]> git.sur5r.net Git - openldap/blob - configure
Import latest changes from devel including removal of CLDAP and BDB2 cruft
[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 (auto)"
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="auto"
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 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
2265         if test $ol_with_kerberos != auto ; then
2266                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2267         else
2268                 ol_with_kerberos=no
2269         fi
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_link_spasswd=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 for ac_func in getaddrinfo 
3938 do
3939 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3940 echo "configure:3941: checking for $ac_func" >&5
3941 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
3942   echo $ac_n "(cached) $ac_c" 1>&6
3943 else
3944   cat > conftest.$ac_ext <<EOF
3945 #line 3946 "configure"
3946 #include "confdefs.h"
3947 /* System header to define __stub macros and hopefully few prototypes,
3948     which can conflict with char $ac_func(); below.  */
3949 #include <assert.h>
3950 /* Override any gcc2 internal prototype to avoid an error.  */
3951 /* We use char because int might match the return type of a gcc2
3952     builtin and then its argument prototype would still apply.  */
3953 char $ac_func();
3954 char (*f)();
3955
3956 int main() {
3957
3958 /* The GNU C library defines this for functions which it implements
3959     to always fail with ENOSYS.  Some functions are actually named
3960     something starting with __ and the normal name is an alias.  */
3961 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3962 choke me
3963 #else
3964 f = $ac_func;
3965 #endif
3966
3967 ; return 0; }
3968 EOF
3969 if { (eval echo configure:3970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3970   rm -rf conftest*
3971   eval "ac_cv_func_$ac_func=yes"
3972 else
3973   echo "configure: failed program was:" >&5
3974   cat conftest.$ac_ext >&5
3975   rm -rf conftest*
3976   eval "ac_cv_func_$ac_func=no"
3977 fi
3978 rm -f conftest*
3979 fi
3980
3981 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3982   echo "$ac_t""yes" 1>&6
3983     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3984   cat >> confdefs.h <<EOF
3985 #define $ac_tr_func 1
3986 EOF
3987  
3988 else
3989   echo "$ac_t""no" 1>&6
3990 fi
3991 done
3992
3993
3994 if test $ac_cv_func_getaddrinfo = no ; then
3995         if test $ol_enable_ipv6 = yes ; then
3996                 { echo "configure: error: IPv6 support requires getaddrinfo()" 1>&2; exit 1; }
3997         fi
3998         ol_enable_ipv6=no
3999 fi
4000
4001 if test $ol_enable_local != no ; then
4002         for ac_hdr in sys/un.h 
4003 do
4004 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4005 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4006 echo "configure:4007: checking for $ac_hdr" >&5
4007 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4008   echo $ac_n "(cached) $ac_c" 1>&6
4009 else
4010   cat > conftest.$ac_ext <<EOF
4011 #line 4012 "configure"
4012 #include "confdefs.h"
4013 #include <$ac_hdr>
4014 EOF
4015 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4016 { (eval echo configure:4017: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4017 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4018 if test -z "$ac_err"; then
4019   rm -rf conftest*
4020   eval "ac_cv_header_$ac_safe=yes"
4021 else
4022   echo "$ac_err" >&5
4023   echo "configure: failed program was:" >&5
4024   cat conftest.$ac_ext >&5
4025   rm -rf conftest*
4026   eval "ac_cv_header_$ac_safe=no"
4027 fi
4028 rm -f conftest*
4029 fi
4030 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4031   echo "$ac_t""yes" 1>&6
4032     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4033   cat >> confdefs.h <<EOF
4034 #define $ac_tr_hdr 1
4035 EOF
4036  
4037 else
4038   echo "$ac_t""no" 1>&6
4039 fi
4040 done
4041
4042
4043         if test $ol_enable_local = auto ; then
4044                 ol_enable_local=$ac_cv_header_sys_un_h
4045         elif test $ac_cv_header_sys_un_h = no ; then
4046                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
4047         fi
4048 fi
4049
4050 ol_link_modules=no
4051 if test $ol_enable_modules != no ; then
4052         for ac_hdr in ltdl.h
4053 do
4054 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4055 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4056 echo "configure:4057: checking for $ac_hdr" >&5
4057 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4058   echo $ac_n "(cached) $ac_c" 1>&6
4059 else
4060   cat > conftest.$ac_ext <<EOF
4061 #line 4062 "configure"
4062 #include "confdefs.h"
4063 #include <$ac_hdr>
4064 EOF
4065 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4066 { (eval echo configure:4067: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4067 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4068 if test -z "$ac_err"; then
4069   rm -rf conftest*
4070   eval "ac_cv_header_$ac_safe=yes"
4071 else
4072   echo "$ac_err" >&5
4073   echo "configure: failed program was:" >&5
4074   cat conftest.$ac_ext >&5
4075   rm -rf conftest*
4076   eval "ac_cv_header_$ac_safe=no"
4077 fi
4078 rm -f conftest*
4079 fi
4080 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4081   echo "$ac_t""yes" 1>&6
4082     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4083   cat >> confdefs.h <<EOF
4084 #define $ac_tr_hdr 1
4085 EOF
4086  
4087 else
4088   echo "$ac_t""no" 1>&6
4089 fi
4090 done
4091
4092
4093         if test $ac_cv_header_ltdl_h = no ; then
4094                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
4095         fi
4096
4097         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
4098 echo "configure:4099: checking for lt_dlinit in -lltdl" >&5
4099 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
4100 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4101   echo $ac_n "(cached) $ac_c" 1>&6
4102 else
4103   ac_save_LIBS="$LIBS"
4104 LIBS="-lltdl  $LIBS"
4105 cat > conftest.$ac_ext <<EOF
4106 #line 4107 "configure"
4107 #include "confdefs.h"
4108 /* Override any gcc2 internal prototype to avoid an error.  */
4109 /* We use char because int might match the return type of a gcc2
4110     builtin and then its argument prototype would still apply.  */
4111 char lt_dlinit();
4112
4113 int main() {
4114 lt_dlinit()
4115 ; return 0; }
4116 EOF
4117 if { (eval echo configure:4118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4118   rm -rf conftest*
4119   eval "ac_cv_lib_$ac_lib_var=yes"
4120 else
4121   echo "configure: failed program was:" >&5
4122   cat conftest.$ac_ext >&5
4123   rm -rf conftest*
4124   eval "ac_cv_lib_$ac_lib_var=no"
4125 fi
4126 rm -f conftest*
4127 LIBS="$ac_save_LIBS"
4128
4129 fi
4130 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4131   echo "$ac_t""yes" 1>&6
4132   
4133             MODULES_LIBS=-lltdl
4134             cat >> confdefs.h <<\EOF
4135 #define HAVE_LIBLTDL 1
4136 EOF
4137
4138         
4139 else
4140   echo "$ac_t""no" 1>&6
4141 fi
4142
4143
4144         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
4145                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
4146         fi
4147         ol_link_modules=yes
4148 else
4149         ol_with_dnssrv_module=static
4150         ol_with_ldap_module=static
4151         ol_with_ldbm_module=static
4152         ol_with_passwd_module=static
4153         ol_with_shell_module=static
4154         ol_with_sql_module=static
4155 fi
4156
4157 # test for EBCDIC
4158 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
4159 echo "configure:4160: checking for EBCDIC" >&5
4160 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
4161   echo $ac_n "(cached) $ac_c" 1>&6
4162 else
4163   
4164         cat > conftest.$ac_ext <<EOF
4165 #line 4166 "configure"
4166 #include "confdefs.h"
4167
4168 #if !('M' == 0xd4)
4169 #include <__ASCII__/generate_error.h>
4170 #endif
4171
4172 EOF
4173 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4174 { (eval echo configure:4175: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4175 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4176 if test -z "$ac_err"; then
4177   rm -rf conftest*
4178   ol_cv_cpp_ebcdic=yes
4179 else
4180   echo "$ac_err" >&5
4181   echo "configure: failed program was:" >&5
4182   cat conftest.$ac_ext >&5
4183   rm -rf conftest*
4184   ol_cv_cpp_ebcdic=no
4185 fi
4186 rm -f conftest*
4187 fi
4188
4189 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
4190 if test $ol_cv_cpp_ebcdic = yes ; then
4191         cat >> confdefs.h <<\EOF
4192 #define HAVE_EBCDIC 1
4193 EOF
4194
4195 fi
4196
4197 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
4198 echo "configure:4199: checking for ANSI C header files" >&5
4199 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
4200   echo $ac_n "(cached) $ac_c" 1>&6
4201 else
4202   cat > conftest.$ac_ext <<EOF
4203 #line 4204 "configure"
4204 #include "confdefs.h"
4205 #include <stdlib.h>
4206 #include <stdarg.h>
4207 #include <string.h>
4208 #include <float.h>
4209 EOF
4210 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4211 { (eval echo configure:4212: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4212 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4213 if test -z "$ac_err"; then
4214   rm -rf conftest*
4215   ol_cv_header_stdc=yes
4216 else
4217   echo "$ac_err" >&5
4218   echo "configure: failed program was:" >&5
4219   cat conftest.$ac_ext >&5
4220   rm -rf conftest*
4221   ol_cv_header_stdc=no
4222 fi
4223 rm -f conftest*
4224
4225 if test $ol_cv_header_stdc = yes; then
4226   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4227 cat > conftest.$ac_ext <<EOF
4228 #line 4229 "configure"
4229 #include "confdefs.h"
4230 #include <string.h>
4231 EOF
4232 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4233   egrep "memchr" >/dev/null 2>&1; then
4234   :
4235 else
4236   rm -rf conftest*
4237   ol_cv_header_stdc=no
4238 fi
4239 rm -f conftest*
4240
4241 fi
4242
4243 if test $ol_cv_header_stdc = yes; then
4244   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4245 cat > conftest.$ac_ext <<EOF
4246 #line 4247 "configure"
4247 #include "confdefs.h"
4248 #include <stdlib.h>
4249 EOF
4250 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4251   egrep "free" >/dev/null 2>&1; then
4252   :
4253 else
4254   rm -rf conftest*
4255   ol_cv_header_stdc=no
4256 fi
4257 rm -f conftest*
4258
4259 fi
4260
4261 if test $ol_cv_header_stdc = yes; then
4262   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4263 if test "$cross_compiling" = yes; then
4264   :
4265 else
4266   cat > conftest.$ac_ext <<EOF
4267 #line 4268 "configure"
4268 #include "confdefs.h"
4269 #include <ctype.h>
4270 #ifndef HAVE_EBCDIC
4271 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4272 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4273 #else
4274 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
4275                 || ('j' <= (c) && (c) <= 'r') \
4276                 || ('s' <= (c) && (c) <= 'z'))
4277 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
4278 #endif
4279 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4280 int main () { int i; for (i = 0; i < 256; i++)
4281 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4282 exit (0); }
4283
4284 EOF
4285 if { (eval echo configure:4286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4286 then
4287   :
4288 else
4289   echo "configure: failed program was:" >&5
4290   cat conftest.$ac_ext >&5
4291   rm -fr conftest*
4292   ol_cv_header_stdc=no
4293 fi
4294 rm -fr conftest*
4295 fi
4296
4297 fi
4298 fi
4299
4300 echo "$ac_t""$ol_cv_header_stdc" 1>&6
4301 if test $ol_cv_header_stdc = yes; then
4302   cat >> confdefs.h <<\EOF
4303 #define STDC_HEADERS 1
4304 EOF
4305
4306 fi
4307 ac_cv_header_stdc=disable
4308
4309
4310 if test $ol_cv_header_stdc != yes; then
4311         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
4312 fi
4313
4314 ac_header_dirent=no
4315 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4316 do
4317 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4318 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4319 echo "configure:4320: checking for $ac_hdr that defines DIR" >&5
4320 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
4321   echo $ac_n "(cached) $ac_c" 1>&6
4322 else
4323   cat > conftest.$ac_ext <<EOF
4324 #line 4325 "configure"
4325 #include "confdefs.h"
4326 #include <sys/types.h>
4327 #include <$ac_hdr>
4328 int main() {
4329 DIR *dirp = 0;
4330 ; return 0; }
4331 EOF
4332 if { (eval echo configure:4333: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4333   rm -rf conftest*
4334   eval "ac_cv_header_dirent_$ac_safe=yes"
4335 else
4336   echo "configure: failed program was:" >&5
4337   cat conftest.$ac_ext >&5
4338   rm -rf conftest*
4339   eval "ac_cv_header_dirent_$ac_safe=no"
4340 fi
4341 rm -f conftest*
4342 fi
4343 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4344   echo "$ac_t""yes" 1>&6
4345     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4346   cat >> confdefs.h <<EOF
4347 #define $ac_tr_hdr 1
4348 EOF
4349  ac_header_dirent=$ac_hdr; break
4350 else
4351   echo "$ac_t""no" 1>&6
4352 fi
4353 done
4354 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4355 if test $ac_header_dirent = dirent.h; then
4356 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4357 echo "configure:4358: checking for opendir in -ldir" >&5
4358 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
4359 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4360   echo $ac_n "(cached) $ac_c" 1>&6
4361 else
4362   ac_save_LIBS="$LIBS"
4363 LIBS="-ldir  $LIBS"
4364 cat > conftest.$ac_ext <<EOF
4365 #line 4366 "configure"
4366 #include "confdefs.h"
4367 /* Override any gcc2 internal prototype to avoid an error.  */
4368 /* We use char because int might match the return type of a gcc2
4369     builtin and then its argument prototype would still apply.  */
4370 char opendir();
4371
4372 int main() {
4373 opendir()
4374 ; return 0; }
4375 EOF
4376 if { (eval echo configure:4377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4377   rm -rf conftest*
4378   eval "ac_cv_lib_$ac_lib_var=yes"
4379 else
4380   echo "configure: failed program was:" >&5
4381   cat conftest.$ac_ext >&5
4382   rm -rf conftest*
4383   eval "ac_cv_lib_$ac_lib_var=no"
4384 fi
4385 rm -f conftest*
4386 LIBS="$ac_save_LIBS"
4387
4388 fi
4389 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4390   echo "$ac_t""yes" 1>&6
4391   LIBS="$LIBS -ldir"
4392 else
4393   echo "$ac_t""no" 1>&6
4394 fi
4395
4396 else
4397 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4398 echo "configure:4399: checking for opendir in -lx" >&5
4399 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
4400 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4401   echo $ac_n "(cached) $ac_c" 1>&6
4402 else
4403   ac_save_LIBS="$LIBS"
4404 LIBS="-lx  $LIBS"
4405 cat > conftest.$ac_ext <<EOF
4406 #line 4407 "configure"
4407 #include "confdefs.h"
4408 /* Override any gcc2 internal prototype to avoid an error.  */
4409 /* We use char because int might match the return type of a gcc2
4410     builtin and then its argument prototype would still apply.  */
4411 char opendir();
4412
4413 int main() {
4414 opendir()
4415 ; return 0; }
4416 EOF
4417 if { (eval echo configure:4418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4418   rm -rf conftest*
4419   eval "ac_cv_lib_$ac_lib_var=yes"
4420 else
4421   echo "configure: failed program was:" >&5
4422   cat conftest.$ac_ext >&5
4423   rm -rf conftest*
4424   eval "ac_cv_lib_$ac_lib_var=no"
4425 fi
4426 rm -f conftest*
4427 LIBS="$ac_save_LIBS"
4428
4429 fi
4430 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4431   echo "$ac_t""yes" 1>&6
4432   LIBS="$LIBS -lx"
4433 else
4434   echo "$ac_t""no" 1>&6
4435 fi
4436
4437 fi
4438
4439 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4440 echo "configure:4441: checking for sys/wait.h that is POSIX.1 compatible" >&5
4441 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
4442   echo $ac_n "(cached) $ac_c" 1>&6
4443 else
4444   cat > conftest.$ac_ext <<EOF
4445 #line 4446 "configure"
4446 #include "confdefs.h"
4447 #include <sys/types.h>
4448 #include <sys/wait.h>
4449 #ifndef WEXITSTATUS
4450 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
4451 #endif
4452 #ifndef WIFEXITED
4453 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
4454 #endif
4455 int main() {
4456 int s;
4457 wait (&s);
4458 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
4459 ; return 0; }
4460 EOF
4461 if { (eval echo configure:4462: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4462   rm -rf conftest*
4463   ac_cv_header_sys_wait_h=yes
4464 else
4465   echo "configure: failed program was:" >&5
4466   cat conftest.$ac_ext >&5
4467   rm -rf conftest*
4468   ac_cv_header_sys_wait_h=no
4469 fi
4470 rm -f conftest*
4471 fi
4472
4473 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4474 if test $ac_cv_header_sys_wait_h = yes; then
4475   cat >> confdefs.h <<\EOF
4476 #define HAVE_SYS_WAIT_H 1
4477 EOF
4478
4479 fi
4480
4481 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
4482 echo "configure:4483: checking POSIX termios" >&5
4483 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
4484   echo $ac_n "(cached) $ac_c" 1>&6
4485 else
4486   cat > conftest.$ac_ext <<EOF
4487 #line 4488 "configure"
4488 #include "confdefs.h"
4489 #include <sys/types.h>
4490 #include <unistd.h>
4491 #include <termios.h>
4492 int main() {
4493 /* SunOS 4.0.3 has termios.h but not the library calls.  */
4494    tcgetattr(0, 0);
4495 ; return 0; }
4496 EOF
4497 if { (eval echo configure:4498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4498   rm -rf conftest*
4499   am_cv_sys_posix_termios=yes
4500 else
4501   echo "configure: failed program was:" >&5
4502   cat conftest.$ac_ext >&5
4503   rm -rf conftest*
4504   am_cv_sys_posix_termios=no
4505 fi
4506 rm -f conftest*
4507 fi
4508
4509 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
4510
4511
4512  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
4513 echo "configure:4514: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
4514 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
4515   echo $ac_n "(cached) $ac_c" 1>&6
4516 else
4517   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
4518
4519   gwinsz_in_termios_h=no
4520   if test $am_cv_sys_posix_termios = yes; then
4521     cat > conftest.$ac_ext <<EOF
4522 #line 4523 "configure"
4523 #include "confdefs.h"
4524 #include <sys/types.h>
4525 #     include <termios.h>
4526 #     ifdef TIOCGWINSZ
4527         yes
4528 #     endif
4529     
4530 EOF
4531 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4532   egrep "yes" >/dev/null 2>&1; then
4533   rm -rf conftest*
4534   gwinsz_in_termios_h=yes
4535 fi
4536 rm -f conftest*
4537
4538   fi
4539
4540   if test $gwinsz_in_termios_h = no; then
4541     cat > conftest.$ac_ext <<EOF
4542 #line 4543 "configure"
4543 #include "confdefs.h"
4544 #include <sys/types.h>
4545 #     include <sys/ioctl.h>
4546 #     ifdef TIOCGWINSZ
4547         yes
4548 #     endif
4549     
4550 EOF
4551 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4552   egrep "yes" >/dev/null 2>&1; then
4553   rm -rf conftest*
4554   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
4555 fi
4556 rm -f conftest*
4557
4558   fi
4559   
4560 fi
4561
4562 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
4563   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
4564     cat >> confdefs.h <<\EOF
4565 #define GWINSZ_IN_SYS_IOCTL 1
4566 EOF
4567
4568   fi
4569
4570 if test $am_cv_sys_posix_termios = yes ; then
4571         cat >> confdefs.h <<\EOF
4572 #define HAVE_POSIX_TERMIOS 1
4573 EOF
4574
4575 fi
4576
4577 for ac_hdr in \
4578         arpa/inet.h             \
4579         arpa/nameser.h  \
4580         assert.h                \
4581         conio.h                 \
4582         crypt.h                 \
4583         direct.h                \
4584         errno.h                 \
4585         fcntl.h                 \
4586         filio.h                 \
4587         getopt.h                \
4588         grp.h                   \
4589         io.h                    \
4590         libutil.h               \
4591         limits.h                \
4592         locale.h                \
4593         netinet/tcp.h   \
4594         malloc.h                \
4595         memory.h                \
4596         psap.h                  \
4597         pwd.h                   \
4598         process.h               \
4599         resolv.h                \
4600         sgtty.h                 \
4601         shadow.h                \
4602         stddef.h                \
4603         string.h                \
4604         strings.h               \
4605         sysexits.h              \
4606         sys/file.h              \
4607         sys/filio.h             \
4608         sys/errno.h             \
4609         sys/ioctl.h             \
4610         sys/param.h             \
4611         sys/resource.h  \
4612         sys/select.h    \
4613         sys/socket.h    \
4614         sys/syslog.h    \
4615         sys/time.h              \
4616         sys/types.h             \
4617         syslog.h                \
4618         termios.h               \
4619         unistd.h                \
4620         winsock.h               \
4621
4622 do
4623 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4624 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4625 echo "configure:4626: checking for $ac_hdr" >&5
4626 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4627   echo $ac_n "(cached) $ac_c" 1>&6
4628 else
4629   cat > conftest.$ac_ext <<EOF
4630 #line 4631 "configure"
4631 #include "confdefs.h"
4632 #include <$ac_hdr>
4633 EOF
4634 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4635 { (eval echo configure:4636: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4636 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4637 if test -z "$ac_err"; then
4638   rm -rf conftest*
4639   eval "ac_cv_header_$ac_safe=yes"
4640 else
4641   echo "$ac_err" >&5
4642   echo "configure: failed program was:" >&5
4643   cat conftest.$ac_ext >&5
4644   rm -rf conftest*
4645   eval "ac_cv_header_$ac_safe=no"
4646 fi
4647 rm -f conftest*
4648 fi
4649 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4650   echo "$ac_t""yes" 1>&6
4651     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4652   cat >> confdefs.h <<EOF
4653 #define $ac_tr_hdr 1
4654 EOF
4655  
4656 else
4657   echo "$ac_t""no" 1>&6
4658 fi
4659 done
4660
4661
4662
4663
4664 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
4665 echo "configure:4666: checking for sigset in -lV3" >&5
4666 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
4667 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4668   echo $ac_n "(cached) $ac_c" 1>&6
4669 else
4670   ac_save_LIBS="$LIBS"
4671 LIBS="-lV3  $LIBS"
4672 cat > conftest.$ac_ext <<EOF
4673 #line 4674 "configure"
4674 #include "confdefs.h"
4675 /* Override any gcc2 internal prototype to avoid an error.  */
4676 /* We use char because int might match the return type of a gcc2
4677     builtin and then its argument prototype would still apply.  */
4678 char sigset();
4679
4680 int main() {
4681 sigset()
4682 ; return 0; }
4683 EOF
4684 if { (eval echo configure:4685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4685   rm -rf conftest*
4686   eval "ac_cv_lib_$ac_lib_var=yes"
4687 else
4688   echo "configure: failed program was:" >&5
4689   cat conftest.$ac_ext >&5
4690   rm -rf conftest*
4691   eval "ac_cv_lib_$ac_lib_var=no"
4692 fi
4693 rm -f conftest*
4694 LIBS="$ac_save_LIBS"
4695
4696 fi
4697 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4698   echo "$ac_t""yes" 1>&6
4699     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4700     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4701   cat >> confdefs.h <<EOF
4702 #define $ac_tr_lib 1
4703 EOF
4704
4705   LIBS="-lV3 $LIBS"
4706
4707 else
4708   echo "$ac_t""no" 1>&6
4709 fi
4710
4711
4712 if test $ac_cv_header_winsock_h = yes; then
4713         echo $ac_n "checking for winsock""... $ac_c" 1>&6
4714 echo "configure:4715: checking for winsock" >&5
4715 if eval "test \"\${ol_cv_winsock+set}\" = set"; then
4716   echo $ac_n "(cached) $ac_c" 1>&6
4717 else
4718   cat > conftest.$ac_ext <<EOF
4719 #line 4720 "configure"
4720 #include "confdefs.h"
4721 #include <winsock.h>
4722 int main() {
4723
4724                         socket(0,0,0);
4725                         select(0,NULL,NULL,NULL,NULL);
4726                         closesocket(0);
4727                         gethostname(NULL,0);
4728         
4729 ; return 0; }
4730 EOF
4731 if { (eval echo configure:4732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4732   rm -rf conftest*
4733   ol_cv_winsock=yes
4734 else
4735   echo "configure: failed program was:" >&5
4736   cat conftest.$ac_ext >&5
4737   rm -rf conftest*
4738   ol_cv_winsock=no
4739 fi
4740 rm -f conftest*]
4741 fi
4742
4743 echo "$ac_t""$ol_cv_winsock" 1>&6
4744
4745         if test $ol_cv_winsock = yes ; then
4746                 cat >> confdefs.h <<\EOF
4747 #define HAVE_WINSOCK 1
4748 EOF
4749
4750                 ac_cv_func_socket=yes
4751                 ac_cv_func_select=yes
4752                 ac_cv_func_closesocket=yes
4753                 ac_cv_func_gethostname=yes
4754         fi
4755 fi
4756
4757
4758 echo $ac_n "checking for socket""... $ac_c" 1>&6
4759 echo "configure:4760: checking for socket" >&5
4760 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
4761   echo $ac_n "(cached) $ac_c" 1>&6
4762 else
4763   cat > conftest.$ac_ext <<EOF
4764 #line 4765 "configure"
4765 #include "confdefs.h"
4766 /* System header to define __stub macros and hopefully few prototypes,
4767     which can conflict with char socket(); below.  */
4768 #include <assert.h>
4769 /* Override any gcc2 internal prototype to avoid an error.  */
4770 /* We use char because int might match the return type of a gcc2
4771     builtin and then its argument prototype would still apply.  */
4772 char socket();
4773 char (*f)();
4774
4775 int main() {
4776
4777 /* The GNU C library defines this for functions which it implements
4778     to always fail with ENOSYS.  Some functions are actually named
4779     something starting with __ and the normal name is an alias.  */
4780 #if defined (__stub_socket) || defined (__stub___socket)
4781 choke me
4782 #else
4783 f = socket;
4784 #endif
4785
4786 ; return 0; }
4787 EOF
4788 if { (eval echo configure:4789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4789   rm -rf conftest*
4790   eval "ac_cv_func_socket=yes"
4791 else
4792   echo "configure: failed program was:" >&5
4793   cat conftest.$ac_ext >&5
4794   rm -rf conftest*
4795   eval "ac_cv_func_socket=no"
4796 fi
4797 rm -f conftest*
4798 fi
4799
4800 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
4801   echo "$ac_t""yes" 1>&6
4802   :
4803 else
4804   echo "$ac_t""no" 1>&6
4805         
4806         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
4807 echo "configure:4808: checking for main in -lsocket" >&5
4808 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
4809 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4810   echo $ac_n "(cached) $ac_c" 1>&6
4811 else
4812   ac_save_LIBS="$LIBS"
4813 LIBS="-lsocket  $LIBS"
4814 cat > conftest.$ac_ext <<EOF
4815 #line 4816 "configure"
4816 #include "confdefs.h"
4817
4818 int main() {
4819 main()
4820 ; return 0; }
4821 EOF
4822 if { (eval echo configure:4823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4823   rm -rf conftest*
4824   eval "ac_cv_lib_$ac_lib_var=yes"
4825 else
4826   echo "configure: failed program was:" >&5
4827   cat conftest.$ac_ext >&5
4828   rm -rf conftest*
4829   eval "ac_cv_lib_$ac_lib_var=no"
4830 fi
4831 rm -f conftest*
4832 LIBS="$ac_save_LIBS"
4833
4834 fi
4835 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4836   echo "$ac_t""yes" 1>&6
4837     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4838     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4839   cat >> confdefs.h <<EOF
4840 #define $ac_tr_lib 1
4841 EOF
4842
4843   LIBS="-lsocket $LIBS"
4844
4845 else
4846   echo "$ac_t""no" 1>&6
4847 fi
4848
4849         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
4850 echo "configure:4851: checking for main in -lnet" >&5
4851 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
4852 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4853   echo $ac_n "(cached) $ac_c" 1>&6
4854 else
4855   ac_save_LIBS="$LIBS"
4856 LIBS="-lnet  $LIBS"
4857 cat > conftest.$ac_ext <<EOF
4858 #line 4859 "configure"
4859 #include "confdefs.h"
4860
4861 int main() {
4862 main()
4863 ; return 0; }
4864 EOF
4865 if { (eval echo configure:4866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4866   rm -rf conftest*
4867   eval "ac_cv_lib_$ac_lib_var=yes"
4868 else
4869   echo "configure: failed program was:" >&5
4870   cat conftest.$ac_ext >&5
4871   rm -rf conftest*
4872   eval "ac_cv_lib_$ac_lib_var=no"
4873 fi
4874 rm -f conftest*
4875 LIBS="$ac_save_LIBS"
4876
4877 fi
4878 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4879   echo "$ac_t""yes" 1>&6
4880     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4881     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4882   cat >> confdefs.h <<EOF
4883 #define $ac_tr_lib 1
4884 EOF
4885
4886   LIBS="-lnet $LIBS"
4887
4888 else
4889   echo "$ac_t""no" 1>&6
4890 fi
4891
4892         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
4893 echo "configure:4894: checking for main in -lnsl_s" >&5
4894 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
4895 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4896   echo $ac_n "(cached) $ac_c" 1>&6
4897 else
4898   ac_save_LIBS="$LIBS"
4899 LIBS="-lnsl_s  $LIBS"
4900 cat > conftest.$ac_ext <<EOF
4901 #line 4902 "configure"
4902 #include "confdefs.h"
4903
4904 int main() {
4905 main()
4906 ; return 0; }
4907 EOF
4908 if { (eval echo configure:4909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4909   rm -rf conftest*
4910   eval "ac_cv_lib_$ac_lib_var=yes"
4911 else
4912   echo "configure: failed program was:" >&5
4913   cat conftest.$ac_ext >&5
4914   rm -rf conftest*
4915   eval "ac_cv_lib_$ac_lib_var=no"
4916 fi
4917 rm -f conftest*
4918 LIBS="$ac_save_LIBS"
4919
4920 fi
4921 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4922   echo "$ac_t""yes" 1>&6
4923     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4924     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4925   cat >> confdefs.h <<EOF
4926 #define $ac_tr_lib 1
4927 EOF
4928
4929   LIBS="-lnsl_s $LIBS"
4930
4931 else
4932   echo "$ac_t""no" 1>&6
4933 fi
4934
4935         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
4936 echo "configure:4937: checking for main in -lnsl" >&5
4937 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
4938 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4939   echo $ac_n "(cached) $ac_c" 1>&6
4940 else
4941   ac_save_LIBS="$LIBS"
4942 LIBS="-lnsl  $LIBS"
4943 cat > conftest.$ac_ext <<EOF
4944 #line 4945 "configure"
4945 #include "confdefs.h"
4946
4947 int main() {
4948 main()
4949 ; return 0; }
4950 EOF
4951 if { (eval echo configure:4952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4952   rm -rf conftest*
4953   eval "ac_cv_lib_$ac_lib_var=yes"
4954 else
4955   echo "configure: failed program was:" >&5
4956   cat conftest.$ac_ext >&5
4957   rm -rf conftest*
4958   eval "ac_cv_lib_$ac_lib_var=no"
4959 fi
4960 rm -f conftest*
4961 LIBS="$ac_save_LIBS"
4962
4963 fi
4964 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4965   echo "$ac_t""yes" 1>&6
4966     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4967     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4968   cat >> confdefs.h <<EOF
4969 #define $ac_tr_lib 1
4970 EOF
4971
4972   LIBS="-lnsl $LIBS"
4973
4974 else
4975   echo "$ac_t""no" 1>&6
4976 fi
4977
4978         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
4979 echo "configure:4980: checking for socket in -linet" >&5
4980 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
4981 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4982   echo $ac_n "(cached) $ac_c" 1>&6
4983 else
4984   ac_save_LIBS="$LIBS"
4985 LIBS="-linet  $LIBS"
4986 cat > conftest.$ac_ext <<EOF
4987 #line 4988 "configure"
4988 #include "confdefs.h"
4989 /* Override any gcc2 internal prototype to avoid an error.  */
4990 /* We use char because int might match the return type of a gcc2
4991     builtin and then its argument prototype would still apply.  */
4992 char socket();
4993
4994 int main() {
4995 socket()
4996 ; return 0; }
4997 EOF
4998 if { (eval echo configure:4999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4999   rm -rf conftest*
5000   eval "ac_cv_lib_$ac_lib_var=yes"
5001 else
5002   echo "configure: failed program was:" >&5
5003   cat conftest.$ac_ext >&5
5004   rm -rf conftest*
5005   eval "ac_cv_lib_$ac_lib_var=no"
5006 fi
5007 rm -f conftest*
5008 LIBS="$ac_save_LIBS"
5009
5010 fi
5011 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5012   echo "$ac_t""yes" 1>&6
5013     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5014     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5015   cat >> confdefs.h <<EOF
5016 #define $ac_tr_lib 1
5017 EOF
5018
5019   LIBS="-linet $LIBS"
5020
5021 else
5022   echo "$ac_t""no" 1>&6
5023 fi
5024
5025         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
5026 echo "configure:5027: checking for main in -lgen" >&5
5027 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
5028 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5029   echo $ac_n "(cached) $ac_c" 1>&6
5030 else
5031   ac_save_LIBS="$LIBS"
5032 LIBS="-lgen  $LIBS"
5033 cat > conftest.$ac_ext <<EOF
5034 #line 5035 "configure"
5035 #include "confdefs.h"
5036
5037 int main() {
5038 main()
5039 ; return 0; }
5040 EOF
5041 if { (eval echo configure:5042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5042   rm -rf conftest*
5043   eval "ac_cv_lib_$ac_lib_var=yes"
5044 else
5045   echo "configure: failed program was:" >&5
5046   cat conftest.$ac_ext >&5
5047   rm -rf conftest*
5048   eval "ac_cv_lib_$ac_lib_var=no"
5049 fi
5050 rm -f conftest*
5051 LIBS="$ac_save_LIBS"
5052
5053 fi
5054 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5055   echo "$ac_t""yes" 1>&6
5056     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5057     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5058   cat >> confdefs.h <<EOF
5059 #define $ac_tr_lib 1
5060 EOF
5061
5062   LIBS="-lgen $LIBS"
5063
5064 else
5065   echo "$ac_t""no" 1>&6
5066 fi
5067
5068
5069 fi
5070
5071
5072 echo $ac_n "checking for select""... $ac_c" 1>&6
5073 echo "configure:5074: checking for select" >&5
5074 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
5075   echo $ac_n "(cached) $ac_c" 1>&6
5076 else
5077   cat > conftest.$ac_ext <<EOF
5078 #line 5079 "configure"
5079 #include "confdefs.h"
5080 /* System header to define __stub macros and hopefully few prototypes,
5081     which can conflict with char select(); below.  */
5082 #include <assert.h>
5083 /* Override any gcc2 internal prototype to avoid an error.  */
5084 /* We use char because int might match the return type of a gcc2
5085     builtin and then its argument prototype would still apply.  */
5086 char select();
5087 char (*f)();
5088
5089 int main() {
5090
5091 /* The GNU C library defines this for functions which it implements
5092     to always fail with ENOSYS.  Some functions are actually named
5093     something starting with __ and the normal name is an alias.  */
5094 #if defined (__stub_select) || defined (__stub___select)
5095 choke me
5096 #else
5097 f = select;
5098 #endif
5099
5100 ; return 0; }
5101 EOF
5102 if { (eval echo configure:5103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5103   rm -rf conftest*
5104   eval "ac_cv_func_select=yes"
5105 else
5106   echo "configure: failed program was:" >&5
5107   cat conftest.$ac_ext >&5
5108   rm -rf conftest*
5109   eval "ac_cv_func_select=no"
5110 fi
5111 rm -f conftest*
5112 fi
5113
5114 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
5115   echo "$ac_t""yes" 1>&6
5116   :
5117 else
5118   echo "$ac_t""no" 1>&6
5119 { echo "configure: error: select() required." 1>&2; exit 1; }
5120 fi
5121
5122
5123 if test "${ac_cv_header_winsock_h}" != yes; then
5124                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
5125 echo "configure:5126: checking types of arguments for select()" >&5
5126  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
5127   echo $ac_n "(cached) $ac_c" 1>&6
5128 else
5129    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
5130   echo $ac_n "(cached) $ac_c" 1>&6
5131 else
5132     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
5133   echo $ac_n "(cached) $ac_c" 1>&6
5134 else
5135      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
5136      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
5137       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
5138        cat > conftest.$ac_ext <<EOF
5139 #line 5140 "configure"
5140 #include "confdefs.h"
5141 #ifdef HAVE_SYS_TYPES_H
5142 #include <sys/types.h>
5143 #endif
5144 #ifdef HAVE_SYS_TIME_H
5145 #include <sys/time.h>
5146 #endif
5147 #ifdef HAVE_SYS_SELECT_H
5148 #include <sys/select.h>
5149 #endif
5150 #ifdef HAVE_SYS_SOCKET_H
5151 #include <sys/socket.h>
5152 #endif
5153 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);
5154 int main() {
5155
5156 ; return 0; }
5157 EOF
5158 if { (eval echo configure:5159: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5159   rm -rf conftest*
5160           ac_not_found=no ; break 3
5161 else
5162   echo "configure: failed program was:" >&5
5163   cat conftest.$ac_ext >&5
5164   rm -rf conftest*
5165   ac_not_found=yes
5166 fi
5167 rm -f conftest*
5168       done
5169      done
5170     done
5171    
5172 fi
5173   
5174 fi
5175  
5176 fi
5177  if test "$ac_not_found" = yes; then
5178   ac_cv_func_select_arg1=int 
5179   ac_cv_func_select_arg234='int *' 
5180   ac_cv_func_select_arg5='struct timeval *'
5181  fi
5182  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
5183  cat >> confdefs.h <<EOF
5184 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
5185 EOF
5186
5187  cat >> confdefs.h <<EOF
5188 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
5189 EOF
5190
5191  cat >> confdefs.h <<EOF
5192 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
5193 EOF
5194
5195
5196 fi
5197
5198
5199 for ac_hdr in regex.h 
5200 do
5201 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5202 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5203 echo "configure:5204: checking for $ac_hdr" >&5
5204 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5205   echo $ac_n "(cached) $ac_c" 1>&6
5206 else
5207   cat > conftest.$ac_ext <<EOF
5208 #line 5209 "configure"
5209 #include "confdefs.h"
5210 #include <$ac_hdr>
5211 EOF
5212 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5213 { (eval echo configure:5214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5214 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5215 if test -z "$ac_err"; then
5216   rm -rf conftest*
5217   eval "ac_cv_header_$ac_safe=yes"
5218 else
5219   echo "$ac_err" >&5
5220   echo "configure: failed program was:" >&5
5221   cat conftest.$ac_ext >&5
5222   rm -rf conftest*
5223   eval "ac_cv_header_$ac_safe=no"
5224 fi
5225 rm -f conftest*
5226 fi
5227 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5228   echo "$ac_t""yes" 1>&6
5229     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5230   cat >> confdefs.h <<EOF
5231 #define $ac_tr_hdr 1
5232 EOF
5233  
5234 else
5235   echo "$ac_t""no" 1>&6
5236 fi
5237 done
5238
5239 if test "$ac_cv_header_regex_h" != yes ; then
5240         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
5241 fi
5242 echo $ac_n "checking for regfree""... $ac_c" 1>&6
5243 echo "configure:5244: checking for regfree" >&5
5244 if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then
5245   echo $ac_n "(cached) $ac_c" 1>&6
5246 else
5247   cat > conftest.$ac_ext <<EOF
5248 #line 5249 "configure"
5249 #include "confdefs.h"
5250 /* System header to define __stub macros and hopefully few prototypes,
5251     which can conflict with char regfree(); below.  */
5252 #include <assert.h>
5253 /* Override any gcc2 internal prototype to avoid an error.  */
5254 /* We use char because int might match the return type of a gcc2
5255     builtin and then its argument prototype would still apply.  */
5256 char regfree();
5257 char (*f)();
5258
5259 int main() {
5260
5261 /* The GNU C library defines this for functions which it implements
5262     to always fail with ENOSYS.  Some functions are actually named
5263     something starting with __ and the normal name is an alias.  */
5264 #if defined (__stub_regfree) || defined (__stub___regfree)
5265 choke me
5266 #else
5267 f = regfree;
5268 #endif
5269
5270 ; return 0; }
5271 EOF
5272 if { (eval echo configure:5273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5273   rm -rf conftest*
5274   eval "ac_cv_func_regfree=yes"
5275 else
5276   echo "configure: failed program was:" >&5
5277   cat conftest.$ac_ext >&5
5278   rm -rf conftest*
5279   eval "ac_cv_func_regfree=no"
5280 fi
5281 rm -f conftest*
5282 fi
5283
5284 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
5285   echo "$ac_t""yes" 1>&6
5286   :
5287 else
5288   echo "$ac_t""no" 1>&6
5289 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
5290 fi
5291
5292
5293
5294 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
5295 echo "configure:5296: checking for compatible POSIX regex" >&5
5296 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
5297   echo $ac_n "(cached) $ac_c" 1>&6
5298 else
5299   
5300         if test "$cross_compiling" = yes; then
5301   ol_cv_c_posix_regex=cross
5302 else
5303   cat > conftest.$ac_ext <<EOF
5304 #line 5305 "configure"
5305 #include "confdefs.h"
5306
5307 #include <sys/types.h>
5308 #include <regex.h>
5309 static char *pattern, *string;
5310 main()
5311 {
5312         int rc;
5313         regex_t re;
5314
5315         pattern = "^A";
5316
5317         if(regcomp(&re, pattern, 0)) {
5318                 return -1;
5319         }
5320         
5321         string = "ALL MATCH";
5322         
5323         rc = regexec(&re, string, 0, (void*)0, 0);
5324
5325         regfree(&re);
5326
5327         return rc;
5328 }
5329 EOF
5330 if { (eval echo configure:5331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5331 then
5332   ol_cv_c_posix_regex=yes
5333 else
5334   echo "configure: failed program was:" >&5
5335   cat conftest.$ac_ext >&5
5336   rm -fr conftest*
5337   ol_cv_c_posix_regex=no
5338 fi
5339 rm -fr conftest*
5340 fi
5341
5342 fi
5343
5344 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
5345
5346 if test "$ol_cv_c_posix_regex" = no ; then
5347         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
5348 fi
5349
5350 ol_link_dnssrv=no
5351 echo $ac_n "checking for res_query""... $ac_c" 1>&6
5352 echo "configure:5353: checking for res_query" >&5
5353 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
5354   echo $ac_n "(cached) $ac_c" 1>&6
5355 else
5356   cat > conftest.$ac_ext <<EOF
5357 #line 5358 "configure"
5358 #include "confdefs.h"
5359 /* System header to define __stub macros and hopefully few prototypes,
5360     which can conflict with char res_query(); below.  */
5361 #include <assert.h>
5362 /* Override any gcc2 internal prototype to avoid an error.  */
5363 /* We use char because int might match the return type of a gcc2
5364     builtin and then its argument prototype would still apply.  */
5365 char res_query();
5366 char (*f)();
5367
5368 int main() {
5369
5370 /* The GNU C library defines this for functions which it implements
5371     to always fail with ENOSYS.  Some functions are actually named
5372     something starting with __ and the normal name is an alias.  */
5373 #if defined (__stub_res_query) || defined (__stub___res_query)
5374 choke me
5375 #else
5376 f = res_query;
5377 #endif
5378
5379 ; return 0; }
5380 EOF
5381 if { (eval echo configure:5382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5382   rm -rf conftest*
5383   eval "ac_cv_func_res_query=yes"
5384 else
5385   echo "configure: failed program was:" >&5
5386   cat conftest.$ac_ext >&5
5387   rm -rf conftest*
5388   eval "ac_cv_func_res_query=no"
5389 fi
5390 rm -f conftest*
5391 fi
5392
5393 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
5394   echo "$ac_t""yes" 1>&6
5395   :
5396 else
5397   echo "$ac_t""no" 1>&6
5398 fi
5399
5400 if test $ac_cv_func_res_query = no ; then 
5401         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
5402 echo "configure:5403: checking for res_query in -lbind" >&5
5403 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
5404 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5405   echo $ac_n "(cached) $ac_c" 1>&6
5406 else
5407   ac_save_LIBS="$LIBS"
5408 LIBS="-lbind  $LIBS"
5409 cat > conftest.$ac_ext <<EOF
5410 #line 5411 "configure"
5411 #include "confdefs.h"
5412 /* Override any gcc2 internal prototype to avoid an error.  */
5413 /* We use char because int might match the return type of a gcc2
5414     builtin and then its argument prototype would still apply.  */
5415 char res_query();
5416
5417 int main() {
5418 res_query()
5419 ; return 0; }
5420 EOF
5421 if { (eval echo configure:5422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5422   rm -rf conftest*
5423   eval "ac_cv_lib_$ac_lib_var=yes"
5424 else
5425   echo "configure: failed program was:" >&5
5426   cat conftest.$ac_ext >&5
5427   rm -rf conftest*
5428   eval "ac_cv_lib_$ac_lib_var=no"
5429 fi
5430 rm -f conftest*
5431 LIBS="$ac_save_LIBS"
5432
5433 fi
5434 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5435   echo "$ac_t""yes" 1>&6
5436     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5437     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5438   cat >> confdefs.h <<EOF
5439 #define $ac_tr_lib 1
5440 EOF
5441
5442   LIBS="-lbind $LIBS"
5443
5444 else
5445   echo "$ac_t""no" 1>&6
5446 fi
5447
5448         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
5449 fi
5450
5451 if test $ac_cv_func_res_query = no ; then 
5452         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
5453 echo "configure:5454: checking for __res_query in -lbind" >&5
5454 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
5455 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5456   echo $ac_n "(cached) $ac_c" 1>&6
5457 else
5458   ac_save_LIBS="$LIBS"
5459 LIBS="-lbind  $LIBS"
5460 cat > conftest.$ac_ext <<EOF
5461 #line 5462 "configure"
5462 #include "confdefs.h"
5463 /* Override any gcc2 internal prototype to avoid an error.  */
5464 /* We use char because int might match the return type of a gcc2
5465     builtin and then its argument prototype would still apply.  */
5466 char __res_query();
5467
5468 int main() {
5469 __res_query()
5470 ; return 0; }
5471 EOF
5472 if { (eval echo configure:5473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5473   rm -rf conftest*
5474   eval "ac_cv_lib_$ac_lib_var=yes"
5475 else
5476   echo "configure: failed program was:" >&5
5477   cat conftest.$ac_ext >&5
5478   rm -rf conftest*
5479   eval "ac_cv_lib_$ac_lib_var=no"
5480 fi
5481 rm -f conftest*
5482 LIBS="$ac_save_LIBS"
5483
5484 fi
5485 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5486   echo "$ac_t""yes" 1>&6
5487     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5488     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5489   cat >> confdefs.h <<EOF
5490 #define $ac_tr_lib 1
5491 EOF
5492
5493   LIBS="-lbind $LIBS"
5494
5495 else
5496   echo "$ac_t""no" 1>&6
5497 fi
5498
5499         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
5500 fi
5501
5502 if test $ac_cv_func_res_query = no ; then 
5503         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
5504 echo "configure:5505: checking for res_query in -lresolv" >&5
5505 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
5506 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5507   echo $ac_n "(cached) $ac_c" 1>&6
5508 else
5509   ac_save_LIBS="$LIBS"
5510 LIBS="-lresolv  $LIBS"
5511 cat > conftest.$ac_ext <<EOF
5512 #line 5513 "configure"
5513 #include "confdefs.h"
5514 /* Override any gcc2 internal prototype to avoid an error.  */
5515 /* We use char because int might match the return type of a gcc2
5516     builtin and then its argument prototype would still apply.  */
5517 char res_query();
5518
5519 int main() {
5520 res_query()
5521 ; return 0; }
5522 EOF
5523 if { (eval echo configure:5524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5524   rm -rf conftest*
5525   eval "ac_cv_lib_$ac_lib_var=yes"
5526 else
5527   echo "configure: failed program was:" >&5
5528   cat conftest.$ac_ext >&5
5529   rm -rf conftest*
5530   eval "ac_cv_lib_$ac_lib_var=no"
5531 fi
5532 rm -f conftest*
5533 LIBS="$ac_save_LIBS"
5534
5535 fi
5536 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5537   echo "$ac_t""yes" 1>&6
5538     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5539     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5540   cat >> confdefs.h <<EOF
5541 #define $ac_tr_lib 1
5542 EOF
5543
5544   LIBS="-lresolv $LIBS"
5545
5546 else
5547   echo "$ac_t""no" 1>&6
5548 fi
5549
5550         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
5551 fi
5552
5553 if test "$ac_cv_func_res_query" = yes ; then
5554         cat >> confdefs.h <<\EOF
5555 #define HAVE_RES_QUERY 1
5556 EOF
5557
5558
5559         if test $ol_enable_dnssrv != no ; then
5560                 ol_link_dnssrv=yes
5561         fi
5562 fi
5563
5564 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
5565         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
5566 fi
5567
5568 ol_link_kbind=no
5569 ol_link_kpasswd=no
5570 ol_link_krb5=no
5571 ol_link_krb4=no
5572
5573 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 \
5574         -o $ol_with_kerberos = k5only -o $ol_with_kerberos = k425 ; then
5575
5576         for ac_hdr in krb5.h
5577 do
5578 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5579 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5580 echo "configure:5581: checking for $ac_hdr" >&5
5581 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5582   echo $ac_n "(cached) $ac_c" 1>&6
5583 else
5584   cat > conftest.$ac_ext <<EOF
5585 #line 5586 "configure"
5586 #include "confdefs.h"
5587 #include <$ac_hdr>
5588 EOF
5589 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5590 { (eval echo configure:5591: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5591 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5592 if test -z "$ac_err"; then
5593   rm -rf conftest*
5594   eval "ac_cv_header_$ac_safe=yes"
5595 else
5596   echo "$ac_err" >&5
5597   echo "configure: failed program was:" >&5
5598   cat conftest.$ac_ext >&5
5599   rm -rf conftest*
5600   eval "ac_cv_header_$ac_safe=no"
5601 fi
5602 rm -f conftest*
5603 fi
5604 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5605   echo "$ac_t""yes" 1>&6
5606     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5607   cat >> confdefs.h <<EOF
5608 #define $ac_tr_hdr 1
5609 EOF
5610  
5611 else
5612   echo "$ac_t""no" 1>&6
5613 fi
5614 done
5615
5616
5617         if test $ac_cv_header_krb5_h = yes ; then
5618                                 for ac_hdr in heim_err.h
5619 do
5620 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5621 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5622 echo "configure:5623: checking for $ac_hdr" >&5
5623 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5624   echo $ac_n "(cached) $ac_c" 1>&6
5625 else
5626   cat > conftest.$ac_ext <<EOF
5627 #line 5628 "configure"
5628 #include "confdefs.h"
5629 #include <$ac_hdr>
5630 EOF
5631 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5632 { (eval echo configure:5633: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5633 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5634 if test -z "$ac_err"; then
5635   rm -rf conftest*
5636   eval "ac_cv_header_$ac_safe=yes"
5637 else
5638   echo "$ac_err" >&5
5639   echo "configure: failed program was:" >&5
5640   cat conftest.$ac_ext >&5
5641   rm -rf conftest*
5642   eval "ac_cv_header_$ac_safe=no"
5643 fi
5644 rm -f conftest*
5645 fi
5646 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5647   echo "$ac_t""yes" 1>&6
5648     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5649   cat >> confdefs.h <<EOF
5650 #define $ac_tr_hdr 1
5651 EOF
5652  
5653 else
5654   echo "$ac_t""no" 1>&6
5655 fi
5656 done
5657
5658                 if test $ac_cv_header_heim_err_h = yes ; then
5659                         krb5_impl=heimdal
5660                 else
5661                         krb5_impl=mit
5662                 fi
5663
5664                 if test $krb5_impl = mit; then
5665                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
5666 echo "configure:5667: checking for main in -lkrb5" >&5
5667 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
5668 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5669   echo $ac_n "(cached) $ac_c" 1>&6
5670 else
5671   ac_save_LIBS="$LIBS"
5672 LIBS="-lkrb5 -lcrypto -lcom_err $LIBS"
5673 cat > conftest.$ac_ext <<EOF
5674 #line 5675 "configure"
5675 #include "confdefs.h"
5676
5677 int main() {
5678 main()
5679 ; return 0; }
5680 EOF
5681 if { (eval echo configure:5682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5682   rm -rf conftest*
5683   eval "ac_cv_lib_$ac_lib_var=yes"
5684 else
5685   echo "configure: failed program was:" >&5
5686   cat conftest.$ac_ext >&5
5687   rm -rf conftest*
5688   eval "ac_cv_lib_$ac_lib_var=no"
5689 fi
5690 rm -f conftest*
5691 LIBS="$ac_save_LIBS"
5692
5693 fi
5694 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5695   echo "$ac_t""yes" 1>&6
5696   have_krb5=yes
5697                                 KRB5_LIBS="-lkrb5 -lcrypto -lcom_err"
5698 else
5699   echo "$ac_t""no" 1>&6
5700 have_krb5=no
5701 fi
5702
5703
5704                 elif test $krb5_impl = heimdal; then
5705                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
5706 echo "configure:5707: checking for main in -lkrb5" >&5
5707 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
5708 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5709   echo $ac_n "(cached) $ac_c" 1>&6
5710 else
5711   ac_save_LIBS="$LIBS"
5712 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
5713 cat > conftest.$ac_ext <<EOF
5714 #line 5715 "configure"
5715 #include "confdefs.h"
5716
5717 int main() {
5718 main()
5719 ; return 0; }
5720 EOF
5721 if { (eval echo configure:5722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5722   rm -rf conftest*
5723   eval "ac_cv_lib_$ac_lib_var=yes"
5724 else
5725   echo "configure: failed program was:" >&5
5726   cat conftest.$ac_ext >&5
5727   rm -rf conftest*
5728   eval "ac_cv_lib_$ac_lib_var=no"
5729 fi
5730 rm -f conftest*
5731 LIBS="$ac_save_LIBS"
5732
5733 fi
5734 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5735   echo "$ac_t""yes" 1>&6
5736   have_krb5=yes
5737                                 KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
5738 else
5739   echo "$ac_t""no" 1>&6
5740 have_krb5=no
5741 fi
5742
5743
5744                         cat >> confdefs.h <<\EOF
5745 #define HAVE_HEIMDAL_KERBEROS 1
5746 EOF
5747
5748                 else
5749                         have_krb5=no
5750                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
5751                 fi
5752
5753                 if test $have_krb5 = yes ; then
5754                         ol_link_krb5=yes
5755
5756                         cat >> confdefs.h <<\EOF
5757 #define HAVE_KRB5 1
5758 EOF
5759
5760
5761                         if test $ol_enable_kpasswd != no ; then
5762                                 ol_link_kpasswd=yes;
5763                         fi
5764
5765                         if test $ol_with_kerberos = k5only ; then
5766                                 ol_with_kerberos=found
5767                         fi
5768
5769                 elif test $ol_with_kerberos != auto ; then
5770                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
5771                 fi
5772
5773         fi
5774 fi
5775
5776 if test $ol_link_krb5 = yes -a \
5777         \( $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
5778
5779         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
5780 do
5781 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5782 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5783 echo "configure:5784: checking for $ac_hdr" >&5
5784 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5785   echo $ac_n "(cached) $ac_c" 1>&6
5786 else
5787   cat > conftest.$ac_ext <<EOF
5788 #line 5789 "configure"
5789 #include "confdefs.h"
5790 #include <$ac_hdr>
5791 EOF
5792 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5793 { (eval echo configure:5794: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5794 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5795 if test -z "$ac_err"; then
5796   rm -rf conftest*
5797   eval "ac_cv_header_$ac_safe=yes"
5798 else
5799   echo "$ac_err" >&5
5800   echo "configure: failed program was:" >&5
5801   cat conftest.$ac_ext >&5
5802   rm -rf conftest*
5803   eval "ac_cv_header_$ac_safe=no"
5804 fi
5805 rm -f conftest*
5806 fi
5807 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5808   echo "$ac_t""yes" 1>&6
5809     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5810   cat >> confdefs.h <<EOF
5811 #define $ac_tr_hdr 1
5812 EOF
5813  
5814 else
5815   echo "$ac_t""no" 1>&6
5816 fi
5817 done
5818
5819
5820         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
5821                 if test $krb5_impl = mit; then
5822                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
5823 echo "configure:5824: checking for main in -lkrb4" >&5
5824 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
5825 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5826   echo $ac_n "(cached) $ac_c" 1>&6
5827 else
5828   ac_save_LIBS="$LIBS"
5829 LIBS="-lkrb4 -ldes425 -lkrb5 -lcrypto -lcom_err $LIBS"
5830 cat > conftest.$ac_ext <<EOF
5831 #line 5832 "configure"
5832 #include "confdefs.h"
5833
5834 int main() {
5835 main()
5836 ; return 0; }
5837 EOF
5838 if { (eval echo configure:5839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5839   rm -rf conftest*
5840   eval "ac_cv_lib_$ac_lib_var=yes"
5841 else
5842   echo "configure: failed program was:" >&5
5843   cat conftest.$ac_ext >&5
5844   rm -rf conftest*
5845   eval "ac_cv_lib_$ac_lib_var=no"
5846 fi
5847 rm -f conftest*
5848 LIBS="$ac_save_LIBS"
5849
5850 fi
5851 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5852   echo "$ac_t""yes" 1>&6
5853   have_k425=yes
5854                                 KRB4_LIBS="-lkrb4 -ldes425"
5855 else
5856   echo "$ac_t""no" 1>&6
5857 have_k425=no
5858 fi
5859
5860
5861                 elif test $krb5_impl = heimdal; then
5862                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
5863 echo "configure:5864: checking for main in -lkrb4" >&5
5864 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
5865 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5866   echo $ac_n "(cached) $ac_c" 1>&6
5867 else
5868   ac_save_LIBS="$LIBS"
5869 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
5870 cat > conftest.$ac_ext <<EOF
5871 #line 5872 "configure"
5872 #include "confdefs.h"
5873
5874 int main() {
5875 main()
5876 ; return 0; }
5877 EOF
5878 if { (eval echo configure:5879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5879   rm -rf conftest*
5880   eval "ac_cv_lib_$ac_lib_var=yes"
5881 else
5882   echo "configure: failed program was:" >&5
5883   cat conftest.$ac_ext >&5
5884   rm -rf conftest*
5885   eval "ac_cv_lib_$ac_lib_var=no"
5886 fi
5887 rm -f conftest*
5888 LIBS="$ac_save_LIBS"
5889
5890 fi
5891 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5892   echo "$ac_t""yes" 1>&6
5893   have_k425=yes
5894                                 KRB4_LIBS="-lkrb4"
5895 else
5896   echo "$ac_t""no" 1>&6
5897 have_k425=no
5898 fi
5899
5900
5901                 else
5902                         have_425=no
5903                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
5904                 fi
5905
5906                 if test $have_k425 = yes ; then
5907                         ol_with_kerberos=found
5908                         ol_link_krb4=yes
5909
5910                         cat >> confdefs.h <<\EOF
5911 #define HAVE_KRB425 1
5912 EOF
5913
5914                         cat >> confdefs.h <<\EOF
5915 #define HAVE_KRB4 1
5916 EOF
5917
5918
5919                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
5920 echo "configure:5921: checking for des_debug in Kerberos libraries" >&5
5921 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
5922   echo $ac_n "(cached) $ac_c" 1>&6
5923 else
5924   
5925                                                                 save_LIBS="$LIBS"
5926                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
5927                                 cat > conftest.$ac_ext <<EOF
5928 #line 5929 "configure"
5929 #include "confdefs.h"
5930
5931 #include <kerberosIV/krb.h>
5932 #include <kerberosIV/des.h>
5933 extern int des_debug;
5934
5935 int main() {
5936
5937 des_debug = 1;
5938
5939 ; return 0; }
5940 EOF
5941 if { (eval echo configure:5942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5942   rm -rf conftest*
5943   ol_cv_var_des_debug=yes
5944 else
5945   echo "configure: failed program was:" >&5
5946   cat conftest.$ac_ext >&5
5947   rm -rf conftest*
5948   ol_cv_var_des_debug=no
5949 fi
5950 rm -f conftest*
5951                                                                 LIBS="$save_LIBS"
5952                         
5953 fi
5954
5955 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
5956
5957                         if test $ol_cv_var_des_debug = yes ; then
5958                                 cat >> confdefs.h <<\EOF
5959 #define HAVE_DES_DEBUG 1
5960 EOF
5961
5962                         fi
5963
5964                         LIBS="$save_LIBS"
5965                 fi
5966         fi
5967 fi
5968
5969 if test $ol_link_krb5 = yes ; then
5970         ol_with_kerberos=found
5971 fi
5972
5973 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 \
5974         -o $ol_with_kerberos = kth ; then
5975
5976         for ac_hdr in krb.h des.h krb-archaeology.h 
5977 do
5978 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5979 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5980 echo "configure:5981: checking for $ac_hdr" >&5
5981 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5982   echo $ac_n "(cached) $ac_c" 1>&6
5983 else
5984   cat > conftest.$ac_ext <<EOF
5985 #line 5986 "configure"
5986 #include "confdefs.h"
5987 #include <$ac_hdr>
5988 EOF
5989 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5990 { (eval echo configure:5991: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5991 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5992 if test -z "$ac_err"; then
5993   rm -rf conftest*
5994   eval "ac_cv_header_$ac_safe=yes"
5995 else
5996   echo "$ac_err" >&5
5997   echo "configure: failed program was:" >&5
5998   cat conftest.$ac_ext >&5
5999   rm -rf conftest*
6000   eval "ac_cv_header_$ac_safe=no"
6001 fi
6002 rm -f conftest*
6003 fi
6004 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6005   echo "$ac_t""yes" 1>&6
6006     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6007   cat >> confdefs.h <<EOF
6008 #define $ac_tr_hdr 1
6009 EOF
6010  
6011 else
6012   echo "$ac_t""no" 1>&6
6013 fi
6014 done
6015
6016
6017         if test $ac_cv_header_krb_h = yes ; then
6018                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
6019 echo "configure:6020: checking for main in -lkrb" >&5
6020 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
6021 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6022   echo $ac_n "(cached) $ac_c" 1>&6
6023 else
6024   ac_save_LIBS="$LIBS"
6025 LIBS="-lkrb -ldes $LIBS"
6026 cat > conftest.$ac_ext <<EOF
6027 #line 6028 "configure"
6028 #include "confdefs.h"
6029
6030 int main() {
6031 main()
6032 ; return 0; }
6033 EOF
6034 if { (eval echo configure:6035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6035   rm -rf conftest*
6036   eval "ac_cv_lib_$ac_lib_var=yes"
6037 else
6038   echo "configure: failed program was:" >&5
6039   cat conftest.$ac_ext >&5
6040   rm -rf conftest*
6041   eval "ac_cv_lib_$ac_lib_var=no"
6042 fi
6043 rm -f conftest*
6044 LIBS="$ac_save_LIBS"
6045
6046 fi
6047 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6048   echo "$ac_t""yes" 1>&6
6049   have_k4=yes
6050 else
6051   echo "$ac_t""no" 1>&6
6052 have_k4=no
6053 fi
6054
6055
6056                 if test $have_k4 = yes ; then
6057                         ol_with_kerberos=found
6058                         ol_link_krb4=yes
6059
6060                         cat >> confdefs.h <<\EOF
6061 #define HAVE_KRB4 1
6062 EOF
6063
6064
6065                         KRB4_LIBS="-lkrb -ldes"
6066
6067                         if test $ac_cv_header_krb_archaeology_h = yes ; then
6068                                 cat >> confdefs.h <<\EOF
6069 #define HAVE_KTH_KERBEROS 1
6070 EOF
6071
6072                         fi
6073                 fi
6074         fi
6075 fi
6076
6077 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
6078         ol_link_kpasswd=yes;
6079 fi
6080
6081 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
6082         cat >> confdefs.h <<\EOF
6083 #define HAVE_KERBEROS 1
6084 EOF
6085
6086
6087 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
6088         { echo "configure: error: Kerberos detection failed." 1>&2; exit 1; }
6089 fi
6090
6091 ol_link_tls=no
6092 if test $ol_with_tls != no ; then
6093         for ac_hdr in openssl/ssl.h ssl.h
6094 do
6095 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6096 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6097 echo "configure:6098: checking for $ac_hdr" >&5
6098 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6099   echo $ac_n "(cached) $ac_c" 1>&6
6100 else
6101   cat > conftest.$ac_ext <<EOF
6102 #line 6103 "configure"
6103 #include "confdefs.h"
6104 #include <$ac_hdr>
6105 EOF
6106 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6107 { (eval echo configure:6108: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6108 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6109 if test -z "$ac_err"; then
6110   rm -rf conftest*
6111   eval "ac_cv_header_$ac_safe=yes"
6112 else
6113   echo "$ac_err" >&5
6114   echo "configure: failed program was:" >&5
6115   cat conftest.$ac_ext >&5
6116   rm -rf conftest*
6117   eval "ac_cv_header_$ac_safe=no"
6118 fi
6119 rm -f conftest*
6120 fi
6121 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6122   echo "$ac_t""yes" 1>&6
6123     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6124   cat >> confdefs.h <<EOF
6125 #define $ac_tr_hdr 1
6126 EOF
6127  
6128 else
6129   echo "$ac_t""no" 1>&6
6130 fi
6131 done
6132
6133         
6134         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
6135                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
6136 echo "configure:6137: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
6137 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
6138 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6139   echo $ac_n "(cached) $ac_c" 1>&6
6140 else
6141   ac_save_LIBS="$LIBS"
6142 LIBS="-lssl -lcrypto $LIBS"
6143 cat > conftest.$ac_ext <<EOF
6144 #line 6145 "configure"
6145 #include "confdefs.h"
6146 /* Override any gcc2 internal prototype to avoid an error.  */
6147 /* We use char because int might match the return type of a gcc2
6148     builtin and then its argument prototype would still apply.  */
6149 char SSLeay_add_ssl_algorithms();
6150
6151 int main() {
6152 SSLeay_add_ssl_algorithms()
6153 ; return 0; }
6154 EOF
6155 if { (eval echo configure:6156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6156   rm -rf conftest*
6157   eval "ac_cv_lib_$ac_lib_var=yes"
6158 else
6159   echo "configure: failed program was:" >&5
6160   cat conftest.$ac_ext >&5
6161   rm -rf conftest*
6162   eval "ac_cv_lib_$ac_lib_var=no"
6163 fi
6164 rm -f conftest*
6165 LIBS="$ac_save_LIBS"
6166
6167 fi
6168 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6169   echo "$ac_t""yes" 1>&6
6170   have_ssleay=yes
6171                         need_rsaref=no
6172 else
6173   echo "$ac_t""no" 1>&6
6174 have_ssleay=no
6175 fi
6176
6177                         
6178                 if test $have_ssleay = no ; then
6179                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
6180 echo "configure:6181: checking for SSL_library_init in -lssl" >&5
6181 ac_lib_var=`echo ssl'_'SSL_library_init | 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 SSL_library_init();
6194
6195 int main() {
6196 SSL_library_init()
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                 fi
6222
6223                 if test $have_ssleay = no ; then
6224                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
6225 echo "configure:6226: checking for ssl3_accept in -lssl" >&5
6226 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
6227 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6228   echo $ac_n "(cached) $ac_c" 1>&6
6229 else
6230   ac_save_LIBS="$LIBS"
6231 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
6232 cat > conftest.$ac_ext <<EOF
6233 #line 6234 "configure"
6234 #include "confdefs.h"
6235 /* Override any gcc2 internal prototype to avoid an error.  */
6236 /* We use char because int might match the return type of a gcc2
6237     builtin and then its argument prototype would still apply.  */
6238 char ssl3_accept();
6239
6240 int main() {
6241 ssl3_accept()
6242 ; return 0; }
6243 EOF
6244 if { (eval echo configure:6245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6245   rm -rf conftest*
6246   eval "ac_cv_lib_$ac_lib_var=yes"
6247 else
6248   echo "configure: failed program was:" >&5
6249   cat conftest.$ac_ext >&5
6250   rm -rf conftest*
6251   eval "ac_cv_lib_$ac_lib_var=no"
6252 fi
6253 rm -f conftest*
6254 LIBS="$ac_save_LIBS"
6255
6256 fi
6257 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6258   echo "$ac_t""yes" 1>&6
6259   have_ssleay=yes
6260                                 need_rsaref=yes
6261 else
6262   echo "$ac_t""no" 1>&6
6263 have_ssleay=no
6264 fi
6265
6266                 fi
6267
6268                 if test $have_ssleay = yes ; then
6269                         ol_with_tls=found
6270                         ol_link_tls=yes
6271
6272                         cat >> confdefs.h <<\EOF
6273 #define HAVE_SSLEAY 1
6274 EOF
6275
6276
6277                         if test $need_rsaref = yes; then
6278                                 cat >> confdefs.h <<\EOF
6279 #define HAVE_RSAREF 1
6280 EOF
6281
6282
6283                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
6284                         else
6285                                 TLS_LIBS="-lssl -lcrypto"
6286                         fi
6287                 fi
6288         fi
6289
6290 else
6291         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6292 fi
6293
6294 if test $ol_link_tls = yes ; then
6295         cat >> confdefs.h <<\EOF
6296 #define HAVE_TLS 1
6297 EOF
6298
6299
6300 elif test $ol_with_tls = auto ; then
6301         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
6302         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6303
6304 elif test $ol_with_tls != no ; then
6305         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
6306 fi
6307
6308 for ac_func in \
6309         ctime_r                 \
6310         gethostbyname_r gethostbyaddr_r \
6311
6312 do
6313 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6314 echo "configure:6315: checking for $ac_func" >&5
6315 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6316   echo $ac_n "(cached) $ac_c" 1>&6
6317 else
6318   cat > conftest.$ac_ext <<EOF
6319 #line 6320 "configure"
6320 #include "confdefs.h"
6321 /* System header to define __stub macros and hopefully few prototypes,
6322     which can conflict with char $ac_func(); below.  */
6323 #include <assert.h>
6324 /* Override any gcc2 internal prototype to avoid an error.  */
6325 /* We use char because int might match the return type of a gcc2
6326     builtin and then its argument prototype would still apply.  */
6327 char $ac_func();
6328 char (*f)();
6329
6330 int main() {
6331
6332 /* The GNU C library defines this for functions which it implements
6333     to always fail with ENOSYS.  Some functions are actually named
6334     something starting with __ and the normal name is an alias.  */
6335 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6336 choke me
6337 #else
6338 f = $ac_func;
6339 #endif
6340
6341 ; return 0; }
6342 EOF
6343 if { (eval echo configure:6344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6344   rm -rf conftest*
6345   eval "ac_cv_func_$ac_func=yes"
6346 else
6347   echo "configure: failed program was:" >&5
6348   cat conftest.$ac_ext >&5
6349   rm -rf conftest*
6350   eval "ac_cv_func_$ac_func=no"
6351 fi
6352 rm -f conftest*
6353 fi
6354
6355 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6356   echo "$ac_t""yes" 1>&6
6357     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6358   cat >> confdefs.h <<EOF
6359 #define $ac_tr_func 1
6360 EOF
6361  
6362 else
6363   echo "$ac_t""no" 1>&6
6364 fi
6365 done
6366
6367
6368 if test "$ac_cv_func_ctime_r" = no ; then
6369         ol_cv_func_ctime_r_nargs=0
6370 else
6371         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
6372 echo "configure:6373: checking number of arguments of ctime_r" >&5
6373 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
6374   echo $ac_n "(cached) $ac_c" 1>&6
6375 else
6376   cat > conftest.$ac_ext <<EOF
6377 #line 6378 "configure"
6378 #include "confdefs.h"
6379 #include <time.h>
6380 int main() {
6381 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
6382 ; return 0; }
6383 EOF
6384 if { (eval echo configure:6385: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6385   rm -rf conftest*
6386   ol_cv_func_ctime_r_nargs3=yes
6387 else
6388   echo "configure: failed program was:" >&5
6389   cat conftest.$ac_ext >&5
6390   rm -rf conftest*
6391   ol_cv_func_ctime_r_nargs3=no
6392 fi
6393 rm -f conftest*
6394
6395         cat > conftest.$ac_ext <<EOF
6396 #line 6397 "configure"
6397 #include "confdefs.h"
6398 #include <time.h>
6399 int main() {
6400 time_t ti; char *buffer; ctime_r(&ti,buffer);
6401 ; return 0; }
6402 EOF
6403 if { (eval echo configure:6404: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6404   rm -rf conftest*
6405   ol_cv_func_ctime_r_nargs2=yes
6406 else
6407   echo "configure: failed program was:" >&5
6408   cat conftest.$ac_ext >&5
6409   rm -rf conftest*
6410   ol_cv_func_ctime_r_nargs2=no
6411 fi
6412 rm -f conftest*
6413
6414         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
6415                 $ol_cv_func_ctime_r_nargs2 = no ; then
6416
6417                 ol_cv_func_ctime_r_nargs=3
6418
6419         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
6420                 $ol_cv_func_ctime_r_nargs2 = yes ; then
6421
6422                 ol_cv_func_ctime_r_nargs=2
6423
6424         else
6425                 ol_cv_func_ctime_r_nargs=0
6426         fi
6427   
6428 fi
6429
6430 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
6431
6432   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
6433         cat >> confdefs.h <<EOF
6434 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
6435 EOF
6436
6437   fi
6438
6439 fi
6440
6441 if test "$ac_cv_func_gethostbyname_r" = yes ; then
6442         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
6443 echo "configure:6444: checking number of arguments of gethostbyname_r" >&5
6444 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
6445   echo $ac_n "(cached) $ac_c" 1>&6
6446 else
6447   cat > conftest.$ac_ext <<EOF
6448 #line 6449 "configure"
6449 #include "confdefs.h"
6450 #include <sys/types.h>
6451 #include <sys/socket.h>
6452 #include <netinet/in.h>
6453 #include <netdb.h>
6454 #define BUFSIZE (sizeof(struct hostent)+10)
6455 int main() {
6456 struct hostent hent; char buffer[BUFSIZE];
6457                 int bufsize=BUFSIZE;int h_errno;
6458                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
6459                         buffer, bufsize, &h_errno);
6460 ; return 0; }
6461 EOF
6462 if { (eval echo configure:6463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6463   rm -rf conftest*
6464   ol_cv_func_gethostbyname_r_nargs5=yes
6465 else
6466   echo "configure: failed program was:" >&5
6467   cat conftest.$ac_ext >&5
6468   rm -rf conftest*
6469   ol_cv_func_gethostbyname_r_nargs5=no
6470 fi
6471 rm -f conftest*
6472
6473         cat > conftest.$ac_ext <<EOF
6474 #line 6475 "configure"
6475 #include "confdefs.h"
6476 #include <sys/types.h>
6477 #include <sys/socket.h>
6478 #include <netinet/in.h>
6479 #include <netdb.h>
6480 #define BUFSIZE (sizeof(struct hostent)+10)
6481 int main() {
6482 struct hostent hent;struct hostent *rhent;
6483                 char buffer[BUFSIZE];
6484                 int bufsize=BUFSIZE;int h_errno;
6485                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
6486                         &rhent, &h_errno);
6487 ; return 0; }
6488 EOF
6489 if { (eval echo configure:6490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6490   rm -rf conftest*
6491   ol_cv_func_gethostbyname_r_nargs6=yes
6492 else
6493   echo "configure: failed program was:" >&5
6494   cat conftest.$ac_ext >&5
6495   rm -rf conftest*
6496   ol_cv_func_gethostbyname_r_nargs6=no
6497 fi
6498 rm -f conftest*
6499
6500         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
6501                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
6502
6503                 ol_cv_func_gethostbyname_r_nargs=5
6504
6505         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
6506                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
6507
6508                 ol_cv_func_gethostbyname_r_nargs=6
6509
6510         else
6511                 ol_cv_func_gethostbyname_r_nargs=0
6512         fi
6513   
6514 fi
6515
6516 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
6517   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
6518         cat >> confdefs.h <<EOF
6519 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
6520 EOF
6521
6522   fi
6523
6524 else
6525         ol_cv_func_gethostbyname_r_nargs=0
6526 fi
6527  
6528 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
6529         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
6530 echo "configure:6531: checking number of arguments of gethostbyaddr_r" >&5
6531 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
6532   echo $ac_n "(cached) $ac_c" 1>&6
6533 else
6534   cat > conftest.$ac_ext <<EOF
6535 #line 6536 "configure"
6536 #include "confdefs.h"
6537 #include <sys/types.h>
6538 #include <sys/socket.h>
6539 #include <netinet/in.h>
6540 #include <netdb.h>
6541 #define BUFSIZE (sizeof(struct hostent)+10)
6542 int main() {
6543 struct hostent hent; char buffer[BUFSIZE]; 
6544             struct in_addr add;
6545             size_t alen=sizeof(struct in_addr);
6546             int bufsize=BUFSIZE;int h_errno;
6547                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
6548                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
6549 ; return 0; }
6550 EOF
6551 if { (eval echo configure:6552: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6552   rm -rf conftest*
6553   ol_cv_func_gethostbyaddr_r_nargs7=yes
6554 else
6555   echo "configure: failed program was:" >&5
6556   cat conftest.$ac_ext >&5
6557   rm -rf conftest*
6558   ol_cv_func_gethostbyaddr_r_nargs7=no
6559 fi
6560 rm -f conftest*
6561
6562         cat > conftest.$ac_ext <<EOF
6563 #line 6564 "configure"
6564 #include "confdefs.h"
6565 #include <sys/types.h>
6566 #include <sys/socket.h>
6567 #include <netinet/in.h>
6568 #include <netdb.h>
6569 #define BUFSIZE (sizeof(struct hostent)+10)
6570 int main() {
6571 struct hostent hent;
6572                 struct hostent *rhent; char buffer[BUFSIZE]; 
6573                 struct in_addr add;
6574                 size_t alen=sizeof(struct in_addr);
6575                 int bufsize=BUFSIZE;int h_errno;
6576                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
6577                         alen, AF_INET, &hent, buffer, bufsize, 
6578                         &rhent, &h_errno);
6579 ; return 0; }
6580 EOF
6581 if { (eval echo configure:6582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6582   rm -rf conftest*
6583   ol_cv_func_gethostbyaddr_r_nargs8=yes
6584 else
6585   echo "configure: failed program was:" >&5
6586   cat conftest.$ac_ext >&5
6587   rm -rf conftest*
6588   ol_cv_func_gethostbyaddr_r_nargs8=no
6589 fi
6590 rm -f conftest*
6591
6592         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
6593                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
6594
6595                 ol_cv_func_gethostbyaddr_r_nargs=7
6596
6597         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
6598                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
6599
6600                 ol_cv_func_gethostbyaddr_r_nargs=8
6601
6602         else
6603                 ol_cv_func_gethostbyaddr_r_nargs=0
6604         fi
6605   
6606 fi
6607
6608 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
6609   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
6610     cat >> confdefs.h <<EOF
6611 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
6612 EOF
6613
6614   fi
6615
6616 else
6617         ol_cv_func_gethostbyaddr_r_nargs=0
6618 fi
6619
6620 if test "$ac_cv_func_ctime_r" = yes \
6621         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
6622         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
6623         -a "$ac_cv_func_gethostbyname_r" = yes \
6624         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
6625         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
6626         -a "$ac_cv_func_gethostbyaddr_r" = yes \
6627         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
6628         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
6629         ; then
6630  
6631         cat >> confdefs.h <<\EOF
6632 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
6633 EOF
6634
6635 fi
6636
6637 ol_link_threads=no
6638
6639 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6640         -o $ol_with_threads = nt ; then
6641
6642         
6643         echo $ac_n "checking for NT Threads""... $ac_c" 1>&6
6644 echo "configure:6645: checking for NT Threads" >&5
6645 if eval "test \"\${ol_cv_nt_threads+set}\" = set"; then
6646   echo $ac_n "(cached) $ac_c" 1>&6
6647 else
6648   
6649                 echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
6650 echo "configure:6651: checking for _beginthread" >&5
6651 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
6652   echo $ac_n "(cached) $ac_c" 1>&6
6653 else
6654   cat > conftest.$ac_ext <<EOF
6655 #line 6656 "configure"
6656 #include "confdefs.h"
6657 /* System header to define __stub macros and hopefully few prototypes,
6658     which can conflict with char _beginthread(); below.  */
6659 #include <assert.h>
6660 /* Override any gcc2 internal prototype to avoid an error.  */
6661 /* We use char because int might match the return type of a gcc2
6662     builtin and then its argument prototype would still apply.  */
6663 char _beginthread();
6664 char (*f)();
6665
6666 int main() {
6667
6668 /* The GNU C library defines this for functions which it implements
6669     to always fail with ENOSYS.  Some functions are actually named
6670     something starting with __ and the normal name is an alias.  */
6671 #if defined (__stub__beginthread) || defined (__stub____beginthread)
6672 choke me
6673 #else
6674 f = _beginthread;
6675 #endif
6676
6677 ; return 0; }
6678 EOF
6679 if { (eval echo configure:6680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6680   rm -rf conftest*
6681   eval "ac_cv_func__beginthread=yes"
6682 else
6683   echo "configure: failed program was:" >&5
6684   cat conftest.$ac_ext >&5
6685   rm -rf conftest*
6686   eval "ac_cv_func__beginthread=no"
6687 fi
6688 rm -f conftest*
6689 fi
6690
6691 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
6692   echo "$ac_t""yes" 1>&6
6693   ol_cv_nt_threads=yes
6694 else
6695   echo "$ac_t""no" 1>&6
6696 ol_cv_nt_threads=no
6697 fi
6698
6699         
6700 fi
6701
6702 echo "$ac_t""$ol_cv_nt_threads" 1>&6
6703
6704         if test $ol_cv_nt_threads = yes ; then
6705                 cat >> confdefs.h <<\EOF
6706 #define HAVE_NT_THREADS 1
6707 EOF
6708
6709         fi
6710
6711
6712         if test "$ol_cv_nt_threads" = yes ; then
6713         ol_link_threads=nt
6714         ol_with_threads=found
6715         ol_with_yielding_select=yes
6716
6717                 cat >> confdefs.h <<\EOF
6718 #define HAVE_NT_SERVICE_MANAGER 1
6719 EOF
6720
6721                 cat >> confdefs.h <<\EOF
6722 #define HAVE_NT_EVENT_LOG 1
6723 EOF
6724
6725         fi
6726
6727         if test $ol_with_threads = nt ; then
6728                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
6729         fi
6730 fi
6731
6732 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6733         -o $ol_with_threads = posix ; then
6734
6735         for ac_hdr in pthread.h
6736 do
6737 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6738 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6739 echo "configure:6740: checking for $ac_hdr" >&5
6740 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6741   echo $ac_n "(cached) $ac_c" 1>&6
6742 else
6743   cat > conftest.$ac_ext <<EOF
6744 #line 6745 "configure"
6745 #include "confdefs.h"
6746 #include <$ac_hdr>
6747 EOF
6748 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6749 { (eval echo configure:6750: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6750 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6751 if test -z "$ac_err"; then
6752   rm -rf conftest*
6753   eval "ac_cv_header_$ac_safe=yes"
6754 else
6755   echo "$ac_err" >&5
6756   echo "configure: failed program was:" >&5
6757   cat conftest.$ac_ext >&5
6758   rm -rf conftest*
6759   eval "ac_cv_header_$ac_safe=no"
6760 fi
6761 rm -f conftest*
6762 fi
6763 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6764   echo "$ac_t""yes" 1>&6
6765     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6766   cat >> confdefs.h <<EOF
6767 #define $ac_tr_hdr 1
6768 EOF
6769  
6770 else
6771   echo "$ac_t""no" 1>&6
6772 fi
6773 done
6774
6775
6776         if test $ac_cv_header_pthread_h = yes ; then
6777                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
6778 echo "configure:6779: checking POSIX thread version" >&5
6779 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
6780   echo $ac_n "(cached) $ac_c" 1>&6
6781 else
6782   
6783         cat > conftest.$ac_ext <<EOF
6784 #line 6785 "configure"
6785 #include "confdefs.h"
6786
6787 #               include <pthread.h>
6788                 /* this check could be improved */
6789 #               ifdef PTHREAD_ONCE_INIT
6790                         pthread_version_final;
6791 #               endif
6792         
6793 EOF
6794 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6795   egrep "pthread_version_final" >/dev/null 2>&1; then
6796   rm -rf conftest*
6797   ol_pthread_final=yes
6798 else
6799   rm -rf conftest*
6800   ol_pthread_final=no
6801 fi
6802 rm -f conftest*
6803
6804
6805         cat > conftest.$ac_ext <<EOF
6806 #line 6807 "configure"
6807 #include "confdefs.h"
6808
6809 #               include <pthread.h>
6810                 /* this check could be improved */
6811 #               ifdef pthread_once_init
6812                         pthread_version_draft4;
6813 #               endif
6814         
6815 EOF
6816 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6817   egrep "pthread_version_draft4" >/dev/null 2>&1; then
6818   rm -rf conftest*
6819   ol_pthread_draft4=yes
6820 else
6821   rm -rf conftest*
6822   ol_pthread_draft4=no
6823 fi
6824 rm -f conftest*
6825
6826
6827         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
6828                 ol_cv_pthread_version=final
6829         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
6830                 ol_cv_pthread_version=draft4
6831         else
6832                 ol_cv_pthread_version=unknown
6833         fi
6834
6835 fi
6836
6837 echo "$ac_t""$ol_cv_pthread_version" 1>&6
6838
6839
6840                 if test $ol_cv_pthread_version = final ; then
6841                         cat >> confdefs.h <<\EOF
6842 #define HAVE_PTHREADS_FINAL 1
6843 EOF
6844
6845                 elif test $ol_cv_pthread_version = draft4 ; then
6846                         cat >> confdefs.h <<\EOF
6847 #define HAVE_PTHREADS_D4 1
6848 EOF
6849
6850                 else
6851                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
6852                 fi
6853
6854                 # consider threads found
6855                 ol_with_threads=found
6856
6857                 
6858         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
6859 echo "configure:6860: checking for LinuxThreads pthread.h" >&5
6860 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
6861   echo $ac_n "(cached) $ac_c" 1>&6
6862 else
6863   cat > conftest.$ac_ext <<EOF
6864 #line 6865 "configure"
6865 #include "confdefs.h"
6866 #include <pthread.h>
6867 EOF
6868 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6869   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
6870   rm -rf conftest*
6871   ol_cv_header_linux_threads=yes
6872 else
6873   rm -rf conftest*
6874   ol_cv_header_linux_threads=no
6875 fi
6876 rm -f conftest*
6877
6878                 
6879 fi
6880
6881 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
6882         if test $ol_cv_header_linux_threads = yes; then
6883                 cat >> confdefs.h <<\EOF
6884 #define HAVE_LINUX_THREADS 1
6885 EOF
6886
6887         fi
6888
6889                 
6890         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
6891 echo "configure:6892: checking for GNU Pth pthread.h" >&5
6892 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
6893   echo $ac_n "(cached) $ac_c" 1>&6
6894 else
6895   cat > conftest.$ac_ext <<EOF
6896 #line 6897 "configure"
6897 #include "confdefs.h"
6898 #include <pthread.h>
6899 #ifdef _POSIX_THREAD_IS_GNU_PTH
6900         __gnu_pth__;
6901 #endif
6902
6903 EOF
6904 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6905   egrep "__gnu_pth__" >/dev/null 2>&1; then
6906   rm -rf conftest*
6907   ol_cv_header_gnu_pth_pthread_h=yes
6908 else
6909   rm -rf conftest*
6910   ol_cv_header_gnu_pth_pthread_h=no
6911 fi
6912 rm -f conftest*
6913
6914                 
6915 fi
6916
6917 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
6918
6919
6920                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
6921                         for ac_hdr in sched.h
6922 do
6923 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6924 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6925 echo "configure:6926: checking for $ac_hdr" >&5
6926 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6927   echo $ac_n "(cached) $ac_c" 1>&6
6928 else
6929   cat > conftest.$ac_ext <<EOF
6930 #line 6931 "configure"
6931 #include "confdefs.h"
6932 #include <$ac_hdr>
6933 EOF
6934 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6935 { (eval echo configure:6936: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6936 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6937 if test -z "$ac_err"; then
6938   rm -rf conftest*
6939   eval "ac_cv_header_$ac_safe=yes"
6940 else
6941   echo "$ac_err" >&5
6942   echo "configure: failed program was:" >&5
6943   cat conftest.$ac_ext >&5
6944   rm -rf conftest*
6945   eval "ac_cv_header_$ac_safe=no"
6946 fi
6947 rm -f conftest*
6948 fi
6949 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6950   echo "$ac_t""yes" 1>&6
6951     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6952   cat >> confdefs.h <<EOF
6953 #define $ac_tr_hdr 1
6954 EOF
6955  
6956 else
6957   echo "$ac_t""no" 1>&6
6958 fi
6959 done
6960
6961                 fi
6962
6963                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
6964                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
6965 echo "configure:6966: checking for pthread_create in default libraries" >&5
6966 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
6967   echo $ac_n "(cached) $ac_c" 1>&6
6968 else
6969   
6970                 if test "$cross_compiling" = yes; then
6971   cat > conftest.$ac_ext <<EOF
6972 #line 6973 "configure"
6973 #include "confdefs.h"
6974 /* pthread test headers */
6975 #include <pthread.h>
6976 #ifndef NULL
6977 #define NULL (void*)0
6978 #endif
6979
6980 static void *task(p)
6981         void *p;
6982 {
6983         return (void *) (p == NULL);
6984 }
6985
6986 int main() {
6987
6988         /* pthread test function */
6989         pthread_t t;
6990         int status;
6991 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
6992         /* This system (e.g. AIX) defaults detached; must override */
6993         pthread_attr_t attr;
6994
6995         status = pthread_attr_init(&attr);
6996         if( status ) exit( status );
6997
6998         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
6999         if( status ) exit( status );
7000
7001 #define ATTR    &attr
7002 #else
7003 #if HAVE_PTHREADS_D4
7004 #define ATTR    pthread_attr_default
7005 #else
7006 #define ATTR    NULL
7007 #endif
7008 #endif
7009         /* make sure pthread_create() isn't just a stub */
7010         status = pthread_create(&t, ATTR, task, NULL);
7011         if( status ) exit( status );
7012
7013         /* make sure pthread_detach() isn't just a stub */
7014 #if HAVE_PTHREADS_D4
7015         status = pthread_detach( &t );
7016 #else
7017         status = pthread_detach( t );
7018 #endif
7019
7020 #ifdef HAVE_LINUX_THREADS
7021         pthread_kill_other_threads_np();
7022 #endif
7023
7024         exit( status );
7025
7026 ; return 0; }
7027 EOF
7028 if { (eval echo configure:7029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7029   rm -rf conftest*
7030   ol_cv_pthread_create=yes
7031 else
7032   echo "configure: failed program was:" >&5
7033   cat conftest.$ac_ext >&5
7034   rm -rf conftest*
7035   ol_cv_pthread_create=no
7036 fi
7037 rm -f conftest*
7038 else
7039   cat > conftest.$ac_ext <<EOF
7040 #line 7041 "configure"
7041 #include "confdefs.h"
7042 /* pthread test headers */
7043 #include <pthread.h>
7044 #ifndef NULL
7045 #define NULL (void*)0
7046 #endif
7047
7048 static void *task(p)
7049         void *p;
7050 {
7051         return (void *) (p == NULL);
7052 }
7053
7054
7055 int main(argc, argv)
7056         int argc;
7057         char **argv;
7058 {
7059
7060         /* pthread test function */
7061         pthread_t t;
7062         int status;
7063 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7064         /* This system (e.g. AIX) defaults detached; must override */
7065         pthread_attr_t attr;
7066
7067         status = pthread_attr_init(&attr);
7068         if( status ) exit( status );
7069
7070         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7071         if( status ) exit( status );
7072
7073 #define ATTR    &attr
7074 #else
7075 #if HAVE_PTHREADS_D4
7076 #define ATTR    pthread_attr_default
7077 #else
7078 #define ATTR    NULL
7079 #endif
7080 #endif
7081         /* make sure pthread_create() isn't just a stub */
7082         status = pthread_create(&t, ATTR, task, NULL);
7083         if( status ) exit( status );
7084
7085         /* make sure pthread_detach() isn't just a stub */
7086 #if HAVE_PTHREADS_D4
7087         status = pthread_detach( &t );
7088 #else
7089         status = pthread_detach( t );
7090 #endif
7091
7092 #ifdef HAVE_LINUX_THREADS
7093         pthread_kill_other_threads_np();
7094 #endif
7095
7096         exit( status );
7097
7098 }
7099
7100 EOF
7101 if { (eval echo configure:7102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7102 then
7103   ol_cv_pthread_create=yes
7104 else
7105   echo "configure: failed program was:" >&5
7106   cat conftest.$ac_ext >&5
7107   rm -fr conftest*
7108   ol_cv_pthread_create=no
7109 fi
7110 rm -fr conftest*
7111 fi
7112
7113 fi
7114
7115 echo "$ac_t""$ol_cv_pthread_create" 1>&6
7116
7117                 if test $ol_cv_pthread_create != no ; then
7118                         ol_link_threads=posix
7119                         ol_link_pthreads=""
7120                 fi
7121                 
7122                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
7123 if test "$ol_link_threads" = no ; then
7124         # try -kthread
7125         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
7126 echo "configure:7127: checking for pthread link with -kthread" >&5
7127 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
7128   echo $ac_n "(cached) $ac_c" 1>&6
7129 else
7130   
7131                 # save the flags
7132                 ol_LIBS="$LIBS"
7133                 LIBS="-kthread $LIBS"
7134
7135                 if test "$cross_compiling" = yes; then
7136   cat > conftest.$ac_ext <<EOF
7137 #line 7138 "configure"
7138 #include "confdefs.h"
7139 /* pthread test headers */
7140 #include <pthread.h>
7141 #ifndef NULL
7142 #define NULL (void*)0
7143 #endif
7144
7145 static void *task(p)
7146         void *p;
7147 {
7148         return (void *) (p == NULL);
7149 }
7150
7151 int main() {
7152
7153         /* pthread test function */
7154         pthread_t t;
7155         int status;
7156 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7157         /* This system (e.g. AIX) defaults detached; must override */
7158         pthread_attr_t attr;
7159
7160         status = pthread_attr_init(&attr);
7161         if( status ) exit( status );
7162
7163         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7164         if( status ) exit( status );
7165
7166 #define ATTR    &attr
7167 #else
7168 #if HAVE_PTHREADS_D4
7169 #define ATTR    pthread_attr_default
7170 #else
7171 #define ATTR    NULL
7172 #endif
7173 #endif
7174         /* make sure pthread_create() isn't just a stub */
7175         status = pthread_create(&t, ATTR, task, NULL);
7176         if( status ) exit( status );
7177
7178         /* make sure pthread_detach() isn't just a stub */
7179 #if HAVE_PTHREADS_D4
7180         status = pthread_detach( &t );
7181 #else
7182         status = pthread_detach( t );
7183 #endif
7184
7185 #ifdef HAVE_LINUX_THREADS
7186         pthread_kill_other_threads_np();
7187 #endif
7188
7189         exit( status );
7190
7191 ; return 0; }
7192 EOF
7193 if { (eval echo configure:7194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7194   rm -rf conftest*
7195   ol_cv_pthread_kthread=yes
7196 else
7197   echo "configure: failed program was:" >&5
7198   cat conftest.$ac_ext >&5
7199   rm -rf conftest*
7200   ol_cv_pthread_kthread=no
7201 fi
7202 rm -f conftest*
7203 else
7204   cat > conftest.$ac_ext <<EOF
7205 #line 7206 "configure"
7206 #include "confdefs.h"
7207 /* pthread test headers */
7208 #include <pthread.h>
7209 #ifndef NULL
7210 #define NULL (void*)0
7211 #endif
7212
7213 static void *task(p)
7214         void *p;
7215 {
7216         return (void *) (p == NULL);
7217 }
7218
7219
7220 int main(argc, argv)
7221         int argc;
7222         char **argv;
7223 {
7224
7225         /* pthread test function */
7226         pthread_t t;
7227         int status;
7228 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7229         /* This system (e.g. AIX) defaults detached; must override */
7230         pthread_attr_t attr;
7231
7232         status = pthread_attr_init(&attr);
7233         if( status ) exit( status );
7234
7235         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7236         if( status ) exit( status );
7237
7238 #define ATTR    &attr
7239 #else
7240 #if HAVE_PTHREADS_D4
7241 #define ATTR    pthread_attr_default
7242 #else
7243 #define ATTR    NULL
7244 #endif
7245 #endif
7246         /* make sure pthread_create() isn't just a stub */
7247         status = pthread_create(&t, ATTR, task, NULL);
7248         if( status ) exit( status );
7249
7250         /* make sure pthread_detach() isn't just a stub */
7251 #if HAVE_PTHREADS_D4
7252         status = pthread_detach( &t );
7253 #else
7254         status = pthread_detach( t );
7255 #endif
7256
7257 #ifdef HAVE_LINUX_THREADS
7258         pthread_kill_other_threads_np();
7259 #endif
7260
7261         exit( status );
7262
7263 }
7264
7265 EOF
7266 if { (eval echo configure:7267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7267 then
7268   ol_cv_pthread_kthread=yes
7269 else
7270   echo "configure: failed program was:" >&5
7271   cat conftest.$ac_ext >&5
7272   rm -fr conftest*
7273   ol_cv_pthread_kthread=no
7274 fi
7275 rm -fr conftest*
7276 fi
7277
7278
7279                 # restore the LIBS
7280                 LIBS="$ol_LIBS"
7281         
7282 fi
7283
7284 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
7285
7286         if test $ol_cv_pthread_kthread = yes ; then
7287                 ol_link_pthreads="-kthread"
7288                 ol_link_threads=posix
7289         fi
7290 fi
7291
7292                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
7293 if test "$ol_link_threads" = no ; then
7294         # try -pthread
7295         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
7296 echo "configure:7297: checking for pthread link with -pthread" >&5
7297 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
7298   echo $ac_n "(cached) $ac_c" 1>&6
7299 else
7300   
7301                 # save the flags
7302                 ol_LIBS="$LIBS"
7303                 LIBS="-pthread $LIBS"
7304
7305                 if test "$cross_compiling" = yes; then
7306   cat > conftest.$ac_ext <<EOF
7307 #line 7308 "configure"
7308 #include "confdefs.h"
7309 /* pthread test headers */
7310 #include <pthread.h>
7311 #ifndef NULL
7312 #define NULL (void*)0
7313 #endif
7314
7315 static void *task(p)
7316         void *p;
7317 {
7318         return (void *) (p == NULL);
7319 }
7320
7321 int main() {
7322
7323         /* pthread test function */
7324         pthread_t t;
7325         int status;
7326 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7327         /* This system (e.g. AIX) defaults detached; must override */
7328         pthread_attr_t attr;
7329
7330         status = pthread_attr_init(&attr);
7331         if( status ) exit( status );
7332
7333         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7334         if( status ) exit( status );
7335
7336 #define ATTR    &attr
7337 #else
7338 #if HAVE_PTHREADS_D4
7339 #define ATTR    pthread_attr_default
7340 #else
7341 #define ATTR    NULL
7342 #endif
7343 #endif
7344         /* make sure pthread_create() isn't just a stub */
7345         status = pthread_create(&t, ATTR, task, NULL);
7346         if( status ) exit( status );
7347
7348         /* make sure pthread_detach() isn't just a stub */
7349 #if HAVE_PTHREADS_D4
7350         status = pthread_detach( &t );
7351 #else
7352         status = pthread_detach( t );
7353 #endif
7354
7355 #ifdef HAVE_LINUX_THREADS
7356         pthread_kill_other_threads_np();
7357 #endif
7358
7359         exit( status );
7360
7361 ; return 0; }
7362 EOF
7363 if { (eval echo configure:7364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7364   rm -rf conftest*
7365   ol_cv_pthread_pthread=yes
7366 else
7367   echo "configure: failed program was:" >&5
7368   cat conftest.$ac_ext >&5
7369   rm -rf conftest*
7370   ol_cv_pthread_pthread=no
7371 fi
7372 rm -f conftest*
7373 else
7374   cat > conftest.$ac_ext <<EOF
7375 #line 7376 "configure"
7376 #include "confdefs.h"
7377 /* pthread test headers */
7378 #include <pthread.h>
7379 #ifndef NULL
7380 #define NULL (void*)0
7381 #endif
7382
7383 static void *task(p)
7384         void *p;
7385 {
7386         return (void *) (p == NULL);
7387 }
7388
7389
7390 int main(argc, argv)
7391         int argc;
7392         char **argv;
7393 {
7394
7395         /* pthread test function */
7396         pthread_t t;
7397         int status;
7398 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7399         /* This system (e.g. AIX) defaults detached; must override */
7400         pthread_attr_t attr;
7401
7402         status = pthread_attr_init(&attr);
7403         if( status ) exit( status );
7404
7405         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7406         if( status ) exit( status );
7407
7408 #define ATTR    &attr
7409 #else
7410 #if HAVE_PTHREADS_D4
7411 #define ATTR    pthread_attr_default
7412 #else
7413 #define ATTR    NULL
7414 #endif
7415 #endif
7416         /* make sure pthread_create() isn't just a stub */
7417         status = pthread_create(&t, ATTR, task, NULL);
7418         if( status ) exit( status );
7419
7420         /* make sure pthread_detach() isn't just a stub */
7421 #if HAVE_PTHREADS_D4
7422         status = pthread_detach( &t );
7423 #else
7424         status = pthread_detach( t );
7425 #endif
7426
7427 #ifdef HAVE_LINUX_THREADS
7428         pthread_kill_other_threads_np();
7429 #endif
7430
7431         exit( status );
7432
7433 }
7434
7435 EOF
7436 if { (eval echo configure:7437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7437 then
7438   ol_cv_pthread_pthread=yes
7439 else
7440   echo "configure: failed program was:" >&5
7441   cat conftest.$ac_ext >&5
7442   rm -fr conftest*
7443   ol_cv_pthread_pthread=no
7444 fi
7445 rm -fr conftest*
7446 fi
7447
7448
7449                 # restore the LIBS
7450                 LIBS="$ol_LIBS"
7451         
7452 fi
7453
7454 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
7455
7456         if test $ol_cv_pthread_pthread = yes ; then
7457                 ol_link_pthreads="-pthread"
7458                 ol_link_threads=posix
7459         fi
7460 fi
7461
7462                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
7463 if test "$ol_link_threads" = no ; then
7464         # try -pthreads
7465         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
7466 echo "configure:7467: checking for pthread link with -pthreads" >&5
7467 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
7468   echo $ac_n "(cached) $ac_c" 1>&6
7469 else
7470   
7471                 # save the flags
7472                 ol_LIBS="$LIBS"
7473                 LIBS="-pthreads $LIBS"
7474
7475                 if test "$cross_compiling" = yes; then
7476   cat > conftest.$ac_ext <<EOF
7477 #line 7478 "configure"
7478 #include "confdefs.h"
7479 /* pthread test headers */
7480 #include <pthread.h>
7481 #ifndef NULL
7482 #define NULL (void*)0
7483 #endif
7484
7485 static void *task(p)
7486         void *p;
7487 {
7488         return (void *) (p == NULL);
7489 }
7490
7491 int main() {
7492
7493         /* pthread test function */
7494         pthread_t t;
7495         int status;
7496 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7497         /* This system (e.g. AIX) defaults detached; must override */
7498         pthread_attr_t attr;
7499
7500         status = pthread_attr_init(&attr);
7501         if( status ) exit( status );
7502
7503         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7504         if( status ) exit( status );
7505
7506 #define ATTR    &attr
7507 #else
7508 #if HAVE_PTHREADS_D4
7509 #define ATTR    pthread_attr_default
7510 #else
7511 #define ATTR    NULL
7512 #endif
7513 #endif
7514         /* make sure pthread_create() isn't just a stub */
7515         status = pthread_create(&t, ATTR, task, NULL);
7516         if( status ) exit( status );
7517
7518         /* make sure pthread_detach() isn't just a stub */
7519 #if HAVE_PTHREADS_D4
7520         status = pthread_detach( &t );
7521 #else
7522         status = pthread_detach( t );
7523 #endif
7524
7525 #ifdef HAVE_LINUX_THREADS
7526         pthread_kill_other_threads_np();
7527 #endif
7528
7529         exit( status );
7530
7531 ; return 0; }
7532 EOF
7533 if { (eval echo configure:7534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7534   rm -rf conftest*
7535   ol_cv_pthread_pthreads=yes
7536 else
7537   echo "configure: failed program was:" >&5
7538   cat conftest.$ac_ext >&5
7539   rm -rf conftest*
7540   ol_cv_pthread_pthreads=no
7541 fi
7542 rm -f conftest*
7543 else
7544   cat > conftest.$ac_ext <<EOF
7545 #line 7546 "configure"
7546 #include "confdefs.h"
7547 /* pthread test headers */
7548 #include <pthread.h>
7549 #ifndef NULL
7550 #define NULL (void*)0
7551 #endif
7552
7553 static void *task(p)
7554         void *p;
7555 {
7556         return (void *) (p == NULL);
7557 }
7558
7559
7560 int main(argc, argv)
7561         int argc;
7562         char **argv;
7563 {
7564
7565         /* pthread test function */
7566         pthread_t t;
7567         int status;
7568 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7569         /* This system (e.g. AIX) defaults detached; must override */
7570         pthread_attr_t attr;
7571
7572         status = pthread_attr_init(&attr);
7573         if( status ) exit( status );
7574
7575         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7576         if( status ) exit( status );
7577
7578 #define ATTR    &attr
7579 #else
7580 #if HAVE_PTHREADS_D4
7581 #define ATTR    pthread_attr_default
7582 #else
7583 #define ATTR    NULL
7584 #endif
7585 #endif
7586         /* make sure pthread_create() isn't just a stub */
7587         status = pthread_create(&t, ATTR, task, NULL);
7588         if( status ) exit( status );
7589
7590         /* make sure pthread_detach() isn't just a stub */
7591 #if HAVE_PTHREADS_D4
7592         status = pthread_detach( &t );
7593 #else
7594         status = pthread_detach( t );
7595 #endif
7596
7597 #ifdef HAVE_LINUX_THREADS
7598         pthread_kill_other_threads_np();
7599 #endif
7600
7601         exit( status );
7602
7603 }
7604
7605 EOF
7606 if { (eval echo configure:7607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7607 then
7608   ol_cv_pthread_pthreads=yes
7609 else
7610   echo "configure: failed program was:" >&5
7611   cat conftest.$ac_ext >&5
7612   rm -fr conftest*
7613   ol_cv_pthread_pthreads=no
7614 fi
7615 rm -fr conftest*
7616 fi
7617
7618
7619                 # restore the LIBS
7620                 LIBS="$ol_LIBS"
7621         
7622 fi
7623
7624 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
7625
7626         if test $ol_cv_pthread_pthreads = yes ; then
7627                 ol_link_pthreads="-pthreads"
7628                 ol_link_threads=posix
7629         fi
7630 fi
7631
7632                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
7633 if test "$ol_link_threads" = no ; then
7634         # try -mthreads
7635         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
7636 echo "configure:7637: checking for pthread link with -mthreads" >&5
7637 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
7638   echo $ac_n "(cached) $ac_c" 1>&6
7639 else
7640   
7641                 # save the flags
7642                 ol_LIBS="$LIBS"
7643                 LIBS="-mthreads $LIBS"
7644
7645                 if test "$cross_compiling" = yes; then
7646   cat > conftest.$ac_ext <<EOF
7647 #line 7648 "configure"
7648 #include "confdefs.h"
7649 /* pthread test headers */
7650 #include <pthread.h>
7651 #ifndef NULL
7652 #define NULL (void*)0
7653 #endif
7654
7655 static void *task(p)
7656         void *p;
7657 {
7658         return (void *) (p == NULL);
7659 }
7660
7661 int main() {
7662
7663         /* pthread test function */
7664         pthread_t t;
7665         int status;
7666 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7667         /* This system (e.g. AIX) defaults detached; must override */
7668         pthread_attr_t attr;
7669
7670         status = pthread_attr_init(&attr);
7671         if( status ) exit( status );
7672
7673         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7674         if( status ) exit( status );
7675
7676 #define ATTR    &attr
7677 #else
7678 #if HAVE_PTHREADS_D4
7679 #define ATTR    pthread_attr_default
7680 #else
7681 #define ATTR    NULL
7682 #endif
7683 #endif
7684         /* make sure pthread_create() isn't just a stub */
7685         status = pthread_create(&t, ATTR, task, NULL);
7686         if( status ) exit( status );
7687
7688         /* make sure pthread_detach() isn't just a stub */
7689 #if HAVE_PTHREADS_D4
7690         status = pthread_detach( &t );
7691 #else
7692         status = pthread_detach( t );
7693 #endif
7694
7695 #ifdef HAVE_LINUX_THREADS
7696         pthread_kill_other_threads_np();
7697 #endif
7698
7699         exit( status );
7700
7701 ; return 0; }
7702 EOF
7703 if { (eval echo configure:7704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7704   rm -rf conftest*
7705   ol_cv_pthread_mthreads=yes
7706 else
7707   echo "configure: failed program was:" >&5
7708   cat conftest.$ac_ext >&5
7709   rm -rf conftest*
7710   ol_cv_pthread_mthreads=no
7711 fi
7712 rm -f conftest*
7713 else
7714   cat > conftest.$ac_ext <<EOF
7715 #line 7716 "configure"
7716 #include "confdefs.h"
7717 /* pthread test headers */
7718 #include <pthread.h>
7719 #ifndef NULL
7720 #define NULL (void*)0
7721 #endif
7722
7723 static void *task(p)
7724         void *p;
7725 {
7726         return (void *) (p == NULL);
7727 }
7728
7729
7730 int main(argc, argv)
7731         int argc;
7732         char **argv;
7733 {
7734
7735         /* pthread test function */
7736         pthread_t t;
7737         int status;
7738 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7739         /* This system (e.g. AIX) defaults detached; must override */
7740         pthread_attr_t attr;
7741
7742         status = pthread_attr_init(&attr);
7743         if( status ) exit( status );
7744
7745         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7746         if( status ) exit( status );
7747
7748 #define ATTR    &attr
7749 #else
7750 #if HAVE_PTHREADS_D4
7751 #define ATTR    pthread_attr_default
7752 #else
7753 #define ATTR    NULL
7754 #endif
7755 #endif
7756         /* make sure pthread_create() isn't just a stub */
7757         status = pthread_create(&t, ATTR, task, NULL);
7758         if( status ) exit( status );
7759
7760         /* make sure pthread_detach() isn't just a stub */
7761 #if HAVE_PTHREADS_D4
7762         status = pthread_detach( &t );
7763 #else
7764         status = pthread_detach( t );
7765 #endif
7766
7767 #ifdef HAVE_LINUX_THREADS
7768         pthread_kill_other_threads_np();
7769 #endif
7770
7771         exit( status );
7772
7773 }
7774
7775 EOF
7776 if { (eval echo configure:7777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7777 then
7778   ol_cv_pthread_mthreads=yes
7779 else
7780   echo "configure: failed program was:" >&5
7781   cat conftest.$ac_ext >&5
7782   rm -fr conftest*
7783   ol_cv_pthread_mthreads=no
7784 fi
7785 rm -fr conftest*
7786 fi
7787
7788
7789                 # restore the LIBS
7790                 LIBS="$ol_LIBS"
7791         
7792 fi
7793
7794 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
7795
7796         if test $ol_cv_pthread_mthreads = yes ; then
7797                 ol_link_pthreads="-mthreads"
7798                 ol_link_threads=posix
7799         fi
7800 fi
7801
7802                 # Pthread try link: -thread (ol_cv_pthread_thread)
7803 if test "$ol_link_threads" = no ; then
7804         # try -thread
7805         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
7806 echo "configure:7807: checking for pthread link with -thread" >&5
7807 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
7808   echo $ac_n "(cached) $ac_c" 1>&6
7809 else
7810   
7811                 # save the flags
7812                 ol_LIBS="$LIBS"
7813                 LIBS="-thread $LIBS"
7814
7815                 if test "$cross_compiling" = yes; then
7816   cat > conftest.$ac_ext <<EOF
7817 #line 7818 "configure"
7818 #include "confdefs.h"
7819 /* pthread test headers */
7820 #include <pthread.h>
7821 #ifndef NULL
7822 #define NULL (void*)0
7823 #endif
7824
7825 static void *task(p)
7826         void *p;
7827 {
7828         return (void *) (p == NULL);
7829 }
7830
7831 int main() {
7832
7833         /* pthread test function */
7834         pthread_t t;
7835         int status;
7836 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7837         /* This system (e.g. AIX) defaults detached; must override */
7838         pthread_attr_t attr;
7839
7840         status = pthread_attr_init(&attr);
7841         if( status ) exit( status );
7842
7843         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7844         if( status ) exit( status );
7845
7846 #define ATTR    &attr
7847 #else
7848 #if HAVE_PTHREADS_D4
7849 #define ATTR    pthread_attr_default
7850 #else
7851 #define ATTR    NULL
7852 #endif
7853 #endif
7854         /* make sure pthread_create() isn't just a stub */
7855         status = pthread_create(&t, ATTR, task, NULL);
7856         if( status ) exit( status );
7857
7858         /* make sure pthread_detach() isn't just a stub */
7859 #if HAVE_PTHREADS_D4
7860         status = pthread_detach( &t );
7861 #else
7862         status = pthread_detach( t );
7863 #endif
7864
7865 #ifdef HAVE_LINUX_THREADS
7866         pthread_kill_other_threads_np();
7867 #endif
7868
7869         exit( status );
7870
7871 ; return 0; }
7872 EOF
7873 if { (eval echo configure:7874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7874   rm -rf conftest*
7875   ol_cv_pthread_thread=yes
7876 else
7877   echo "configure: failed program was:" >&5
7878   cat conftest.$ac_ext >&5
7879   rm -rf conftest*
7880   ol_cv_pthread_thread=no
7881 fi
7882 rm -f conftest*
7883 else
7884   cat > conftest.$ac_ext <<EOF
7885 #line 7886 "configure"
7886 #include "confdefs.h"
7887 /* pthread test headers */
7888 #include <pthread.h>
7889 #ifndef NULL
7890 #define NULL (void*)0
7891 #endif
7892
7893 static void *task(p)
7894         void *p;
7895 {
7896         return (void *) (p == NULL);
7897 }
7898
7899
7900 int main(argc, argv)
7901         int argc;
7902         char **argv;
7903 {
7904
7905         /* pthread test function */
7906         pthread_t t;
7907         int status;
7908 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7909         /* This system (e.g. AIX) defaults detached; must override */
7910         pthread_attr_t attr;
7911
7912         status = pthread_attr_init(&attr);
7913         if( status ) exit( status );
7914
7915         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7916         if( status ) exit( status );
7917
7918 #define ATTR    &attr
7919 #else
7920 #if HAVE_PTHREADS_D4
7921 #define ATTR    pthread_attr_default
7922 #else
7923 #define ATTR    NULL
7924 #endif
7925 #endif
7926         /* make sure pthread_create() isn't just a stub */
7927         status = pthread_create(&t, ATTR, task, NULL);
7928         if( status ) exit( status );
7929
7930         /* make sure pthread_detach() isn't just a stub */
7931 #if HAVE_PTHREADS_D4
7932         status = pthread_detach( &t );
7933 #else
7934         status = pthread_detach( t );
7935 #endif
7936
7937 #ifdef HAVE_LINUX_THREADS
7938         pthread_kill_other_threads_np();
7939 #endif
7940
7941         exit( status );
7942
7943 }
7944
7945 EOF
7946 if { (eval echo configure:7947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7947 then
7948   ol_cv_pthread_thread=yes
7949 else
7950   echo "configure: failed program was:" >&5
7951   cat conftest.$ac_ext >&5
7952   rm -fr conftest*
7953   ol_cv_pthread_thread=no
7954 fi
7955 rm -fr conftest*
7956 fi
7957
7958
7959                 # restore the LIBS
7960                 LIBS="$ol_LIBS"
7961         
7962 fi
7963
7964 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
7965
7966         if test $ol_cv_pthread_thread = yes ; then
7967                 ol_link_pthreads="-thread"
7968                 ol_link_threads=posix
7969         fi
7970 fi
7971
7972
7973                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
7974 if test "$ol_link_threads" = no ; then
7975         # try -lpthread -lmach -lexc -lc_r
7976         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
7977 echo "configure:7978: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
7978 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
7979   echo $ac_n "(cached) $ac_c" 1>&6
7980 else
7981   
7982                 # save the flags
7983                 ol_LIBS="$LIBS"
7984                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
7985
7986                 if test "$cross_compiling" = yes; then
7987   cat > conftest.$ac_ext <<EOF
7988 #line 7989 "configure"
7989 #include "confdefs.h"
7990 /* pthread test headers */
7991 #include <pthread.h>
7992 #ifndef NULL
7993 #define NULL (void*)0
7994 #endif
7995
7996 static void *task(p)
7997         void *p;
7998 {
7999         return (void *) (p == NULL);
8000 }
8001
8002 int main() {
8003
8004         /* pthread test function */
8005         pthread_t t;
8006         int status;
8007 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8008         /* This system (e.g. AIX) defaults detached; must override */
8009         pthread_attr_t attr;
8010
8011         status = pthread_attr_init(&attr);
8012         if( status ) exit( status );
8013
8014         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8015         if( status ) exit( status );
8016
8017 #define ATTR    &attr
8018 #else
8019 #if HAVE_PTHREADS_D4
8020 #define ATTR    pthread_attr_default
8021 #else
8022 #define ATTR    NULL
8023 #endif
8024 #endif
8025         /* make sure pthread_create() isn't just a stub */
8026         status = pthread_create(&t, ATTR, task, NULL);
8027         if( status ) exit( status );
8028
8029         /* make sure pthread_detach() isn't just a stub */
8030 #if HAVE_PTHREADS_D4
8031         status = pthread_detach( &t );
8032 #else
8033         status = pthread_detach( t );
8034 #endif
8035
8036 #ifdef HAVE_LINUX_THREADS
8037         pthread_kill_other_threads_np();
8038 #endif
8039
8040         exit( status );
8041
8042 ; return 0; }
8043 EOF
8044 if { (eval echo configure:8045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8045   rm -rf conftest*
8046   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8047 else
8048   echo "configure: failed program was:" >&5
8049   cat conftest.$ac_ext >&5
8050   rm -rf conftest*
8051   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8052 fi
8053 rm -f conftest*
8054 else
8055   cat > conftest.$ac_ext <<EOF
8056 #line 8057 "configure"
8057 #include "confdefs.h"
8058 /* pthread test headers */
8059 #include <pthread.h>
8060 #ifndef NULL
8061 #define NULL (void*)0
8062 #endif
8063
8064 static void *task(p)
8065         void *p;
8066 {
8067         return (void *) (p == NULL);
8068 }
8069
8070
8071 int main(argc, argv)
8072         int argc;
8073         char **argv;
8074 {
8075
8076         /* pthread test function */
8077         pthread_t t;
8078         int status;
8079 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8080         /* This system (e.g. AIX) defaults detached; must override */
8081         pthread_attr_t attr;
8082
8083         status = pthread_attr_init(&attr);
8084         if( status ) exit( status );
8085
8086         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8087         if( status ) exit( status );
8088
8089 #define ATTR    &attr
8090 #else
8091 #if HAVE_PTHREADS_D4
8092 #define ATTR    pthread_attr_default
8093 #else
8094 #define ATTR    NULL
8095 #endif
8096 #endif
8097         /* make sure pthread_create() isn't just a stub */
8098         status = pthread_create(&t, ATTR, task, NULL);
8099         if( status ) exit( status );
8100
8101         /* make sure pthread_detach() isn't just a stub */
8102 #if HAVE_PTHREADS_D4
8103         status = pthread_detach( &t );
8104 #else
8105         status = pthread_detach( t );
8106 #endif
8107
8108 #ifdef HAVE_LINUX_THREADS
8109         pthread_kill_other_threads_np();
8110 #endif
8111
8112         exit( status );
8113
8114 }
8115
8116 EOF
8117 if { (eval echo configure:8118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8118 then
8119   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8120 else
8121   echo "configure: failed program was:" >&5
8122   cat conftest.$ac_ext >&5
8123   rm -fr conftest*
8124   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8125 fi
8126 rm -fr conftest*
8127 fi
8128
8129
8130                 # restore the LIBS
8131                 LIBS="$ol_LIBS"
8132         
8133 fi
8134
8135 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
8136
8137         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
8138                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
8139                 ol_link_threads=posix
8140         fi
8141 fi
8142
8143                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
8144 if test "$ol_link_threads" = no ; then
8145         # try -lpthread -lmach -lexc
8146         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
8147 echo "configure:8148: checking for pthread link with -lpthread -lmach -lexc" >&5
8148 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
8149   echo $ac_n "(cached) $ac_c" 1>&6
8150 else
8151   
8152                 # save the flags
8153                 ol_LIBS="$LIBS"
8154                 LIBS="-lpthread -lmach -lexc $LIBS"
8155
8156                 if test "$cross_compiling" = yes; then
8157   cat > conftest.$ac_ext <<EOF
8158 #line 8159 "configure"
8159 #include "confdefs.h"
8160 /* pthread test headers */
8161 #include <pthread.h>
8162 #ifndef NULL
8163 #define NULL (void*)0
8164 #endif
8165
8166 static void *task(p)
8167         void *p;
8168 {
8169         return (void *) (p == NULL);
8170 }
8171
8172 int main() {
8173
8174         /* pthread test function */
8175         pthread_t t;
8176         int status;
8177 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8178         /* This system (e.g. AIX) defaults detached; must override */
8179         pthread_attr_t attr;
8180
8181         status = pthread_attr_init(&attr);
8182         if( status ) exit( status );
8183
8184         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8185         if( status ) exit( status );
8186
8187 #define ATTR    &attr
8188 #else
8189 #if HAVE_PTHREADS_D4
8190 #define ATTR    pthread_attr_default
8191 #else
8192 #define ATTR    NULL
8193 #endif
8194 #endif
8195         /* make sure pthread_create() isn't just a stub */
8196         status = pthread_create(&t, ATTR, task, NULL);
8197         if( status ) exit( status );
8198
8199         /* make sure pthread_detach() isn't just a stub */
8200 #if HAVE_PTHREADS_D4
8201         status = pthread_detach( &t );
8202 #else
8203         status = pthread_detach( t );
8204 #endif
8205
8206 #ifdef HAVE_LINUX_THREADS
8207         pthread_kill_other_threads_np();
8208 #endif
8209
8210         exit( status );
8211
8212 ; return 0; }
8213 EOF
8214 if { (eval echo configure:8215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8215   rm -rf conftest*
8216   ol_cv_pthread_lpthread_lmach_lexc=yes
8217 else
8218   echo "configure: failed program was:" >&5
8219   cat conftest.$ac_ext >&5
8220   rm -rf conftest*
8221   ol_cv_pthread_lpthread_lmach_lexc=no
8222 fi
8223 rm -f conftest*
8224 else
8225   cat > conftest.$ac_ext <<EOF
8226 #line 8227 "configure"
8227 #include "confdefs.h"
8228 /* pthread test headers */
8229 #include <pthread.h>
8230 #ifndef NULL
8231 #define NULL (void*)0
8232 #endif
8233
8234 static void *task(p)
8235         void *p;
8236 {
8237         return (void *) (p == NULL);
8238 }
8239
8240
8241 int main(argc, argv)
8242         int argc;
8243         char **argv;
8244 {
8245
8246         /* pthread test function */
8247         pthread_t t;
8248         int status;
8249 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8250         /* This system (e.g. AIX) defaults detached; must override */
8251         pthread_attr_t attr;
8252
8253         status = pthread_attr_init(&attr);
8254         if( status ) exit( status );
8255
8256         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8257         if( status ) exit( status );
8258
8259 #define ATTR    &attr
8260 #else
8261 #if HAVE_PTHREADS_D4
8262 #define ATTR    pthread_attr_default
8263 #else
8264 #define ATTR    NULL
8265 #endif
8266 #endif
8267         /* make sure pthread_create() isn't just a stub */
8268         status = pthread_create(&t, ATTR, task, NULL);
8269         if( status ) exit( status );
8270
8271         /* make sure pthread_detach() isn't just a stub */
8272 #if HAVE_PTHREADS_D4
8273         status = pthread_detach( &t );
8274 #else
8275         status = pthread_detach( t );
8276 #endif
8277
8278 #ifdef HAVE_LINUX_THREADS
8279         pthread_kill_other_threads_np();
8280 #endif
8281
8282         exit( status );
8283
8284 }
8285
8286 EOF
8287 if { (eval echo configure:8288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8288 then
8289   ol_cv_pthread_lpthread_lmach_lexc=yes
8290 else
8291   echo "configure: failed program was:" >&5
8292   cat conftest.$ac_ext >&5
8293   rm -fr conftest*
8294   ol_cv_pthread_lpthread_lmach_lexc=no
8295 fi
8296 rm -fr conftest*
8297 fi
8298
8299
8300                 # restore the LIBS
8301                 LIBS="$ol_LIBS"
8302         
8303 fi
8304
8305 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
8306
8307         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
8308                 ol_link_pthreads="-lpthread -lmach -lexc"
8309                 ol_link_threads=posix
8310         fi
8311 fi
8312
8313
8314                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
8315 if test "$ol_link_threads" = no ; then
8316         # try -lpthread -Wl,-woff,85
8317         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
8318 echo "configure:8319: checking for pthread link with -lpthread -Wl,-woff,85" >&5
8319 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
8320   echo $ac_n "(cached) $ac_c" 1>&6
8321 else
8322   
8323                 # save the flags
8324                 ol_LIBS="$LIBS"
8325                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
8326
8327                 if test "$cross_compiling" = yes; then
8328   cat > conftest.$ac_ext <<EOF
8329 #line 8330 "configure"
8330 #include "confdefs.h"
8331 /* pthread test headers */
8332 #include <pthread.h>
8333 #ifndef NULL
8334 #define NULL (void*)0
8335 #endif
8336
8337 static void *task(p)
8338         void *p;
8339 {
8340         return (void *) (p == NULL);
8341 }
8342
8343 int main() {
8344
8345         /* pthread test function */
8346         pthread_t t;
8347         int status;
8348 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8349         /* This system (e.g. AIX) defaults detached; must override */
8350         pthread_attr_t attr;
8351
8352         status = pthread_attr_init(&attr);
8353         if( status ) exit( status );
8354
8355         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8356         if( status ) exit( status );
8357
8358 #define ATTR    &attr
8359 #else
8360 #if HAVE_PTHREADS_D4
8361 #define ATTR    pthread_attr_default
8362 #else
8363 #define ATTR    NULL
8364 #endif
8365 #endif
8366         /* make sure pthread_create() isn't just a stub */
8367         status = pthread_create(&t, ATTR, task, NULL);
8368         if( status ) exit( status );
8369
8370         /* make sure pthread_detach() isn't just a stub */
8371 #if HAVE_PTHREADS_D4
8372         status = pthread_detach( &t );
8373 #else
8374         status = pthread_detach( t );
8375 #endif
8376
8377 #ifdef HAVE_LINUX_THREADS
8378         pthread_kill_other_threads_np();
8379 #endif
8380
8381         exit( status );
8382
8383 ; return 0; }
8384 EOF
8385 if { (eval echo configure:8386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8386   rm -rf conftest*
8387   ol_cv_pthread_lib_lpthread_woff=yes
8388 else
8389   echo "configure: failed program was:" >&5
8390   cat conftest.$ac_ext >&5
8391   rm -rf conftest*
8392   ol_cv_pthread_lib_lpthread_woff=no
8393 fi
8394 rm -f conftest*
8395 else
8396   cat > conftest.$ac_ext <<EOF
8397 #line 8398 "configure"
8398 #include "confdefs.h"
8399 /* pthread test headers */
8400 #include <pthread.h>
8401 #ifndef NULL
8402 #define NULL (void*)0
8403 #endif
8404
8405 static void *task(p)
8406         void *p;
8407 {
8408         return (void *) (p == NULL);
8409 }
8410
8411
8412 int main(argc, argv)
8413         int argc;
8414         char **argv;
8415 {
8416
8417         /* pthread test function */
8418         pthread_t t;
8419         int status;
8420 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8421         /* This system (e.g. AIX) defaults detached; must override */
8422         pthread_attr_t attr;
8423
8424         status = pthread_attr_init(&attr);
8425         if( status ) exit( status );
8426
8427         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8428         if( status ) exit( status );
8429
8430 #define ATTR    &attr
8431 #else
8432 #if HAVE_PTHREADS_D4
8433 #define ATTR    pthread_attr_default
8434 #else
8435 #define ATTR    NULL
8436 #endif
8437 #endif
8438         /* make sure pthread_create() isn't just a stub */
8439         status = pthread_create(&t, ATTR, task, NULL);
8440         if( status ) exit( status );
8441
8442         /* make sure pthread_detach() isn't just a stub */
8443 #if HAVE_PTHREADS_D4
8444         status = pthread_detach( &t );
8445 #else
8446         status = pthread_detach( t );
8447 #endif
8448
8449 #ifdef HAVE_LINUX_THREADS
8450         pthread_kill_other_threads_np();
8451 #endif
8452
8453         exit( status );
8454
8455 }
8456
8457 EOF
8458 if { (eval echo configure:8459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8459 then
8460   ol_cv_pthread_lib_lpthread_woff=yes
8461 else
8462   echo "configure: failed program was:" >&5
8463   cat conftest.$ac_ext >&5
8464   rm -fr conftest*
8465   ol_cv_pthread_lib_lpthread_woff=no
8466 fi
8467 rm -fr conftest*
8468 fi
8469
8470
8471                 # restore the LIBS
8472                 LIBS="$ol_LIBS"
8473         
8474 fi
8475
8476 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
8477
8478         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
8479                 ol_link_pthreads="-lpthread -Wl,-woff,85"
8480                 ol_link_threads=posix
8481         fi
8482 fi
8483
8484
8485                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
8486 if test "$ol_link_threads" = no ; then
8487         # try -lpthread
8488         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
8489 echo "configure:8490: checking for pthread link with -lpthread" >&5
8490 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
8491   echo $ac_n "(cached) $ac_c" 1>&6
8492 else
8493   
8494                 # save the flags
8495                 ol_LIBS="$LIBS"
8496                 LIBS="-lpthread $LIBS"
8497
8498                 if test "$cross_compiling" = yes; then
8499   cat > conftest.$ac_ext <<EOF
8500 #line 8501 "configure"
8501 #include "confdefs.h"
8502 /* pthread test headers */
8503 #include <pthread.h>
8504 #ifndef NULL
8505 #define NULL (void*)0
8506 #endif
8507
8508 static void *task(p)
8509         void *p;
8510 {
8511         return (void *) (p == NULL);
8512 }
8513
8514 int main() {
8515
8516         /* pthread test function */
8517         pthread_t t;
8518         int status;
8519 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8520         /* This system (e.g. AIX) defaults detached; must override */
8521         pthread_attr_t attr;
8522
8523         status = pthread_attr_init(&attr);
8524         if( status ) exit( status );
8525
8526         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8527         if( status ) exit( status );
8528
8529 #define ATTR    &attr
8530 #else
8531 #if HAVE_PTHREADS_D4
8532 #define ATTR    pthread_attr_default
8533 #else
8534 #define ATTR    NULL
8535 #endif
8536 #endif
8537         /* make sure pthread_create() isn't just a stub */
8538         status = pthread_create(&t, ATTR, task, NULL);
8539         if( status ) exit( status );
8540
8541         /* make sure pthread_detach() isn't just a stub */
8542 #if HAVE_PTHREADS_D4
8543         status = pthread_detach( &t );
8544 #else
8545         status = pthread_detach( t );
8546 #endif
8547
8548 #ifdef HAVE_LINUX_THREADS
8549         pthread_kill_other_threads_np();
8550 #endif
8551
8552         exit( status );
8553
8554 ; return 0; }
8555 EOF
8556 if { (eval echo configure:8557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8557   rm -rf conftest*
8558   ol_cv_pthread_lpthread=yes
8559 else
8560   echo "configure: failed program was:" >&5
8561   cat conftest.$ac_ext >&5
8562   rm -rf conftest*
8563   ol_cv_pthread_lpthread=no
8564 fi
8565 rm -f conftest*
8566 else
8567   cat > conftest.$ac_ext <<EOF
8568 #line 8569 "configure"
8569 #include "confdefs.h"
8570 /* pthread test headers */
8571 #include <pthread.h>
8572 #ifndef NULL
8573 #define NULL (void*)0
8574 #endif
8575
8576 static void *task(p)
8577         void *p;
8578 {
8579         return (void *) (p == NULL);
8580 }
8581
8582
8583 int main(argc, argv)
8584         int argc;
8585         char **argv;
8586 {
8587
8588         /* pthread test function */
8589         pthread_t t;
8590         int status;
8591 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8592         /* This system (e.g. AIX) defaults detached; must override */
8593         pthread_attr_t attr;
8594
8595         status = pthread_attr_init(&attr);
8596         if( status ) exit( status );
8597
8598         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8599         if( status ) exit( status );
8600
8601 #define ATTR    &attr
8602 #else
8603 #if HAVE_PTHREADS_D4
8604 #define ATTR    pthread_attr_default
8605 #else
8606 #define ATTR    NULL
8607 #endif
8608 #endif
8609         /* make sure pthread_create() isn't just a stub */
8610         status = pthread_create(&t, ATTR, task, NULL);
8611         if( status ) exit( status );
8612
8613         /* make sure pthread_detach() isn't just a stub */
8614 #if HAVE_PTHREADS_D4
8615         status = pthread_detach( &t );
8616 #else
8617         status = pthread_detach( t );
8618 #endif
8619
8620 #ifdef HAVE_LINUX_THREADS
8621         pthread_kill_other_threads_np();
8622 #endif
8623
8624         exit( status );
8625
8626 }
8627
8628 EOF
8629 if { (eval echo configure:8630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8630 then
8631   ol_cv_pthread_lpthread=yes
8632 else
8633   echo "configure: failed program was:" >&5
8634   cat conftest.$ac_ext >&5
8635   rm -fr conftest*
8636   ol_cv_pthread_lpthread=no
8637 fi
8638 rm -fr conftest*
8639 fi
8640
8641
8642                 # restore the LIBS
8643                 LIBS="$ol_LIBS"
8644         
8645 fi
8646
8647 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
8648
8649         if test $ol_cv_pthread_lpthread = yes ; then
8650                 ol_link_pthreads="-lpthread"
8651                 ol_link_threads=posix
8652         fi
8653 fi
8654
8655                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
8656 if test "$ol_link_threads" = no ; then
8657         # try -lc_r
8658         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
8659 echo "configure:8660: checking for pthread link with -lc_r" >&5
8660 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
8661   echo $ac_n "(cached) $ac_c" 1>&6
8662 else
8663   
8664                 # save the flags
8665                 ol_LIBS="$LIBS"
8666                 LIBS="-lc_r $LIBS"
8667
8668                 if test "$cross_compiling" = yes; then
8669   cat > conftest.$ac_ext <<EOF
8670 #line 8671 "configure"
8671 #include "confdefs.h"
8672 /* pthread test headers */
8673 #include <pthread.h>
8674 #ifndef NULL
8675 #define NULL (void*)0
8676 #endif
8677
8678 static void *task(p)
8679         void *p;
8680 {
8681         return (void *) (p == NULL);
8682 }
8683
8684 int main() {
8685
8686         /* pthread test function */
8687         pthread_t t;
8688         int status;
8689 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8690         /* This system (e.g. AIX) defaults detached; must override */
8691         pthread_attr_t attr;
8692
8693         status = pthread_attr_init(&attr);
8694         if( status ) exit( status );
8695
8696         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8697         if( status ) exit( status );
8698
8699 #define ATTR    &attr
8700 #else
8701 #if HAVE_PTHREADS_D4
8702 #define ATTR    pthread_attr_default
8703 #else
8704 #define ATTR    NULL
8705 #endif
8706 #endif
8707         /* make sure pthread_create() isn't just a stub */
8708         status = pthread_create(&t, ATTR, task, NULL);
8709         if( status ) exit( status );
8710
8711         /* make sure pthread_detach() isn't just a stub */
8712 #if HAVE_PTHREADS_D4
8713         status = pthread_detach( &t );
8714 #else
8715         status = pthread_detach( t );
8716 #endif
8717
8718 #ifdef HAVE_LINUX_THREADS
8719         pthread_kill_other_threads_np();
8720 #endif
8721
8722         exit( status );
8723
8724 ; return 0; }
8725 EOF
8726 if { (eval echo configure:8727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8727   rm -rf conftest*
8728   ol_cv_pthread_lc_r=yes
8729 else
8730   echo "configure: failed program was:" >&5
8731   cat conftest.$ac_ext >&5
8732   rm -rf conftest*
8733   ol_cv_pthread_lc_r=no
8734 fi
8735 rm -f conftest*
8736 else
8737   cat > conftest.$ac_ext <<EOF
8738 #line 8739 "configure"
8739 #include "confdefs.h"
8740 /* pthread test headers */
8741 #include <pthread.h>
8742 #ifndef NULL
8743 #define NULL (void*)0
8744 #endif
8745
8746 static void *task(p)
8747         void *p;
8748 {
8749         return (void *) (p == NULL);
8750 }
8751
8752
8753 int main(argc, argv)
8754         int argc;
8755         char **argv;
8756 {
8757
8758         /* pthread test function */
8759         pthread_t t;
8760         int status;
8761 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8762         /* This system (e.g. AIX) defaults detached; must override */
8763         pthread_attr_t attr;
8764
8765         status = pthread_attr_init(&attr);
8766         if( status ) exit( status );
8767
8768         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8769         if( status ) exit( status );
8770
8771 #define ATTR    &attr
8772 #else
8773 #if HAVE_PTHREADS_D4
8774 #define ATTR    pthread_attr_default
8775 #else
8776 #define ATTR    NULL
8777 #endif
8778 #endif
8779         /* make sure pthread_create() isn't just a stub */
8780         status = pthread_create(&t, ATTR, task, NULL);
8781         if( status ) exit( status );
8782
8783         /* make sure pthread_detach() isn't just a stub */
8784 #if HAVE_PTHREADS_D4
8785         status = pthread_detach( &t );
8786 #else
8787         status = pthread_detach( t );
8788 #endif
8789
8790 #ifdef HAVE_LINUX_THREADS
8791         pthread_kill_other_threads_np();
8792 #endif
8793
8794         exit( status );
8795
8796 }
8797
8798 EOF
8799 if { (eval echo configure:8800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8800 then
8801   ol_cv_pthread_lc_r=yes
8802 else
8803   echo "configure: failed program was:" >&5
8804   cat conftest.$ac_ext >&5
8805   rm -fr conftest*
8806   ol_cv_pthread_lc_r=no
8807 fi
8808 rm -fr conftest*
8809 fi
8810
8811
8812                 # restore the LIBS
8813                 LIBS="$ol_LIBS"
8814         
8815 fi
8816
8817 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
8818
8819         if test $ol_cv_pthread_lc_r = yes ; then
8820                 ol_link_pthreads="-lc_r"
8821                 ol_link_threads=posix
8822         fi
8823 fi
8824
8825
8826                 # Pthread try link: -threads (ol_cv_pthread_threads)
8827 if test "$ol_link_threads" = no ; then
8828         # try -threads
8829         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
8830 echo "configure:8831: checking for pthread link with -threads" >&5
8831 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
8832   echo $ac_n "(cached) $ac_c" 1>&6
8833 else
8834   
8835                 # save the flags
8836                 ol_LIBS="$LIBS"
8837                 LIBS="-threads $LIBS"
8838
8839                 if test "$cross_compiling" = yes; then
8840   cat > conftest.$ac_ext <<EOF
8841 #line 8842 "configure"
8842 #include "confdefs.h"
8843 /* pthread test headers */
8844 #include <pthread.h>
8845 #ifndef NULL
8846 #define NULL (void*)0
8847 #endif
8848
8849 static void *task(p)
8850         void *p;
8851 {
8852         return (void *) (p == NULL);
8853 }
8854
8855 int main() {
8856
8857         /* pthread test function */
8858         pthread_t t;
8859         int status;
8860 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8861         /* This system (e.g. AIX) defaults detached; must override */
8862         pthread_attr_t attr;
8863
8864         status = pthread_attr_init(&attr);
8865         if( status ) exit( status );
8866
8867         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8868         if( status ) exit( status );
8869
8870 #define ATTR    &attr
8871 #else
8872 #if HAVE_PTHREADS_D4
8873 #define ATTR    pthread_attr_default
8874 #else
8875 #define ATTR    NULL
8876 #endif
8877 #endif
8878         /* make sure pthread_create() isn't just a stub */
8879         status = pthread_create(&t, ATTR, task, NULL);
8880         if( status ) exit( status );
8881
8882         /* make sure pthread_detach() isn't just a stub */
8883 #if HAVE_PTHREADS_D4
8884         status = pthread_detach( &t );
8885 #else
8886         status = pthread_detach( t );
8887 #endif
8888
8889 #ifdef HAVE_LINUX_THREADS
8890         pthread_kill_other_threads_np();
8891 #endif
8892
8893         exit( status );
8894
8895 ; return 0; }
8896 EOF
8897 if { (eval echo configure:8898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8898   rm -rf conftest*
8899   ol_cv_pthread_threads=yes
8900 else
8901   echo "configure: failed program was:" >&5
8902   cat conftest.$ac_ext >&5
8903   rm -rf conftest*
8904   ol_cv_pthread_threads=no
8905 fi
8906 rm -f conftest*
8907 else
8908   cat > conftest.$ac_ext <<EOF
8909 #line 8910 "configure"
8910 #include "confdefs.h"
8911 /* pthread test headers */
8912 #include <pthread.h>
8913 #ifndef NULL
8914 #define NULL (void*)0
8915 #endif
8916
8917 static void *task(p)
8918         void *p;
8919 {
8920         return (void *) (p == NULL);
8921 }
8922
8923
8924 int main(argc, argv)
8925         int argc;
8926         char **argv;
8927 {
8928
8929         /* pthread test function */
8930         pthread_t t;
8931         int status;
8932 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8933         /* This system (e.g. AIX) defaults detached; must override */
8934         pthread_attr_t attr;
8935
8936         status = pthread_attr_init(&attr);
8937         if( status ) exit( status );
8938
8939         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8940         if( status ) exit( status );
8941
8942 #define ATTR    &attr
8943 #else
8944 #if HAVE_PTHREADS_D4
8945 #define ATTR    pthread_attr_default
8946 #else
8947 #define ATTR    NULL
8948 #endif
8949 #endif
8950         /* make sure pthread_create() isn't just a stub */
8951         status = pthread_create(&t, ATTR, task, NULL);
8952         if( status ) exit( status );
8953
8954         /* make sure pthread_detach() isn't just a stub */
8955 #if HAVE_PTHREADS_D4
8956         status = pthread_detach( &t );
8957 #else
8958         status = pthread_detach( t );
8959 #endif
8960
8961 #ifdef HAVE_LINUX_THREADS
8962         pthread_kill_other_threads_np();
8963 #endif
8964
8965         exit( status );
8966
8967 }
8968
8969 EOF
8970 if { (eval echo configure:8971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8971 then
8972   ol_cv_pthread_threads=yes
8973 else
8974   echo "configure: failed program was:" >&5
8975   cat conftest.$ac_ext >&5
8976   rm -fr conftest*
8977   ol_cv_pthread_threads=no
8978 fi
8979 rm -fr conftest*
8980 fi
8981
8982
8983                 # restore the LIBS
8984                 LIBS="$ol_LIBS"
8985         
8986 fi
8987
8988 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
8989
8990         if test $ol_cv_pthread_threads = yes ; then
8991                 ol_link_pthreads="-threads"
8992                 ol_link_threads=posix
8993         fi
8994 fi
8995
8996
8997                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
8998 if test "$ol_link_threads" = no ; then
8999         # try -lpthreads -lmach -lexc -lc_r
9000         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
9001 echo "configure:9002: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
9002 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
9003   echo $ac_n "(cached) $ac_c" 1>&6
9004 else
9005   
9006                 # save the flags
9007                 ol_LIBS="$LIBS"
9008                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
9009
9010                 if test "$cross_compiling" = yes; then
9011   cat > conftest.$ac_ext <<EOF
9012 #line 9013 "configure"
9013 #include "confdefs.h"
9014 /* pthread test headers */
9015 #include <pthread.h>
9016 #ifndef NULL
9017 #define NULL (void*)0
9018 #endif
9019
9020 static void *task(p)
9021         void *p;
9022 {
9023         return (void *) (p == NULL);
9024 }
9025
9026 int main() {
9027
9028         /* pthread test function */
9029         pthread_t t;
9030         int status;
9031 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9032         /* This system (e.g. AIX) defaults detached; must override */
9033         pthread_attr_t attr;
9034
9035         status = pthread_attr_init(&attr);
9036         if( status ) exit( status );
9037
9038         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9039         if( status ) exit( status );
9040
9041 #define ATTR    &attr
9042 #else
9043 #if HAVE_PTHREADS_D4
9044 #define ATTR    pthread_attr_default
9045 #else
9046 #define ATTR    NULL
9047 #endif
9048 #endif
9049         /* make sure pthread_create() isn't just a stub */
9050         status = pthread_create(&t, ATTR, task, NULL);
9051         if( status ) exit( status );
9052
9053         /* make sure pthread_detach() isn't just a stub */
9054 #if HAVE_PTHREADS_D4
9055         status = pthread_detach( &t );
9056 #else
9057         status = pthread_detach( t );
9058 #endif
9059
9060 #ifdef HAVE_LINUX_THREADS
9061         pthread_kill_other_threads_np();
9062 #endif
9063
9064         exit( status );
9065
9066 ; return 0; }
9067 EOF
9068 if { (eval echo configure:9069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9069   rm -rf conftest*
9070   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
9071 else
9072   echo "configure: failed program was:" >&5
9073   cat conftest.$ac_ext >&5
9074   rm -rf conftest*
9075   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
9076 fi
9077 rm -f conftest*
9078 else
9079   cat > conftest.$ac_ext <<EOF
9080 #line 9081 "configure"
9081 #include "confdefs.h"
9082 /* pthread test headers */
9083 #include <pthread.h>
9084 #ifndef NULL
9085 #define NULL (void*)0
9086 #endif
9087
9088 static void *task(p)
9089         void *p;
9090 {
9091         return (void *) (p == NULL);
9092 }
9093
9094
9095 int main(argc, argv)
9096         int argc;
9097         char **argv;
9098 {
9099
9100         /* pthread test function */
9101         pthread_t t;
9102         int status;
9103 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9104         /* This system (e.g. AIX) defaults detached; must override */
9105         pthread_attr_t attr;
9106
9107         status = pthread_attr_init(&attr);
9108         if( status ) exit( status );
9109
9110         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9111         if( status ) exit( status );
9112
9113 #define ATTR    &attr
9114 #else
9115 #if HAVE_PTHREADS_D4
9116 #define ATTR    pthread_attr_default
9117 #else
9118 #define ATTR    NULL
9119 #endif
9120 #endif
9121         /* make sure pthread_create() isn't just a stub */
9122         status = pthread_create(&t, ATTR, task, NULL);
9123         if( status ) exit( status );
9124
9125         /* make sure pthread_detach() isn't just a stub */
9126 #if HAVE_PTHREADS_D4
9127         status = pthread_detach( &t );
9128 #else
9129         status = pthread_detach( t );
9130 #endif
9131
9132 #ifdef HAVE_LINUX_THREADS
9133         pthread_kill_other_threads_np();
9134 #endif
9135
9136         exit( status );
9137
9138 }
9139
9140 EOF
9141 if { (eval echo configure:9142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9142 then
9143   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
9144 else
9145   echo "configure: failed program was:" >&5
9146   cat conftest.$ac_ext >&5
9147   rm -fr conftest*
9148   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
9149 fi
9150 rm -fr conftest*
9151 fi
9152
9153
9154                 # restore the LIBS
9155                 LIBS="$ol_LIBS"
9156         
9157 fi
9158
9159 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
9160
9161         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
9162                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
9163                 ol_link_threads=posix
9164         fi
9165 fi
9166
9167                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
9168 if test "$ol_link_threads" = no ; then
9169         # try -lpthreads -lmach -lexc
9170         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
9171 echo "configure:9172: checking for pthread link with -lpthreads -lmach -lexc" >&5
9172 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
9173   echo $ac_n "(cached) $ac_c" 1>&6
9174 else
9175   
9176                 # save the flags
9177                 ol_LIBS="$LIBS"
9178                 LIBS="-lpthreads -lmach -lexc $LIBS"
9179
9180                 if test "$cross_compiling" = yes; then
9181   cat > conftest.$ac_ext <<EOF
9182 #line 9183 "configure"
9183 #include "confdefs.h"
9184 /* pthread test headers */
9185 #include <pthread.h>
9186 #ifndef NULL
9187 #define NULL (void*)0
9188 #endif
9189
9190 static void *task(p)
9191         void *p;
9192 {
9193         return (void *) (p == NULL);
9194 }
9195
9196 int main() {
9197
9198         /* pthread test function */
9199         pthread_t t;
9200         int status;
9201 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9202         /* This system (e.g. AIX) defaults detached; must override */
9203         pthread_attr_t attr;
9204
9205         status = pthread_attr_init(&attr);
9206         if( status ) exit( status );
9207
9208         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9209         if( status ) exit( status );
9210
9211 #define ATTR    &attr
9212 #else
9213 #if HAVE_PTHREADS_D4
9214 #define ATTR    pthread_attr_default
9215 #else
9216 #define ATTR    NULL
9217 #endif
9218 #endif
9219         /* make sure pthread_create() isn't just a stub */
9220         status = pthread_create(&t, ATTR, task, NULL);
9221         if( status ) exit( status );
9222
9223         /* make sure pthread_detach() isn't just a stub */
9224 #if HAVE_PTHREADS_D4
9225         status = pthread_detach( &t );
9226 #else
9227         status = pthread_detach( t );
9228 #endif
9229
9230 #ifdef HAVE_LINUX_THREADS
9231         pthread_kill_other_threads_np();
9232 #endif
9233
9234         exit( status );
9235
9236 ; return 0; }
9237 EOF
9238 if { (eval echo configure:9239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9239   rm -rf conftest*
9240   ol_cv_pthread_lpthreads_lmach_lexc=yes
9241 else
9242   echo "configure: failed program was:" >&5
9243   cat conftest.$ac_ext >&5
9244   rm -rf conftest*
9245   ol_cv_pthread_lpthreads_lmach_lexc=no
9246 fi
9247 rm -f conftest*
9248 else
9249   cat > conftest.$ac_ext <<EOF
9250 #line 9251 "configure"
9251 #include "confdefs.h"
9252 /* pthread test headers */
9253 #include <pthread.h>
9254 #ifndef NULL
9255 #define NULL (void*)0
9256 #endif
9257
9258 static void *task(p)
9259         void *p;
9260 {
9261         return (void *) (p == NULL);
9262 }
9263
9264
9265 int main(argc, argv)
9266         int argc;
9267         char **argv;
9268 {
9269
9270         /* pthread test function */
9271         pthread_t t;
9272         int status;
9273 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9274         /* This system (e.g. AIX) defaults detached; must override */
9275         pthread_attr_t attr;
9276
9277         status = pthread_attr_init(&attr);
9278         if( status ) exit( status );
9279
9280         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9281         if( status ) exit( status );
9282
9283 #define ATTR    &attr
9284 #else
9285 #if HAVE_PTHREADS_D4
9286 #define ATTR    pthread_attr_default
9287 #else
9288 #define ATTR    NULL
9289 #endif
9290 #endif
9291         /* make sure pthread_create() isn't just a stub */
9292         status = pthread_create(&t, ATTR, task, NULL);
9293         if( status ) exit( status );
9294
9295         /* make sure pthread_detach() isn't just a stub */
9296 #if HAVE_PTHREADS_D4
9297         status = pthread_detach( &t );
9298 #else
9299         status = pthread_detach( t );
9300 #endif
9301
9302 #ifdef HAVE_LINUX_THREADS
9303         pthread_kill_other_threads_np();
9304 #endif
9305
9306         exit( status );
9307
9308 }
9309
9310 EOF
9311 if { (eval echo configure:9312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9312 then
9313   ol_cv_pthread_lpthreads_lmach_lexc=yes
9314 else
9315   echo "configure: failed program was:" >&5
9316   cat conftest.$ac_ext >&5
9317   rm -fr conftest*
9318   ol_cv_pthread_lpthreads_lmach_lexc=no
9319 fi
9320 rm -fr conftest*
9321 fi
9322
9323
9324                 # restore the LIBS
9325                 LIBS="$ol_LIBS"
9326         
9327 fi
9328
9329 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
9330
9331         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
9332                 ol_link_pthreads="-lpthreads -lmach -lexc"
9333                 ol_link_threads=posix
9334         fi
9335 fi
9336
9337                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
9338 if test "$ol_link_threads" = no ; then
9339         # try -lpthreads -lexc
9340         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
9341 echo "configure:9342: checking for pthread link with -lpthreads -lexc" >&5
9342 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
9343   echo $ac_n "(cached) $ac_c" 1>&6
9344 else
9345   
9346                 # save the flags
9347                 ol_LIBS="$LIBS"
9348                 LIBS="-lpthreads -lexc $LIBS"
9349
9350                 if test "$cross_compiling" = yes; then
9351   cat > conftest.$ac_ext <<EOF
9352 #line 9353 "configure"
9353 #include "confdefs.h"
9354 /* pthread test headers */
9355 #include <pthread.h>
9356 #ifndef NULL
9357 #define NULL (void*)0
9358 #endif
9359
9360 static void *task(p)
9361         void *p;
9362 {
9363         return (void *) (p == NULL);
9364 }
9365
9366 int main() {
9367
9368         /* pthread test function */
9369         pthread_t t;
9370         int status;
9371 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9372         /* This system (e.g. AIX) defaults detached; must override */
9373         pthread_attr_t attr;
9374
9375         status = pthread_attr_init(&attr);
9376         if( status ) exit( status );
9377
9378         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9379         if( status ) exit( status );
9380
9381 #define ATTR    &attr
9382 #else
9383 #if HAVE_PTHREADS_D4
9384 #define ATTR    pthread_attr_default
9385 #else
9386 #define ATTR    NULL
9387 #endif
9388 #endif
9389         /* make sure pthread_create() isn't just a stub */
9390         status = pthread_create(&t, ATTR, task, NULL);
9391         if( status ) exit( status );
9392
9393         /* make sure pthread_detach() isn't just a stub */
9394 #if HAVE_PTHREADS_D4
9395         status = pthread_detach( &t );
9396 #else
9397         status = pthread_detach( t );
9398 #endif
9399
9400 #ifdef HAVE_LINUX_THREADS
9401         pthread_kill_other_threads_np();
9402 #endif
9403
9404         exit( status );
9405
9406 ; return 0; }
9407 EOF
9408 if { (eval echo configure:9409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9409   rm -rf conftest*
9410   ol_cv_pthread_lpthreads_lexc=yes
9411 else
9412   echo "configure: failed program was:" >&5
9413   cat conftest.$ac_ext >&5
9414   rm -rf conftest*
9415   ol_cv_pthread_lpthreads_lexc=no
9416 fi
9417 rm -f conftest*
9418 else
9419   cat > conftest.$ac_ext <<EOF
9420 #line 9421 "configure"
9421 #include "confdefs.h"
9422 /* pthread test headers */
9423 #include <pthread.h>
9424 #ifndef NULL
9425 #define NULL (void*)0
9426 #endif
9427
9428 static void *task(p)
9429         void *p;
9430 {
9431         return (void *) (p == NULL);
9432 }
9433
9434
9435 int main(argc, argv)
9436         int argc;
9437         char **argv;
9438 {
9439
9440         /* pthread test function */
9441         pthread_t t;
9442         int status;
9443 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9444         /* This system (e.g. AIX) defaults detached; must override */
9445         pthread_attr_t attr;
9446
9447         status = pthread_attr_init(&attr);
9448         if( status ) exit( status );
9449
9450         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9451         if( status ) exit( status );
9452
9453 #define ATTR    &attr
9454 #else
9455 #if HAVE_PTHREADS_D4
9456 #define ATTR    pthread_attr_default
9457 #else
9458 #define ATTR    NULL
9459 #endif
9460 #endif
9461         /* make sure pthread_create() isn't just a stub */
9462         status = pthread_create(&t, ATTR, task, NULL);
9463         if( status ) exit( status );
9464
9465         /* make sure pthread_detach() isn't just a stub */
9466 #if HAVE_PTHREADS_D4
9467         status = pthread_detach( &t );
9468 #else
9469         status = pthread_detach( t );
9470 #endif
9471
9472 #ifdef HAVE_LINUX_THREADS
9473         pthread_kill_other_threads_np();
9474 #endif
9475
9476         exit( status );
9477
9478 }
9479
9480 EOF
9481 if { (eval echo configure:9482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9482 then
9483   ol_cv_pthread_lpthreads_lexc=yes
9484 else
9485   echo "configure: failed program was:" >&5
9486   cat conftest.$ac_ext >&5
9487   rm -fr conftest*
9488   ol_cv_pthread_lpthreads_lexc=no
9489 fi
9490 rm -fr conftest*
9491 fi
9492
9493
9494                 # restore the LIBS
9495                 LIBS="$ol_LIBS"
9496         
9497 fi
9498
9499 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
9500
9501         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
9502                 ol_link_pthreads="-lpthreads -lexc"
9503                 ol_link_threads=posix
9504         fi
9505 fi
9506
9507
9508                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
9509 if test "$ol_link_threads" = no ; then
9510         # try -lpthreads
9511         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
9512 echo "configure:9513: checking for pthread link with -lpthreads" >&5
9513 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
9514   echo $ac_n "(cached) $ac_c" 1>&6
9515 else
9516   
9517                 # save the flags
9518                 ol_LIBS="$LIBS"
9519                 LIBS="-lpthreads $LIBS"
9520
9521                 if test "$cross_compiling" = yes; then
9522   cat > conftest.$ac_ext <<EOF
9523 #line 9524 "configure"
9524 #include "confdefs.h"
9525 /* pthread test headers */
9526 #include <pthread.h>
9527 #ifndef NULL
9528 #define NULL (void*)0
9529 #endif
9530
9531 static void *task(p)
9532         void *p;
9533 {
9534         return (void *) (p == NULL);
9535 }
9536
9537 int main() {
9538
9539         /* pthread test function */
9540         pthread_t t;
9541         int status;
9542 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9543         /* This system (e.g. AIX) defaults detached; must override */
9544         pthread_attr_t attr;
9545
9546         status = pthread_attr_init(&attr);
9547         if( status ) exit( status );
9548
9549         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9550         if( status ) exit( status );
9551
9552 #define ATTR    &attr
9553 #else
9554 #if HAVE_PTHREADS_D4
9555 #define ATTR    pthread_attr_default
9556 #else
9557 #define ATTR    NULL
9558 #endif
9559 #endif
9560         /* make sure pthread_create() isn't just a stub */
9561         status = pthread_create(&t, ATTR, task, NULL);
9562         if( status ) exit( status );
9563
9564         /* make sure pthread_detach() isn't just a stub */
9565 #if HAVE_PTHREADS_D4
9566         status = pthread_detach( &t );
9567 #else
9568         status = pthread_detach( t );
9569 #endif
9570
9571 #ifdef HAVE_LINUX_THREADS
9572         pthread_kill_other_threads_np();
9573 #endif
9574
9575         exit( status );
9576
9577 ; return 0; }
9578 EOF
9579 if { (eval echo configure:9580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9580   rm -rf conftest*
9581   ol_cv_pthread_lib_lpthreads=yes
9582 else
9583   echo "configure: failed program was:" >&5
9584   cat conftest.$ac_ext >&5
9585   rm -rf conftest*
9586   ol_cv_pthread_lib_lpthreads=no
9587 fi
9588 rm -f conftest*
9589 else
9590   cat > conftest.$ac_ext <<EOF
9591 #line 9592 "configure"
9592 #include "confdefs.h"
9593 /* pthread test headers */
9594 #include <pthread.h>
9595 #ifndef NULL
9596 #define NULL (void*)0
9597 #endif
9598
9599 static void *task(p)
9600         void *p;
9601 {
9602         return (void *) (p == NULL);
9603 }
9604
9605
9606 int main(argc, argv)
9607         int argc;
9608         char **argv;
9609 {
9610
9611         /* pthread test function */
9612         pthread_t t;
9613         int status;
9614 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9615         /* This system (e.g. AIX) defaults detached; must override */
9616         pthread_attr_t attr;
9617
9618         status = pthread_attr_init(&attr);
9619         if( status ) exit( status );
9620
9621         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9622         if( status ) exit( status );
9623
9624 #define ATTR    &attr
9625 #else
9626 #if HAVE_PTHREADS_D4
9627 #define ATTR    pthread_attr_default
9628 #else
9629 #define ATTR    NULL
9630 #endif
9631 #endif
9632         /* make sure pthread_create() isn't just a stub */
9633         status = pthread_create(&t, ATTR, task, NULL);
9634         if( status ) exit( status );
9635
9636         /* make sure pthread_detach() isn't just a stub */
9637 #if HAVE_PTHREADS_D4
9638         status = pthread_detach( &t );
9639 #else
9640         status = pthread_detach( t );
9641 #endif
9642
9643 #ifdef HAVE_LINUX_THREADS
9644         pthread_kill_other_threads_np();
9645 #endif
9646
9647         exit( status );
9648
9649 }
9650
9651 EOF
9652 if { (eval echo configure:9653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9653 then
9654   ol_cv_pthread_lib_lpthreads=yes
9655 else
9656   echo "configure: failed program was:" >&5
9657   cat conftest.$ac_ext >&5
9658   rm -fr conftest*
9659   ol_cv_pthread_lib_lpthreads=no
9660 fi
9661 rm -fr conftest*
9662 fi
9663
9664
9665                 # restore the LIBS
9666                 LIBS="$ol_LIBS"
9667         
9668 fi
9669
9670 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
9671
9672         if test $ol_cv_pthread_lib_lpthreads = yes ; then
9673                 ol_link_pthreads="-lpthreads"
9674                 ol_link_threads=posix
9675         fi
9676 fi
9677
9678
9679                 if test $ol_link_threads != no ; then
9680                         cat >> confdefs.h <<\EOF
9681 #define HAVE_PTHREADS 1
9682 EOF
9683
9684
9685                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
9686
9687                                                 save_CPPFLAGS="$CPPFLAGS"
9688                         save_LIBS="$LIBS"
9689                         LIBS="$LTHREAD_LIBS $LIBS"
9690
9691                                                                                                 for ac_func in sched_yield pthread_yield
9692 do
9693 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9694 echo "configure:9695: checking for $ac_func" >&5
9695 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9696   echo $ac_n "(cached) $ac_c" 1>&6
9697 else
9698   cat > conftest.$ac_ext <<EOF
9699 #line 9700 "configure"
9700 #include "confdefs.h"
9701 /* System header to define __stub macros and hopefully few prototypes,
9702     which can conflict with char $ac_func(); below.  */
9703 #include <assert.h>
9704 /* Override any gcc2 internal prototype to avoid an error.  */
9705 /* We use char because int might match the return type of a gcc2
9706     builtin and then its argument prototype would still apply.  */
9707 char $ac_func();
9708 char (*f)();
9709
9710 int main() {
9711
9712 /* The GNU C library defines this for functions which it implements
9713     to always fail with ENOSYS.  Some functions are actually named
9714     something starting with __ and the normal name is an alias.  */
9715 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9716 choke me
9717 #else
9718 f = $ac_func;
9719 #endif
9720
9721 ; return 0; }
9722 EOF
9723 if { (eval echo configure:9724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9724   rm -rf conftest*
9725   eval "ac_cv_func_$ac_func=yes"
9726 else
9727   echo "configure: failed program was:" >&5
9728   cat conftest.$ac_ext >&5
9729   rm -rf conftest*
9730   eval "ac_cv_func_$ac_func=no"
9731 fi
9732 rm -f conftest*
9733 fi
9734
9735 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9736   echo "$ac_t""yes" 1>&6
9737     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9738   cat >> confdefs.h <<EOF
9739 #define $ac_tr_func 1
9740 EOF
9741  
9742 else
9743   echo "$ac_t""no" 1>&6
9744 fi
9745 done
9746
9747
9748                         if test $ac_cv_func_sched_yield = no -a \
9749                                 $ac_cv_func_pthread_yield = no ; then
9750                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
9751 echo "configure:9752: checking for sched_yield in -lrt" >&5
9752 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
9753 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9754   echo $ac_n "(cached) $ac_c" 1>&6
9755 else
9756   ac_save_LIBS="$LIBS"
9757 LIBS="-lrt  $LIBS"
9758 cat > conftest.$ac_ext <<EOF
9759 #line 9760 "configure"
9760 #include "confdefs.h"
9761 /* Override any gcc2 internal prototype to avoid an error.  */
9762 /* We use char because int might match the return type of a gcc2
9763     builtin and then its argument prototype would still apply.  */
9764 char sched_yield();
9765
9766 int main() {
9767 sched_yield()
9768 ; return 0; }
9769 EOF
9770 if { (eval echo configure:9771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9771   rm -rf conftest*
9772   eval "ac_cv_lib_$ac_lib_var=yes"
9773 else
9774   echo "configure: failed program was:" >&5
9775   cat conftest.$ac_ext >&5
9776   rm -rf conftest*
9777   eval "ac_cv_lib_$ac_lib_var=no"
9778 fi
9779 rm -f conftest*
9780 LIBS="$ac_save_LIBS"
9781
9782 fi
9783 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9784   echo "$ac_t""yes" 1>&6
9785   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
9786                                         cat >> confdefs.h <<\EOF
9787 #define HAVE_SCHED_YIELD 1
9788 EOF
9789
9790                                         ac_cv_func_sched_yield=yes
9791 else
9792   echo "$ac_t""no" 1>&6
9793 ac_cv_func_sched_yield=no
9794 fi
9795
9796                         fi
9797                         if test $ac_cv_func_sched_yield = no -a \
9798                                 $ac_cv_func_pthread_yield = no ; then
9799                                                                                                 for ac_func in thr_yield
9800 do
9801 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9802 echo "configure:9803: checking for $ac_func" >&5
9803 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9804   echo $ac_n "(cached) $ac_c" 1>&6
9805 else
9806   cat > conftest.$ac_ext <<EOF
9807 #line 9808 "configure"
9808 #include "confdefs.h"
9809 /* System header to define __stub macros and hopefully few prototypes,
9810     which can conflict with char $ac_func(); below.  */
9811 #include <assert.h>
9812 /* Override any gcc2 internal prototype to avoid an error.  */
9813 /* We use char because int might match the return type of a gcc2
9814     builtin and then its argument prototype would still apply.  */
9815 char $ac_func();
9816 char (*f)();
9817
9818 int main() {
9819
9820 /* The GNU C library defines this for functions which it implements
9821     to always fail with ENOSYS.  Some functions are actually named
9822     something starting with __ and the normal name is an alias.  */
9823 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9824 choke me
9825 #else
9826 f = $ac_func;
9827 #endif
9828
9829 ; return 0; }
9830 EOF
9831 if { (eval echo configure:9832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9832   rm -rf conftest*
9833   eval "ac_cv_func_$ac_func=yes"
9834 else
9835   echo "configure: failed program was:" >&5
9836   cat conftest.$ac_ext >&5
9837   rm -rf conftest*
9838   eval "ac_cv_func_$ac_func=no"
9839 fi
9840 rm -f conftest*
9841 fi
9842
9843 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9844   echo "$ac_t""yes" 1>&6
9845     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9846   cat >> confdefs.h <<EOF
9847 #define $ac_tr_func 1
9848 EOF
9849  
9850 else
9851   echo "$ac_t""no" 1>&6
9852 fi
9853 done
9854
9855                         fi
9856                         if test $ac_cv_func_sched_yield = no -a \
9857                                 $ac_cv_func_pthread_yield = no -a \
9858                                 "$ac_cv_func_thr_yield" = no ; then
9859                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
9860                         fi
9861
9862                                                 for ac_func in pthread_kill pthread_rwlock_destroy
9863 do
9864 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9865 echo "configure:9866: checking for $ac_func" >&5
9866 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9867   echo $ac_n "(cached) $ac_c" 1>&6
9868 else
9869   cat > conftest.$ac_ext <<EOF
9870 #line 9871 "configure"
9871 #include "confdefs.h"
9872 /* System header to define __stub macros and hopefully few prototypes,
9873     which can conflict with char $ac_func(); below.  */
9874 #include <assert.h>
9875 /* Override any gcc2 internal prototype to avoid an error.  */
9876 /* We use char because int might match the return type of a gcc2
9877     builtin and then its argument prototype would still apply.  */
9878 char $ac_func();
9879 char (*f)();
9880
9881 int main() {
9882
9883 /* The GNU C library defines this for functions which it implements
9884     to always fail with ENOSYS.  Some functions are actually named
9885     something starting with __ and the normal name is an alias.  */
9886 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9887 choke me
9888 #else
9889 f = $ac_func;
9890 #endif
9891
9892 ; return 0; }
9893 EOF
9894 if { (eval echo configure:9895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9895   rm -rf conftest*
9896   eval "ac_cv_func_$ac_func=yes"
9897 else
9898   echo "configure: failed program was:" >&5
9899   cat conftest.$ac_ext >&5
9900   rm -rf conftest*
9901   eval "ac_cv_func_$ac_func=no"
9902 fi
9903 rm -f conftest*
9904 fi
9905
9906 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9907   echo "$ac_t""yes" 1>&6
9908     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9909   cat >> confdefs.h <<EOF
9910 #define $ac_tr_func 1
9911 EOF
9912  
9913 else
9914   echo "$ac_t""no" 1>&6
9915 fi
9916 done
9917
9918
9919                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
9920 echo "configure:9921: checking for pthread_detach with <pthread.h>" >&5
9921 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
9922   echo $ac_n "(cached) $ac_c" 1>&6
9923 else
9924   
9925                                                                 cat > conftest.$ac_ext <<EOF
9926 #line 9927 "configure"
9927 #include "confdefs.h"
9928
9929 #include <pthread.h>
9930 #ifndef NULL
9931 #define NULL (void*)0
9932 #endif
9933
9934 int main() {
9935 pthread_detach(NULL);
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   ol_cv_func_pthread_detach=yes
9941 else
9942   echo "configure: failed program was:" >&5
9943   cat conftest.$ac_ext >&5
9944   rm -rf conftest*
9945   ol_cv_func_pthread_detach=no
9946 fi
9947 rm -f conftest*
9948                         
9949 fi
9950
9951 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
9952
9953                         if test $ol_cv_func_pthread_detach = no ; then
9954                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
9955                         fi
9956
9957                         cat >> confdefs.h <<\EOF
9958 #define HAVE_PTHREAD_DETACH 1
9959 EOF
9960
9961
9962                                                 for ac_func in \
9963                                 pthread_setconcurrency \
9964                                 pthread_getconcurrency \
9965                                 thr_setconcurrency \
9966                                 thr_getconcurrency \
9967                         
9968 do
9969 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9970 echo "configure:9971: checking for $ac_func" >&5
9971 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9972   echo $ac_n "(cached) $ac_c" 1>&6
9973 else
9974   cat > conftest.$ac_ext <<EOF
9975 #line 9976 "configure"
9976 #include "confdefs.h"
9977 /* System header to define __stub macros and hopefully few prototypes,
9978     which can conflict with char $ac_func(); below.  */
9979 #include <assert.h>
9980 /* Override any gcc2 internal prototype to avoid an error.  */
9981 /* We use char because int might match the return type of a gcc2
9982     builtin and then its argument prototype would still apply.  */
9983 char $ac_func();
9984 char (*f)();
9985
9986 int main() {
9987
9988 /* The GNU C library defines this for functions which it implements
9989     to always fail with ENOSYS.  Some functions are actually named
9990     something starting with __ and the normal name is an alias.  */
9991 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9992 choke me
9993 #else
9994 f = $ac_func;
9995 #endif
9996
9997 ; return 0; }
9998 EOF
9999 if { (eval echo configure:10000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10000   rm -rf conftest*
10001   eval "ac_cv_func_$ac_func=yes"
10002 else
10003   echo "configure: failed program was:" >&5
10004   cat conftest.$ac_ext >&5
10005   rm -rf conftest*
10006   eval "ac_cv_func_$ac_func=no"
10007 fi
10008 rm -f conftest*
10009 fi
10010
10011 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10012   echo "$ac_t""yes" 1>&6
10013     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10014   cat >> confdefs.h <<EOF
10015 #define $ac_tr_func 1
10016 EOF
10017  
10018 else
10019   echo "$ac_t""no" 1>&6
10020 fi
10021 done
10022
10023
10024                         
10025         for ac_func in pthread_kill_other_threads_np
10026 do
10027 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10028 echo "configure:10029: checking for $ac_func" >&5
10029 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10030   echo $ac_n "(cached) $ac_c" 1>&6
10031 else
10032   cat > conftest.$ac_ext <<EOF
10033 #line 10034 "configure"
10034 #include "confdefs.h"
10035 /* System header to define __stub macros and hopefully few prototypes,
10036     which can conflict with char $ac_func(); below.  */
10037 #include <assert.h>
10038 /* Override any gcc2 internal prototype to avoid an error.  */
10039 /* We use char because int might match the return type of a gcc2
10040     builtin and then its argument prototype would still apply.  */
10041 char $ac_func();
10042 char (*f)();
10043
10044 int main() {
10045
10046 /* The GNU C library defines this for functions which it implements
10047     to always fail with ENOSYS.  Some functions are actually named
10048     something starting with __ and the normal name is an alias.  */
10049 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10050 choke me
10051 #else
10052 f = $ac_func;
10053 #endif
10054
10055 ; return 0; }
10056 EOF
10057 if { (eval echo configure:10058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10058   rm -rf conftest*
10059   eval "ac_cv_func_$ac_func=yes"
10060 else
10061   echo "configure: failed program was:" >&5
10062   cat conftest.$ac_ext >&5
10063   rm -rf conftest*
10064   eval "ac_cv_func_$ac_func=no"
10065 fi
10066 rm -f conftest*
10067 fi
10068
10069 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10070   echo "$ac_t""yes" 1>&6
10071     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10072   cat >> confdefs.h <<EOF
10073 #define $ac_tr_func 1
10074 EOF
10075  
10076 else
10077   echo "$ac_t""no" 1>&6
10078 fi
10079 done
10080
10081         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
10082 echo "configure:10083: checking for LinuxThreads implementation" >&5
10083 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
10084   echo $ac_n "(cached) $ac_c" 1>&6
10085 else
10086   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
10087 fi
10088
10089 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
10090
10091                         
10092         
10093         
10094         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
10095 echo "configure:10096: checking for LinuxThreads consistency" >&5
10096 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
10097   echo $ac_n "(cached) $ac_c" 1>&6
10098 else
10099   
10100                 if test $ol_cv_header_linux_threads = yes -a \
10101                         $ol_cv_sys_linux_threads = yes; then
10102                         ol_cv_linux_threads=yes
10103                 elif test $ol_cv_header_linux_threads = no -a \
10104                         $ol_cv_sys_linux_threads = no; then
10105                         ol_cv_linux_threads=no
10106                 else
10107                         ol_cv_linux_threads=error
10108                 fi
10109         
10110 fi
10111
10112 echo "$ac_t""$ol_cv_linux_threads" 1>&6
10113
10114
10115                         if test $ol_cv_linux_threads = error; then
10116                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
10117                         fi
10118
10119                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
10120 echo "configure:10121: checking if pthread_create() works" >&5
10121 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
10122   echo $ac_n "(cached) $ac_c" 1>&6
10123 else
10124   
10125                         if test "$cross_compiling" = yes; then
10126                                 ol_cv_pthread_create_works=yes
10127 else
10128   cat > conftest.$ac_ext <<EOF
10129 #line 10130 "configure"
10130 #include "confdefs.h"
10131 /* pthread test headers */
10132 #include <pthread.h>
10133 #ifndef NULL
10134 #define NULL (void*)0
10135 #endif
10136
10137 static void *task(p)
10138         void *p;
10139 {
10140         return (void *) (p == NULL);
10141 }
10142
10143
10144 int main(argc, argv)
10145         int argc;
10146         char **argv;
10147 {
10148
10149         /* pthread test function */
10150         pthread_t t;
10151         int status;
10152 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
10153         /* This system (e.g. AIX) defaults detached; must override */
10154         pthread_attr_t attr;
10155
10156         status = pthread_attr_init(&attr);
10157         if( status ) exit( status );
10158
10159         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
10160         if( status ) exit( status );
10161
10162 #define ATTR    &attr
10163 #else
10164 #if HAVE_PTHREADS_D4
10165 #define ATTR    pthread_attr_default
10166 #else
10167 #define ATTR    NULL
10168 #endif
10169 #endif
10170         /* make sure pthread_create() isn't just a stub */
10171         status = pthread_create(&t, ATTR, task, NULL);
10172         if( status ) exit( status );
10173
10174         /* make sure pthread_detach() isn't just a stub */
10175 #if HAVE_PTHREADS_D4
10176         status = pthread_detach( &t );
10177 #else
10178         status = pthread_detach( t );
10179 #endif
10180
10181 #ifdef HAVE_LINUX_THREADS
10182         pthread_kill_other_threads_np();
10183 #endif
10184
10185         exit( status );
10186
10187 }
10188
10189 EOF
10190 if { (eval echo configure:10191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10191 then
10192   ol_cv_pthread_create_works=yes
10193 else
10194   echo "configure: failed program was:" >&5
10195   cat conftest.$ac_ext >&5
10196   rm -fr conftest*
10197   ol_cv_pthread_create_works=no
10198 fi
10199 rm -fr conftest*
10200 fi
10201
10202 fi
10203
10204 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
10205
10206                         if test $ol_cv_pthread_create_works = no ; then
10207                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
10208                         fi
10209
10210                                                 if test $ol_with_yielding_select = auto ; then
10211                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
10212 echo "configure:10213: checking if select yields when using pthreads" >&5
10213 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
10214   echo $ac_n "(cached) $ac_c" 1>&6
10215 else
10216   
10217                                 if test "$cross_compiling" = yes; then
10218   ol_cv_pthread_select_yields=cross
10219 else
10220   cat > conftest.$ac_ext <<EOF
10221 #line 10222 "configure"
10222 #include "confdefs.h"
10223
10224 #include <sys/types.h>
10225 #include <sys/time.h>
10226 #include <unistd.h>
10227 #include <pthread.h>
10228 #ifndef NULL
10229 #define NULL (void*) 0
10230 #endif
10231
10232 static int fildes[2];
10233
10234 static void *task(p)
10235         void *p;
10236 {
10237         int i;
10238         struct timeval tv;
10239
10240         fd_set rfds;
10241
10242         tv.tv_sec=10;
10243         tv.tv_usec=0;
10244
10245         FD_ZERO(&rfds);
10246         FD_SET(fildes[0], &rfds);
10247
10248         /* we're not interested in any fds */
10249         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
10250
10251         if(i < 0) {
10252                 perror("select");
10253                 exit(10);
10254         }
10255
10256         exit(0); /* if we exit here, the select blocked the whole process */
10257 }
10258
10259 int main(argc, argv)
10260         int argc;
10261         char **argv;
10262 {
10263         pthread_t t;
10264
10265         /* create a pipe to select */
10266         if(pipe(&fildes[0])) {
10267                 perror("select");
10268                 exit(1);
10269         }
10270
10271 #ifdef HAVE_PTHREAD_SETCONCURRENCY
10272         (void) pthread_setconcurrency(2);
10273 #else
10274 #ifdef HAVE_THR_SETCONCURRENCY
10275         /* Set Solaris LWP concurrency to 2 */
10276         thr_setconcurrency(2);
10277 #endif
10278 #endif
10279
10280 #if HAVE_PTHREADS_D4
10281         pthread_create(&t, pthread_attr_default, task, NULL);
10282 #else
10283         pthread_create(&t, NULL, task, NULL);
10284 #endif
10285
10286 #if HAVE_SCHED_YIELD
10287         sched_yield();  /* make sure task runs first */
10288 #else
10289 #ifdef HAVE_PTHREAD_YIELD
10290         pthread_yield();        /* make sure task runs first */
10291 #endif
10292 #endif
10293
10294         exit(2);
10295 }
10296 EOF
10297 if { (eval echo configure:10298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10298 then
10299   ol_cv_pthread_select_yields=no
10300 else
10301   echo "configure: failed program was:" >&5
10302   cat conftest.$ac_ext >&5
10303   rm -fr conftest*
10304   ol_cv_pthread_select_yields=yes
10305 fi
10306 rm -fr conftest*
10307 fi
10308
10309 fi
10310
10311 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
10312
10313                                 if test $ol_cv_pthread_select_yields = cross ; then
10314                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
10315                                 fi
10316
10317                                 if test $ol_cv_pthread_select_yields = yes ; then
10318                                         ol_with_yielding_select=yes
10319                                 fi
10320                         fi
10321
10322                                                 CPPFLAGS="$save_CPPFLAGS"
10323                         LIBS="$save_LIBS"
10324                 else
10325                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
10326                 fi
10327         fi
10328
10329         if test $ol_with_threads = posix ; then
10330                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
10331         fi
10332 fi
10333
10334 if test $ol_with_threads = auto -o $ol_with_threads = yes \
10335         -o $ol_with_threads = mach ; then
10336
10337                 for ac_hdr in mach/cthreads.h
10338 do
10339 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10340 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10341 echo "configure:10342: checking for $ac_hdr" >&5
10342 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10343   echo $ac_n "(cached) $ac_c" 1>&6
10344 else
10345   cat > conftest.$ac_ext <<EOF
10346 #line 10347 "configure"
10347 #include "confdefs.h"
10348 #include <$ac_hdr>
10349 EOF
10350 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10351 { (eval echo configure:10352: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10352 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10353 if test -z "$ac_err"; then
10354   rm -rf conftest*
10355   eval "ac_cv_header_$ac_safe=yes"
10356 else
10357   echo "$ac_err" >&5
10358   echo "configure: failed program was:" >&5
10359   cat conftest.$ac_ext >&5
10360   rm -rf conftest*
10361   eval "ac_cv_header_$ac_safe=no"
10362 fi
10363 rm -f conftest*
10364 fi
10365 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10366   echo "$ac_t""yes" 1>&6
10367     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10368   cat >> confdefs.h <<EOF
10369 #define $ac_tr_hdr 1
10370 EOF
10371  
10372 else
10373   echo "$ac_t""no" 1>&6
10374 fi
10375 done
10376
10377         if test $ac_cv_header_mach_cthreads_h = yes ; then
10378                 ol_with_threads=found
10379
10380                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
10381 echo "configure:10382: checking for cthread_fork" >&5
10382 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
10383   echo $ac_n "(cached) $ac_c" 1>&6
10384 else
10385   cat > conftest.$ac_ext <<EOF
10386 #line 10387 "configure"
10387 #include "confdefs.h"
10388 /* System header to define __stub macros and hopefully few prototypes,
10389     which can conflict with char cthread_fork(); below.  */
10390 #include <assert.h>
10391 /* Override any gcc2 internal prototype to avoid an error.  */
10392 /* We use char because int might match the return type of a gcc2
10393     builtin and then its argument prototype would still apply.  */
10394 char cthread_fork();
10395 char (*f)();
10396
10397 int main() {
10398
10399 /* The GNU C library defines this for functions which it implements
10400     to always fail with ENOSYS.  Some functions are actually named
10401     something starting with __ and the normal name is an alias.  */
10402 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
10403 choke me
10404 #else
10405 f = cthread_fork;
10406 #endif
10407
10408 ; return 0; }
10409 EOF
10410 if { (eval echo configure:10411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10411   rm -rf conftest*
10412   eval "ac_cv_func_cthread_fork=yes"
10413 else
10414   echo "configure: failed program was:" >&5
10415   cat conftest.$ac_ext >&5
10416   rm -rf conftest*
10417   eval "ac_cv_func_cthread_fork=no"
10418 fi
10419 rm -f conftest*
10420 fi
10421
10422 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
10423   echo "$ac_t""yes" 1>&6
10424   ol_link_threads=yes
10425 else
10426   echo "$ac_t""no" 1>&6
10427 fi
10428
10429
10430                 if test $ol_link_threads = no ; then
10431                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
10432 echo "configure:10433: checking for cthread_fork with -all_load" >&5
10433 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
10434   echo $ac_n "(cached) $ac_c" 1>&6
10435 else
10436   
10437                                                                 save_LIBS="$LIBS"
10438                                 LIBS="-all_load $LIBS"
10439                                 cat > conftest.$ac_ext <<EOF
10440 #line 10441 "configure"
10441 #include "confdefs.h"
10442 #include <mach/cthreads.h>
10443 int main() {
10444
10445                                         cthread_fork((void *)0, (void *)0);
10446                                         
10447 ; return 0; }
10448 EOF
10449 if { (eval echo configure:10450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10450   rm -rf conftest*
10451   ol_cv_cthread_all_load=yes
10452 else
10453   echo "configure: failed program was:" >&5
10454   cat conftest.$ac_ext >&5
10455   rm -rf conftest*
10456   ol_cv_cthread_all_load=no
10457 fi
10458 rm -f conftest*
10459                                                                 LIBS="$save_LIBS"
10460                         
10461 fi
10462
10463 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
10464
10465                         if test $ol_cv_cthread_all_load = yes ; then
10466                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
10467                                 ol_link_threads=mach
10468                         fi
10469                 fi
10470
10471                 if test $ol_link_threads != no ; then
10472                         : check for cthread specific functionality here
10473                         cat >> confdefs.h <<\EOF
10474 #define HAVE_MACH_CTHREADS 1
10475 EOF
10476
10477                 else
10478                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
10479                 fi
10480         fi
10481
10482         if test $ol_with_threads = mach ; then
10483                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
10484         fi
10485 fi
10486
10487 if test $ol_with_threads = auto -o $ol_with_threads = yes \
10488         -o $ol_with_threads = pth ; then
10489
10490         for ac_hdr in pth.h
10491 do
10492 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10493 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10494 echo "configure:10495: checking for $ac_hdr" >&5
10495 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10496   echo $ac_n "(cached) $ac_c" 1>&6
10497 else
10498   cat > conftest.$ac_ext <<EOF
10499 #line 10500 "configure"
10500 #include "confdefs.h"
10501 #include <$ac_hdr>
10502 EOF
10503 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10504 { (eval echo configure:10505: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10505 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10506 if test -z "$ac_err"; then
10507   rm -rf conftest*
10508   eval "ac_cv_header_$ac_safe=yes"
10509 else
10510   echo "$ac_err" >&5
10511   echo "configure: failed program was:" >&5
10512   cat conftest.$ac_ext >&5
10513   rm -rf conftest*
10514   eval "ac_cv_header_$ac_safe=no"
10515 fi
10516 rm -f conftest*
10517 fi
10518 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10519   echo "$ac_t""yes" 1>&6
10520     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10521   cat >> confdefs.h <<EOF
10522 #define $ac_tr_hdr 1
10523 EOF
10524  
10525 else
10526   echo "$ac_t""no" 1>&6
10527 fi
10528 done
10529
10530
10531         if test $ac_cv_header_pth_h = yes ; then
10532                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
10533 echo "configure:10534: checking for pth_version in -lpth" >&5
10534 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
10535 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10536   echo $ac_n "(cached) $ac_c" 1>&6
10537 else
10538   ac_save_LIBS="$LIBS"
10539 LIBS="-lpth  $LIBS"
10540 cat > conftest.$ac_ext <<EOF
10541 #line 10542 "configure"
10542 #include "confdefs.h"
10543 /* Override any gcc2 internal prototype to avoid an error.  */
10544 /* We use char because int might match the return type of a gcc2
10545     builtin and then its argument prototype would still apply.  */
10546 char pth_version();
10547
10548 int main() {
10549 pth_version()
10550 ; return 0; }
10551 EOF
10552 if { (eval echo configure:10553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10553   rm -rf conftest*
10554   eval "ac_cv_lib_$ac_lib_var=yes"
10555 else
10556   echo "configure: failed program was:" >&5
10557   cat conftest.$ac_ext >&5
10558   rm -rf conftest*
10559   eval "ac_cv_lib_$ac_lib_var=no"
10560 fi
10561 rm -f conftest*
10562 LIBS="$ac_save_LIBS"
10563
10564 fi
10565 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10566   echo "$ac_t""yes" 1>&6
10567   have_pth=yes
10568 else
10569   echo "$ac_t""no" 1>&6
10570 have_pth=no
10571 fi
10572
10573
10574                 if test $have_pth = yes ; then
10575                         cat >> confdefs.h <<\EOF
10576 #define HAVE_GNU_PTH 1
10577 EOF
10578
10579                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
10580                         ol_link_threads=pth
10581
10582                         if test $ol_with_yielding_select = auto ; then
10583                                 ol_with_yielding_select=yes
10584                         fi
10585                 fi
10586         fi
10587 fi
10588
10589 if test $ol_with_threads = auto -o $ol_with_threads = yes \
10590         -o $ol_with_threads = lwp ; then
10591
10592                 for ac_hdr in thread.h synch.h
10593 do
10594 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10595 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10596 echo "configure:10597: checking for $ac_hdr" >&5
10597 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10598   echo $ac_n "(cached) $ac_c" 1>&6
10599 else
10600   cat > conftest.$ac_ext <<EOF
10601 #line 10602 "configure"
10602 #include "confdefs.h"
10603 #include <$ac_hdr>
10604 EOF
10605 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10606 { (eval echo configure:10607: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10607 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10608 if test -z "$ac_err"; then
10609   rm -rf conftest*
10610   eval "ac_cv_header_$ac_safe=yes"
10611 else
10612   echo "$ac_err" >&5
10613   echo "configure: failed program was:" >&5
10614   cat conftest.$ac_ext >&5
10615   rm -rf conftest*
10616   eval "ac_cv_header_$ac_safe=no"
10617 fi
10618 rm -f conftest*
10619 fi
10620 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10621   echo "$ac_t""yes" 1>&6
10622     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10623   cat >> confdefs.h <<EOF
10624 #define $ac_tr_hdr 1
10625 EOF
10626  
10627 else
10628   echo "$ac_t""no" 1>&6
10629 fi
10630 done
10631
10632         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
10633                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
10634 echo "configure:10635: checking for thr_create in -lthread" >&5
10635 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
10636 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10637   echo $ac_n "(cached) $ac_c" 1>&6
10638 else
10639   ac_save_LIBS="$LIBS"
10640 LIBS="-lthread  $LIBS"
10641 cat > conftest.$ac_ext <<EOF
10642 #line 10643 "configure"
10643 #include "confdefs.h"
10644 /* Override any gcc2 internal prototype to avoid an error.  */
10645 /* We use char because int might match the return type of a gcc2
10646     builtin and then its argument prototype would still apply.  */
10647 char thr_create();
10648
10649 int main() {
10650 thr_create()
10651 ; return 0; }
10652 EOF
10653 if { (eval echo configure:10654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10654   rm -rf conftest*
10655   eval "ac_cv_lib_$ac_lib_var=yes"
10656 else
10657   echo "configure: failed program was:" >&5
10658   cat conftest.$ac_ext >&5
10659   rm -rf conftest*
10660   eval "ac_cv_lib_$ac_lib_var=no"
10661 fi
10662 rm -f conftest*
10663 LIBS="$ac_save_LIBS"
10664
10665 fi
10666 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10667   echo "$ac_t""yes" 1>&6
10668   have_thr=yes
10669 else
10670   echo "$ac_t""no" 1>&6
10671 have_thr=no
10672 fi
10673
10674
10675                 if test $have_thr = yes ; then
10676                         cat >> confdefs.h <<\EOF
10677 #define HAVE_THR 1
10678 EOF
10679
10680                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
10681                         ol_link_threads=thr
10682
10683                         if test $ol_with_yielding_select = auto ; then
10684                                 ol_with_yielding_select=yes
10685                         fi
10686
10687                                                 for ac_func in \
10688                                 thr_setconcurrency \
10689                                 thr_getconcurrency \
10690                         
10691 do
10692 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10693 echo "configure:10694: checking for $ac_func" >&5
10694 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10695   echo $ac_n "(cached) $ac_c" 1>&6
10696 else
10697   cat > conftest.$ac_ext <<EOF
10698 #line 10699 "configure"
10699 #include "confdefs.h"
10700 /* System header to define __stub macros and hopefully few prototypes,
10701     which can conflict with char $ac_func(); below.  */
10702 #include <assert.h>
10703 /* Override any gcc2 internal prototype to avoid an error.  */
10704 /* We use char because int might match the return type of a gcc2
10705     builtin and then its argument prototype would still apply.  */
10706 char $ac_func();
10707 char (*f)();
10708
10709 int main() {
10710
10711 /* The GNU C library defines this for functions which it implements
10712     to always fail with ENOSYS.  Some functions are actually named
10713     something starting with __ and the normal name is an alias.  */
10714 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10715 choke me
10716 #else
10717 f = $ac_func;
10718 #endif
10719
10720 ; return 0; }
10721 EOF
10722 if { (eval echo configure:10723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10723   rm -rf conftest*
10724   eval "ac_cv_func_$ac_func=yes"
10725 else
10726   echo "configure: failed program was:" >&5
10727   cat conftest.$ac_ext >&5
10728   rm -rf conftest*
10729   eval "ac_cv_func_$ac_func=no"
10730 fi
10731 rm -f conftest*
10732 fi
10733
10734 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10735   echo "$ac_t""yes" 1>&6
10736     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10737   cat >> confdefs.h <<EOF
10738 #define $ac_tr_func 1
10739 EOF
10740  
10741 else
10742   echo "$ac_t""no" 1>&6
10743 fi
10744 done
10745
10746                 fi
10747         fi
10748
10749                 for ac_hdr in lwp/lwp.h
10750 do
10751 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10752 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10753 echo "configure:10754: checking for $ac_hdr" >&5
10754 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10755   echo $ac_n "(cached) $ac_c" 1>&6
10756 else
10757   cat > conftest.$ac_ext <<EOF
10758 #line 10759 "configure"
10759 #include "confdefs.h"
10760 #include <$ac_hdr>
10761 EOF
10762 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10763 { (eval echo configure:10764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10764 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10765 if test -z "$ac_err"; then
10766   rm -rf conftest*
10767   eval "ac_cv_header_$ac_safe=yes"
10768 else
10769   echo "$ac_err" >&5
10770   echo "configure: failed program was:" >&5
10771   cat conftest.$ac_ext >&5
10772   rm -rf conftest*
10773   eval "ac_cv_header_$ac_safe=no"
10774 fi
10775 rm -f conftest*
10776 fi
10777 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10778   echo "$ac_t""yes" 1>&6
10779     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10780   cat >> confdefs.h <<EOF
10781 #define $ac_tr_hdr 1
10782 EOF
10783  
10784 else
10785   echo "$ac_t""no" 1>&6
10786 fi
10787 done
10788
10789         if test $ac_cv_header_lwp_lwp_h = yes ; then
10790                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
10791 echo "configure:10792: checking for lwp_create in -llwp" >&5
10792 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
10793 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10794   echo $ac_n "(cached) $ac_c" 1>&6
10795 else
10796   ac_save_LIBS="$LIBS"
10797 LIBS="-llwp  $LIBS"
10798 cat > conftest.$ac_ext <<EOF
10799 #line 10800 "configure"
10800 #include "confdefs.h"
10801 /* Override any gcc2 internal prototype to avoid an error.  */
10802 /* We use char because int might match the return type of a gcc2
10803     builtin and then its argument prototype would still apply.  */
10804 char lwp_create();
10805
10806 int main() {
10807 lwp_create()
10808 ; return 0; }
10809 EOF
10810 if { (eval echo configure:10811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10811   rm -rf conftest*
10812   eval "ac_cv_lib_$ac_lib_var=yes"
10813 else
10814   echo "configure: failed program was:" >&5
10815   cat conftest.$ac_ext >&5
10816   rm -rf conftest*
10817   eval "ac_cv_lib_$ac_lib_var=no"
10818 fi
10819 rm -f conftest*
10820 LIBS="$ac_save_LIBS"
10821
10822 fi
10823 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10824   echo "$ac_t""yes" 1>&6
10825   have_lwp=yes
10826 else
10827   echo "$ac_t""no" 1>&6
10828 have_lwp=no
10829 fi
10830
10831
10832                 if test $have_lwp = yes ; then
10833                         cat >> confdefs.h <<\EOF
10834 #define HAVE_LWP 1
10835 EOF
10836
10837                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
10838                         ol_link_threads=lwp
10839
10840                         if test $ol_with_yielding_select = auto ; then
10841                                 ol_with_yielding_select=no
10842                         fi
10843                 fi
10844         fi
10845 fi
10846
10847 if test $ol_with_yielding_select = yes ; then
10848         cat >> confdefs.h <<\EOF
10849 #define HAVE_YIELDING_SELECT 1
10850 EOF
10851
10852 fi
10853
10854 if test $ol_with_threads = manual ; then
10855                 ol_link_threads=yes
10856
10857         echo "configure: warning: thread defines and link options must be set manually" 1>&2
10858
10859         for ac_hdr in pthread.h sched.h
10860 do
10861 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10862 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10863 echo "configure:10864: checking for $ac_hdr" >&5
10864 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10865   echo $ac_n "(cached) $ac_c" 1>&6
10866 else
10867   cat > conftest.$ac_ext <<EOF
10868 #line 10869 "configure"
10869 #include "confdefs.h"
10870 #include <$ac_hdr>
10871 EOF
10872 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10873 { (eval echo configure:10874: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10874 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10875 if test -z "$ac_err"; then
10876   rm -rf conftest*
10877   eval "ac_cv_header_$ac_safe=yes"
10878 else
10879   echo "$ac_err" >&5
10880   echo "configure: failed program was:" >&5
10881   cat conftest.$ac_ext >&5
10882   rm -rf conftest*
10883   eval "ac_cv_header_$ac_safe=no"
10884 fi
10885 rm -f conftest*
10886 fi
10887 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10888   echo "$ac_t""yes" 1>&6
10889     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10890   cat >> confdefs.h <<EOF
10891 #define $ac_tr_hdr 1
10892 EOF
10893  
10894 else
10895   echo "$ac_t""no" 1>&6
10896 fi
10897 done
10898
10899         for ac_func in sched_yield pthread_yield
10900 do
10901 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10902 echo "configure:10903: checking for $ac_func" >&5
10903 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10904   echo $ac_n "(cached) $ac_c" 1>&6
10905 else
10906   cat > conftest.$ac_ext <<EOF
10907 #line 10908 "configure"
10908 #include "confdefs.h"
10909 /* System header to define __stub macros and hopefully few prototypes,
10910     which can conflict with char $ac_func(); below.  */
10911 #include <assert.h>
10912 /* Override any gcc2 internal prototype to avoid an error.  */
10913 /* We use char because int might match the return type of a gcc2
10914     builtin and then its argument prototype would still apply.  */
10915 char $ac_func();
10916 char (*f)();
10917
10918 int main() {
10919
10920 /* The GNU C library defines this for functions which it implements
10921     to always fail with ENOSYS.  Some functions are actually named
10922     something starting with __ and the normal name is an alias.  */
10923 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10924 choke me
10925 #else
10926 f = $ac_func;
10927 #endif
10928
10929 ; return 0; }
10930 EOF
10931 if { (eval echo configure:10932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10932   rm -rf conftest*
10933   eval "ac_cv_func_$ac_func=yes"
10934 else
10935   echo "configure: failed program was:" >&5
10936   cat conftest.$ac_ext >&5
10937   rm -rf conftest*
10938   eval "ac_cv_func_$ac_func=no"
10939 fi
10940 rm -f conftest*
10941 fi
10942
10943 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10944   echo "$ac_t""yes" 1>&6
10945     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10946   cat >> confdefs.h <<EOF
10947 #define $ac_tr_func 1
10948 EOF
10949  
10950 else
10951   echo "$ac_t""no" 1>&6
10952 fi
10953 done
10954
10955         
10956         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
10957 echo "configure:10958: checking for LinuxThreads pthread.h" >&5
10958 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
10959   echo $ac_n "(cached) $ac_c" 1>&6
10960 else
10961   cat > conftest.$ac_ext <<EOF
10962 #line 10963 "configure"
10963 #include "confdefs.h"
10964 #include <pthread.h>
10965 EOF
10966 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10967   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
10968   rm -rf conftest*
10969   ol_cv_header_linux_threads=yes
10970 else
10971   rm -rf conftest*
10972   ol_cv_header_linux_threads=no
10973 fi
10974 rm -f conftest*
10975
10976                 
10977 fi
10978
10979 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
10980         if test $ol_cv_header_linux_threads = yes; then
10981                 cat >> confdefs.h <<\EOF
10982 #define HAVE_LINUX_THREADS 1
10983 EOF
10984
10985         fi
10986
10987
10988         for ac_hdr in mach/cthreads.h
10989 do
10990 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10991 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10992 echo "configure:10993: checking for $ac_hdr" >&5
10993 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10994   echo $ac_n "(cached) $ac_c" 1>&6
10995 else
10996   cat > conftest.$ac_ext <<EOF
10997 #line 10998 "configure"
10998 #include "confdefs.h"
10999 #include <$ac_hdr>
11000 EOF
11001 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11002 { (eval echo configure:11003: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11003 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11004 if test -z "$ac_err"; then
11005   rm -rf conftest*
11006   eval "ac_cv_header_$ac_safe=yes"
11007 else
11008   echo "$ac_err" >&5
11009   echo "configure: failed program was:" >&5
11010   cat conftest.$ac_ext >&5
11011   rm -rf conftest*
11012   eval "ac_cv_header_$ac_safe=no"
11013 fi
11014 rm -f conftest*
11015 fi
11016 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11017   echo "$ac_t""yes" 1>&6
11018     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11019   cat >> confdefs.h <<EOF
11020 #define $ac_tr_hdr 1
11021 EOF
11022  
11023 else
11024   echo "$ac_t""no" 1>&6
11025 fi
11026 done
11027
11028         for ac_hdr in lwp/lwp.h
11029 do
11030 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11031 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11032 echo "configure:11033: checking for $ac_hdr" >&5
11033 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11034   echo $ac_n "(cached) $ac_c" 1>&6
11035 else
11036   cat > conftest.$ac_ext <<EOF
11037 #line 11038 "configure"
11038 #include "confdefs.h"
11039 #include <$ac_hdr>
11040 EOF
11041 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11042 { (eval echo configure:11043: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11043 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11044 if test -z "$ac_err"; then
11045   rm -rf conftest*
11046   eval "ac_cv_header_$ac_safe=yes"
11047 else
11048   echo "$ac_err" >&5
11049   echo "configure: failed program was:" >&5
11050   cat conftest.$ac_ext >&5
11051   rm -rf conftest*
11052   eval "ac_cv_header_$ac_safe=no"
11053 fi
11054 rm -f conftest*
11055 fi
11056 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11057   echo "$ac_t""yes" 1>&6
11058     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11059   cat >> confdefs.h <<EOF
11060 #define $ac_tr_hdr 1
11061 EOF
11062  
11063 else
11064   echo "$ac_t""no" 1>&6
11065 fi
11066 done
11067
11068         for ac_hdr in thread.h synch.h
11069 do
11070 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11071 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11072 echo "configure:11073: checking for $ac_hdr" >&5
11073 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11074   echo $ac_n "(cached) $ac_c" 1>&6
11075 else
11076   cat > conftest.$ac_ext <<EOF
11077 #line 11078 "configure"
11078 #include "confdefs.h"
11079 #include <$ac_hdr>
11080 EOF
11081 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11082 { (eval echo configure:11083: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11083 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11084 if test -z "$ac_err"; then
11085   rm -rf conftest*
11086   eval "ac_cv_header_$ac_safe=yes"
11087 else
11088   echo "$ac_err" >&5
11089   echo "configure: failed program was:" >&5
11090   cat conftest.$ac_ext >&5
11091   rm -rf conftest*
11092   eval "ac_cv_header_$ac_safe=no"
11093 fi
11094 rm -f conftest*
11095 fi
11096 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11097   echo "$ac_t""yes" 1>&6
11098     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11099   cat >> confdefs.h <<EOF
11100 #define $ac_tr_hdr 1
11101 EOF
11102  
11103 else
11104   echo "$ac_t""no" 1>&6
11105 fi
11106 done
11107
11108 fi
11109
11110 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
11111                         cat >> confdefs.h <<\EOF
11112 #define REENTRANT 1
11113 EOF
11114
11115         cat >> confdefs.h <<\EOF
11116 #define _REENTRANT 1
11117 EOF
11118
11119         cat >> confdefs.h <<\EOF
11120 #define THREAD_SAFE 1
11121 EOF
11122
11123         cat >> confdefs.h <<\EOF
11124 #define _THREAD_SAFE 1
11125 EOF
11126
11127         cat >> confdefs.h <<\EOF
11128 #define THREADSAFE 1
11129 EOF
11130
11131         cat >> confdefs.h <<\EOF
11132 #define _THREADSAFE 1
11133 EOF
11134
11135         cat >> confdefs.h <<\EOF
11136 #define _SGI_MP_SOURCE 1
11137 EOF
11138
11139
11140                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
11141 echo "configure:11142: checking for thread specific errno" >&5
11142 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
11143   echo $ac_n "(cached) $ac_c" 1>&6
11144 else
11145   
11146                 cat > conftest.$ac_ext <<EOF
11147 #line 11148 "configure"
11148 #include "confdefs.h"
11149 #include <errno.h>
11150 int main() {
11151 errno = 0;
11152 ; return 0; }
11153 EOF
11154 if { (eval echo configure:11155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11155   rm -rf conftest*
11156   ol_cv_errno_thread_specific=yes
11157 else
11158   echo "configure: failed program was:" >&5
11159   cat conftest.$ac_ext >&5
11160   rm -rf conftest*
11161   ol_cv_errno_thread_specific=no
11162 fi
11163 rm -f conftest*
11164         
11165 fi
11166
11167 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
11168
11169                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
11170 echo "configure:11171: checking for thread specific h_errno" >&5
11171 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
11172   echo $ac_n "(cached) $ac_c" 1>&6
11173 else
11174   
11175                 cat > conftest.$ac_ext <<EOF
11176 #line 11177 "configure"
11177 #include "confdefs.h"
11178 #include <netdb.h>
11179 int main() {
11180 h_errno = 0;
11181 ; return 0; }
11182 EOF
11183 if { (eval echo configure:11184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11184   rm -rf conftest*
11185   ol_cv_h_errno_thread_specific=yes
11186 else
11187   echo "configure: failed program was:" >&5
11188   cat conftest.$ac_ext >&5
11189   rm -rf conftest*
11190   ol_cv_h_errno_thread_specific=no
11191 fi
11192 rm -f conftest*
11193         
11194 fi
11195
11196 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
11197
11198         if test $ol_cv_errno_thread_specific != yes \
11199                 -o $ol_cv_h_errno_thread_specific != yes ; then
11200                 LIBS="$LTHREAD_LIBS $LIBS"
11201                 LTHREAD_LIBS=""
11202         fi
11203
11204 fi  
11205
11206 if test $ol_link_threads = no ; then
11207         if test $ol_with_threads = yes ; then
11208                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
11209         fi
11210
11211         if test $ol_with_threads = auto ; then
11212                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
11213                 ol_with_threads=no
11214         fi
11215
11216         cat >> confdefs.h <<\EOF
11217 #define NO_THREADS 1
11218 EOF
11219
11220         LTHREAD_LIBS=""
11221 fi
11222
11223 if test $ol_link_threads != no ; then
11224         cat >> confdefs.h <<\EOF
11225 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
11226 EOF
11227
11228 fi
11229
11230 ol_link_ldbm=no 
11231
11232 if test $ol_with_ldbm_api = auto \
11233         -o $ol_with_ldbm_api = berkeley \
11234         -o $ol_with_ldbm_api = bcompat ; then
11235
11236         if test $ol_with_ldbm_api = bcompat; then \
11237                 ol_cv_berkeley_db=no
11238 for ac_hdr in db_185.h db.h
11239 do
11240 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11241 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11242 echo "configure:11243: checking for $ac_hdr" >&5
11243 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11244   echo $ac_n "(cached) $ac_c" 1>&6
11245 else
11246   cat > conftest.$ac_ext <<EOF
11247 #line 11248 "configure"
11248 #include "confdefs.h"
11249 #include <$ac_hdr>
11250 EOF
11251 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11252 { (eval echo configure:11253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11253 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11254 if test -z "$ac_err"; then
11255   rm -rf conftest*
11256   eval "ac_cv_header_$ac_safe=yes"
11257 else
11258   echo "$ac_err" >&5
11259   echo "configure: failed program was:" >&5
11260   cat conftest.$ac_ext >&5
11261   rm -rf conftest*
11262   eval "ac_cv_header_$ac_safe=no"
11263 fi
11264 rm -f conftest*
11265 fi
11266 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11267   echo "$ac_t""yes" 1>&6
11268     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11269   cat >> confdefs.h <<EOF
11270 #define $ac_tr_hdr 1
11271 EOF
11272  
11273 else
11274   echo "$ac_t""no" 1>&6
11275 fi
11276 done
11277
11278 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
11279         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
11280 echo "configure:11281: checking if Berkeley DB header compatibility" >&5
11281 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
11282   echo $ac_n "(cached) $ac_c" 1>&6
11283 else
11284   
11285                 cat > conftest.$ac_ext <<EOF
11286 #line 11287 "configure"
11287 #include "confdefs.h"
11288
11289 #if HAVE_DB_185_H
11290 #       include <db_185.h>
11291 #else
11292 #       include <db.h>
11293 #endif
11294
11295  /* this check could be improved */
11296 #ifndef DB_VERSION_MAJOR
11297 #       define DB_VERSION_MAJOR 1
11298 #endif
11299
11300 #if DB_VERSION_MAJOR == 1 
11301         __db_version_1
11302 #endif
11303
11304 EOF
11305 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11306   egrep "__db_version_1" >/dev/null 2>&1; then
11307   rm -rf conftest*
11308   ol_cv_header_db1=yes
11309 else
11310   rm -rf conftest*
11311   ol_cv_header_db1=no
11312 fi
11313 rm -f conftest*
11314
11315 fi
11316
11317 echo "$ac_t""$ol_cv_header_db1" 1>&6
11318
11319         if test ol_cv_header_db1=yes ; then
11320                 ol_cv_lib_db=no
11321 if test $ol_cv_lib_db = no ; then
11322         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
11323 echo "configure:11324: checking for Berkeley DB link (default)" >&5
11324 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
11325   echo $ac_n "(cached) $ac_c" 1>&6
11326 else
11327   
11328         ol_DB_LIB=
11329         ol_LIBS=$LIBS
11330         LIBS="$ol_DB_LIB $LIBS"
11331
11332         cat > conftest.$ac_ext <<EOF
11333 #line 11334 "configure"
11334 #include "confdefs.h"
11335
11336 #ifdef HAVE_DB_185_H
11337 # include <db_185.h>
11338 #else
11339 # include <db.h>
11340 #endif
11341
11342 #ifndef DB_VERSION_MAJOR
11343 # define DB_VERSION_MAJOR 1
11344 #endif
11345
11346 #ifndef NULL
11347 #define NULL ((void*)0)
11348 #endif
11349
11350 int main() {
11351
11352 #if DB_VERSION_MAJOR > 2
11353         db_env_create( NULL, 0 );
11354 #elif DB_VERSION_MAJOR > 1
11355         db_appexit( NULL );
11356 #else
11357         (void) dbopen( NULL, 0, 0, 0, NULL);
11358 #endif
11359
11360 ; return 0; }
11361 EOF
11362 if { (eval echo configure:11363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11363   rm -rf conftest*
11364   ol_cv_db_none=yes
11365 else
11366   echo "configure: failed program was:" >&5
11367   cat conftest.$ac_ext >&5
11368   rm -rf conftest*
11369   ol_cv_db_none=no
11370 fi
11371 rm -f conftest*
11372
11373         LIBS="$ol_LIBS"
11374
11375 fi
11376
11377 echo "$ac_t""$ol_cv_db_none" 1>&6
11378
11379         if test $ol_cv_db_none = yes ; then
11380                 ol_cv_lib_db=yes
11381         fi
11382 fi
11383
11384 if test $ol_cv_lib_db = no ; then
11385         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
11386 echo "configure:11387: checking for Berkeley DB link (-ldb)" >&5
11387 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
11388   echo $ac_n "(cached) $ac_c" 1>&6
11389 else
11390   
11391         ol_DB_LIB=-ldb
11392         ol_LIBS=$LIBS
11393         LIBS="$ol_DB_LIB $LIBS"
11394
11395         cat > conftest.$ac_ext <<EOF
11396 #line 11397 "configure"
11397 #include "confdefs.h"
11398
11399 #ifdef HAVE_DB_185_H
11400 # include <db_185.h>
11401 #else
11402 # include <db.h>
11403 #endif
11404
11405 #ifndef DB_VERSION_MAJOR
11406 # define DB_VERSION_MAJOR 1
11407 #endif
11408
11409 #ifndef NULL
11410 #define NULL ((void*)0)
11411 #endif
11412
11413 int main() {
11414
11415 #if DB_VERSION_MAJOR > 2
11416         db_env_create( NULL, 0 );
11417 #elif DB_VERSION_MAJOR > 1
11418         db_appexit( NULL );
11419 #else
11420         (void) dbopen( NULL, 0, 0, 0, NULL);
11421 #endif
11422
11423 ; return 0; }
11424 EOF
11425 if { (eval echo configure:11426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11426   rm -rf conftest*
11427   ol_cv_db_db=yes
11428 else
11429   echo "configure: failed program was:" >&5
11430   cat conftest.$ac_ext >&5
11431   rm -rf conftest*
11432   ol_cv_db_db=no
11433 fi
11434 rm -f conftest*
11435
11436         LIBS="$ol_LIBS"
11437
11438 fi
11439
11440 echo "$ac_t""$ol_cv_db_db" 1>&6
11441
11442         if test $ol_cv_db_db = yes ; then
11443                 ol_cv_lib_db=-ldb
11444         fi
11445 fi
11446
11447 if test $ol_cv_lib_db = no ; then
11448         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
11449 echo "configure:11450: checking for Berkeley DB link (-ldb3)" >&5
11450 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
11451   echo $ac_n "(cached) $ac_c" 1>&6
11452 else
11453   
11454         ol_DB_LIB=-ldb3
11455         ol_LIBS=$LIBS
11456         LIBS="$ol_DB_LIB $LIBS"
11457
11458         cat > conftest.$ac_ext <<EOF
11459 #line 11460 "configure"
11460 #include "confdefs.h"
11461
11462 #ifdef HAVE_DB_185_H
11463 # include <db_185.h>
11464 #else
11465 # include <db.h>
11466 #endif
11467
11468 #ifndef DB_VERSION_MAJOR
11469 # define DB_VERSION_MAJOR 1
11470 #endif
11471
11472 #ifndef NULL
11473 #define NULL ((void*)0)
11474 #endif
11475
11476 int main() {
11477
11478 #if DB_VERSION_MAJOR > 2
11479         db_env_create( NULL, 0 );
11480 #elif DB_VERSION_MAJOR > 1
11481         db_appexit( NULL );
11482 #else
11483         (void) dbopen( NULL, 0, 0, 0, NULL);
11484 #endif
11485
11486 ; return 0; }
11487 EOF
11488 if { (eval echo configure:11489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11489   rm -rf conftest*
11490   ol_cv_db_db3=yes
11491 else
11492   echo "configure: failed program was:" >&5
11493   cat conftest.$ac_ext >&5
11494   rm -rf conftest*
11495   ol_cv_db_db3=no
11496 fi
11497 rm -f conftest*
11498
11499         LIBS="$ol_LIBS"
11500
11501 fi
11502
11503 echo "$ac_t""$ol_cv_db_db3" 1>&6
11504
11505         if test $ol_cv_db_db3 = yes ; then
11506                 ol_cv_lib_db=-ldb3
11507         fi
11508 fi
11509
11510 if test $ol_cv_lib_db = no ; then
11511         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
11512 echo "configure:11513: checking for Berkeley DB link (-ldb2)" >&5
11513 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
11514   echo $ac_n "(cached) $ac_c" 1>&6
11515 else
11516   
11517         ol_DB_LIB=-ldb2
11518         ol_LIBS=$LIBS
11519         LIBS="$ol_DB_LIB $LIBS"
11520
11521         cat > conftest.$ac_ext <<EOF
11522 #line 11523 "configure"
11523 #include "confdefs.h"
11524
11525 #ifdef HAVE_DB_185_H
11526 # include <db_185.h>
11527 #else
11528 # include <db.h>
11529 #endif
11530
11531 #ifndef DB_VERSION_MAJOR
11532 # define DB_VERSION_MAJOR 1
11533 #endif
11534
11535 #ifndef NULL
11536 #define NULL ((void*)0)
11537 #endif
11538
11539 int main() {
11540
11541 #if DB_VERSION_MAJOR > 2
11542         db_env_create( NULL, 0 );
11543 #elif DB_VERSION_MAJOR > 1
11544         db_appexit( NULL );
11545 #else
11546         (void) dbopen( NULL, 0, 0, 0, NULL);
11547 #endif
11548
11549 ; return 0; }
11550 EOF
11551 if { (eval echo configure:11552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11552   rm -rf conftest*
11553   ol_cv_db_db2=yes
11554 else
11555   echo "configure: failed program was:" >&5
11556   cat conftest.$ac_ext >&5
11557   rm -rf conftest*
11558   ol_cv_db_db2=no
11559 fi
11560 rm -f conftest*
11561
11562         LIBS="$ol_LIBS"
11563
11564 fi
11565
11566 echo "$ac_t""$ol_cv_db_db2" 1>&6
11567
11568         if test $ol_cv_db_db2 = yes ; then
11569                 ol_cv_lib_db=-ldb2
11570         fi
11571 fi
11572
11573 if test $ol_cv_lib_db = no ; then
11574         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
11575 echo "configure:11576: checking for Berkeley DB link (-ldb1)" >&5
11576 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
11577   echo $ac_n "(cached) $ac_c" 1>&6
11578 else
11579   
11580         ol_DB_LIB=-ldb1
11581         ol_LIBS=$LIBS
11582         LIBS="$ol_DB_LIB $LIBS"
11583
11584         cat > conftest.$ac_ext <<EOF
11585 #line 11586 "configure"
11586 #include "confdefs.h"
11587
11588 #ifdef HAVE_DB_185_H
11589 # include <db_185.h>
11590 #else
11591 # include <db.h>
11592 #endif
11593
11594 #ifndef DB_VERSION_MAJOR
11595 # define DB_VERSION_MAJOR 1
11596 #endif
11597
11598 #ifndef NULL
11599 #define NULL ((void*)0)
11600 #endif
11601
11602 int main() {
11603
11604 #if DB_VERSION_MAJOR > 2
11605         db_env_create( NULL, 0 );
11606 #elif DB_VERSION_MAJOR > 1
11607         db_appexit( NULL );
11608 #else
11609         (void) dbopen( NULL, 0, 0, 0, NULL);
11610 #endif
11611
11612 ; return 0; }
11613 EOF
11614 if { (eval echo configure:11615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11615   rm -rf conftest*
11616   ol_cv_db_db1=yes
11617 else
11618   echo "configure: failed program was:" >&5
11619   cat conftest.$ac_ext >&5
11620   rm -rf conftest*
11621   ol_cv_db_db1=no
11622 fi
11623 rm -f conftest*
11624
11625         LIBS="$ol_LIBS"
11626
11627 fi
11628
11629 echo "$ac_t""$ol_cv_db_db1" 1>&6
11630
11631         if test $ol_cv_db_db1 = yes ; then
11632                 ol_cv_lib_db=-ldb1
11633         fi
11634 fi
11635
11636
11637                 if test "$ol_cv_lib_db" != no ; then
11638                         ol_cv_berkeley_db=yes
11639                 fi
11640         fi
11641 fi
11642
11643         else
11644                 ol_cv_berkeley_db=no
11645 for ac_hdr in db.h
11646 do
11647 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11648 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11649 echo "configure:11650: checking for $ac_hdr" >&5
11650 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11651   echo $ac_n "(cached) $ac_c" 1>&6
11652 else
11653   cat > conftest.$ac_ext <<EOF
11654 #line 11655 "configure"
11655 #include "confdefs.h"
11656 #include <$ac_hdr>
11657 EOF
11658 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11659 { (eval echo configure:11660: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11660 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11661 if test -z "$ac_err"; then
11662   rm -rf conftest*
11663   eval "ac_cv_header_$ac_safe=yes"
11664 else
11665   echo "$ac_err" >&5
11666   echo "configure: failed program was:" >&5
11667   cat conftest.$ac_ext >&5
11668   rm -rf conftest*
11669   eval "ac_cv_header_$ac_safe=no"
11670 fi
11671 rm -f conftest*
11672 fi
11673 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11674   echo "$ac_t""yes" 1>&6
11675     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11676   cat >> confdefs.h <<EOF
11677 #define $ac_tr_hdr 1
11678 EOF
11679  
11680 else
11681   echo "$ac_t""no" 1>&6
11682 fi
11683 done
11684
11685 if test $ac_cv_header_db_h = yes; then
11686         ol_cv_lib_db=no
11687 if test $ol_cv_lib_db = no ; then
11688         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
11689 echo "configure:11690: checking for Berkeley DB link (default)" >&5
11690 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
11691   echo $ac_n "(cached) $ac_c" 1>&6
11692 else
11693   
11694         ol_DB_LIB=
11695         ol_LIBS=$LIBS
11696         LIBS="$ol_DB_LIB $LIBS"
11697
11698         cat > conftest.$ac_ext <<EOF
11699 #line 11700 "configure"
11700 #include "confdefs.h"
11701
11702 #ifdef HAVE_DB_185_H
11703 # include <db_185.h>
11704 #else
11705 # include <db.h>
11706 #endif
11707
11708 #ifndef DB_VERSION_MAJOR
11709 # define DB_VERSION_MAJOR 1
11710 #endif
11711
11712 #ifndef NULL
11713 #define NULL ((void*)0)
11714 #endif
11715
11716 int main() {
11717
11718 #if DB_VERSION_MAJOR > 2
11719         db_env_create( NULL, 0 );
11720 #elif DB_VERSION_MAJOR > 1
11721         db_appexit( NULL );
11722 #else
11723         (void) dbopen( NULL, 0, 0, 0, NULL);
11724 #endif
11725
11726 ; return 0; }
11727 EOF
11728 if { (eval echo configure:11729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11729   rm -rf conftest*
11730   ol_cv_db_none=yes
11731 else
11732   echo "configure: failed program was:" >&5
11733   cat conftest.$ac_ext >&5
11734   rm -rf conftest*
11735   ol_cv_db_none=no
11736 fi
11737 rm -f conftest*
11738
11739         LIBS="$ol_LIBS"
11740
11741 fi
11742
11743 echo "$ac_t""$ol_cv_db_none" 1>&6
11744
11745         if test $ol_cv_db_none = yes ; then
11746                 ol_cv_lib_db=yes
11747         fi
11748 fi
11749
11750 if test $ol_cv_lib_db = no ; then
11751         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
11752 echo "configure:11753: checking for Berkeley DB link (-ldb)" >&5
11753 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
11754   echo $ac_n "(cached) $ac_c" 1>&6
11755 else
11756   
11757         ol_DB_LIB=-ldb
11758         ol_LIBS=$LIBS
11759         LIBS="$ol_DB_LIB $LIBS"
11760
11761         cat > conftest.$ac_ext <<EOF
11762 #line 11763 "configure"
11763 #include "confdefs.h"
11764
11765 #ifdef HAVE_DB_185_H
11766 # include <db_185.h>
11767 #else
11768 # include <db.h>
11769 #endif
11770
11771 #ifndef DB_VERSION_MAJOR
11772 # define DB_VERSION_MAJOR 1
11773 #endif
11774
11775 #ifndef NULL
11776 #define NULL ((void*)0)
11777 #endif
11778
11779 int main() {
11780
11781 #if DB_VERSION_MAJOR > 2
11782         db_env_create( NULL, 0 );
11783 #elif DB_VERSION_MAJOR > 1
11784         db_appexit( NULL );
11785 #else
11786         (void) dbopen( NULL, 0, 0, 0, NULL);
11787 #endif
11788
11789 ; return 0; }
11790 EOF
11791 if { (eval echo configure:11792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11792   rm -rf conftest*
11793   ol_cv_db_db=yes
11794 else
11795   echo "configure: failed program was:" >&5
11796   cat conftest.$ac_ext >&5
11797   rm -rf conftest*
11798   ol_cv_db_db=no
11799 fi
11800 rm -f conftest*
11801
11802         LIBS="$ol_LIBS"
11803
11804 fi
11805
11806 echo "$ac_t""$ol_cv_db_db" 1>&6
11807
11808         if test $ol_cv_db_db = yes ; then
11809                 ol_cv_lib_db=-ldb
11810         fi
11811 fi
11812
11813 if test $ol_cv_lib_db = no ; then
11814         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
11815 echo "configure:11816: checking for Berkeley DB link (-ldb3)" >&5
11816 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
11817   echo $ac_n "(cached) $ac_c" 1>&6
11818 else
11819   
11820         ol_DB_LIB=-ldb3
11821         ol_LIBS=$LIBS
11822         LIBS="$ol_DB_LIB $LIBS"
11823
11824         cat > conftest.$ac_ext <<EOF
11825 #line 11826 "configure"
11826 #include "confdefs.h"
11827
11828 #ifdef HAVE_DB_185_H
11829 # include <db_185.h>
11830 #else
11831 # include <db.h>
11832 #endif
11833
11834 #ifndef DB_VERSION_MAJOR
11835 # define DB_VERSION_MAJOR 1
11836 #endif
11837
11838 #ifndef NULL
11839 #define NULL ((void*)0)
11840 #endif
11841
11842 int main() {
11843
11844 #if DB_VERSION_MAJOR > 2
11845         db_env_create( NULL, 0 );
11846 #elif DB_VERSION_MAJOR > 1
11847         db_appexit( NULL );
11848 #else
11849         (void) dbopen( NULL, 0, 0, 0, NULL);
11850 #endif
11851
11852 ; return 0; }
11853 EOF
11854 if { (eval echo configure:11855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11855   rm -rf conftest*
11856   ol_cv_db_db3=yes
11857 else
11858   echo "configure: failed program was:" >&5
11859   cat conftest.$ac_ext >&5
11860   rm -rf conftest*
11861   ol_cv_db_db3=no
11862 fi
11863 rm -f conftest*
11864
11865         LIBS="$ol_LIBS"
11866
11867 fi
11868
11869 echo "$ac_t""$ol_cv_db_db3" 1>&6
11870
11871         if test $ol_cv_db_db3 = yes ; then
11872                 ol_cv_lib_db=-ldb3
11873         fi
11874 fi
11875
11876 if test $ol_cv_lib_db = no ; then
11877         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
11878 echo "configure:11879: checking for Berkeley DB link (-ldb2)" >&5
11879 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
11880   echo $ac_n "(cached) $ac_c" 1>&6
11881 else
11882   
11883         ol_DB_LIB=-ldb2
11884         ol_LIBS=$LIBS
11885         LIBS="$ol_DB_LIB $LIBS"
11886
11887         cat > conftest.$ac_ext <<EOF
11888 #line 11889 "configure"
11889 #include "confdefs.h"
11890
11891 #ifdef HAVE_DB_185_H
11892 # include <db_185.h>
11893 #else
11894 # include <db.h>
11895 #endif
11896
11897 #ifndef DB_VERSION_MAJOR
11898 # define DB_VERSION_MAJOR 1
11899 #endif
11900
11901 #ifndef NULL
11902 #define NULL ((void*)0)
11903 #endif
11904
11905 int main() {
11906
11907 #if DB_VERSION_MAJOR > 2
11908         db_env_create( NULL, 0 );
11909 #elif DB_VERSION_MAJOR > 1
11910         db_appexit( NULL );
11911 #else
11912         (void) dbopen( NULL, 0, 0, 0, NULL);
11913 #endif
11914
11915 ; return 0; }
11916 EOF
11917 if { (eval echo configure:11918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11918   rm -rf conftest*
11919   ol_cv_db_db2=yes
11920 else
11921   echo "configure: failed program was:" >&5
11922   cat conftest.$ac_ext >&5
11923   rm -rf conftest*
11924   ol_cv_db_db2=no
11925 fi
11926 rm -f conftest*
11927
11928         LIBS="$ol_LIBS"
11929
11930 fi
11931
11932 echo "$ac_t""$ol_cv_db_db2" 1>&6
11933
11934         if test $ol_cv_db_db2 = yes ; then
11935                 ol_cv_lib_db=-ldb2
11936         fi
11937 fi
11938
11939 if test $ol_cv_lib_db = no ; then
11940         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
11941 echo "configure:11942: checking for Berkeley DB link (-ldb1)" >&5
11942 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
11943   echo $ac_n "(cached) $ac_c" 1>&6
11944 else
11945   
11946         ol_DB_LIB=-ldb1
11947         ol_LIBS=$LIBS
11948         LIBS="$ol_DB_LIB $LIBS"
11949
11950         cat > conftest.$ac_ext <<EOF
11951 #line 11952 "configure"
11952 #include "confdefs.h"
11953
11954 #ifdef HAVE_DB_185_H
11955 # include <db_185.h>
11956 #else
11957 # include <db.h>
11958 #endif
11959
11960 #ifndef DB_VERSION_MAJOR
11961 # define DB_VERSION_MAJOR 1
11962 #endif
11963
11964 #ifndef NULL
11965 #define NULL ((void*)0)
11966 #endif
11967
11968 int main() {
11969
11970 #if DB_VERSION_MAJOR > 2
11971         db_env_create( NULL, 0 );
11972 #elif DB_VERSION_MAJOR > 1
11973         db_appexit( NULL );
11974 #else
11975         (void) dbopen( NULL, 0, 0, 0, NULL);
11976 #endif
11977
11978 ; return 0; }
11979 EOF
11980 if { (eval echo configure:11981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11981   rm -rf conftest*
11982   ol_cv_db_db1=yes
11983 else
11984   echo "configure: failed program was:" >&5
11985   cat conftest.$ac_ext >&5
11986   rm -rf conftest*
11987   ol_cv_db_db1=no
11988 fi
11989 rm -f conftest*
11990
11991         LIBS="$ol_LIBS"
11992
11993 fi
11994
11995 echo "$ac_t""$ol_cv_db_db1" 1>&6
11996
11997         if test $ol_cv_db_db1 = yes ; then
11998                 ol_cv_lib_db=-ldb1
11999         fi
12000 fi
12001
12002
12003         if test "$ol_cv_lib_db" != no ; then
12004                 ol_cv_berkeley_db=yes
12005                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
12006 echo "configure:12007: checking for Berkeley DB thread support" >&5
12007 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
12008   echo $ac_n "(cached) $ac_c" 1>&6
12009 else
12010   
12011         ol_LIBS="$LIBS"
12012         if test $ol_cv_lib_db != yes ; then
12013                 LIBS="$ol_cv_lib_db"
12014         fi
12015
12016         if test "$cross_compiling" = yes; then
12017   ol_cv_berkeley_db_thread=cross
12018 else
12019   cat > conftest.$ac_ext <<EOF
12020 #line 12021 "configure"
12021 #include "confdefs.h"
12022
12023 #ifdef HAVE_DB_185_H
12024         choke me;
12025 #else
12026 #include <db.h>
12027 #endif
12028 #ifndef NULL
12029 #define NULL ((void *)0)
12030 #endif
12031 main()
12032 {
12033         int rc;
12034         u_int32_t flags = DB_CREATE | DB_THREAD;
12035
12036 #if DB_VERSION_MAJOR > 2
12037         DB_ENV *env = NULL;
12038
12039         rc = db_env_create( &env, 0 );
12040
12041         if( rc == 0 ) {
12042 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
12043                 rc = env->open( env, NULL, flags, 0 );
12044 #else
12045                 rc = env->open( env, NULL, NULL, flags, 0 );
12046 #endif
12047         }
12048
12049 #else
12050         DB_ENV env;
12051         memset( &env, '\0', sizeof(env) );
12052
12053         rc = db_appinit( NULL, NULL, &env, flags );
12054
12055         if( rc == 0 ) {
12056                 db_appexit( &env );
12057         }
12058 #endif
12059 #if DB_VERSION_MAJOR > 2
12060 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
12061         env->remove( env, NULL, DB_FORCE);
12062 #else
12063         env->remove( env, NULL, NULL, DB_FORCE);
12064 #endif
12065 #endif
12066
12067         return rc;
12068 }
12069 EOF
12070 if { (eval echo configure:12071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12071 then
12072   ol_cv_berkeley_db_thread=yes
12073 else
12074   echo "configure: failed program was:" >&5
12075   cat conftest.$ac_ext >&5
12076   rm -fr conftest*
12077   ol_cv_berkeley_db_thread=no
12078 fi
12079 rm -fr conftest*
12080 fi
12081
12082
12083         LIBS="$ol_LIBS"
12084
12085         if test $ol_cv_berkeley_db_thread != no ; then
12086                 cat >> confdefs.h <<\EOF
12087 #define HAVE_BERKELEY_DB_THREAD 1
12088 EOF
12089
12090         fi
12091
12092 fi
12093
12094 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
12095         fi
12096 fi
12097
12098         fi
12099
12100         if test $ol_cv_berkeley_db != no ; then
12101                 cat >> confdefs.h <<\EOF
12102 #define HAVE_BERKELEY_DB 1
12103 EOF
12104
12105
12106                 ol_link_ldbm=berkeley
12107                 ol_with_ldbm_api=db
12108
12109                 if test $ol_with_ldbm_type = hash ; then
12110                         cat >> confdefs.h <<\EOF
12111 #define LDBM_USE_DBHASH 1
12112 EOF
12113
12114                 else
12115                         cat >> confdefs.h <<\EOF
12116 #define LDBM_USE_DBBTREE 1
12117 EOF
12118
12119                 fi
12120
12121                                                 if test $ol_cv_lib_db != yes ; then
12122                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
12123                 fi
12124         fi
12125 fi
12126
12127 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
12128         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
12129         ol_with_ldbm_api=none
12130 fi
12131
12132 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
12133         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
12134 echo "configure:12135: checking for MDBM library" >&5
12135 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
12136   echo $ac_n "(cached) $ac_c" 1>&6
12137 else
12138         ol_LIBS="$LIBS"
12139         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
12140 echo "configure:12141: checking for mdbm_set_chain" >&5
12141 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
12142   echo $ac_n "(cached) $ac_c" 1>&6
12143 else
12144   cat > conftest.$ac_ext <<EOF
12145 #line 12146 "configure"
12146 #include "confdefs.h"
12147 /* System header to define __stub macros and hopefully few prototypes,
12148     which can conflict with char mdbm_set_chain(); below.  */
12149 #include <assert.h>
12150 /* Override any gcc2 internal prototype to avoid an error.  */
12151 /* We use char because int might match the return type of a gcc2
12152     builtin and then its argument prototype would still apply.  */
12153 char mdbm_set_chain();
12154 char (*f)();
12155
12156 int main() {
12157
12158 /* The GNU C library defines this for functions which it implements
12159     to always fail with ENOSYS.  Some functions are actually named
12160     something starting with __ and the normal name is an alias.  */
12161 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
12162 choke me
12163 #else
12164 f = mdbm_set_chain;
12165 #endif
12166
12167 ; return 0; }
12168 EOF
12169 if { (eval echo configure:12170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12170   rm -rf conftest*
12171   eval "ac_cv_func_mdbm_set_chain=yes"
12172 else
12173   echo "configure: failed program was:" >&5
12174   cat conftest.$ac_ext >&5
12175   rm -rf conftest*
12176   eval "ac_cv_func_mdbm_set_chain=no"
12177 fi
12178 rm -f conftest*
12179 fi
12180
12181 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
12182   echo "$ac_t""yes" 1>&6
12183   ol_cv_lib_mdbm=yes
12184 else
12185   echo "$ac_t""no" 1>&6
12186
12187                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
12188 echo "configure:12189: checking for mdbm_set_chain in -lmdbm" >&5
12189 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
12190 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12191   echo $ac_n "(cached) $ac_c" 1>&6
12192 else
12193   ac_save_LIBS="$LIBS"
12194 LIBS="-lmdbm  $LIBS"
12195 cat > conftest.$ac_ext <<EOF
12196 #line 12197 "configure"
12197 #include "confdefs.h"
12198 /* Override any gcc2 internal prototype to avoid an error.  */
12199 /* We use char because int might match the return type of a gcc2
12200     builtin and then its argument prototype would still apply.  */
12201 char mdbm_set_chain();
12202
12203 int main() {
12204 mdbm_set_chain()
12205 ; return 0; }
12206 EOF
12207 if { (eval echo configure:12208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12208   rm -rf conftest*
12209   eval "ac_cv_lib_$ac_lib_var=yes"
12210 else
12211   echo "configure: failed program was:" >&5
12212   cat conftest.$ac_ext >&5
12213   rm -rf conftest*
12214   eval "ac_cv_lib_$ac_lib_var=no"
12215 fi
12216 rm -f conftest*
12217 LIBS="$ac_save_LIBS"
12218
12219 fi
12220 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12221   echo "$ac_t""yes" 1>&6
12222   ol_cv_lib_mdbm=-lmdbm
12223 else
12224   echo "$ac_t""no" 1>&6
12225 ol_cv_lib_mdbm=no
12226 fi
12227
12228         
12229 fi
12230
12231         LIBS="$ol_LIBS"
12232
12233 fi
12234
12235 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
12236
12237
12238  for ac_hdr in mdbm.h
12239 do
12240 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12241 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12242 echo "configure:12243: checking for $ac_hdr" >&5
12243 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12244   echo $ac_n "(cached) $ac_c" 1>&6
12245 else
12246   cat > conftest.$ac_ext <<EOF
12247 #line 12248 "configure"
12248 #include "confdefs.h"
12249 #include <$ac_hdr>
12250 EOF
12251 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12252 { (eval echo configure:12253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12253 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12254 if test -z "$ac_err"; then
12255   rm -rf conftest*
12256   eval "ac_cv_header_$ac_safe=yes"
12257 else
12258   echo "$ac_err" >&5
12259   echo "configure: failed program was:" >&5
12260   cat conftest.$ac_ext >&5
12261   rm -rf conftest*
12262   eval "ac_cv_header_$ac_safe=no"
12263 fi
12264 rm -f conftest*
12265 fi
12266 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12267   echo "$ac_t""yes" 1>&6
12268     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12269   cat >> confdefs.h <<EOF
12270 #define $ac_tr_hdr 1
12271 EOF
12272  
12273 else
12274   echo "$ac_t""no" 1>&6
12275 fi
12276 done
12277
12278  echo $ac_n "checking for db""... $ac_c" 1>&6
12279 echo "configure:12280: checking for db" >&5
12280 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
12281   echo $ac_n "(cached) $ac_c" 1>&6
12282 else
12283   
12284         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
12285                 ol_cv_mdbm=no
12286         else
12287                 ol_cv_mdbm=yes
12288         fi
12289
12290 fi
12291
12292 echo "$ac_t""$ol_cv_mdbm" 1>&6
12293  if test $ol_cv_mdbm = yes ; then
12294         cat >> confdefs.h <<\EOF
12295 #define HAVE_MDBM 1
12296 EOF
12297
12298  fi
12299
12300
12301         if test $ol_cv_mdbm = yes ; then
12302                 ol_link_ldbm=mdbm
12303                 ol_with_ldbm_api=mdbm
12304                 if test $ol_cv_lib_mdbm != yes ; then
12305                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
12306                 fi
12307         fi
12308 fi
12309
12310 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
12311         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
12312 echo "configure:12313: checking for GDBM library" >&5
12313 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
12314   echo $ac_n "(cached) $ac_c" 1>&6
12315 else
12316         ol_LIBS="$LIBS"
12317         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
12318 echo "configure:12319: checking for gdbm_open" >&5
12319 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
12320   echo $ac_n "(cached) $ac_c" 1>&6
12321 else
12322   cat > conftest.$ac_ext <<EOF
12323 #line 12324 "configure"
12324 #include "confdefs.h"
12325 /* System header to define __stub macros and hopefully few prototypes,
12326     which can conflict with char gdbm_open(); below.  */
12327 #include <assert.h>
12328 /* Override any gcc2 internal prototype to avoid an error.  */
12329 /* We use char because int might match the return type of a gcc2
12330     builtin and then its argument prototype would still apply.  */
12331 char gdbm_open();
12332 char (*f)();
12333
12334 int main() {
12335
12336 /* The GNU C library defines this for functions which it implements
12337     to always fail with ENOSYS.  Some functions are actually named
12338     something starting with __ and the normal name is an alias.  */
12339 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
12340 choke me
12341 #else
12342 f = gdbm_open;
12343 #endif
12344
12345 ; return 0; }
12346 EOF
12347 if { (eval echo configure:12348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12348   rm -rf conftest*
12349   eval "ac_cv_func_gdbm_open=yes"
12350 else
12351   echo "configure: failed program was:" >&5
12352   cat conftest.$ac_ext >&5
12353   rm -rf conftest*
12354   eval "ac_cv_func_gdbm_open=no"
12355 fi
12356 rm -f conftest*
12357 fi
12358
12359 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
12360   echo "$ac_t""yes" 1>&6
12361   ol_cv_lib_gdbm=yes
12362 else
12363   echo "$ac_t""no" 1>&6
12364
12365                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
12366 echo "configure:12367: checking for gdbm_open in -lgdbm" >&5
12367 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
12368 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12369   echo $ac_n "(cached) $ac_c" 1>&6
12370 else
12371   ac_save_LIBS="$LIBS"
12372 LIBS="-lgdbm  $LIBS"
12373 cat > conftest.$ac_ext <<EOF
12374 #line 12375 "configure"
12375 #include "confdefs.h"
12376 /* Override any gcc2 internal prototype to avoid an error.  */
12377 /* We use char because int might match the return type of a gcc2
12378     builtin and then its argument prototype would still apply.  */
12379 char gdbm_open();
12380
12381 int main() {
12382 gdbm_open()
12383 ; return 0; }
12384 EOF
12385 if { (eval echo configure:12386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12386   rm -rf conftest*
12387   eval "ac_cv_lib_$ac_lib_var=yes"
12388 else
12389   echo "configure: failed program was:" >&5
12390   cat conftest.$ac_ext >&5
12391   rm -rf conftest*
12392   eval "ac_cv_lib_$ac_lib_var=no"
12393 fi
12394 rm -f conftest*
12395 LIBS="$ac_save_LIBS"
12396
12397 fi
12398 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12399   echo "$ac_t""yes" 1>&6
12400   ol_cv_lib_gdbm=-lgdbm
12401 else
12402   echo "$ac_t""no" 1>&6
12403 ol_cv_lib_gdbm=no
12404 fi
12405
12406         
12407 fi
12408
12409         LIBS="$ol_LIBS"
12410
12411 fi
12412
12413 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
12414
12415
12416  for ac_hdr in gdbm.h
12417 do
12418 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12419 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12420 echo "configure:12421: checking for $ac_hdr" >&5
12421 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12422   echo $ac_n "(cached) $ac_c" 1>&6
12423 else
12424   cat > conftest.$ac_ext <<EOF
12425 #line 12426 "configure"
12426 #include "confdefs.h"
12427 #include <$ac_hdr>
12428 EOF
12429 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12430 { (eval echo configure:12431: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12431 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12432 if test -z "$ac_err"; then
12433   rm -rf conftest*
12434   eval "ac_cv_header_$ac_safe=yes"
12435 else
12436   echo "$ac_err" >&5
12437   echo "configure: failed program was:" >&5
12438   cat conftest.$ac_ext >&5
12439   rm -rf conftest*
12440   eval "ac_cv_header_$ac_safe=no"
12441 fi
12442 rm -f conftest*
12443 fi
12444 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12445   echo "$ac_t""yes" 1>&6
12446     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12447   cat >> confdefs.h <<EOF
12448 #define $ac_tr_hdr 1
12449 EOF
12450  
12451 else
12452   echo "$ac_t""no" 1>&6
12453 fi
12454 done
12455
12456  echo $ac_n "checking for db""... $ac_c" 1>&6
12457 echo "configure:12458: checking for db" >&5
12458 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
12459   echo $ac_n "(cached) $ac_c" 1>&6
12460 else
12461   
12462         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
12463                 ol_cv_gdbm=no
12464         else
12465                 ol_cv_gdbm=yes
12466         fi
12467
12468 fi
12469
12470 echo "$ac_t""$ol_cv_gdbm" 1>&6
12471  if test $ol_cv_gdbm = yes ; then
12472         cat >> confdefs.h <<\EOF
12473 #define HAVE_GDBM 1
12474 EOF
12475
12476  fi
12477
12478
12479         if test $ol_cv_gdbm = yes ; then
12480                 ol_link_ldbm=gdbm
12481                 ol_with_ldbm_api=gdbm
12482
12483                 if test $ol_cv_lib_gdbm != yes ; then
12484                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
12485                 fi
12486         fi
12487 fi
12488
12489 if test $ol_with_ldbm_api = ndbm ; then
12490         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
12491 echo "configure:12492: checking for NDBM library" >&5
12492 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
12493   echo $ac_n "(cached) $ac_c" 1>&6
12494 else
12495         ol_LIBS="$LIBS"
12496         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
12497 echo "configure:12498: checking for dbm_open" >&5
12498 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
12499   echo $ac_n "(cached) $ac_c" 1>&6
12500 else
12501   cat > conftest.$ac_ext <<EOF
12502 #line 12503 "configure"
12503 #include "confdefs.h"
12504 /* System header to define __stub macros and hopefully few prototypes,
12505     which can conflict with char dbm_open(); below.  */
12506 #include <assert.h>
12507 /* Override any gcc2 internal prototype to avoid an error.  */
12508 /* We use char because int might match the return type of a gcc2
12509     builtin and then its argument prototype would still apply.  */
12510 char dbm_open();
12511 char (*f)();
12512
12513 int main() {
12514
12515 /* The GNU C library defines this for functions which it implements
12516     to always fail with ENOSYS.  Some functions are actually named
12517     something starting with __ and the normal name is an alias.  */
12518 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
12519 choke me
12520 #else
12521 f = dbm_open;
12522 #endif
12523
12524 ; return 0; }
12525 EOF
12526 if { (eval echo configure:12527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12527   rm -rf conftest*
12528   eval "ac_cv_func_dbm_open=yes"
12529 else
12530   echo "configure: failed program was:" >&5
12531   cat conftest.$ac_ext >&5
12532   rm -rf conftest*
12533   eval "ac_cv_func_dbm_open=no"
12534 fi
12535 rm -f conftest*
12536 fi
12537
12538 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
12539   echo "$ac_t""yes" 1>&6
12540   ol_cv_lib_ndbm=yes
12541 else
12542   echo "$ac_t""no" 1>&6
12543
12544                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
12545 echo "configure:12546: checking for dbm_open in -lndbm" >&5
12546 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
12547 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12548   echo $ac_n "(cached) $ac_c" 1>&6
12549 else
12550   ac_save_LIBS="$LIBS"
12551 LIBS="-lndbm  $LIBS"
12552 cat > conftest.$ac_ext <<EOF
12553 #line 12554 "configure"
12554 #include "confdefs.h"
12555 /* Override any gcc2 internal prototype to avoid an error.  */
12556 /* We use char because int might match the return type of a gcc2
12557     builtin and then its argument prototype would still apply.  */
12558 char dbm_open();
12559
12560 int main() {
12561 dbm_open()
12562 ; return 0; }
12563 EOF
12564 if { (eval echo configure:12565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12565   rm -rf conftest*
12566   eval "ac_cv_lib_$ac_lib_var=yes"
12567 else
12568   echo "configure: failed program was:" >&5
12569   cat conftest.$ac_ext >&5
12570   rm -rf conftest*
12571   eval "ac_cv_lib_$ac_lib_var=no"
12572 fi
12573 rm -f conftest*
12574 LIBS="$ac_save_LIBS"
12575
12576 fi
12577 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12578   echo "$ac_t""yes" 1>&6
12579   ol_cv_lib_ndbm=-lndbm
12580 else
12581   echo "$ac_t""no" 1>&6
12582
12583                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
12584 echo "configure:12585: checking for dbm_open in -ldbm" >&5
12585 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
12586 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12587   echo $ac_n "(cached) $ac_c" 1>&6
12588 else
12589   ac_save_LIBS="$LIBS"
12590 LIBS="-ldbm  $LIBS"
12591 cat > conftest.$ac_ext <<EOF
12592 #line 12593 "configure"
12593 #include "confdefs.h"
12594 /* Override any gcc2 internal prototype to avoid an error.  */
12595 /* We use char because int might match the return type of a gcc2
12596     builtin and then its argument prototype would still apply.  */
12597 char dbm_open();
12598
12599 int main() {
12600 dbm_open()
12601 ; return 0; }
12602 EOF
12603 if { (eval echo configure:12604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12604   rm -rf conftest*
12605   eval "ac_cv_lib_$ac_lib_var=yes"
12606 else
12607   echo "configure: failed program was:" >&5
12608   cat conftest.$ac_ext >&5
12609   rm -rf conftest*
12610   eval "ac_cv_lib_$ac_lib_var=no"
12611 fi
12612 rm -f conftest*
12613 LIBS="$ac_save_LIBS"
12614
12615 fi
12616 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12617   echo "$ac_t""yes" 1>&6
12618   ol_cv_lib_ndbm=-ldbm
12619 else
12620   echo "$ac_t""no" 1>&6
12621 ol_cv_lib_ndbm=no
12622 fi
12623                 
12624 fi
12625
12626         
12627 fi
12628
12629         LIBS="$ol_LIBS"
12630
12631 fi
12632
12633 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
12634
12635
12636  for ac_hdr in ndbm.h
12637 do
12638 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12639 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12640 echo "configure:12641: checking for $ac_hdr" >&5
12641 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12642   echo $ac_n "(cached) $ac_c" 1>&6
12643 else
12644   cat > conftest.$ac_ext <<EOF
12645 #line 12646 "configure"
12646 #include "confdefs.h"
12647 #include <$ac_hdr>
12648 EOF
12649 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12650 { (eval echo configure:12651: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12651 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12652 if test -z "$ac_err"; then
12653   rm -rf conftest*
12654   eval "ac_cv_header_$ac_safe=yes"
12655 else
12656   echo "$ac_err" >&5
12657   echo "configure: failed program was:" >&5
12658   cat conftest.$ac_ext >&5
12659   rm -rf conftest*
12660   eval "ac_cv_header_$ac_safe=no"
12661 fi
12662 rm -f conftest*
12663 fi
12664 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12665   echo "$ac_t""yes" 1>&6
12666     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12667   cat >> confdefs.h <<EOF
12668 #define $ac_tr_hdr 1
12669 EOF
12670  
12671 else
12672   echo "$ac_t""no" 1>&6
12673 fi
12674 done
12675
12676  echo $ac_n "checking for db""... $ac_c" 1>&6
12677 echo "configure:12678: checking for db" >&5
12678 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
12679   echo $ac_n "(cached) $ac_c" 1>&6
12680 else
12681   
12682         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
12683                 ol_cv_ndbm=no
12684         else
12685                 ol_cv_ndbm=yes
12686         fi
12687
12688 fi
12689
12690 echo "$ac_t""$ol_cv_ndbm" 1>&6
12691  if test $ol_cv_ndbm = yes ; then
12692         cat >> confdefs.h <<\EOF
12693 #define HAVE_NDBM 1
12694 EOF
12695
12696  fi
12697
12698
12699         if test $ol_cv_ndbm = yes ; then
12700                 ol_link_ldbm=ndbm
12701                 ol_with_ldbm_api=ndbm
12702
12703                 if test $ol_cv_lib_ndbm != yes ; then
12704                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
12705                 fi
12706         fi
12707 fi
12708
12709 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
12710         echo "configure: warning: could not find suitable LDBM backend" 1>&2
12711         if test $ol_enable_ldbm = yes ; then
12712                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
12713         fi
12714
12715         echo "configure: warning: disabling LDBM" 1>&2
12716         ol_enable_ldbm=no
12717 fi
12718
12719 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
12720         LINK_BINS_DYNAMIC="yes"
12721 else
12722         LINK_BINS_DYNAMIC="no"
12723 fi
12724
12725 if test $ol_enable_wrappers != no ; then
12726         for ac_hdr in tcpd.h
12727 do
12728 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12729 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12730 echo "configure:12731: checking for $ac_hdr" >&5
12731 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12732   echo $ac_n "(cached) $ac_c" 1>&6
12733 else
12734   cat > conftest.$ac_ext <<EOF
12735 #line 12736 "configure"
12736 #include "confdefs.h"
12737 #include <$ac_hdr>
12738 EOF
12739 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12740 { (eval echo configure:12741: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12741 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12742 if test -z "$ac_err"; then
12743   rm -rf conftest*
12744   eval "ac_cv_header_$ac_safe=yes"
12745 else
12746   echo "$ac_err" >&5
12747   echo "configure: failed program was:" >&5
12748   cat conftest.$ac_ext >&5
12749   rm -rf conftest*
12750   eval "ac_cv_header_$ac_safe=no"
12751 fi
12752 rm -f conftest*
12753 fi
12754 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12755   echo "$ac_t""yes" 1>&6
12756     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12757   cat >> confdefs.h <<EOF
12758 #define $ac_tr_hdr 1
12759 EOF
12760  
12761 else
12762   echo "$ac_t""no" 1>&6
12763 fi
12764 done
12765
12766
12767         if test $ac_cv_header_tcpd_h != yes ; then
12768                 have_wrappers=no
12769         else
12770                 cat > conftest.$ac_ext <<EOF
12771 #line 12772 "configure"
12772 #include "confdefs.h"
12773
12774 int allow_severity = 0;
12775 int deny_severity  = 0;
12776                 
12777 int main() {
12778 hosts_access()
12779 ; return 0; }
12780 EOF
12781 if { (eval echo configure:12782: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
12782   rm -rf conftest*
12783   have_wrappers=yes
12784 else
12785   echo "configure: failed program was:" >&5
12786   cat conftest.$ac_ext >&5
12787   rm -rf conftest*
12788   have_wrappers=no
12789 fi
12790 rm -f conftest*
12791         fi
12792
12793         if test $have_wrappers = yes ; then
12794                 cat >> confdefs.h <<\EOF
12795 #define HAVE_TCPD 1
12796 EOF
12797
12798                 WRAP_LIBS="-lwrap"
12799
12800                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
12801 echo "configure:12802: checking for main in -lnsl" >&5
12802 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
12803 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12804   echo $ac_n "(cached) $ac_c" 1>&6
12805 else
12806   ac_save_LIBS="$LIBS"
12807 LIBS="-lnsl  $LIBS"
12808 cat > conftest.$ac_ext <<EOF
12809 #line 12810 "configure"
12810 #include "confdefs.h"
12811
12812 int main() {
12813 main()
12814 ; return 0; }
12815 EOF
12816 if { (eval echo configure:12817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12817   rm -rf conftest*
12818   eval "ac_cv_lib_$ac_lib_var=yes"
12819 else
12820   echo "configure: failed program was:" >&5
12821   cat conftest.$ac_ext >&5
12822   rm -rf conftest*
12823   eval "ac_cv_lib_$ac_lib_var=no"
12824 fi
12825 rm -f conftest*
12826 LIBS="$ac_save_LIBS"
12827
12828 fi
12829 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12830   echo "$ac_t""yes" 1>&6
12831     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
12832     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
12833   cat >> confdefs.h <<EOF
12834 #define $ac_tr_lib 1
12835 EOF
12836
12837   LIBS="-lnsl $LIBS"
12838
12839 else
12840   echo "$ac_t""no" 1>&6
12841 fi
12842
12843         else
12844                 echo "configure: warning: could not find -lwrap" 1>&2
12845                 if test $ol_enable_wrappers = yes ; then
12846                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
12847                 fi
12848
12849                 echo "configure: warning: disabling wrappers support" 1>&2
12850                 ol_enable_wrappers=no
12851                 WRAP_LIBS=""
12852         fi
12853 fi
12854
12855 if test $ol_enable_syslog != no ; then
12856         echo $ac_n "checking for openlog""... $ac_c" 1>&6
12857 echo "configure:12858: checking for openlog" >&5
12858 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
12859   echo $ac_n "(cached) $ac_c" 1>&6
12860 else
12861   cat > conftest.$ac_ext <<EOF
12862 #line 12863 "configure"
12863 #include "confdefs.h"
12864 /* System header to define __stub macros and hopefully few prototypes,
12865     which can conflict with char openlog(); below.  */
12866 #include <assert.h>
12867 /* Override any gcc2 internal prototype to avoid an error.  */
12868 /* We use char because int might match the return type of a gcc2
12869     builtin and then its argument prototype would still apply.  */
12870 char openlog();
12871 char (*f)();
12872
12873 int main() {
12874
12875 /* The GNU C library defines this for functions which it implements
12876     to always fail with ENOSYS.  Some functions are actually named
12877     something starting with __ and the normal name is an alias.  */
12878 #if defined (__stub_openlog) || defined (__stub___openlog)
12879 choke me
12880 #else
12881 f = openlog;
12882 #endif
12883
12884 ; return 0; }
12885 EOF
12886 if { (eval echo configure:12887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12887   rm -rf conftest*
12888   eval "ac_cv_func_openlog=yes"
12889 else
12890   echo "configure: failed program was:" >&5
12891   cat conftest.$ac_ext >&5
12892   rm -rf conftest*
12893   eval "ac_cv_func_openlog=no"
12894 fi
12895 rm -f conftest*
12896 fi
12897
12898 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
12899   echo "$ac_t""yes" 1>&6
12900   :
12901 else
12902   echo "$ac_t""no" 1>&6
12903 fi
12904
12905         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
12906                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
12907         fi
12908         ol_enable_syslog=$ac_cv_func_openlog
12909 fi
12910
12911 ol_link_termcap=no
12912 for ac_hdr in termcap.h ncurses.h
12913 do
12914 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12915 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12916 echo "configure:12917: checking for $ac_hdr" >&5
12917 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12918   echo $ac_n "(cached) $ac_c" 1>&6
12919 else
12920   cat > conftest.$ac_ext <<EOF
12921 #line 12922 "configure"
12922 #include "confdefs.h"
12923 #include <$ac_hdr>
12924 EOF
12925 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12926 { (eval echo configure:12927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12927 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12928 if test -z "$ac_err"; then
12929   rm -rf conftest*
12930   eval "ac_cv_header_$ac_safe=yes"
12931 else
12932   echo "$ac_err" >&5
12933   echo "configure: failed program was:" >&5
12934   cat conftest.$ac_ext >&5
12935   rm -rf conftest*
12936   eval "ac_cv_header_$ac_safe=no"
12937 fi
12938 rm -f conftest*
12939 fi
12940 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12941   echo "$ac_t""yes" 1>&6
12942     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12943   cat >> confdefs.h <<EOF
12944 #define $ac_tr_hdr 1
12945 EOF
12946  
12947 else
12948   echo "$ac_t""no" 1>&6
12949 fi
12950 done
12951
12952
12953 if test $ol_link_termcap = no ; then
12954         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
12955 echo "configure:12956: checking for tputs in -ltermcap" >&5
12956 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
12957 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12958   echo $ac_n "(cached) $ac_c" 1>&6
12959 else
12960   ac_save_LIBS="$LIBS"
12961 LIBS="-ltermcap  $LIBS"
12962 cat > conftest.$ac_ext <<EOF
12963 #line 12964 "configure"
12964 #include "confdefs.h"
12965 /* Override any gcc2 internal prototype to avoid an error.  */
12966 /* We use char because int might match the return type of a gcc2
12967     builtin and then its argument prototype would still apply.  */
12968 char tputs();
12969
12970 int main() {
12971 tputs()
12972 ; return 0; }
12973 EOF
12974 if { (eval echo configure:12975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12975   rm -rf conftest*
12976   eval "ac_cv_lib_$ac_lib_var=yes"
12977 else
12978   echo "configure: failed program was:" >&5
12979   cat conftest.$ac_ext >&5
12980   rm -rf conftest*
12981   eval "ac_cv_lib_$ac_lib_var=no"
12982 fi
12983 rm -f conftest*
12984 LIBS="$ac_save_LIBS"
12985
12986 fi
12987 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12988   echo "$ac_t""yes" 1>&6
12989   have_termcap=yes
12990 else
12991   echo "$ac_t""no" 1>&6
12992 have_termcap=no
12993 fi
12994
12995         if test $have_termcap = yes ; then
12996                 cat >> confdefs.h <<\EOF
12997 #define HAVE_TERMCAP 1
12998 EOF
12999
13000                 ol_link_termcap=yes
13001                 TERMCAP_LIBS=-ltermcap
13002         fi
13003 fi
13004
13005 if test $ol_link_termcap = no ; then
13006         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
13007 echo "configure:13008: checking for initscr in -lncurses" >&5
13008 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
13009 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13010   echo $ac_n "(cached) $ac_c" 1>&6
13011 else
13012   ac_save_LIBS="$LIBS"
13013 LIBS="-lncurses  $LIBS"
13014 cat > conftest.$ac_ext <<EOF
13015 #line 13016 "configure"
13016 #include "confdefs.h"
13017 /* Override any gcc2 internal prototype to avoid an error.  */
13018 /* We use char because int might match the return type of a gcc2
13019     builtin and then its argument prototype would still apply.  */
13020 char initscr();
13021
13022 int main() {
13023 initscr()
13024 ; return 0; }
13025 EOF
13026 if { (eval echo configure:13027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13027   rm -rf conftest*
13028   eval "ac_cv_lib_$ac_lib_var=yes"
13029 else
13030   echo "configure: failed program was:" >&5
13031   cat conftest.$ac_ext >&5
13032   rm -rf conftest*
13033   eval "ac_cv_lib_$ac_lib_var=no"
13034 fi
13035 rm -f conftest*
13036 LIBS="$ac_save_LIBS"
13037
13038 fi
13039 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13040   echo "$ac_t""yes" 1>&6
13041   have_ncurses=yes
13042 else
13043   echo "$ac_t""no" 1>&6
13044 have_ncurses=no
13045 fi
13046
13047         if test $have_ncurses = yes ; then
13048                 cat >> confdefs.h <<\EOF
13049 #define HAVE_NCURSES 1
13050 EOF
13051
13052                 ol_link_termcap=yes
13053                 TERMCAP_LIBS=-lncurses
13054         fi
13055 fi
13056
13057 if test $ol_link_termcap = no ; then
13058         cat >> confdefs.h <<\EOF
13059 #define NO_TERMCAP 1
13060 EOF
13061
13062         TERMCAP_LIBS=
13063 fi
13064
13065 ol_link_sasl=no
13066 ol_link_spasswd=no
13067 if test $ol_with_cyrus_sasl != no ; then
13068         ac_safe=`echo "sasl.h" | sed 'y%./+-%__p_%'`
13069 echo $ac_n "checking for sasl.h""... $ac_c" 1>&6
13070 echo "configure:13071: checking for sasl.h" >&5
13071 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13072   echo $ac_n "(cached) $ac_c" 1>&6
13073 else
13074   cat > conftest.$ac_ext <<EOF
13075 #line 13076 "configure"
13076 #include "confdefs.h"
13077 #include <sasl.h>
13078 EOF
13079 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13080 { (eval echo configure:13081: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13081 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13082 if test -z "$ac_err"; then
13083   rm -rf conftest*
13084   eval "ac_cv_header_$ac_safe=yes"
13085 else
13086   echo "$ac_err" >&5
13087   echo "configure: failed program was:" >&5
13088   cat conftest.$ac_ext >&5
13089   rm -rf conftest*
13090   eval "ac_cv_header_$ac_safe=no"
13091 fi
13092 rm -f conftest*
13093 fi
13094 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13095   echo "$ac_t""yes" 1>&6
13096   :
13097 else
13098   echo "$ac_t""no" 1>&6
13099 fi
13100
13101
13102         if test $ac_cv_header_sasl_h = yes ; then
13103                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
13104 echo "configure:13105: checking for sasl_client_init in -lsasl" >&5
13105 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
13106 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13107   echo $ac_n "(cached) $ac_c" 1>&6
13108 else
13109   ac_save_LIBS="$LIBS"
13110 LIBS="-lsasl  $LIBS"
13111 cat > conftest.$ac_ext <<EOF
13112 #line 13113 "configure"
13113 #include "confdefs.h"
13114 /* Override any gcc2 internal prototype to avoid an error.  */
13115 /* We use char because int might match the return type of a gcc2
13116     builtin and then its argument prototype would still apply.  */
13117 char sasl_client_init();
13118
13119 int main() {
13120 sasl_client_init()
13121 ; return 0; }
13122 EOF
13123 if { (eval echo configure:13124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13124   rm -rf conftest*
13125   eval "ac_cv_lib_$ac_lib_var=yes"
13126 else
13127   echo "configure: failed program was:" >&5
13128   cat conftest.$ac_ext >&5
13129   rm -rf conftest*
13130   eval "ac_cv_lib_$ac_lib_var=no"
13131 fi
13132 rm -f conftest*
13133 LIBS="$ac_save_LIBS"
13134
13135 fi
13136 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13137   echo "$ac_t""yes" 1>&6
13138   have_cyrus_sasl=yes
13139 else
13140   echo "$ac_t""no" 1>&6
13141 have_cyrus_sasl=no
13142 fi
13143
13144
13145                 if test $have_cyrus_sasl != no ; then
13146                         SASL_LIBS="-lsasl"
13147                         cat >> confdefs.h <<\EOF
13148 #define HAVE_CYRUS_SASL 1
13149 EOF
13150
13151                         ol_link_sasl=yes
13152                 fi
13153         fi
13154
13155         if test $ol_link_sasl = no ; then
13156                 if test $ol_with_cyrus_sasl != auto ; then
13157                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
13158                 else
13159                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
13160                         echo "configure: warning: SASL authentication not supported!" 1>&2
13161                         if test $ol_link_tls = no ; then
13162                                 echo "configure: warning: Strong authentication not supported!" 1>&2
13163                         fi
13164                 fi
13165         fi
13166 else
13167         echo "configure: warning: SASL authentication not supported!" 1>&2
13168         if test $ol_link_tls = no ; then
13169                 echo "configure: warning: Strong authentication not supported!" 1>&2
13170         fi
13171 fi
13172
13173 if test $cross_compiling != yes ; then
13174         dev=no
13175         if test -r /dev/urandom ; then
13176                 dev="/dev/urandom";
13177         elif test -r /idev/urandom ; then
13178                 dev="/idev/urandom";
13179         elif test -r /dev/srandom ; then
13180                 dev="/dev/srandom";
13181         elif test -r /dev/random ; then
13182                 dev="/dev/random";
13183         elif test -r /idev/random ; then
13184                 dev="/idev/random";
13185         fi
13186
13187         if test $dev != no ; then
13188                 cat >> confdefs.h <<EOF
13189 #define URANDOM_DEVICE "$dev"
13190 EOF
13191
13192         fi
13193 fi
13194
13195 ol_link_fetch=no
13196 if test $ol_with_fetch != no ; then
13197         ol_LIBS=$LIBS
13198 LIBS="-lfetch -lcom_err $LIBS"
13199 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
13200 echo "configure:13201: checking fetch(3) library" >&5
13201 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
13202   echo $ac_n "(cached) $ac_c" 1>&6
13203 else
13204   
13205         cat > conftest.$ac_ext <<EOF
13206 #line 13207 "configure"
13207 #include "confdefs.h"
13208
13209 #include <sys/param.h>
13210 #include <stdio.h>
13211 #include <fetch.h>
13212 int main() {
13213 struct url *u = fetchParseURL("file:///"); 
13214 ; return 0; }
13215 EOF
13216 if { (eval echo configure:13217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13217   rm -rf conftest*
13218   ol_cv_lib_fetch=yes
13219 else
13220   echo "configure: failed program was:" >&5
13221   cat conftest.$ac_ext >&5
13222   rm -rf conftest*
13223   ol_cv_lib_fetch=no
13224 fi
13225 rm -f conftest*
13226 fi
13227
13228 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
13229 LIBS=$ol_LIBS
13230 if test $ol_cv_lib_fetch != no ; then
13231         ol_link_fetch="-lfetch -lcom_err"
13232         cat >> confdefs.h <<\EOF
13233 #define HAVE_FETCH 1
13234 EOF
13235
13236 fi
13237
13238
13239         if test $ol_cv_lib_fetch != no ; then
13240                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
13241                 ol_link_fetch=freebsd
13242
13243         elif test $ol_with_fetch != auto ; then
13244                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
13245         fi 
13246 fi
13247
13248 ol_link_readline=no
13249 if test $ol_with_readline != no ; then
13250         for ac_hdr in readline/readline.h readline/history.h
13251 do
13252 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13253 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13254 echo "configure:13255: checking for $ac_hdr" >&5
13255 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13256   echo $ac_n "(cached) $ac_c" 1>&6
13257 else
13258   cat > conftest.$ac_ext <<EOF
13259 #line 13260 "configure"
13260 #include "confdefs.h"
13261 #include <$ac_hdr>
13262 EOF
13263 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13264 { (eval echo configure:13265: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13265 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13266 if test -z "$ac_err"; then
13267   rm -rf conftest*
13268   eval "ac_cv_header_$ac_safe=yes"
13269 else
13270   echo "$ac_err" >&5
13271   echo "configure: failed program was:" >&5
13272   cat conftest.$ac_ext >&5
13273   rm -rf conftest*
13274   eval "ac_cv_header_$ac_safe=no"
13275 fi
13276 rm -f conftest*
13277 fi
13278 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13279   echo "$ac_t""yes" 1>&6
13280     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13281   cat >> confdefs.h <<EOF
13282 #define $ac_tr_hdr 1
13283 EOF
13284  
13285 else
13286   echo "$ac_t""no" 1>&6
13287 fi
13288 done
13289
13290
13291         if test $ac_cv_header_readline_readline_h = yes ; then
13292                 save_LIBS="$LIBS"
13293                 LIBS="$TERMCAP_LIBS $LIBS"
13294                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
13295 echo "configure:13296: checking for readline in -lreadline" >&5
13296 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
13297 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13298   echo $ac_n "(cached) $ac_c" 1>&6
13299 else
13300   ac_save_LIBS="$LIBS"
13301 LIBS="-lreadline  $LIBS"
13302 cat > conftest.$ac_ext <<EOF
13303 #line 13304 "configure"
13304 #include "confdefs.h"
13305 /* Override any gcc2 internal prototype to avoid an error.  */
13306 /* We use char because int might match the return type of a gcc2
13307     builtin and then its argument prototype would still apply.  */
13308 char readline();
13309
13310 int main() {
13311 readline()
13312 ; return 0; }
13313 EOF
13314 if { (eval echo configure:13315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13315   rm -rf conftest*
13316   eval "ac_cv_lib_$ac_lib_var=yes"
13317 else
13318   echo "configure: failed program was:" >&5
13319   cat conftest.$ac_ext >&5
13320   rm -rf conftest*
13321   eval "ac_cv_lib_$ac_lib_var=no"
13322 fi
13323 rm -f conftest*
13324 LIBS="$ac_save_LIBS"
13325
13326 fi
13327 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13328   echo "$ac_t""yes" 1>&6
13329   have_readline=yes
13330 else
13331   echo "$ac_t""no" 1>&6
13332 have_readline=no
13333 fi
13334
13335                 LIBS="$save_LIBS"
13336                         
13337                 if test $have_readline = yes ; then
13338                         ol_with_readline=found
13339                         ol_link_readline=yes
13340
13341                         READLINE_LIBS="-lreadline"
13342                 fi
13343         fi
13344 fi
13345
13346 if test $ol_link_readline = yes ; then
13347         cat >> confdefs.h <<\EOF
13348 #define HAVE_READLINE 1
13349 EOF
13350
13351 fi
13352
13353
13354 if test $ol_enable_crypt != no ; then
13355         echo $ac_n "checking for crypt""... $ac_c" 1>&6
13356 echo "configure:13357: checking for crypt" >&5
13357 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
13358   echo $ac_n "(cached) $ac_c" 1>&6
13359 else
13360   cat > conftest.$ac_ext <<EOF
13361 #line 13362 "configure"
13362 #include "confdefs.h"
13363 /* System header to define __stub macros and hopefully few prototypes,
13364     which can conflict with char crypt(); below.  */
13365 #include <assert.h>
13366 /* Override any gcc2 internal prototype to avoid an error.  */
13367 /* We use char because int might match the return type of a gcc2
13368     builtin and then its argument prototype would still apply.  */
13369 char crypt();
13370 char (*f)();
13371
13372 int main() {
13373
13374 /* The GNU C library defines this for functions which it implements
13375     to always fail with ENOSYS.  Some functions are actually named
13376     something starting with __ and the normal name is an alias.  */
13377 #if defined (__stub_crypt) || defined (__stub___crypt)
13378 choke me
13379 #else
13380 f = crypt;
13381 #endif
13382
13383 ; return 0; }
13384 EOF
13385 if { (eval echo configure:13386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13386   rm -rf conftest*
13387   eval "ac_cv_func_crypt=yes"
13388 else
13389   echo "configure: failed program was:" >&5
13390   cat conftest.$ac_ext >&5
13391   rm -rf conftest*
13392   eval "ac_cv_func_crypt=no"
13393 fi
13394 rm -f conftest*
13395 fi
13396
13397 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
13398   echo "$ac_t""yes" 1>&6
13399   have_crypt=yes
13400 else
13401   echo "$ac_t""no" 1>&6
13402
13403                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
13404 echo "configure:13405: checking for crypt in -lcrypt" >&5
13405 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
13406 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13407   echo $ac_n "(cached) $ac_c" 1>&6
13408 else
13409   ac_save_LIBS="$LIBS"
13410 LIBS="-lcrypt  $LIBS"
13411 cat > conftest.$ac_ext <<EOF
13412 #line 13413 "configure"
13413 #include "confdefs.h"
13414 /* Override any gcc2 internal prototype to avoid an error.  */
13415 /* We use char because int might match the return type of a gcc2
13416     builtin and then its argument prototype would still apply.  */
13417 char crypt();
13418
13419 int main() {
13420 crypt()
13421 ; return 0; }
13422 EOF
13423 if { (eval echo configure:13424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13424   rm -rf conftest*
13425   eval "ac_cv_lib_$ac_lib_var=yes"
13426 else
13427   echo "configure: failed program was:" >&5
13428   cat conftest.$ac_ext >&5
13429   rm -rf conftest*
13430   eval "ac_cv_lib_$ac_lib_var=no"
13431 fi
13432 rm -f conftest*
13433 LIBS="$ac_save_LIBS"
13434
13435 fi
13436 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13437   echo "$ac_t""yes" 1>&6
13438   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
13439                         have_crypt=yes
13440 else
13441   echo "$ac_t""no" 1>&6
13442 have_crypt=no
13443 fi
13444
13445 fi
13446
13447
13448         if test $have_crypt = yes ; then
13449                 cat >> confdefs.h <<\EOF
13450 #define HAVE_CRYPT 1
13451 EOF
13452
13453         else
13454                 echo "configure: warning: could not find crypt" 1>&2
13455                 if test $ol_enable_crypt = yes ; then
13456                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
13457                 fi
13458
13459                 echo "configure: warning: disabling crypt support" 1>&2
13460                 ol_enable_crypt=no
13461         fi
13462 fi
13463
13464 if test $ol_enable_proctitle != no ; then
13465         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
13466 echo "configure:13467: checking for setproctitle" >&5
13467 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
13468   echo $ac_n "(cached) $ac_c" 1>&6
13469 else
13470   cat > conftest.$ac_ext <<EOF
13471 #line 13472 "configure"
13472 #include "confdefs.h"
13473 /* System header to define __stub macros and hopefully few prototypes,
13474     which can conflict with char setproctitle(); below.  */
13475 #include <assert.h>
13476 /* Override any gcc2 internal prototype to avoid an error.  */
13477 /* We use char because int might match the return type of a gcc2
13478     builtin and then its argument prototype would still apply.  */
13479 char setproctitle();
13480 char (*f)();
13481
13482 int main() {
13483
13484 /* The GNU C library defines this for functions which it implements
13485     to always fail with ENOSYS.  Some functions are actually named
13486     something starting with __ and the normal name is an alias.  */
13487 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
13488 choke me
13489 #else
13490 f = setproctitle;
13491 #endif
13492
13493 ; return 0; }
13494 EOF
13495 if { (eval echo configure:13496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13496   rm -rf conftest*
13497   eval "ac_cv_func_setproctitle=yes"
13498 else
13499   echo "configure: failed program was:" >&5
13500   cat conftest.$ac_ext >&5
13501   rm -rf conftest*
13502   eval "ac_cv_func_setproctitle=no"
13503 fi
13504 rm -f conftest*
13505 fi
13506
13507 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
13508   echo "$ac_t""yes" 1>&6
13509   have_setproctitle=yes
13510 else
13511   echo "$ac_t""no" 1>&6
13512
13513                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
13514 echo "configure:13515: checking for setproctitle in -lutil" >&5
13515 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
13516 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13517   echo $ac_n "(cached) $ac_c" 1>&6
13518 else
13519   ac_save_LIBS="$LIBS"
13520 LIBS="-lutil  $LIBS"
13521 cat > conftest.$ac_ext <<EOF
13522 #line 13523 "configure"
13523 #include "confdefs.h"
13524 /* Override any gcc2 internal prototype to avoid an error.  */
13525 /* We use char because int might match the return type of a gcc2
13526     builtin and then its argument prototype would still apply.  */
13527 char setproctitle();
13528
13529 int main() {
13530 setproctitle()
13531 ; return 0; }
13532 EOF
13533 if { (eval echo configure:13534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13534   rm -rf conftest*
13535   eval "ac_cv_lib_$ac_lib_var=yes"
13536 else
13537   echo "configure: failed program was:" >&5
13538   cat conftest.$ac_ext >&5
13539   rm -rf conftest*
13540   eval "ac_cv_lib_$ac_lib_var=no"
13541 fi
13542 rm -f conftest*
13543 LIBS="$ac_save_LIBS"
13544
13545 fi
13546 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13547   echo "$ac_t""yes" 1>&6
13548   have_setproctitle=yes
13549                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
13550 else
13551   echo "$ac_t""no" 1>&6
13552 have_setproctitle=no
13553                         LIBOBJS="$LIBOBJS setproctitle.o"
13554                         LIBSRCS="$LIBSRCS setproctitle.c"
13555 fi
13556
13557 fi
13558
13559
13560         if test $have_setproctitle = yes ; then
13561                 cat >> confdefs.h <<\EOF
13562 #define HAVE_SETPROCTITLE 1
13563 EOF
13564
13565         fi
13566 fi
13567
13568 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
13569 echo "configure:13570: checking for ANSI C header files" >&5
13570 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
13571   echo $ac_n "(cached) $ac_c" 1>&6
13572 else
13573   cat > conftest.$ac_ext <<EOF
13574 #line 13575 "configure"
13575 #include "confdefs.h"
13576 #include <stdlib.h>
13577 #include <stdarg.h>
13578 #include <string.h>
13579 #include <float.h>
13580 EOF
13581 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13582 { (eval echo configure:13583: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13583 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13584 if test -z "$ac_err"; then
13585   rm -rf conftest*
13586   ac_cv_header_stdc=yes
13587 else
13588   echo "$ac_err" >&5
13589   echo "configure: failed program was:" >&5
13590   cat conftest.$ac_ext >&5
13591   rm -rf conftest*
13592   ac_cv_header_stdc=no
13593 fi
13594 rm -f conftest*
13595
13596 if test $ac_cv_header_stdc = yes; then
13597   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13598 cat > conftest.$ac_ext <<EOF
13599 #line 13600 "configure"
13600 #include "confdefs.h"
13601 #include <string.h>
13602 EOF
13603 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13604   egrep "memchr" >/dev/null 2>&1; then
13605   :
13606 else
13607   rm -rf conftest*
13608   ac_cv_header_stdc=no
13609 fi
13610 rm -f conftest*
13611
13612 fi
13613
13614 if test $ac_cv_header_stdc = yes; then
13615   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13616 cat > conftest.$ac_ext <<EOF
13617 #line 13618 "configure"
13618 #include "confdefs.h"
13619 #include <stdlib.h>
13620 EOF
13621 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13622   egrep "free" >/dev/null 2>&1; then
13623   :
13624 else
13625   rm -rf conftest*
13626   ac_cv_header_stdc=no
13627 fi
13628 rm -f conftest*
13629
13630 fi
13631
13632 if test $ac_cv_header_stdc = yes; then
13633   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13634 if test "$cross_compiling" = yes; then
13635   :
13636 else
13637   cat > conftest.$ac_ext <<EOF
13638 #line 13639 "configure"
13639 #include "confdefs.h"
13640 #include <ctype.h>
13641 #if ((' ' & 0x0FF) == 0x020)
13642 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13643 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13644 #else
13645 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13646  || ('j' <= (c) && (c) <= 'r') \
13647  || ('s' <= (c) && (c) <= 'z'))
13648 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13649 #endif
13650 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13651 int main () { int i; for (i = 0; i < 256; i++)
13652 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
13653 exit (0); }
13654
13655 EOF
13656 if { (eval echo configure:13657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13657 then
13658   :
13659 else
13660   echo "configure: failed program was:" >&5
13661   cat conftest.$ac_ext >&5
13662   rm -fr conftest*
13663   ac_cv_header_stdc=no
13664 fi
13665 rm -fr conftest*
13666 fi
13667
13668 fi
13669 fi
13670
13671 echo "$ac_t""$ac_cv_header_stdc" 1>&6
13672 if test $ac_cv_header_stdc = yes; then
13673   cat >> confdefs.h <<\EOF
13674 #define STDC_HEADERS 1
13675 EOF
13676
13677 fi
13678
13679 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
13680 echo "configure:13681: checking for mode_t" >&5
13681 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
13682   echo $ac_n "(cached) $ac_c" 1>&6
13683 else
13684   cat > conftest.$ac_ext <<EOF
13685 #line 13686 "configure"
13686 #include "confdefs.h"
13687 #include <sys/types.h>
13688 #if STDC_HEADERS
13689 #include <stdlib.h>
13690 #include <stddef.h>
13691 #endif
13692
13693 EOF
13694 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13695   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
13696   rm -rf conftest*
13697   eval "ac_cv_type_mode_t=yes"
13698 else
13699   rm -rf conftest*
13700   eval "ac_cv_type_mode_t=no"
13701 fi
13702 rm -f conftest*
13703
13704 fi
13705 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
13706   echo "$ac_t""yes" 1>&6
13707 else
13708   echo "$ac_t""no" 1>&6
13709   cat >> confdefs.h <<EOF
13710 #define mode_t int
13711 EOF
13712
13713 fi
13714
13715 echo $ac_n "checking for off_t""... $ac_c" 1>&6
13716 echo "configure:13717: checking for off_t" >&5
13717 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
13718   echo $ac_n "(cached) $ac_c" 1>&6
13719 else
13720   cat > conftest.$ac_ext <<EOF
13721 #line 13722 "configure"
13722 #include "confdefs.h"
13723 #include <sys/types.h>
13724 #if STDC_HEADERS
13725 #include <stdlib.h>
13726 #include <stddef.h>
13727 #endif
13728
13729 EOF
13730 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13731   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
13732   rm -rf conftest*
13733   eval "ac_cv_type_off_t=yes"
13734 else
13735   rm -rf conftest*
13736   eval "ac_cv_type_off_t=no"
13737 fi
13738 rm -f conftest*
13739
13740 fi
13741 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
13742   echo "$ac_t""yes" 1>&6
13743 else
13744   echo "$ac_t""no" 1>&6
13745   cat >> confdefs.h <<EOF
13746 #define off_t long
13747 EOF
13748
13749 fi
13750
13751 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
13752 echo "configure:13753: checking for pid_t" >&5
13753 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
13754   echo $ac_n "(cached) $ac_c" 1>&6
13755 else
13756   cat > conftest.$ac_ext <<EOF
13757 #line 13758 "configure"
13758 #include "confdefs.h"
13759 #include <sys/types.h>
13760 #if STDC_HEADERS
13761 #include <stdlib.h>
13762 #include <stddef.h>
13763 #endif
13764
13765 EOF
13766 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13767   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
13768   rm -rf conftest*
13769   eval "ac_cv_type_pid_t=yes"
13770 else
13771   rm -rf conftest*
13772   eval "ac_cv_type_pid_t=no"
13773 fi
13774 rm -f conftest*
13775
13776 fi
13777 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
13778   echo "$ac_t""yes" 1>&6
13779 else
13780   echo "$ac_t""no" 1>&6
13781   cat >> confdefs.h <<EOF
13782 #define pid_t int
13783 EOF
13784
13785 fi
13786
13787 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
13788 echo "configure:13789: checking for ptrdiff_t" >&5
13789 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
13790   echo $ac_n "(cached) $ac_c" 1>&6
13791 else
13792   cat > conftest.$ac_ext <<EOF
13793 #line 13794 "configure"
13794 #include "confdefs.h"
13795 #include <stddef.h>
13796 int main() {
13797 ptrdiff_t p
13798 ; return 0; }
13799 EOF
13800 if { (eval echo configure:13801: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13801   rm -rf conftest*
13802   am_cv_type_ptrdiff_t=yes
13803 else
13804   echo "configure: failed program was:" >&5
13805   cat conftest.$ac_ext >&5
13806   rm -rf conftest*
13807   am_cv_type_ptrdiff_t=no
13808 fi
13809 rm -f conftest*
13810 fi
13811
13812 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
13813    if test $am_cv_type_ptrdiff_t = yes; then
13814      cat >> confdefs.h <<\EOF
13815 #define HAVE_PTRDIFF_T 1
13816 EOF
13817
13818    fi
13819
13820 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
13821 echo "configure:13822: checking return type of signal handlers" >&5
13822 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
13823   echo $ac_n "(cached) $ac_c" 1>&6
13824 else
13825   cat > conftest.$ac_ext <<EOF
13826 #line 13827 "configure"
13827 #include "confdefs.h"
13828 #include <sys/types.h>
13829 #include <signal.h>
13830 #ifdef signal
13831 #undef signal
13832 #endif
13833 #ifdef __cplusplus
13834 extern "C" void (*signal (int, void (*)(int)))(int);
13835 #else
13836 void (*signal ()) ();
13837 #endif
13838
13839 int main() {
13840 int i;
13841 ; return 0; }
13842 EOF
13843 if { (eval echo configure:13844: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13844   rm -rf conftest*
13845   ac_cv_type_signal=void
13846 else
13847   echo "configure: failed program was:" >&5
13848   cat conftest.$ac_ext >&5
13849   rm -rf conftest*
13850   ac_cv_type_signal=int
13851 fi
13852 rm -f conftest*
13853 fi
13854
13855 echo "$ac_t""$ac_cv_type_signal" 1>&6
13856 cat >> confdefs.h <<EOF
13857 #define RETSIGTYPE $ac_cv_type_signal
13858 EOF
13859
13860
13861 echo $ac_n "checking for size_t""... $ac_c" 1>&6
13862 echo "configure:13863: checking for size_t" >&5
13863 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
13864   echo $ac_n "(cached) $ac_c" 1>&6
13865 else
13866   cat > conftest.$ac_ext <<EOF
13867 #line 13868 "configure"
13868 #include "confdefs.h"
13869 #include <sys/types.h>
13870 #if STDC_HEADERS
13871 #include <stdlib.h>
13872 #include <stddef.h>
13873 #endif
13874
13875 EOF
13876 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13877   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
13878   rm -rf conftest*
13879   eval "ac_cv_type_size_t=yes"
13880 else
13881   rm -rf conftest*
13882   eval "ac_cv_type_size_t=no"
13883 fi
13884 rm -f conftest*
13885
13886 fi
13887 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
13888   echo "$ac_t""yes" 1>&6
13889 else
13890   echo "$ac_t""no" 1>&6
13891   cat >> confdefs.h <<EOF
13892 #define size_t unsigned
13893 EOF
13894
13895 fi
13896
13897
13898 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
13899 echo "configure:13900: checking for ssize_t" >&5
13900 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
13901   echo $ac_n "(cached) $ac_c" 1>&6
13902 else
13903   cat > conftest.$ac_ext <<EOF
13904 #line 13905 "configure"
13905 #include "confdefs.h"
13906 #include <sys/types.h>
13907 #if STDC_HEADERS
13908 #include <stdlib.h>
13909 #include <stddef.h>
13910 #endif
13911
13912 EOF
13913 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13914   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
13915   rm -rf conftest*
13916   eval "ac_cv_type_ssize_t=yes"
13917 else
13918   rm -rf conftest*
13919   eval "ac_cv_type_ssize_t=no"
13920 fi
13921 rm -f conftest*
13922
13923 fi
13924 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
13925   echo "$ac_t""yes" 1>&6
13926 else
13927   echo "$ac_t""no" 1>&6
13928   cat >> confdefs.h <<EOF
13929 #define ssize_t signed int
13930 EOF
13931
13932 fi
13933
13934 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
13935 echo "configure:13936: checking for caddr_t" >&5
13936 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
13937   echo $ac_n "(cached) $ac_c" 1>&6
13938 else
13939   cat > conftest.$ac_ext <<EOF
13940 #line 13941 "configure"
13941 #include "confdefs.h"
13942 #include <sys/types.h>
13943 #if STDC_HEADERS
13944 #include <stdlib.h>
13945 #include <stddef.h>
13946 #endif
13947
13948 EOF
13949 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13950   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
13951   rm -rf conftest*
13952   eval "ac_cv_type_caddr_t=yes"
13953 else
13954   rm -rf conftest*
13955   eval "ac_cv_type_caddr_t=no"
13956 fi
13957 rm -f conftest*
13958
13959 fi
13960 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
13961   echo "$ac_t""yes" 1>&6
13962 else
13963   echo "$ac_t""no" 1>&6
13964   cat >> confdefs.h <<EOF
13965 #define caddr_t char *
13966 EOF
13967
13968 fi
13969
13970
13971 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
13972 echo "configure:13973: checking for socklen_t" >&5
13973 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
13974   echo $ac_n "(cached) $ac_c" 1>&6
13975 else
13976   cat > conftest.$ac_ext <<EOF
13977 #line 13978 "configure"
13978 #include "confdefs.h"
13979
13980 #ifdef HAVE_SYS_TYPES_H
13981 #include <sys/types.h>
13982 #endif
13983 #ifdef HAVE_SYS_SOCKET_H
13984 #include <sys/socket.h>
13985 #endif
13986
13987 int main() {
13988 socklen_t len;
13989 ; return 0; }
13990 EOF
13991 if { (eval echo configure:13992: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13992   rm -rf conftest*
13993   ol_cv_type_socklen_t=yes
13994 else
13995   echo "configure: failed program was:" >&5
13996   cat conftest.$ac_ext >&5
13997   rm -rf conftest*
13998   ol_cv_type_socklen_t=no
13999 fi
14000 rm -f conftest*
14001 fi
14002
14003 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
14004   if test $ol_cv_type_socklen_t = no; then
14005     cat >> confdefs.h <<\EOF
14006 #define socklen_t int
14007 EOF
14008
14009   fi
14010  
14011 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
14012 echo "configure:14013: checking for member st_blksize in aggregate type struct stat" >&5
14013 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
14014   echo $ac_n "(cached) $ac_c" 1>&6
14015 else
14016   cat > conftest.$ac_ext <<EOF
14017 #line 14018 "configure"
14018 #include "confdefs.h"
14019 #include <sys/types.h>
14020 #include <sys/stat.h>
14021 int main() {
14022 struct stat foo; foo.st_blksize;
14023 ; return 0; }
14024 EOF
14025 if { (eval echo configure:14026: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14026   rm -rf conftest*
14027   ac_cv_c_struct_member_st_blksize=yes
14028 else
14029   echo "configure: failed program was:" >&5
14030   cat conftest.$ac_ext >&5
14031   rm -rf conftest*
14032   ac_cv_c_struct_member_st_blksize=no
14033 fi
14034 rm -f conftest*
14035 fi
14036
14037 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
14038 st_blksize="$ac_cv_c_struct_member_st_blksize"
14039 if test $ac_cv_c_struct_member_st_blksize = yes; then
14040   cat >> confdefs.h <<\EOF
14041 #define HAVE_ST_BLKSIZE 1
14042 EOF
14043
14044 fi
14045
14046 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
14047 echo "configure:14048: checking whether time.h and sys/time.h may both be included" >&5
14048 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
14049   echo $ac_n "(cached) $ac_c" 1>&6
14050 else
14051   cat > conftest.$ac_ext <<EOF
14052 #line 14053 "configure"
14053 #include "confdefs.h"
14054 #include <sys/types.h>
14055 #include <sys/time.h>
14056 #include <time.h>
14057 int main() {
14058 struct tm *tp;
14059 ; return 0; }
14060 EOF
14061 if { (eval echo configure:14062: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14062   rm -rf conftest*
14063   ac_cv_header_time=yes
14064 else
14065   echo "configure: failed program was:" >&5
14066   cat conftest.$ac_ext >&5
14067   rm -rf conftest*
14068   ac_cv_header_time=no
14069 fi
14070 rm -f conftest*
14071 fi
14072
14073 echo "$ac_t""$ac_cv_header_time" 1>&6
14074 if test $ac_cv_header_time = yes; then
14075   cat >> confdefs.h <<\EOF
14076 #define TIME_WITH_SYS_TIME 1
14077 EOF
14078
14079 fi
14080
14081 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
14082 echo "configure:14083: checking whether struct tm is in sys/time.h or time.h" >&5
14083 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
14084   echo $ac_n "(cached) $ac_c" 1>&6
14085 else
14086   cat > conftest.$ac_ext <<EOF
14087 #line 14088 "configure"
14088 #include "confdefs.h"
14089 #include <sys/types.h>
14090 #include <time.h>
14091 int main() {
14092 struct tm *tp; tp->tm_sec;
14093 ; return 0; }
14094 EOF
14095 if { (eval echo configure:14096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14096   rm -rf conftest*
14097   ac_cv_struct_tm=time.h
14098 else
14099   echo "configure: failed program was:" >&5
14100   cat conftest.$ac_ext >&5
14101   rm -rf conftest*
14102   ac_cv_struct_tm=sys/time.h
14103 fi
14104 rm -f conftest*
14105 fi
14106
14107 echo "$ac_t""$ac_cv_struct_tm" 1>&6
14108 if test $ac_cv_struct_tm = sys/time.h; then
14109   cat >> confdefs.h <<\EOF
14110 #define TM_IN_SYS_TIME 1
14111 EOF
14112
14113 fi
14114
14115 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
14116 echo "configure:14117: checking for uid_t in sys/types.h" >&5
14117 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
14118   echo $ac_n "(cached) $ac_c" 1>&6
14119 else
14120   cat > conftest.$ac_ext <<EOF
14121 #line 14122 "configure"
14122 #include "confdefs.h"
14123 #include <sys/types.h>
14124 EOF
14125 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14126   egrep "uid_t" >/dev/null 2>&1; then
14127   rm -rf conftest*
14128   ac_cv_type_uid_t=yes
14129 else
14130   rm -rf conftest*
14131   ac_cv_type_uid_t=no
14132 fi
14133 rm -f conftest*
14134
14135 fi
14136
14137 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
14138 if test $ac_cv_type_uid_t = no; then
14139   cat >> confdefs.h <<\EOF
14140 #define uid_t int
14141 EOF
14142
14143   cat >> confdefs.h <<\EOF
14144 #define gid_t int
14145 EOF
14146
14147 fi
14148
14149 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
14150 echo "configure:14151: checking for sig_atomic_t" >&5
14151 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
14152   echo $ac_n "(cached) $ac_c" 1>&6
14153 else
14154   cat > conftest.$ac_ext <<EOF
14155 #line 14156 "configure"
14156 #include "confdefs.h"
14157 #include <signal.h>
14158 int main() {
14159 sig_atomic_t atomic;
14160 ; return 0; }
14161 EOF
14162 if { (eval echo configure:14163: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14163   rm -rf conftest*
14164   ol_cv_type_sig_atomic_t=yes
14165 else
14166   echo "configure: failed program was:" >&5
14167   cat conftest.$ac_ext >&5
14168   rm -rf conftest*
14169   ol_cv_type_sig_atomic_t=no
14170 fi
14171 rm -f conftest*
14172 fi
14173
14174 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
14175   if test $ol_cv_type_sig_atomic_t = no; then
14176     cat >> confdefs.h <<\EOF
14177 #define sig_atomic_t int
14178 EOF
14179
14180   fi
14181  
14182
14183
14184 # test for pw_gecos in struct passwd
14185 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
14186 echo "configure:14187: checking struct passwd for pw_gecos" >&5
14187 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
14188   echo $ac_n "(cached) $ac_c" 1>&6
14189 else
14190   
14191         cat > conftest.$ac_ext <<EOF
14192 #line 14193 "configure"
14193 #include "confdefs.h"
14194 #include <pwd.h>
14195 int main() {
14196
14197         struct passwd pwd;
14198         pwd.pw_gecos = pwd.pw_name;
14199
14200 ; return 0; }
14201 EOF
14202 if { (eval echo configure:14203: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14203   rm -rf conftest*
14204   ol_cv_struct_passwd_pw_gecos=yes
14205 else
14206   echo "configure: failed program was:" >&5
14207   cat conftest.$ac_ext >&5
14208   rm -rf conftest*
14209   ol_cv_struct_passwd_pw_gecos=no
14210 fi
14211 rm -f conftest*
14212 fi
14213
14214 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
14215 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
14216         cat >> confdefs.h <<\EOF
14217 #define HAVE_PW_GECOS 1
14218 EOF
14219
14220 fi
14221
14222 # test for pw_passwd in struct passwd
14223 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
14224 echo "configure:14225: checking struct passwd for pw_passwd" >&5
14225 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
14226   echo $ac_n "(cached) $ac_c" 1>&6
14227 else
14228   
14229         cat > conftest.$ac_ext <<EOF
14230 #line 14231 "configure"
14231 #include "confdefs.h"
14232 #include <pwd.h>
14233 int main() {
14234
14235         struct passwd pwd;
14236         pwd.pw_passwd = pwd.pw_name;
14237
14238 ; return 0; }
14239 EOF
14240 if { (eval echo configure:14241: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14241   rm -rf conftest*
14242   ol_cv_struct_passwd_pw_passwd=yes
14243 else
14244   echo "configure: failed program was:" >&5
14245   cat conftest.$ac_ext >&5
14246   rm -rf conftest*
14247   ol_cv_struct_passwd_pw_passwd=no
14248 fi
14249 rm -f conftest*
14250 fi
14251
14252 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
14253 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
14254         cat >> confdefs.h <<\EOF
14255 #define HAVE_PW_PASSWD 1
14256 EOF
14257
14258 fi
14259
14260
14261 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
14262 echo "configure:14263: checking if toupper() requires islower()" >&5
14263 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
14264   echo $ac_n "(cached) $ac_c" 1>&6
14265 else
14266   
14267         if test "$cross_compiling" = yes; then
14268   ol_cv_c_upper_lower=safe
14269 else
14270   cat > conftest.$ac_ext <<EOF
14271 #line 14272 "configure"
14272 #include "confdefs.h"
14273
14274 #include <ctype.h>
14275 main()
14276 {
14277         if ('C' == toupper('C'))
14278                 exit(0);
14279         else
14280                 exit(1);
14281 }
14282 EOF
14283 if { (eval echo configure:14284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14284 then
14285   ol_cv_c_upper_lower=no
14286 else
14287   echo "configure: failed program was:" >&5
14288   cat conftest.$ac_ext >&5
14289   rm -fr conftest*
14290   ol_cv_c_upper_lower=yes
14291 fi
14292 rm -fr conftest*
14293 fi
14294
14295 fi
14296
14297 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
14298 if test $ol_cv_c_upper_lower != no ; then
14299         cat >> confdefs.h <<\EOF
14300 #define C_UPPER_LOWER 1
14301 EOF
14302
14303 fi
14304
14305 echo $ac_n "checking for working const""... $ac_c" 1>&6
14306 echo "configure:14307: checking for working const" >&5
14307 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
14308   echo $ac_n "(cached) $ac_c" 1>&6
14309 else
14310   cat > conftest.$ac_ext <<EOF
14311 #line 14312 "configure"
14312 #include "confdefs.h"
14313
14314 int main() {
14315
14316 /* Ultrix mips cc rejects this.  */
14317 typedef int charset[2]; const charset x;
14318 /* SunOS 4.1.1 cc rejects this.  */
14319 char const *const *ccp;
14320 char **p;
14321 /* NEC SVR4.0.2 mips cc rejects this.  */
14322 struct point {int x, y;};
14323 static struct point const zero = {0,0};
14324 /* AIX XL C 1.02.0.0 rejects this.
14325    It does not let you subtract one const X* pointer from another in an arm
14326    of an if-expression whose if-part is not a constant expression */
14327 const char *g = "string";
14328 ccp = &g + (g ? g-g : 0);
14329 /* HPUX 7.0 cc rejects these. */
14330 ++ccp;
14331 p = (char**) ccp;
14332 ccp = (char const *const *) p;
14333 { /* SCO 3.2v4 cc rejects this.  */
14334   char *t;
14335   char const *s = 0 ? (char *) 0 : (char const *) 0;
14336
14337   *t++ = 0;
14338 }
14339 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
14340   int x[] = {25, 17};
14341   const int *foo = &x[0];
14342   ++foo;
14343 }
14344 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
14345   typedef const int *iptr;
14346   iptr p = 0;
14347   ++p;
14348 }
14349 { /* AIX XL C 1.02.0.0 rejects this saying
14350      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
14351   struct s { int j; const int *ap[3]; };
14352   struct s *b; b->j = 5;
14353 }
14354 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
14355   const int foo = 10;
14356 }
14357
14358 ; return 0; }
14359 EOF
14360 if { (eval echo configure:14361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14361   rm -rf conftest*
14362   ac_cv_c_const=yes
14363 else
14364   echo "configure: failed program was:" >&5
14365   cat conftest.$ac_ext >&5
14366   rm -rf conftest*
14367   ac_cv_c_const=no
14368 fi
14369 rm -f conftest*
14370 fi
14371
14372 echo "$ac_t""$ac_cv_c_const" 1>&6
14373 if test $ac_cv_c_const = no; then
14374   cat >> confdefs.h <<\EOF
14375 #define const 
14376 EOF
14377
14378 fi
14379
14380 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
14381 echo "configure:14382: checking if compiler understands volatile" >&5
14382 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
14383   echo $ac_n "(cached) $ac_c" 1>&6
14384 else
14385   cat > conftest.$ac_ext <<EOF
14386 #line 14387 "configure"
14387 #include "confdefs.h"
14388 int x, y, z;
14389 int main() {
14390 volatile int a; int * volatile b = x ? &y : &z;
14391       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
14392       *b = 0;
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_c_volatile=yes
14398 else
14399   echo "configure: failed program was:" >&5
14400   cat conftest.$ac_ext >&5
14401   rm -rf conftest*
14402   ol_cv_c_volatile=no
14403 fi
14404 rm -f conftest*
14405 fi
14406
14407 echo "$ac_t""$ol_cv_c_volatile" 1>&6
14408   if test $ol_cv_c_volatile = yes; then
14409     : 
14410   else
14411     cat >> confdefs.h <<\EOF
14412 #define volatile 
14413 EOF
14414
14415   fi
14416  
14417
14418 if test $cross_compiling = yes ; then
14419         cat >> confdefs.h <<\EOF
14420 #define CROSS_COMPILING 1
14421 EOF
14422
14423 else
14424         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
14425 echo "configure:14426: checking whether byte ordering is bigendian" >&5
14426 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
14427   echo $ac_n "(cached) $ac_c" 1>&6
14428 else
14429   ac_cv_c_bigendian=unknown
14430 # See if sys/param.h defines the BYTE_ORDER macro.
14431 cat > conftest.$ac_ext <<EOF
14432 #line 14433 "configure"
14433 #include "confdefs.h"
14434 #include <sys/types.h>
14435 #include <sys/param.h>
14436 int main() {
14437
14438 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
14439  bogus endian macros
14440 #endif
14441 ; return 0; }
14442 EOF
14443 if { (eval echo configure:14444: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14444   rm -rf conftest*
14445   # It does; now see whether it defined to BIG_ENDIAN or not.
14446 cat > conftest.$ac_ext <<EOF
14447 #line 14448 "configure"
14448 #include "confdefs.h"
14449 #include <sys/types.h>
14450 #include <sys/param.h>
14451 int main() {
14452
14453 #if BYTE_ORDER != BIG_ENDIAN
14454  not big endian
14455 #endif
14456 ; return 0; }
14457 EOF
14458 if { (eval echo configure:14459: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14459   rm -rf conftest*
14460   ac_cv_c_bigendian=yes
14461 else
14462   echo "configure: failed program was:" >&5
14463   cat conftest.$ac_ext >&5
14464   rm -rf conftest*
14465   ac_cv_c_bigendian=no
14466 fi
14467 rm -f conftest*
14468 else
14469   echo "configure: failed program was:" >&5
14470   cat conftest.$ac_ext >&5
14471 fi
14472 rm -f conftest*
14473 if test $ac_cv_c_bigendian = unknown; then
14474 if test "$cross_compiling" = yes; then
14475     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
14476 else
14477   cat > conftest.$ac_ext <<EOF
14478 #line 14479 "configure"
14479 #include "confdefs.h"
14480 main () {
14481   /* Are we little or big endian?  From Harbison&Steele.  */
14482   union
14483   {
14484     long l;
14485     char c[sizeof (long)];
14486   } u;
14487   u.l = 1;
14488   exit (u.c[sizeof (long) - 1] == 1);
14489 }
14490 EOF
14491 if { (eval echo configure:14492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14492 then
14493   ac_cv_c_bigendian=no
14494 else
14495   echo "configure: failed program was:" >&5
14496   cat conftest.$ac_ext >&5
14497   rm -fr conftest*
14498   ac_cv_c_bigendian=yes
14499 fi
14500 rm -fr conftest*
14501 fi
14502
14503 fi
14504 fi
14505
14506 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
14507 if test $ac_cv_c_bigendian = yes; then
14508   cat >> confdefs.h <<\EOF
14509 #define WORDS_BIGENDIAN 1
14510 EOF
14511
14512 fi
14513
14514 fi
14515
14516 echo $ac_n "checking size of short""... $ac_c" 1>&6
14517 echo "configure:14518: checking size of short" >&5 
14518 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
14519   echo $ac_n "(cached) $ac_c" 1>&6
14520 else
14521   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
14522   cat > conftest.$ac_ext <<EOF
14523 #line 14524 "configure"
14524 #include "confdefs.h"
14525 #include "confdefs.h" 
14526 #include <sys/types.h> 
14527  
14528
14529 int main() {
14530 switch (0) case 0: case (sizeof (short) == $ac_size):;
14531 ; return 0; }
14532 EOF
14533 if { (eval echo configure:14534: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14534   rm -rf conftest*
14535   ac_cv_sizeof_short=$ac_size
14536 else
14537   echo "configure: failed program was:" >&5
14538   cat conftest.$ac_ext >&5
14539 fi
14540 rm -f conftest* 
14541   if test x$ac_cv_sizeof_short != x ; then break; fi 
14542 done 
14543
14544 fi
14545  
14546 if test x$ac_cv_sizeof_short = x ; then 
14547   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
14548 fi 
14549 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
14550 cat >> confdefs.h <<EOF
14551 #define SIZEOF_SHORT $ac_cv_sizeof_short
14552 EOF
14553  
14554  
14555 echo $ac_n "checking size of int""... $ac_c" 1>&6
14556 echo "configure:14557: checking size of int" >&5 
14557 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
14558   echo $ac_n "(cached) $ac_c" 1>&6
14559 else
14560   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
14561   cat > conftest.$ac_ext <<EOF
14562 #line 14563 "configure"
14563 #include "confdefs.h"
14564 #include "confdefs.h" 
14565 #include <sys/types.h> 
14566  
14567
14568 int main() {
14569 switch (0) case 0: case (sizeof (int) == $ac_size):;
14570 ; return 0; }
14571 EOF
14572 if { (eval echo configure:14573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14573   rm -rf conftest*
14574   ac_cv_sizeof_int=$ac_size
14575 else
14576   echo "configure: failed program was:" >&5
14577   cat conftest.$ac_ext >&5
14578 fi
14579 rm -f conftest* 
14580   if test x$ac_cv_sizeof_int != x ; then break; fi 
14581 done 
14582
14583 fi
14584  
14585 if test x$ac_cv_sizeof_int = x ; then 
14586   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
14587 fi 
14588 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
14589 cat >> confdefs.h <<EOF
14590 #define SIZEOF_INT $ac_cv_sizeof_int
14591 EOF
14592  
14593  
14594 echo $ac_n "checking size of long""... $ac_c" 1>&6
14595 echo "configure:14596: checking size of long" >&5 
14596 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
14597   echo $ac_n "(cached) $ac_c" 1>&6
14598 else
14599   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
14600   cat > conftest.$ac_ext <<EOF
14601 #line 14602 "configure"
14602 #include "confdefs.h"
14603 #include "confdefs.h" 
14604 #include <sys/types.h> 
14605  
14606
14607 int main() {
14608 switch (0) case 0: case (sizeof (long) == $ac_size):;
14609 ; return 0; }
14610 EOF
14611 if { (eval echo configure:14612: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14612   rm -rf conftest*
14613   ac_cv_sizeof_long=$ac_size
14614 else
14615   echo "configure: failed program was:" >&5
14616   cat conftest.$ac_ext >&5
14617 fi
14618 rm -f conftest* 
14619   if test x$ac_cv_sizeof_long != x ; then break; fi 
14620 done 
14621
14622 fi
14623  
14624 if test x$ac_cv_sizeof_long = x ; then 
14625   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
14626 fi 
14627 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
14628 cat >> confdefs.h <<EOF
14629 #define SIZEOF_LONG $ac_cv_sizeof_long
14630 EOF
14631  
14632
14633
14634 if test "$ac_cv_sizeof_int" -lt 4 ; then
14635         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
14636
14637         cat >> confdefs.h <<\EOF
14638 #define LBER_INT_T long
14639 EOF
14640
14641 else
14642         cat >> confdefs.h <<\EOF
14643 #define LBER_INT_T int
14644 EOF
14645
14646 fi
14647
14648 cat >> confdefs.h <<\EOF
14649 #define LBER_LEN_T long
14650 EOF
14651
14652 cat >> confdefs.h <<\EOF
14653 #define LBER_SOCKET_T int
14654 EOF
14655
14656 cat >> confdefs.h <<\EOF
14657 #define LBER_TAG_T long
14658 EOF
14659
14660
14661 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
14662 echo "configure:14663: checking for 8-bit clean memcmp" >&5
14663 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
14664   echo $ac_n "(cached) $ac_c" 1>&6
14665 else
14666   if test "$cross_compiling" = yes; then
14667   ac_cv_func_memcmp_clean=no
14668 else
14669   cat > conftest.$ac_ext <<EOF
14670 #line 14671 "configure"
14671 #include "confdefs.h"
14672
14673 main()
14674 {
14675   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
14676   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
14677 }
14678
14679 EOF
14680 if { (eval echo configure:14681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14681 then
14682   ac_cv_func_memcmp_clean=yes
14683 else
14684   echo "configure: failed program was:" >&5
14685   cat conftest.$ac_ext >&5
14686   rm -fr conftest*
14687   ac_cv_func_memcmp_clean=no
14688 fi
14689 rm -fr conftest*
14690 fi
14691
14692 fi
14693
14694 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
14695 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
14696
14697 echo $ac_n "checking for strftime""... $ac_c" 1>&6
14698 echo "configure:14699: checking for strftime" >&5
14699 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
14700   echo $ac_n "(cached) $ac_c" 1>&6
14701 else
14702   cat > conftest.$ac_ext <<EOF
14703 #line 14704 "configure"
14704 #include "confdefs.h"
14705 /* System header to define __stub macros and hopefully few prototypes,
14706     which can conflict with char strftime(); below.  */
14707 #include <assert.h>
14708 /* Override any gcc2 internal prototype to avoid an error.  */
14709 /* We use char because int might match the return type of a gcc2
14710     builtin and then its argument prototype would still apply.  */
14711 char strftime();
14712 char (*f)();
14713
14714 int main() {
14715
14716 /* The GNU C library defines this for functions which it implements
14717     to always fail with ENOSYS.  Some functions are actually named
14718     something starting with __ and the normal name is an alias.  */
14719 #if defined (__stub_strftime) || defined (__stub___strftime)
14720 choke me
14721 #else
14722 f = strftime;
14723 #endif
14724
14725 ; return 0; }
14726 EOF
14727 if { (eval echo configure:14728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14728   rm -rf conftest*
14729   eval "ac_cv_func_strftime=yes"
14730 else
14731   echo "configure: failed program was:" >&5
14732   cat conftest.$ac_ext >&5
14733   rm -rf conftest*
14734   eval "ac_cv_func_strftime=no"
14735 fi
14736 rm -f conftest*
14737 fi
14738
14739 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
14740   echo "$ac_t""yes" 1>&6
14741   cat >> confdefs.h <<\EOF
14742 #define HAVE_STRFTIME 1
14743 EOF
14744
14745 else
14746   echo "$ac_t""no" 1>&6
14747 # strftime is in -lintl on SCO UNIX.
14748 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
14749 echo "configure:14750: checking for strftime in -lintl" >&5
14750 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
14751 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14752   echo $ac_n "(cached) $ac_c" 1>&6
14753 else
14754   ac_save_LIBS="$LIBS"
14755 LIBS="-lintl  $LIBS"
14756 cat > conftest.$ac_ext <<EOF
14757 #line 14758 "configure"
14758 #include "confdefs.h"
14759 /* Override any gcc2 internal prototype to avoid an error.  */
14760 /* We use char because int might match the return type of a gcc2
14761     builtin and then its argument prototype would still apply.  */
14762 char strftime();
14763
14764 int main() {
14765 strftime()
14766 ; return 0; }
14767 EOF
14768 if { (eval echo configure:14769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14769   rm -rf conftest*
14770   eval "ac_cv_lib_$ac_lib_var=yes"
14771 else
14772   echo "configure: failed program was:" >&5
14773   cat conftest.$ac_ext >&5
14774   rm -rf conftest*
14775   eval "ac_cv_lib_$ac_lib_var=no"
14776 fi
14777 rm -f conftest*
14778 LIBS="$ac_save_LIBS"
14779
14780 fi
14781 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14782   echo "$ac_t""yes" 1>&6
14783   cat >> confdefs.h <<\EOF
14784 #define HAVE_STRFTIME 1
14785 EOF
14786
14787 LIBS="-lintl $LIBS"
14788 else
14789   echo "$ac_t""no" 1>&6
14790 fi
14791
14792 fi
14793
14794
14795 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
14796 echo "configure:14797: checking for inet_aton()" >&5
14797 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
14798   echo $ac_n "(cached) $ac_c" 1>&6
14799 else
14800   cat > conftest.$ac_ext <<EOF
14801 #line 14802 "configure"
14802 #include "confdefs.h"
14803
14804 #ifdef HAVE_SYS_TYPES_H
14805 #       include <sys/types.h>
14806 #endif
14807 #ifdef HAVE_SYS_SOCKET_H
14808 #       include <sys/socket.h>
14809 #       ifdef HAVE_SYS_SELECT_H
14810 #               include <sys/select.h>
14811 #       endif
14812 #       include <netinet/in.h>
14813 #       ifdef HAVE_ARPA_INET_H
14814 #               include <arpa/inet.h>
14815 #       endif
14816 #endif
14817
14818 int main() {
14819 struct in_addr in;
14820 int rc = inet_aton( "255.255.255.255", &in );
14821 ; return 0; }
14822 EOF
14823 if { (eval echo configure:14824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14824   rm -rf conftest*
14825   ol_cv_func_inet_aton=yes
14826 else
14827   echo "configure: failed program was:" >&5
14828   cat conftest.$ac_ext >&5
14829   rm -rf conftest*
14830   ol_cv_func_inet_aton=no
14831 fi
14832 rm -f conftest*
14833 fi
14834
14835 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
14836   if test $ol_cv_func_inet_aton != no; then
14837     cat >> confdefs.h <<\EOF
14838 #define HAVE_INET_ATON 1
14839 EOF
14840
14841   fi
14842  
14843
14844 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
14845 echo "configure:14846: checking for _spawnlp" >&5
14846 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
14847   echo $ac_n "(cached) $ac_c" 1>&6
14848 else
14849   cat > conftest.$ac_ext <<EOF
14850 #line 14851 "configure"
14851 #include "confdefs.h"
14852 /* System header to define __stub macros and hopefully few prototypes,
14853     which can conflict with char _spawnlp(); below.  */
14854 #include <assert.h>
14855 /* Override any gcc2 internal prototype to avoid an error.  */
14856 /* We use char because int might match the return type of a gcc2
14857     builtin and then its argument prototype would still apply.  */
14858 char _spawnlp();
14859 char (*f)();
14860
14861 int main() {
14862
14863 /* The GNU C library defines this for functions which it implements
14864     to always fail with ENOSYS.  Some functions are actually named
14865     something starting with __ and the normal name is an alias.  */
14866 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
14867 choke me
14868 #else
14869 f = _spawnlp;
14870 #endif
14871
14872 ; return 0; }
14873 EOF
14874 if { (eval echo configure:14875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14875   rm -rf conftest*
14876   eval "ac_cv_func__spawnlp=yes"
14877 else
14878   echo "configure: failed program was:" >&5
14879   cat conftest.$ac_ext >&5
14880   rm -rf conftest*
14881   eval "ac_cv_func__spawnlp=no"
14882 fi
14883 rm -f conftest*
14884 fi
14885
14886 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
14887   echo "$ac_t""yes" 1>&6
14888   cat >> confdefs.h <<\EOF
14889 #define HAVE_SPAWNLP 1
14890 EOF
14891
14892 else
14893   echo "$ac_t""no" 1>&6
14894 fi
14895
14896
14897 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
14898 echo "configure:14899: checking for _snprintf" >&5
14899 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
14900   echo $ac_n "(cached) $ac_c" 1>&6
14901 else
14902   cat > conftest.$ac_ext <<EOF
14903 #line 14904 "configure"
14904 #include "confdefs.h"
14905 /* System header to define __stub macros and hopefully few prototypes,
14906     which can conflict with char _snprintf(); below.  */
14907 #include <assert.h>
14908 /* Override any gcc2 internal prototype to avoid an error.  */
14909 /* We use char because int might match the return type of a gcc2
14910     builtin and then its argument prototype would still apply.  */
14911 char _snprintf();
14912 char (*f)();
14913
14914 int main() {
14915
14916 /* The GNU C library defines this for functions which it implements
14917     to always fail with ENOSYS.  Some functions are actually named
14918     something starting with __ and the normal name is an alias.  */
14919 #if defined (__stub__snprintf) || defined (__stub____snprintf)
14920 choke me
14921 #else
14922 f = _snprintf;
14923 #endif
14924
14925 ; return 0; }
14926 EOF
14927 if { (eval echo configure:14928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14928   rm -rf conftest*
14929   eval "ac_cv_func__snprintf=yes"
14930 else
14931   echo "configure: failed program was:" >&5
14932   cat conftest.$ac_ext >&5
14933   rm -rf conftest*
14934   eval "ac_cv_func__snprintf=no"
14935 fi
14936 rm -f conftest*
14937 fi
14938
14939 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
14940   echo "$ac_t""yes" 1>&6
14941   ac_cv_func_snprintf=yes
14942         cat >> confdefs.h <<\EOF
14943 #define snprintf _snprintf
14944 EOF
14945
14946
14947 else
14948   echo "$ac_t""no" 1>&6
14949 fi
14950
14951
14952 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
14953 echo "configure:14954: checking for _vsnprintf" >&5
14954 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
14955   echo $ac_n "(cached) $ac_c" 1>&6
14956 else
14957   cat > conftest.$ac_ext <<EOF
14958 #line 14959 "configure"
14959 #include "confdefs.h"
14960 /* System header to define __stub macros and hopefully few prototypes,
14961     which can conflict with char _vsnprintf(); below.  */
14962 #include <assert.h>
14963 /* Override any gcc2 internal prototype to avoid an error.  */
14964 /* We use char because int might match the return type of a gcc2
14965     builtin and then its argument prototype would still apply.  */
14966 char _vsnprintf();
14967 char (*f)();
14968
14969 int main() {
14970
14971 /* The GNU C library defines this for functions which it implements
14972     to always fail with ENOSYS.  Some functions are actually named
14973     something starting with __ and the normal name is an alias.  */
14974 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
14975 choke me
14976 #else
14977 f = _vsnprintf;
14978 #endif
14979
14980 ; return 0; }
14981 EOF
14982 if { (eval echo configure:14983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14983   rm -rf conftest*
14984   eval "ac_cv_func__vsnprintf=yes"
14985 else
14986   echo "configure: failed program was:" >&5
14987   cat conftest.$ac_ext >&5
14988   rm -rf conftest*
14989   eval "ac_cv_func__vsnprintf=no"
14990 fi
14991 rm -f conftest*
14992 fi
14993
14994 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
14995   echo "$ac_t""yes" 1>&6
14996   ac_cv_func_vsnprintf=yes
14997         cat >> confdefs.h <<\EOF
14998 #define vsnprintf _vsnprintf
14999 EOF
15000
15001
15002 else
15003   echo "$ac_t""no" 1>&6
15004 fi
15005
15006
15007 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
15008 echo "configure:15009: checking for vprintf" >&5
15009 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
15010   echo $ac_n "(cached) $ac_c" 1>&6
15011 else
15012   cat > conftest.$ac_ext <<EOF
15013 #line 15014 "configure"
15014 #include "confdefs.h"
15015 /* System header to define __stub macros and hopefully few prototypes,
15016     which can conflict with char vprintf(); below.  */
15017 #include <assert.h>
15018 /* Override any gcc2 internal prototype to avoid an error.  */
15019 /* We use char because int might match the return type of a gcc2
15020     builtin and then its argument prototype would still apply.  */
15021 char vprintf();
15022 char (*f)();
15023
15024 int main() {
15025
15026 /* The GNU C library defines this for functions which it implements
15027     to always fail with ENOSYS.  Some functions are actually named
15028     something starting with __ and the normal name is an alias.  */
15029 #if defined (__stub_vprintf) || defined (__stub___vprintf)
15030 choke me
15031 #else
15032 f = vprintf;
15033 #endif
15034
15035 ; return 0; }
15036 EOF
15037 if { (eval echo configure:15038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15038   rm -rf conftest*
15039   eval "ac_cv_func_vprintf=yes"
15040 else
15041   echo "configure: failed program was:" >&5
15042   cat conftest.$ac_ext >&5
15043   rm -rf conftest*
15044   eval "ac_cv_func_vprintf=no"
15045 fi
15046 rm -f conftest*
15047 fi
15048
15049 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
15050   echo "$ac_t""yes" 1>&6
15051   cat >> confdefs.h <<\EOF
15052 #define HAVE_VPRINTF 1
15053 EOF
15054
15055 else
15056   echo "$ac_t""no" 1>&6
15057 fi
15058
15059 if test "$ac_cv_func_vprintf" != yes; then
15060 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
15061 echo "configure:15062: checking for _doprnt" >&5
15062 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
15063   echo $ac_n "(cached) $ac_c" 1>&6
15064 else
15065   cat > conftest.$ac_ext <<EOF
15066 #line 15067 "configure"
15067 #include "confdefs.h"
15068 /* System header to define __stub macros and hopefully few prototypes,
15069     which can conflict with char _doprnt(); below.  */
15070 #include <assert.h>
15071 /* Override any gcc2 internal prototype to avoid an error.  */
15072 /* We use char because int might match the return type of a gcc2
15073     builtin and then its argument prototype would still apply.  */
15074 char _doprnt();
15075 char (*f)();
15076
15077 int main() {
15078
15079 /* The GNU C library defines this for functions which it implements
15080     to always fail with ENOSYS.  Some functions are actually named
15081     something starting with __ and the normal name is an alias.  */
15082 #if defined (__stub__doprnt) || defined (__stub____doprnt)
15083 choke me
15084 #else
15085 f = _doprnt;
15086 #endif
15087
15088 ; return 0; }
15089 EOF
15090 if { (eval echo configure:15091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15091   rm -rf conftest*
15092   eval "ac_cv_func__doprnt=yes"
15093 else
15094   echo "configure: failed program was:" >&5
15095   cat conftest.$ac_ext >&5
15096   rm -rf conftest*
15097   eval "ac_cv_func__doprnt=no"
15098 fi
15099 rm -f conftest*
15100 fi
15101
15102 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
15103   echo "$ac_t""yes" 1>&6
15104   cat >> confdefs.h <<\EOF
15105 #define HAVE_DOPRNT 1
15106 EOF
15107
15108 else
15109   echo "$ac_t""no" 1>&6
15110 fi
15111
15112 fi
15113
15114
15115 if test $ac_cv_func_vprintf = yes ; then
15116                 for ac_func in vsnprintf vsprintf
15117 do
15118 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15119 echo "configure:15120: checking for $ac_func" >&5
15120 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15121   echo $ac_n "(cached) $ac_c" 1>&6
15122 else
15123   cat > conftest.$ac_ext <<EOF
15124 #line 15125 "configure"
15125 #include "confdefs.h"
15126 /* System header to define __stub macros and hopefully few prototypes,
15127     which can conflict with char $ac_func(); below.  */
15128 #include <assert.h>
15129 /* Override any gcc2 internal prototype to avoid an error.  */
15130 /* We use char because int might match the return type of a gcc2
15131     builtin and then its argument prototype would still apply.  */
15132 char $ac_func();
15133 char (*f)();
15134
15135 int main() {
15136
15137 /* The GNU C library defines this for functions which it implements
15138     to always fail with ENOSYS.  Some functions are actually named
15139     something starting with __ and the normal name is an alias.  */
15140 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15141 choke me
15142 #else
15143 f = $ac_func;
15144 #endif
15145
15146 ; return 0; }
15147 EOF
15148 if { (eval echo configure:15149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15149   rm -rf conftest*
15150   eval "ac_cv_func_$ac_func=yes"
15151 else
15152   echo "configure: failed program was:" >&5
15153   cat conftest.$ac_ext >&5
15154   rm -rf conftest*
15155   eval "ac_cv_func_$ac_func=no"
15156 fi
15157 rm -f conftest*
15158 fi
15159
15160 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15161   echo "$ac_t""yes" 1>&6
15162     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15163   cat >> confdefs.h <<EOF
15164 #define $ac_tr_func 1
15165 EOF
15166  
15167 else
15168   echo "$ac_t""no" 1>&6
15169 fi
15170 done
15171
15172 fi
15173
15174 for ac_func in \
15175         bcopy                   \
15176         closesocket             \
15177         chroot                  \
15178         endgrent                \
15179         endpwent                \
15180         flock                   \
15181         getdtablesize   \
15182         getgrgid                \
15183         gethostname             \
15184         getpass                 \
15185         getpassphrase   \
15186         getpwuid                \
15187         getpwnam                \
15188         getspnam                \
15189         gettimeofday    \
15190         initgroups              \
15191         lockf                   \
15192         memcpy                  \
15193         memmove                 \
15194         mkstemp                 \
15195         pipe                    \
15196         read                    \
15197         recv                    \
15198         recvfrom                \
15199         setpwfile               \
15200         setgid                  \
15201         setegid                 \
15202         setsid                  \
15203         setuid                  \
15204         seteuid                 \
15205         sigaction               \
15206         signal                  \
15207         sigset                  \
15208         snprintf                \
15209         strdup                  \
15210         strerror                \
15211         strpbrk                 \
15212         strrchr                 \
15213         strsep                  \
15214         strstr                  \
15215         strtol                  \
15216         strtoul                 \
15217         strspn                  \
15218         sysconf                 \
15219         waitpid                 \
15220         wait4                   \
15221         write                   \
15222         send                    \
15223         sendto                  \
15224
15225 do
15226 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15227 echo "configure:15228: checking for $ac_func" >&5
15228 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15229   echo $ac_n "(cached) $ac_c" 1>&6
15230 else
15231   cat > conftest.$ac_ext <<EOF
15232 #line 15233 "configure"
15233 #include "confdefs.h"
15234 /* System header to define __stub macros and hopefully few prototypes,
15235     which can conflict with char $ac_func(); below.  */
15236 #include <assert.h>
15237 /* Override any gcc2 internal prototype to avoid an error.  */
15238 /* We use char because int might match the return type of a gcc2
15239     builtin and then its argument prototype would still apply.  */
15240 char $ac_func();
15241 char (*f)();
15242
15243 int main() {
15244
15245 /* The GNU C library defines this for functions which it implements
15246     to always fail with ENOSYS.  Some functions are actually named
15247     something starting with __ and the normal name is an alias.  */
15248 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15249 choke me
15250 #else
15251 f = $ac_func;
15252 #endif
15253
15254 ; return 0; }
15255 EOF
15256 if { (eval echo configure:15257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15257   rm -rf conftest*
15258   eval "ac_cv_func_$ac_func=yes"
15259 else
15260   echo "configure: failed program was:" >&5
15261   cat conftest.$ac_ext >&5
15262   rm -rf conftest*
15263   eval "ac_cv_func_$ac_func=no"
15264 fi
15265 rm -f conftest*
15266 fi
15267
15268 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15269   echo "$ac_t""yes" 1>&6
15270     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15271   cat >> confdefs.h <<EOF
15272 #define $ac_tr_func 1
15273 EOF
15274  
15275 else
15276   echo "$ac_t""no" 1>&6
15277 fi
15278 done
15279
15280
15281 for ac_func in getopt tempnam
15282 do
15283 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15284 echo "configure:15285: checking for $ac_func" >&5
15285 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15286   echo $ac_n "(cached) $ac_c" 1>&6
15287 else
15288   cat > conftest.$ac_ext <<EOF
15289 #line 15290 "configure"
15290 #include "confdefs.h"
15291 /* System header to define __stub macros and hopefully few prototypes,
15292     which can conflict with char $ac_func(); below.  */
15293 #include <assert.h>
15294 /* Override any gcc2 internal prototype to avoid an error.  */
15295 /* We use char because int might match the return type of a gcc2
15296     builtin and then its argument prototype would still apply.  */
15297 char $ac_func();
15298 char (*f)();
15299
15300 int main() {
15301
15302 /* The GNU C library defines this for functions which it implements
15303     to always fail with ENOSYS.  Some functions are actually named
15304     something starting with __ and the normal name is an alias.  */
15305 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15306 choke me
15307 #else
15308 f = $ac_func;
15309 #endif
15310
15311 ; return 0; }
15312 EOF
15313 if { (eval echo configure:15314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15314   rm -rf conftest*
15315   eval "ac_cv_func_$ac_func=yes"
15316 else
15317   echo "configure: failed program was:" >&5
15318   cat conftest.$ac_ext >&5
15319   rm -rf conftest*
15320   eval "ac_cv_func_$ac_func=no"
15321 fi
15322 rm -f conftest*
15323 fi
15324
15325 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15326   echo "$ac_t""yes" 1>&6
15327     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15328   cat >> confdefs.h <<EOF
15329 #define $ac_tr_func 1
15330 EOF
15331  
15332 else
15333   echo "$ac_t""no" 1>&6
15334 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
15335 fi
15336 done
15337
15338
15339
15340 if test "$ac_cv_func_getopt" != yes; then
15341     LIBSRCS="$LIBSRCS getopt.c"
15342 fi
15343
15344 if test "$ac_cv_func_tempnam" != yes; then
15345     LIBSRCS="$LIBSRCS tempnam.c"
15346 fi
15347
15348 # Check Configuration
15349 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
15350 echo "configure:15351: checking declaration of sys_errlist" >&5
15351 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
15352   echo $ac_n "(cached) $ac_c" 1>&6
15353 else
15354   
15355         cat > conftest.$ac_ext <<EOF
15356 #line 15357 "configure"
15357 #include "confdefs.h"
15358
15359 #include <stdio.h>
15360 #include <sys/types.h>
15361 #include <errno.h>
15362 #ifdef WINNT
15363 #include <stdlib.h>
15364 #endif 
15365 int main() {
15366 char *c = (char *) *sys_errlist
15367 ; return 0; }
15368 EOF
15369 if { (eval echo configure:15370: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15370   rm -rf conftest*
15371   ol_cv_dcl_sys_errlist=yes
15372         ol_cv_have_sys_errlist=yes
15373 else
15374   echo "configure: failed program was:" >&5
15375   cat conftest.$ac_ext >&5
15376   rm -rf conftest*
15377   ol_cv_dcl_sys_errlist=no
15378 fi
15379 rm -f conftest*
15380 fi
15381
15382 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
15383 #
15384 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
15385 if test $ol_cv_dcl_sys_errlist = no ; then
15386         cat >> confdefs.h <<\EOF
15387 #define DECL_SYS_ERRLIST 1
15388 EOF
15389
15390
15391         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
15392 echo "configure:15393: checking existence of sys_errlist" >&5
15393 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
15394   echo $ac_n "(cached) $ac_c" 1>&6
15395 else
15396   
15397                 cat > conftest.$ac_ext <<EOF
15398 #line 15399 "configure"
15399 #include "confdefs.h"
15400 #include <errno.h>
15401 int main() {
15402 char *c = (char *) *sys_errlist
15403 ; return 0; }
15404 EOF
15405 if { (eval echo configure:15406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15406   rm -rf conftest*
15407   ol_cv_have_sys_errlist=yes
15408 else
15409   echo "configure: failed program was:" >&5
15410   cat conftest.$ac_ext >&5
15411   rm -rf conftest*
15412   ol_cv_have_sys_errlist=no
15413 fi
15414 rm -f conftest*
15415 fi
15416
15417 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
15418 fi
15419 if test $ol_cv_have_sys_errlist = yes ; then
15420         cat >> confdefs.h <<\EOF
15421 #define HAVE_SYS_ERRLIST 1
15422 EOF
15423
15424 fi
15425
15426
15427
15428 if test "$ol_enable_debug" != no ; then
15429         cat >> confdefs.h <<\EOF
15430 #define LDAP_DEBUG 1
15431 EOF
15432
15433 fi
15434 if test "$ol_enable_syslog" = yes ; then
15435         cat >> confdefs.h <<\EOF
15436 #define LDAP_SYSLOG 1
15437 EOF
15438
15439 fi
15440 if test "$ol_enable_libui" = yes ; then
15441         cat >> confdefs.h <<\EOF
15442 #define LDAP_LIBUI 1
15443 EOF
15444
15445 fi
15446 if test "$ol_enable_cache" = no ; then
15447         cat >> confdefs.h <<\EOF
15448 #define LDAP_NOCACHE 1
15449 EOF
15450
15451 fi
15452 if test "$ol_link_kbind" != no ; then
15453         cat >> confdefs.h <<\EOF
15454 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
15455 EOF
15456
15457 fi
15458 if test "$ol_enable_proctitle" != no ; then
15459         cat >> confdefs.h <<\EOF
15460 #define LDAP_PROCTITLE 1
15461 EOF
15462
15463 fi
15464 if test "$ol_enable_referrals" != no ; then
15465         cat >> confdefs.h <<\EOF
15466 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
15467 EOF
15468
15469 fi
15470 if test "$ol_enable_local" != no; then
15471         cat >> confdefs.h <<\EOF
15472 #define LDAP_PF_LOCAL 1
15473 EOF
15474
15475 fi
15476 if test "$ol_enable_ipv6" != no; then
15477         cat >> confdefs.h <<\EOF
15478 #define LDAP_PF_INET6 1
15479 EOF
15480
15481 fi
15482 if test "$ol_enable_cleartext" != no ; then
15483         cat >> confdefs.h <<\EOF
15484 #define SLAPD_CLEARTEXT 1
15485 EOF
15486
15487 fi
15488 if test "$ol_enable_crypt" != no ; then
15489         cat >> confdefs.h <<\EOF
15490 #define SLAPD_CRYPT 1
15491 EOF
15492
15493 fi
15494 if test "$ol_link_kpasswd" != no ; then
15495         cat >> confdefs.h <<\EOF
15496 #define SLAPD_KPASSWD 1
15497 EOF
15498
15499 fi
15500 if test "$ol_link_spasswd" != no ; then
15501         cat >> confdefs.h <<\EOF
15502 #define SLAPD_SPASSWD 1
15503 EOF
15504
15505 fi
15506 if test "$ol_enable_multimaster" != no ; then
15507         cat >> confdefs.h <<\EOF
15508 #define SLAPD_MULTIMASTER 1
15509 EOF
15510
15511 fi
15512 if test "$ol_enable_phonetic" != no ; then
15513         cat >> confdefs.h <<\EOF
15514 #define SLAPD_PHONETIC 1
15515 EOF
15516
15517 fi
15518 if test "$ol_enable_rlookups" != no ; then
15519         cat >> confdefs.h <<\EOF
15520 #define SLAPD_RLOOKUPS 1
15521 EOF
15522
15523 fi
15524 if test "$ol_enable_aci" != no ; then
15525         cat >> confdefs.h <<\EOF
15526 #define SLAPD_ACI_ENABLED 1
15527 EOF
15528
15529 fi
15530
15531 if test "$ol_link_modules" != no ; then
15532         cat >> confdefs.h <<\EOF
15533 #define SLAPD_MODULES 1
15534 EOF
15535
15536         BUILD_SLAPD=yes
15537         SLAPD_MODULES_LDFLAGS="-dlopen self"
15538 fi
15539
15540 if test "$ol_link_dnssrv" != no ; then
15541         cat >> confdefs.h <<\EOF
15542 #define SLAPD_DNSSRV 1
15543 EOF
15544
15545         BUILD_SLAPD=yes
15546         BUILD_DNSSRV=yes
15547         if test "$ol_with_dnssrv_module" != static ; then
15548                 cat >> confdefs.h <<\EOF
15549 #define SLAPD_DNSSRV_DYNAMIC 1
15550 EOF
15551
15552                 BUILD_DNSSRV=mod
15553                 BUILD_DNSSRV_DYNAMIC=shared
15554                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
15555         fi
15556 fi
15557
15558 if test "$ol_enable_ldap" != no ; then
15559         cat >> confdefs.h <<\EOF
15560 #define SLAPD_LDAP 1
15561 EOF
15562
15563         BUILD_SLAPD=yes
15564         BUILD_LDAP=yes
15565         if test "$ol_with_ldap_module" != static ; then
15566                 cat >> confdefs.h <<\EOF
15567 #define SLAPD_LDAP_DYNAMIC 1
15568 EOF
15569
15570                 BUILD_LDAP=mod
15571                 BUILD_LDAP_DYNAMIC=shared
15572                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
15573         fi
15574 fi
15575
15576 if test "$ol_link_ldbm" != no ; then
15577         cat >> confdefs.h <<\EOF
15578 #define SLAPD_LDBM 1
15579 EOF
15580
15581         BUILD_SLAPD=yes
15582         BUILD_LDBM=yes
15583         if test "$ol_with_ldbm_module" != static ; then
15584                 cat >> confdefs.h <<\EOF
15585 #define SLAPD_LDBM_DYNAMIC 1
15586 EOF
15587
15588                 BUILD_LDBM=mod
15589                 BUILD_LDBM_DYNAMIC=shared
15590                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
15591         fi
15592 fi
15593
15594 if test "$ol_enable_passwd" != no ; then
15595         cat >> confdefs.h <<\EOF
15596 #define SLAPD_PASSWD 1
15597 EOF
15598
15599         BUILD_SLAPD=yes
15600         BUILD_PASSWD=yes
15601         if test "$ol_with_passwd_module" != static ; then
15602                 cat >> confdefs.h <<\EOF
15603 #define SLAPD_PASSWD_DYNAMIC 1
15604 EOF
15605
15606                 BUILD_PASSWD=mod
15607                 BUILD_PASSWD_DYNAMIC=shared
15608                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
15609         fi
15610 fi
15611
15612 if test "$ol_enable_shell" != no ; then
15613         cat >> confdefs.h <<\EOF
15614 #define SLAPD_SHELL 1
15615 EOF
15616
15617         BUILD_SLAPD=yes
15618         BUILD_SHELL=yes
15619         if test "$ol_with_shell_module" != static ; then
15620                 cat >> confdefs.h <<\EOF
15621 #define SLAPD_SHELL_DYNAMIC 1
15622 EOF
15623
15624                 BUILD_SHELL=mod
15625                 BUILD_SHELL_DYNAMIC=shared
15626                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
15627         fi
15628 fi
15629
15630 if test "$ol_enable_sql" != no ; then
15631         cat >> confdefs.h <<\EOF
15632 #define SLAPD_SQL 1
15633 EOF
15634
15635         BUILD_SLAPD=yes
15636         BUILD_SQL=yes
15637         SLAPD_SQL_LIBS=-liodbc
15638         if test "$ol_with_sql_module" != static; then
15639                 cat >> confdefs.h <<\EOF
15640 #define SLAPD_SQL_DYNAMIC 1
15641 EOF
15642
15643                 BUILD_SQL=mod
15644                 BUILD_SQL_DYNAMIC=shared
15645                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
15646         fi
15647 fi
15648
15649 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
15650         $BUILD_SLAPD = yes ; then
15651         BUILD_SLURPD=yes
15652 fi
15653
15654
15655 if test "$LINK_BINS_DYNAMIC" = yes; then
15656     LIB_LINKAGE=DYN
15657     LT_LIB_LINKAGE=shared
15658 else
15659     LIB_LINKAGE=STAT
15660     LT_LIB_LINKAGE=static
15661 fi
15662
15663 if test "$ac_cv_mingw32" = yes ; then
15664     PLAT=NT
15665     DYN_EXT=dll
15666 else
15667     PLAT=UNIX
15668     DYN_EXT=so
15669 fi
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679   
15680   
15681   
15682   
15683   
15684   
15685   
15686   
15687   
15688   
15689   
15690   
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721 trap '' 1 2 15
15722
15723 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
15724
15725 test "x$prefix" = xNONE && prefix=$ac_default_prefix
15726 # Let make expand exec_prefix.
15727 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
15728
15729 # Any assignment to VPATH causes Sun make to only execute
15730 # the first set of double-colon rules, so remove it if not needed.
15731 # If there is a colon in the path, we need to keep it.
15732 if test "x$srcdir" = x.; then
15733   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
15734 fi
15735
15736 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
15737
15738 DEFS=-DHAVE_CONFIG_H
15739
15740 # Without the "./", some shells look in PATH for config.status.
15741 : ${CONFIG_STATUS=./config.status}
15742
15743 echo creating $CONFIG_STATUS
15744 rm -f $CONFIG_STATUS
15745 cat > $CONFIG_STATUS <<EOF
15746 #! /bin/sh
15747 # Generated automatically by configure.
15748 # Run this file to recreate the current configuration.
15749 # This directory was configured as follows,
15750 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
15751 #
15752 # $0 $ac_configure_args
15753 #
15754 # Compiler output produced by configure, useful for debugging
15755 # configure, is in ./config.log if it exists.
15756
15757 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
15758 for ac_option
15759 do
15760   case "\$ac_option" in
15761   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
15762     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
15763     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
15764   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
15765     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
15766     exit 0 ;;
15767   -help | --help | --hel | --he | --h)
15768     echo "\$ac_cs_usage"; exit 0 ;;
15769   *) echo "\$ac_cs_usage"; exit 1 ;;
15770   esac
15771 done
15772
15773 ac_given_srcdir=$srcdir
15774 ac_given_INSTALL="$INSTALL"
15775
15776 trap 'rm -fr `echo "\
15777 Makefile:build/top.mk:Makefile.in:build/dir.mk \
15778 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
15779 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
15780 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
15781 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
15782 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
15783 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
15784 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
15785 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
15786 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
15787 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
15788 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
15789 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
15790 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
15791 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
15792 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
15793 include/Makefile:build/top.mk:include/Makefile.in \
15794 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
15795 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
15796 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
15797 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
15798 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
15799 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
15800 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
15801 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
15802 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
15803 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
15804 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
15805 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
15806 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
15807 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
15808 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
15809 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
15810 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
15811 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
15812 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
15813 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
15814 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
15815 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
15816 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
15817 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
15818 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
15819  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
15820 EOF
15821 cat >> $CONFIG_STATUS <<EOF
15822
15823 # Protect against being on the right side of a sed subst in config.status.
15824 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
15825  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
15826 $ac_vpsub
15827 $extrasub
15828 s%@SHELL@%$SHELL%g
15829 s%@CFLAGS@%$CFLAGS%g
15830 s%@CPPFLAGS@%$CPPFLAGS%g
15831 s%@CXXFLAGS@%$CXXFLAGS%g
15832 s%@FFLAGS@%$FFLAGS%g
15833 s%@DEFS@%$DEFS%g
15834 s%@LDFLAGS@%$LDFLAGS%g
15835 s%@LIBS@%$LIBS%g
15836 s%@exec_prefix@%$exec_prefix%g
15837 s%@prefix@%$prefix%g
15838 s%@program_transform_name@%$program_transform_name%g
15839 s%@bindir@%$bindir%g
15840 s%@sbindir@%$sbindir%g
15841 s%@libexecdir@%$libexecdir%g
15842 s%@datadir@%$datadir%g
15843 s%@sysconfdir@%$sysconfdir%g
15844 s%@sharedstatedir@%$sharedstatedir%g
15845 s%@localstatedir@%$localstatedir%g
15846 s%@libdir@%$libdir%g
15847 s%@includedir@%$includedir%g
15848 s%@oldincludedir@%$oldincludedir%g
15849 s%@infodir@%$infodir%g
15850 s%@mandir@%$mandir%g
15851 s%@host@%$host%g
15852 s%@host_alias@%$host_alias%g
15853 s%@host_cpu@%$host_cpu%g
15854 s%@host_vendor@%$host_vendor%g
15855 s%@host_os@%$host_os%g
15856 s%@target@%$target%g
15857 s%@target_alias@%$target_alias%g
15858 s%@target_cpu@%$target_cpu%g
15859 s%@target_vendor@%$target_vendor%g
15860 s%@target_os@%$target_os%g
15861 s%@build@%$build%g
15862 s%@build_alias@%$build_alias%g
15863 s%@build_cpu@%$build_cpu%g
15864 s%@build_vendor@%$build_vendor%g
15865 s%@build_os@%$build_os%g
15866 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
15867 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
15868 s%@INSTALL_DATA@%$INSTALL_DATA%g
15869 s%@PACKAGE@%$PACKAGE%g
15870 s%@VERSION@%$VERSION%g
15871 s%@ACLOCAL@%$ACLOCAL%g
15872 s%@AUTOCONF@%$AUTOCONF%g
15873 s%@AUTOMAKE@%$AUTOMAKE%g
15874 s%@AUTOHEADER@%$AUTOHEADER%g
15875 s%@MAKEINFO@%$MAKEINFO%g
15876 s%@install_sh@%$install_sh%g
15877 s%@AMTAR@%$AMTAR%g
15878 s%@AWK@%$AWK%g
15879 s%@AMTARFLAGS@%$AMTARFLAGS%g
15880 s%@SET_MAKE@%$SET_MAKE%g
15881 s%@top_builddir@%$top_builddir%g
15882 s%@ldap_subdir@%$ldap_subdir%g
15883 s%@CC@%$CC%g
15884 s%@RANLIB@%$RANLIB%g
15885 s%@LN_S@%$LN_S%g
15886 s%@DLLTOOL@%$DLLTOOL%g
15887 s%@AS@%$AS%g
15888 s%@OBJDUMP@%$OBJDUMP%g
15889 s%@LIBTOOL@%$LIBTOOL%g
15890 s%@LN_H@%$LN_H%g
15891 s%@SENDMAIL@%$SENDMAIL%g
15892 s%@EDITOR@%$EDITOR%g
15893 s%@FINGER@%$FINGER%g
15894 s%@CPP@%$CPP%g
15895 s%@EXEEXT@%$EXEEXT%g
15896 s%@OBJEXT@%$OBJEXT%g
15897 s%@OL_MKDEP@%$OL_MKDEP%g
15898 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
15899 s%@LIBOBJS@%$LIBOBJS%g
15900 s%@LIBSRCS@%$LIBSRCS%g
15901 s%@PLAT@%$PLAT%g
15902 s%@LIB_LINKAGE@%$LIB_LINKAGE%g
15903 s%@LT_LIB_LINKAGE@%$LT_LIB_LINKAGE%g
15904 s%@DYN_EXT@%$DYN_EXT%g
15905 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
15906 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
15907 s%@BUILD_LDAP@%$BUILD_LDAP%g
15908 s%@BUILD_LDBM@%$BUILD_LDBM%g
15909 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
15910 s%@BUILD_SHELL@%$BUILD_SHELL%g
15911 s%@BUILD_SQL@%$BUILD_SQL%g
15912 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
15913 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
15914 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
15915 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
15916 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
15917 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
15918 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
15919 s%@LDAP_LIBS@%$LDAP_LIBS%g
15920 s%@LDIF_LIBS@%$LDIF_LIBS%g
15921 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
15922 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
15923 s%@LDBM_LIBS@%$LDBM_LIBS%g
15924 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
15925 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
15926 s%@WRAP_LIBS@%$WRAP_LIBS%g
15927 s%@LINK_BINS_DYNAMIC@%$LINK_BINS_DYNAMIC%g
15928 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
15929 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
15930 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
15931 s%@KRB4_LIBS@%$KRB4_LIBS%g
15932 s%@KRB5_LIBS@%$KRB5_LIBS%g
15933 s%@READLINE_LIBS@%$READLINE_LIBS%g
15934 s%@SASL_LIBS@%$SASL_LIBS%g
15935 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
15936 s%@TLS_LIBS@%$TLS_LIBS%g
15937 s%@MODULES_LIBS@%$MODULES_LIBS%g
15938 s%@AUTH_LIBS@%$AUTH_LIBS%g
15939 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
15940 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
15941 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
15942
15943 CEOF
15944 EOF
15945
15946 cat >> $CONFIG_STATUS <<\EOF
15947
15948 # Split the substitutions into bite-sized pieces for seds with
15949 # small command number limits, like on Digital OSF/1 and HP-UX.
15950 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
15951 ac_file=1 # Number of current file.
15952 ac_beg=1 # First line for current file.
15953 ac_end=$ac_max_sed_cmds # Line after last line for current file.
15954 ac_more_lines=:
15955 ac_sed_cmds=""
15956 while $ac_more_lines; do
15957   if test $ac_beg -gt 1; then
15958     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
15959   else
15960     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
15961   fi
15962   if test ! -s conftest.s$ac_file; then
15963     ac_more_lines=false
15964     rm -f conftest.s$ac_file
15965   else
15966     if test -z "$ac_sed_cmds"; then
15967       ac_sed_cmds="sed -f conftest.s$ac_file"
15968     else
15969       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
15970     fi
15971     ac_file=`expr $ac_file + 1`
15972     ac_beg=$ac_end
15973     ac_end=`expr $ac_end + $ac_max_sed_cmds`
15974   fi
15975 done
15976 if test -z "$ac_sed_cmds"; then
15977   ac_sed_cmds=cat
15978 fi
15979 EOF
15980
15981 cat >> $CONFIG_STATUS <<EOF
15982
15983 CONFIG_FILES=\${CONFIG_FILES-"\
15984 Makefile:build/top.mk:Makefile.in:build/dir.mk \
15985 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
15986 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
15987 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
15988 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
15989 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
15990 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
15991 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
15992 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
15993 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
15994 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
15995 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
15996 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
15997 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
15998 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
15999 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
16000 include/Makefile:build/top.mk:include/Makefile.in \
16001 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
16002 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
16003 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
16004 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
16005 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
16006 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
16007 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
16008 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
16009 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
16010 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
16011 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
16012 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
16013 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
16014 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
16015 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
16016 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
16017 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
16018 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
16019 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
16020 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
16021 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
16022 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
16023 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
16024 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
16025 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
16026 "}
16027 EOF
16028 cat >> $CONFIG_STATUS <<\EOF
16029 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
16030   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16031   case "$ac_file" in
16032   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
16033        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
16034   *) ac_file_in="${ac_file}.in" ;;
16035   esac
16036
16037   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
16038
16039   # Remove last slash and all that follows it.  Not all systems have dirname.
16040   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
16041   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16042     # The file is in a subdirectory.
16043     test ! -d "$ac_dir" && mkdir "$ac_dir"
16044     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
16045     # A "../" for each directory in $ac_dir_suffix.
16046     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
16047   else
16048     ac_dir_suffix= ac_dots=
16049   fi
16050
16051   case "$ac_given_srcdir" in
16052   .)  srcdir=.
16053       if test -z "$ac_dots"; then top_srcdir=.
16054       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
16055   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
16056   *) # Relative path.
16057     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
16058     top_srcdir="$ac_dots$ac_given_srcdir" ;;
16059   esac
16060
16061   case "$ac_given_INSTALL" in
16062   [/$]*) INSTALL="$ac_given_INSTALL" ;;
16063   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
16064   esac
16065
16066   echo creating "$ac_file"
16067   rm -f "$ac_file"
16068   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
16069   case "$ac_file" in
16070   *[Mm]akefile*) ac_comsub="1i\\
16071 # $configure_input" ;;
16072   *) ac_comsub= ;;
16073   esac
16074
16075   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
16076   sed -e "$ac_comsub
16077 s%@configure_input@%$configure_input%g
16078 s%@srcdir@%$srcdir%g
16079 s%@top_srcdir@%$top_srcdir%g
16080 s%@INSTALL@%$INSTALL%g
16081 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
16082 fi; done
16083 rm -f conftest.s*
16084
16085 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
16086 # NAME is the cpp macro being defined and VALUE is the value it is being given.
16087 #
16088 # ac_d sets the value in "#define NAME VALUE" lines.
16089 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
16090 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
16091 ac_dC='\3'
16092 ac_dD='%g'
16093 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
16094 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16095 ac_uB='\([      ]\)%\1#\2define\3'
16096 ac_uC=' '
16097 ac_uD='\4%g'
16098 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
16099 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16100 ac_eB='$%\1#\2define\3'
16101 ac_eC=' '
16102 ac_eD='%g'
16103
16104 if test "${CONFIG_HEADERS+set}" != set; then
16105 EOF
16106 cat >> $CONFIG_STATUS <<EOF
16107   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
16108 EOF
16109 cat >> $CONFIG_STATUS <<\EOF
16110 fi
16111 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
16112   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16113   case "$ac_file" in
16114   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
16115        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
16116   *) ac_file_in="${ac_file}.in" ;;
16117   esac
16118
16119   echo creating $ac_file
16120
16121   rm -f conftest.frag conftest.in conftest.out
16122   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
16123   cat $ac_file_inputs > conftest.in
16124
16125 EOF
16126
16127 # Transform confdefs.h into a sed script conftest.vals that substitutes
16128 # the proper values into config.h.in to produce config.h.  And first:
16129 # Protect against being on the right side of a sed subst in config.status.
16130 # Protect against being in an unquoted here document in config.status.
16131 rm -f conftest.vals
16132 cat > conftest.hdr <<\EOF
16133 s/[\\&%]/\\&/g
16134 s%[\\$`]%\\&%g
16135 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
16136 s%ac_d%ac_u%gp
16137 s%ac_u%ac_e%gp
16138 EOF
16139 sed -n -f conftest.hdr confdefs.h > conftest.vals
16140 rm -f conftest.hdr
16141
16142 # This sed command replaces #undef with comments.  This is necessary, for
16143 # example, in the case of _POSIX_SOURCE, which is predefined and required
16144 # on some systems where configure will not decide to define it.
16145 cat >> conftest.vals <<\EOF
16146 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
16147 EOF
16148
16149 # Break up conftest.vals because some shells have a limit on
16150 # the size of here documents, and old seds have small limits too.
16151
16152 rm -f conftest.tail
16153 while :
16154 do
16155   ac_lines=`grep -c . conftest.vals`
16156   # grep -c gives empty output for an empty file on some AIX systems.
16157   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
16158   # Write a limited-size here document to conftest.frag.
16159   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
16160   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
16161   echo 'CEOF
16162   sed -f conftest.frag conftest.in > conftest.out
16163   rm -f conftest.in
16164   mv conftest.out conftest.in
16165 ' >> $CONFIG_STATUS
16166   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
16167   rm -f conftest.vals
16168   mv conftest.tail conftest.vals
16169 done
16170 rm -f conftest.vals
16171
16172 cat >> $CONFIG_STATUS <<\EOF
16173   rm -f conftest.frag conftest.h
16174   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
16175   cat conftest.in >> conftest.h
16176   rm -f conftest.in
16177   if cmp -s $ac_file conftest.h 2>/dev/null; then
16178     echo "$ac_file is unchanged"
16179     rm -f conftest.h
16180   else
16181     # Remove last slash and all that follows it.  Not all systems have dirname.
16182       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
16183       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16184       # The file is in a subdirectory.
16185       test ! -d "$ac_dir" && mkdir "$ac_dir"
16186     fi
16187     rm -f $ac_file
16188     mv conftest.h $ac_file
16189   fi
16190 fi; done
16191
16192 EOF
16193 cat >> $CONFIG_STATUS <<EOF
16194
16195 EOF
16196 cat >> $CONFIG_STATUS <<\EOF
16197
16198 date > stamp-h
16199 echo Please \"make depend\" to build dependencies
16200
16201 exit 0
16202 EOF
16203 chmod +x $CONFIG_STATUS
16204 rm -fr confdefs* $ac_clean_files
16205 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
16206