]> git.sur5r.net Git - openldap/blob - configure
fix ITS#2923
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.478.2.10 2003/12/15 22:05:18 kurt Exp  
4
5 # This work is part of OpenLDAP Software <http://www.openldap.org/>.
6 #
7 # Copyright 1998-2004 The OpenLDAP Foundation.
8 # All rights reserved.
9 #
10 # Redistribution and use in source and binary forms, with or without
11 # modification, are permitted only as authorized by the OpenLDAP
12 # Public License.
13 #
14 # A copy of this license is available in the file LICENSE in the
15 # top-level directory of the distribution or, alternatively, at
16 # <http://www.OpenLDAP.org/license.html>.
17
18 echo "Copyright 1998-2004 The OpenLDAP Foundation. All rights reserved."
19 echo "  Restrictions apply, see COPYRIGHT and LICENSE files."
20
21 # Guess values for system-dependent variables and create Makefiles.
22 # Generated automatically using autoconf version 2.13.1 
23 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
24 #
25 # This configure script is free software; the Free Software Foundation
26 # gives unlimited permission to copy, distribute and modify it.
27
28 # Defaults:
29 ac_help=
30 ac_default_prefix=/usr/local
31 # Any additions from configure.in:
32 ac_default_prefix=/usr/local
33 ac_help="$ac_help
34   --with-subdir=DIR       change default subdirectory used for installs"
35 ac_help="$ac_help
36   --enable-debug          enable debugging [yes]"
37 ac_help="$ac_help
38   --enable-dynamic        enable linking built binaries with dynamic libs [no]"
39 ac_help="$ac_help
40   --enable-syslog         enable syslog support [auto]"
41 ac_help="$ac_help
42   --enable-proctitle      enable proctitle support [yes]"
43 ac_help="$ac_help
44   --enable-ipv6           enable IPv6 support [auto]"
45 ac_help="$ac_help
46   --enable-local          enable AF_LOCAL (AF_UNIX) socket support [auto]"
47 ac_help="$ac_help
48   --enable-x-compile      enable cross compiling [no]"
49 ac_help="$ac_help
50   --with-cyrus-sasl       with Cyrus SASL support [auto]"
51 ac_help="$ac_help
52   --with-fetch            with fetch(3) URL support [auto]"
53 ac_help="$ac_help
54   --with-threads          with threads [auto]"
55 ac_help="$ac_help
56   --with-tls              with TLS/SSL support [auto]"
57 ac_help="$ac_help
58   --with-yielding-select  with implicitly yielding select [auto]"
59 ac_help="$ac_help
60
61 SLAPD (Standalone LDAP Daemon) Options:"
62 ac_help="$ac_help
63   --enable-slapd          enable building slapd [yes]"
64 ac_help="$ac_help
65     --enable-aci          enable per-object ACIs (experimental) [no]"
66 ac_help="$ac_help
67     --enable-cleartext    enable cleartext passwords [yes]"
68 ac_help="$ac_help
69     --enable-crypt        enable crypt(3) passwords [no]"
70 ac_help="$ac_help
71     --enable-lmpasswd     enable LAN Manager passwords [no]"
72 ac_help="$ac_help
73     --enable-spasswd      enable (Cyrus) SASL password verification [no]"
74 ac_help="$ac_help
75     --enable-modules      enable dynamic module support [no]"
76 ac_help="$ac_help
77     --enable-rewrite      enable DN rewriting in back-ldap and back-meta [no]"
78 ac_help="$ac_help
79     --enable-rlookups     enable reverse lookups of client hostnames [no]"
80 ac_help="$ac_help
81     --enable-slapi        enable SLAPI support (experimental) [no]"
82 ac_help="$ac_help
83     --enable-slp          enable SLPv2 support [no]"
84 ac_help="$ac_help
85     --enable-wrappers     enable tcp wrapper support [no]"
86 ac_help="$ac_help
87     --enable-bdb          enable Berkeley DB backend [yes]"
88 ac_help="$ac_help
89     --with-bdb-module     module type static|dynamic [static]"
90 ac_help="$ac_help
91     --enable-dnssrv       enable dnssrv backend [no]"
92 ac_help="$ac_help
93     --with-dnssrv-module  module type static|dynamic [static]"
94 ac_help="$ac_help
95     --enable-hdb          enable Hierarchical DB backend [no]"
96 ac_help="$ac_help
97     --with-hdb-module     module type static|dynamic [static]"
98 ac_help="$ac_help
99     --enable-ldap         enable ldap backend [no]"
100 ac_help="$ac_help
101     --with-ldap-module    module type static|dynamic [static]"
102 ac_help="$ac_help
103     --enable-ldbm         enable ldbm backend [no]"
104 ac_help="$ac_help
105     --with-ldbm-api       with LDBM API auto|berkeley|bcompat|mdbm|gdbm [auto]"
106 ac_help="$ac_help
107     --with-ldbm-module    module type static|dynamic [static]"
108 ac_help="$ac_help
109     --with-ldbm-type      use LDBM type auto|btree|hash [auto]"
110 ac_help="$ac_help
111     --enable-meta         enable metadirectory backend [no]"
112 ac_help="$ac_help
113     --with-meta-module    module type static|dynamic [static]"
114 ac_help="$ac_help
115     --enable-monitor      enable monitor backend [yes]"
116 ac_help="$ac_help
117     --with-monitor-module module type static|dynamic [static]"
118 ac_help="$ac_help
119     --enable-null         enable null backend [no]"
120 ac_help="$ac_help
121     --with-null-module    module type static|dynamic [static]"
122 ac_help="$ac_help
123     --enable-passwd       enable passwd backend [no]"
124 ac_help="$ac_help
125     --with-passwd-module  module type static|dynamic [static]"
126 ac_help="$ac_help
127     --enable-perl         enable perl backend [no]"
128 ac_help="$ac_help
129     --with-perl-module    module type static|dynamic [static]"
130 ac_help="$ac_help
131     --enable-shell        enable shell backend [no]"
132 ac_help="$ac_help
133     --with-shell-module   module type static|dynamic [static]"
134 ac_help="$ac_help
135     --enable-sql          enable sql backend [no]"
136 ac_help="$ac_help
137     --with-sql-module     module type static|dynamic [static]"
138 ac_help="$ac_help
139
140 SLAPD Overlay Options:"
141 ac_help="$ac_help
142     --with-dyngroup       Dynamic Group overlay no|yes|mod [no]"
143 ac_help="$ac_help
144     --with-proxycache     Proxy Cache overlay no|yes|mod [no]"
145 ac_help="$ac_help
146
147 SLURPD (Replication Daemon) Options:"
148 ac_help="$ac_help
149   --enable-slurpd         enable building slurpd [auto]"
150 ac_help="$ac_help
151
152 Library Generation & Linking Options"
153 ac_help="$ac_help
154   --enable-static[=PKGS]  build static libraries [default=yes]"
155 ac_help="$ac_help
156   --enable-shared[=PKGS]  build shared libraries [default=yes]"
157 ac_help="$ac_help
158   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
159 ac_help="$ac_help
160   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
161
162 # Find the correct PATH separator.  Usually this is `:', but
163 # DJGPP uses `;' like DOS.
164 if test "X${PATH_SEPARATOR+set}" != Xset; then
165   UNAME=${UNAME-`uname 2>/dev/null`}
166   case X$UNAME in
167     *-DOS) lt_cv_sys_path_separator=';' ;;
168     *)     lt_cv_sys_path_separator=':' ;;
169   esac
170   PATH_SEPARATOR=$lt_cv_sys_path_separator
171 fi
172
173
174 # Check that we are running under the correct shell.
175 SHELL=${CONFIG_SHELL-/bin/sh}
176
177 case X$ECHO in
178 X*--fallback-echo)
179   # Remove one level of quotation (which was required for Make).
180   ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
181   ;;
182 esac
183
184 echo=${ECHO-echo}
185 if test "X$1" = X--no-reexec; then
186   # Discard the --no-reexec flag, and continue.
187   shift
188 elif test "X$1" = X--fallback-echo; then
189   # Avoid inline document here, it may be left over
190   :
191 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
192   # Yippee, $echo works!
193   :
194 else
195   # Restart under the correct shell.
196   exec $SHELL "$0" --no-reexec ${1+"$@"}
197 fi
198
199 if test "X$1" = X--fallback-echo; then
200   # used as fallback echo
201   shift
202   cat <<EOF
203
204 EOF
205   exit 0
206 fi
207
208 # The HP-UX ksh and POSIX shell print the target directory to stdout
209 # if CDPATH is set.
210 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
211
212 if test -z "$ECHO"; then
213 if test "X${echo_test_string+set}" != Xset; then
214 # find a string as large as possible, as long as the shell can cope with it
215   for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
216     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
217     if (echo_test_string="`eval $cmd`") 2>/dev/null &&
218        echo_test_string="`eval $cmd`" &&
219        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
220     then
221       break
222     fi
223   done
224 fi
225
226 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
227    echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
228    test "X$echo_testing_string" = "X$echo_test_string"; then
229   :
230 else
231   # The Solaris, AIX, and Digital Unix default echo programs unquote
232   # backslashes.  This makes it impossible to quote backslashes using
233   #   echo "$something" | sed 's/\\/\\\\/g'
234   #
235   # So, first we look for a working echo in the user's PATH.
236
237   IFS="${IFS=   }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
238   for dir in $PATH /usr/ucb; do
239     if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
240        test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
241        echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
242        test "X$echo_testing_string" = "X$echo_test_string"; then
243       echo="$dir/echo"
244       break
245     fi
246   done
247   IFS="$save_ifs"
248
249   if test "X$echo" = Xecho; then
250     # We didn't find a better echo, so look for alternatives.
251     if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
252        echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
253        test "X$echo_testing_string" = "X$echo_test_string"; then
254       # This shell has a builtin print -r that does the trick.
255       echo='print -r'
256     elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
257          test "X$CONFIG_SHELL" != X/bin/ksh; then
258       # If we have ksh, try running configure again with it.
259       ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
260       export ORIGINAL_CONFIG_SHELL
261       CONFIG_SHELL=/bin/ksh
262       export CONFIG_SHELL
263       exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
264     else
265       # Try using printf.
266       echo='printf %s\n'
267       if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
268          echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
269          test "X$echo_testing_string" = "X$echo_test_string"; then
270         # Cool, printf works
271         :
272       elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
273            test "X$echo_testing_string" = 'X\t' &&
274            echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
275            test "X$echo_testing_string" = "X$echo_test_string"; then
276         CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
277         export CONFIG_SHELL
278         SHELL="$CONFIG_SHELL"
279         export SHELL
280         echo="$CONFIG_SHELL $0 --fallback-echo"
281       elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
282            test "X$echo_testing_string" = 'X\t' &&
283            echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
284            test "X$echo_testing_string" = "X$echo_test_string"; then
285         echo="$CONFIG_SHELL $0 --fallback-echo"
286       else
287         # maybe with a smaller string...
288         prev=:
289
290         for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
291           if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
292           then
293             break
294           fi
295           prev="$cmd"
296         done
297
298         if test "$prev" != 'sed 50q "$0"'; then
299           echo_test_string=`eval $prev`
300           export echo_test_string
301           exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
302         else
303           # Oops.  We lost completely, so just stick with echo.
304           echo=echo
305         fi
306       fi
307     fi
308   fi
309 fi
310 fi
311
312 # Copy echo and quote the copy suitably for passing to libtool from
313 # the Makefile, instead of quoting the original, which is used later.
314 ECHO=$echo
315 if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
316    ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
317 fi
318
319
320 ac_help="$ac_help
321   --disable-libtool-lock  avoid locking (might break parallel builds)"
322 ac_help="$ac_help
323   --with-pic              try to use only PIC/non-PIC objects [default=use both]"
324 ac_help="$ac_help
325
326 See INSTALL file for further details."
327
328 # Initialize some variables set by options.
329 # The variables have the same names as the options, with
330 # dashes changed to underlines.
331 build=NONE
332 cache_file=./config.cache
333 exec_prefix=NONE
334 host=NONE
335 no_create=
336 nonopt=NONE
337 no_recursion=
338 prefix=NONE
339 program_prefix=NONE
340 program_suffix=NONE
341 program_transform_name=s,x,x,
342 silent=
343 site=
344 srcdir=
345 target=NONE
346 verbose=
347 x_includes=NONE
348 x_libraries=NONE
349 bindir='${exec_prefix}/bin'
350 sbindir='${exec_prefix}/sbin'
351 libexecdir='${exec_prefix}/libexec'
352 datadir='${prefix}/share'
353 sysconfdir='${prefix}/etc'
354 sharedstatedir='${prefix}/com'
355 localstatedir='${prefix}/var'
356 libdir='${exec_prefix}/lib'
357 includedir='${prefix}/include'
358 oldincludedir='/usr/include'
359 infodir='${prefix}/info'
360 mandir='${prefix}/man'
361
362 # Initialize some other variables.
363 subdirs=
364 MFLAGS= MAKEFLAGS=
365 SHELL=${CONFIG_SHELL-/bin/sh}
366 # Maximum number of lines to put in a shell here document.
367 ac_max_here_lines=12
368
369 ac_prev=
370 for ac_option
371 do
372
373   # If the previous option needs an argument, assign it.
374   if test -n "$ac_prev"; then
375     eval "$ac_prev=\$ac_option"
376     ac_prev=
377     continue
378   fi
379
380   case "$ac_option" in
381   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
382   *) ac_optarg= ;;
383   esac
384
385   # Accept the important Cygnus configure options, so we can diagnose typos.
386
387   case "$ac_option" in
388
389   -bindir | --bindir | --bindi | --bind | --bin | --bi)
390     ac_prev=bindir ;;
391   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
392     bindir="$ac_optarg" ;;
393
394   -build | --build | --buil | --bui | --bu)
395     ac_prev=build ;;
396   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
397     build="$ac_optarg" ;;
398
399   -cache-file | --cache-file | --cache-fil | --cache-fi \
400   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
401     ac_prev=cache_file ;;
402   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
403   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
404     cache_file="$ac_optarg" ;;
405
406   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
407     ac_prev=datadir ;;
408   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
409   | --da=*)
410     datadir="$ac_optarg" ;;
411
412   -disable-* | --disable-*)
413     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
414     # Reject names that are not valid shell variable names.
415     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
416       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
417     fi
418     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
419     eval "enable_${ac_feature}=no" ;;
420
421   -enable-* | --enable-*)
422     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
423     # Reject names that are not valid shell variable names.
424     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
425       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
426     fi
427     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
428     case "$ac_option" in
429       *=*) ;;
430       *) ac_optarg=yes ;;
431     esac
432     eval "enable_${ac_feature}='$ac_optarg'" ;;
433
434   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
435   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
436   | --exec | --exe | --ex)
437     ac_prev=exec_prefix ;;
438   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
439   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
440   | --exec=* | --exe=* | --ex=*)
441     exec_prefix="$ac_optarg" ;;
442
443   -gas | --gas | --ga | --g)
444     # Obsolete; use --with-gas.
445     with_gas=yes ;;
446
447   -help | --help | --hel | --he)
448     # Omit some internal or obsolete options to make the list less imposing.
449     # This message is too long to be a string in the A/UX 3.1 sh.
450     cat << EOF
451 Usage: configure [options] [host]
452 Options: [defaults in brackets after descriptions]
453 Configuration:
454   --cache-file=FILE       cache test results in FILE
455   --help                  print this message
456   --no-create             do not create output files
457   --quiet, --silent       do not print \`checking...' messages
458   --version               print the version of autoconf that created configure
459 Directory and file names:
460   --prefix=PREFIX         install architecture-independent files in PREFIX
461                           [$ac_default_prefix]
462   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
463                           [same as prefix]
464   --bindir=DIR            user executables in DIR [EPREFIX/bin]
465   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
466   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
467   --datadir=DIR           read-only architecture-independent data in DIR
468                           [PREFIX/share]
469   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
470   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
471                           [PREFIX/com]
472   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
473   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
474   --includedir=DIR        C header files in DIR [PREFIX/include]
475   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
476   --infodir=DIR           info documentation in DIR [PREFIX/info]
477   --mandir=DIR            man documentation in DIR [PREFIX/man]
478   --srcdir=DIR            find the sources in DIR [configure dir or ..]
479   --program-prefix=PREFIX prepend PREFIX to installed program names
480   --program-suffix=SUFFIX append SUFFIX to installed program names
481   --program-transform-name=PROGRAM
482                           run sed PROGRAM on installed program names
483 EOF
484     cat << EOF
485 Host type:
486   --build=BUILD           configure for building on BUILD [BUILD=HOST]
487   --host=HOST             configure for HOST [guessed]
488   --target=TARGET         configure for TARGET [TARGET=HOST]
489 Features and packages:
490   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
491   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
492   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
493   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
494   --x-includes=DIR        X include files are in DIR
495   --x-libraries=DIR       X library files are in DIR
496 EOF
497     if test -n "$ac_help"; then
498       echo "--enable and --with options recognized:$ac_help"
499     fi
500     exit 0 ;;
501
502   -host | --host | --hos | --ho)
503     ac_prev=host ;;
504   -host=* | --host=* | --hos=* | --ho=*)
505     host="$ac_optarg" ;;
506
507   -includedir | --includedir | --includedi | --included | --include \
508   | --includ | --inclu | --incl | --inc)
509     ac_prev=includedir ;;
510   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
511   | --includ=* | --inclu=* | --incl=* | --inc=*)
512     includedir="$ac_optarg" ;;
513
514   -infodir | --infodir | --infodi | --infod | --info | --inf)
515     ac_prev=infodir ;;
516   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
517     infodir="$ac_optarg" ;;
518
519   -libdir | --libdir | --libdi | --libd)
520     ac_prev=libdir ;;
521   -libdir=* | --libdir=* | --libdi=* | --libd=*)
522     libdir="$ac_optarg" ;;
523
524   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
525   | --libexe | --libex | --libe)
526     ac_prev=libexecdir ;;
527   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
528   | --libexe=* | --libex=* | --libe=*)
529     libexecdir="$ac_optarg" ;;
530
531   -localstatedir | --localstatedir | --localstatedi | --localstated \
532   | --localstate | --localstat | --localsta | --localst \
533   | --locals | --local | --loca | --loc | --lo)
534     ac_prev=localstatedir ;;
535   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
536   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
537   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
538     localstatedir="$ac_optarg" ;;
539
540   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
541     ac_prev=mandir ;;
542   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
543     mandir="$ac_optarg" ;;
544
545   -nfp | --nfp | --nf)
546     # Obsolete; use --without-fp.
547     with_fp=no ;;
548
549   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
550   | --no-cr | --no-c)
551     no_create=yes ;;
552
553   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
554   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
555     no_recursion=yes ;;
556
557   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
558   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
559   | --oldin | --oldi | --old | --ol | --o)
560     ac_prev=oldincludedir ;;
561   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
562   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
563   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
564     oldincludedir="$ac_optarg" ;;
565
566   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
567     ac_prev=prefix ;;
568   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
569     prefix="$ac_optarg" ;;
570
571   -program-prefix | --program-prefix | --program-prefi | --program-pref \
572   | --program-pre | --program-pr | --program-p)
573     ac_prev=program_prefix ;;
574   -program-prefix=* | --program-prefix=* | --program-prefi=* \
575   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
576     program_prefix="$ac_optarg" ;;
577
578   -program-suffix | --program-suffix | --program-suffi | --program-suff \
579   | --program-suf | --program-su | --program-s)
580     ac_prev=program_suffix ;;
581   -program-suffix=* | --program-suffix=* | --program-suffi=* \
582   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
583     program_suffix="$ac_optarg" ;;
584
585   -program-transform-name | --program-transform-name \
586   | --program-transform-nam | --program-transform-na \
587   | --program-transform-n | --program-transform- \
588   | --program-transform | --program-transfor \
589   | --program-transfo | --program-transf \
590   | --program-trans | --program-tran \
591   | --progr-tra | --program-tr | --program-t)
592     ac_prev=program_transform_name ;;
593   -program-transform-name=* | --program-transform-name=* \
594   | --program-transform-nam=* | --program-transform-na=* \
595   | --program-transform-n=* | --program-transform-=* \
596   | --program-transform=* | --program-transfor=* \
597   | --program-transfo=* | --program-transf=* \
598   | --program-trans=* | --program-tran=* \
599   | --progr-tra=* | --program-tr=* | --program-t=*)
600     program_transform_name="$ac_optarg" ;;
601
602   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
603   | -silent | --silent | --silen | --sile | --sil)
604     silent=yes ;;
605
606   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
607     ac_prev=sbindir ;;
608   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
609   | --sbi=* | --sb=*)
610     sbindir="$ac_optarg" ;;
611
612   -sharedstatedir | --sharedstatedir | --sharedstatedi \
613   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
614   | --sharedst | --shareds | --shared | --share | --shar \
615   | --sha | --sh)
616     ac_prev=sharedstatedir ;;
617   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
618   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
619   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
620   | --sha=* | --sh=*)
621     sharedstatedir="$ac_optarg" ;;
622
623   -site | --site | --sit)
624     ac_prev=site ;;
625   -site=* | --site=* | --sit=*)
626     site="$ac_optarg" ;;
627
628   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
629     ac_prev=srcdir ;;
630   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
631     srcdir="$ac_optarg" ;;
632
633   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
634   | --syscon | --sysco | --sysc | --sys | --sy)
635     ac_prev=sysconfdir ;;
636   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
637   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
638     sysconfdir="$ac_optarg" ;;
639
640   -target | --target | --targe | --targ | --tar | --ta | --t)
641     ac_prev=target ;;
642   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
643     target="$ac_optarg" ;;
644
645   -v | -verbose | --verbose | --verbos | --verbo | --verb)
646     verbose=yes ;;
647
648   -version | --version | --versio | --versi | --vers)
649     echo "configure generated by autoconf version 2.13.1"
650     exit 0 ;;
651
652   -with-* | --with-*)
653     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
654     # Reject names that are not valid shell variable names.
655     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
656       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
657     fi
658     ac_package=`echo $ac_package| sed 's/-/_/g'`
659     case "$ac_option" in
660       *=*) ;;
661       *) ac_optarg=yes ;;
662     esac
663     eval "with_${ac_package}='$ac_optarg'" ;;
664
665   -without-* | --without-*)
666     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
667     # Reject names that are not valid shell variable names.
668     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
669       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
670     fi
671     ac_package=`echo $ac_package| sed 's/-/_/g'`
672     eval "with_${ac_package}=no" ;;
673
674   --x)
675     # Obsolete; use --with-x.
676     with_x=yes ;;
677
678   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
679   | --x-incl | --x-inc | --x-in | --x-i)
680     ac_prev=x_includes ;;
681   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
682   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
683     x_includes="$ac_optarg" ;;
684
685   -x-libraries | --x-libraries | --x-librarie | --x-librari \
686   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
687     ac_prev=x_libraries ;;
688   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
689   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
690     x_libraries="$ac_optarg" ;;
691
692   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
693     ;;
694
695   *)
696     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
697       echo "configure: warning: $ac_option: invalid host type" 1>&2
698     fi
699     if test "x$nonopt" != xNONE; then
700       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
701     fi
702     nonopt="$ac_option"
703     ;;
704
705   esac
706 done
707
708 if test -n "$ac_prev"; then
709   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
710 fi
711
712 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
713
714 # File descriptor usage:
715 # 0 standard input
716 # 1 file creation
717 # 2 errors and warnings
718 # 3 some systems may open it to /dev/tty
719 # 4 used on the Kubota Titan
720 # 6 checking for... messages and results
721 # 5 compiler messages saved in config.log
722 if test "$silent" = yes; then
723   exec 6>/dev/null
724 else
725   exec 6>&1
726 fi
727 exec 5>./config.log
728
729 echo "\
730 This file contains any messages produced by compilers while
731 running configure, to aid debugging if configure makes a mistake.
732 " 1>&5
733
734 # Strip out --no-create and --no-recursion so they do not pile up.
735 # Also quote any args containing shell metacharacters.
736 ac_configure_args=
737 for ac_arg
738 do
739   case "$ac_arg" in
740   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
741   | --no-cr | --no-c) ;;
742   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
743   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
744   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
745   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
746   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
747   esac
748 done
749
750 # NLS nuisances.
751 # Only set these to C if already set.  These must not be set unconditionally
752 # because not all systems understand e.g. LANG=C (notably SCO).
753 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
754 # Non-C LC_CTYPE values break the ctype check.
755 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
756 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
757 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
758 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
759
760 # confdefs.h avoids OS command line length limits that DEFS can exceed.
761 rm -rf conftest* confdefs.h
762 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
763 echo > confdefs.h
764
765 # A filename unique to this package, relative to the directory that
766 # configure is in, which we can look for to find out if srcdir is correct.
767 ac_unique_file=build/version.sh
768
769 # Find the source files, if location was not specified.
770 if test -z "$srcdir"; then
771   ac_srcdir_defaulted=yes
772   # Try the directory containing this script, then its parent.
773   ac_prog=$0
774   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
775   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
776   srcdir=$ac_confdir
777   if test ! -r $srcdir/$ac_unique_file; then
778     srcdir=..
779   fi
780 else
781   ac_srcdir_defaulted=no
782 fi
783 if test ! -r $srcdir/$ac_unique_file; then
784   if test "$ac_srcdir_defaulted" = yes; then
785     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
786   else
787     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
788   fi
789 fi
790 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
791
792 # Prefer explicitly selected file to automatically selected ones.
793 if test -z "$CONFIG_SITE"; then
794   if test "x$prefix" != xNONE; then
795     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
796   else
797     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
798   fi
799 fi
800 for ac_site_file in $CONFIG_SITE; do
801   if test -r "$ac_site_file"; then
802     echo "loading site script $ac_site_file"
803     . "$ac_site_file"
804   fi
805 done
806
807
808 ac_ext=c
809 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
810 ac_cpp='$CPP $CPPFLAGS'
811 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
812 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
813 cross_compiling=$ac_cv_prog_cc_cross
814
815 ac_exeext=
816 ac_objext=o
817 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
818   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
819   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
820     ac_n= ac_c='
821 ' ac_t='        '
822   else
823     ac_n=-n ac_c= ac_t=
824   fi
825 else
826   ac_n= ac_c='\c' ac_t=
827 fi
828
829
830 # set unset (borrowed from autoconf 2.49c)
831 if (OL_FOO=OL_FOO; unset OL_FOO) >/dev/null 2>&1; then
832   ol_unset=unset
833 else
834   ol_unset=false
835 fi
836 # unset CDPATH
837 $ol_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
838
839 ac_aux_dir=
840 for ac_dir in build $srcdir/build; do
841   if test -f $ac_dir/install-sh; then
842     ac_aux_dir=$ac_dir
843     ac_install_sh="$ac_aux_dir/install-sh -c"
844     break
845   elif test -f $ac_dir/install.sh; then
846     ac_aux_dir=$ac_dir
847     ac_install_sh="$ac_aux_dir/install.sh -c"
848     break
849   elif test -f $ac_dir/shtool; then
850     ac_aux_dir=$ac_dir
851     ac_install_sh="$ac_aux_dir/shtool install -c"
852     break
853   fi
854 done
855 if test -z "$ac_aux_dir"; then
856   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
857 fi
858 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
859 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
860 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
861
862 eval `$ac_aux_dir/version.sh`
863 if test -z "$OL_STRING"; then
864         { echo "configure: error: could not determine version" 1>&2; exit 1; }
865 fi
866
867 if test -f "$ac_aux_dir/shtool" -a ! -d $ac_aux_dir/shtool; then
868         ac_cv_shtool="$ac_aux_dir/shtool"
869 else
870         { echo "configure: error: no shtool found in $ac_aux_dir" 1>&2; exit 1; }
871 fi
872
873 SHTOOL="$ac_cv_shtool"
874
875 TB="`$SHTOOL echo -e '%B' 2>/dev/null`"
876 TN="`$SHTOOL echo -e '%b' 2>/dev/null`"
877
878 OPENLDAP_CVS=""
879 if test -d $ac_aux_dir/CVS; then
880         OPENLDAP_CVS="(from CVS sources) "
881 fi
882
883 echo "Configuring ${TB}${OL_STRING}${TN} ${OPENLDAP_CVS}..."
884
885
886 echo $ac_n "checking host system type""... $ac_c" 1>&6
887 echo "configure:888: checking host system type" >&5
888 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
889
890 # Make sure we can run config.sub.
891   if $ac_config_sub sun4 >/dev/null 2>&1; then :
892     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
893   fi
894
895   ac_cv_host_alias=$host
896   case "$ac_cv_host_alias" in
897   NONE)
898     case $nonopt in
899     NONE)
900       if ac_cv_host_alias=`$ac_config_guess`; then :
901       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
902       fi ;;
903     *) ac_cv_host_alias=$nonopt ;;
904     esac ;;
905   esac
906
907   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
908   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
909   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
910   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
911 else
912   echo $ac_n "(cached) $ac_c" 1>&6
913 fi
914
915 echo "$ac_t""$ac_cv_host" 1>&6
916
917 host=$ac_cv_host
918 host_alias=$ac_cv_host_alias
919 host_cpu=$ac_cv_host_cpu
920 host_vendor=$ac_cv_host_vendor
921 host_os=$ac_cv_host_os
922
923
924
925
926
927 echo $ac_n "checking target system type""... $ac_c" 1>&6
928 echo "configure:929: checking target system type" >&5
929 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
930
931 # Make sure we can run config.sub.
932   if $ac_config_sub sun4 >/dev/null 2>&1; then :
933     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
934   fi
935
936   ac_cv_target_alias=$target
937   case "$ac_cv_target_alias" in
938   NONE)
939     case $nonopt in
940     NONE)
941       ac_cv_target_alias=$host_alias ;;
942
943     *) ac_cv_target_alias=$nonopt ;;
944     esac ;;
945   esac
946
947   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
948   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
949   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
950   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
951 else
952   echo $ac_n "(cached) $ac_c" 1>&6
953 fi
954
955 echo "$ac_t""$ac_cv_target" 1>&6
956
957 target=$ac_cv_target
958 target_alias=$ac_cv_target_alias
959 target_cpu=$ac_cv_target_cpu
960 target_vendor=$ac_cv_target_vendor
961 target_os=$ac_cv_target_os
962
963
964
965
966
967 echo $ac_n "checking build system type""... $ac_c" 1>&6
968 echo "configure:969: checking build system type" >&5
969 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
970
971 # Make sure we can run config.sub.
972   if $ac_config_sub sun4 >/dev/null 2>&1; then :
973     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
974   fi
975
976   ac_cv_build_alias=$build
977   case "$ac_cv_build_alias" in
978   NONE)
979     case $nonopt in
980     NONE)
981       ac_cv_build_alias=$host_alias ;;
982
983     *) ac_cv_build_alias=$nonopt ;;
984     esac ;;
985   esac
986
987   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
988   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
989   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
990   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
991 else
992   echo $ac_n "(cached) $ac_c" 1>&6
993 fi
994
995 echo "$ac_t""$ac_cv_build" 1>&6
996
997 build=$ac_cv_build
998 build_alias=$ac_cv_build_alias
999 build_cpu=$ac_cv_build_cpu
1000 build_vendor=$ac_cv_build_vendor
1001 build_os=$ac_cv_build_os
1002
1003
1004
1005
1006
1007 # Do some error checking and defaulting for the host and target type.
1008 # The inputs are:
1009 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
1010 #
1011 # The rules are:
1012 # 1. You are not allowed to specify --host, --target, and nonopt at the
1013 #    same time.
1014 # 2. Host defaults to nonopt.
1015 # 3. If nonopt is not specified, then host defaults to the current host,
1016 #    as determined by config.guess.
1017 # 4. Target and build default to nonopt.
1018 # 5. If nonopt is not specified, then target and build default to host.
1019
1020 # The aliases save the names the user supplied, while $host etc.
1021 # will get canonicalized.
1022 case $host---$target---$nonopt in
1023 NONE---*---* | *---NONE---* | *---*---NONE) ;;
1024 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
1025 esac
1026
1027 test "$host_alias" != "$target_alias" &&
1028   test "$program_prefix$program_suffix$program_transform_name" = \
1029     NONENONEs,x,x, &&
1030   program_prefix=${target_alias}-
1031
1032
1033 # Find a good install program.  We prefer a C program (faster),
1034 # so one script is as good as another.  But avoid the broken or
1035 # incompatible versions:
1036 # SysV /etc/install, /usr/sbin/install
1037 # SunOS /usr/etc/install
1038 # IRIX /sbin/install
1039 # AIX /bin/install
1040 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1041 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1042 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1043 # ./install, which can be erroneously created by make from ./install.sh.
1044 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1045 echo "configure:1046: checking for a BSD compatible install" >&5
1046 if test -z "$INSTALL"; then
1047 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
1048   echo $ac_n "(cached) $ac_c" 1>&6
1049 else
1050     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1051   for ac_dir in $PATH; do
1052     # Account for people who put trailing slashes in PATH elements.
1053     case "$ac_dir/" in
1054     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1055     *)
1056       # OSF1 and SCO ODT 3.0 have their own names for install.
1057       # Don't use installbsd from OSF since it installs stuff as root
1058       # by default.
1059       for ac_prog in ginstall scoinst install; do
1060         if test -f $ac_dir/$ac_prog; then
1061           if test $ac_prog = install &&
1062             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1063             # AIX install.  It has an incompatible calling convention.
1064             :
1065           elif test $ac_prog = install &&
1066             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
1067             # program-specific install script used by HP pwplus--don't use.
1068             :
1069           else
1070             ac_cv_path_install="$ac_dir/$ac_prog -c"
1071             break 2
1072           fi
1073         fi
1074       done
1075       ;;
1076     esac
1077   done
1078   IFS="$ac_save_IFS"
1079
1080 fi
1081   if test "${ac_cv_path_install+set}" = set; then
1082     INSTALL="$ac_cv_path_install"
1083   else
1084     # As a last resort, use the slow shell script.  We don't cache a
1085     # path for INSTALL within a source directory, because that will
1086     # break other packages using the cache if that directory is
1087     # removed, or if the path is relative.
1088     INSTALL="$ac_install_sh"
1089   fi
1090 fi
1091 echo "$ac_t""$INSTALL" 1>&6
1092
1093 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1094 # It thinks the first close brace ends the variable substitution.
1095 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1096
1097 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
1098
1099 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1100
1101 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
1102 echo "configure:1103: checking whether build environment is sane" >&5
1103 # Just in case
1104 sleep 1
1105 echo timestamp > conftestfile
1106 # Do `set' in a subshell so we don't clobber the current shell's
1107 # arguments.  Must try -L first in case configure is actually a
1108 # symlink; some systems play weird games with the mod time of symlinks
1109 # (eg FreeBSD returns the mod time of the symlink's containing
1110 # directory).
1111 if (
1112    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1113    if test "$*" = "X"; then
1114       # -L didn't work.
1115       set X `ls -t $srcdir/configure conftestfile`
1116    fi
1117    if test "$*" != "X $srcdir/configure conftestfile" \
1118       && test "$*" != "X conftestfile $srcdir/configure"; then
1119
1120       # If neither matched, then we have a broken ls.  This can happen
1121       # if, for instance, CONFIG_SHELL is bash and it inherits a
1122       # broken ls alias from the environment.  This has actually
1123       # happened.  Such a system could not be considered "sane".
1124       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
1125 alias in your environment" 1>&2; exit 1; }
1126    fi
1127
1128    test "$2" = conftestfile
1129    )
1130 then
1131    # Ok.
1132    :
1133 else
1134    { echo "configure: error: newly created file is older than distributed files!
1135 Check your system clock" 1>&2; exit 1; }
1136 fi
1137 rm -f conftest*
1138 echo "$ac_t""yes" 1>&6
1139 if test "$program_transform_name" = s,x,x,; then
1140   program_transform_name=
1141 else
1142   # Double any \ or $.  echo might interpret backslashes.
1143   cat <<\EOF_SED > conftestsed
1144 s,\\,\\\\,g; s,\$,$$,g
1145 EOF_SED
1146   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
1147   rm -f conftestsed
1148 fi
1149 test "$program_prefix" != NONE &&
1150   program_transform_name="s,^,${program_prefix},;$program_transform_name"
1151 # Use a double $ so make ignores it.
1152 test "$program_suffix" != NONE &&
1153   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
1154
1155 # sed with no file args requires a program.
1156 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
1157
1158 for ac_prog in mawk gawk nawk awk
1159 do
1160 # Extract the first word of "$ac_prog", so it can be a program name with args.
1161 set dummy $ac_prog; ac_word=$2
1162 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1163 echo "configure:1164: checking for $ac_word" >&5
1164 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
1165   echo $ac_n "(cached) $ac_c" 1>&6
1166 else
1167   if test -n "$AWK"; then
1168   ac_cv_prog_AWK="$AWK" # Let the user override the test.
1169 else
1170   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1171   ac_dummy="$PATH"
1172   for ac_dir in $ac_dummy; do
1173     test -z "$ac_dir" && ac_dir=.
1174     if test -f $ac_dir/$ac_word; then
1175       ac_cv_prog_AWK="$ac_prog"
1176       break
1177     fi
1178   done
1179   IFS="$ac_save_ifs"
1180 fi
1181 fi
1182 AWK="$ac_cv_prog_AWK"
1183 if test -n "$AWK"; then
1184   echo "$ac_t""$AWK" 1>&6
1185 else
1186   echo "$ac_t""no" 1>&6
1187 fi
1188
1189 test -n "$AWK" && break
1190 done
1191
1192 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1193 echo "configure:1194: checking whether ${MAKE-make} sets \${MAKE}" >&5
1194 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1195 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1196   echo $ac_n "(cached) $ac_c" 1>&6
1197 else
1198   cat > conftestmake <<\EOF
1199 all:
1200         @echo 'ac_maketemp="${MAKE}"'
1201 EOF
1202 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1203 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1204 if test -n "$ac_maketemp"; then
1205   eval ac_cv_prog_make_${ac_make}_set=yes
1206 else
1207   eval ac_cv_prog_make_${ac_make}_set=no
1208 fi
1209 rm -f conftestmake
1210 fi
1211 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1212   echo "$ac_t""yes" 1>&6
1213   SET_MAKE=
1214 else
1215   echo "$ac_t""no" 1>&6
1216   SET_MAKE="MAKE=${MAKE-make}"
1217 fi
1218
1219
1220
1221 PACKAGE=$OL_PACKAGE
1222
1223 VERSION=$OL_VERSION
1224
1225 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1226   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
1227 fi
1228
1229
1230
1231 missing_dir=`cd $ac_aux_dir && pwd`
1232 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1233 echo "configure:1234: checking for working aclocal" >&5
1234 # Run test in a subshell; some versions of sh will print an error if
1235 # an executable is not found, even if stderr is redirected.
1236 # Redirect stdin to placate older versions of autoconf.  Sigh.
1237 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1238    ACLOCAL=aclocal
1239    echo "$ac_t""found" 1>&6
1240 else
1241    ACLOCAL="$missing_dir/missing aclocal"
1242    echo "$ac_t""missing" 1>&6
1243 fi
1244
1245 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1246 echo "configure:1247: checking for working autoconf" >&5
1247 # Run test in a subshell; some versions of sh will print an error if
1248 # an executable is not found, even if stderr is redirected.
1249 # Redirect stdin to placate older versions of autoconf.  Sigh.
1250 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1251    AUTOCONF=autoconf
1252    echo "$ac_t""found" 1>&6
1253 else
1254    AUTOCONF="$missing_dir/missing autoconf"
1255    echo "$ac_t""missing" 1>&6
1256 fi
1257
1258 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1259 echo "configure:1260: checking for working automake" >&5
1260 # Run test in a subshell; some versions of sh will print an error if
1261 # an executable is not found, even if stderr is redirected.
1262 # Redirect stdin to placate older versions of autoconf.  Sigh.
1263 if (automake --version) < /dev/null > /dev/null 2>&1; then
1264    AUTOMAKE=automake
1265    echo "$ac_t""found" 1>&6
1266 else
1267    AUTOMAKE="$missing_dir/missing automake"
1268    echo "$ac_t""missing" 1>&6
1269 fi
1270
1271 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1272 echo "configure:1273: checking for working autoheader" >&5
1273 # Run test in a subshell; some versions of sh will print an error if
1274 # an executable is not found, even if stderr is redirected.
1275 # Redirect stdin to placate older versions of autoconf.  Sigh.
1276 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1277    AUTOHEADER=autoheader
1278    echo "$ac_t""found" 1>&6
1279 else
1280    AUTOHEADER="$missing_dir/missing autoheader"
1281    echo "$ac_t""missing" 1>&6
1282 fi
1283
1284 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1285 echo "configure:1286: checking for working makeinfo" >&5
1286 # Run test in a subshell; some versions of sh will print an error if
1287 # an executable is not found, even if stderr is redirected.
1288 # Redirect stdin to placate older versions of autoconf.  Sigh.
1289 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1290    MAKEINFO=makeinfo
1291    echo "$ac_t""found" 1>&6
1292 else
1293    MAKEINFO="$missing_dir/missing makeinfo"
1294    echo "$ac_t""missing" 1>&6
1295 fi
1296
1297 install_sh="$missing_dir/install-sh"
1298 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1299
1300 for ac_prog in gnutar gtar tar
1301 do
1302 # Extract the first word of "$ac_prog", so it can be a program name with args.
1303 set dummy $ac_prog; ac_word=$2
1304 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1305 echo "configure:1306: checking for $ac_word" >&5
1306 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1307   echo $ac_n "(cached) $ac_c" 1>&6
1308 else
1309   if test -n "$AMTAR"; then
1310   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1311 else
1312   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1313   ac_dummy="$PATH"
1314   for ac_dir in $ac_dummy; do
1315     test -z "$ac_dir" && ac_dir=.
1316     if test -f $ac_dir/$ac_word; then
1317       ac_cv_prog_AMTAR="$ac_prog"
1318       break
1319     fi
1320   done
1321   IFS="$ac_save_ifs"
1322 fi
1323 fi
1324 AMTAR="$ac_cv_prog_AMTAR"
1325 if test -n "$AMTAR"; then
1326   echo "$ac_t""$AMTAR" 1>&6
1327 else
1328   echo "$ac_t""no" 1>&6
1329 fi
1330
1331 test -n "$AMTAR" && break
1332 done
1333
1334
1335 AMTARFLAGS=
1336 if test -n "$AMTAR"; then
1337   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1338         AMTARFLAGS=o
1339   fi
1340 fi
1341
1342 cat >> confdefs.h <<EOF
1343 #define OPENLDAP_PACKAGE "$PACKAGE"
1344 EOF
1345
1346 cat >> confdefs.h <<EOF
1347 #define OPENLDAP_VERSION "$VERSION"
1348 EOF
1349
1350
1351 cat >> confdefs.h <<EOF
1352 #define LDAP_VENDOR_VERSION $OL_API_INC
1353 EOF
1354
1355 cat >> confdefs.h <<EOF
1356 #define LDAP_VENDOR_VERSION_MAJOR $OL_MAJOR
1357 EOF
1358
1359 cat >> confdefs.h <<EOF
1360 #define LDAP_VENDOR_VERSION_MINOR $OL_MINOR
1361 EOF
1362
1363 cat >> confdefs.h <<EOF
1364 #define LDAP_VENDOR_VERSION_PATCH $OL_PATCH
1365 EOF
1366
1367
1368 OPENLDAP_LIBVERSION=$OL_API_LIB
1369
1370 OPENLDAP_RELEASE_DATE="$OL_RELEASE_DATE"
1371
1372
1373
1374 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1375 echo "configure:1376: checking configure arguments" >&5
1376
1377
1378 top_builddir=`pwd`
1379
1380 ldap_subdir="/openldap"
1381
1382 # Check whether --with-subdir or --without-subdir was given.
1383 if test "${with_subdir+set}" = set; then
1384   withval="$with_subdir"
1385   case "$withval" in
1386         no) ldap_subdir=""
1387                 ;;
1388         yes)
1389                 ;;
1390         /*|\\*)
1391                 ldap_subdir="$withval"
1392                 ;;
1393         *)
1394                 ldap_subdir="/$withval"
1395                 ;;
1396 esac
1397
1398 fi
1399
1400
1401 # OpenLDAP --enable-debug
1402         # Check whether --enable-debug or --disable-debug was given.
1403 if test "${enable_debug+set}" = set; then
1404   enableval="$enable_debug"
1405   
1406         ol_arg=invalid
1407         for ol_val in auto yes no ; do
1408                 if test "$enableval" = "$ol_val" ; then
1409                         ol_arg="$ol_val"
1410                 fi
1411         done
1412         if test "$ol_arg" = "invalid" ; then
1413                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1414         fi
1415         ol_enable_debug="$ol_arg"
1416
1417 else
1418         ol_enable_debug="yes"
1419 fi
1420 # end --enable-debug
1421 # OpenLDAP --enable-dynamic
1422         # Check whether --enable-dynamic or --disable-dynamic was given.
1423 if test "${enable_dynamic+set}" = set; then
1424   enableval="$enable_dynamic"
1425   
1426         ol_arg=invalid
1427         for ol_val in auto yes no ; do
1428                 if test "$enableval" = "$ol_val" ; then
1429                         ol_arg="$ol_val"
1430                 fi
1431         done
1432         if test "$ol_arg" = "invalid" ; then
1433                 { echo "configure: error: bad value $enableval for --enable-dynamic" 1>&2; exit 1; }
1434         fi
1435         ol_enable_dynamic="$ol_arg"
1436
1437 else
1438         ol_enable_dynamic="no"
1439 fi
1440 # end --enable-dynamic
1441 # OpenLDAP --enable-syslog
1442         # Check whether --enable-syslog or --disable-syslog was given.
1443 if test "${enable_syslog+set}" = set; then
1444   enableval="$enable_syslog"
1445   
1446         ol_arg=invalid
1447         for ol_val in auto yes no ; do
1448                 if test "$enableval" = "$ol_val" ; then
1449                         ol_arg="$ol_val"
1450                 fi
1451         done
1452         if test "$ol_arg" = "invalid" ; then
1453                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1454         fi
1455         ol_enable_syslog="$ol_arg"
1456
1457 else
1458         ol_enable_syslog="auto"
1459 fi
1460 # end --enable-syslog
1461 # OpenLDAP --enable-proctitle
1462         # Check whether --enable-proctitle or --disable-proctitle was given.
1463 if test "${enable_proctitle+set}" = set; then
1464   enableval="$enable_proctitle"
1465   
1466         ol_arg=invalid
1467         for ol_val in auto yes no ; do
1468                 if test "$enableval" = "$ol_val" ; then
1469                         ol_arg="$ol_val"
1470                 fi
1471         done
1472         if test "$ol_arg" = "invalid" ; then
1473                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1474         fi
1475         ol_enable_proctitle="$ol_arg"
1476
1477 else
1478         ol_enable_proctitle="yes"
1479 fi
1480 # end --enable-proctitle
1481 ol_enable_referrals=${ol_enable_referrals-no}
1482 ol_enable_kbind=${ol_enable_kbind-no}
1483 # OpenLDAP --enable-ipv6
1484         # Check whether --enable-ipv6 or --disable-ipv6 was given.
1485 if test "${enable_ipv6+set}" = set; then
1486   enableval="$enable_ipv6"
1487   
1488         ol_arg=invalid
1489         for ol_val in auto yes no ; do
1490                 if test "$enableval" = "$ol_val" ; then
1491                         ol_arg="$ol_val"
1492                 fi
1493         done
1494         if test "$ol_arg" = "invalid" ; then
1495                 { echo "configure: error: bad value $enableval for --enable-ipv6" 1>&2; exit 1; }
1496         fi
1497         ol_enable_ipv6="$ol_arg"
1498
1499 else
1500         ol_enable_ipv6="auto"
1501 fi
1502 # end --enable-ipv6
1503 # OpenLDAP --enable-local
1504         # Check whether --enable-local or --disable-local was given.
1505 if test "${enable_local+set}" = set; then
1506   enableval="$enable_local"
1507   
1508         ol_arg=invalid
1509         for ol_val in auto yes no ; do
1510                 if test "$enableval" = "$ol_val" ; then
1511                         ol_arg="$ol_val"
1512                 fi
1513         done
1514         if test "$ol_arg" = "invalid" ; then
1515                 { echo "configure: error: bad value $enableval for --enable-local" 1>&2; exit 1; }
1516         fi
1517         ol_enable_local="$ol_arg"
1518
1519 else
1520         ol_enable_local="auto"
1521 fi
1522 # end --enable-local
1523 # OpenLDAP --enable-x_compile
1524         # Check whether --enable-x_compile or --disable-x_compile was given.
1525 if test "${enable_x_compile+set}" = set; then
1526   enableval="$enable_x_compile"
1527   
1528         ol_arg=invalid
1529         for ol_val in yes no ; do
1530                 if test "$enableval" = "$ol_val" ; then
1531                         ol_arg="$ol_val"
1532                 fi
1533         done
1534         if test "$ol_arg" = "invalid" ; then
1535                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1536         fi
1537         ol_enable_x_compile="$ol_arg"
1538
1539 else
1540         ol_enable_x_compile="no"
1541 fi
1542 # end --enable-x_compile
1543
1544
1545 # OpenLDAP --with-cyrus_sasl
1546         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1547 if test "${with_cyrus_sasl+set}" = set; then
1548   withval="$with_cyrus_sasl"
1549   
1550         ol_arg=invalid
1551         for ol_val in auto yes no  ; do
1552                 if test "$withval" = "$ol_val" ; then
1553                         ol_arg="$ol_val"
1554                 fi
1555         done
1556         if test "$ol_arg" = "invalid" ; then
1557                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1558         fi
1559         ol_with_cyrus_sasl="$ol_arg"
1560
1561 else
1562         ol_with_cyrus_sasl="auto"
1563 fi
1564 # end --with-cyrus_sasl
1565
1566 # OpenLDAP --with-fetch
1567         # Check whether --with-fetch or --without-fetch was given.
1568 if test "${with_fetch+set}" = set; then
1569   withval="$with_fetch"
1570   
1571         ol_arg=invalid
1572         for ol_val in auto yes no  ; do
1573                 if test "$withval" = "$ol_val" ; then
1574                         ol_arg="$ol_val"
1575                 fi
1576         done
1577         if test "$ol_arg" = "invalid" ; then
1578                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1579         fi
1580         ol_with_fetch="$ol_arg"
1581
1582 else
1583         ol_with_fetch="auto"
1584 fi
1585 # end --with-fetch
1586
1587 ol_with_kerberos=${ol_with_kerberos-auto}
1588 # OpenLDAP --with-threads
1589         # Check whether --with-threads or --without-threads was given.
1590 if test "${with_threads+set}" = set; then
1591   withval="$with_threads"
1592   
1593         ol_arg=invalid
1594         for ol_val in auto nt posix mach pth lwp yes no manual  ; do
1595                 if test "$withval" = "$ol_val" ; then
1596                         ol_arg="$ol_val"
1597                 fi
1598         done
1599         if test "$ol_arg" = "invalid" ; then
1600                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1601         fi
1602         ol_with_threads="$ol_arg"
1603
1604 else
1605         ol_with_threads="auto"
1606 fi
1607 # end --with-threads
1608
1609 # OpenLDAP --with-tls
1610         # Check whether --with-tls or --without-tls was given.
1611 if test "${with_tls+set}" = set; then
1612   withval="$with_tls"
1613   
1614         ol_arg=invalid
1615         for ol_val in auto ssleay openssl yes no  ; do
1616                 if test "$withval" = "$ol_val" ; then
1617                         ol_arg="$ol_val"
1618                 fi
1619         done
1620         if test "$ol_arg" = "invalid" ; then
1621                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1622         fi
1623         ol_with_tls="$ol_arg"
1624
1625 else
1626         ol_with_tls="auto"
1627 fi
1628 # end --with-tls
1629
1630 # OpenLDAP --with-yielding_select
1631         # Check whether --with-yielding_select or --without-yielding_select was given.
1632 if test "${with_yielding_select+set}" = set; then
1633   withval="$with_yielding_select"
1634   
1635         ol_arg=invalid
1636         for ol_val in auto yes no manual  ; do
1637                 if test "$withval" = "$ol_val" ; then
1638                         ol_arg="$ol_val"
1639                 fi
1640         done
1641         if test "$ol_arg" = "invalid" ; then
1642                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1643         fi
1644         ol_with_yielding_select="$ol_arg"
1645
1646 else
1647         ol_with_yielding_select="auto"
1648 fi
1649 # end --with-yielding_select
1650
1651
1652
1653 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1654 if test "${with_xxslapdoptions+set}" = set; then
1655   withval="$with_xxslapdoptions"
1656   :
1657 fi
1658
1659 # OpenLDAP --enable-slapd
1660         # Check whether --enable-slapd or --disable-slapd was given.
1661 if test "${enable_slapd+set}" = set; then
1662   enableval="$enable_slapd"
1663   
1664         ol_arg=invalid
1665         for ol_val in auto yes no ; do
1666                 if test "$enableval" = "$ol_val" ; then
1667                         ol_arg="$ol_val"
1668                 fi
1669         done
1670         if test "$ol_arg" = "invalid" ; then
1671                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1672         fi
1673         ol_enable_slapd="$ol_arg"
1674
1675 else
1676         ol_enable_slapd="yes"
1677 fi
1678 # end --enable-slapd
1679 # OpenLDAP --enable-aci
1680         # Check whether --enable-aci or --disable-aci was given.
1681 if test "${enable_aci+set}" = set; then
1682   enableval="$enable_aci"
1683   
1684         ol_arg=invalid
1685         for ol_val in auto yes no ; do
1686                 if test "$enableval" = "$ol_val" ; then
1687                         ol_arg="$ol_val"
1688                 fi
1689         done
1690         if test "$ol_arg" = "invalid" ; then
1691                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1692         fi
1693         ol_enable_aci="$ol_arg"
1694
1695 else
1696         ol_enable_aci="no"
1697 fi
1698 # end --enable-aci
1699 # OpenLDAP --enable-cleartext
1700         # Check whether --enable-cleartext or --disable-cleartext was given.
1701 if test "${enable_cleartext+set}" = set; then
1702   enableval="$enable_cleartext"
1703   
1704         ol_arg=invalid
1705         for ol_val in auto yes no ; do
1706                 if test "$enableval" = "$ol_val" ; then
1707                         ol_arg="$ol_val"
1708                 fi
1709         done
1710         if test "$ol_arg" = "invalid" ; then
1711                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1712         fi
1713         ol_enable_cleartext="$ol_arg"
1714
1715 else
1716         ol_enable_cleartext="yes"
1717 fi
1718 # end --enable-cleartext
1719 # OpenLDAP --enable-crypt
1720         # Check whether --enable-crypt or --disable-crypt was given.
1721 if test "${enable_crypt+set}" = set; then
1722   enableval="$enable_crypt"
1723   
1724         ol_arg=invalid
1725         for ol_val in auto yes no ; do
1726                 if test "$enableval" = "$ol_val" ; then
1727                         ol_arg="$ol_val"
1728                 fi
1729         done
1730         if test "$ol_arg" = "invalid" ; then
1731                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1732         fi
1733         ol_enable_crypt="$ol_arg"
1734
1735 else
1736         ol_enable_crypt="no"
1737 fi
1738 # end --enable-crypt
1739 ol_enable_kpasswd=${ol_enable_kpasswd-no}
1740 # OpenLDAP --enable-lmpasswd
1741         # Check whether --enable-lmpasswd or --disable-lmpasswd was given.
1742 if test "${enable_lmpasswd+set}" = set; then
1743   enableval="$enable_lmpasswd"
1744   
1745         ol_arg=invalid
1746         for ol_val in auto yes no ; do
1747                 if test "$enableval" = "$ol_val" ; then
1748                         ol_arg="$ol_val"
1749                 fi
1750         done
1751         if test "$ol_arg" = "invalid" ; then
1752                 { echo "configure: error: bad value $enableval for --enable-lmpasswd" 1>&2; exit 1; }
1753         fi
1754         ol_enable_lmpasswd="$ol_arg"
1755
1756 else
1757         ol_enable_lmpasswd="no"
1758 fi
1759 # end --enable-lmpasswd
1760 # OpenLDAP --enable-spasswd
1761         # Check whether --enable-spasswd or --disable-spasswd was given.
1762 if test "${enable_spasswd+set}" = set; then
1763   enableval="$enable_spasswd"
1764   
1765         ol_arg=invalid
1766         for ol_val in auto yes no ; do
1767                 if test "$enableval" = "$ol_val" ; then
1768                         ol_arg="$ol_val"
1769                 fi
1770         done
1771         if test "$ol_arg" = "invalid" ; then
1772                 { echo "configure: error: bad value $enableval for --enable-spasswd" 1>&2; exit 1; }
1773         fi
1774         ol_enable_spasswd="$ol_arg"
1775
1776 else
1777         ol_enable_spasswd="no"
1778 fi
1779 # end --enable-spasswd
1780 # OpenLDAP --enable-modules
1781         # Check whether --enable-modules or --disable-modules was given.
1782 if test "${enable_modules+set}" = set; then
1783   enableval="$enable_modules"
1784   
1785         ol_arg=invalid
1786         for ol_val in auto yes no ; do
1787                 if test "$enableval" = "$ol_val" ; then
1788                         ol_arg="$ol_val"
1789                 fi
1790         done
1791         if test "$ol_arg" = "invalid" ; then
1792                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1793         fi
1794         ol_enable_modules="$ol_arg"
1795
1796 else
1797         ol_enable_modules="no"
1798 fi
1799 # end --enable-modules
1800 ol_enable_multimaster=${ol_enable_multimaster-no}
1801 # OpenLDAP --enable-rewrite
1802         # Check whether --enable-rewrite or --disable-rewrite was given.
1803 if test "${enable_rewrite+set}" = set; then
1804   enableval="$enable_rewrite"
1805   
1806         ol_arg=invalid
1807         for ol_val in auto yes no ; do
1808                 if test "$enableval" = "$ol_val" ; then
1809                         ol_arg="$ol_val"
1810                 fi
1811         done
1812         if test "$ol_arg" = "invalid" ; then
1813                 { echo "configure: error: bad value $enableval for --enable-rewrite" 1>&2; exit 1; }
1814         fi
1815         ol_enable_rewrite="$ol_arg"
1816
1817 else
1818         ol_enable_rewrite="no"
1819 fi
1820 # end --enable-rewrite
1821 # OpenLDAP --enable-rlookups
1822         # Check whether --enable-rlookups or --disable-rlookups was given.
1823 if test "${enable_rlookups+set}" = set; then
1824   enableval="$enable_rlookups"
1825   
1826         ol_arg=invalid
1827         for ol_val in auto yes no ; do
1828                 if test "$enableval" = "$ol_val" ; then
1829                         ol_arg="$ol_val"
1830                 fi
1831         done
1832         if test "$ol_arg" = "invalid" ; then
1833                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1834         fi
1835         ol_enable_rlookups="$ol_arg"
1836
1837 else
1838         ol_enable_rlookups="no"
1839 fi
1840 # end --enable-rlookups
1841 # OpenLDAP --enable-slapi
1842         # Check whether --enable-slapi or --disable-slapi was given.
1843 if test "${enable_slapi+set}" = set; then
1844   enableval="$enable_slapi"
1845   
1846         ol_arg=invalid
1847         for ol_val in auto yes no ; do
1848                 if test "$enableval" = "$ol_val" ; then
1849                         ol_arg="$ol_val"
1850                 fi
1851         done
1852         if test "$ol_arg" = "invalid" ; then
1853                 { echo "configure: error: bad value $enableval for --enable-slapi" 1>&2; exit 1; }
1854         fi
1855         ol_enable_slapi="$ol_arg"
1856
1857 else
1858         ol_enable_slapi="no"
1859 fi
1860 # end --enable-slapi
1861 # OpenLDAP --enable-slp
1862         # Check whether --enable-slp or --disable-slp was given.
1863 if test "${enable_slp+set}" = set; then
1864   enableval="$enable_slp"
1865   
1866         ol_arg=invalid
1867         for ol_val in auto yes no ; do
1868                 if test "$enableval" = "$ol_val" ; then
1869                         ol_arg="$ol_val"
1870                 fi
1871         done
1872         if test "$ol_arg" = "invalid" ; then
1873                 { echo "configure: error: bad value $enableval for --enable-slp" 1>&2; exit 1; }
1874         fi
1875         ol_enable_slp="$ol_arg"
1876
1877 else
1878         ol_enable_slp="no"
1879 fi
1880 # end --enable-slp
1881 # OpenLDAP --enable-wrappers
1882         # Check whether --enable-wrappers or --disable-wrappers was given.
1883 if test "${enable_wrappers+set}" = set; then
1884   enableval="$enable_wrappers"
1885   
1886         ol_arg=invalid
1887         for ol_val in auto yes no ; do
1888                 if test "$enableval" = "$ol_val" ; then
1889                         ol_arg="$ol_val"
1890                 fi
1891         done
1892         if test "$ol_arg" = "invalid" ; then
1893                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1894         fi
1895         ol_enable_wrappers="$ol_arg"
1896
1897 else
1898         ol_enable_wrappers="no"
1899 fi
1900 # end --enable-wrappers
1901
1902
1903 # OpenLDAP --enable-bdb
1904         # Check whether --enable-bdb or --disable-bdb was given.
1905 if test "${enable_bdb+set}" = set; then
1906   enableval="$enable_bdb"
1907   
1908         ol_arg=invalid
1909         for ol_val in auto yes no ; do
1910                 if test "$enableval" = "$ol_val" ; then
1911                         ol_arg="$ol_val"
1912                 fi
1913         done
1914         if test "$ol_arg" = "invalid" ; then
1915                 { echo "configure: error: bad value $enableval for --enable-bdb" 1>&2; exit 1; }
1916         fi
1917         ol_enable_bdb="$ol_arg"
1918
1919 else
1920         ol_enable_bdb="yes"
1921 fi
1922 # end --enable-bdb
1923 # OpenLDAP --with-bdb_module
1924         # Check whether --with-bdb_module or --without-bdb_module was given.
1925 if test "${with_bdb_module+set}" = set; then
1926   withval="$with_bdb_module"
1927   
1928         ol_arg=invalid
1929         for ol_val in static dynamic ; do
1930                 if test "$withval" = "$ol_val" ; then
1931                         ol_arg="$ol_val"
1932                 fi
1933         done
1934         if test "$ol_arg" = "invalid" ; then
1935                 { echo "configure: error: bad value $withval for --with-bdb_module" 1>&2; exit 1; }
1936         fi
1937         ol_with_bdb_module="$ol_arg"
1938
1939 else
1940         ol_with_bdb_module="static"
1941 fi
1942 # end --with-bdb_module
1943
1944 # OpenLDAP --enable-dnssrv
1945         # Check whether --enable-dnssrv or --disable-dnssrv was given.
1946 if test "${enable_dnssrv+set}" = set; then
1947   enableval="$enable_dnssrv"
1948   
1949         ol_arg=invalid
1950         for ol_val in auto yes no ; do
1951                 if test "$enableval" = "$ol_val" ; then
1952                         ol_arg="$ol_val"
1953                 fi
1954         done
1955         if test "$ol_arg" = "invalid" ; then
1956                 { echo "configure: error: bad value $enableval for --enable-dnssrv" 1>&2; exit 1; }
1957         fi
1958         ol_enable_dnssrv="$ol_arg"
1959
1960 else
1961         ol_enable_dnssrv="no"
1962 fi
1963 # end --enable-dnssrv
1964 # OpenLDAP --with-dnssrv_module
1965         # Check whether --with-dnssrv_module or --without-dnssrv_module was given.
1966 if test "${with_dnssrv_module+set}" = set; then
1967   withval="$with_dnssrv_module"
1968   
1969         ol_arg=invalid
1970         for ol_val in static dynamic ; do
1971                 if test "$withval" = "$ol_val" ; then
1972                         ol_arg="$ol_val"
1973                 fi
1974         done
1975         if test "$ol_arg" = "invalid" ; then
1976                 { echo "configure: error: bad value $withval for --with-dnssrv_module" 1>&2; exit 1; }
1977         fi
1978         ol_with_dnssrv_module="$ol_arg"
1979
1980 else
1981         ol_with_dnssrv_module="static"
1982 fi
1983 # end --with-dnssrv_module
1984
1985 # OpenLDAP --enable-hdb
1986         # Check whether --enable-hdb or --disable-hdb was given.
1987 if test "${enable_hdb+set}" = set; then
1988   enableval="$enable_hdb"
1989   
1990         ol_arg=invalid
1991         for ol_val in auto yes no ; do
1992                 if test "$enableval" = "$ol_val" ; then
1993                         ol_arg="$ol_val"
1994                 fi
1995         done
1996         if test "$ol_arg" = "invalid" ; then
1997                 { echo "configure: error: bad value $enableval for --enable-hdb" 1>&2; exit 1; }
1998         fi
1999         ol_enable_hdb="$ol_arg"
2000
2001 else
2002         ol_enable_hdb="no"
2003 fi
2004 # end --enable-hdb
2005 # OpenLDAP --with-hdb_module
2006         # Check whether --with-hdb_module or --without-hdb_module was given.
2007 if test "${with_hdb_module+set}" = set; then
2008   withval="$with_hdb_module"
2009   
2010         ol_arg=invalid
2011         for ol_val in static dynamic ; do
2012                 if test "$withval" = "$ol_val" ; then
2013                         ol_arg="$ol_val"
2014                 fi
2015         done
2016         if test "$ol_arg" = "invalid" ; then
2017                 { echo "configure: error: bad value $withval for --with-hdb_module" 1>&2; exit 1; }
2018         fi
2019         ol_with_hdb_module="$ol_arg"
2020
2021 else
2022         ol_with_hdb_module="static"
2023 fi
2024 # end --with-hdb_module
2025
2026 # OpenLDAP --enable-ldap
2027         # Check whether --enable-ldap or --disable-ldap was given.
2028 if test "${enable_ldap+set}" = set; then
2029   enableval="$enable_ldap"
2030   
2031         ol_arg=invalid
2032         for ol_val in auto yes no ; do
2033                 if test "$enableval" = "$ol_val" ; then
2034                         ol_arg="$ol_val"
2035                 fi
2036         done
2037         if test "$ol_arg" = "invalid" ; then
2038                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
2039         fi
2040         ol_enable_ldap="$ol_arg"
2041
2042 else
2043         ol_enable_ldap="no"
2044 fi
2045 # end --enable-ldap
2046 # OpenLDAP --with-ldap_module
2047         # Check whether --with-ldap_module or --without-ldap_module was given.
2048 if test "${with_ldap_module+set}" = set; then
2049   withval="$with_ldap_module"
2050   
2051         ol_arg=invalid
2052         for ol_val in static dynamic ; do
2053                 if test "$withval" = "$ol_val" ; then
2054                         ol_arg="$ol_val"
2055                 fi
2056         done
2057         if test "$ol_arg" = "invalid" ; then
2058                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
2059         fi
2060         ol_with_ldap_module="$ol_arg"
2061
2062 else
2063         ol_with_ldap_module="static"
2064 fi
2065 # end --with-ldap_module
2066
2067 # OpenLDAP --enable-ldbm
2068         # Check whether --enable-ldbm or --disable-ldbm was given.
2069 if test "${enable_ldbm+set}" = set; then
2070   enableval="$enable_ldbm"
2071   
2072         ol_arg=invalid
2073         for ol_val in auto yes no ; do
2074                 if test "$enableval" = "$ol_val" ; then
2075                         ol_arg="$ol_val"
2076                 fi
2077         done
2078         if test "$ol_arg" = "invalid" ; then
2079                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
2080         fi
2081         ol_enable_ldbm="$ol_arg"
2082
2083 else
2084         ol_enable_ldbm="no"
2085 fi
2086 # end --enable-ldbm
2087 # OpenLDAP --with-ldbm_api
2088         # Check whether --with-ldbm_api or --without-ldbm_api was given.
2089 if test "${with_ldbm_api+set}" = set; then
2090   withval="$with_ldbm_api"
2091   
2092         ol_arg=invalid
2093         for ol_val in auto berkeley bcompat mdbm gdbm ; do
2094                 if test "$withval" = "$ol_val" ; then
2095                         ol_arg="$ol_val"
2096                 fi
2097         done
2098         if test "$ol_arg" = "invalid" ; then
2099                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
2100         fi
2101         ol_with_ldbm_api="$ol_arg"
2102
2103 else
2104         ol_with_ldbm_api="auto"
2105 fi
2106 # end --with-ldbm_api
2107
2108 # OpenLDAP --with-ldbm_module
2109         # Check whether --with-ldbm_module or --without-ldbm_module was given.
2110 if test "${with_ldbm_module+set}" = set; then
2111   withval="$with_ldbm_module"
2112   
2113         ol_arg=invalid
2114         for ol_val in static dynamic ; do
2115                 if test "$withval" = "$ol_val" ; then
2116                         ol_arg="$ol_val"
2117                 fi
2118         done
2119         if test "$ol_arg" = "invalid" ; then
2120                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
2121         fi
2122         ol_with_ldbm_module="$ol_arg"
2123
2124 else
2125         ol_with_ldbm_module="static"
2126 fi
2127 # end --with-ldbm_module
2128
2129 # OpenLDAP --with-ldbm_type
2130         # Check whether --with-ldbm_type or --without-ldbm_type was given.
2131 if test "${with_ldbm_type+set}" = set; then
2132   withval="$with_ldbm_type"
2133   
2134         ol_arg=invalid
2135         for ol_val in auto btree hash ; do
2136                 if test "$withval" = "$ol_val" ; then
2137                         ol_arg="$ol_val"
2138                 fi
2139         done
2140         if test "$ol_arg" = "invalid" ; then
2141                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
2142         fi
2143         ol_with_ldbm_type="$ol_arg"
2144
2145 else
2146         ol_with_ldbm_type="auto"
2147 fi
2148 # end --with-ldbm_type
2149
2150 # OpenLDAP --enable-meta
2151         # Check whether --enable-meta or --disable-meta was given.
2152 if test "${enable_meta+set}" = set; then
2153   enableval="$enable_meta"
2154   
2155         ol_arg=invalid
2156         for ol_val in auto yes no ; do
2157                 if test "$enableval" = "$ol_val" ; then
2158                         ol_arg="$ol_val"
2159                 fi
2160         done
2161         if test "$ol_arg" = "invalid" ; then
2162                 { echo "configure: error: bad value $enableval for --enable-meta" 1>&2; exit 1; }
2163         fi
2164         ol_enable_meta="$ol_arg"
2165
2166 else
2167         ol_enable_meta="no"
2168 fi
2169 # end --enable-meta
2170 # OpenLDAP --with-meta_module
2171         # Check whether --with-meta_module or --without-meta_module was given.
2172 if test "${with_meta_module+set}" = set; then
2173   withval="$with_meta_module"
2174   
2175         ol_arg=invalid
2176         for ol_val in static dynamic ; do
2177                 if test "$withval" = "$ol_val" ; then
2178                         ol_arg="$ol_val"
2179                 fi
2180         done
2181         if test "$ol_arg" = "invalid" ; then
2182                 { echo "configure: error: bad value $withval for --with-meta_module" 1>&2; exit 1; }
2183         fi
2184         ol_with_meta_module="$ol_arg"
2185
2186 else
2187         ol_with_meta_module="static"
2188 fi
2189 # end --with-meta_module
2190
2191 # OpenLDAP --enable-monitor
2192         # Check whether --enable-monitor or --disable-monitor was given.
2193 if test "${enable_monitor+set}" = set; then
2194   enableval="$enable_monitor"
2195   
2196         ol_arg=invalid
2197         for ol_val in auto yes no ; do
2198                 if test "$enableval" = "$ol_val" ; then
2199                         ol_arg="$ol_val"
2200                 fi
2201         done
2202         if test "$ol_arg" = "invalid" ; then
2203                 { echo "configure: error: bad value $enableval for --enable-monitor" 1>&2; exit 1; }
2204         fi
2205         ol_enable_monitor="$ol_arg"
2206
2207 else
2208         ol_enable_monitor="yes"
2209 fi
2210 # end --enable-monitor
2211 # OpenLDAP --with-monitor_module
2212         # Check whether --with-monitor_module or --without-monitor_module was given.
2213 if test "${with_monitor_module+set}" = set; then
2214   withval="$with_monitor_module"
2215   
2216         ol_arg=invalid
2217         for ol_val in static dynamic ; do
2218                 if test "$withval" = "$ol_val" ; then
2219                         ol_arg="$ol_val"
2220                 fi
2221         done
2222         if test "$ol_arg" = "invalid" ; then
2223                 { echo "configure: error: bad value $withval for --with-monitor_module" 1>&2; exit 1; }
2224         fi
2225         ol_with_monitor_module="$ol_arg"
2226
2227 else
2228         ol_with_monitor_module="static"
2229 fi
2230 # end --with-monitor_module
2231
2232 # OpenLDAP --enable-null
2233         # Check whether --enable-null or --disable-null was given.
2234 if test "${enable_null+set}" = set; then
2235   enableval="$enable_null"
2236   
2237         ol_arg=invalid
2238         for ol_val in auto yes no ; do
2239                 if test "$enableval" = "$ol_val" ; then
2240                         ol_arg="$ol_val"
2241                 fi
2242         done
2243         if test "$ol_arg" = "invalid" ; then
2244                 { echo "configure: error: bad value $enableval for --enable-null" 1>&2; exit 1; }
2245         fi
2246         ol_enable_null="$ol_arg"
2247
2248 else
2249         ol_enable_null="no"
2250 fi
2251 # end --enable-null
2252 # OpenLDAP --with-null_module
2253         # Check whether --with-null_module or --without-null_module was given.
2254 if test "${with_null_module+set}" = set; then
2255   withval="$with_null_module"
2256   
2257         ol_arg=invalid
2258         for ol_val in static dynamic ; do
2259                 if test "$withval" = "$ol_val" ; then
2260                         ol_arg="$ol_val"
2261                 fi
2262         done
2263         if test "$ol_arg" = "invalid" ; then
2264                 { echo "configure: error: bad value $withval for --with-null_module" 1>&2; exit 1; }
2265         fi
2266         ol_with_null_module="$ol_arg"
2267
2268 else
2269         ol_with_null_module="static"
2270 fi
2271 # end --with-null_module
2272
2273 # OpenLDAP --enable-passwd
2274         # Check whether --enable-passwd or --disable-passwd was given.
2275 if test "${enable_passwd+set}" = set; then
2276   enableval="$enable_passwd"
2277   
2278         ol_arg=invalid
2279         for ol_val in auto yes no ; do
2280                 if test "$enableval" = "$ol_val" ; then
2281                         ol_arg="$ol_val"
2282                 fi
2283         done
2284         if test "$ol_arg" = "invalid" ; then
2285                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
2286         fi
2287         ol_enable_passwd="$ol_arg"
2288
2289 else
2290         ol_enable_passwd="no"
2291 fi
2292 # end --enable-passwd
2293 # OpenLDAP --with-passwd_module
2294         # Check whether --with-passwd_module or --without-passwd_module was given.
2295 if test "${with_passwd_module+set}" = set; then
2296   withval="$with_passwd_module"
2297   
2298         ol_arg=invalid
2299         for ol_val in static dynamic ; do
2300                 if test "$withval" = "$ol_val" ; then
2301                         ol_arg="$ol_val"
2302                 fi
2303         done
2304         if test "$ol_arg" = "invalid" ; then
2305                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
2306         fi
2307         ol_with_passwd_module="$ol_arg"
2308
2309 else
2310         ol_with_passwd_module="static"
2311 fi
2312 # end --with-passwd_module
2313
2314 # OpenLDAP --enable-perl
2315         # Check whether --enable-perl or --disable-perl was given.
2316 if test "${enable_perl+set}" = set; then
2317   enableval="$enable_perl"
2318   
2319         ol_arg=invalid
2320         for ol_val in auto yes no ; do
2321                 if test "$enableval" = "$ol_val" ; then
2322                         ol_arg="$ol_val"
2323                 fi
2324         done
2325         if test "$ol_arg" = "invalid" ; then
2326                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
2327         fi
2328         ol_enable_perl="$ol_arg"
2329
2330 else
2331         ol_enable_perl="no"
2332 fi
2333 # end --enable-perl
2334 # OpenLDAP --with-perl_module
2335         # Check whether --with-perl_module or --without-perl_module was given.
2336 if test "${with_perl_module+set}" = set; then
2337   withval="$with_perl_module"
2338   
2339         ol_arg=invalid
2340         for ol_val in static dynamic ; do
2341                 if test "$withval" = "$ol_val" ; then
2342                         ol_arg="$ol_val"
2343                 fi
2344         done
2345         if test "$ol_arg" = "invalid" ; then
2346                 { echo "configure: error: bad value $withval for --with-perl_module" 1>&2; exit 1; }
2347         fi
2348         ol_with_perl_module="$ol_arg"
2349
2350 else
2351         ol_with_perl_module="static"
2352 fi
2353 # end --with-perl_module
2354
2355 # OpenLDAP --enable-shell
2356         # Check whether --enable-shell or --disable-shell was given.
2357 if test "${enable_shell+set}" = set; then
2358   enableval="$enable_shell"
2359   
2360         ol_arg=invalid
2361         for ol_val in auto yes no ; do
2362                 if test "$enableval" = "$ol_val" ; then
2363                         ol_arg="$ol_val"
2364                 fi
2365         done
2366         if test "$ol_arg" = "invalid" ; then
2367                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
2368         fi
2369         ol_enable_shell="$ol_arg"
2370
2371 else
2372         ol_enable_shell="no"
2373 fi
2374 # end --enable-shell
2375 # OpenLDAP --with-shell_module
2376         # Check whether --with-shell_module or --without-shell_module was given.
2377 if test "${with_shell_module+set}" = set; then
2378   withval="$with_shell_module"
2379   
2380         ol_arg=invalid
2381         for ol_val in static dynamic ; do
2382                 if test "$withval" = "$ol_val" ; then
2383                         ol_arg="$ol_val"
2384                 fi
2385         done
2386         if test "$ol_arg" = "invalid" ; then
2387                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
2388         fi
2389         ol_with_shell_module="$ol_arg"
2390
2391 else
2392         ol_with_shell_module="static"
2393 fi
2394 # end --with-shell_module
2395
2396 # OpenLDAP --enable-sql
2397         # Check whether --enable-sql or --disable-sql was given.
2398 if test "${enable_sql+set}" = set; then
2399   enableval="$enable_sql"
2400   
2401         ol_arg=invalid
2402         for ol_val in auto yes no ; do
2403                 if test "$enableval" = "$ol_val" ; then
2404                         ol_arg="$ol_val"
2405                 fi
2406         done
2407         if test "$ol_arg" = "invalid" ; then
2408                 { echo "configure: error: bad value $enableval for --enable-sql" 1>&2; exit 1; }
2409         fi
2410         ol_enable_sql="$ol_arg"
2411
2412 else
2413         ol_enable_sql="no"
2414 fi
2415 # end --enable-sql
2416 # OpenLDAP --with-sql_module
2417         # Check whether --with-sql_module or --without-sql_module was given.
2418 if test "${with_sql_module+set}" = set; then
2419   withval="$with_sql_module"
2420   
2421         ol_arg=invalid
2422         for ol_val in static dynamic ; do
2423                 if test "$withval" = "$ol_val" ; then
2424                         ol_arg="$ol_val"
2425                 fi
2426         done
2427         if test "$ol_arg" = "invalid" ; then
2428                 { echo "configure: error: bad value $withval for --with-sql_module" 1>&2; exit 1; }
2429         fi
2430         ol_with_sql_module="$ol_arg"
2431
2432 else
2433         ol_with_sql_module="static"
2434 fi
2435 # end --with-sql_module
2436
2437
2438 # Check whether --with-xxslapoverlays or --without-xxslapoverlays was given.
2439 if test "${with_xxslapoverlays+set}" = set; then
2440   withval="$with_xxslapoverlays"
2441   :
2442 fi
2443
2444 # OpenLDAP --with-dyngroup
2445         # Check whether --with-dyngroup or --without-dyngroup was given.
2446 if test "${with_dyngroup+set}" = set; then
2447   withval="$with_dyngroup"
2448   
2449         ol_arg=invalid
2450         for ol_val in no yes mod ; do
2451                 if test "$withval" = "$ol_val" ; then
2452                         ol_arg="$ol_val"
2453                 fi
2454         done
2455         if test "$ol_arg" = "invalid" ; then
2456                 { echo "configure: error: bad value $withval for --with-dyngroup" 1>&2; exit 1; }
2457         fi
2458         ol_with_dyngroup="$ol_arg"
2459
2460 else
2461         ol_with_dyngroup="no"
2462 fi
2463 # end --with-dyngroup
2464
2465 # OpenLDAP --with-proxycache
2466         # Check whether --with-proxycache or --without-proxycache was given.
2467 if test "${with_proxycache+set}" = set; then
2468   withval="$with_proxycache"
2469   
2470         ol_arg=invalid
2471         for ol_val in no yes mod ; do
2472                 if test "$withval" = "$ol_val" ; then
2473                         ol_arg="$ol_val"
2474                 fi
2475         done
2476         if test "$ol_arg" = "invalid" ; then
2477                 { echo "configure: error: bad value $withval for --with-proxycache" 1>&2; exit 1; }
2478         fi
2479         ol_with_proxycache="$ol_arg"
2480
2481 else
2482         ol_with_proxycache="no"
2483 fi
2484 # end --with-proxycache
2485
2486
2487 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2488 if test "${with_xxslurpdoptions+set}" = set; then
2489   withval="$with_xxslurpdoptions"
2490   :
2491 fi
2492
2493 # OpenLDAP --enable-slurpd
2494         # Check whether --enable-slurpd or --disable-slurpd was given.
2495 if test "${enable_slurpd+set}" = set; then
2496   enableval="$enable_slurpd"
2497   
2498         ol_arg=invalid
2499         for ol_val in auto yes no ; do
2500                 if test "$enableval" = "$ol_val" ; then
2501                         ol_arg="$ol_val"
2502                 fi
2503         done
2504         if test "$ol_arg" = "invalid" ; then
2505                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2506         fi
2507         ol_enable_slurpd="$ol_arg"
2508
2509 else
2510         ol_enable_slurpd="auto"
2511 fi
2512 # end --enable-slurpd
2513
2514 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2515 if test "${with_xxliboptions+set}" = set; then
2516   withval="$with_xxliboptions"
2517   :
2518 fi
2519
2520 # Check whether --enable-static or --disable-static was given.
2521 if test "${enable_static+set}" = set; then
2522   enableval="$enable_static"
2523   p=${PACKAGE-default}
2524 case $enableval in
2525 yes) enable_static=yes ;;
2526 no) enable_static=no ;;
2527 *)
2528   enable_static=no
2529   # Look at the argument we got.  We use all the common list separators.
2530   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2531   for pkg in $enableval; do
2532     if test "X$pkg" = "X$p"; then
2533       enable_static=yes
2534     fi
2535   done
2536   IFS="$ac_save_ifs"
2537   ;;
2538 esac
2539 else
2540   enable_static=yes
2541 fi
2542
2543 # Check whether --enable-shared or --disable-shared was given.
2544 if test "${enable_shared+set}" = set; then
2545   enableval="$enable_shared"
2546   p=${PACKAGE-default}
2547 case $enableval in
2548 yes) enable_shared=yes ;;
2549 no) enable_shared=no ;;
2550 *)
2551   enable_shared=no
2552   # Look at the argument we got.  We use all the common list separators.
2553   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2554   for pkg in $enableval; do
2555     if test "X$pkg" = "X$p"; then
2556       enable_shared=yes
2557     fi
2558   done
2559   IFS="$ac_save_ifs"
2560   ;;
2561 esac
2562 else
2563   enable_shared=yes
2564 fi
2565
2566
2567
2568 # validate options
2569 if test $ol_enable_slapd = no ; then
2570                 if test $ol_enable_slapi = yes ; then
2571                 echo "configure: warning: slapd disabled, ignoring --enable-slapi argument" 1>&2
2572         fi
2573         if test $ol_enable_bdb = yes ; then
2574                 echo "configure: warning: slapd disabled, ignoring --enable-bdb argument" 1>&2
2575         fi
2576         if test $ol_enable_dnssrv = yes ; then
2577                 echo "configure: warning: slapd disabled, ignoring --enable-dnssrv argument" 1>&2
2578         fi
2579         if test $ol_enable_hdb = yes ; then
2580                 echo "configure: warning: slapd disabled, ignoring --enable-hdb argument" 1>&2
2581         fi
2582         if test $ol_enable_ldap = yes ; then
2583                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2584         fi
2585         if test $ol_enable_ldbm = yes ; then
2586                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2587         fi
2588         if test $ol_enable_meta = yes ; then
2589                 echo "configure: warning: slapd disabled, ignoring --enable-meta argument" 1>&2
2590         fi
2591         if test $ol_enable_monitor = yes ; then
2592                 echo "configure: warning: slapd disabled, ignoring --enable-monitor argument" 1>&2
2593         fi
2594         if test $ol_enable_null = yes ; then
2595                 echo "configure: warning: slapd disabled, ignoring --enable-null argument" 1>&2
2596         fi
2597         if test $ol_enable_passwd = yes ; then
2598                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2599         fi
2600         if test $ol_enable_perl = yes ; then
2601                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
2602         fi
2603         if test $ol_enable_shell = yes ; then
2604                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2605         fi
2606         if test $ol_enable_sql = yes ; then
2607                 echo "configure: warning: slapd disabled, ignoring --enable-sql argument" 1>&2
2608         fi
2609         if test $ol_enable_modules = yes ; then
2610                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2611         fi
2612         if test $ol_enable_multimaster = yes ; then
2613                 echo "configure: warning: slapd disabled, ignoring --enable-multimaster argument" 1>&2
2614         fi
2615         if test $ol_enable_wrappers = yes ; then
2616                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2617         fi
2618         if test $ol_enable_rlookups = yes ; then
2619                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2620         fi
2621         if test $ol_enable_aci = yes ; then
2622                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2623         fi
2624         if test $ol_with_ldbm_api != auto ; then
2625                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2626         fi
2627         if test $ol_with_ldbm_type != auto ; then
2628                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2629         fi
2630         if test $ol_with_bdb_module != static ; then
2631                 echo "configure: warning: slapd disabled, ignoring --with-bdb-module argument" 1>&2
2632         fi
2633         if test $ol_with_dnssrv_module != static ; then
2634                 echo "configure: warning: slapd disabled, ignoring --with-dnssrv-module argument" 1>&2
2635         fi
2636         if test $ol_with_hdb_module != static ; then
2637                 echo "configure: warning: slapd disabled, ignoring --with-hdb-module argument" 1>&2
2638         fi
2639         if test $ol_with_ldap_module != static ; then
2640                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2641         fi
2642         if test $ol_with_ldbm_module != static ; then
2643                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2644         fi
2645         if test $ol_with_meta_module != static ; then
2646                 echo "configure: warning: slapd disabled, ignoring --with-meta-module argument" 1>&2
2647         fi
2648         if test $ol_with_monitor_module != static ; then
2649                 echo "configure: warning: slapd disabled, ignoring --with-monitor-module argument" 1>&2
2650         fi
2651         if test $ol_with_null_module != static ; then
2652                 echo "configure: warning: slapd disabled, ignoring --with-null-module argument" 1>&2
2653         fi
2654         if test $ol_with_passwd_module != static ; then
2655                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2656         fi
2657         if test $ol_with_perl_module != static ; then
2658                 echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2
2659         fi
2660         if test $ol_with_shell_module != static ; then
2661                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2662         fi
2663         if test $ol_with_sql_module != static ; then
2664                 echo "configure: warning: slapd disabled, ignoring --with-sql-module argument" 1>&2
2665         fi
2666         if test $ol_enable_slurpd = yes ; then
2667                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2668         fi
2669         if test $ol_enable_rewrite = yes ; then
2670                 echo "configure: warning: slapd disabled, ignoring --enable-rewrite argument" 1>&2
2671         fi
2672         if test $ol_with_dyngroup != no ; then
2673                 echo "configure: warning: slapd disabled, ignoring --with-dyngroup argument" 1>&2
2674         fi
2675         if test $ol_with_proxycache != no ; then
2676                 echo "configure: warning: slapd disabled, ignoring --with-proxycache argument" 1>&2
2677         fi
2678
2679         # force settings to no
2680         ol_enable_slapi=no
2681         ol_enable_bdb=no
2682         ol_enable_dnssrv=no
2683         ol_enable_hdb=no
2684         ol_enable_ldap=no
2685         ol_enable_ldbm=no
2686         ol_enable_meta=no
2687         ol_enable_monitor=no
2688         ol_enable_null=no
2689         ol_enable_passwd=no
2690         ol_enable_perl=no
2691         ol_enable_shell=no
2692         ol_enable_sql=no
2693
2694         ol_enable_modules=no
2695         ol_enable_multimaster=no
2696         ol_enable_rlookups=no
2697         ol_enable_aci=no
2698         ol_enable_wrappers=no
2699
2700         ol_with_ldbm_api=no
2701         ol_with_ldbm_type=no
2702
2703         ol_with_bdb_module=static
2704         ol_with_dnssrv_module=static
2705         ol_with_hdb_module=static
2706         ol_with_ldap_module=static
2707         ol_with_ldbm_module=static
2708         ol_with_meta_module=static
2709         ol_with_monitor_module=static
2710         ol_with_null_module=static
2711         ol_with_passwd_module=static
2712         ol_with_perl_module=static
2713         ol_with_shell_module=static
2714         ol_with_sql_module=static
2715
2716         ol_enable_slurpd=no
2717
2718         ol_enable_rewrite=no
2719
2720         ol_with_dyngroup=no
2721         ol_with_proxycache=no
2722
2723 elif test $ol_enable_ldbm = no ; then
2724         
2725         if test $ol_with_ldbm_api != auto ; then
2726                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2727         fi
2728
2729         if test $ol_with_ldbm_type != auto ; then
2730                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2731         fi
2732
2733         if test $ol_with_ldbm_module != static ; then
2734                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2735         fi
2736
2737         if test $ol_enable_modules != yes -a \
2738                 $ol_enable_bdb = no -a \
2739                 $ol_enable_dnssrv = no -a \
2740                 $ol_enable_hdb = no -a \
2741                 $ol_enable_ldap = no -a \
2742                 $ol_enable_meta = no -a \
2743                 $ol_enable_monitor = no -a \
2744                 $ol_enable_null = no -a \
2745                 $ol_enable_passwd = no -a \
2746                 $ol_enable_perl = no -a \
2747                 $ol_enable_shell = no -a \
2748                 $ol_enable_sql = no ; then
2749
2750                 if test $ol_enable_slapd = yes ; then
2751                         { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2752                 else
2753                         echo "configure: warning: skipping slapd, no backend specified" 1>&2
2754                         ol_enable_slapd=no
2755                 fi
2756         fi
2757
2758         ol_with_ldbm_api=no
2759         ol_with_ldbm_type=no
2760         ol_with_ldbm_module=static
2761
2762         if test $ol_enable_bdb != no -o $ol_enable_hdb != no; then
2763                 ol_with_ldbm_api=berkeley
2764         fi
2765
2766 else
2767                 if test $ol_with_ldbm_api = gdbm -a \
2768                 $ol_with_ldbm_type = btree ; then
2769                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2770         fi
2771         if test $ol_with_ldbm_api = mdbm -a \
2772                 $ol_with_ldbm_type = btree ; then
2773                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2774         fi
2775         if test $ol_with_ldbm_api = ndbm -a \
2776                 $ol_with_ldbm_type = btree ; then
2777                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2778         fi
2779
2780         if test $ol_enable_bdb = yes -o $ol_enable_hdb = yes ; then
2781                 if test $ol_with_ldbm_api = auto ; then
2782                         ol_with_ldbm_api=berkeley
2783                 elif test $ol_with_ldbm_api != berkeley ; then
2784                         { echo "configure: error: LDBM API not compatible with BDB/HDB" 1>&2; exit 1; }
2785                 fi
2786
2787         elif test $ol_enable_bdb = auto ; then
2788                 if test $ol_with_ldbm_api != berkeley \
2789                         -o $ol_with_ldbm_api != auto ; then
2790                         echo "configure: warning: LDBM API not compatible with BDB, disabling BDB" 1>&2
2791                         ol_enable_bdb=no
2792                 fi
2793         fi
2794 fi
2795
2796 if test $ol_enable_slurpd = yes ; then
2797                 if test $ol_with_threads = no ; then
2798                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2799         fi
2800 fi
2801
2802 if test $ol_enable_lmpasswd = yes ; then
2803         if test $ol_with_tls = no ; then
2804                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
2805         fi
2806 fi
2807
2808 if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
2809         if test $ol_with_kerberos = no ; then
2810                 { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
2811         elif test $ol_with_kerberos = auto ; then
2812                 ol_with_kerberos=yes
2813         fi
2814
2815 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
2816         if test $ol_with_kerberos = auto ; then
2817                 ol_with_kerberos=no
2818         elif test $ol_with_kerberos != no ; then
2819                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2820                 ol_with_kerberos=no
2821         fi
2822 fi
2823
2824 if test $ol_enable_spasswd = yes ; then
2825         if test $ol_with_cyrus_sasl = no ; then
2826                 { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
2827         fi
2828         ol_with_cyrus_sasl=yes
2829 fi
2830
2831 echo "$ac_t""done" 1>&6
2832
2833 LDAP_LIBS=
2834 LDBM_LIBS=
2835 LTHREAD_LIBS=
2836 LUTIL_LIBS=
2837
2838 SLAPD_LIBS=
2839 SLURPD_LIBS=
2840
2841 BUILD_SLAPD=no
2842 BUILD_SLURPD=no
2843
2844 BUILD_THREAD=no
2845
2846 BUILD_SLAPI=no
2847 SLAPD_SLAPI_DEPEND=
2848
2849 BUILD_BDB=no
2850 BUILD_DNSSRV=no
2851 BUILD_HDB=no
2852 BUILD_LDAP=no
2853 BUILD_LDBM=no
2854 BUILD_META=no
2855 BUILD_MONITOR=no
2856 BUILD_NULL=no
2857 BUILD_PASSWD=no
2858 BUILD_PERL=no
2859 BUILD_SHELL=no
2860 BUILD_SQL=no
2861
2862 BUILD_BDB_DYNAMIC=static
2863 BUILD_DNSSRV_DYNAMIC=static
2864 BUILD_HDB_DYNAMIC=static
2865 BUILD_LDAP_DYNAMIC=static
2866 BUILD_LDBM_DYNAMIC=static
2867 BUILD_META_DYNAMIC=static
2868 BUILD_MONITOR_DYNAMIC=static
2869 BUILD_NULL_DYNAMIC=static
2870 BUILD_PASSWD_DYNAMIC=static
2871 BUILD_PERL_DYNAMIC=static
2872 BUILD_SHELL_DYNAMIC=static
2873 BUILD_SQL_DYNAMIC=static
2874
2875 BUILD_DYNGROUP=no
2876 BUILD_PROXYCACHE=no
2877
2878 SLAPD_DYNAMIC_OVERLAYS=
2879
2880 SLAPD_MODULES_LDFLAGS=
2881 SLAPD_MODULES_CPPFLAGS=
2882
2883 SLAPD_STATIC_BACKENDS=
2884 SLAPD_DYNAMIC_BACKENDS=
2885
2886 SLAPD_PERL_LDFLAGS=
2887 MOD_PERL_LDFLAGS=
2888 PERL_CPPFLAGS=
2889
2890 SLAPD_SQL_LDFLAGS=
2891 SLAPD_SQL_LIBS=
2892 SLAPD_SQL_INCLUDES=
2893
2894 KRB4_LIBS=
2895 KRB5_LIBS=
2896 SASL_LIBS=
2897 TLS_LIBS=
2898 MODULES_LIBS=
2899 SLAPI_LIBS=
2900 LIBSLAPI=
2901 LIBSLAPITOOLS=
2902 AUTH_LIBS=
2903
2904 SLAPD_SLP_LIBS=
2905
2906
2907 # Find a good install program.  We prefer a C program (faster),
2908 # so one script is as good as another.  But avoid the broken or
2909 # incompatible versions:
2910 # SysV /etc/install, /usr/sbin/install
2911 # SunOS /usr/etc/install
2912 # IRIX /sbin/install
2913 # AIX /bin/install
2914 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2915 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2916 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2917 # ./install, which can be erroneously created by make from ./install.sh.
2918 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
2919 echo "configure:2920: checking for a BSD compatible install" >&5
2920 if test -z "$INSTALL"; then
2921 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
2922   echo $ac_n "(cached) $ac_c" 1>&6
2923 else
2924     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
2925   for ac_dir in $PATH; do
2926     # Account for people who put trailing slashes in PATH elements.
2927     case "$ac_dir/" in
2928     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
2929     *)
2930       # OSF1 and SCO ODT 3.0 have their own names for install.
2931       # Don't use installbsd from OSF since it installs stuff as root
2932       # by default.
2933       for ac_prog in ginstall scoinst install; do
2934         if test -f $ac_dir/$ac_prog; then
2935           if test $ac_prog = install &&
2936             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
2937             # AIX install.  It has an incompatible calling convention.
2938             :
2939           elif test $ac_prog = install &&
2940             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
2941             # program-specific install script used by HP pwplus--don't use.
2942             :
2943           else
2944             ac_cv_path_install="$ac_dir/$ac_prog -c"
2945             break 2
2946           fi
2947         fi
2948       done
2949       ;;
2950     esac
2951   done
2952   IFS="$ac_save_IFS"
2953
2954 fi
2955   if test "${ac_cv_path_install+set}" = set; then
2956     INSTALL="$ac_cv_path_install"
2957   else
2958     # As a last resort, use the slow shell script.  We don't cache a
2959     # path for INSTALL within a source directory, because that will
2960     # break other packages using the cache if that directory is
2961     # removed, or if the path is relative.
2962     INSTALL="$ac_install_sh"
2963   fi
2964 fi
2965 echo "$ac_t""$INSTALL" 1>&6
2966
2967 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2968 # It thinks the first close brace ends the variable substitution.
2969 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2970
2971 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2972
2973 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2974
2975
2976 cat >> confdefs.h <<\EOF
2977 #define HAVE_MKVERSION 1
2978 EOF
2979
2980
2981
2982
2983 ol_aix_threads=no
2984 case "$target" in
2985 *-*-aix*)       if test -z "$CC" ; then
2986                 case "$ol_with_threads" in
2987                 auto | yes |  posix) ol_aix_threads=yes ;;
2988                 esac
2989         fi
2990 ;;
2991 esac
2992
2993 if test $ol_aix_threads = yes ; then
2994         if test -z "${CC}" ; then
2995                 for ac_prog in cc_r xlc_r cc
2996 do
2997 # Extract the first word of "$ac_prog", so it can be a program name with args.
2998 set dummy $ac_prog; ac_word=$2
2999 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3000 echo "configure:3001: checking for $ac_word" >&5
3001 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3002   echo $ac_n "(cached) $ac_c" 1>&6
3003 else
3004   if test -n "$CC"; then
3005   ac_cv_prog_CC="$CC" # Let the user override the test.
3006 else
3007   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3008   ac_dummy="$PATH"
3009   for ac_dir in $ac_dummy; do
3010     test -z "$ac_dir" && ac_dir=.
3011     if test -f $ac_dir/$ac_word; then
3012       ac_cv_prog_CC="$ac_prog"
3013       break
3014     fi
3015   done
3016   IFS="$ac_save_ifs"
3017 fi
3018 fi
3019 CC="$ac_cv_prog_CC"
3020 if test -n "$CC"; then
3021   echo "$ac_t""$CC" 1>&6
3022 else
3023   echo "$ac_t""no" 1>&6
3024 fi
3025
3026 test -n "$CC" && break
3027 done
3028
3029
3030                 if test "$CC" = cc ; then
3031                                                 if test $ol_with_threads != auto ; then
3032                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
3033                         else
3034                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
3035                         fi
3036                         ol_with_threads=no
3037                 fi
3038         fi
3039
3040         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
3041                 ol_with_threads=posix
3042                 ol_cv_pthread_create=yes
3043         fi
3044 fi
3045
3046 if test -z "${CC}"; then
3047         for ac_prog in cc gcc
3048 do
3049 # Extract the first word of "$ac_prog", so it can be a program name with args.
3050 set dummy $ac_prog; ac_word=$2
3051 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3052 echo "configure:3053: checking for $ac_word" >&5
3053 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3054   echo $ac_n "(cached) $ac_c" 1>&6
3055 else
3056   if test -n "$CC"; then
3057   ac_cv_prog_CC="$CC" # Let the user override the test.
3058 else
3059   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3060   ac_dummy="$PATH"
3061   for ac_dir in $ac_dummy; do
3062     test -z "$ac_dir" && ac_dir=.
3063     if test -f $ac_dir/$ac_word; then
3064       ac_cv_prog_CC="$ac_prog"
3065       break
3066     fi
3067   done
3068   IFS="$ac_save_ifs"
3069 fi
3070 fi
3071 CC="$ac_cv_prog_CC"
3072 if test -n "$CC"; then
3073   echo "$ac_t""$CC" 1>&6
3074 else
3075   echo "$ac_t""no" 1>&6
3076 fi
3077
3078 test -n "$CC" && break
3079 done
3080 test -n "$CC" || CC="missing"
3081
3082
3083         if test "${CC}" = "missing" ; then
3084                 { echo "configure: error: Unable to locate cc(1) or suitable replacement.  Check PATH or set CC." 1>&2; exit 1; }
3085         fi
3086 fi
3087
3088 if test -z "${AR}"; then
3089         for ac_prog in ar gar
3090 do
3091 # Extract the first word of "$ac_prog", so it can be a program name with args.
3092 set dummy $ac_prog; ac_word=$2
3093 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3094 echo "configure:3095: checking for $ac_word" >&5
3095 if eval "test \"\${ac_cv_prog_AR+set}\" = set"; then
3096   echo $ac_n "(cached) $ac_c" 1>&6
3097 else
3098   if test -n "$AR"; then
3099   ac_cv_prog_AR="$AR" # Let the user override the test.
3100 else
3101   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3102   ac_dummy="$PATH"
3103   for ac_dir in $ac_dummy; do
3104     test -z "$ac_dir" && ac_dir=.
3105     if test -f $ac_dir/$ac_word; then
3106       ac_cv_prog_AR="$ac_prog"
3107       break
3108     fi
3109   done
3110   IFS="$ac_save_ifs"
3111 fi
3112 fi
3113 AR="$ac_cv_prog_AR"
3114 if test -n "$AR"; then
3115   echo "$ac_t""$AR" 1>&6
3116 else
3117   echo "$ac_t""no" 1>&6
3118 fi
3119
3120 test -n "$AR" && break
3121 done
3122 test -n "$AR" || AR="missing"
3123
3124
3125         if test "${AR}" = "missing" ; then
3126                 { echo "configure: error: Unable to locate ar(1) or suitable replacement.  Check PATH or set AR." 1>&2; exit 1; }
3127         fi
3128 fi
3129
3130
3131
3132 # Find the correct PATH separator.  Usually this is `:', but
3133 # DJGPP uses `;' like DOS.
3134 if test "X${PATH_SEPARATOR+set}" != Xset; then
3135   UNAME=${UNAME-`uname 2>/dev/null`}
3136   case X$UNAME in
3137     *-DOS) lt_cv_sys_path_separator=';' ;;
3138     *)     lt_cv_sys_path_separator=':' ;;
3139   esac
3140   PATH_SEPARATOR=$lt_cv_sys_path_separator
3141 fi
3142
3143 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3144 echo "configure:3145: checking for Cygwin environment" >&5
3145 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
3146   echo $ac_n "(cached) $ac_c" 1>&6
3147 else
3148   cat > conftest.$ac_ext <<EOF
3149 #line 3150 "configure"
3150 #include "confdefs.h"
3151
3152 int main() {
3153
3154 #ifndef __CYGWIN__
3155 #define __CYGWIN__ __CYGWIN32__
3156 #endif
3157 return __CYGWIN__;
3158 ; return 0; }
3159 EOF
3160 if { (eval echo configure:3161: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3161   rm -rf conftest*
3162   ac_cv_cygwin=yes
3163 else
3164   echo "configure: failed program was:" >&5
3165   cat conftest.$ac_ext >&5
3166   rm -rf conftest*
3167   ac_cv_cygwin=no
3168 fi
3169 rm -f conftest*
3170 fi
3171
3172 echo "$ac_t""$ac_cv_cygwin" 1>&6
3173 CYGWIN=
3174 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3175 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3176 echo "configure:3177: checking for mingw32 environment" >&5
3177 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
3178   echo $ac_n "(cached) $ac_c" 1>&6
3179 else
3180   cat > conftest.$ac_ext <<EOF
3181 #line 3182 "configure"
3182 #include "confdefs.h"
3183
3184 int main() {
3185 return __MINGW32__;
3186 ; return 0; }
3187 EOF
3188 if { (eval echo configure:3189: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3189   rm -rf conftest*
3190   ac_cv_mingw32=yes
3191 else
3192   echo "configure: failed program was:" >&5
3193   cat conftest.$ac_ext >&5
3194   rm -rf conftest*
3195   ac_cv_mingw32=no
3196 fi
3197 rm -f conftest*
3198 fi
3199
3200 echo "$ac_t""$ac_cv_mingw32" 1>&6
3201 MINGW32=
3202 test "$ac_cv_mingw32" = yes && MINGW32=yes
3203 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
3204 echo "configure:3205: checking for EMX OS/2 environment" >&5
3205 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
3206   echo $ac_n "(cached) $ac_c" 1>&6
3207 else
3208   cat > conftest.$ac_ext <<EOF
3209 #line 3210 "configure"
3210 #include "confdefs.h"
3211
3212 int main() {
3213 return __EMX__;
3214 ; return 0; }
3215 EOF
3216 if { (eval echo configure:3217: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3217   rm -rf conftest*
3218   ac_cv_emxos2=yes
3219 else
3220   echo "configure: failed program was:" >&5
3221   cat conftest.$ac_ext >&5
3222   rm -rf conftest*
3223   ac_cv_emxos2=no
3224 fi
3225 rm -f conftest*
3226 fi
3227
3228 echo "$ac_t""$ac_cv_emxos2" 1>&6
3229 EMXOS2=
3230 test "$ac_cv_emxos2" = yes && EMXOS2=yes
3231 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3232 echo "configure:3233: checking how to run the C preprocessor" >&5
3233 # On Suns, sometimes $CPP names a directory.
3234 if test -n "$CPP" && test -d "$CPP"; then
3235   CPP=
3236 fi
3237 if test -z "$CPP"; then
3238 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3239   echo $ac_n "(cached) $ac_c" 1>&6
3240 else
3241     # This must be in double quotes, not single quotes, because CPP may get
3242   # substituted into the Makefile and "${CC-cc}" will confuse make.
3243   CPP="${CC-cc} -E"
3244   # On the NeXT, cc -E runs the code through the compiler's parser,
3245   # not just through cpp.
3246   cat > conftest.$ac_ext <<EOF
3247 #line 3248 "configure"
3248 #include "confdefs.h"
3249 #include <assert.h>
3250 Syntax Error
3251 EOF
3252 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3253 { (eval echo configure:3254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3254 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3255 if test -z "$ac_err"; then
3256   :
3257 else
3258   echo "$ac_err" >&5
3259   echo "configure: failed program was:" >&5
3260   cat conftest.$ac_ext >&5
3261   rm -rf conftest*
3262   CPP="${CC-cc} -E -traditional-cpp"
3263   cat > conftest.$ac_ext <<EOF
3264 #line 3265 "configure"
3265 #include "confdefs.h"
3266 #include <assert.h>
3267 Syntax Error
3268 EOF
3269 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3270 { (eval echo configure:3271: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3271 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3272 if test -z "$ac_err"; then
3273   :
3274 else
3275   echo "$ac_err" >&5
3276   echo "configure: failed program was:" >&5
3277   cat conftest.$ac_ext >&5
3278   rm -rf conftest*
3279   CPP="${CC-cc} -nologo -E"
3280   cat > conftest.$ac_ext <<EOF
3281 #line 3282 "configure"
3282 #include "confdefs.h"
3283 #include <assert.h>
3284 Syntax Error
3285 EOF
3286 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3287 { (eval echo configure:3288: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3288 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3289 if test -z "$ac_err"; then
3290   :
3291 else
3292   echo "$ac_err" >&5
3293   echo "configure: failed program was:" >&5
3294   cat conftest.$ac_ext >&5
3295   rm -rf conftest*
3296   CPP=/lib/cpp
3297 fi
3298 rm -f conftest*
3299 fi
3300 rm -f conftest*
3301 fi
3302 rm -f conftest*
3303   ac_cv_prog_CPP="$CPP"
3304 fi
3305   CPP="$ac_cv_prog_CPP"
3306 else
3307   ac_cv_prog_CPP="$CPP"
3308 fi
3309 echo "$ac_t""$CPP" 1>&6
3310
3311 # Check whether --enable-fast-install or --disable-fast-install was given.
3312 if test "${enable_fast_install+set}" = set; then
3313   enableval="$enable_fast_install"
3314   p=${PACKAGE-default}
3315 case $enableval in
3316 yes) enable_fast_install=yes ;;
3317 no) enable_fast_install=no ;;
3318 *)
3319   enable_fast_install=no
3320   # Look at the argument we got.  We use all the common list separators.
3321   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3322   for pkg in $enableval; do
3323     if test "X$pkg" = "X$p"; then
3324       enable_fast_install=yes
3325     fi
3326   done
3327   IFS="$ac_save_ifs"
3328   ;;
3329 esac
3330 else
3331   enable_fast_install=yes
3332 fi
3333
3334 # Extract the first word of "gcc", so it can be a program name with args.
3335 set dummy gcc; ac_word=$2
3336 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3337 echo "configure:3338: checking for $ac_word" >&5
3338 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3339   echo $ac_n "(cached) $ac_c" 1>&6
3340 else
3341   if test -n "$CC"; then
3342   ac_cv_prog_CC="$CC" # Let the user override the test.
3343 else
3344   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3345   ac_dummy="$PATH"
3346   for ac_dir in $ac_dummy; do
3347     test -z "$ac_dir" && ac_dir=.
3348     if test -f $ac_dir/$ac_word; then
3349       ac_cv_prog_CC="gcc"
3350       break
3351     fi
3352   done
3353   IFS="$ac_save_ifs"
3354 fi
3355 fi
3356 CC="$ac_cv_prog_CC"
3357 if test -n "$CC"; then
3358   echo "$ac_t""$CC" 1>&6
3359 else
3360   echo "$ac_t""no" 1>&6
3361 fi
3362
3363 if test -z "$CC"; then
3364   # Extract the first word of "cc", so it can be a program name with args.
3365 set dummy cc; ac_word=$2
3366 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3367 echo "configure:3368: checking for $ac_word" >&5
3368 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3369   echo $ac_n "(cached) $ac_c" 1>&6
3370 else
3371   if test -n "$CC"; then
3372   ac_cv_prog_CC="$CC" # Let the user override the test.
3373 else
3374   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3375   ac_prog_rejected=no
3376   ac_dummy="$PATH"
3377   for ac_dir in $ac_dummy; do
3378     test -z "$ac_dir" && ac_dir=.
3379     if test -f $ac_dir/$ac_word; then
3380       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
3381         ac_prog_rejected=yes
3382         continue
3383       fi
3384       ac_cv_prog_CC="cc"
3385       break
3386     fi
3387   done
3388   IFS="$ac_save_ifs"
3389 if test $ac_prog_rejected = yes; then
3390   # We found a bogon in the path, so make sure we never use it.
3391   set dummy $ac_cv_prog_CC
3392   shift
3393   if test $# -gt 0; then
3394     # We chose a different compiler from the bogus one.
3395     # However, it has the same basename, so the bogon will be chosen
3396     # first if we set CC to just the basename; use the full file name.
3397     shift
3398     set dummy "$ac_dir/$ac_word" "$@"
3399     shift
3400     ac_cv_prog_CC="$@"
3401   fi
3402 fi
3403 fi
3404 fi
3405 CC="$ac_cv_prog_CC"
3406 if test -n "$CC"; then
3407   echo "$ac_t""$CC" 1>&6
3408 else
3409   echo "$ac_t""no" 1>&6
3410 fi
3411
3412   if test -z "$CC"; then
3413     case "`uname -s`" in
3414     *win32* | *WIN32* | *CYGWIN*)
3415       # Extract the first word of "cl", so it can be a program name with args.
3416 set dummy cl; ac_word=$2
3417 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3418 echo "configure:3419: checking for $ac_word" >&5
3419 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3420   echo $ac_n "(cached) $ac_c" 1>&6
3421 else
3422   if test -n "$CC"; then
3423   ac_cv_prog_CC="$CC" # Let the user override the test.
3424 else
3425   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3426   ac_dummy="$PATH"
3427   for ac_dir in $ac_dummy; do
3428     test -z "$ac_dir" && ac_dir=.
3429     if test -f $ac_dir/$ac_word; then
3430       ac_cv_prog_CC="cl"
3431       break
3432     fi
3433   done
3434   IFS="$ac_save_ifs"
3435 fi
3436 fi
3437 CC="$ac_cv_prog_CC"
3438 if test -n "$CC"; then
3439   echo "$ac_t""$CC" 1>&6
3440 else
3441   echo "$ac_t""no" 1>&6
3442 fi
3443  ;;
3444     esac
3445   fi
3446   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
3447 fi
3448
3449 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
3450 echo "configure:3451: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
3451
3452 ac_ext=c
3453 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3454 ac_cpp='$CPP $CPPFLAGS'
3455 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3456 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3457 cross_compiling=$ac_cv_prog_cc_cross
3458
3459 cat > conftest.$ac_ext << EOF
3460
3461 #line 3462 "configure"
3462 #include "confdefs.h"
3463
3464 main(){return(0);}
3465 EOF
3466 if { (eval echo configure:3467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3467   ac_cv_prog_cc_works=yes
3468   # If we can't run a trivial program, we are probably using a cross compiler.
3469   if (./conftest; exit) 2>/dev/null; then
3470     ac_cv_prog_cc_cross=no
3471   else
3472     ac_cv_prog_cc_cross=yes
3473   fi
3474 else
3475   echo "configure: failed program was:" >&5
3476   cat conftest.$ac_ext >&5
3477   ac_cv_prog_cc_works=no
3478 fi
3479 rm -fr conftest*
3480 ac_ext=c
3481 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3482 ac_cpp='$CPP $CPPFLAGS'
3483 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3484 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3485 cross_compiling=$ac_cv_prog_cc_cross
3486
3487 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
3488 if test $ac_cv_prog_cc_works = no; then
3489   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
3490 fi
3491 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
3492 echo "configure:3493: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
3493 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
3494 cross_compiling=$ac_cv_prog_cc_cross
3495
3496 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
3497 echo "configure:3498: checking whether we are using GNU C" >&5
3498 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
3499   echo $ac_n "(cached) $ac_c" 1>&6
3500 else
3501   cat > conftest.c <<EOF
3502 #ifdef __GNUC__
3503   yes;
3504 #endif
3505 EOF
3506 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3507: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
3507   ac_cv_prog_gcc=yes
3508 else
3509   ac_cv_prog_gcc=no
3510 fi
3511 fi
3512
3513 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
3514
3515 if test $ac_cv_prog_gcc = yes; then
3516   GCC=yes
3517 else
3518   GCC=
3519 fi
3520
3521 ac_test_CFLAGS="${CFLAGS+set}"
3522 ac_save_CFLAGS="$CFLAGS"
3523 CFLAGS=
3524 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
3525 echo "configure:3526: checking whether ${CC-cc} accepts -g" >&5
3526 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
3527   echo $ac_n "(cached) $ac_c" 1>&6
3528 else
3529   echo 'void f(){}' > conftest.c
3530 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
3531   ac_cv_prog_cc_g=yes
3532 else
3533   ac_cv_prog_cc_g=no
3534 fi
3535 rm -f conftest*
3536
3537 fi
3538
3539 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
3540 if test "$ac_test_CFLAGS" = set; then
3541   CFLAGS="$ac_save_CFLAGS"
3542 elif test $ac_cv_prog_cc_g = yes; then
3543   if test "$GCC" = yes; then
3544     CFLAGS="-g -O2"
3545   else
3546     CFLAGS="-g"
3547   fi
3548 else
3549   if test "$GCC" = yes; then
3550     CFLAGS="-O2"
3551   else
3552     CFLAGS=
3553   fi
3554 fi
3555
3556 # Check whether --with-gnu-ld or --without-gnu-ld was given.
3557 if test "${with_gnu_ld+set}" = set; then
3558   withval="$with_gnu_ld"
3559   test "$withval" = no || with_gnu_ld=yes
3560 else
3561   with_gnu_ld=no
3562 fi
3563
3564 ac_prog=ld
3565 if test "$GCC" = yes; then
3566   # Check if gcc -print-prog-name=ld gives a path.
3567   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
3568 echo "configure:3569: checking for ld used by GCC" >&5
3569   case $host in
3570   *-*-mingw*)
3571     # gcc leaves a trailing carriage return which upsets mingw
3572     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3573   *)
3574     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3575   esac
3576   case $ac_prog in
3577     # Accept absolute paths.
3578     [\\/]* | [A-Za-z]:[\\/]*)
3579       re_direlt='/[^/][^/]*/\.\./'
3580       # Canonicalize the path of ld
3581       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3582       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3583         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3584       done
3585       test -z "$LD" && LD="$ac_prog"
3586       ;;
3587   "")
3588     # If it fails, then pretend we aren't using GCC.
3589     ac_prog=ld
3590     ;;
3591   *)
3592     # If it is relative, then search for the first ld in PATH.
3593     with_gnu_ld=unknown
3594     ;;
3595   esac
3596 elif test "$with_gnu_ld" = yes; then
3597   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
3598 echo "configure:3599: checking for GNU ld" >&5
3599 else
3600   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
3601 echo "configure:3602: checking for non-GNU ld" >&5
3602 fi
3603 if eval "test \"\${lt_cv_path_LD+set}\" = set"; then
3604   echo $ac_n "(cached) $ac_c" 1>&6
3605 else
3606   if test -z "$LD"; then
3607   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3608   for ac_dir in $PATH; do
3609     test -z "$ac_dir" && ac_dir=.
3610     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3611       lt_cv_path_LD="$ac_dir/$ac_prog"
3612       # Check to see if the program is GNU ld.  I'd rather use --version,
3613       # but apparently some GNU ld's only accept -v.
3614       # Break only if it was the GNU/non-GNU ld that we prefer.
3615       if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3616         test "$with_gnu_ld" != no && break
3617       else
3618         test "$with_gnu_ld" != yes && break
3619       fi
3620     fi
3621   done
3622   IFS="$ac_save_ifs"
3623 else
3624   lt_cv_path_LD="$LD" # Let the user override the test with a path.
3625 fi
3626 fi
3627
3628 LD="$lt_cv_path_LD"
3629 if test -n "$LD"; then
3630   echo "$ac_t""$LD" 1>&6
3631 else
3632   echo "$ac_t""no" 1>&6
3633 fi
3634 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
3635 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
3636 echo "configure:3637: checking if the linker ($LD) is GNU ld" >&5
3637 if eval "test \"\${lt_cv_prog_gnu_ld+set}\" = set"; then
3638   echo $ac_n "(cached) $ac_c" 1>&6
3639 else
3640   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
3641 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3642   lt_cv_prog_gnu_ld=yes
3643 else
3644   lt_cv_prog_gnu_ld=no
3645 fi
3646 fi
3647
3648 echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
3649 with_gnu_ld=$lt_cv_prog_gnu_ld
3650
3651
3652 echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
3653 echo "configure:3654: checking for $LD option to reload object files" >&5
3654 if eval "test \"\${lt_cv_ld_reload_flag+set}\" = set"; then
3655   echo $ac_n "(cached) $ac_c" 1>&6
3656 else
3657   lt_cv_ld_reload_flag='-r'
3658 fi
3659
3660 echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6
3661 reload_flag=$lt_cv_ld_reload_flag
3662 test -n "$reload_flag" && reload_flag=" $reload_flag"
3663
3664 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
3665 echo "configure:3666: checking for BSD-compatible nm" >&5
3666 if eval "test \"\${lt_cv_path_NM+set}\" = set"; then
3667   echo $ac_n "(cached) $ac_c" 1>&6
3668 else
3669   if test -n "$NM"; then
3670   # Let the user override the test.
3671   lt_cv_path_NM="$NM"
3672 else
3673   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3674   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3675     test -z "$ac_dir" && ac_dir=.
3676     tmp_nm=$ac_dir/${ac_tool_prefix}nm
3677     if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
3678       # Check to see if the nm accepts a BSD-compat flag.
3679       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3680       #   nm: unknown option "B" ignored
3681       # Tru64's nm complains that /dev/null is an invalid object file
3682       if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
3683         lt_cv_path_NM="$tmp_nm -B"
3684         break
3685       elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3686         lt_cv_path_NM="$tmp_nm -p"
3687         break
3688       else
3689         lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3690         continue # so that we can try to find one that supports BSD flags
3691       fi
3692     fi
3693   done
3694   IFS="$ac_save_ifs"
3695   test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
3696 fi
3697 fi
3698
3699 NM="$lt_cv_path_NM"
3700 echo "$ac_t""$NM" 1>&6
3701
3702 echo $ac_n "checking for a sed that does not truncate output""... $ac_c" 1>&6
3703 echo "configure:3704: checking for a sed that does not truncate output" >&5
3704 if eval "test \"\${lt_cv_path_SED+set}\" = set"; then
3705   echo $ac_n "(cached) $ac_c" 1>&6
3706 else
3707   # Loop through the user's path and test for sed and gsed.
3708 # Then use that list of sed's as ones to test for truncation.
3709 as_executable_p="test -f"
3710 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3711 for as_dir in $PATH
3712 do
3713   IFS=$as_save_IFS
3714   test -z "$as_dir" && as_dir=.
3715   for ac_prog in sed gsed; do
3716     for ac_exec_ext in '' $ac_executable_extensions; do
3717       if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
3718         _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
3719       fi
3720     done
3721   done
3722 done
3723
3724   # Create a temporary directory, and hook for its removal unless debugging.
3725 $debug ||
3726 {
3727   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
3728   trap '{ (exit 1); exit 1; }' 1 2 13 15
3729 }
3730
3731 # Create a (secure) tmp directory for tmp files.
3732 : ${TMPDIR=/tmp}
3733 {
3734   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
3735   test -n "$tmp" && test -d "$tmp"
3736 }  ||
3737 {
3738   tmp=$TMPDIR/sed$$-$RANDOM
3739   (umask 077 && mkdir $tmp)
3740 } ||
3741 {
3742    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
3743    { (exit 1); exit 1; }
3744 }
3745   _max=0
3746   _count=0
3747   # Add /usr/xpg4/bin/sed as it is typically found on Solaris
3748   # along with /bin/sed that truncates output.
3749   for _sed in $_sed_list /usr/xpg4/bin/sed; do
3750     test ! -f ${_sed} && break
3751     cat /dev/null > "$tmp/sed.in"
3752     _count=0
3753     echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
3754     # Check for GNU sed and select it if it is found.
3755     if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
3756       lt_cv_path_SED=${_sed}
3757       break
3758     fi
3759     while true; do
3760       cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
3761       mv "$tmp/sed.tmp" "$tmp/sed.in"
3762       cp "$tmp/sed.in" "$tmp/sed.nl"
3763       echo >>"$tmp/sed.nl"
3764       ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
3765       cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
3766       # 40000 chars as input seems more than enough
3767       test $_count -gt 10 && break
3768       _count=`expr $_count + 1`
3769       if test $_count -gt $_max; then
3770         _max=$_count
3771         lt_cv_path_SED=$_sed
3772       fi
3773     done
3774   done
3775   rm -rf "$tmp"
3776
3777 fi
3778
3779 if test "X$SED" != "X"; then
3780   lt_cv_path_SED=$SED
3781 else
3782   SED=$lt_cv_path_SED
3783 fi
3784 echo "$ac_t""$SED" 1>&6
3785
3786 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3787 echo "configure:3788: checking whether ln -s works" >&5
3788 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3789   echo $ac_n "(cached) $ac_c" 1>&6
3790 else
3791   rm -f conftestdata
3792 if ln -s X conftestdata 2>/dev/null
3793 then
3794   rm -f conftestdata
3795   ac_cv_prog_LN_S="ln -s"
3796 else
3797   ac_cv_prog_LN_S=ln
3798 fi
3799 fi
3800 LN_S="$ac_cv_prog_LN_S"
3801 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3802   echo "$ac_t""yes" 1>&6
3803 else
3804   echo "$ac_t""no" 1>&6
3805 fi
3806
3807 echo $ac_n "checking how to recognise dependent libraries""... $ac_c" 1>&6
3808 echo "configure:3809: checking how to recognise dependent libraries" >&5
3809 if eval "test \"\${lt_cv_deplibs_check_method+set}\" = set"; then
3810   echo $ac_n "(cached) $ac_c" 1>&6
3811 else
3812   lt_cv_file_magic_cmd='$MAGIC_CMD'
3813 lt_cv_file_magic_test_file=
3814 lt_cv_deplibs_check_method='unknown'
3815 # Need to set the preceding variable on all platforms that support
3816 # interlibrary dependencies.
3817 # 'none' -- dependencies not supported.
3818 # `unknown' -- same as none, but documents that we really don't know.
3819 # 'pass_all' -- all dependencies passed with no checks.
3820 # 'test_compile' -- check by making test program.
3821 # 'file_magic [[regex]]' -- check by looking for files in library path
3822 # which responds to the $file_magic_cmd with a given egrep regex.
3823 # If you have `file' or equivalent on your system and you're not sure
3824 # whether `pass_all' will *always* work, you probably want this one.
3825
3826 case $host_os in
3827 aix4* | aix5*)
3828   lt_cv_deplibs_check_method=pass_all
3829   ;;
3830
3831 beos*)
3832   lt_cv_deplibs_check_method=pass_all
3833   ;;
3834
3835 bsdi4*)
3836   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
3837   lt_cv_file_magic_cmd='/usr/bin/file -L'
3838   lt_cv_file_magic_test_file=/shlib/libc.so
3839   ;;
3840
3841 cygwin* | mingw* | pw32*)
3842   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3843   lt_cv_file_magic_cmd='$OBJDUMP -f'
3844   ;;
3845
3846 darwin* | rhapsody*)
3847   lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
3848   lt_cv_file_magic_cmd='/usr/bin/file -L'
3849   case "$host_os" in
3850   rhapsody* | darwin1.[012])
3851     lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
3852     ;;
3853   *) # Darwin 1.3 on
3854     lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
3855     ;;
3856   esac
3857   ;;
3858
3859 freebsd*)
3860   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3861     case $host_cpu in
3862     i*86 )
3863       # Not sure whether the presence of OpenBSD here was a mistake.
3864       # Let's accept both of them until this is cleared up.
3865       lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
3866       lt_cv_file_magic_cmd=/usr/bin/file
3867       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3868       ;;
3869     esac
3870   else
3871     lt_cv_deplibs_check_method=pass_all
3872   fi
3873   ;;
3874
3875 gnu*)
3876   lt_cv_deplibs_check_method=pass_all
3877   ;;
3878
3879 hpux10.20*|hpux11*)
3880   lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
3881   lt_cv_file_magic_cmd=/usr/bin/file
3882   lt_cv_file_magic_test_file=/usr/lib/libc.sl
3883   ;;
3884
3885 irix5* | irix6* | nonstopux*)
3886   case $host_os in
3887   irix5* | nonstopux*)
3888     # this will be overridden with pass_all, but let us keep it just in case
3889     lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
3890     ;;
3891   *)
3892     case $LD in
3893     *-32|*"-32 ") libmagic=32-bit;;
3894     *-n32|*"-n32 ") libmagic=N32;;
3895     *-64|*"-64 ") libmagic=64-bit;;
3896     *) libmagic=never-match;;
3897     esac
3898     # this will be overridden with pass_all, but let us keep it just in case
3899     lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
3900     ;;
3901   esac
3902   lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
3903   lt_cv_deplibs_check_method=pass_all
3904   ;;
3905
3906 # This must be Linux ELF.
3907 linux-gnu*)
3908   case $host_cpu in
3909   alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64*)
3910     lt_cv_deplibs_check_method=pass_all ;;
3911   *)
3912     # glibc up to 2.1.1 does not perform some relocations on ARM
3913     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
3914   esac
3915   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
3916   ;;
3917
3918 netbsd*)
3919   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3920     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
3921   else
3922     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
3923   fi
3924   ;;
3925
3926 newos6*)
3927   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
3928   lt_cv_file_magic_cmd=/usr/bin/file
3929   lt_cv_file_magic_test_file=/usr/lib/libnls.so
3930   ;;
3931
3932 openbsd*)
3933   lt_cv_file_magic_cmd=/usr/bin/file
3934   lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3935   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3936     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
3937   else
3938     lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
3939   fi
3940   ;;
3941
3942 osf3* | osf4* | osf5*)
3943   # this will be overridden with pass_all, but let us keep it just in case
3944   lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
3945   lt_cv_file_magic_test_file=/shlib/libc.so
3946   lt_cv_deplibs_check_method=pass_all
3947   ;;
3948
3949 sco3.2v5*)
3950   lt_cv_deplibs_check_method=pass_all
3951   ;;
3952
3953 solaris*)
3954   lt_cv_deplibs_check_method=pass_all
3955   lt_cv_file_magic_test_file=/lib/libc.so
3956   ;;
3957
3958 sysv5uw[78]* | sysv4*uw2*)
3959   lt_cv_deplibs_check_method=pass_all
3960   ;;
3961
3962 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
3963   case $host_vendor in
3964   motorola)
3965     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
3966     lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3967     ;;
3968   ncr)
3969     lt_cv_deplibs_check_method=pass_all
3970     ;;
3971   sequent)
3972     lt_cv_file_magic_cmd='/bin/file'
3973     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
3974     ;;
3975   sni)
3976     lt_cv_file_magic_cmd='/bin/file'
3977     lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
3978     lt_cv_file_magic_test_file=/lib/libc.so
3979     ;;
3980   siemens)
3981     lt_cv_deplibs_check_method=pass_all
3982     ;;
3983   esac
3984   ;;
3985 esac
3986
3987 fi
3988
3989 echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6
3990 file_magic_cmd=$lt_cv_file_magic_cmd
3991 deplibs_check_method=$lt_cv_deplibs_check_method
3992
3993 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
3994 echo "configure:3995: checking for object suffix" >&5
3995 if eval "test \"\${ac_cv_objext+set}\" = set"; then
3996   echo $ac_n "(cached) $ac_c" 1>&6
3997 else
3998   rm -f conftest*
3999 echo 'int i = 1;' > conftest.$ac_ext
4000 if { (eval echo configure:4001: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4001   for ac_file in conftest.*; do
4002     case $ac_file in
4003     *.c) ;;
4004     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
4005     esac
4006   done
4007 else
4008   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
4009 fi
4010 rm -f conftest*
4011 fi
4012
4013 echo "$ac_t""$ac_cv_objext" 1>&6
4014 OBJEXT=$ac_cv_objext
4015 ac_objext=$ac_cv_objext
4016
4017
4018
4019
4020 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
4021 echo "configure:4022: checking for executable suffix" >&5
4022 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
4023   echo $ac_n "(cached) $ac_c" 1>&6
4024 else
4025   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
4026   ac_cv_exeext=.exe
4027 else
4028   rm -f conftest*
4029   echo 'int main () { return 0; }' > conftest.$ac_ext
4030   ac_cv_exeext=
4031   if { (eval echo configure:4032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
4032     for file in conftest.*; do
4033       case $file in
4034       *.c | *.C | *.o | *.obj | *.xcoff) ;;
4035       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
4036       esac
4037     done
4038   else
4039     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
4040   fi
4041   rm -f conftest*
4042   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
4043 fi
4044 fi
4045
4046 EXEEXT=""
4047 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
4048 echo "$ac_t""${ac_cv_exeext}" 1>&6
4049 ac_exeext=$EXEEXT
4050
4051 if test $host != $build; then
4052   ac_tool_prefix=${host_alias}-
4053 else
4054   ac_tool_prefix=
4055 fi
4056
4057
4058
4059
4060 # Check for command to grab the raw symbol name followed by C symbol from nm.
4061 echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
4062 echo "configure:4063: checking command to parse $NM output" >&5
4063 if eval "test \"\${lt_cv_sys_global_symbol_pipe+set}\" = set"; then
4064   echo $ac_n "(cached) $ac_c" 1>&6
4065 else
4066   
4067 # These are sane defaults that work on at least a few old systems.
4068 # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4069
4070 # Character class describing NM global symbol codes.
4071 symcode='[BCDEGRST]'
4072
4073 # Regexp to match symbols that can be accessed directly from C.
4074 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
4075
4076 # Transform the above into a raw symbol and a C symbol.
4077 symxfrm='\1 \2\3 \3'
4078
4079 # Transform an extracted symbol line into a proper C declaration
4080 lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
4081
4082 # Transform an extracted symbol line into symbol name and symbol address
4083 lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
4084
4085 # Define system-specific variables.
4086 case $host_os in
4087 aix*)
4088   symcode='[BCDT]'
4089   ;;
4090 cygwin* | mingw* | pw32*)
4091   symcode='[ABCDGISTW]'
4092   ;;
4093 hpux*) # Its linker distinguishes data from code symbols
4094   lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4095   lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
4096   ;;
4097 irix* | nonstopux*)
4098   symcode='[BCDEGRST]'
4099   ;;
4100 osf*)
4101   symcode='[BCDEGQRST]'
4102   ;;
4103 solaris* | sysv5*)
4104   symcode='[BDT]'
4105   ;;
4106 sysv4)
4107   symcode='[DFNSTU]'
4108   ;;
4109 esac
4110
4111 # Handle CRLF in mingw tool chain
4112 opt_cr=
4113 case $host_os in
4114 mingw*)
4115   opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4116   ;;
4117 esac
4118
4119 # If we're using GNU nm, then use its standard symbol codes.
4120 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
4121   symcode='[ABCDGISTW]'
4122 fi
4123
4124 # Try without a prefix undercore, then with it.
4125 for ac_symprfx in "" "_"; do
4126
4127   # Write the raw and C identifiers.
4128 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[         ]\($symcode$symcode*\)[         ][      ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
4129
4130   # Check to see that the pipe works correctly.
4131   pipe_works=no
4132   rm -f conftest*
4133   cat > conftest.$ac_ext <<EOF
4134 #ifdef __cplusplus
4135 extern "C" {
4136 #endif
4137 char nm_test_var;
4138 void nm_test_func(){}
4139 #ifdef __cplusplus
4140 }
4141 #endif
4142 int main(){nm_test_var='a';nm_test_func();return(0);}
4143 EOF
4144
4145   if { (eval echo configure:4146: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4146     # Now try to grab the symbols.
4147     nlist=conftest.nm
4148     if { (eval echo configure:4149: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then
4149       # Try sorting and uniquifying the output.
4150       if sort "$nlist" | uniq > "$nlist"T; then
4151         mv -f "$nlist"T "$nlist"
4152       else
4153         rm -f "$nlist"T
4154       fi
4155
4156       # Make sure that we snagged all the symbols we need.
4157       if egrep ' nm_test_var$' "$nlist" >/dev/null; then
4158         if egrep ' nm_test_func$' "$nlist" >/dev/null; then
4159           cat <<EOF > conftest.$ac_ext
4160 #ifdef __cplusplus
4161 extern "C" {
4162 #endif
4163
4164 EOF
4165           # Now generate the symbol file.
4166           eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
4167
4168           cat <<EOF >> conftest.$ac_ext
4169 #if defined (__STDC__) && __STDC__
4170 # define lt_ptr void *
4171 #else
4172 # define lt_ptr char *
4173 # define const
4174 #endif
4175
4176 /* The mapping between symbol names and symbols. */
4177 const struct {
4178   const char *name;
4179   lt_ptr address;
4180 }
4181 lt_preloaded_symbols[] =
4182 {
4183 EOF
4184           sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
4185           cat <<\EOF >> conftest.$ac_ext
4186   {0, (lt_ptr) 0}
4187 };
4188
4189 #ifdef __cplusplus
4190 }
4191 #endif
4192 EOF
4193           # Now try linking the two files.
4194           mv conftest.$ac_objext conftstm.$ac_objext
4195           save_LIBS="$LIBS"
4196           save_CFLAGS="$CFLAGS"
4197           LIBS="conftstm.$ac_objext"
4198           CFLAGS="$CFLAGS$no_builtin_flag"
4199           if { (eval echo configure:4200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest$ac_exeext; then
4200             pipe_works=yes
4201           fi
4202           LIBS="$save_LIBS"
4203           CFLAGS="$save_CFLAGS"
4204         else
4205           echo "cannot find nm_test_func in $nlist" >&5
4206         fi
4207       else
4208         echo "cannot find nm_test_var in $nlist" >&5
4209       fi
4210     else
4211       echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
4212     fi
4213   else
4214     echo "$progname: failed program was:" >&5
4215     cat conftest.$ac_ext >&5
4216   fi
4217   rm -f conftest* conftst*
4218
4219   # Do not use the global_symbol_pipe unless it works.
4220   if test "$pipe_works" = yes; then
4221     break
4222   else
4223     lt_cv_sys_global_symbol_pipe=
4224   fi
4225 done
4226
4227 fi
4228
4229 global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
4230 if test -z "$lt_cv_sys_global_symbol_pipe"; then
4231   global_symbol_to_cdecl=
4232   global_symbol_to_c_name_address=
4233 else
4234   global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
4235   global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
4236 fi
4237 if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
4238 then
4239   echo "$ac_t""failed" 1>&6
4240 else
4241   echo "$ac_t""ok" 1>&6
4242 fi
4243
4244 for ac_hdr in dlfcn.h
4245 do
4246 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4247 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4248 echo "configure:4249: checking for $ac_hdr" >&5
4249 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4250   echo $ac_n "(cached) $ac_c" 1>&6
4251 else
4252   cat > conftest.$ac_ext <<EOF
4253 #line 4254 "configure"
4254 #include "confdefs.h"
4255 #include <$ac_hdr>
4256 EOF
4257 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4258 { (eval echo configure:4259: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4259 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4260 if test -z "$ac_err"; then
4261   rm -rf conftest*
4262   eval "ac_cv_header_$ac_safe=yes"
4263 else
4264   echo "$ac_err" >&5
4265   echo "configure: failed program was:" >&5
4266   cat conftest.$ac_ext >&5
4267   rm -rf conftest*
4268   eval "ac_cv_header_$ac_safe=no"
4269 fi
4270 rm -f conftest*
4271 fi
4272 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4273   echo "$ac_t""yes" 1>&6
4274     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4275   cat >> confdefs.h <<EOF
4276 #define $ac_tr_hdr 1
4277 EOF
4278  
4279 else
4280   echo "$ac_t""no" 1>&6
4281 fi
4282 done
4283
4284
4285
4286
4287
4288
4289 # Only perform the check for file, if the check method requires it
4290 case $deplibs_check_method in
4291 file_magic*)
4292   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
4293     echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
4294 echo "configure:4295: checking for ${ac_tool_prefix}file" >&5
4295 if eval "test \"\${lt_cv_path_MAGIC_CMD+set}\" = set"; then
4296   echo $ac_n "(cached) $ac_c" 1>&6
4297 else
4298   case $MAGIC_CMD in
4299   /*)
4300   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4301   ;;
4302   ?:/*)
4303   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
4304   ;;
4305   *)
4306   ac_save_MAGIC_CMD="$MAGIC_CMD"
4307   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4308   ac_dummy="/usr/bin:$PATH"
4309   for ac_dir in $ac_dummy; do
4310     test -z "$ac_dir" && ac_dir=.
4311     if test -f $ac_dir/${ac_tool_prefix}file; then
4312       lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
4313       if test -n "$file_magic_test_file"; then
4314         case $deplibs_check_method in
4315         "file_magic "*)
4316           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
4317           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4318           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4319             egrep "$file_magic_regex" > /dev/null; then
4320             :
4321           else
4322             cat <<EOF 1>&2
4323
4324 *** Warning: the command libtool uses to detect shared libraries,
4325 *** $file_magic_cmd, produces output that libtool cannot recognize.
4326 *** The result is that libtool may fail to recognize shared libraries
4327 *** as such.  This will affect the creation of libtool libraries that
4328 *** depend on shared libraries, but programs linked with such libtool
4329 *** libraries will work regardless of this problem.  Nevertheless, you
4330 *** may want to report the problem to your system manager and/or to
4331 *** bug-libtool@gnu.org
4332
4333 EOF
4334           fi ;;
4335         esac
4336       fi
4337       break
4338     fi
4339   done
4340   IFS="$ac_save_ifs"
4341   MAGIC_CMD="$ac_save_MAGIC_CMD"
4342   ;;
4343 esac
4344 fi
4345
4346 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4347 if test -n "$MAGIC_CMD"; then
4348   echo "$ac_t""$MAGIC_CMD" 1>&6
4349 else
4350   echo "$ac_t""no" 1>&6
4351 fi
4352
4353 if test -z "$lt_cv_path_MAGIC_CMD"; then
4354   if test -n "$ac_tool_prefix"; then
4355     echo $ac_n "checking for file""... $ac_c" 1>&6
4356 echo "configure:4357: checking for file" >&5
4357 if eval "test \"\${lt_cv_path_MAGIC_CMD+set}\" = set"; then
4358   echo $ac_n "(cached) $ac_c" 1>&6
4359 else
4360   case $MAGIC_CMD in
4361   /*)
4362   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4363   ;;
4364   ?:/*)
4365   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
4366   ;;
4367   *)
4368   ac_save_MAGIC_CMD="$MAGIC_CMD"
4369   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4370   ac_dummy="/usr/bin:$PATH"
4371   for ac_dir in $ac_dummy; do
4372     test -z "$ac_dir" && ac_dir=.
4373     if test -f $ac_dir/file; then
4374       lt_cv_path_MAGIC_CMD="$ac_dir/file"
4375       if test -n "$file_magic_test_file"; then
4376         case $deplibs_check_method in
4377         "file_magic "*)
4378           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
4379           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4380           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4381             egrep "$file_magic_regex" > /dev/null; then
4382             :
4383           else
4384             cat <<EOF 1>&2
4385
4386 *** Warning: the command libtool uses to detect shared libraries,
4387 *** $file_magic_cmd, produces output that libtool cannot recognize.
4388 *** The result is that libtool may fail to recognize shared libraries
4389 *** as such.  This will affect the creation of libtool libraries that
4390 *** depend on shared libraries, but programs linked with such libtool
4391 *** libraries will work regardless of this problem.  Nevertheless, you
4392 *** may want to report the problem to your system manager and/or to
4393 *** bug-libtool@gnu.org
4394
4395 EOF
4396           fi ;;
4397         esac
4398       fi
4399       break
4400     fi
4401   done
4402   IFS="$ac_save_ifs"
4403   MAGIC_CMD="$ac_save_MAGIC_CMD"
4404   ;;
4405 esac
4406 fi
4407
4408 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4409 if test -n "$MAGIC_CMD"; then
4410   echo "$ac_t""$MAGIC_CMD" 1>&6
4411 else
4412   echo "$ac_t""no" 1>&6
4413 fi
4414
4415   else
4416     MAGIC_CMD=:
4417   fi
4418 fi
4419
4420   fi
4421   ;;
4422 esac
4423
4424 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
4425 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
4426 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4427 echo "configure:4428: checking for $ac_word" >&5
4428 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
4429   echo $ac_n "(cached) $ac_c" 1>&6
4430 else
4431   if test -n "$RANLIB"; then
4432   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
4433 else
4434   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4435   ac_dummy="$PATH"
4436   for ac_dir in $ac_dummy; do
4437     test -z "$ac_dir" && ac_dir=.
4438     if test -f $ac_dir/$ac_word; then
4439       ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
4440       break
4441     fi
4442   done
4443   IFS="$ac_save_ifs"
4444 fi
4445 fi
4446 RANLIB="$ac_cv_prog_RANLIB"
4447 if test -n "$RANLIB"; then
4448   echo "$ac_t""$RANLIB" 1>&6
4449 else
4450   echo "$ac_t""no" 1>&6
4451 fi
4452
4453
4454 if test -z "$ac_cv_prog_RANLIB"; then
4455 if test -n "$ac_tool_prefix"; then
4456   # Extract the first word of "ranlib", so it can be a program name with args.
4457 set dummy ranlib; ac_word=$2
4458 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4459 echo "configure:4460: checking for $ac_word" >&5
4460 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
4461   echo $ac_n "(cached) $ac_c" 1>&6
4462 else
4463   if test -n "$RANLIB"; then
4464   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
4465 else
4466   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4467   ac_dummy="$PATH"
4468   for ac_dir in $ac_dummy; do
4469     test -z "$ac_dir" && ac_dir=.
4470     if test -f $ac_dir/$ac_word; then
4471       ac_cv_prog_RANLIB="ranlib"
4472       break
4473     fi
4474   done
4475   IFS="$ac_save_ifs"
4476   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
4477 fi
4478 fi
4479 RANLIB="$ac_cv_prog_RANLIB"
4480 if test -n "$RANLIB"; then
4481   echo "$ac_t""$RANLIB" 1>&6
4482 else
4483   echo "$ac_t""no" 1>&6
4484 fi
4485
4486 else
4487   RANLIB=":"
4488 fi
4489 fi
4490
4491 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
4492 set dummy ${ac_tool_prefix}strip; ac_word=$2
4493 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4494 echo "configure:4495: checking for $ac_word" >&5
4495 if eval "test \"\${ac_cv_prog_STRIP+set}\" = set"; then
4496   echo $ac_n "(cached) $ac_c" 1>&6
4497 else
4498   if test -n "$STRIP"; then
4499   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
4500 else
4501   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4502   ac_dummy="$PATH"
4503   for ac_dir in $ac_dummy; do
4504     test -z "$ac_dir" && ac_dir=.
4505     if test -f $ac_dir/$ac_word; then
4506       ac_cv_prog_STRIP="${ac_tool_prefix}strip"
4507       break
4508     fi
4509   done
4510   IFS="$ac_save_ifs"
4511 fi
4512 fi
4513 STRIP="$ac_cv_prog_STRIP"
4514 if test -n "$STRIP"; then
4515   echo "$ac_t""$STRIP" 1>&6
4516 else
4517   echo "$ac_t""no" 1>&6
4518 fi
4519
4520
4521 if test -z "$ac_cv_prog_STRIP"; then
4522 if test -n "$ac_tool_prefix"; then
4523   # Extract the first word of "strip", so it can be a program name with args.
4524 set dummy strip; ac_word=$2
4525 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4526 echo "configure:4527: checking for $ac_word" >&5
4527 if eval "test \"\${ac_cv_prog_STRIP+set}\" = set"; then
4528   echo $ac_n "(cached) $ac_c" 1>&6
4529 else
4530   if test -n "$STRIP"; then
4531   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
4532 else
4533   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4534   ac_dummy="$PATH"
4535   for ac_dir in $ac_dummy; do
4536     test -z "$ac_dir" && ac_dir=.
4537     if test -f $ac_dir/$ac_word; then
4538       ac_cv_prog_STRIP="strip"
4539       break
4540     fi
4541   done
4542   IFS="$ac_save_ifs"
4543   test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
4544 fi
4545 fi
4546 STRIP="$ac_cv_prog_STRIP"
4547 if test -n "$STRIP"; then
4548   echo "$ac_t""$STRIP" 1>&6
4549 else
4550   echo "$ac_t""no" 1>&6
4551 fi
4552
4553 else
4554   STRIP=":"
4555 fi
4556 fi
4557
4558
4559 enable_dlopen=yes
4560 enable_win32_dll=yes
4561
4562 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
4563 if test "${enable_libtool_lock+set}" = set; then
4564   enableval="$enable_libtool_lock"
4565   :
4566 fi
4567
4568 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
4569
4570 # Some flags need to be propagated to the compiler or linker for good
4571 # libtool support.
4572 case $host in
4573 *-*-irix6*)
4574   # Find out which ABI we are using.
4575   echo '#line 4576 "configure"' > conftest.$ac_ext
4576   if { (eval echo configure:4577: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4577     case `/usr/bin/file conftest.$ac_objext` in
4578     *32-bit*)
4579       LD="${LD-ld} -32"
4580       ;;
4581     *N32*)
4582       LD="${LD-ld} -n32"
4583       ;;
4584     *64-bit*)
4585       LD="${LD-ld} -64"
4586       ;;
4587     esac
4588   fi
4589   rm -rf conftest*
4590   ;;
4591
4592 *-*-sco3.2v5*)
4593   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
4594   SAVE_CFLAGS="$CFLAGS"
4595   CFLAGS="$CFLAGS -belf"
4596   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
4597 echo "configure:4598: checking whether the C compiler needs -belf" >&5
4598 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
4599   echo $ac_n "(cached) $ac_c" 1>&6
4600 else
4601   
4602      ac_ext=c
4603 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
4604 ac_cpp='$CPP $CPPFLAGS'
4605 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
4606 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
4607 cross_compiling=$ac_cv_prog_cc_cross
4608
4609      cat > conftest.$ac_ext <<EOF
4610 #line 4611 "configure"
4611 #include "confdefs.h"
4612
4613 int main() {
4614
4615 ; return 0; }
4616 EOF
4617 if { (eval echo configure:4618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4618   rm -rf conftest*
4619   lt_cv_cc_needs_belf=yes
4620 else
4621   echo "configure: failed program was:" >&5
4622   cat conftest.$ac_ext >&5
4623   rm -rf conftest*
4624   lt_cv_cc_needs_belf=no
4625 fi
4626 rm -f conftest*
4627      ac_ext=c
4628 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
4629 ac_cpp='$CPP $CPPFLAGS'
4630 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
4631 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
4632 cross_compiling=$ac_cv_prog_cc_cross
4633
4634 fi
4635
4636 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
4637   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
4638     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
4639     CFLAGS="$SAVE_CFLAGS"
4640   fi
4641   ;;
4642
4643 *-*-cygwin* | *-*-mingw* | *-*-pw32*)
4644   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
4645 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
4646 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4647 echo "configure:4648: checking for $ac_word" >&5
4648 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
4649   echo $ac_n "(cached) $ac_c" 1>&6
4650 else
4651   if test -n "$DLLTOOL"; then
4652   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
4653 else
4654   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4655   ac_dummy="$PATH"
4656   for ac_dir in $ac_dummy; do
4657     test -z "$ac_dir" && ac_dir=.
4658     if test -f $ac_dir/$ac_word; then
4659       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
4660       break
4661     fi
4662   done
4663   IFS="$ac_save_ifs"
4664 fi
4665 fi
4666 DLLTOOL="$ac_cv_prog_DLLTOOL"
4667 if test -n "$DLLTOOL"; then
4668   echo "$ac_t""$DLLTOOL" 1>&6
4669 else
4670   echo "$ac_t""no" 1>&6
4671 fi
4672
4673
4674 if test -z "$ac_cv_prog_DLLTOOL"; then
4675 if test -n "$ac_tool_prefix"; then
4676   # Extract the first word of "dlltool", so it can be a program name with args.
4677 set dummy dlltool; ac_word=$2
4678 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4679 echo "configure:4680: checking for $ac_word" >&5
4680 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
4681   echo $ac_n "(cached) $ac_c" 1>&6
4682 else
4683   if test -n "$DLLTOOL"; then
4684   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
4685 else
4686   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4687   ac_dummy="$PATH"
4688   for ac_dir in $ac_dummy; do
4689     test -z "$ac_dir" && ac_dir=.
4690     if test -f $ac_dir/$ac_word; then
4691       ac_cv_prog_DLLTOOL="dlltool"
4692       break
4693     fi
4694   done
4695   IFS="$ac_save_ifs"
4696   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
4697 fi
4698 fi
4699 DLLTOOL="$ac_cv_prog_DLLTOOL"
4700 if test -n "$DLLTOOL"; then
4701   echo "$ac_t""$DLLTOOL" 1>&6
4702 else
4703   echo "$ac_t""no" 1>&6
4704 fi
4705
4706 else
4707   DLLTOOL="false"
4708 fi
4709 fi
4710
4711   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
4712 set dummy ${ac_tool_prefix}as; ac_word=$2
4713 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4714 echo "configure:4715: checking for $ac_word" >&5
4715 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
4716   echo $ac_n "(cached) $ac_c" 1>&6
4717 else
4718   if test -n "$AS"; then
4719   ac_cv_prog_AS="$AS" # Let the user override the test.
4720 else
4721   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4722   ac_dummy="$PATH"
4723   for ac_dir in $ac_dummy; do
4724     test -z "$ac_dir" && ac_dir=.
4725     if test -f $ac_dir/$ac_word; then
4726       ac_cv_prog_AS="${ac_tool_prefix}as"
4727       break
4728     fi
4729   done
4730   IFS="$ac_save_ifs"
4731 fi
4732 fi
4733 AS="$ac_cv_prog_AS"
4734 if test -n "$AS"; then
4735   echo "$ac_t""$AS" 1>&6
4736 else
4737   echo "$ac_t""no" 1>&6
4738 fi
4739
4740
4741 if test -z "$ac_cv_prog_AS"; then
4742 if test -n "$ac_tool_prefix"; then
4743   # Extract the first word of "as", so it can be a program name with args.
4744 set dummy as; ac_word=$2
4745 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4746 echo "configure:4747: checking for $ac_word" >&5
4747 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
4748   echo $ac_n "(cached) $ac_c" 1>&6
4749 else
4750   if test -n "$AS"; then
4751   ac_cv_prog_AS="$AS" # Let the user override the test.
4752 else
4753   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4754   ac_dummy="$PATH"
4755   for ac_dir in $ac_dummy; do
4756     test -z "$ac_dir" && ac_dir=.
4757     if test -f $ac_dir/$ac_word; then
4758       ac_cv_prog_AS="as"
4759       break
4760     fi
4761   done
4762   IFS="$ac_save_ifs"
4763   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
4764 fi
4765 fi
4766 AS="$ac_cv_prog_AS"
4767 if test -n "$AS"; then
4768   echo "$ac_t""$AS" 1>&6
4769 else
4770   echo "$ac_t""no" 1>&6
4771 fi
4772
4773 else
4774   AS="false"
4775 fi
4776 fi
4777
4778   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
4779 set dummy ${ac_tool_prefix}objdump; ac_word=$2
4780 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4781 echo "configure:4782: checking for $ac_word" >&5
4782 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
4783   echo $ac_n "(cached) $ac_c" 1>&6
4784 else
4785   if test -n "$OBJDUMP"; then
4786   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
4787 else
4788   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4789   ac_dummy="$PATH"
4790   for ac_dir in $ac_dummy; do
4791     test -z "$ac_dir" && ac_dir=.
4792     if test -f $ac_dir/$ac_word; then
4793       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
4794       break
4795     fi
4796   done
4797   IFS="$ac_save_ifs"
4798 fi
4799 fi
4800 OBJDUMP="$ac_cv_prog_OBJDUMP"
4801 if test -n "$OBJDUMP"; then
4802   echo "$ac_t""$OBJDUMP" 1>&6
4803 else
4804   echo "$ac_t""no" 1>&6
4805 fi
4806
4807
4808 if test -z "$ac_cv_prog_OBJDUMP"; then
4809 if test -n "$ac_tool_prefix"; then
4810   # Extract the first word of "objdump", so it can be a program name with args.
4811 set dummy objdump; ac_word=$2
4812 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4813 echo "configure:4814: checking for $ac_word" >&5
4814 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
4815   echo $ac_n "(cached) $ac_c" 1>&6
4816 else
4817   if test -n "$OBJDUMP"; then
4818   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
4819 else
4820   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4821   ac_dummy="$PATH"
4822   for ac_dir in $ac_dummy; do
4823     test -z "$ac_dir" && ac_dir=.
4824     if test -f $ac_dir/$ac_word; then
4825       ac_cv_prog_OBJDUMP="objdump"
4826       break
4827     fi
4828   done
4829   IFS="$ac_save_ifs"
4830   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
4831 fi
4832 fi
4833 OBJDUMP="$ac_cv_prog_OBJDUMP"
4834 if test -n "$OBJDUMP"; then
4835   echo "$ac_t""$OBJDUMP" 1>&6
4836 else
4837   echo "$ac_t""no" 1>&6
4838 fi
4839
4840 else
4841   OBJDUMP="false"
4842 fi
4843 fi
4844
4845
4846   # recent cygwin and mingw systems supply a stub DllMain which the user
4847   # can override, but on older systems we have to supply one
4848   echo $ac_n "checking if libtool should supply DllMain function""... $ac_c" 1>&6
4849 echo "configure:4850: checking if libtool should supply DllMain function" >&5
4850 if eval "test \"\${lt_cv_need_dllmain+set}\" = set"; then
4851   echo $ac_n "(cached) $ac_c" 1>&6
4852 else
4853   cat > conftest.$ac_ext <<EOF
4854 #line 4855 "configure"
4855 #include "confdefs.h"
4856
4857 int main() {
4858 extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
4859       DllMain (0, 0, 0);
4860 ; return 0; }
4861 EOF
4862 if { (eval echo configure:4863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4863   rm -rf conftest*
4864   lt_cv_need_dllmain=no
4865 else
4866   echo "configure: failed program was:" >&5
4867   cat conftest.$ac_ext >&5
4868   rm -rf conftest*
4869   lt_cv_need_dllmain=yes
4870 fi
4871 rm -f conftest*
4872 fi
4873
4874 echo "$ac_t""$lt_cv_need_dllmain" 1>&6
4875
4876   case $host/$CC in
4877   *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
4878     # old mingw systems require "-dll" to link a DLL, while more recent ones
4879     # require "-mdll"
4880     SAVE_CFLAGS="$CFLAGS"
4881     CFLAGS="$CFLAGS -mdll"
4882     echo $ac_n "checking how to link DLLs""... $ac_c" 1>&6
4883 echo "configure:4884: checking how to link DLLs" >&5
4884 if eval "test \"\${lt_cv_cc_dll_switch+set}\" = set"; then
4885   echo $ac_n "(cached) $ac_c" 1>&6
4886 else
4887   cat > conftest.$ac_ext <<EOF
4888 #line 4889 "configure"
4889 #include "confdefs.h"
4890
4891 int main() {
4892
4893 ; return 0; }
4894 EOF
4895 if { (eval echo configure:4896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4896   rm -rf conftest*
4897   lt_cv_cc_dll_switch=-mdll
4898 else
4899   echo "configure: failed program was:" >&5
4900   cat conftest.$ac_ext >&5
4901   rm -rf conftest*
4902   lt_cv_cc_dll_switch=-dll
4903 fi
4904 rm -f conftest*
4905 fi
4906
4907 echo "$ac_t""$lt_cv_cc_dll_switch" 1>&6
4908     CFLAGS="$SAVE_CFLAGS" ;;
4909   *-*-cygwin* | *-*-pw32*)
4910     # cygwin systems need to pass --dll to the linker, and not link
4911     # crt.o which will require a WinMain@16 definition.
4912     lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
4913   esac
4914   ;;
4915   
4916 esac
4917
4918 # Sed substitution that helps us do robust quoting.  It backslashifies
4919 # metacharacters that are still active within double-quoted strings.
4920 Xsed='sed -e s/^X//'
4921 sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
4922
4923 # Same as above, but do not quote variable references.
4924 double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
4925
4926 # Sed substitution to delay expansion of an escaped shell variable in a
4927 # double_quote_subst'ed string.
4928 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
4929
4930 # Constants:
4931 rm="rm -f"
4932
4933 # Global variables:
4934 default_ofile=libtool
4935 can_build_shared=yes
4936
4937 # All known linkers require a `.a' archive for static linking (except M$VC,
4938 # which needs '.lib').
4939 libext=a
4940 ltmain="$ac_aux_dir/ltmain.sh"
4941 ofile="$default_ofile"
4942 with_gnu_ld="$lt_cv_prog_gnu_ld"
4943 need_locks="$enable_libtool_lock"
4944
4945 old_CC="$CC"
4946 old_CFLAGS="$CFLAGS"
4947
4948 # Set sane defaults for various variables
4949 test -z "$AR" && AR=ar
4950 test -z "$AR_FLAGS" && AR_FLAGS=cru
4951 test -z "$AS" && AS=as
4952 test -z "$CC" && CC=cc
4953 test -z "$DLLTOOL" && DLLTOOL=dlltool
4954 test -z "$LD" && LD=ld
4955 test -z "$LN_S" && LN_S="ln -s"
4956 test -z "$MAGIC_CMD" && MAGIC_CMD=file
4957 test -z "$NM" && NM=nm
4958 test -z "$OBJDUMP" && OBJDUMP=objdump
4959 test -z "$RANLIB" && RANLIB=:
4960 test -z "$STRIP" && STRIP=:
4961 test -z "$ac_objext" && ac_objext=o
4962
4963 if test x"$host" != x"$build"; then
4964   ac_tool_prefix=${host_alias}-
4965 else
4966   ac_tool_prefix=
4967 fi
4968
4969 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
4970 case $host_os in
4971 linux-gnu*) ;;
4972 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
4973 esac
4974
4975 case $host_os in
4976 aix3*)
4977   # AIX sometimes has problems with the GCC collect2 program.  For some
4978   # reason, if we set the COLLECT_NAMES environment variable, the problems
4979   # vanish in a puff of smoke.
4980   if test "X${COLLECT_NAMES+set}" != Xset; then
4981     COLLECT_NAMES=
4982     export COLLECT_NAMES
4983   fi
4984   ;;
4985 esac
4986
4987 # Determine commands to create old-style static archives.
4988 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
4989 old_postinstall_cmds='chmod 644 $oldlib'
4990 old_postuninstall_cmds=
4991
4992 if test -n "$RANLIB"; then
4993   case $host_os in
4994   openbsd*)
4995     old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
4996     ;;
4997   *)
4998     old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
4999     ;;
5000   esac
5001   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
5002 fi
5003
5004 # Allow CC to be a program name with arguments.
5005 set dummy $CC
5006 compiler="$2"
5007
5008 echo $ac_n "checking for objdir""... $ac_c" 1>&6
5009 echo "configure:5010: checking for objdir" >&5
5010 rm -f .libs 2>/dev/null
5011 mkdir .libs 2>/dev/null
5012 if test -d .libs; then
5013   objdir=.libs
5014 else
5015   # MS-DOS does not allow filenames that begin with a dot.
5016   objdir=_libs
5017 fi
5018 rmdir .libs 2>/dev/null
5019 echo "$ac_t""$objdir" 1>&6
5020
5021
5022 # Check whether --with-pic or --without-pic was given.
5023 if test "${with_pic+set}" = set; then
5024   withval="$with_pic"
5025   pic_mode="$withval"
5026 else
5027   pic_mode=default
5028 fi
5029
5030 test -z "$pic_mode" && pic_mode=default
5031
5032 # We assume here that the value for lt_cv_prog_cc_pic will not be cached
5033 # in isolation, and that seeing it set (from the cache) indicates that
5034 # the associated values are set (in the cache) correctly too.
5035 echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6
5036 echo "configure:5037: checking for $compiler option to produce PIC" >&5
5037 if eval "test \"\${lt_cv_prog_cc_pic+set}\" = set"; then
5038   echo $ac_n "(cached) $ac_c" 1>&6
5039 else
5040    lt_cv_prog_cc_pic=
5041   lt_cv_prog_cc_shlib=
5042   lt_cv_prog_cc_wl=
5043   lt_cv_prog_cc_static=
5044   lt_cv_prog_cc_no_builtin=
5045   lt_cv_prog_cc_can_build_shared=$can_build_shared
5046
5047   if test "$GCC" = yes; then
5048     lt_cv_prog_cc_wl='-Wl,'
5049     lt_cv_prog_cc_static='-static'
5050
5051     case $host_os in
5052     aix*)
5053       # Below there is a dirty hack to force normal static linking with -ldl
5054       # The problem is because libdl dynamically linked with both libc and
5055       # libC (AIX C++ library), which obviously doesn't included in libraries
5056       # list by gcc. This cause undefined symbols with -static flags.
5057       # This hack allows C programs to be linked with "-static -ldl", but
5058       # not sure about C++ programs.
5059       lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
5060       ;;
5061     amigaos*)
5062       # FIXME: we need at least 68020 code to build shared libraries, but
5063       # adding the `-m68020' flag to GCC prevents building anything better,
5064       # like `-m68040'.
5065       lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
5066       ;;
5067     beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5068       # PIC is the default for these OSes.
5069       ;;
5070     darwin* | rhapsody*)
5071       # PIC is the default on this platform
5072       # Common symbols not allowed in MH_DYLIB files
5073       lt_cv_prog_cc_pic='-fno-common'
5074       ;;
5075     cygwin* | mingw* | pw32* | os2*)
5076       # This hack is so that the source file can tell whether it is being
5077       # built for inclusion in a dll (and should export symbols for example).
5078       lt_cv_prog_cc_pic='-DDLL_EXPORT'
5079       ;;
5080     sysv4*MP*)
5081       if test -d /usr/nec; then
5082          lt_cv_prog_cc_pic=-Kconform_pic
5083       fi
5084       ;;
5085     *)
5086       lt_cv_prog_cc_pic='-fPIC'
5087       ;;
5088     esac
5089   else
5090     # PORTME Check for PIC flags for the system compiler.
5091     case $host_os in
5092     aix3* | aix4* | aix5*)
5093       lt_cv_prog_cc_wl='-Wl,'
5094       # All AIX code is PIC.
5095       if test "$host_cpu" = ia64; then
5096         # AIX 5 now supports IA64 processor
5097         lt_cv_prog_cc_static='-Bstatic'
5098       else
5099         lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
5100       fi
5101       ;;
5102
5103     hpux9* | hpux10* | hpux11*)
5104       # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
5105       lt_cv_prog_cc_wl='-Wl,'
5106       lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
5107       lt_cv_prog_cc_pic='+Z'
5108       ;;
5109
5110     irix5* | irix6* | nonstopux*)
5111       lt_cv_prog_cc_wl='-Wl,'
5112       lt_cv_prog_cc_static='-non_shared'
5113       # PIC (with -KPIC) is the default.
5114       ;;
5115
5116     cygwin* | mingw* | pw32* | os2*)
5117       # This hack is so that the source file can tell whether it is being
5118       # built for inclusion in a dll (and should export symbols for example).
5119       lt_cv_prog_cc_pic='-DDLL_EXPORT'
5120       ;;
5121
5122     newsos6)
5123       lt_cv_prog_cc_pic='-KPIC'
5124       lt_cv_prog_cc_static='-Bstatic'
5125       ;;
5126
5127     osf3* | osf4* | osf5*)
5128       # All OSF/1 code is PIC.
5129       lt_cv_prog_cc_wl='-Wl,'
5130       lt_cv_prog_cc_static='-non_shared'
5131       ;;
5132
5133     sco3.2v5*)
5134       lt_cv_prog_cc_pic='-Kpic'
5135       lt_cv_prog_cc_static='-dn'
5136       lt_cv_prog_cc_shlib='-belf'
5137       ;;
5138
5139     solaris*)
5140       lt_cv_prog_cc_pic='-KPIC'
5141       lt_cv_prog_cc_static='-Bstatic'
5142       lt_cv_prog_cc_wl='-Wl,'
5143       ;;
5144
5145     sunos4*)
5146       lt_cv_prog_cc_pic='-PIC'
5147       lt_cv_prog_cc_static='-Bstatic'
5148       lt_cv_prog_cc_wl='-Qoption ld '
5149       ;;
5150
5151     sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5152       lt_cv_prog_cc_pic='-KPIC'
5153       lt_cv_prog_cc_static='-Bstatic'
5154       lt_cv_prog_cc_wl='-Wl,'
5155       ;;
5156
5157     uts4*)
5158       lt_cv_prog_cc_pic='-pic'
5159       lt_cv_prog_cc_static='-Bstatic'
5160       ;;
5161
5162     sysv4*MP*)
5163       if test -d /usr/nec ;then
5164         lt_cv_prog_cc_pic='-Kconform_pic'
5165         lt_cv_prog_cc_static='-Bstatic'
5166       fi
5167       ;;
5168
5169     *)
5170       lt_cv_prog_cc_can_build_shared=no
5171       ;;
5172     esac
5173   fi
5174
5175 fi
5176
5177 if test -z "$lt_cv_prog_cc_pic"; then
5178   echo "$ac_t""none" 1>&6
5179 else
5180   echo "$ac_t""$lt_cv_prog_cc_pic" 1>&6
5181
5182   # Check to make sure the pic_flag actually works.
5183   echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6
5184 echo "configure:5185: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
5185   if eval "test \"\${lt_cv_prog_cc_pic_works+set}\" = set"; then
5186   echo $ac_n "(cached) $ac_c" 1>&6
5187 else
5188       save_CFLAGS="$CFLAGS"
5189     CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
5190     cat > conftest.$ac_ext <<EOF
5191 #line 5192 "configure"
5192 #include "confdefs.h"
5193
5194 int main() {
5195
5196 ; return 0; }
5197 EOF
5198 if { (eval echo configure:5199: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5199   rm -rf conftest*
5200         case $host_os in
5201       hpux9* | hpux10* | hpux11*)
5202         # On HP-UX, both CC and GCC only warn that PIC is supported... then
5203         # they create non-PIC objects.  So, if there were any warnings, we
5204         # assume that PIC is not supported.
5205         if test -s conftest.err; then
5206           lt_cv_prog_cc_pic_works=no
5207         else
5208           lt_cv_prog_cc_pic_works=yes
5209         fi
5210         ;;
5211       *)
5212         lt_cv_prog_cc_pic_works=yes
5213         ;;
5214       esac
5215     
5216 else
5217   echo "configure: failed program was:" >&5
5218   cat conftest.$ac_ext >&5
5219   rm -rf conftest*
5220         lt_cv_prog_cc_pic_works=no
5221     
5222 fi
5223 rm -f conftest*
5224     CFLAGS="$save_CFLAGS"
5225   
5226 fi
5227
5228
5229   if test "X$lt_cv_prog_cc_pic_works" = Xno; then
5230     lt_cv_prog_cc_pic=
5231     lt_cv_prog_cc_can_build_shared=no
5232   else
5233     lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
5234   fi
5235
5236   echo "$ac_t""$lt_cv_prog_cc_pic_works" 1>&6
5237 fi
5238
5239 # Check for any special shared library compilation flags.
5240 if test -n "$lt_cv_prog_cc_shlib"; then
5241   echo "configure: warning: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" 1>&2
5242   if echo "$old_CC $old_CFLAGS " | egrep -e "[  ]$lt_cv_prog_cc_shlib[  ]" >/dev/null; then :
5243   else
5244    echo "configure: warning: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2
5245     lt_cv_prog_cc_can_build_shared=no
5246   fi
5247 fi
5248
5249 echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6
5250 echo "configure:5251: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
5251 if eval "test \"\${lt_cv_prog_cc_static_works+set}\" = set"; then
5252   echo $ac_n "(cached) $ac_c" 1>&6
5253 else
5254     lt_cv_prog_cc_static_works=no
5255   save_LDFLAGS="$LDFLAGS"
5256   LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
5257   cat > conftest.$ac_ext <<EOF
5258 #line 5259 "configure"
5259 #include "confdefs.h"
5260
5261 int main() {
5262
5263 ; return 0; }
5264 EOF
5265 if { (eval echo configure:5266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5266   rm -rf conftest*
5267   lt_cv_prog_cc_static_works=yes
5268 else
5269   echo "configure: failed program was:" >&5
5270   cat conftest.$ac_ext >&5
5271 fi
5272 rm -f conftest*
5273   LDFLAGS="$save_LDFLAGS"
5274
5275 fi
5276
5277
5278 # Belt *and* braces to stop my trousers falling down:
5279 test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
5280 echo "$ac_t""$lt_cv_prog_cc_static_works" 1>&6
5281
5282 pic_flag="$lt_cv_prog_cc_pic"
5283 special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
5284 wl="$lt_cv_prog_cc_wl"
5285 link_static_flag="$lt_cv_prog_cc_static"
5286 no_builtin_flag="$lt_cv_prog_cc_no_builtin"
5287 can_build_shared="$lt_cv_prog_cc_can_build_shared"
5288
5289
5290 # Check to see if options -o and -c are simultaneously supported by compiler
5291 echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6
5292 echo "configure:5293: checking if $compiler supports -c -o file.$ac_objext" >&5
5293 if eval "test \"\${lt_cv_compiler_c_o+set}\" = set"; then
5294   echo $ac_n "(cached) $ac_c" 1>&6
5295 else
5296   
5297 $rm -r conftest 2>/dev/null
5298 mkdir conftest
5299 cd conftest
5300 echo "int some_variable = 0;" > conftest.$ac_ext
5301 mkdir out
5302 # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
5303 # that will create temporary files in the current directory regardless of
5304 # the output directory.  Thus, making CWD read-only will cause this test
5305 # to fail, enabling locking or at least warning the user not to do parallel
5306 # builds.
5307 chmod -w .
5308 save_CFLAGS="$CFLAGS"
5309 CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
5310 compiler_c_o=no
5311 if { (eval echo configure:5312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
5312   # The compiler can only warn and ignore the option if not recognized
5313   # So say no if there are warnings
5314   if test -s out/conftest.err; then
5315     lt_cv_compiler_c_o=no
5316   else
5317     lt_cv_compiler_c_o=yes
5318   fi
5319 else
5320   # Append any errors to the config.log.
5321   cat out/conftest.err 1>&5
5322   lt_cv_compiler_c_o=no
5323 fi
5324 CFLAGS="$save_CFLAGS"
5325 chmod u+w .
5326 $rm conftest* out/*
5327 rmdir out
5328 cd ..
5329 rmdir conftest
5330 $rm -r conftest 2>/dev/null
5331
5332 fi
5333
5334 compiler_c_o=$lt_cv_compiler_c_o
5335 echo "$ac_t""$compiler_c_o" 1>&6
5336
5337 if test x"$compiler_c_o" = x"yes"; then
5338   # Check to see if we can write to a .lo
5339   echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6
5340 echo "configure:5341: checking if $compiler supports -c -o file.lo" >&5
5341   if eval "test \"\${lt_cv_compiler_o_lo+set}\" = set"; then
5342   echo $ac_n "(cached) $ac_c" 1>&6
5343 else
5344   
5345   lt_cv_compiler_o_lo=no
5346   save_CFLAGS="$CFLAGS"
5347   CFLAGS="$CFLAGS -c -o conftest.lo"
5348   save_objext="$ac_objext"
5349   ac_objext=lo
5350   cat > conftest.$ac_ext <<EOF
5351 #line 5352 "configure"
5352 #include "confdefs.h"
5353
5354 int main() {
5355 int some_variable = 0;
5356 ; return 0; }
5357 EOF
5358 if { (eval echo configure:5359: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5359   rm -rf conftest*
5360       # The compiler can only warn and ignore the option if not recognized
5361     # So say no if there are warnings
5362     if test -s conftest.err; then
5363       lt_cv_compiler_o_lo=no
5364     else
5365       lt_cv_compiler_o_lo=yes
5366     fi
5367   
5368 else
5369   echo "configure: failed program was:" >&5
5370   cat conftest.$ac_ext >&5
5371 fi
5372 rm -f conftest*
5373   ac_objext="$save_objext"
5374   CFLAGS="$save_CFLAGS"
5375   
5376 fi
5377
5378   compiler_o_lo=$lt_cv_compiler_o_lo
5379   echo "$ac_t""$compiler_o_lo" 1>&6
5380 else
5381   compiler_o_lo=no
5382 fi
5383
5384 # Check to see if we can do hard links to lock some files if needed
5385 hard_links="nottested"
5386 if test "$compiler_c_o" = no && test "$need_locks" != no; then
5387   # do not overwrite the value of need_locks provided by the user
5388   echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6
5389 echo "configure:5390: checking if we can lock with hard links" >&5
5390   hard_links=yes
5391   $rm conftest*
5392   ln conftest.a conftest.b 2>/dev/null && hard_links=no
5393   touch conftest.a
5394   ln conftest.a conftest.b 2>&5 || hard_links=no
5395   ln conftest.a conftest.b 2>/dev/null && hard_links=no
5396   echo "$ac_t""$hard_links" 1>&6
5397   if test "$hard_links" = no; then
5398     echo "configure: warning: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" 1>&2
5399     need_locks=warn
5400   fi
5401 else
5402   need_locks=no
5403 fi
5404
5405 if test "$GCC" = yes; then
5406   # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
5407   echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6
5408 echo "configure:5409: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
5409   echo "int some_variable = 0;" > conftest.$ac_ext
5410   save_CFLAGS="$CFLAGS"
5411   CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
5412   compiler_rtti_exceptions=no
5413   cat > conftest.$ac_ext <<EOF
5414 #line 5415 "configure"
5415 #include "confdefs.h"
5416
5417 int main() {
5418 int some_variable = 0;
5419 ; return 0; }
5420 EOF
5421 if { (eval echo configure:5422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5422   rm -rf conftest*
5423       # The compiler can only warn and ignore the option if not recognized
5424     # So say no if there are warnings
5425     if test -s conftest.err; then
5426       compiler_rtti_exceptions=no
5427     else
5428       compiler_rtti_exceptions=yes
5429     fi
5430   
5431 else
5432   echo "configure: failed program was:" >&5
5433   cat conftest.$ac_ext >&5
5434 fi
5435 rm -f conftest*
5436   CFLAGS="$save_CFLAGS"
5437   echo "$ac_t""$compiler_rtti_exceptions" 1>&6
5438
5439   if test "$compiler_rtti_exceptions" = "yes"; then
5440     no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
5441   else
5442     no_builtin_flag=' -fno-builtin'
5443   fi
5444 fi
5445
5446 # See if the linker supports building shared libraries.
5447 echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6
5448 echo "configure:5449: checking whether the linker ($LD) supports shared libraries" >&5
5449
5450 allow_undefined_flag=
5451 no_undefined_flag=
5452 need_lib_prefix=unknown
5453 need_version=unknown
5454 # when you set need_version to no, make sure it does not cause -set_version
5455 # flags to be left without arguments
5456 archive_cmds=
5457 archive_expsym_cmds=
5458 old_archive_from_new_cmds=
5459 old_archive_from_expsyms_cmds=
5460 export_dynamic_flag_spec=
5461 whole_archive_flag_spec=
5462 thread_safe_flag_spec=
5463 hardcode_into_libs=no
5464 hardcode_libdir_flag_spec=
5465 hardcode_libdir_separator=
5466 hardcode_direct=no
5467 hardcode_minus_L=no
5468 hardcode_shlibpath_var=unsupported
5469 runpath_var=
5470 link_all_deplibs=unknown
5471 always_export_symbols=no
5472 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
5473 # include_expsyms should be a list of space-separated symbols to be *always*
5474 # included in the symbol list
5475 include_expsyms=
5476 # exclude_expsyms can be an egrep regular expression of symbols to exclude
5477 # it will be wrapped by ` (' and `)$', so one must not match beginning or
5478 # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5479 # as well as any symbol that contains `d'.
5480 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
5481 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5482 # platforms (ab)use it in PIC code, but their linkers get confused if
5483 # the symbol is explicitly referenced.  Since portable code cannot
5484 # rely on this symbol name, it's probably fine to never include it in
5485 # preloaded symbol tables.
5486 extract_expsyms_cmds=
5487
5488 case $host_os in
5489 cygwin* | mingw* | pw32*)
5490   # FIXME: the MSVC++ port hasn't been tested in a loooong time
5491   # When not using gcc, we currently assume that we are using
5492   # Microsoft Visual C++.
5493   if test "$GCC" != yes; then
5494     with_gnu_ld=no
5495   fi
5496   ;;
5497 openbsd*)
5498   with_gnu_ld=no
5499   ;;
5500 esac
5501
5502 ld_shlibs=yes
5503 if test "$with_gnu_ld" = yes; then
5504   # If archive_cmds runs LD, not CC, wlarc should be empty
5505   wlarc='${wl}'
5506
5507   # See if GNU ld supports shared libraries.
5508   case $host_os in
5509   aix3* | aix4* | aix5*)
5510     # On AIX, the GNU linker is very broken
5511     # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
5512     ld_shlibs=no
5513     cat <<EOF 1>&2
5514
5515 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
5516 *** to be unable to reliably create shared libraries on AIX.
5517 *** Therefore, libtool is disabling shared libraries support.  If you
5518 *** really care for shared libraries, you may want to modify your PATH
5519 *** so that a non-GNU linker is found, and then restart.
5520
5521 EOF
5522     ;;
5523
5524   amigaos*)
5525     archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
5526     hardcode_libdir_flag_spec='-L$libdir'
5527     hardcode_minus_L=yes
5528
5529     # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
5530     # that the semantics of dynamic libraries on AmigaOS, at least up
5531     # to version 4, is to share data among multiple programs linked
5532     # with the same dynamic library.  Since this doesn't match the
5533     # behavior of shared libraries on other platforms, we can use
5534     # them.
5535     ld_shlibs=no
5536     ;;
5537
5538   beos*)
5539     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5540       allow_undefined_flag=unsupported
5541       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5542       # support --undefined.  This deserves some investigation.  FIXME
5543       archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5544     else
5545       ld_shlibs=no
5546     fi
5547     ;;
5548
5549   cygwin* | mingw* | pw32*)
5550     # hardcode_libdir_flag_spec is actually meaningless, as there is
5551     # no search path for DLLs.
5552     hardcode_libdir_flag_spec='-L$libdir'
5553     allow_undefined_flag=unsupported
5554     always_export_symbols=yes
5555
5556     extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
5557       sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
5558       test -f $output_objdir/impgen.exe || (cd $output_objdir && \
5559       if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
5560       else $CC -o impgen impgen.c ; fi)~
5561       $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
5562
5563     old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
5564
5565     # cygwin and mingw dlls have different entry points and sets of symbols
5566     # to exclude.
5567     # FIXME: what about values for MSVC?
5568     dll_entry=__cygwin_dll_entry@12
5569     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
5570     case $host_os in
5571     mingw*)
5572       # mingw values
5573       dll_entry=_DllMainCRTStartup@12
5574       dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
5575       ;;
5576     esac
5577
5578     # mingw and cygwin differ, and it's simplest to just exclude the union
5579     # of the two symbol sets.
5580     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
5581
5582     # recent cygwin and mingw systems supply a stub DllMain which the user
5583     # can override, but on older systems we have to supply one (in ltdll.c)
5584     if test "x$lt_cv_need_dllmain" = "xyes"; then
5585       ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
5586       ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
5587         test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
5588     else
5589       ltdll_obj=
5590       ltdll_cmds=
5591     fi
5592
5593     # Extract the symbol export list from an `--export-all' def file,
5594     # then regenerate the def file from the symbol export list, so that
5595     # the compiled dll only exports the symbol export list.
5596     # Be careful not to strip the DATA tag left be newer dlltools.
5597     export_symbols_cmds="$ltdll_cmds"'
5598       $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
5599       sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
5600
5601     # If the export-symbols file already is a .def file (1st line
5602     # is EXPORTS), use it as is.
5603     # If DATA tags from a recent dlltool are present, honour them!
5604     archive_expsym_cmds='if test "x`sed 1q $export_symbols`" = xEXPORTS; then
5605         cp $export_symbols $output_objdir/$soname-def;
5606       else
5607         echo EXPORTS > $output_objdir/$soname-def;
5608         _lt_hint=1;
5609         cat $export_symbols | while read symbol; do
5610          set dummy \$symbol;
5611          case \$# in
5612            2) echo "   \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
5613            4) echo "   \$2 \$3 \$4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
5614            *) echo "     \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
5615          esac;
5616          _lt_hint=`expr 1 + \$_lt_hint`;
5617         done;
5618       fi~
5619       '"$ltdll_cmds"'
5620       $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
5621       $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
5622       $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
5623       $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
5624       $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
5625     ;;
5626
5627   netbsd*)
5628     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5629       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5630       wlarc=
5631     else
5632       archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5633       archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5634     fi
5635     ;;
5636
5637   solaris* | sysv5*)
5638     if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
5639       ld_shlibs=no
5640       cat <<EOF 1>&2
5641
5642 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
5643 *** create shared libraries on Solaris systems.  Therefore, libtool
5644 *** is disabling shared libraries support.  We urge you to upgrade GNU
5645 *** binutils to release 2.9.1 or newer.  Another option is to modify
5646 *** your PATH or compiler configuration so that the native linker is
5647 *** used, and then restart.
5648
5649 EOF
5650     elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5651       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5652       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5653     else
5654       ld_shlibs=no
5655     fi
5656     ;;
5657
5658   sunos4*)
5659     archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5660     wlarc=
5661     hardcode_direct=yes
5662     hardcode_shlibpath_var=no
5663     ;;
5664
5665   *)
5666     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5667       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5668       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5669     else
5670       ld_shlibs=no
5671     fi
5672     ;;
5673   esac
5674
5675   if test "$ld_shlibs" = yes; then
5676     runpath_var=LD_RUN_PATH
5677     hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
5678     export_dynamic_flag_spec='${wl}--export-dynamic'
5679     case $host_os in
5680     cygwin* | mingw* | pw32*)
5681       # dlltool doesn't understand --whole-archive et. al.
5682       whole_archive_flag_spec=
5683       ;;
5684     *)
5685       # ancient GNU ld didn't support --whole-archive et. al.
5686       if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
5687         whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5688       else
5689         whole_archive_flag_spec=
5690       fi
5691       ;;
5692     esac
5693   fi
5694 else
5695   # PORTME fill in a description of your system's linker (not GNU ld)
5696   case $host_os in
5697   aix3*)
5698     allow_undefined_flag=unsupported
5699     always_export_symbols=yes
5700     archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
5701     # Note: this linker hardcodes the directories in LIBPATH if there
5702     # are no directories specified by -L.
5703     hardcode_minus_L=yes
5704     if test "$GCC" = yes && test -z "$link_static_flag"; then
5705       # Neither direct hardcoding nor static linking is supported with a
5706       # broken collect2.
5707       hardcode_direct=unsupported
5708     fi
5709     ;;
5710
5711   aix4* | aix5*)
5712     if test "$host_cpu" = ia64; then
5713       # On IA64, the linker does run time linking by default, so we don't
5714       # have to do anything special.
5715       aix_use_runtimelinking=no
5716       exp_sym_flag='-Bexport'
5717       no_entry_flag=""
5718     else
5719       aix_use_runtimelinking=no
5720
5721       # Test if we are trying to use run time linking or normal
5722       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5723       # need to do runtime linking.
5724       case $host_os in aix4.[23]|aix4.[23].*|aix5*)
5725         for ld_flag in $LDFLAGS; do
5726           case $ld_flag in
5727           *-brtl*)
5728             aix_use_runtimelinking=yes
5729             break
5730           ;;
5731           esac
5732         done
5733       esac
5734
5735       exp_sym_flag='-bexport'
5736       no_entry_flag='-bnoentry'
5737     fi
5738
5739     # When large executables or shared objects are built, AIX ld can
5740     # have problems creating the table of contents.  If linking a library
5741     # or program results in "error TOC overflow" add -mminimal-toc to
5742     # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5743     # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5744
5745     hardcode_direct=yes
5746     archive_cmds=''
5747     hardcode_libdir_separator=':'
5748     if test "$GCC" = yes; then
5749       case $host_os in aix4.[012]|aix4.[012].*)
5750         collect2name=`${CC} -print-prog-name=collect2`
5751         if test -f "$collect2name" && \
5752           strings "$collect2name" | grep resolve_lib_name >/dev/null
5753         then
5754           # We have reworked collect2
5755           hardcode_direct=yes
5756         else
5757           # We have old collect2
5758           hardcode_direct=unsupported
5759           # It fails to find uninstalled libraries when the uninstalled
5760           # path is not listed in the libpath.  Setting hardcode_minus_L
5761           # to unsupported forces relinking
5762           hardcode_minus_L=yes
5763           hardcode_libdir_flag_spec='-L$libdir'
5764           hardcode_libdir_separator=
5765         fi
5766       esac
5767
5768       shared_flag='-shared'
5769     else
5770       # not using gcc
5771       if test "$host_cpu" = ia64; then
5772         shared_flag='${wl}-G'
5773       else
5774         if test "$aix_use_runtimelinking" = yes; then
5775           shared_flag='${wl}-G'
5776         else
5777           shared_flag='${wl}-bM:SRE'
5778         fi
5779       fi
5780     fi
5781
5782     # It seems that -bexpall can do strange things, so it is better to
5783     # generate a list of symbols to export.
5784     always_export_symbols=yes
5785     if test "$aix_use_runtimelinking" = yes; then
5786       # Warning - without using the other runtime loading flags (-brtl),
5787       # -berok will link without error, but may produce a broken library.
5788       allow_undefined_flag='-berok'
5789       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
5790       archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
5791     else
5792       if test "$host_cpu" = ia64; then
5793         hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
5794         allow_undefined_flag="-z nodefs"
5795         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
5796       else
5797         hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
5798         # Warning - without using the other run time loading flags,
5799         # -berok will link without error, but may produce a broken library.
5800         allow_undefined_flag='${wl}-berok'
5801         # This is a bit strange, but is similar to how AIX traditionally builds
5802         # it's shared libraries.
5803         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname'
5804       fi
5805     fi
5806     ;;
5807
5808   amigaos*)
5809     archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
5810     hardcode_libdir_flag_spec='-L$libdir'
5811     hardcode_minus_L=yes
5812     # see comment about different semantics on the GNU ld section
5813     ld_shlibs=no
5814     ;;
5815
5816   cygwin* | mingw* | pw32*)
5817     # When not using gcc, we currently assume that we are using
5818     # Microsoft Visual C++.
5819     # hardcode_libdir_flag_spec is actually meaningless, as there is
5820     # no search path for DLLs.
5821     hardcode_libdir_flag_spec=' '
5822     allow_undefined_flag=unsupported
5823     # Tell ltmain to make .lib files, not .a files.
5824     libext=lib
5825     # FIXME: Setting linknames here is a bad hack.
5826     archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
5827     # The linker will automatically build a .lib file if we build a DLL.
5828     old_archive_from_new_cmds='true'
5829     # FIXME: Should let the user specify the lib program.
5830     old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
5831     fix_srcfile_path='`cygpath -w "$srcfile"`'
5832     ;;
5833
5834   darwin* | rhapsody*)
5835     case "$host_os" in
5836     rhapsody* | darwin1.[012])
5837       allow_undefined_flag='-undefined suppress'
5838       ;;
5839     *) # Darwin 1.3 on
5840       allow_undefined_flag='-flat_namespace -undefined suppress'
5841       ;;
5842     esac
5843     # FIXME: Relying on posixy $() will cause problems for
5844     #        cross-compilation, but unfortunately the echo tests do not
5845     #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
5846     #        `"' quotes if we put them in here... so don't!
5847     archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
5848     # We need to add '_' to the symbols in $export_symbols first
5849     #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
5850     hardcode_direct=yes
5851     hardcode_shlibpath_var=no
5852     whole_archive_flag_spec='-all_load $convenience'
5853     ;;
5854
5855   freebsd1*)
5856     ld_shlibs=no
5857     ;;
5858
5859   # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5860   # support.  Future versions do this automatically, but an explicit c++rt0.o
5861   # does not break anything, and helps significantly (at the cost of a little
5862   # extra space).
5863   freebsd2.2*)
5864     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5865     hardcode_libdir_flag_spec='-R$libdir'
5866     hardcode_direct=yes
5867     hardcode_shlibpath_var=no
5868     ;;
5869
5870   # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5871   freebsd2*)
5872     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5873     hardcode_direct=yes
5874     hardcode_minus_L=yes
5875     hardcode_shlibpath_var=no
5876     ;;
5877
5878   # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5879   freebsd*)
5880     archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
5881     hardcode_libdir_flag_spec='-R$libdir'
5882     hardcode_direct=yes
5883     hardcode_shlibpath_var=no
5884     ;;
5885
5886   hpux9* | hpux10* | hpux11*)
5887     case $host_os in
5888     hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
5889     *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
5890     esac
5891     hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
5892     hardcode_libdir_separator=:
5893     hardcode_direct=yes
5894     hardcode_minus_L=yes # Not in the search PATH, but as the default
5895                          # location of the library.
5896     export_dynamic_flag_spec='${wl}-E'
5897     ;;
5898
5899   irix5* | irix6* | nonstopux*)
5900     if test "$GCC" = yes; then
5901       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5902       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5903     else
5904       archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
5905       hardcode_libdir_flag_spec='-rpath $libdir'
5906     fi
5907     hardcode_libdir_separator=:
5908     link_all_deplibs=yes
5909     ;;
5910
5911   netbsd*)
5912     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5913       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5914     else
5915       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5916     fi
5917     hardcode_libdir_flag_spec='-R$libdir'
5918     hardcode_direct=yes
5919     hardcode_shlibpath_var=no
5920     ;;
5921
5922   newsos6)
5923     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5924     hardcode_direct=yes
5925     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5926     hardcode_libdir_separator=:
5927     hardcode_shlibpath_var=no
5928     ;;
5929
5930   openbsd*)
5931     hardcode_direct=yes
5932     hardcode_shlibpath_var=no
5933     if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5934       archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5935       hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
5936       export_dynamic_flag_spec='${wl}-E'
5937     else
5938       case "$host_os" in
5939       openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
5940         archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5941         hardcode_libdir_flag_spec='-R$libdir'
5942         ;;
5943       *)
5944         archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5945         hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
5946         ;;
5947       esac
5948     fi
5949     ;;
5950
5951   os2*)
5952     hardcode_libdir_flag_spec='-L$libdir'
5953     hardcode_minus_L=yes
5954     allow_undefined_flag=unsupported
5955     archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
5956     old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
5957     ;;
5958
5959   osf3*)
5960     if test "$GCC" = yes; then
5961       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
5962       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5963     else
5964       allow_undefined_flag=' -expect_unresolved \*'
5965       archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
5966     fi
5967     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5968     hardcode_libdir_separator=:
5969     ;;
5970
5971   osf4* | osf5*)        # as osf3* with the addition of -msym flag
5972     if test "$GCC" = yes; then
5973       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
5974       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5975       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5976     else
5977       allow_undefined_flag=' -expect_unresolved \*'
5978       archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
5979       archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
5980       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
5981
5982       #Both c and cxx compiler support -rpath directly
5983       hardcode_libdir_flag_spec='-rpath $libdir'
5984     fi
5985     hardcode_libdir_separator=:
5986     ;;
5987
5988   sco3.2v5*)
5989     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5990     hardcode_shlibpath_var=no
5991     runpath_var=LD_RUN_PATH
5992     hardcode_runpath_var=yes
5993     export_dynamic_flag_spec='${wl}-Bexport'
5994     ;;
5995
5996   solaris*)
5997     # gcc --version < 3.0 without binutils cannot create self contained
5998     # shared libraries reliably, requiring libgcc.a to resolve some of
5999     # the object symbols generated in some cases.  Libraries that use
6000     # assert need libgcc.a to resolve __eprintf, for example.  Linking
6001     # a copy of libgcc.a into every shared library to guarantee resolving
6002     # such symbols causes other problems:  According to Tim Van Holder
6003     # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
6004     # (to the application) exception stack for one thing.
6005     no_undefined_flag=' -z defs'
6006     if test "$GCC" = yes; then
6007       case `$CC --version 2>/dev/null` in
6008       [12].*)
6009         cat <<EOF 1>&2
6010
6011 *** Warning: Releases of GCC earlier than version 3.0 cannot reliably
6012 *** create self contained shared libraries on Solaris systems, without
6013 *** introducing a dependency on libgcc.a.  Therefore, libtool is disabling
6014 *** -no-undefined support, which will at least allow you to build shared
6015 *** libraries.  However, you may find that when you link such libraries
6016 *** into an application without using GCC, you have to manually add
6017 *** \`gcc --print-libgcc-file-name\` to the link command.  We urge you to
6018 *** upgrade to a newer version of GCC.  Another option is to rebuild your
6019 *** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
6020
6021 EOF
6022         no_undefined_flag=
6023         ;;
6024       esac
6025     fi
6026     # $CC -shared without GNU ld will not create a library from C++
6027     # object files and a static libstdc++, better avoid it by now
6028     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6029     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6030                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
6031     hardcode_libdir_flag_spec='-R$libdir'
6032     hardcode_shlibpath_var=no
6033     case $host_os in
6034     solaris2.[0-5] | solaris2.[0-5].*) ;;
6035     *) # Supported since Solaris 2.6 (maybe 2.5.1?)
6036       whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
6037     esac
6038     link_all_deplibs=yes
6039     ;;
6040
6041   sunos4*)
6042     if test "x$host_vendor" = xsequent; then
6043       # Use $CC to link under sequent, because it throws in some extra .o
6044       # files that make .init and .fini sections work.
6045       archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
6046     else
6047       archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
6048     fi
6049     hardcode_libdir_flag_spec='-L$libdir'
6050     hardcode_direct=yes
6051     hardcode_minus_L=yes
6052     hardcode_shlibpath_var=no
6053     ;;
6054
6055   sysv4)
6056     case $host_vendor in
6057       sni)
6058         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6059         hardcode_direct=yes # is this really true???
6060         ;;
6061       siemens)
6062         ## LD is ld it makes a PLAMLIB
6063         ## CC just makes a GrossModule.
6064         archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6065         reload_cmds='$CC -r -o $output$reload_objs'
6066         hardcode_direct=no
6067         ;;
6068       motorola)
6069         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6070         hardcode_direct=no #Motorola manual says yes, but my tests say they lie
6071         ;;
6072     esac
6073     runpath_var='LD_RUN_PATH'
6074     hardcode_shlibpath_var=no
6075     ;;
6076
6077   sysv4.3*)
6078     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6079     hardcode_shlibpath_var=no
6080     export_dynamic_flag_spec='-Bexport'
6081     ;;
6082
6083   sysv5*)
6084     no_undefined_flag=' -z text'
6085     # $CC -shared without GNU ld will not create a library from C++
6086     # object files and a static libstdc++, better avoid it by now
6087     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6088     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6089                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
6090     hardcode_libdir_flag_spec=
6091     hardcode_shlibpath_var=no
6092     runpath_var='LD_RUN_PATH'
6093     ;;
6094
6095   uts4*)
6096     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6097     hardcode_libdir_flag_spec='-L$libdir'
6098     hardcode_shlibpath_var=no
6099     ;;
6100
6101   dgux*)
6102     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6103     hardcode_libdir_flag_spec='-L$libdir'
6104     hardcode_shlibpath_var=no
6105     ;;
6106
6107   sysv4*MP*)
6108     if test -d /usr/nec; then
6109       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6110       hardcode_shlibpath_var=no
6111       runpath_var=LD_RUN_PATH
6112       hardcode_runpath_var=yes
6113       ld_shlibs=yes
6114     fi
6115     ;;
6116
6117   sysv4.2uw2*)
6118     archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6119     hardcode_direct=yes
6120     hardcode_minus_L=no
6121     hardcode_shlibpath_var=no
6122     hardcode_runpath_var=yes
6123     runpath_var=LD_RUN_PATH
6124     ;;
6125
6126   sysv5uw7* | unixware7*)
6127     no_undefined_flag='${wl}-z ${wl}text'
6128     if test "$GCC" = yes; then
6129       archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6130     else
6131       archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6132     fi
6133     runpath_var='LD_RUN_PATH'
6134     hardcode_shlibpath_var=no
6135     ;;
6136
6137   *)
6138     ld_shlibs=no
6139     ;;
6140   esac
6141 fi
6142 echo "$ac_t""$ld_shlibs" 1>&6
6143 test "$ld_shlibs" = no && can_build_shared=no
6144
6145 # Check hardcoding attributes.
6146 echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6
6147 echo "configure:6148: checking how to hardcode library paths into programs" >&5
6148 hardcode_action=
6149 if test -n "$hardcode_libdir_flag_spec" || \
6150    test -n "$runpath_var"; then
6151
6152   # We can hardcode non-existant directories.
6153   if test "$hardcode_direct" != no &&
6154      # If the only mechanism to avoid hardcoding is shlibpath_var, we
6155      # have to relink, otherwise we might link with an installed library
6156      # when we should be linking with a yet-to-be-installed one
6157      ## test "$hardcode_shlibpath_var" != no &&
6158      test "$hardcode_minus_L" != no; then
6159     # Linking always hardcodes the temporary library directory.
6160     hardcode_action=relink
6161   else
6162     # We can link without hardcoding, and we can hardcode nonexisting dirs.
6163     hardcode_action=immediate
6164   fi
6165 else
6166   # We cannot hardcode anything, or else we can only hardcode existing
6167   # directories.
6168   hardcode_action=unsupported
6169 fi
6170 echo "$ac_t""$hardcode_action" 1>&6
6171
6172 striplib=
6173 old_striplib=
6174 echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6
6175 echo "configure:6176: checking whether stripping libraries is possible" >&5
6176 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
6177   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
6178   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
6179   echo "$ac_t""yes" 1>&6
6180 else
6181   echo "$ac_t""no" 1>&6
6182 fi
6183
6184 reload_cmds='$LD$reload_flag -o $output$reload_objs'
6185 test -z "$deplibs_check_method" && deplibs_check_method=unknown
6186
6187 # PORTME Fill in your ld.so characteristics
6188 echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6
6189 echo "configure:6190: checking dynamic linker characteristics" >&5
6190 library_names_spec=
6191 libname_spec='lib$name'
6192 soname_spec=
6193 postinstall_cmds=
6194 postuninstall_cmds=
6195 finish_cmds=
6196 finish_eval=
6197 shlibpath_var=
6198 shlibpath_overrides_runpath=unknown
6199 version_type=none
6200 dynamic_linker="$host_os ld.so"
6201 sys_lib_dlsearch_path_spec="/lib /usr/lib"
6202 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
6203
6204 case $host_os in
6205 aix3*)
6206   version_type=linux
6207   library_names_spec='${libname}${release}.so$versuffix $libname.a'
6208   shlibpath_var=LIBPATH
6209
6210   # AIX has no versioning support, so we append a major version to the name.
6211   soname_spec='${libname}${release}.so$major'
6212   ;;
6213
6214 aix4* | aix5*)
6215   version_type=linux
6216   need_lib_prefix=no
6217   need_version=no
6218   hardcode_into_libs=yes
6219   if test "$host_cpu" = ia64; then
6220     # AIX 5 supports IA64
6221     library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
6222     shlibpath_var=LD_LIBRARY_PATH
6223   else
6224     # With GCC up to 2.95.x, collect2 would create an import file
6225     # for dependence libraries.  The import file would start with
6226     # the line `#! .'.  This would cause the generated library to
6227     # depend on `.', always an invalid library.  This was fixed in
6228     # development snapshots of GCC prior to 3.0.
6229     case $host_os in
6230       aix4 | aix4.[01] | aix4.[01].*)
6231         if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
6232              echo ' yes '
6233              echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
6234           :
6235         else
6236           can_build_shared=no
6237         fi
6238         ;;
6239     esac
6240     # AIX (on Power*) has no versioning support, so currently we can
6241     # not hardcode correct soname into executable. Probably we can
6242     # add versioning support to collect2, so additional links can
6243     # be useful in future.
6244     if test "$aix_use_runtimelinking" = yes; then
6245       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
6246       # instead of lib<name>.a to let people know that these are not
6247       # typical AIX shared libraries.
6248       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6249     else
6250       # We preserve .a as extension for shared libraries through AIX4.2
6251       # and later when we are not doing run time linking.
6252       library_names_spec='${libname}${release}.a $libname.a'
6253       soname_spec='${libname}${release}.so$major'
6254     fi
6255     shlibpath_var=LIBPATH
6256   fi
6257   hardcode_into_libs=yes
6258   ;;
6259
6260 amigaos*)
6261   library_names_spec='$libname.ixlibrary $libname.a'
6262   # Create ${libname}_ixlibrary.a entries in /sys/libs.
6263   finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
6264   ;;
6265
6266 beos*)
6267   library_names_spec='${libname}.so'
6268   dynamic_linker="$host_os ld.so"
6269   shlibpath_var=LIBRARY_PATH
6270   ;;
6271
6272 bsdi4*)
6273   version_type=linux
6274   need_version=no
6275   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6276   soname_spec='${libname}${release}.so$major'
6277   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
6278   shlibpath_var=LD_LIBRARY_PATH
6279   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
6280   sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
6281   export_dynamic_flag_spec=-rdynamic
6282   # the default ld.so.conf also contains /usr/contrib/lib and
6283   # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
6284   # libtool to hard-code these into programs
6285   ;;
6286
6287 cygwin* | mingw* | pw32*)
6288   version_type=windows
6289   need_version=no
6290   need_lib_prefix=no
6291   case $GCC,$host_os in
6292   yes,cygwin*)
6293     library_names_spec='$libname.dll.a'
6294     soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
6295     postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
6296       dldir=$destdir/`dirname \$dlpath`~
6297       test -d \$dldir || mkdir -p \$dldir~
6298       $install_prog .libs/$dlname \$dldir/$dlname'
6299     postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
6300       dlpath=$dir/\$dldll~
6301        $rm \$dlpath'
6302     ;;
6303   yes,mingw*)
6304     library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
6305     sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
6306     ;;
6307   yes,pw32*)
6308     library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll'
6309     ;;
6310   *)
6311     library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
6312     ;;
6313   esac
6314   dynamic_linker='Win32 ld.exe'
6315   # FIXME: first we should search . and the directory the executable is in
6316   shlibpath_var=PATH
6317   ;;
6318
6319 darwin* | rhapsody*)
6320   dynamic_linker="$host_os dyld"
6321   version_type=darwin
6322   need_lib_prefix=no
6323   need_version=no
6324   # FIXME: Relying on posixy $() will cause problems for
6325   #        cross-compilation, but unfortunately the echo tests do not
6326   #        yet detect zsh echo's removal of \ escapes.
6327   library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
6328   soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
6329   shlibpath_overrides_runpath=yes
6330   shlibpath_var=DYLD_LIBRARY_PATH
6331   ;;
6332
6333 freebsd1*)
6334   dynamic_linker=no
6335   ;;
6336
6337 freebsd*)
6338   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
6339   version_type=freebsd-$objformat
6340   case $version_type in
6341     freebsd-elf*)
6342       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
6343       need_version=no
6344       need_lib_prefix=no
6345       ;;
6346     freebsd-*)
6347       library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
6348       need_version=yes
6349       ;;
6350   esac
6351   shlibpath_var=LD_LIBRARY_PATH
6352   case $host_os in
6353   freebsd2*)
6354     shlibpath_overrides_runpath=yes
6355     ;;
6356   *)
6357     shlibpath_overrides_runpath=no
6358     hardcode_into_libs=yes
6359     ;;
6360   esac
6361   ;;
6362
6363 gnu*)
6364   version_type=linux
6365   need_lib_prefix=no
6366   need_version=no
6367   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
6368   soname_spec='${libname}${release}.so$major'
6369   shlibpath_var=LD_LIBRARY_PATH
6370   hardcode_into_libs=yes
6371   ;;
6372
6373 hpux9* | hpux10* | hpux11*)
6374   # Give a soname corresponding to the major version so that dld.sl refuses to
6375   # link against other versions.
6376   dynamic_linker="$host_os dld.sl"
6377   version_type=sunos
6378   need_lib_prefix=no
6379   need_version=no
6380   shlibpath_var=SHLIB_PATH
6381   shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
6382   library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
6383   soname_spec='${libname}${release}.sl$major'
6384   # HP-UX runs *really* slowly unless shared libraries are mode 555.
6385   postinstall_cmds='chmod 555 $lib'
6386   ;;
6387
6388 irix5* | irix6* | nonstopux*)
6389   case $host_os in
6390     nonstopux*) version_type=nonstopux ;;
6391     *)          version_type=irix ;;
6392   esac
6393   need_lib_prefix=no
6394   need_version=no
6395   soname_spec='${libname}${release}.so$major'
6396   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
6397   case $host_os in
6398   irix5* | nonstopux*)
6399     libsuff= shlibsuff=
6400     ;;
6401   *)
6402     case $LD in # libtool.m4 will add one of these switches to LD
6403     *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
6404     *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
6405     *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
6406     *) libsuff= shlibsuff= libmagic=never-match;;
6407     esac
6408     ;;
6409   esac
6410   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
6411   shlibpath_overrides_runpath=no
6412   sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
6413   sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
6414   ;;
6415
6416 # No shared lib support for Linux oldld, aout, or coff.
6417 linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
6418   dynamic_linker=no
6419   ;;
6420
6421 # This must be Linux ELF.
6422 linux-gnu*)
6423   version_type=linux
6424   need_lib_prefix=no
6425   need_version=no
6426   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6427   soname_spec='${libname}${release}.so$major'
6428   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
6429   shlibpath_var=LD_LIBRARY_PATH
6430   shlibpath_overrides_runpath=no
6431   # This implies no fast_install, which is unacceptable.
6432   # Some rework will be needed to allow for fast_install
6433   # before this can be enabled.
6434   hardcode_into_libs=yes
6435
6436   # We used to test for /lib/ld.so.1 and disable shared libraries on
6437   # powerpc, because MkLinux only supported shared libraries with the
6438   # GNU dynamic linker.  Since this was broken with cross compilers,
6439   # most powerpc-linux boxes support dynamic linking these days and
6440   # people can always --disable-shared, the test was removed, and we
6441   # assume the GNU/Linux dynamic linker is in use.
6442   dynamic_linker='GNU/Linux ld.so'
6443   ;;
6444
6445 netbsd*)
6446   version_type=sunos
6447   need_lib_prefix=no
6448   need_version=no
6449   if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6450     library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6451     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6452     dynamic_linker='NetBSD (a.out) ld.so'
6453   else
6454     library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
6455     soname_spec='${libname}${release}.so$major'
6456     dynamic_linker='NetBSD ld.elf_so'
6457   fi
6458   shlibpath_var=LD_LIBRARY_PATH
6459   shlibpath_overrides_runpath=yes
6460   hardcode_into_libs=yes
6461   ;;
6462
6463 newsos6)
6464   version_type=linux
6465   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6466   shlibpath_var=LD_LIBRARY_PATH
6467   shlibpath_overrides_runpath=yes
6468   ;;
6469
6470 openbsd*)
6471   version_type=sunos
6472   need_lib_prefix=no
6473   need_version=no
6474   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6475     case "$host_os" in
6476     openbsd2.[89] | openbsd2.[89].*)
6477       shlibpath_overrides_runpath=no
6478       ;;
6479     *)
6480       shlibpath_overrides_runpath=yes
6481       ;;
6482     esac
6483   else
6484     shlibpath_overrides_runpath=yes
6485   fi
6486   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6487   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6488   shlibpath_var=LD_LIBRARY_PATH
6489   ;;
6490
6491 os2*)
6492   libname_spec='$name'
6493   need_lib_prefix=no
6494   library_names_spec='$libname.dll $libname.a'
6495   dynamic_linker='OS/2 ld.exe'
6496   shlibpath_var=LIBPATH
6497   ;;
6498
6499 osf3* | osf4* | osf5*)
6500   version_type=osf
6501   need_version=no
6502   soname_spec='${libname}${release}.so$major'
6503   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6504   shlibpath_var=LD_LIBRARY_PATH
6505   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
6506   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
6507   hardcode_into_libs=yes
6508   ;;
6509
6510 sco3.2v5*)
6511   version_type=osf
6512   soname_spec='${libname}${release}.so$major'
6513   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6514   shlibpath_var=LD_LIBRARY_PATH
6515   ;;
6516
6517 solaris*)
6518   version_type=linux
6519   need_lib_prefix=no
6520   need_version=no
6521   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6522   soname_spec='${libname}${release}.so$major'
6523   shlibpath_var=LD_LIBRARY_PATH
6524   shlibpath_overrides_runpath=yes
6525   hardcode_into_libs=yes
6526   # ldd complains unless libraries are executable
6527   postinstall_cmds='chmod +x $lib'
6528   ;;
6529
6530 sunos4*)
6531   version_type=sunos
6532   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6533   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
6534   shlibpath_var=LD_LIBRARY_PATH
6535   shlibpath_overrides_runpath=yes
6536   if test "$with_gnu_ld" = yes; then
6537     need_lib_prefix=no
6538   fi
6539   need_version=yes
6540   ;;
6541
6542 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6543   version_type=linux
6544   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6545   soname_spec='${libname}${release}.so$major'
6546   shlibpath_var=LD_LIBRARY_PATH
6547   case $host_vendor in
6548     sni)
6549       shlibpath_overrides_runpath=no
6550       need_lib_prefix=no
6551       export_dynamic_flag_spec='${wl}-Blargedynsym'
6552       runpath_var=LD_RUN_PATH
6553       ;;
6554     siemens)
6555       need_lib_prefix=no
6556       ;;
6557     motorola)
6558       need_lib_prefix=no
6559       need_version=no
6560       shlibpath_overrides_runpath=no
6561       sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
6562       ;;
6563   esac
6564   ;;
6565
6566 uts4*)
6567   version_type=linux
6568   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6569   soname_spec='${libname}${release}.so$major'
6570   shlibpath_var=LD_LIBRARY_PATH
6571   ;;
6572
6573 dgux*)
6574   version_type=linux
6575   need_lib_prefix=no
6576   need_version=no
6577   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6578   soname_spec='${libname}${release}.so$major'
6579   shlibpath_var=LD_LIBRARY_PATH
6580   ;;
6581
6582 sysv4*MP*)
6583   if test -d /usr/nec ;then
6584     version_type=linux
6585     library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
6586     soname_spec='$libname.so.$major'
6587     shlibpath_var=LD_LIBRARY_PATH
6588   fi
6589   ;;
6590
6591 *)
6592   dynamic_linker=no
6593   ;;
6594 esac
6595 echo "$ac_t""$dynamic_linker" 1>&6
6596 test "$dynamic_linker" = no && can_build_shared=no
6597
6598 # Report the final consequences.
6599 echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6
6600 echo "configure:6601: checking if libtool supports shared libraries" >&5
6601 echo "$ac_t""$can_build_shared" 1>&6
6602
6603 echo $ac_n "checking whether to build shared libraries""... $ac_c" 1>&6
6604 echo "configure:6605: checking whether to build shared libraries" >&5
6605 test "$can_build_shared" = "no" && enable_shared=no
6606
6607 # On AIX, shared libraries and static libraries use the same namespace, and
6608 # are all built from PIC.
6609 case "$host_os" in
6610 aix3*)
6611   test "$enable_shared" = yes && enable_static=no
6612   if test -n "$RANLIB"; then
6613     archive_cmds="$archive_cmds~\$RANLIB \$lib"
6614     postinstall_cmds='$RANLIB $lib'
6615   fi
6616   ;;
6617
6618 aix4*)
6619   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6620     test "$enable_shared" = yes && enable_static=no
6621   fi
6622   ;;
6623 esac
6624 echo "$ac_t""$enable_shared" 1>&6
6625
6626 echo $ac_n "checking whether to build static libraries""... $ac_c" 1>&6
6627 echo "configure:6628: checking whether to build static libraries" >&5
6628 # Make sure either enable_shared or enable_static is yes.
6629 test "$enable_shared" = yes || enable_static=yes
6630 echo "$ac_t""$enable_static" 1>&6
6631
6632 if test "$hardcode_action" = relink; then
6633   # Fast installation is not supported
6634   enable_fast_install=no
6635 elif test "$shlibpath_overrides_runpath" = yes ||
6636      test "$enable_shared" = no; then
6637   # Fast installation is not necessary
6638   enable_fast_install=needless
6639 fi
6640
6641 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
6642 if test "$GCC" = yes; then
6643   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
6644 fi
6645
6646 if test "x$enable_dlopen" != xyes; then
6647   enable_dlopen=unknown
6648   enable_dlopen_self=unknown
6649   enable_dlopen_self_static=unknown
6650 else
6651   lt_cv_dlopen=no
6652   lt_cv_dlopen_libs=
6653
6654   case $host_os in
6655   beos*)
6656     lt_cv_dlopen="load_add_on"
6657     lt_cv_dlopen_libs=
6658     lt_cv_dlopen_self=yes
6659     ;;
6660
6661   cygwin* | mingw* | pw32*)
6662     lt_cv_dlopen="LoadLibrary"
6663     lt_cv_dlopen_libs=
6664    ;;
6665
6666   *)
6667     echo $ac_n "checking for shl_load""... $ac_c" 1>&6
6668 echo "configure:6669: checking for shl_load" >&5
6669 if eval "test \"\${ac_cv_func_shl_load+set}\" = set"; then
6670   echo $ac_n "(cached) $ac_c" 1>&6
6671 else
6672   cat > conftest.$ac_ext <<EOF
6673 #line 6674 "configure"
6674 #include "confdefs.h"
6675 /* System header to define __stub macros and hopefully few prototypes,
6676     which can conflict with char shl_load(); below.  */
6677 #include <assert.h>
6678 /* Override any gcc2 internal prototype to avoid an error.  */
6679 /* We use char because int might match the return type of a gcc2
6680     builtin and then its argument prototype would still apply.  */
6681 char shl_load();
6682 char (*f)();
6683
6684 int main() {
6685
6686 /* The GNU C library defines this for functions which it implements
6687     to always fail with ENOSYS.  Some functions are actually named
6688     something starting with __ and the normal name is an alias.  */
6689 #if defined (__stub_shl_load) || defined (__stub___shl_load)
6690 choke me
6691 #else
6692 f = shl_load;
6693 #endif
6694
6695 ; return 0; }
6696 EOF
6697 if { (eval echo configure:6698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6698   rm -rf conftest*
6699   eval "ac_cv_func_shl_load=yes"
6700 else
6701   echo "configure: failed program was:" >&5
6702   cat conftest.$ac_ext >&5
6703   rm -rf conftest*
6704   eval "ac_cv_func_shl_load=no"
6705 fi
6706 rm -f conftest*
6707 fi
6708
6709 if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
6710   echo "$ac_t""yes" 1>&6
6711   lt_cv_dlopen="shl_load"
6712 else
6713   echo "$ac_t""no" 1>&6
6714 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
6715 echo "configure:6716: checking for shl_load in -ldld" >&5
6716 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-:%__p__%'`
6717 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6718   echo $ac_n "(cached) $ac_c" 1>&6
6719 else
6720   ac_save_LIBS="$LIBS"
6721 LIBS="-ldld  $LIBS"
6722 cat > conftest.$ac_ext <<EOF
6723 #line 6724 "configure"
6724 #include "confdefs.h"
6725 /* Override any gcc2 internal prototype to avoid an error.  */
6726 /* We use char because int might match the return type of a gcc2
6727     builtin and then its argument prototype would still apply.  */
6728 char shl_load();
6729
6730 int main() {
6731 shl_load()
6732 ; return 0; }
6733 EOF
6734 if { (eval echo configure:6735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6735   rm -rf conftest*
6736   eval "ac_cv_lib_$ac_lib_var=yes"
6737 else
6738   echo "configure: failed program was:" >&5
6739   cat conftest.$ac_ext >&5
6740   rm -rf conftest*
6741   eval "ac_cv_lib_$ac_lib_var=no"
6742 fi
6743 rm -f conftest*
6744 LIBS="$ac_save_LIBS"
6745
6746 fi
6747 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6748   echo "$ac_t""yes" 1>&6
6749   lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
6750 else
6751   echo "$ac_t""no" 1>&6
6752 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
6753 echo "configure:6754: checking for dlopen" >&5
6754 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
6755   echo $ac_n "(cached) $ac_c" 1>&6
6756 else
6757   cat > conftest.$ac_ext <<EOF
6758 #line 6759 "configure"
6759 #include "confdefs.h"
6760 /* System header to define __stub macros and hopefully few prototypes,
6761     which can conflict with char dlopen(); below.  */
6762 #include <assert.h>
6763 /* Override any gcc2 internal prototype to avoid an error.  */
6764 /* We use char because int might match the return type of a gcc2
6765     builtin and then its argument prototype would still apply.  */
6766 char dlopen();
6767 char (*f)();
6768
6769 int main() {
6770
6771 /* The GNU C library defines this for functions which it implements
6772     to always fail with ENOSYS.  Some functions are actually named
6773     something starting with __ and the normal name is an alias.  */
6774 #if defined (__stub_dlopen) || defined (__stub___dlopen)
6775 choke me
6776 #else
6777 f = dlopen;
6778 #endif
6779
6780 ; return 0; }
6781 EOF
6782 if { (eval echo configure:6783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6783   rm -rf conftest*
6784   eval "ac_cv_func_dlopen=yes"
6785 else
6786   echo "configure: failed program was:" >&5
6787   cat conftest.$ac_ext >&5
6788   rm -rf conftest*
6789   eval "ac_cv_func_dlopen=no"
6790 fi
6791 rm -f conftest*
6792 fi
6793
6794 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
6795   echo "$ac_t""yes" 1>&6
6796   lt_cv_dlopen="dlopen"
6797 else
6798   echo "$ac_t""no" 1>&6
6799 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
6800 echo "configure:6801: checking for dlopen in -ldl" >&5
6801 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
6802 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6803   echo $ac_n "(cached) $ac_c" 1>&6
6804 else
6805   ac_save_LIBS="$LIBS"
6806 LIBS="-ldl  $LIBS"
6807 cat > conftest.$ac_ext <<EOF
6808 #line 6809 "configure"
6809 #include "confdefs.h"
6810 /* Override any gcc2 internal prototype to avoid an error.  */
6811 /* We use char because int might match the return type of a gcc2
6812     builtin and then its argument prototype would still apply.  */
6813 char dlopen();
6814
6815 int main() {
6816 dlopen()
6817 ; return 0; }
6818 EOF
6819 if { (eval echo configure:6820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6820   rm -rf conftest*
6821   eval "ac_cv_lib_$ac_lib_var=yes"
6822 else
6823   echo "configure: failed program was:" >&5
6824   cat conftest.$ac_ext >&5
6825   rm -rf conftest*
6826   eval "ac_cv_lib_$ac_lib_var=no"
6827 fi
6828 rm -f conftest*
6829 LIBS="$ac_save_LIBS"
6830
6831 fi
6832 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6833   echo "$ac_t""yes" 1>&6
6834   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
6835 else
6836   echo "$ac_t""no" 1>&6
6837 echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
6838 echo "configure:6839: checking for dlopen in -lsvld" >&5
6839 ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-:%__p__%'`
6840 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6841   echo $ac_n "(cached) $ac_c" 1>&6
6842 else
6843   ac_save_LIBS="$LIBS"
6844 LIBS="-lsvld  $LIBS"
6845 cat > conftest.$ac_ext <<EOF
6846 #line 6847 "configure"
6847 #include "confdefs.h"
6848 /* Override any gcc2 internal prototype to avoid an error.  */
6849 /* We use char because int might match the return type of a gcc2
6850     builtin and then its argument prototype would still apply.  */
6851 char dlopen();
6852
6853 int main() {
6854 dlopen()
6855 ; return 0; }
6856 EOF
6857 if { (eval echo configure:6858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6858   rm -rf conftest*
6859   eval "ac_cv_lib_$ac_lib_var=yes"
6860 else
6861   echo "configure: failed program was:" >&5
6862   cat conftest.$ac_ext >&5
6863   rm -rf conftest*
6864   eval "ac_cv_lib_$ac_lib_var=no"
6865 fi
6866 rm -f conftest*
6867 LIBS="$ac_save_LIBS"
6868
6869 fi
6870 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6871   echo "$ac_t""yes" 1>&6
6872   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
6873 else
6874   echo "$ac_t""no" 1>&6
6875 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
6876 echo "configure:6877: checking for dld_link in -ldld" >&5
6877 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-:%__p__%'`
6878 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6879   echo $ac_n "(cached) $ac_c" 1>&6
6880 else
6881   ac_save_LIBS="$LIBS"
6882 LIBS="-ldld  $LIBS"
6883 cat > conftest.$ac_ext <<EOF
6884 #line 6885 "configure"
6885 #include "confdefs.h"
6886 /* Override any gcc2 internal prototype to avoid an error.  */
6887 /* We use char because int might match the return type of a gcc2
6888     builtin and then its argument prototype would still apply.  */
6889 char dld_link();
6890
6891 int main() {
6892 dld_link()
6893 ; return 0; }
6894 EOF
6895 if { (eval echo configure:6896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6896   rm -rf conftest*
6897   eval "ac_cv_lib_$ac_lib_var=yes"
6898 else
6899   echo "configure: failed program was:" >&5
6900   cat conftest.$ac_ext >&5
6901   rm -rf conftest*
6902   eval "ac_cv_lib_$ac_lib_var=no"
6903 fi
6904 rm -f conftest*
6905 LIBS="$ac_save_LIBS"
6906
6907 fi
6908 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6909   echo "$ac_t""yes" 1>&6
6910   lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
6911 else
6912   echo "$ac_t""no" 1>&6
6913 fi
6914
6915               
6916 fi
6917
6918             
6919 fi
6920
6921           
6922 fi
6923
6924         
6925 fi
6926
6927       
6928 fi
6929
6930     ;;
6931   esac
6932
6933   if test "x$lt_cv_dlopen" != xno; then
6934     enable_dlopen=yes
6935   else
6936     enable_dlopen=no
6937   fi
6938
6939   case $lt_cv_dlopen in
6940   dlopen)
6941     save_CPPFLAGS="$CPPFLAGS"
6942         test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
6943
6944     save_LDFLAGS="$LDFLAGS"
6945     eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
6946
6947     save_LIBS="$LIBS"
6948     LIBS="$lt_cv_dlopen_libs $LIBS"
6949
6950     echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
6951 echo "configure:6952: checking whether a program can dlopen itself" >&5
6952 if eval "test \"\${lt_cv_dlopen_self+set}\" = set"; then
6953   echo $ac_n "(cached) $ac_c" 1>&6
6954 else
6955           if test "$cross_compiling" = yes; then :
6956   lt_cv_dlopen_self=cross
6957 else
6958     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
6959   lt_status=$lt_dlunknown
6960   cat > conftest.$ac_ext <<EOF
6961 #line 6962 "configure"
6962 #include "confdefs.h"
6963
6964 #if HAVE_DLFCN_H
6965 #include <dlfcn.h>
6966 #endif
6967
6968 #include <stdio.h>
6969
6970 #ifdef RTLD_GLOBAL
6971 #  define LT_DLGLOBAL           RTLD_GLOBAL
6972 #else
6973 #  ifdef DL_GLOBAL
6974 #    define LT_DLGLOBAL         DL_GLOBAL
6975 #  else
6976 #    define LT_DLGLOBAL         0
6977 #  endif
6978 #endif
6979
6980 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
6981    find out it does not work in some platform. */
6982 #ifndef LT_DLLAZY_OR_NOW
6983 #  ifdef RTLD_LAZY
6984 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
6985 #  else
6986 #    ifdef DL_LAZY
6987 #      define LT_DLLAZY_OR_NOW          DL_LAZY
6988 #    else
6989 #      ifdef RTLD_NOW
6990 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
6991 #      else
6992 #        ifdef DL_NOW
6993 #          define LT_DLLAZY_OR_NOW      DL_NOW
6994 #        else
6995 #          define LT_DLLAZY_OR_NOW      0
6996 #        endif
6997 #      endif
6998 #    endif
6999 #  endif
7000 #endif
7001
7002 #ifdef __cplusplus
7003 extern "C" void exit (int);
7004 #endif
7005
7006 void fnord() { int i=42;}
7007 int main ()
7008 {
7009   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
7010   int status = $lt_dlunknown;
7011
7012   if (self)
7013     {
7014       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
7015       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
7016       /* dlclose (self); */
7017     }
7018
7019     exit (status);
7020 }
7021 EOF
7022   if { (eval echo configure:7023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
7023     (./conftest; exit; ) 2>/dev/null
7024     lt_status=$?
7025     case x$lt_status in
7026       x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
7027       x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
7028       x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
7029     esac
7030   else :
7031     # compilation failed
7032     lt_cv_dlopen_self=no
7033   fi
7034 fi
7035 rm -fr conftest*
7036
7037     
7038 fi
7039
7040 echo "$ac_t""$lt_cv_dlopen_self" 1>&6
7041
7042     if test "x$lt_cv_dlopen_self" = xyes; then
7043       LDFLAGS="$LDFLAGS $link_static_flag"
7044       echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
7045 echo "configure:7046: checking whether a statically linked program can dlopen itself" >&5
7046 if eval "test \"\${lt_cv_dlopen_self_static+set}\" = set"; then
7047   echo $ac_n "(cached) $ac_c" 1>&6
7048 else
7049           if test "$cross_compiling" = yes; then :
7050   lt_cv_dlopen_self_static=cross
7051 else
7052     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
7053   lt_status=$lt_dlunknown
7054   cat > conftest.$ac_ext <<EOF
7055 #line 7056 "configure"
7056 #include "confdefs.h"
7057
7058 #if HAVE_DLFCN_H
7059 #include <dlfcn.h>
7060 #endif
7061
7062 #include <stdio.h>
7063
7064 #ifdef RTLD_GLOBAL
7065 #  define LT_DLGLOBAL           RTLD_GLOBAL
7066 #else
7067 #  ifdef DL_GLOBAL
7068 #    define LT_DLGLOBAL         DL_GLOBAL
7069 #  else
7070 #    define LT_DLGLOBAL         0
7071 #  endif
7072 #endif
7073
7074 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
7075    find out it does not work in some platform. */
7076 #ifndef LT_DLLAZY_OR_NOW
7077 #  ifdef RTLD_LAZY
7078 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
7079 #  else
7080 #    ifdef DL_LAZY
7081 #      define LT_DLLAZY_OR_NOW          DL_LAZY
7082 #    else
7083 #      ifdef RTLD_NOW
7084 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
7085 #      else
7086 #        ifdef DL_NOW
7087 #          define LT_DLLAZY_OR_NOW      DL_NOW
7088 #        else
7089 #          define LT_DLLAZY_OR_NOW      0
7090 #        endif
7091 #      endif
7092 #    endif
7093 #  endif
7094 #endif
7095
7096 #ifdef __cplusplus
7097 extern "C" void exit (int);
7098 #endif
7099
7100 void fnord() { int i=42;}
7101 int main ()
7102 {
7103   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
7104   int status = $lt_dlunknown;
7105
7106   if (self)
7107     {
7108       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
7109       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
7110       /* dlclose (self); */
7111     }
7112
7113     exit (status);
7114 }
7115 EOF
7116   if { (eval echo configure:7117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
7117     (./conftest; exit; ) 2>/dev/null
7118     lt_status=$?
7119     case x$lt_status in
7120       x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
7121       x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
7122       x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
7123     esac
7124   else :
7125     # compilation failed
7126     lt_cv_dlopen_self_static=no
7127   fi
7128 fi
7129 rm -fr conftest*
7130
7131       
7132 fi
7133
7134 echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
7135     fi
7136
7137     CPPFLAGS="$save_CPPFLAGS"
7138     LDFLAGS="$save_LDFLAGS"
7139     LIBS="$save_LIBS"
7140     ;;
7141   esac
7142
7143   case $lt_cv_dlopen_self in
7144   yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
7145   *) enable_dlopen_self=unknown ;;
7146   esac
7147
7148   case $lt_cv_dlopen_self_static in
7149   yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
7150   *) enable_dlopen_self_static=unknown ;;
7151   esac
7152 fi
7153
7154
7155 if test "$enable_shared" = yes && test "$GCC" = yes; then
7156   case $archive_cmds in
7157   *'~'*)
7158     # FIXME: we may have to deal with multi-command sequences.
7159     ;;
7160   '$CC '*)
7161     # Test whether the compiler implicitly links with -lc since on some
7162     # systems, -lgcc has to come before -lc. If gcc already passes -lc
7163     # to ld, don't add -lc before -lgcc.
7164     echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6
7165 echo "configure:7166: checking whether -lc should be explicitly linked in" >&5
7166     if eval "test \"\${lt_cv_archive_cmds_need_lc+set}\" = set"; then
7167   echo $ac_n "(cached) $ac_c" 1>&6
7168 else
7169   $rm conftest*
7170     echo 'static int dummy;' > conftest.$ac_ext
7171
7172     if { (eval echo configure:7173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7173       soname=conftest
7174       lib=conftest
7175       libobjs=conftest.$ac_objext
7176       deplibs=
7177       wl=$lt_cv_prog_cc_wl
7178       compiler_flags=-v
7179       linker_flags=-v
7180       verstring=
7181       output_objdir=.
7182       libname=conftest
7183       save_allow_undefined_flag=$allow_undefined_flag
7184       allow_undefined_flag=
7185       if { (eval echo configure:7186: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; }
7186       then
7187         lt_cv_archive_cmds_need_lc=no
7188       else
7189         lt_cv_archive_cmds_need_lc=yes
7190       fi
7191       allow_undefined_flag=$save_allow_undefined_flag
7192     else
7193       cat conftest.err 1>&5
7194     fi
7195 fi
7196
7197     echo "$ac_t""$lt_cv_archive_cmds_need_lc" 1>&6
7198     ;;
7199   esac
7200 fi
7201 need_lc=${lt_cv_archive_cmds_need_lc-yes}
7202
7203 # The second clause should only fire when bootstrapping the
7204 # libtool distribution, otherwise you forgot to ship ltmain.sh
7205 # with your package, and you will get complaints that there are
7206 # no rules to generate ltmain.sh.
7207 if test -f "$ltmain"; then
7208   :
7209 else
7210   # If there is no Makefile yet, we rely on a make rule to execute
7211   # `config.status --recheck' to rerun these tests and create the
7212   # libtool script then.
7213   test -f Makefile && make "$ltmain"
7214 fi
7215
7216 if test -f "$ltmain"; then
7217   trap "$rm \"${ofile}T\"; exit 1" 1 2 15
7218   $rm -f "${ofile}T"
7219
7220   echo creating $ofile
7221
7222   # Now quote all the things that may contain metacharacters while being
7223   # careful not to overquote the AC_SUBSTed values.  We take copies of the
7224   # variables and quote the copies for generation of the libtool script.
7225   for var in echo old_CC old_CFLAGS SED \
7226     AR AR_FLAGS CC LD LN_S NM SHELL \
7227     reload_flag reload_cmds wl \
7228     pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
7229     thread_safe_flag_spec whole_archive_flag_spec libname_spec \
7230     library_names_spec soname_spec \
7231     RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
7232     old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
7233     postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
7234     old_striplib striplib file_magic_cmd export_symbols_cmds \
7235     deplibs_check_method allow_undefined_flag no_undefined_flag \
7236     finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
7237     global_symbol_to_c_name_address \
7238     hardcode_libdir_flag_spec hardcode_libdir_separator  \
7239     sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
7240     compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
7241
7242     case $var in
7243     reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
7244     old_postinstall_cmds | old_postuninstall_cmds | \
7245     export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
7246     extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
7247     postinstall_cmds | postuninstall_cmds | \
7248     finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
7249       # Double-quote double-evaled strings.
7250       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
7251       ;;
7252     *)
7253       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
7254       ;;
7255     esac
7256   done
7257
7258   cat <<__EOF__ > "${ofile}T"
7259 #! $SHELL
7260
7261 # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
7262 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
7263 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
7264 #
7265 # Copyright (C) 1996-2000 Free Software Foundation, Inc.
7266 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7267 #
7268 # This program is free software; you can redistribute it and/or modify
7269 # it under the terms of the GNU General Public License as published by
7270 # the Free Software Foundation; either version 2 of the License, or
7271 # (at your option) any later version.
7272 #
7273 # This program is distributed in the hope that it will be useful, but
7274 # WITHOUT ANY WARRANTY; without even the implied warranty of
7275 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
7276 # General Public License for more details.
7277 #
7278 # You should have received a copy of the GNU General Public License
7279 # along with this program; if not, write to the Free Software
7280 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
7281 #
7282 # As a special exception to the GNU General Public License, if you
7283 # distribute this file as part of a program that contains a
7284 # configuration script generated by Autoconf, you may include it under
7285 # the same distribution terms that you use for the rest of that program.
7286
7287 # A sed that does not truncate output.
7288 SED=$lt_SED
7289
7290 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
7291 Xsed="${SED} -e s/^X//"
7292
7293 # The HP-UX ksh and POSIX shell print the target directory to stdout
7294 # if CDPATH is set.
7295 if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
7296
7297 # ### BEGIN LIBTOOL CONFIG
7298
7299 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
7300
7301 # Shell to use when invoking shell scripts.
7302 SHELL=$lt_SHELL
7303
7304 # Whether or not to build shared libraries.
7305 build_libtool_libs=$enable_shared
7306
7307 # Whether or not to build static libraries.
7308 build_old_libs=$enable_static
7309
7310 # Whether or not to add -lc for building shared libraries.
7311 build_libtool_need_lc=$need_lc
7312
7313 # Whether or not to optimize for fast installation.
7314 fast_install=$enable_fast_install
7315
7316 # The host system.
7317 host_alias=$host_alias
7318 host=$host
7319
7320 # An echo program that does not interpret backslashes.
7321 echo=$lt_echo
7322
7323 # The archiver.
7324 AR=$lt_AR
7325 AR_FLAGS=$lt_AR_FLAGS
7326
7327 # The default C compiler.
7328 CC=$lt_CC
7329
7330 # Is the compiler the GNU C compiler?
7331 with_gcc=$GCC
7332
7333 # The linker used to build libraries.
7334 LD=$lt_LD
7335
7336 # Whether we need hard or soft links.
7337 LN_S=$lt_LN_S
7338
7339 # A BSD-compatible nm program.
7340 NM=$lt_NM
7341
7342 # A symbol stripping program
7343 STRIP=$STRIP
7344
7345 # Used to examine libraries when file_magic_cmd begins "file"
7346 MAGIC_CMD=$MAGIC_CMD
7347
7348 # Used on cygwin: DLL creation program.
7349 DLLTOOL="$DLLTOOL"
7350
7351 # Used on cygwin: object dumper.
7352 OBJDUMP="$OBJDUMP"
7353
7354 # Used on cygwin: assembler.
7355 AS="$AS"
7356
7357 # The name of the directory that contains temporary libtool files.
7358 objdir=$objdir
7359
7360 # How to create reloadable object files.
7361 reload_flag=$lt_reload_flag
7362 reload_cmds=$lt_reload_cmds
7363
7364 # How to pass a linker flag through the compiler.
7365 wl=$lt_wl
7366
7367 # Object file suffix (normally "o").
7368 objext="$ac_objext"
7369
7370 # Old archive suffix (normally "a").
7371 libext="$libext"
7372
7373 # Executable file suffix (normally "").
7374 exeext="$exeext"
7375
7376 # Additional compiler flags for building library objects.
7377 pic_flag=$lt_pic_flag
7378 pic_mode=$pic_mode
7379
7380 # Does compiler simultaneously support -c and -o options?
7381 compiler_c_o=$lt_compiler_c_o
7382
7383 # Can we write directly to a .lo ?
7384 compiler_o_lo=$lt_compiler_o_lo
7385
7386 # Must we lock files when doing compilation ?
7387 need_locks=$lt_need_locks
7388
7389 # Do we need the lib prefix for modules?
7390 need_lib_prefix=$need_lib_prefix
7391
7392 # Do we need a version for libraries?
7393 need_version=$need_version
7394
7395 # Whether dlopen is supported.
7396 dlopen_support=$enable_dlopen
7397
7398 # Whether dlopen of programs is supported.
7399 dlopen_self=$enable_dlopen_self
7400
7401 # Whether dlopen of statically linked programs is supported.
7402 dlopen_self_static=$enable_dlopen_self_static
7403
7404 # Compiler flag to prevent dynamic linking.
7405 link_static_flag=$lt_link_static_flag
7406
7407 # Compiler flag to turn off builtin functions.
7408 no_builtin_flag=$lt_no_builtin_flag
7409
7410 # Compiler flag to allow reflexive dlopens.
7411 export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
7412
7413 # Compiler flag to generate shared objects directly from archives.
7414 whole_archive_flag_spec=$lt_whole_archive_flag_spec
7415
7416 # Compiler flag to generate thread-safe objects.
7417 thread_safe_flag_spec=$lt_thread_safe_flag_spec
7418
7419 # Library versioning type.
7420 version_type=$version_type
7421
7422 # Format of library name prefix.
7423 libname_spec=$lt_libname_spec
7424
7425 # List of archive names.  First name is the real one, the rest are links.
7426 # The last name is the one that the linker finds with -lNAME.
7427 library_names_spec=$lt_library_names_spec
7428
7429 # The coded name of the library, if different from the real name.
7430 soname_spec=$lt_soname_spec
7431
7432 # Commands used to build and install an old-style archive.
7433 RANLIB=$lt_RANLIB
7434 old_archive_cmds=$lt_old_archive_cmds
7435 old_postinstall_cmds=$lt_old_postinstall_cmds
7436 old_postuninstall_cmds=$lt_old_postuninstall_cmds
7437
7438 # Create an old-style archive from a shared archive.
7439 old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
7440
7441 # Create a temporary old-style archive to link instead of a shared archive.
7442 old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
7443
7444 # Commands used to build and install a shared archive.
7445 archive_cmds=$lt_archive_cmds
7446 archive_expsym_cmds=$lt_archive_expsym_cmds
7447 postinstall_cmds=$lt_postinstall_cmds
7448 postuninstall_cmds=$lt_postuninstall_cmds
7449
7450 # Commands to strip libraries.
7451 old_striplib=$lt_old_striplib
7452 striplib=$lt_striplib
7453
7454 # Method to check whether dependent libraries are shared objects.
7455 deplibs_check_method=$lt_deplibs_check_method
7456
7457 # Command to use when deplibs_check_method == file_magic.
7458 file_magic_cmd=$lt_file_magic_cmd
7459
7460 # Flag that allows shared libraries with undefined symbols to be built.
7461 allow_undefined_flag=$lt_allow_undefined_flag
7462
7463 # Flag that forces no undefined symbols.
7464 no_undefined_flag=$lt_no_undefined_flag
7465
7466 # Commands used to finish a libtool library installation in a directory.
7467 finish_cmds=$lt_finish_cmds
7468
7469 # Same as above, but a single script fragment to be evaled but not shown.
7470 finish_eval=$lt_finish_eval
7471
7472 # Take the output of nm and produce a listing of raw symbols and C names.
7473 global_symbol_pipe=$lt_global_symbol_pipe
7474
7475 # Transform the output of nm in a proper C declaration
7476 global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
7477
7478 # Transform the output of nm in a C name address pair
7479 global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
7480
7481 # This is the shared library runtime path variable.
7482 runpath_var=$runpath_var
7483
7484 # This is the shared library path variable.
7485 shlibpath_var=$shlibpath_var
7486
7487 # Is shlibpath searched before the hard-coded library search path?
7488 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
7489
7490 # How to hardcode a shared library path into an executable.
7491 hardcode_action=$hardcode_action
7492
7493 # Whether we should hardcode library paths into libraries.
7494 hardcode_into_libs=$hardcode_into_libs
7495
7496 # Flag to hardcode \$libdir into a binary during linking.
7497 # This must work even if \$libdir does not exist.
7498 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
7499
7500 # Whether we need a single -rpath flag with a separated argument.
7501 hardcode_libdir_separator=$lt_hardcode_libdir_separator
7502
7503 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
7504 # resulting binary.
7505 hardcode_direct=$hardcode_direct
7506
7507 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7508 # resulting binary.
7509 hardcode_minus_L=$hardcode_minus_L
7510
7511 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7512 # the resulting binary.
7513 hardcode_shlibpath_var=$hardcode_shlibpath_var
7514
7515 # Variables whose values should be saved in libtool wrapper scripts and
7516 # restored at relink time.
7517 variables_saved_for_relink="$variables_saved_for_relink"
7518
7519 # Whether libtool must link a program against all its dependency libraries.
7520 link_all_deplibs=$link_all_deplibs
7521
7522 # Compile-time system search path for libraries
7523 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
7524
7525 # Run-time system search path for libraries
7526 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
7527
7528 # Fix the shell variable \$srcfile for the compiler.
7529 fix_srcfile_path="$fix_srcfile_path"
7530
7531 # Set to yes if exported symbols are required.
7532 always_export_symbols=$always_export_symbols
7533
7534 # The commands to list exported symbols.
7535 export_symbols_cmds=$lt_export_symbols_cmds
7536
7537 # The commands to extract the exported symbol list from a shared archive.
7538 extract_expsyms_cmds=$lt_extract_expsyms_cmds
7539
7540 # Symbols that should not be listed in the preloaded symbols.
7541 exclude_expsyms=$lt_exclude_expsyms
7542
7543 # Symbols that must always be exported.
7544 include_expsyms=$lt_include_expsyms
7545
7546 # ### END LIBTOOL CONFIG
7547
7548 __EOF__
7549
7550   case $host_os in
7551   aix3*)
7552     cat <<\EOF >> "${ofile}T"
7553
7554 # AIX sometimes has problems with the GCC collect2 program.  For some
7555 # reason, if we set the COLLECT_NAMES environment variable, the problems
7556 # vanish in a puff of smoke.
7557 if test "X${COLLECT_NAMES+set}" != Xset; then
7558   COLLECT_NAMES=
7559   export COLLECT_NAMES
7560 fi
7561 EOF
7562     ;;
7563   esac
7564
7565   case $host_os in
7566   cygwin* | mingw* | pw32* | os2*)
7567     cat <<'EOF' >> "${ofile}T"
7568       # This is a source program that is used to create dlls on Windows
7569       # Don't remove nor modify the starting and closing comments
7570 # /* ltdll.c starts here */
7571 # #define WIN32_LEAN_AND_MEAN
7572 # #include <windows.h>
7573 # #undef WIN32_LEAN_AND_MEAN
7574 # #include <stdio.h>
7575 #
7576 # #ifndef __CYGWIN__
7577 # #  ifdef __CYGWIN32__
7578 # #    define __CYGWIN__ __CYGWIN32__
7579 # #  endif
7580 # #endif
7581 #
7582 # #ifdef __cplusplus
7583 # extern "C" {
7584 # #endif
7585 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
7586 # #ifdef __cplusplus
7587 # }
7588 # #endif
7589 #
7590 # #ifdef __CYGWIN__
7591 # #include <cygwin/cygwin_dll.h>
7592 # DECLARE_CYGWIN_DLL( DllMain );
7593 # #endif
7594 # HINSTANCE __hDllInstance_base;
7595 #
7596 # BOOL APIENTRY
7597 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
7598 # {
7599 #   __hDllInstance_base = hInst;
7600 #   return TRUE;
7601 # }
7602 # /* ltdll.c ends here */
7603         # This is a source program that is used to create import libraries
7604         # on Windows for dlls which lack them. Don't remove nor modify the
7605         # starting and closing comments
7606 # /* impgen.c starts here */
7607 # /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
7608 #
7609 #  This file is part of GNU libtool.
7610 #
7611 #  This program is free software; you can redistribute it and/or modify
7612 #  it under the terms of the GNU General Public License as published by
7613 #  the Free Software Foundation; either version 2 of the License, or
7614 #  (at your option) any later version.
7615 #
7616 #  This program is distributed in the hope that it will be useful,
7617 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
7618 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
7619 #  GNU General Public License for more details.
7620 #
7621 #  You should have received a copy of the GNU General Public License
7622 #  along with this program; if not, write to the Free Software
7623 #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
7624 #  */
7625 #
7626 # #include <stdio.h>            /* for printf() */
7627 # #include <unistd.h>           /* for open(), lseek(), read() */
7628 # #include <fcntl.h>            /* for O_RDONLY, O_BINARY */
7629 # #include <string.h>           /* for strdup() */
7630 #
7631 # /* O_BINARY isn't required (or even defined sometimes) under Unix */
7632 # #ifndef O_BINARY
7633 # #define O_BINARY 0
7634 # #endif
7635 #
7636 # static unsigned int
7637 # pe_get16 (fd, offset)
7638 #      int fd;
7639 #      int offset;
7640 # {
7641 #   unsigned char b[2];
7642 #   lseek (fd, offset, SEEK_SET);
7643 #   read (fd, b, 2);
7644 #   return b[0] + (b[1]<<8);
7645 # }
7646 #
7647 # static unsigned int
7648 # pe_get32 (fd, offset)
7649 #     int fd;
7650 #     int offset;
7651 # {
7652 #   unsigned char b[4];
7653 #   lseek (fd, offset, SEEK_SET);
7654 #   read (fd, b, 4);
7655 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
7656 # }
7657 #
7658 # static unsigned int
7659 # pe_as32 (ptr)
7660 #      void *ptr;
7661 # {
7662 #   unsigned char *b = ptr;
7663 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
7664 # }
7665 #
7666 # int
7667 # main (argc, argv)
7668 #     int argc;
7669 #     char *argv[];
7670 # {
7671 #     int dll;
7672 #     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
7673 #     unsigned long export_rva, export_size, nsections, secptr, expptr;
7674 #     unsigned long name_rvas, nexp;
7675 #     unsigned char *expdata, *erva;
7676 #     char *filename, *dll_name;
7677 #
7678 #     filename = argv[1];
7679 #
7680 #     dll = open(filename, O_RDONLY|O_BINARY);
7681 #     if (dll < 1)
7682 #       return 1;
7683 #
7684 #     dll_name = filename;
7685 #
7686 #     for (i=0; filename[i]; i++)
7687 #       if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
7688 #           dll_name = filename + i +1;
7689 #
7690 #     pe_header_offset = pe_get32 (dll, 0x3c);
7691 #     opthdr_ofs = pe_header_offset + 4 + 20;
7692 #     num_entries = pe_get32 (dll, opthdr_ofs + 92);
7693 #
7694 #     if (num_entries < 1) /* no exports */
7695 #       return 1;
7696 #
7697 #     export_rva = pe_get32 (dll, opthdr_ofs + 96);
7698 #     export_size = pe_get32 (dll, opthdr_ofs + 100);
7699 #     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
7700 #     secptr = (pe_header_offset + 4 + 20 +
7701 #             pe_get16 (dll, pe_header_offset + 4 + 16));
7702 #
7703 #     expptr = 0;
7704 #     for (i = 0; i < nsections; i++)
7705 #     {
7706 #       char sname[8];
7707 #       unsigned long secptr1 = secptr + 40 * i;
7708 #       unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
7709 #       unsigned long vsize = pe_get32 (dll, secptr1 + 16);
7710 #       unsigned long fptr = pe_get32 (dll, secptr1 + 20);
7711 #       lseek(dll, secptr1, SEEK_SET);
7712 #       read(dll, sname, 8);
7713 #       if (vaddr <= export_rva && vaddr+vsize > export_rva)
7714 #       {
7715 #           expptr = fptr + (export_rva - vaddr);
7716 #           if (export_rva + export_size > vaddr + vsize)
7717 #               export_size = vsize - (export_rva - vaddr);
7718 #           break;
7719 #       }
7720 #     }
7721 #
7722 #     expdata = (unsigned char*)malloc(export_size);
7723 #     lseek (dll, expptr, SEEK_SET);
7724 #     read (dll, expdata, export_size);
7725 #     erva = expdata - export_rva;
7726 #
7727 #     nexp = pe_as32 (expdata+24);
7728 #     name_rvas = pe_as32 (expdata+32);
7729 #
7730 #     printf ("EXPORTS\n");
7731 #     for (i = 0; i<nexp; i++)
7732 #     {
7733 #       unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
7734 #       printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
7735 #     }
7736 #
7737 #     return 0;
7738 # }
7739 # /* impgen.c ends here */
7740
7741 EOF
7742     ;;
7743   esac
7744
7745   # We use sed instead of cat because bash on DJGPP gets confused if
7746   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
7747   # text mode, it properly converts lines to CR/LF.  This bash problem
7748   # is reportedly fixed, but why not run on old versions too?
7749   sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
7750
7751   mv -f "${ofile}T" "$ofile" || \
7752     (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
7753   chmod +x "$ofile"
7754 fi
7755
7756
7757
7758
7759
7760 # This can be used to rebuild libtool when needed
7761 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
7762
7763 # Always use our own libtool.
7764 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
7765
7766 # Prevent multiple expansion
7767
7768
7769
7770 # test for ln hardlink support
7771 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
7772 echo "configure:7773: checking whether ln works" >&5
7773 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
7774   echo $ac_n "(cached) $ac_c" 1>&6
7775 else
7776   rm -f conftest.src conftest.dst
7777 echo "conftest" > conftest.src
7778 if ln conftest.src conftest.dst 2>/dev/null
7779 then
7780   ol_cv_prog_LN_H="ln"
7781 else
7782   ol_cv_prog_LN_H="cp"
7783 fi
7784 rm -f conftest.src conftest.dst
7785
7786 fi
7787 LN_H="$ol_cv_prog_LN_H"
7788 if test "$ol_cv_prog_LN_H" = "ln"; then
7789         echo "$ac_t""yes" 1>&6
7790 else
7791         echo "$ac_t""no" 1>&6
7792 fi
7793
7794 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
7795 echo "configure:7796: checking whether ln -s works" >&5
7796 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
7797   echo $ac_n "(cached) $ac_c" 1>&6
7798 else
7799   rm -f conftestdata
7800 if ln -s X conftestdata 2>/dev/null
7801 then
7802   rm -f conftestdata
7803   ac_cv_prog_LN_S="ln -s"
7804 else
7805   ac_cv_prog_LN_S=ln
7806 fi
7807 fi
7808 LN_S="$ac_cv_prog_LN_S"
7809 if test "$ac_cv_prog_LN_S" = "ln -s"; then
7810   echo "$ac_t""yes" 1>&6
7811 else
7812   echo "$ac_t""no" 1>&6
7813 fi
7814
7815
7816 ol_link_perl=no
7817 if test $ol_enable_perl != no ; then
7818         # Extract the first word of "perl", so it can be a program name with args.
7819 set dummy perl; ac_word=$2
7820 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7821 echo "configure:7822: checking for $ac_word" >&5
7822 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
7823   echo $ac_n "(cached) $ac_c" 1>&6
7824 else
7825   case "$PERLBIN" in
7826   /*)
7827   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
7828   ;;
7829   ?:/*)
7830   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
7831   ;;
7832   *)
7833   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7834   ac_dummy="$PATH"
7835   for ac_dir in $ac_dummy; do 
7836     test -z "$ac_dir" && ac_dir=.
7837     if test -f $ac_dir/$ac_word; then
7838       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
7839       break
7840     fi
7841   done
7842   IFS="$ac_save_ifs"
7843   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
7844   ;;
7845 esac
7846 fi
7847 PERLBIN="$ac_cv_path_PERLBIN"
7848 if test -n "$PERLBIN"; then
7849   echo "$ac_t""$PERLBIN" 1>&6
7850 else
7851   echo "$ac_t""no" 1>&6
7852 fi
7853
7854
7855         if test "no$PERLBIN" = "no" ; then
7856                 if test $ol_enable_perl = yes ; then
7857                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
7858                 fi
7859
7860         else
7861                 PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
7862                 PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e 's/ -lc / /' -e 's/ -lc$//'`"
7863
7864                 if test x"$ol_with_perl_module" = "xstatic" ; then
7865                         SLAPD_PERL_LDFLAGS="$PERL_LDFLAGS"
7866                 else
7867                         MOD_PERL_LDFLAGS="$PERL_LDFLAGS"
7868                 fi
7869                                 ol_link_perl=yes
7870         fi
7871 fi
7872
7873 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
7874 echo "configure:7875: checking how to run the C preprocessor" >&5
7875 # On Suns, sometimes $CPP names a directory.
7876 if test -n "$CPP" && test -d "$CPP"; then
7877   CPP=
7878 fi
7879 if test -z "$CPP"; then
7880 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
7881   echo $ac_n "(cached) $ac_c" 1>&6
7882 else
7883     # This must be in double quotes, not single quotes, because CPP may get
7884   # substituted into the Makefile and "${CC-cc}" will confuse make.
7885   CPP="${CC-cc} -E"
7886   # On the NeXT, cc -E runs the code through the compiler's parser,
7887   # not just through cpp.
7888   cat > conftest.$ac_ext <<EOF
7889 #line 7890 "configure"
7890 #include "confdefs.h"
7891 #include <assert.h>
7892 Syntax Error
7893 EOF
7894 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7895 { (eval echo configure:7896: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7896 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7897 if test -z "$ac_err"; then
7898   :
7899 else
7900   echo "$ac_err" >&5
7901   echo "configure: failed program was:" >&5
7902   cat conftest.$ac_ext >&5
7903   rm -rf conftest*
7904   CPP="${CC-cc} -E -traditional-cpp"
7905   cat > conftest.$ac_ext <<EOF
7906 #line 7907 "configure"
7907 #include "confdefs.h"
7908 #include <assert.h>
7909 Syntax Error
7910 EOF
7911 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7912 { (eval echo configure:7913: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7913 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7914 if test -z "$ac_err"; then
7915   :
7916 else
7917   echo "$ac_err" >&5
7918   echo "configure: failed program was:" >&5
7919   cat conftest.$ac_ext >&5
7920   rm -rf conftest*
7921   CPP="${CC-cc} -nologo -E"
7922   cat > conftest.$ac_ext <<EOF
7923 #line 7924 "configure"
7924 #include "confdefs.h"
7925 #include <assert.h>
7926 Syntax Error
7927 EOF
7928 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7929 { (eval echo configure:7930: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7930 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7931 if test -z "$ac_err"; then
7932   :
7933 else
7934   echo "$ac_err" >&5
7935   echo "configure: failed program was:" >&5
7936   cat conftest.$ac_ext >&5
7937   rm -rf conftest*
7938   CPP=/lib/cpp
7939 fi
7940 rm -f conftest*
7941 fi
7942 rm -f conftest*
7943 fi
7944 rm -f conftest*
7945   ac_cv_prog_CPP="$CPP"
7946 fi
7947   CPP="$ac_cv_prog_CPP"
7948 else
7949   ac_cv_prog_CPP="$CPP"
7950 fi
7951 echo "$ac_t""$CPP" 1>&6
7952
7953
7954 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
7955         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
7956
7957 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
7958         echo "configure: warning: programs compiled here do run here..." 1>&2
7959         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
7960
7961 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
7962         echo "configure: warning: programs compiled here do not run here..." 1>&2
7963         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
7964 fi
7965
7966
7967 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
7968 echo "configure:7969: checking for Cygwin environment" >&5
7969 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
7970   echo $ac_n "(cached) $ac_c" 1>&6
7971 else
7972   cat > conftest.$ac_ext <<EOF
7973 #line 7974 "configure"
7974 #include "confdefs.h"
7975
7976 int main() {
7977
7978 #ifndef __CYGWIN__
7979 #define __CYGWIN__ __CYGWIN32__
7980 #endif
7981 return __CYGWIN__;
7982 ; return 0; }
7983 EOF
7984 if { (eval echo configure:7985: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7985   rm -rf conftest*
7986   ac_cv_cygwin=yes
7987 else
7988   echo "configure: failed program was:" >&5
7989   cat conftest.$ac_ext >&5
7990   rm -rf conftest*
7991   ac_cv_cygwin=no
7992 fi
7993 rm -f conftest*
7994 fi
7995
7996 echo "$ac_t""$ac_cv_cygwin" 1>&6
7997 CYGWIN=
7998 test "$ac_cv_cygwin" = yes && CYGWIN=yes
7999 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
8000 echo "configure:8001: checking for mingw32 environment" >&5
8001 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
8002   echo $ac_n "(cached) $ac_c" 1>&6
8003 else
8004   cat > conftest.$ac_ext <<EOF
8005 #line 8006 "configure"
8006 #include "confdefs.h"
8007
8008 int main() {
8009 return __MINGW32__;
8010 ; return 0; }
8011 EOF
8012 if { (eval echo configure:8013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8013   rm -rf conftest*
8014   ac_cv_mingw32=yes
8015 else
8016   echo "configure: failed program was:" >&5
8017   cat conftest.$ac_ext >&5
8018   rm -rf conftest*
8019   ac_cv_mingw32=no
8020 fi
8021 rm -f conftest*
8022 fi
8023
8024 echo "$ac_t""$ac_cv_mingw32" 1>&6
8025 MINGW32=
8026 test "$ac_cv_mingw32" = yes && MINGW32=yes
8027
8028
8029
8030 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
8031 echo "configure:8032: checking for executable suffix" >&5
8032 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
8033   echo $ac_n "(cached) $ac_c" 1>&6
8034 else
8035   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
8036   ac_cv_exeext=.exe
8037 else
8038   rm -f conftest*
8039   echo 'int main () { return 0; }' > conftest.$ac_ext
8040   ac_cv_exeext=
8041   if { (eval echo configure:8042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
8042     for file in conftest.*; do
8043       case $file in
8044       *.c | *.C | *.o | *.obj | *.xcoff) ;;
8045       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
8046       esac
8047     done
8048   else
8049     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
8050   fi
8051   rm -f conftest*
8052   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
8053 fi
8054 fi
8055
8056 EXEEXT=""
8057 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
8058 echo "$ac_t""${ac_cv_exeext}" 1>&6
8059 ac_exeext=$EXEEXT
8060
8061 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
8062 echo "configure:8063: checking for object suffix" >&5
8063 if eval "test \"\${ac_cv_objext+set}\" = set"; then
8064   echo $ac_n "(cached) $ac_c" 1>&6
8065 else
8066   rm -f conftest*
8067 echo 'int i = 1;' > conftest.$ac_ext
8068 if { (eval echo configure:8069: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8069   for ac_file in conftest.*; do
8070     case $ac_file in
8071     *.c) ;;
8072     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
8073     esac
8074   done
8075 else
8076   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
8077 fi
8078 rm -f conftest*
8079 fi
8080
8081 echo "$ac_t""$ac_cv_objext" 1>&6
8082 OBJEXT=$ac_cv_objext
8083 ac_objext=$ac_cv_objext
8084
8085
8086 cat >> confdefs.h <<EOF
8087 #define EXEEXT "${EXEEXT}"
8088 EOF
8089
8090
8091 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
8092 echo "configure:8093: checking for be_app in -lbe" >&5
8093 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
8094 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8095   echo $ac_n "(cached) $ac_c" 1>&6
8096 else
8097   ac_save_LIBS="$LIBS"
8098 LIBS="-lbe -lroot -lnet $LIBS"
8099 cat > conftest.$ac_ext <<EOF
8100 #line 8101 "configure"
8101 #include "confdefs.h"
8102 /* Override any gcc2 internal prototype to avoid an error.  */
8103 /* We use char because int might match the return type of a gcc2
8104     builtin and then its argument prototype would still apply.  */
8105 char be_app();
8106
8107 int main() {
8108 be_app()
8109 ; return 0; }
8110 EOF
8111 if { (eval echo configure:8112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8112   rm -rf conftest*
8113   eval "ac_cv_lib_$ac_lib_var=yes"
8114 else
8115   echo "configure: failed program was:" >&5
8116   cat conftest.$ac_ext >&5
8117   rm -rf conftest*
8118   eval "ac_cv_lib_$ac_lib_var=no"
8119 fi
8120 rm -f conftest*
8121 LIBS="$ac_save_LIBS"
8122
8123 fi
8124 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8125   echo "$ac_t""yes" 1>&6
8126   LIBS="$LIBS -lbe -lroot -lnet"
8127 else
8128   echo "$ac_t""no" 1>&6
8129 :
8130 fi
8131
8132
8133
8134
8135
8136 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
8137 echo "configure:8138: checking for ${CC-cc} option to accept ANSI C" >&5
8138 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
8139   echo $ac_n "(cached) $ac_c" 1>&6
8140 else
8141   am_cv_prog_cc_stdc=no
8142 ac_save_CC="$CC"
8143 # Don't try gcc -ansi; that turns off useful extensions and
8144 # breaks some systems' header files.
8145 # AIX                   -qlanglvl=ansi
8146 # Ultrix and OSF/1      -std1
8147 # HP-UX 10.20 and later -Ae
8148 # HP-UX older versions  -Aa -D_HPUX_SOURCE
8149 # SVR4                  -Xc -D__EXTENSIONS__
8150 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
8151 do
8152   CC="$ac_save_CC $ac_arg"
8153   cat > conftest.$ac_ext <<EOF
8154 #line 8155 "configure"
8155 #include "confdefs.h"
8156 #include <stdarg.h>
8157 #include <stdio.h>
8158 #include <sys/types.h>
8159 #include <sys/stat.h>
8160 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
8161 struct buf { int x; };
8162 FILE * (*rcsopen) (struct buf *, struct stat *, int);
8163 static char *e (p, i)
8164      char **p;
8165      int i;
8166 {
8167   return p[i];
8168 }
8169 static char *f (char * (*g) (char **, int), char **p, ...)
8170 {
8171   char *s;
8172   va_list v;
8173   va_start (v,p);
8174   s = g (p, va_arg (v,int));
8175   va_end (v);
8176   return s;
8177 }
8178 int test (int i, double x);
8179 struct s1 {int (*f) (int a);};
8180 struct s2 {int (*f) (double a);};
8181 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
8182 int argc;
8183 char **argv;
8184
8185 int main() {
8186
8187 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
8188
8189 ; return 0; }
8190 EOF
8191 if { (eval echo configure:8192: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8192   rm -rf conftest*
8193   am_cv_prog_cc_stdc="$ac_arg"; break
8194 else
8195   echo "configure: failed program was:" >&5
8196   cat conftest.$ac_ext >&5
8197 fi
8198 rm -f conftest*
8199 done
8200 CC="$ac_save_CC"
8201
8202 fi
8203
8204 if test -z "$am_cv_prog_cc_stdc"; then
8205   echo "$ac_t""none needed" 1>&6
8206 else
8207   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
8208 fi
8209 case "x$am_cv_prog_cc_stdc" in
8210   x|xno) ;;
8211   *) CC="$CC $am_cv_prog_cc_stdc" ;;
8212 esac
8213
8214 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
8215         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
8216 fi
8217
8218 # test for make depend flag
8219 OL_MKDEP=
8220 OL_MKDEP_FLAGS=
8221 if test -z "${MKDEP}"; then
8222         OL_MKDEP="${CC-cc}"
8223         if test -z "${MKDEP_FLAGS}"; then
8224                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
8225 echo "configure:8226: checking for ${OL_MKDEP} depend flag" >&5
8226 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
8227   echo $ac_n "(cached) $ac_c" 1>&6
8228 else
8229   
8230                         ol_cv_mkdep=no
8231                         for flag in "-M" "-xM"; do
8232                                 cat > conftest.c <<EOF
8233  noCode;
8234 EOF
8235                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:8236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
8236                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
8237                                 then
8238                                         if test ! -f conftest."${ac_object}" ; then
8239                                                 ol_cv_mkdep=$flag
8240                                                 OL_MKDEP_FLAGS="$flag"
8241                                                 break
8242                                         fi
8243                                 fi
8244                         done
8245                         rm -f conftest*
8246                 
8247 fi
8248
8249 echo "$ac_t""$ol_cv_mkdep" 1>&6
8250         else
8251                 cc_cv_mkdep=yes
8252                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
8253         fi
8254 else
8255         cc_cv_mkdep=yes
8256         OL_MKDEP="${MKDEP}"
8257         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
8258 fi
8259
8260
8261
8262 if test "${ol_cv_mkdep}" = no ; then
8263         # this will soon become an error
8264         echo "configure: warning: do not know how to generate dependencies" 1>&2
8265 fi
8266
8267 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
8268 echo "configure:8269: checking for afopen in -ls" >&5
8269 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
8270 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8271   echo $ac_n "(cached) $ac_c" 1>&6
8272 else
8273   ac_save_LIBS="$LIBS"
8274 LIBS="-ls  $LIBS"
8275 cat > conftest.$ac_ext <<EOF
8276 #line 8277 "configure"
8277 #include "confdefs.h"
8278 /* Override any gcc2 internal prototype to avoid an error.  */
8279 /* We use char because int might match the return type of a gcc2
8280     builtin and then its argument prototype would still apply.  */
8281 char afopen();
8282
8283 int main() {
8284 afopen()
8285 ; return 0; }
8286 EOF
8287 if { (eval echo configure:8288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8288   rm -rf conftest*
8289   eval "ac_cv_lib_$ac_lib_var=yes"
8290 else
8291   echo "configure: failed program was:" >&5
8292   cat conftest.$ac_ext >&5
8293   rm -rf conftest*
8294   eval "ac_cv_lib_$ac_lib_var=no"
8295 fi
8296 rm -f conftest*
8297 LIBS="$ac_save_LIBS"
8298
8299 fi
8300 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8301   echo "$ac_t""yes" 1>&6
8302   
8303         AUTH_LIBS=-ls
8304         cat >> confdefs.h <<\EOF
8305 #define HAVE_AIX_SECURITY 1
8306 EOF
8307
8308
8309 else
8310   echo "$ac_t""no" 1>&6
8311 fi
8312
8313
8314 case "$target" in
8315 *-ibm-openedition)
8316         ac_cv_func_getopt=no
8317         cat >> confdefs.h <<\EOF
8318 #define BOTH_STRINGS_H 1
8319 EOF
8320
8321         ;;
8322 esac
8323
8324 ol_link_modules=no
8325 if test $ol_enable_modules != no ; then
8326         for ac_hdr in ltdl.h
8327 do
8328 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8329 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8330 echo "configure:8331: checking for $ac_hdr" >&5
8331 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8332   echo $ac_n "(cached) $ac_c" 1>&6
8333 else
8334   cat > conftest.$ac_ext <<EOF
8335 #line 8336 "configure"
8336 #include "confdefs.h"
8337 #include <$ac_hdr>
8338 EOF
8339 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8340 { (eval echo configure:8341: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8341 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8342 if test -z "$ac_err"; then
8343   rm -rf conftest*
8344   eval "ac_cv_header_$ac_safe=yes"
8345 else
8346   echo "$ac_err" >&5
8347   echo "configure: failed program was:" >&5
8348   cat conftest.$ac_ext >&5
8349   rm -rf conftest*
8350   eval "ac_cv_header_$ac_safe=no"
8351 fi
8352 rm -f conftest*
8353 fi
8354 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8355   echo "$ac_t""yes" 1>&6
8356     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8357   cat >> confdefs.h <<EOF
8358 #define $ac_tr_hdr 1
8359 EOF
8360  
8361 else
8362   echo "$ac_t""no" 1>&6
8363 fi
8364 done
8365
8366
8367         if test $ac_cv_header_ltdl_h = no ; then
8368                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
8369         fi
8370
8371         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
8372 echo "configure:8373: checking for lt_dlinit in -lltdl" >&5
8373 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
8374 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8375   echo $ac_n "(cached) $ac_c" 1>&6
8376 else
8377   ac_save_LIBS="$LIBS"
8378 LIBS="-lltdl  $LIBS"
8379 cat > conftest.$ac_ext <<EOF
8380 #line 8381 "configure"
8381 #include "confdefs.h"
8382 /* Override any gcc2 internal prototype to avoid an error.  */
8383 /* We use char because int might match the return type of a gcc2
8384     builtin and then its argument prototype would still apply.  */
8385 char lt_dlinit();
8386
8387 int main() {
8388 lt_dlinit()
8389 ; return 0; }
8390 EOF
8391 if { (eval echo configure:8392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8392   rm -rf conftest*
8393   eval "ac_cv_lib_$ac_lib_var=yes"
8394 else
8395   echo "configure: failed program was:" >&5
8396   cat conftest.$ac_ext >&5
8397   rm -rf conftest*
8398   eval "ac_cv_lib_$ac_lib_var=no"
8399 fi
8400 rm -f conftest*
8401 LIBS="$ac_save_LIBS"
8402
8403 fi
8404 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8405   echo "$ac_t""yes" 1>&6
8406   
8407                 MODULES_LIBS=-lltdl
8408                 cat >> confdefs.h <<\EOF
8409 #define HAVE_LIBLTDL 1
8410 EOF
8411
8412         
8413 else
8414   echo "$ac_t""no" 1>&6
8415 fi
8416
8417
8418         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
8419                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
8420         fi
8421         ol_link_modules=yes
8422 else
8423         ol_with_bdb_module=static
8424         ol_with_dnssrv_module=static
8425         ol_with_hdb_module=static
8426         ol_with_ldap_module=static
8427         ol_with_ldbm_module=static
8428         ol_with_meta_module=static
8429         ol_with_monitor_module=static
8430         ol_with_null_module=static
8431         ol_with_passwd_module=static
8432         ol_with_perl_module=static
8433         ol_with_shell_module=static
8434         ol_with_sql_module=static
8435         if test $ol_with_dyngroup = mod ; then
8436                 echo "configure: warning: building static dyngroup overlay" 1>&2
8437                 ol_with_dyngroup = yes
8438         fi
8439         if test $ol_with_proxycache = mod ; then
8440                 echo "configure: warning: building static proxycache overlay" 1>&2
8441                 ol_with_proxycache = yes
8442         fi
8443 fi
8444
8445 # test for EBCDIC
8446 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
8447 echo "configure:8448: checking for EBCDIC" >&5
8448 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
8449   echo $ac_n "(cached) $ac_c" 1>&6
8450 else
8451   
8452         cat > conftest.$ac_ext <<EOF
8453 #line 8454 "configure"
8454 #include "confdefs.h"
8455
8456 #if !('M' == 0xd4)
8457 #include <__ASCII__/generate_error.h>
8458 #endif
8459
8460 EOF
8461 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8462 { (eval echo configure:8463: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8463 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8464 if test -z "$ac_err"; then
8465   rm -rf conftest*
8466   ol_cv_cpp_ebcdic=yes
8467 else
8468   echo "$ac_err" >&5
8469   echo "configure: failed program was:" >&5
8470   cat conftest.$ac_ext >&5
8471   rm -rf conftest*
8472   ol_cv_cpp_ebcdic=no
8473 fi
8474 rm -f conftest*
8475 fi
8476
8477 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
8478 if test $ol_cv_cpp_ebcdic = yes ; then
8479         cat >> confdefs.h <<\EOF
8480 #define HAVE_EBCDIC 1
8481 EOF
8482
8483 fi
8484
8485 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
8486 echo "configure:8487: checking for ANSI C header files" >&5
8487 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
8488   echo $ac_n "(cached) $ac_c" 1>&6
8489 else
8490   cat > conftest.$ac_ext <<EOF
8491 #line 8492 "configure"
8492 #include "confdefs.h"
8493 #include <stdlib.h>
8494 #include <stdarg.h>
8495 #include <string.h>
8496 #include <float.h>
8497 EOF
8498 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8499 { (eval echo configure:8500: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8500 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8501 if test -z "$ac_err"; then
8502   rm -rf conftest*
8503   ol_cv_header_stdc=yes
8504 else
8505   echo "$ac_err" >&5
8506   echo "configure: failed program was:" >&5
8507   cat conftest.$ac_ext >&5
8508   rm -rf conftest*
8509   ol_cv_header_stdc=no
8510 fi
8511 rm -f conftest*
8512
8513 if test $ol_cv_header_stdc = yes; then
8514   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
8515 cat > conftest.$ac_ext <<EOF
8516 #line 8517 "configure"
8517 #include "confdefs.h"
8518 #include <string.h>
8519 EOF
8520 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8521   egrep "memchr" >/dev/null 2>&1; then
8522   :
8523 else
8524   rm -rf conftest*
8525   ol_cv_header_stdc=no
8526 fi
8527 rm -f conftest*
8528
8529 fi
8530
8531 if test $ol_cv_header_stdc = yes; then
8532   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
8533 cat > conftest.$ac_ext <<EOF
8534 #line 8535 "configure"
8535 #include "confdefs.h"
8536 #include <stdlib.h>
8537 EOF
8538 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8539   egrep "free" >/dev/null 2>&1; then
8540   :
8541 else
8542   rm -rf conftest*
8543   ol_cv_header_stdc=no
8544 fi
8545 rm -f conftest*
8546
8547 fi
8548
8549 if test $ol_cv_header_stdc = yes; then
8550   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
8551 if test "$cross_compiling" = yes; then
8552   :
8553 else
8554   cat > conftest.$ac_ext <<EOF
8555 #line 8556 "configure"
8556 #include "confdefs.h"
8557 #include <ctype.h>
8558 #ifndef HAVE_EBCDIC
8559 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
8560 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
8561 #else
8562 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
8563                 || ('j' <= (c) && (c) <= 'r') \
8564                 || ('s' <= (c) && (c) <= 'z'))
8565 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
8566 #endif
8567 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
8568 int main () { int i; for (i = 0; i < 256; i++)
8569 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
8570 exit (0); }
8571
8572 EOF
8573 if { (eval echo configure:8574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8574 then
8575   :
8576 else
8577   echo "configure: failed program was:" >&5
8578   cat conftest.$ac_ext >&5
8579   rm -fr conftest*
8580   ol_cv_header_stdc=no
8581 fi
8582 rm -fr conftest*
8583 fi
8584
8585 fi
8586 fi
8587
8588 echo "$ac_t""$ol_cv_header_stdc" 1>&6
8589 if test $ol_cv_header_stdc = yes; then
8590   cat >> confdefs.h <<\EOF
8591 #define STDC_HEADERS 1
8592 EOF
8593
8594 fi
8595 ac_cv_header_stdc=disable
8596
8597
8598 if test $ol_cv_header_stdc != yes; then
8599         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
8600 fi
8601
8602 ac_header_dirent=no
8603 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
8604 do
8605 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8606 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
8607 echo "configure:8608: checking for $ac_hdr that defines DIR" >&5
8608 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
8609   echo $ac_n "(cached) $ac_c" 1>&6
8610 else
8611   cat > conftest.$ac_ext <<EOF
8612 #line 8613 "configure"
8613 #include "confdefs.h"
8614 #include <sys/types.h>
8615 #include <$ac_hdr>
8616 int main() {
8617 DIR *dirp = 0;
8618 ; return 0; }
8619 EOF
8620 if { (eval echo configure:8621: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8621   rm -rf conftest*
8622   eval "ac_cv_header_dirent_$ac_safe=yes"
8623 else
8624   echo "configure: failed program was:" >&5
8625   cat conftest.$ac_ext >&5
8626   rm -rf conftest*
8627   eval "ac_cv_header_dirent_$ac_safe=no"
8628 fi
8629 rm -f conftest*
8630 fi
8631 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
8632   echo "$ac_t""yes" 1>&6
8633     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8634   cat >> confdefs.h <<EOF
8635 #define $ac_tr_hdr 1
8636 EOF
8637  ac_header_dirent=$ac_hdr; break
8638 else
8639   echo "$ac_t""no" 1>&6
8640 fi
8641 done
8642 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
8643 if test $ac_header_dirent = dirent.h; then
8644 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
8645 echo "configure:8646: checking for opendir in -ldir" >&5
8646 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
8647 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8648   echo $ac_n "(cached) $ac_c" 1>&6
8649 else
8650   ac_save_LIBS="$LIBS"
8651 LIBS="-ldir  $LIBS"
8652 cat > conftest.$ac_ext <<EOF
8653 #line 8654 "configure"
8654 #include "confdefs.h"
8655 /* Override any gcc2 internal prototype to avoid an error.  */
8656 /* We use char because int might match the return type of a gcc2
8657     builtin and then its argument prototype would still apply.  */
8658 char opendir();
8659
8660 int main() {
8661 opendir()
8662 ; return 0; }
8663 EOF
8664 if { (eval echo configure:8665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8665   rm -rf conftest*
8666   eval "ac_cv_lib_$ac_lib_var=yes"
8667 else
8668   echo "configure: failed program was:" >&5
8669   cat conftest.$ac_ext >&5
8670   rm -rf conftest*
8671   eval "ac_cv_lib_$ac_lib_var=no"
8672 fi
8673 rm -f conftest*
8674 LIBS="$ac_save_LIBS"
8675
8676 fi
8677 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8678   echo "$ac_t""yes" 1>&6
8679   LIBS="$LIBS -ldir"
8680 else
8681   echo "$ac_t""no" 1>&6
8682 fi
8683
8684 else
8685 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
8686 echo "configure:8687: checking for opendir in -lx" >&5
8687 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
8688 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8689   echo $ac_n "(cached) $ac_c" 1>&6
8690 else
8691   ac_save_LIBS="$LIBS"
8692 LIBS="-lx  $LIBS"
8693 cat > conftest.$ac_ext <<EOF
8694 #line 8695 "configure"
8695 #include "confdefs.h"
8696 /* Override any gcc2 internal prototype to avoid an error.  */
8697 /* We use char because int might match the return type of a gcc2
8698     builtin and then its argument prototype would still apply.  */
8699 char opendir();
8700
8701 int main() {
8702 opendir()
8703 ; return 0; }
8704 EOF
8705 if { (eval echo configure:8706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8706   rm -rf conftest*
8707   eval "ac_cv_lib_$ac_lib_var=yes"
8708 else
8709   echo "configure: failed program was:" >&5
8710   cat conftest.$ac_ext >&5
8711   rm -rf conftest*
8712   eval "ac_cv_lib_$ac_lib_var=no"
8713 fi
8714 rm -f conftest*
8715 LIBS="$ac_save_LIBS"
8716
8717 fi
8718 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8719   echo "$ac_t""yes" 1>&6
8720   LIBS="$LIBS -lx"
8721 else
8722   echo "$ac_t""no" 1>&6
8723 fi
8724
8725 fi
8726
8727 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
8728 echo "configure:8729: checking for sys/wait.h that is POSIX.1 compatible" >&5
8729 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
8730   echo $ac_n "(cached) $ac_c" 1>&6
8731 else
8732   cat > conftest.$ac_ext <<EOF
8733 #line 8734 "configure"
8734 #include "confdefs.h"
8735 #include <sys/types.h>
8736 #include <sys/wait.h>
8737 #ifndef WEXITSTATUS
8738 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
8739 #endif
8740 #ifndef WIFEXITED
8741 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
8742 #endif
8743 int main() {
8744 int s;
8745 wait (&s);
8746 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
8747 ; return 0; }
8748 EOF
8749 if { (eval echo configure:8750: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8750   rm -rf conftest*
8751   ac_cv_header_sys_wait_h=yes
8752 else
8753   echo "configure: failed program was:" >&5
8754   cat conftest.$ac_ext >&5
8755   rm -rf conftest*
8756   ac_cv_header_sys_wait_h=no
8757 fi
8758 rm -f conftest*
8759 fi
8760
8761 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
8762 if test $ac_cv_header_sys_wait_h = yes; then
8763   cat >> confdefs.h <<\EOF
8764 #define HAVE_SYS_WAIT_H 1
8765 EOF
8766
8767 fi
8768
8769 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
8770 echo "configure:8771: checking POSIX termios" >&5
8771 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
8772   echo $ac_n "(cached) $ac_c" 1>&6
8773 else
8774   cat > conftest.$ac_ext <<EOF
8775 #line 8776 "configure"
8776 #include "confdefs.h"
8777 #include <sys/types.h>
8778 #include <unistd.h>
8779 #include <termios.h>
8780 int main() {
8781 /* SunOS 4.0.3 has termios.h but not the library calls.  */
8782    tcgetattr(0, 0);
8783 ; return 0; }
8784 EOF
8785 if { (eval echo configure:8786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8786   rm -rf conftest*
8787   am_cv_sys_posix_termios=yes
8788 else
8789   echo "configure: failed program was:" >&5
8790   cat conftest.$ac_ext >&5
8791   rm -rf conftest*
8792   am_cv_sys_posix_termios=no
8793 fi
8794 rm -f conftest*
8795 fi
8796
8797 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
8798
8799
8800  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
8801 echo "configure:8802: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
8802 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
8803   echo $ac_n "(cached) $ac_c" 1>&6
8804 else
8805   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
8806
8807   gwinsz_in_termios_h=no
8808   if test $am_cv_sys_posix_termios = yes; then
8809     cat > conftest.$ac_ext <<EOF
8810 #line 8811 "configure"
8811 #include "confdefs.h"
8812 #include <sys/types.h>
8813 #     include <termios.h>
8814 #     ifdef TIOCGWINSZ
8815         yes
8816 #     endif
8817     
8818 EOF
8819 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8820   egrep "yes" >/dev/null 2>&1; then
8821   rm -rf conftest*
8822   gwinsz_in_termios_h=yes
8823 fi
8824 rm -f conftest*
8825
8826   fi
8827
8828   if test $gwinsz_in_termios_h = no; then
8829     cat > conftest.$ac_ext <<EOF
8830 #line 8831 "configure"
8831 #include "confdefs.h"
8832 #include <sys/types.h>
8833 #     include <sys/ioctl.h>
8834 #     ifdef TIOCGWINSZ
8835         yes
8836 #     endif
8837     
8838 EOF
8839 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8840   egrep "yes" >/dev/null 2>&1; then
8841   rm -rf conftest*
8842   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
8843 fi
8844 rm -f conftest*
8845
8846   fi
8847   
8848 fi
8849
8850 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
8851   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
8852     cat >> confdefs.h <<\EOF
8853 #define GWINSZ_IN_SYS_IOCTL 1
8854 EOF
8855
8856   fi
8857
8858 if test $am_cv_sys_posix_termios = yes ; then
8859         cat >> confdefs.h <<\EOF
8860 #define HAVE_POSIX_TERMIOS 1
8861 EOF
8862
8863 fi
8864
8865 for ac_hdr in \
8866         arpa/inet.h             \
8867         arpa/nameser.h  \
8868         assert.h                \
8869         bits/types.h    \
8870         conio.h                 \
8871         crypt.h                 \
8872         direct.h                \
8873         errno.h                 \
8874         fcntl.h                 \
8875         filio.h                 \
8876         getopt.h                \
8877         grp.h                   \
8878         io.h                    \
8879         libutil.h               \
8880         limits.h                \
8881         locale.h                \
8882         netinet/tcp.h   \
8883         malloc.h                \
8884         memory.h                \
8885         psap.h                  \
8886         pwd.h                   \
8887         process.h               \
8888         resolv.h                \
8889         sgtty.h                 \
8890         shadow.h                \
8891         stddef.h                \
8892         string.h                \
8893         strings.h               \
8894         sysexits.h              \
8895         sys/file.h              \
8896         sys/filio.h             \
8897         sys/errno.h             \
8898         sys/ioctl.h             \
8899         sys/param.h             \
8900         sys/resource.h  \
8901         sys/select.h    \
8902         sys/socket.h    \
8903         sys/stat.h              \
8904         sys/syslog.h    \
8905         sys/time.h              \
8906         sys/types.h             \
8907         sys/ucred.h             \
8908         sys/uio.h               \
8909         syslog.h                \
8910         termios.h               \
8911         unistd.h                \
8912         winsock.h               \
8913         winsock2.h              \
8914
8915 do
8916 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8917 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8918 echo "configure:8919: checking for $ac_hdr" >&5
8919 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8920   echo $ac_n "(cached) $ac_c" 1>&6
8921 else
8922   cat > conftest.$ac_ext <<EOF
8923 #line 8924 "configure"
8924 #include "confdefs.h"
8925 #include <$ac_hdr>
8926 EOF
8927 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8928 { (eval echo configure:8929: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8929 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8930 if test -z "$ac_err"; then
8931   rm -rf conftest*
8932   eval "ac_cv_header_$ac_safe=yes"
8933 else
8934   echo "$ac_err" >&5
8935   echo "configure: failed program was:" >&5
8936   cat conftest.$ac_ext >&5
8937   rm -rf conftest*
8938   eval "ac_cv_header_$ac_safe=no"
8939 fi
8940 rm -f conftest*
8941 fi
8942 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8943   echo "$ac_t""yes" 1>&6
8944     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8945   cat >> confdefs.h <<EOF
8946 #define $ac_tr_hdr 1
8947 EOF
8948  
8949 else
8950   echo "$ac_t""no" 1>&6
8951 fi
8952 done
8953
8954
8955
8956
8957 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
8958 echo "configure:8959: checking for dlopen" >&5
8959 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
8960   echo $ac_n "(cached) $ac_c" 1>&6
8961 else
8962   cat > conftest.$ac_ext <<EOF
8963 #line 8964 "configure"
8964 #include "confdefs.h"
8965 /* System header to define __stub macros and hopefully few prototypes,
8966     which can conflict with char dlopen(); below.  */
8967 #include <assert.h>
8968 /* Override any gcc2 internal prototype to avoid an error.  */
8969 /* We use char because int might match the return type of a gcc2
8970     builtin and then its argument prototype would still apply.  */
8971 char dlopen();
8972 char (*f)();
8973
8974 int main() {
8975
8976 /* The GNU C library defines this for functions which it implements
8977     to always fail with ENOSYS.  Some functions are actually named
8978     something starting with __ and the normal name is an alias.  */
8979 #if defined (__stub_dlopen) || defined (__stub___dlopen)
8980 choke me
8981 #else
8982 f = dlopen;
8983 #endif
8984
8985 ; return 0; }
8986 EOF
8987 if { (eval echo configure:8988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8988   rm -rf conftest*
8989   eval "ac_cv_func_dlopen=yes"
8990 else
8991   echo "configure: failed program was:" >&5
8992   cat conftest.$ac_ext >&5
8993   rm -rf conftest*
8994   eval "ac_cv_func_dlopen=no"
8995 fi
8996 rm -f conftest*
8997 fi
8998
8999 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
9000   echo "$ac_t""yes" 1>&6
9001   :
9002 else
9003   echo "$ac_t""no" 1>&6
9004 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
9005 echo "configure:9006: checking for dlopen in -ldl" >&5
9006 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
9007 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9008   echo $ac_n "(cached) $ac_c" 1>&6
9009 else
9010   ac_save_LIBS="$LIBS"
9011 LIBS="-ldl  $LIBS"
9012 cat > conftest.$ac_ext <<EOF
9013 #line 9014 "configure"
9014 #include "confdefs.h"
9015 /* Override any gcc2 internal prototype to avoid an error.  */
9016 /* We use char because int might match the return type of a gcc2
9017     builtin and then its argument prototype would still apply.  */
9018 char dlopen();
9019
9020 int main() {
9021 dlopen()
9022 ; return 0; }
9023 EOF
9024 if { (eval echo configure:9025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9025   rm -rf conftest*
9026   eval "ac_cv_lib_$ac_lib_var=yes"
9027 else
9028   echo "configure: failed program was:" >&5
9029   cat conftest.$ac_ext >&5
9030   rm -rf conftest*
9031   eval "ac_cv_lib_$ac_lib_var=no"
9032 fi
9033 rm -f conftest*
9034 LIBS="$ac_save_LIBS"
9035
9036 fi
9037 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9038   echo "$ac_t""yes" 1>&6
9039     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9040     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9041   cat >> confdefs.h <<EOF
9042 #define $ac_tr_lib 1
9043 EOF
9044
9045   LIBS="-ldl $LIBS"
9046
9047 else
9048   echo "$ac_t""no" 1>&6
9049 fi
9050
9051 fi
9052
9053
9054 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
9055 echo "configure:9056: checking for sigset in -lV3" >&5
9056 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
9057 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9058   echo $ac_n "(cached) $ac_c" 1>&6
9059 else
9060   ac_save_LIBS="$LIBS"
9061 LIBS="-lV3  $LIBS"
9062 cat > conftest.$ac_ext <<EOF
9063 #line 9064 "configure"
9064 #include "confdefs.h"
9065 /* Override any gcc2 internal prototype to avoid an error.  */
9066 /* We use char because int might match the return type of a gcc2
9067     builtin and then its argument prototype would still apply.  */
9068 char sigset();
9069
9070 int main() {
9071 sigset()
9072 ; return 0; }
9073 EOF
9074 if { (eval echo configure:9075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9075   rm -rf conftest*
9076   eval "ac_cv_lib_$ac_lib_var=yes"
9077 else
9078   echo "configure: failed program was:" >&5
9079   cat conftest.$ac_ext >&5
9080   rm -rf conftest*
9081   eval "ac_cv_lib_$ac_lib_var=no"
9082 fi
9083 rm -f conftest*
9084 LIBS="$ac_save_LIBS"
9085
9086 fi
9087 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9088   echo "$ac_t""yes" 1>&6
9089     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9090     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9091   cat >> confdefs.h <<EOF
9092 #define $ac_tr_lib 1
9093 EOF
9094
9095   LIBS="-lV3 $LIBS"
9096
9097 else
9098   echo "$ac_t""no" 1>&6
9099 fi
9100
9101
9102 echo $ac_n "checking for winsock""... $ac_c" 1>&6
9103 echo "configure:9104: checking for winsock" >&5
9104 save_LIBS="$LIBS"
9105 for curlib in ws2_32 wsock32; do
9106         LIBS="$LIBS -l$curlib"
9107         cat > conftest.$ac_ext <<EOF
9108 #line 9109 "configure"
9109 #include "confdefs.h"
9110
9111                         char socket@12();
9112                         char select@20();
9113                         char closesocket@4();
9114                         char gethostname@8();
9115                         
9116 int main() {
9117
9118                         socket@12();
9119                         select@20();
9120                         closesocket@4();
9121                         gethostname@8();
9122                         
9123 ; return 0; }
9124 EOF
9125 if { (eval echo configure:9126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9126   rm -rf conftest*
9127   have_winsock=yes
9128 else
9129   echo "configure: failed program was:" >&5
9130   cat conftest.$ac_ext >&5
9131   rm -rf conftest*
9132   have_winsock=no
9133 fi
9134 rm -f conftest*
9135
9136         if test $have_winsock = yes; then
9137                 cat >> confdefs.h <<\EOF
9138 #define HAVE_WINSOCK 1
9139 EOF
9140
9141                 ac_cv_func_socket=yes
9142                 ac_cv_func_select=yes
9143                 ac_cv_func_closesocket=yes
9144                 ac_cv_func_gethostname=yes
9145                 if test $curlib = ws2_32; then
9146                         have_winsock=winsock2
9147                         cat >> confdefs.h <<\EOF
9148 #define HAVE_WINSOCK2 1
9149 EOF
9150
9151                 fi
9152                 break
9153         fi
9154         LIBS="$save_LIBS"
9155 done
9156 echo "$ac_t""$have_winsock" 1>&6
9157
9158
9159 echo $ac_n "checking for socket""... $ac_c" 1>&6
9160 echo "configure:9161: checking for socket" >&5
9161 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
9162   echo $ac_n "(cached) $ac_c" 1>&6
9163 else
9164   cat > conftest.$ac_ext <<EOF
9165 #line 9166 "configure"
9166 #include "confdefs.h"
9167 /* System header to define __stub macros and hopefully few prototypes,
9168     which can conflict with char socket(); below.  */
9169 #include <assert.h>
9170 /* Override any gcc2 internal prototype to avoid an error.  */
9171 /* We use char because int might match the return type of a gcc2
9172     builtin and then its argument prototype would still apply.  */
9173 char socket();
9174 char (*f)();
9175
9176 int main() {
9177
9178 /* The GNU C library defines this for functions which it implements
9179     to always fail with ENOSYS.  Some functions are actually named
9180     something starting with __ and the normal name is an alias.  */
9181 #if defined (__stub_socket) || defined (__stub___socket)
9182 choke me
9183 #else
9184 f = socket;
9185 #endif
9186
9187 ; return 0; }
9188 EOF
9189 if { (eval echo configure:9190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9190   rm -rf conftest*
9191   eval "ac_cv_func_socket=yes"
9192 else
9193   echo "configure: failed program was:" >&5
9194   cat conftest.$ac_ext >&5
9195   rm -rf conftest*
9196   eval "ac_cv_func_socket=no"
9197 fi
9198 rm -f conftest*
9199 fi
9200
9201 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
9202   echo "$ac_t""yes" 1>&6
9203   :
9204 else
9205   echo "$ac_t""no" 1>&6
9206         
9207         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
9208 echo "configure:9209: checking for main in -lsocket" >&5
9209 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
9210 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9211   echo $ac_n "(cached) $ac_c" 1>&6
9212 else
9213   ac_save_LIBS="$LIBS"
9214 LIBS="-lsocket  $LIBS"
9215 cat > conftest.$ac_ext <<EOF
9216 #line 9217 "configure"
9217 #include "confdefs.h"
9218
9219 int main() {
9220 main()
9221 ; return 0; }
9222 EOF
9223 if { (eval echo configure:9224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9224   rm -rf conftest*
9225   eval "ac_cv_lib_$ac_lib_var=yes"
9226 else
9227   echo "configure: failed program was:" >&5
9228   cat conftest.$ac_ext >&5
9229   rm -rf conftest*
9230   eval "ac_cv_lib_$ac_lib_var=no"
9231 fi
9232 rm -f conftest*
9233 LIBS="$ac_save_LIBS"
9234
9235 fi
9236 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9237   echo "$ac_t""yes" 1>&6
9238     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9239     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9240   cat >> confdefs.h <<EOF
9241 #define $ac_tr_lib 1
9242 EOF
9243
9244   LIBS="-lsocket $LIBS"
9245
9246 else
9247   echo "$ac_t""no" 1>&6
9248 fi
9249
9250         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
9251 echo "configure:9252: checking for main in -lnet" >&5
9252 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
9253 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9254   echo $ac_n "(cached) $ac_c" 1>&6
9255 else
9256   ac_save_LIBS="$LIBS"
9257 LIBS="-lnet  $LIBS"
9258 cat > conftest.$ac_ext <<EOF
9259 #line 9260 "configure"
9260 #include "confdefs.h"
9261
9262 int main() {
9263 main()
9264 ; return 0; }
9265 EOF
9266 if { (eval echo configure:9267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9267   rm -rf conftest*
9268   eval "ac_cv_lib_$ac_lib_var=yes"
9269 else
9270   echo "configure: failed program was:" >&5
9271   cat conftest.$ac_ext >&5
9272   rm -rf conftest*
9273   eval "ac_cv_lib_$ac_lib_var=no"
9274 fi
9275 rm -f conftest*
9276 LIBS="$ac_save_LIBS"
9277
9278 fi
9279 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9280   echo "$ac_t""yes" 1>&6
9281     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9282     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9283   cat >> confdefs.h <<EOF
9284 #define $ac_tr_lib 1
9285 EOF
9286
9287   LIBS="-lnet $LIBS"
9288
9289 else
9290   echo "$ac_t""no" 1>&6
9291 fi
9292
9293         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
9294 echo "configure:9295: checking for main in -lnsl_s" >&5
9295 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
9296 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9297   echo $ac_n "(cached) $ac_c" 1>&6
9298 else
9299   ac_save_LIBS="$LIBS"
9300 LIBS="-lnsl_s  $LIBS"
9301 cat > conftest.$ac_ext <<EOF
9302 #line 9303 "configure"
9303 #include "confdefs.h"
9304
9305 int main() {
9306 main()
9307 ; return 0; }
9308 EOF
9309 if { (eval echo configure:9310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9310   rm -rf conftest*
9311   eval "ac_cv_lib_$ac_lib_var=yes"
9312 else
9313   echo "configure: failed program was:" >&5
9314   cat conftest.$ac_ext >&5
9315   rm -rf conftest*
9316   eval "ac_cv_lib_$ac_lib_var=no"
9317 fi
9318 rm -f conftest*
9319 LIBS="$ac_save_LIBS"
9320
9321 fi
9322 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9323   echo "$ac_t""yes" 1>&6
9324     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9325     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9326   cat >> confdefs.h <<EOF
9327 #define $ac_tr_lib 1
9328 EOF
9329
9330   LIBS="-lnsl_s $LIBS"
9331
9332 else
9333   echo "$ac_t""no" 1>&6
9334 fi
9335
9336         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
9337 echo "configure:9338: checking for main in -lnsl" >&5
9338 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
9339 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9340   echo $ac_n "(cached) $ac_c" 1>&6
9341 else
9342   ac_save_LIBS="$LIBS"
9343 LIBS="-lnsl  $LIBS"
9344 cat > conftest.$ac_ext <<EOF
9345 #line 9346 "configure"
9346 #include "confdefs.h"
9347
9348 int main() {
9349 main()
9350 ; return 0; }
9351 EOF
9352 if { (eval echo configure:9353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9353   rm -rf conftest*
9354   eval "ac_cv_lib_$ac_lib_var=yes"
9355 else
9356   echo "configure: failed program was:" >&5
9357   cat conftest.$ac_ext >&5
9358   rm -rf conftest*
9359   eval "ac_cv_lib_$ac_lib_var=no"
9360 fi
9361 rm -f conftest*
9362 LIBS="$ac_save_LIBS"
9363
9364 fi
9365 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9366   echo "$ac_t""yes" 1>&6
9367     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9368     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9369   cat >> confdefs.h <<EOF
9370 #define $ac_tr_lib 1
9371 EOF
9372
9373   LIBS="-lnsl $LIBS"
9374
9375 else
9376   echo "$ac_t""no" 1>&6
9377 fi
9378
9379         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
9380 echo "configure:9381: checking for socket in -linet" >&5
9381 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
9382 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9383   echo $ac_n "(cached) $ac_c" 1>&6
9384 else
9385   ac_save_LIBS="$LIBS"
9386 LIBS="-linet  $LIBS"
9387 cat > conftest.$ac_ext <<EOF
9388 #line 9389 "configure"
9389 #include "confdefs.h"
9390 /* Override any gcc2 internal prototype to avoid an error.  */
9391 /* We use char because int might match the return type of a gcc2
9392     builtin and then its argument prototype would still apply.  */
9393 char socket();
9394
9395 int main() {
9396 socket()
9397 ; return 0; }
9398 EOF
9399 if { (eval echo configure:9400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9400   rm -rf conftest*
9401   eval "ac_cv_lib_$ac_lib_var=yes"
9402 else
9403   echo "configure: failed program was:" >&5
9404   cat conftest.$ac_ext >&5
9405   rm -rf conftest*
9406   eval "ac_cv_lib_$ac_lib_var=no"
9407 fi
9408 rm -f conftest*
9409 LIBS="$ac_save_LIBS"
9410
9411 fi
9412 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9413   echo "$ac_t""yes" 1>&6
9414     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9415     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9416   cat >> confdefs.h <<EOF
9417 #define $ac_tr_lib 1
9418 EOF
9419
9420   LIBS="-linet $LIBS"
9421
9422 else
9423   echo "$ac_t""no" 1>&6
9424 fi
9425
9426         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
9427 echo "configure:9428: checking for main in -lgen" >&5
9428 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
9429 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9430   echo $ac_n "(cached) $ac_c" 1>&6
9431 else
9432   ac_save_LIBS="$LIBS"
9433 LIBS="-lgen  $LIBS"
9434 cat > conftest.$ac_ext <<EOF
9435 #line 9436 "configure"
9436 #include "confdefs.h"
9437
9438 int main() {
9439 main()
9440 ; return 0; }
9441 EOF
9442 if { (eval echo configure:9443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9443   rm -rf conftest*
9444   eval "ac_cv_lib_$ac_lib_var=yes"
9445 else
9446   echo "configure: failed program was:" >&5
9447   cat conftest.$ac_ext >&5
9448   rm -rf conftest*
9449   eval "ac_cv_lib_$ac_lib_var=no"
9450 fi
9451 rm -f conftest*
9452 LIBS="$ac_save_LIBS"
9453
9454 fi
9455 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9456   echo "$ac_t""yes" 1>&6
9457     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9458     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9459   cat >> confdefs.h <<EOF
9460 #define $ac_tr_lib 1
9461 EOF
9462
9463   LIBS="-lgen $LIBS"
9464
9465 else
9466   echo "$ac_t""no" 1>&6
9467 fi
9468
9469
9470 fi
9471
9472
9473 echo $ac_n "checking for select""... $ac_c" 1>&6
9474 echo "configure:9475: checking for select" >&5
9475 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
9476   echo $ac_n "(cached) $ac_c" 1>&6
9477 else
9478   cat > conftest.$ac_ext <<EOF
9479 #line 9480 "configure"
9480 #include "confdefs.h"
9481 /* System header to define __stub macros and hopefully few prototypes,
9482     which can conflict with char select(); below.  */
9483 #include <assert.h>
9484 /* Override any gcc2 internal prototype to avoid an error.  */
9485 /* We use char because int might match the return type of a gcc2
9486     builtin and then its argument prototype would still apply.  */
9487 char select();
9488 char (*f)();
9489
9490 int main() {
9491
9492 /* The GNU C library defines this for functions which it implements
9493     to always fail with ENOSYS.  Some functions are actually named
9494     something starting with __ and the normal name is an alias.  */
9495 #if defined (__stub_select) || defined (__stub___select)
9496 choke me
9497 #else
9498 f = select;
9499 #endif
9500
9501 ; return 0; }
9502 EOF
9503 if { (eval echo configure:9504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9504   rm -rf conftest*
9505   eval "ac_cv_func_select=yes"
9506 else
9507   echo "configure: failed program was:" >&5
9508   cat conftest.$ac_ext >&5
9509   rm -rf conftest*
9510   eval "ac_cv_func_select=no"
9511 fi
9512 rm -f conftest*
9513 fi
9514
9515 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
9516   echo "$ac_t""yes" 1>&6
9517   :
9518 else
9519   echo "$ac_t""no" 1>&6
9520 { echo "configure: error: select() required." 1>&2; exit 1; }
9521 fi
9522
9523
9524 if test "${ac_cv_header_winsock_h}" != yes; then
9525                                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
9526 echo "configure:9527: checking types of arguments for select()" >&5
9527  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
9528   echo $ac_n "(cached) $ac_c" 1>&6
9529 else
9530    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
9531   echo $ac_n "(cached) $ac_c" 1>&6
9532 else
9533     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
9534   echo $ac_n "(cached) $ac_c" 1>&6
9535 else
9536      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
9537      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
9538       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
9539        cat > conftest.$ac_ext <<EOF
9540 #line 9541 "configure"
9541 #include "confdefs.h"
9542 #ifdef HAVE_SYS_TYPES_H
9543 #include <sys/types.h>
9544 #endif
9545 #ifdef HAVE_SYS_TIME_H
9546 #include <sys/time.h>
9547 #endif
9548 #ifdef HAVE_SYS_SELECT_H
9549 #include <sys/select.h>
9550 #endif
9551 #ifdef HAVE_SYS_SOCKET_H
9552 #include <sys/socket.h>
9553 #endif
9554 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);
9555 int main() {
9556
9557 ; return 0; }
9558 EOF
9559 if { (eval echo configure:9560: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9560   rm -rf conftest*
9561           ac_not_found=no ; break 3
9562 else
9563   echo "configure: failed program was:" >&5
9564   cat conftest.$ac_ext >&5
9565   rm -rf conftest*
9566   ac_not_found=yes
9567 fi
9568 rm -f conftest*
9569       done
9570      done
9571     done
9572    
9573 fi
9574   
9575 fi
9576  
9577 fi
9578  if test "$ac_not_found" = yes; then
9579   ac_cv_func_select_arg1=int 
9580   ac_cv_func_select_arg234='int *' 
9581   ac_cv_func_select_arg5='struct timeval *'
9582  fi
9583  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
9584  cat >> confdefs.h <<EOF
9585 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
9586 EOF
9587
9588  cat >> confdefs.h <<EOF
9589 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
9590 EOF
9591
9592  cat >> confdefs.h <<EOF
9593 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
9594 EOF
9595
9596
9597 fi
9598
9599
9600 for ac_hdr in regex.h 
9601 do
9602 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9603 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9604 echo "configure:9605: checking for $ac_hdr" >&5
9605 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9606   echo $ac_n "(cached) $ac_c" 1>&6
9607 else
9608   cat > conftest.$ac_ext <<EOF
9609 #line 9610 "configure"
9610 #include "confdefs.h"
9611 #include <$ac_hdr>
9612 EOF
9613 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9614 { (eval echo configure:9615: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9615 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9616 if test -z "$ac_err"; then
9617   rm -rf conftest*
9618   eval "ac_cv_header_$ac_safe=yes"
9619 else
9620   echo "$ac_err" >&5
9621   echo "configure: failed program was:" >&5
9622   cat conftest.$ac_ext >&5
9623   rm -rf conftest*
9624   eval "ac_cv_header_$ac_safe=no"
9625 fi
9626 rm -f conftest*
9627 fi
9628 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9629   echo "$ac_t""yes" 1>&6
9630     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9631   cat >> confdefs.h <<EOF
9632 #define $ac_tr_hdr 1
9633 EOF
9634  
9635 else
9636   echo "$ac_t""no" 1>&6
9637 fi
9638 done
9639
9640 if test "$ac_cv_header_regex_h" != yes ; then
9641         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
9642 fi
9643
9644 echo $ac_n "checking for library containing regfree""... $ac_c" 1>&6
9645 echo "configure:9646: checking for library containing regfree" >&5
9646 if eval "test \"\${ac_cv_search_regfree+set}\" = set"; then
9647   echo $ac_n "(cached) $ac_c" 1>&6
9648 else
9649   ac_func_search_save_LIBS="$LIBS"
9650 ac_cv_search_regfree="no"
9651 cat > conftest.$ac_ext <<EOF
9652 #line 9653 "configure"
9653 #include "confdefs.h"
9654 /* Override any gcc2 internal prototype to avoid an error.  */
9655 /* We use char because int might match the return type of a gcc2
9656     builtin and then its argument prototype would still apply.  */
9657 char regfree();
9658
9659 int main() {
9660 regfree()
9661 ; return 0; }
9662 EOF
9663 if { (eval echo configure:9664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9664   rm -rf conftest*
9665   ac_cv_search_regfree="none required"
9666 else
9667   echo "configure: failed program was:" >&5
9668   cat conftest.$ac_ext >&5
9669 fi
9670 rm -f conftest*
9671 test "$ac_cv_search_regfree" = "no" && for ac_lib in regex gnuregex; do
9672 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9673 cat > conftest.$ac_ext <<EOF
9674 #line 9675 "configure"
9675 #include "confdefs.h"
9676 /* Override any gcc2 internal prototype to avoid an error.  */
9677 /* We use char because int might match the return type of a gcc2
9678     builtin and then its argument prototype would still apply.  */
9679 char regfree();
9680
9681 int main() {
9682 regfree()
9683 ; return 0; }
9684 EOF
9685 if { (eval echo configure:9686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9686   rm -rf conftest*
9687   ac_cv_search_regfree="-l$ac_lib"
9688 break
9689 else
9690   echo "configure: failed program was:" >&5
9691   cat conftest.$ac_ext >&5
9692 fi
9693 rm -f conftest*
9694 done
9695 LIBS="$ac_func_search_save_LIBS"
9696 fi
9697
9698 echo "$ac_t""$ac_cv_search_regfree" 1>&6
9699 if test "$ac_cv_search_regfree" != "no"; then
9700   test "$ac_cv_search_regfree" = "none required" || LIBS="$ac_cv_search_regfree $LIBS"
9701   :
9702 else :
9703   { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
9704 fi
9705
9706
9707 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
9708 echo "configure:9709: checking for compatible POSIX regex" >&5
9709 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
9710   echo $ac_n "(cached) $ac_c" 1>&6
9711 else
9712   
9713         if test "$cross_compiling" = yes; then
9714   ol_cv_c_posix_regex=cross
9715 else
9716   cat > conftest.$ac_ext <<EOF
9717 #line 9718 "configure"
9718 #include "confdefs.h"
9719
9720 #include <sys/types.h>
9721 #include <regex.h>
9722 static char *pattern, *string;
9723 main()
9724 {
9725         int rc;
9726         regex_t re;
9727
9728         pattern = "^A";
9729
9730         if(regcomp(&re, pattern, 0)) {
9731                 return -1;
9732         }
9733         
9734         string = "ALL MATCH";
9735         
9736         rc = regexec(&re, string, 0, (void*)0, 0);
9737
9738         regfree(&re);
9739
9740         return rc;
9741 }
9742 EOF
9743 if { (eval echo configure:9744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9744 then
9745   ol_cv_c_posix_regex=yes
9746 else
9747   echo "configure: failed program was:" >&5
9748   cat conftest.$ac_ext >&5
9749   rm -fr conftest*
9750   ol_cv_c_posix_regex=no
9751 fi
9752 rm -fr conftest*
9753 fi
9754
9755 fi
9756
9757 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
9758
9759 if test "$ol_cv_c_posix_regex" = no ; then
9760         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
9761 fi
9762
9763
9764 have_uuid=no
9765 for ac_hdr in sys/uuid.h
9766 do
9767 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9768 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9769 echo "configure:9770: checking for $ac_hdr" >&5
9770 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9771   echo $ac_n "(cached) $ac_c" 1>&6
9772 else
9773   cat > conftest.$ac_ext <<EOF
9774 #line 9775 "configure"
9775 #include "confdefs.h"
9776 #include <$ac_hdr>
9777 EOF
9778 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9779 { (eval echo configure:9780: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9780 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9781 if test -z "$ac_err"; then
9782   rm -rf conftest*
9783   eval "ac_cv_header_$ac_safe=yes"
9784 else
9785   echo "$ac_err" >&5
9786   echo "configure: failed program was:" >&5
9787   cat conftest.$ac_ext >&5
9788   rm -rf conftest*
9789   eval "ac_cv_header_$ac_safe=no"
9790 fi
9791 rm -f conftest*
9792 fi
9793 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9794   echo "$ac_t""yes" 1>&6
9795     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9796   cat >> confdefs.h <<EOF
9797 #define $ac_tr_hdr 1
9798 EOF
9799  
9800 else
9801   echo "$ac_t""no" 1>&6
9802 fi
9803 done
9804
9805 if test $ac_cv_header_sys_uuid_h = yes ; then
9806         save_LIBS="$LIBS"
9807         
9808 echo $ac_n "checking for library containing uuid_to_str""... $ac_c" 1>&6
9809 echo "configure:9810: checking for library containing uuid_to_str" >&5
9810 if eval "test \"\${ac_cv_search_uuid_to_str+set}\" = set"; then
9811   echo $ac_n "(cached) $ac_c" 1>&6
9812 else
9813   ac_func_search_save_LIBS="$LIBS"
9814 ac_cv_search_uuid_to_str="no"
9815 cat > conftest.$ac_ext <<EOF
9816 #line 9817 "configure"
9817 #include "confdefs.h"
9818 /* Override any gcc2 internal prototype to avoid an error.  */
9819 /* We use char because int might match the return type of a gcc2
9820     builtin and then its argument prototype would still apply.  */
9821 char uuid_to_str();
9822
9823 int main() {
9824 uuid_to_str()
9825 ; return 0; }
9826 EOF
9827 if { (eval echo configure:9828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9828   rm -rf conftest*
9829   ac_cv_search_uuid_to_str="none required"
9830 else
9831   echo "configure: failed program was:" >&5
9832   cat conftest.$ac_ext >&5
9833 fi
9834 rm -f conftest*
9835 test "$ac_cv_search_uuid_to_str" = "no" && for ac_lib in uuid; do
9836 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9837 cat > conftest.$ac_ext <<EOF
9838 #line 9839 "configure"
9839 #include "confdefs.h"
9840 /* Override any gcc2 internal prototype to avoid an error.  */
9841 /* We use char because int might match the return type of a gcc2
9842     builtin and then its argument prototype would still apply.  */
9843 char uuid_to_str();
9844
9845 int main() {
9846 uuid_to_str()
9847 ; return 0; }
9848 EOF
9849 if { (eval echo configure:9850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9850   rm -rf conftest*
9851   ac_cv_search_uuid_to_str="-l$ac_lib"
9852 break
9853 else
9854   echo "configure: failed program was:" >&5
9855   cat conftest.$ac_ext >&5
9856 fi
9857 rm -f conftest*
9858 done
9859 LIBS="$ac_func_search_save_LIBS"
9860 fi
9861
9862 echo "$ac_t""$ac_cv_search_uuid_to_str" 1>&6
9863 if test "$ac_cv_search_uuid_to_str" != "no"; then
9864   test "$ac_cv_search_uuid_to_str" = "none required" || LIBS="$ac_cv_search_uuid_to_str $LIBS"
9865   have_uuid=yes
9866 else :
9867   :
9868 fi
9869         LIBS="$save_LIBS"
9870
9871         if test have_uuid = yes ; then
9872                 cat >> confdefs.h <<\EOF
9873 #define HAVE_UUID_TO_STR 1
9874 EOF
9875
9876
9877                 test "$ac_cv_search_uuid_to_str" = "none required" || \
9878                         SLAPD_LIBS="$SLAPD_LIBS $ac_cv_search_uuid_to_str"
9879         fi
9880 fi
9881
9882 if test $have_uuid = no ; then
9883         echo $ac_n "checking to see if -lrpcrt4 is needed for win32 UUID support""... $ac_c" 1>&6
9884 echo "configure:9885: checking to see if -lrpcrt4 is needed for win32 UUID support" >&5
9885         save_LIBS="$LIBS"
9886         LIBS="$LIBS -lrpcrt4"
9887         cat > conftest.$ac_ext <<EOF
9888 #line 9889 "configure"
9889 #include "confdefs.h"
9890
9891                 char UuidCreate@4();
9892                 char UuidToStringA@8();
9893                 
9894 int main() {
9895
9896                 UuidCreate@4();
9897                 UuidToStringA@8();
9898                 
9899 ; return 0; }
9900 EOF
9901 if { (eval echo configure:9902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9902   rm -rf conftest*
9903   need_rpcrt=yes
9904 else
9905   echo "configure: failed program was:" >&5
9906   cat conftest.$ac_ext >&5
9907   rm -rf conftest*
9908   need_rpcrt=no
9909 fi
9910 rm -f conftest*
9911         if test $need_rpcrt = yes; then
9912                 SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
9913         fi
9914         LIBS="$save_LIBS"
9915         echo "$ac_t""$need_rpcrt" 1>&6
9916 fi
9917
9918 ol_link_dnssrv=no
9919 echo $ac_n "checking for res_query""... $ac_c" 1>&6
9920 echo "configure:9921: checking for res_query" >&5
9921 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
9922   echo $ac_n "(cached) $ac_c" 1>&6
9923 else
9924   cat > conftest.$ac_ext <<EOF
9925 #line 9926 "configure"
9926 #include "confdefs.h"
9927 /* System header to define __stub macros and hopefully few prototypes,
9928     which can conflict with char res_query(); below.  */
9929 #include <assert.h>
9930 /* Override any gcc2 internal prototype to avoid an error.  */
9931 /* We use char because int might match the return type of a gcc2
9932     builtin and then its argument prototype would still apply.  */
9933 char res_query();
9934 char (*f)();
9935
9936 int main() {
9937
9938 /* The GNU C library defines this for functions which it implements
9939     to always fail with ENOSYS.  Some functions are actually named
9940     something starting with __ and the normal name is an alias.  */
9941 #if defined (__stub_res_query) || defined (__stub___res_query)
9942 choke me
9943 #else
9944 f = res_query;
9945 #endif
9946
9947 ; return 0; }
9948 EOF
9949 if { (eval echo configure:9950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9950   rm -rf conftest*
9951   eval "ac_cv_func_res_query=yes"
9952 else
9953   echo "configure: failed program was:" >&5
9954   cat conftest.$ac_ext >&5
9955   rm -rf conftest*
9956   eval "ac_cv_func_res_query=no"
9957 fi
9958 rm -f conftest*
9959 fi
9960
9961 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
9962   echo "$ac_t""yes" 1>&6
9963   :
9964 else
9965   echo "$ac_t""no" 1>&6
9966 fi
9967
9968 if test $ac_cv_func_res_query = no ; then 
9969         echo $ac_n "checking for __res_query""... $ac_c" 1>&6
9970 echo "configure:9971: checking for __res_query" >&5
9971 if eval "test \"\${ac_cv_func___res_query+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 __res_query(); 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 __res_query();
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___res_query) || defined (__stub_____res_query)
9992 choke me
9993 #else
9994 f = __res_query;
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___res_query=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___res_query=no"
10007 fi
10008 rm -f conftest*
10009 fi
10010
10011 if eval "test \"`echo '$ac_cv_func_'__res_query`\" = yes"; then
10012   echo "$ac_t""yes" 1>&6
10013   :
10014 else
10015   echo "$ac_t""no" 1>&6
10016 fi
10017
10018         ac_cv_func_res_query=$ac_cv_func___res_query
10019 fi
10020
10021 if test $ac_cv_func_res_query = no ; then 
10022         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
10023 echo "configure:10024: checking for res_query in -lbind" >&5
10024 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
10025 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10026   echo $ac_n "(cached) $ac_c" 1>&6
10027 else
10028   ac_save_LIBS="$LIBS"
10029 LIBS="-lbind  $LIBS"
10030 cat > conftest.$ac_ext <<EOF
10031 #line 10032 "configure"
10032 #include "confdefs.h"
10033 /* Override any gcc2 internal prototype to avoid an error.  */
10034 /* We use char because int might match the return type of a gcc2
10035     builtin and then its argument prototype would still apply.  */
10036 char res_query();
10037
10038 int main() {
10039 res_query()
10040 ; return 0; }
10041 EOF
10042 if { (eval echo configure:10043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10043   rm -rf conftest*
10044   eval "ac_cv_lib_$ac_lib_var=yes"
10045 else
10046   echo "configure: failed program was:" >&5
10047   cat conftest.$ac_ext >&5
10048   rm -rf conftest*
10049   eval "ac_cv_lib_$ac_lib_var=no"
10050 fi
10051 rm -f conftest*
10052 LIBS="$ac_save_LIBS"
10053
10054 fi
10055 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10056   echo "$ac_t""yes" 1>&6
10057     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10058     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10059   cat >> confdefs.h <<EOF
10060 #define $ac_tr_lib 1
10061 EOF
10062
10063   LIBS="-lbind $LIBS"
10064
10065 else
10066   echo "$ac_t""no" 1>&6
10067 fi
10068
10069         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
10070 fi
10071
10072 if test $ac_cv_func_res_query = no ; then 
10073         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
10074 echo "configure:10075: checking for __res_query in -lbind" >&5
10075 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
10076 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10077   echo $ac_n "(cached) $ac_c" 1>&6
10078 else
10079   ac_save_LIBS="$LIBS"
10080 LIBS="-lbind  $LIBS"
10081 cat > conftest.$ac_ext <<EOF
10082 #line 10083 "configure"
10083 #include "confdefs.h"
10084 /* Override any gcc2 internal prototype to avoid an error.  */
10085 /* We use char because int might match the return type of a gcc2
10086     builtin and then its argument prototype would still apply.  */
10087 char __res_query();
10088
10089 int main() {
10090 __res_query()
10091 ; return 0; }
10092 EOF
10093 if { (eval echo configure:10094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10094   rm -rf conftest*
10095   eval "ac_cv_lib_$ac_lib_var=yes"
10096 else
10097   echo "configure: failed program was:" >&5
10098   cat conftest.$ac_ext >&5
10099   rm -rf conftest*
10100   eval "ac_cv_lib_$ac_lib_var=no"
10101 fi
10102 rm -f conftest*
10103 LIBS="$ac_save_LIBS"
10104
10105 fi
10106 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10107   echo "$ac_t""yes" 1>&6
10108     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10109     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10110   cat >> confdefs.h <<EOF
10111 #define $ac_tr_lib 1
10112 EOF
10113
10114   LIBS="-lbind $LIBS"
10115
10116 else
10117   echo "$ac_t""no" 1>&6
10118 fi
10119
10120         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
10121 fi
10122
10123 if test $ac_cv_func_res_query = no ; then 
10124         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
10125 echo "configure:10126: checking for res_query in -lresolv" >&5
10126 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
10127 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10128   echo $ac_n "(cached) $ac_c" 1>&6
10129 else
10130   ac_save_LIBS="$LIBS"
10131 LIBS="-lresolv  $LIBS"
10132 cat > conftest.$ac_ext <<EOF
10133 #line 10134 "configure"
10134 #include "confdefs.h"
10135 /* Override any gcc2 internal prototype to avoid an error.  */
10136 /* We use char because int might match the return type of a gcc2
10137     builtin and then its argument prototype would still apply.  */
10138 char res_query();
10139
10140 int main() {
10141 res_query()
10142 ; return 0; }
10143 EOF
10144 if { (eval echo configure:10145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10145   rm -rf conftest*
10146   eval "ac_cv_lib_$ac_lib_var=yes"
10147 else
10148   echo "configure: failed program was:" >&5
10149   cat conftest.$ac_ext >&5
10150   rm -rf conftest*
10151   eval "ac_cv_lib_$ac_lib_var=no"
10152 fi
10153 rm -f conftest*
10154 LIBS="$ac_save_LIBS"
10155
10156 fi
10157 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10158   echo "$ac_t""yes" 1>&6
10159     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10160     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10161   cat >> confdefs.h <<EOF
10162 #define $ac_tr_lib 1
10163 EOF
10164
10165   LIBS="-lresolv $LIBS"
10166
10167 else
10168   echo "$ac_t""no" 1>&6
10169 fi
10170
10171         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
10172 fi
10173
10174 if test $ac_cv_func_res_query = no ; then 
10175         echo $ac_n "checking for __res_query in -lresolv""... $ac_c" 1>&6
10176 echo "configure:10177: checking for __res_query in -lresolv" >&5
10177 ac_lib_var=`echo resolv'_'__res_query | sed 'y%./+-:%__p__%'`
10178 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10179   echo $ac_n "(cached) $ac_c" 1>&6
10180 else
10181   ac_save_LIBS="$LIBS"
10182 LIBS="-lresolv  $LIBS"
10183 cat > conftest.$ac_ext <<EOF
10184 #line 10185 "configure"
10185 #include "confdefs.h"
10186 /* Override any gcc2 internal prototype to avoid an error.  */
10187 /* We use char because int might match the return type of a gcc2
10188     builtin and then its argument prototype would still apply.  */
10189 char __res_query();
10190
10191 int main() {
10192 __res_query()
10193 ; return 0; }
10194 EOF
10195 if { (eval echo configure:10196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10196   rm -rf conftest*
10197   eval "ac_cv_lib_$ac_lib_var=yes"
10198 else
10199   echo "configure: failed program was:" >&5
10200   cat conftest.$ac_ext >&5
10201   rm -rf conftest*
10202   eval "ac_cv_lib_$ac_lib_var=no"
10203 fi
10204 rm -f conftest*
10205 LIBS="$ac_save_LIBS"
10206
10207 fi
10208 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10209   echo "$ac_t""yes" 1>&6
10210     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10211     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10212   cat >> confdefs.h <<EOF
10213 #define $ac_tr_lib 1
10214 EOF
10215
10216   LIBS="-lresolv $LIBS"
10217
10218 else
10219   echo "$ac_t""no" 1>&6
10220 fi
10221
10222         ac_cv_func_res_query=$ac_cv_lib_resolv___res_query
10223 fi
10224
10225 if test "$ac_cv_func_res_query" = yes ; then
10226         cat >> confdefs.h <<\EOF
10227 #define HAVE_RES_QUERY 1
10228 EOF
10229
10230
10231         if test $ol_enable_dnssrv != no ; then
10232                 ol_link_dnssrv=yes
10233         fi
10234 fi
10235
10236 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
10237         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
10238 fi
10239
10240 for ac_func in getaddrinfo getnameinfo gai_strerror inet_ntop 
10241 do
10242 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10243 echo "configure:10244: checking for $ac_func" >&5
10244 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10245   echo $ac_n "(cached) $ac_c" 1>&6
10246 else
10247   cat > conftest.$ac_ext <<EOF
10248 #line 10249 "configure"
10249 #include "confdefs.h"
10250 /* System header to define __stub macros and hopefully few prototypes,
10251     which can conflict with char $ac_func(); below.  */
10252 #include <assert.h>
10253 /* Override any gcc2 internal prototype to avoid an error.  */
10254 /* We use char because int might match the return type of a gcc2
10255     builtin and then its argument prototype would still apply.  */
10256 char $ac_func();
10257 char (*f)();
10258
10259 int main() {
10260
10261 /* The GNU C library defines this for functions which it implements
10262     to always fail with ENOSYS.  Some functions are actually named
10263     something starting with __ and the normal name is an alias.  */
10264 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10265 choke me
10266 #else
10267 f = $ac_func;
10268 #endif
10269
10270 ; return 0; }
10271 EOF
10272 if { (eval echo configure:10273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10273   rm -rf conftest*
10274   eval "ac_cv_func_$ac_func=yes"
10275 else
10276   echo "configure: failed program was:" >&5
10277   cat conftest.$ac_ext >&5
10278   rm -rf conftest*
10279   eval "ac_cv_func_$ac_func=no"
10280 fi
10281 rm -f conftest*
10282 fi
10283
10284 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10285   echo "$ac_t""yes" 1>&6
10286     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10287   cat >> confdefs.h <<EOF
10288 #define $ac_tr_func 1
10289 EOF
10290  
10291 else
10292   echo "$ac_t""no" 1>&6
10293 fi
10294 done
10295
10296
10297 ol_link_ipv6=no
10298 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
10299         if test $ol_enable_ipv6 = yes ; then
10300                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
10301         fi
10302 elif test $ol_enable_ipv6 != no ; then
10303         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
10304 echo "configure:10305: checking INET6_ADDRSTRLEN" >&5
10305 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
10306   echo $ac_n "(cached) $ac_c" 1>&6
10307 else
10308   
10309                 cat > conftest.$ac_ext <<EOF
10310 #line 10311 "configure"
10311 #include "confdefs.h"
10312
10313 #                       include <netinet/in.h>
10314 #                       ifdef INET6_ADDRSTRLEN
10315                                 __has_inet6_addrstrlen__;
10316 #                       endif
10317                 
10318 EOF
10319 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10320   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
10321   rm -rf conftest*
10322   ol_cv_inet6_addrstrlen=yes
10323 else
10324   rm -rf conftest*
10325   ol_cv_inet6_addrstrlen=no
10326 fi
10327 rm -f conftest*
10328
10329 fi
10330
10331 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
10332
10333
10334         echo $ac_n "checking struct sockaddr_storage""... $ac_c" 1>&6
10335 echo "configure:10336: checking struct sockaddr_storage" >&5
10336 if eval "test \"\${ol_cv_struct_sockaddr_storage+set}\" = set"; then
10337   echo $ac_n "(cached) $ac_c" 1>&6
10338 else
10339   
10340                 cat > conftest.$ac_ext <<EOF
10341 #line 10342 "configure"
10342 #include "confdefs.h"
10343
10344 #include <sys/types.h>
10345 #include <sys/socket.h>
10346
10347 int main() {
10348
10349                         struct sockaddr_storage ss;
10350
10351 ; return 0; }
10352 EOF
10353 if { (eval echo configure:10354: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10354   rm -rf conftest*
10355   ol_cv_struct_sockaddr_storage=yes
10356 else
10357   echo "configure: failed program was:" >&5
10358   cat conftest.$ac_ext >&5
10359   rm -rf conftest*
10360   ol_cv_struct_sockaddr_storage=no
10361 fi
10362 rm -f conftest*
10363 fi
10364
10365 echo "$ac_t""$ol_cv_struct_sockaddr_storage" 1>&6
10366
10367         if test $ol_cv_inet6_addrstrlen = yes \
10368                 -a $ol_cv_struct_sockaddr_storage = yes ; then
10369                 ol_link_ipv6=yes
10370         elif test $ol_enable_ipv6 = yes \
10371                         -a $ol_cv_inet6_addrstrlen = no ; then
10372                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
10373         elif test $ol_enable_ipv6 = yes \
10374                         -a $ol_cv_struct_sockaddr_storage = no ; then
10375                 { echo "configure: error: IPv6 support requires struct sockaddr_storage" 1>&2; exit 1; }
10376         fi
10377 fi
10378
10379 if test $ol_enable_local != no ; then
10380         for ac_hdr in sys/un.h 
10381 do
10382 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10383 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10384 echo "configure:10385: checking for $ac_hdr" >&5
10385 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10386   echo $ac_n "(cached) $ac_c" 1>&6
10387 else
10388   cat > conftest.$ac_ext <<EOF
10389 #line 10390 "configure"
10390 #include "confdefs.h"
10391 #include <$ac_hdr>
10392 EOF
10393 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10394 { (eval echo configure:10395: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10395 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10396 if test -z "$ac_err"; then
10397   rm -rf conftest*
10398   eval "ac_cv_header_$ac_safe=yes"
10399 else
10400   echo "$ac_err" >&5
10401   echo "configure: failed program was:" >&5
10402   cat conftest.$ac_ext >&5
10403   rm -rf conftest*
10404   eval "ac_cv_header_$ac_safe=no"
10405 fi
10406 rm -f conftest*
10407 fi
10408 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10409   echo "$ac_t""yes" 1>&6
10410     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10411   cat >> confdefs.h <<EOF
10412 #define $ac_tr_hdr 1
10413 EOF
10414  
10415 else
10416   echo "$ac_t""no" 1>&6
10417 fi
10418 done
10419
10420
10421         if test $ol_enable_local = auto ; then
10422                 ol_enable_local=$ac_cv_header_sys_un_h
10423         elif test $ac_cv_header_sys_un_h = no ; then
10424                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
10425         fi
10426 fi
10427
10428 ol_link_kbind=no
10429 ol_link_kpasswd=no
10430 ol_link_krb5=no
10431 ol_link_krb4=no
10432
10433 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
10434         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
10435         -o $ol_with_kerberos = k425 ; then
10436
10437         for ac_hdr in krb5.h
10438 do
10439 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10440 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10441 echo "configure:10442: checking for $ac_hdr" >&5
10442 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10443   echo $ac_n "(cached) $ac_c" 1>&6
10444 else
10445   cat > conftest.$ac_ext <<EOF
10446 #line 10447 "configure"
10447 #include "confdefs.h"
10448 #include <$ac_hdr>
10449 EOF
10450 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10451 { (eval echo configure:10452: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10452 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10453 if test -z "$ac_err"; then
10454   rm -rf conftest*
10455   eval "ac_cv_header_$ac_safe=yes"
10456 else
10457   echo "$ac_err" >&5
10458   echo "configure: failed program was:" >&5
10459   cat conftest.$ac_ext >&5
10460   rm -rf conftest*
10461   eval "ac_cv_header_$ac_safe=no"
10462 fi
10463 rm -f conftest*
10464 fi
10465 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10466   echo "$ac_t""yes" 1>&6
10467     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10468   cat >> confdefs.h <<EOF
10469 #define $ac_tr_hdr 1
10470 EOF
10471  
10472 else
10473   echo "$ac_t""no" 1>&6
10474 fi
10475 done
10476
10477
10478         if test $ac_cv_header_krb5_h = yes ; then
10479                                 for ac_hdr in heim_err.h
10480 do
10481 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10482 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10483 echo "configure:10484: checking for $ac_hdr" >&5
10484 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10485   echo $ac_n "(cached) $ac_c" 1>&6
10486 else
10487   cat > conftest.$ac_ext <<EOF
10488 #line 10489 "configure"
10489 #include "confdefs.h"
10490 #include <$ac_hdr>
10491 EOF
10492 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10493 { (eval echo configure:10494: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10494 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10495 if test -z "$ac_err"; then
10496   rm -rf conftest*
10497   eval "ac_cv_header_$ac_safe=yes"
10498 else
10499   echo "$ac_err" >&5
10500   echo "configure: failed program was:" >&5
10501   cat conftest.$ac_ext >&5
10502   rm -rf conftest*
10503   eval "ac_cv_header_$ac_safe=no"
10504 fi
10505 rm -f conftest*
10506 fi
10507 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10508   echo "$ac_t""yes" 1>&6
10509     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10510   cat >> confdefs.h <<EOF
10511 #define $ac_tr_hdr 1
10512 EOF
10513  
10514 else
10515   echo "$ac_t""no" 1>&6
10516 fi
10517 done
10518
10519                 if test $ac_cv_header_heim_err_h = yes ; then
10520                         krb5_impl=heimdal
10521                 else
10522                         krb5_impl=mit
10523                 fi
10524
10525                 if test $krb5_impl = mit; then
10526                         echo $ac_n "checking for main in -lk5crypto""... $ac_c" 1>&6
10527 echo "configure:10528: checking for main in -lk5crypto" >&5
10528 ac_lib_var=`echo k5crypto'_'main | sed 'y%./+-:%__p__%'`
10529 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10530   echo $ac_n "(cached) $ac_c" 1>&6
10531 else
10532   ac_save_LIBS="$LIBS"
10533 LIBS="-lk5crypto  $LIBS"
10534 cat > conftest.$ac_ext <<EOF
10535 #line 10536 "configure"
10536 #include "confdefs.h"
10537
10538 int main() {
10539 main()
10540 ; return 0; }
10541 EOF
10542 if { (eval echo configure:10543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10543   rm -rf conftest*
10544   eval "ac_cv_lib_$ac_lib_var=yes"
10545 else
10546   echo "configure: failed program was:" >&5
10547   cat conftest.$ac_ext >&5
10548   rm -rf conftest*
10549   eval "ac_cv_lib_$ac_lib_var=no"
10550 fi
10551 rm -f conftest*
10552 LIBS="$ac_save_LIBS"
10553
10554 fi
10555 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10556   echo "$ac_t""yes" 1>&6
10557   krb5crypto=k5crypto
10558 else
10559   echo "$ac_t""no" 1>&6
10560 krb5crypto=crypto
10561 fi
10562
10563
10564                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
10565 echo "configure:10566: checking for main in -lkrb5" >&5
10566 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
10567 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10568   echo $ac_n "(cached) $ac_c" 1>&6
10569 else
10570   ac_save_LIBS="$LIBS"
10571 LIBS="-lkrb5 -l$krb5crypto -lcom_err $LIBS"
10572 cat > conftest.$ac_ext <<EOF
10573 #line 10574 "configure"
10574 #include "confdefs.h"
10575
10576 int main() {
10577 main()
10578 ; return 0; }
10579 EOF
10580 if { (eval echo configure:10581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10581   rm -rf conftest*
10582   eval "ac_cv_lib_$ac_lib_var=yes"
10583 else
10584   echo "configure: failed program was:" >&5
10585   cat conftest.$ac_ext >&5
10586   rm -rf conftest*
10587   eval "ac_cv_lib_$ac_lib_var=no"
10588 fi
10589 rm -f conftest*
10590 LIBS="$ac_save_LIBS"
10591
10592 fi
10593 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10594   echo "$ac_t""yes" 1>&6
10595   have_krb5=yes
10596                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lcom_err"
10597 else
10598   echo "$ac_t""no" 1>&6
10599 have_krb5=no
10600 fi
10601
10602
10603                 elif test $krb5_impl = heimdal; then
10604                         echo $ac_n "checking for main in -ldes""... $ac_c" 1>&6
10605 echo "configure:10606: checking for main in -ldes" >&5
10606 ac_lib_var=`echo des'_'main | sed 'y%./+-:%__p__%'`
10607 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10608   echo $ac_n "(cached) $ac_c" 1>&6
10609 else
10610   ac_save_LIBS="$LIBS"
10611 LIBS="-ldes  $LIBS"
10612 cat > conftest.$ac_ext <<EOF
10613 #line 10614 "configure"
10614 #include "confdefs.h"
10615
10616 int main() {
10617 main()
10618 ; return 0; }
10619 EOF
10620 if { (eval echo configure:10621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10621   rm -rf conftest*
10622   eval "ac_cv_lib_$ac_lib_var=yes"
10623 else
10624   echo "configure: failed program was:" >&5
10625   cat conftest.$ac_ext >&5
10626   rm -rf conftest*
10627   eval "ac_cv_lib_$ac_lib_var=no"
10628 fi
10629 rm -f conftest*
10630 LIBS="$ac_save_LIBS"
10631
10632 fi
10633 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10634   echo "$ac_t""yes" 1>&6
10635   krb5crypto=des
10636 else
10637   echo "$ac_t""no" 1>&6
10638 krb5crypto=crypto
10639 fi
10640
10641
10642                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
10643 echo "configure:10644: checking for main in -lkrb5" >&5
10644 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
10645 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10646   echo $ac_n "(cached) $ac_c" 1>&6
10647 else
10648   ac_save_LIBS="$LIBS"
10649 LIBS="-lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err $LIBS"
10650 cat > conftest.$ac_ext <<EOF
10651 #line 10652 "configure"
10652 #include "confdefs.h"
10653
10654 int main() {
10655 main()
10656 ; return 0; }
10657 EOF
10658 if { (eval echo configure:10659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10659   rm -rf conftest*
10660   eval "ac_cv_lib_$ac_lib_var=yes"
10661 else
10662   echo "configure: failed program was:" >&5
10663   cat conftest.$ac_ext >&5
10664   rm -rf conftest*
10665   eval "ac_cv_lib_$ac_lib_var=no"
10666 fi
10667 rm -f conftest*
10668 LIBS="$ac_save_LIBS"
10669
10670 fi
10671 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10672   echo "$ac_t""yes" 1>&6
10673   have_krb5=yes
10674                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err"
10675 else
10676   echo "$ac_t""no" 1>&6
10677 have_krb5=no
10678 fi
10679
10680
10681                         cat >> confdefs.h <<\EOF
10682 #define HAVE_HEIMDAL_KERBEROS 1
10683 EOF
10684
10685
10686                 else
10687                         have_krb5=no
10688                         echo "configure: warning: Unrecognized Kerberos5 Implementation" 1>&2
10689                 fi
10690
10691                 if test $have_krb5 = yes ; then
10692                         ol_link_krb5=yes
10693
10694                         cat >> confdefs.h <<\EOF
10695 #define HAVE_KRB5 1
10696 EOF
10697
10698
10699                         if test $ol_enable_kpasswd != no ; then
10700                                 ol_link_kpasswd=yes;
10701                         fi
10702
10703                         if test $ol_with_kerberos = k5only ; then
10704                                 ol_with_kerberos=found
10705                         fi
10706
10707                 elif test $ol_with_kerberos != auto ; then
10708                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
10709                 fi
10710
10711         fi
10712 fi
10713
10714 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
10715         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
10716
10717         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
10718 do
10719 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10720 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10721 echo "configure:10722: checking for $ac_hdr" >&5
10722 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10723   echo $ac_n "(cached) $ac_c" 1>&6
10724 else
10725   cat > conftest.$ac_ext <<EOF
10726 #line 10727 "configure"
10727 #include "confdefs.h"
10728 #include <$ac_hdr>
10729 EOF
10730 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10731 { (eval echo configure:10732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10732 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10733 if test -z "$ac_err"; then
10734   rm -rf conftest*
10735   eval "ac_cv_header_$ac_safe=yes"
10736 else
10737   echo "$ac_err" >&5
10738   echo "configure: failed program was:" >&5
10739   cat conftest.$ac_ext >&5
10740   rm -rf conftest*
10741   eval "ac_cv_header_$ac_safe=no"
10742 fi
10743 rm -f conftest*
10744 fi
10745 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10746   echo "$ac_t""yes" 1>&6
10747     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10748   cat >> confdefs.h <<EOF
10749 #define $ac_tr_hdr 1
10750 EOF
10751  
10752 else
10753   echo "$ac_t""no" 1>&6
10754 fi
10755 done
10756
10757
10758         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
10759                 if test $krb5_impl = mit; then
10760                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
10761 echo "configure:10762: checking for main in -lkrb4" >&5
10762 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
10763 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10764   echo $ac_n "(cached) $ac_c" 1>&6
10765 else
10766   ac_save_LIBS="$LIBS"
10767 LIBS="-lkrb4 -ldes425 -lkrb5 -l$krb5crypto -lcom_err $LIBS"
10768 cat > conftest.$ac_ext <<EOF
10769 #line 10770 "configure"
10770 #include "confdefs.h"
10771
10772 int main() {
10773 main()
10774 ; return 0; }
10775 EOF
10776 if { (eval echo configure:10777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10777   rm -rf conftest*
10778   eval "ac_cv_lib_$ac_lib_var=yes"
10779 else
10780   echo "configure: failed program was:" >&5
10781   cat conftest.$ac_ext >&5
10782   rm -rf conftest*
10783   eval "ac_cv_lib_$ac_lib_var=no"
10784 fi
10785 rm -f conftest*
10786 LIBS="$ac_save_LIBS"
10787
10788 fi
10789 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10790   echo "$ac_t""yes" 1>&6
10791   have_k425=yes
10792                                 KRB4_LIBS="-lkrb4 -ldes425"
10793 else
10794   echo "$ac_t""no" 1>&6
10795 have_k425=no
10796 fi
10797
10798
10799                 elif test $krb5_impl = heimdal; then
10800                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
10801 echo "configure:10802: checking for main in -lkrb4" >&5
10802 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
10803 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10804   echo $ac_n "(cached) $ac_c" 1>&6
10805 else
10806   ac_save_LIBS="$LIBS"
10807 LIBS="-lkrb4 -lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err $LIBS"
10808 cat > conftest.$ac_ext <<EOF
10809 #line 10810 "configure"
10810 #include "confdefs.h"
10811
10812 int main() {
10813 main()
10814 ; return 0; }
10815 EOF
10816 if { (eval echo configure:10817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10817   rm -rf conftest*
10818   eval "ac_cv_lib_$ac_lib_var=yes"
10819 else
10820   echo "configure: failed program was:" >&5
10821   cat conftest.$ac_ext >&5
10822   rm -rf conftest*
10823   eval "ac_cv_lib_$ac_lib_var=no"
10824 fi
10825 rm -f conftest*
10826 LIBS="$ac_save_LIBS"
10827
10828 fi
10829 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10830   echo "$ac_t""yes" 1>&6
10831   have_k425=yes
10832                                 KRB4_LIBS="-lkrb4"
10833 else
10834   echo "$ac_t""no" 1>&6
10835 have_k425=no
10836 fi
10837
10838
10839                 else
10840                         have_425=no
10841                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
10842                 fi
10843
10844                 if test $have_k425 = yes ; then
10845                         ol_with_kerberos=found
10846                         ol_link_krb4=yes
10847
10848                         cat >> confdefs.h <<\EOF
10849 #define HAVE_KRB425 1
10850 EOF
10851
10852                         cat >> confdefs.h <<\EOF
10853 #define HAVE_KRB4 1
10854 EOF
10855
10856
10857                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
10858 echo "configure:10859: checking for des_debug in Kerberos libraries" >&5
10859 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
10860   echo $ac_n "(cached) $ac_c" 1>&6
10861 else
10862   
10863                                                                 save_LIBS="$LIBS"
10864                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
10865                                 cat > conftest.$ac_ext <<EOF
10866 #line 10867 "configure"
10867 #include "confdefs.h"
10868
10869 #include <kerberosIV/krb.h>
10870 #include <kerberosIV/des.h>
10871 extern int des_debug;
10872
10873 int main() {
10874
10875 des_debug = 1;
10876
10877 ; return 0; }
10878 EOF
10879 if { (eval echo configure:10880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10880   rm -rf conftest*
10881   ol_cv_var_des_debug=yes
10882 else
10883   echo "configure: failed program was:" >&5
10884   cat conftest.$ac_ext >&5
10885   rm -rf conftest*
10886   ol_cv_var_des_debug=no
10887 fi
10888 rm -f conftest*
10889                                                                 LIBS="$save_LIBS"
10890                         
10891 fi
10892
10893 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
10894
10895                         if test $ol_cv_var_des_debug = yes ; then
10896                                 cat >> confdefs.h <<\EOF
10897 #define HAVE_DES_DEBUG 1
10898 EOF
10899
10900                         fi
10901
10902                         LIBS="$save_LIBS"
10903                 fi
10904         fi
10905 fi
10906
10907 if test $ol_link_krb5 = yes ; then
10908         ol_with_kerberos=found
10909 fi
10910
10911 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
10912         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
10913
10914         for ac_hdr in krb.h des.h krb-archaeology.h 
10915 do
10916 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10917 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10918 echo "configure:10919: checking for $ac_hdr" >&5
10919 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10920   echo $ac_n "(cached) $ac_c" 1>&6
10921 else
10922   cat > conftest.$ac_ext <<EOF
10923 #line 10924 "configure"
10924 #include "confdefs.h"
10925 #include <$ac_hdr>
10926 EOF
10927 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10928 { (eval echo configure:10929: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10929 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10930 if test -z "$ac_err"; then
10931   rm -rf conftest*
10932   eval "ac_cv_header_$ac_safe=yes"
10933 else
10934   echo "$ac_err" >&5
10935   echo "configure: failed program was:" >&5
10936   cat conftest.$ac_ext >&5
10937   rm -rf conftest*
10938   eval "ac_cv_header_$ac_safe=no"
10939 fi
10940 rm -f conftest*
10941 fi
10942 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10943   echo "$ac_t""yes" 1>&6
10944     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10945   cat >> confdefs.h <<EOF
10946 #define $ac_tr_hdr 1
10947 EOF
10948  
10949 else
10950   echo "$ac_t""no" 1>&6
10951 fi
10952 done
10953
10954
10955         if test $ac_cv_header_krb_h = yes ; then
10956                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
10957 echo "configure:10958: checking for main in -lkrb" >&5
10958 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
10959 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10960   echo $ac_n "(cached) $ac_c" 1>&6
10961 else
10962   ac_save_LIBS="$LIBS"
10963 LIBS="-lkrb -ldes $LIBS"
10964 cat > conftest.$ac_ext <<EOF
10965 #line 10966 "configure"
10966 #include "confdefs.h"
10967
10968 int main() {
10969 main()
10970 ; return 0; }
10971 EOF
10972 if { (eval echo configure:10973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10973   rm -rf conftest*
10974   eval "ac_cv_lib_$ac_lib_var=yes"
10975 else
10976   echo "configure: failed program was:" >&5
10977   cat conftest.$ac_ext >&5
10978   rm -rf conftest*
10979   eval "ac_cv_lib_$ac_lib_var=no"
10980 fi
10981 rm -f conftest*
10982 LIBS="$ac_save_LIBS"
10983
10984 fi
10985 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10986   echo "$ac_t""yes" 1>&6
10987   have_k4=yes
10988 else
10989   echo "$ac_t""no" 1>&6
10990 have_k4=no
10991 fi
10992
10993
10994                 if test $have_k4 = yes ; then
10995                         ol_with_kerberos=found
10996                         ol_link_krb4=yes
10997
10998                         cat >> confdefs.h <<\EOF
10999 #define HAVE_KRB4 1
11000 EOF
11001
11002
11003                         KRB4_LIBS="-lkrb -ldes"
11004
11005                         if test $ac_cv_header_krb_archaeology_h = yes ; then
11006                                 cat >> confdefs.h <<\EOF
11007 #define HAVE_KTH_KERBEROS 1
11008 EOF
11009
11010                         fi
11011                 fi
11012         fi
11013 fi
11014
11015 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
11016         ol_link_kpasswd=yes
11017 fi
11018
11019 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
11020         ol_link_kbind=yes
11021
11022 elif test $ol_enable_kbind = yes ; then
11023         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
11024 fi
11025
11026 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
11027         cat >> confdefs.h <<\EOF
11028 #define HAVE_KERBEROS 1
11029 EOF
11030
11031
11032 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
11033         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
11034 fi
11035
11036 ol_link_tls=no
11037 if test $ol_with_tls != no ; then
11038         for ac_hdr in openssl/ssl.h ssl.h
11039 do
11040 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11041 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11042 echo "configure:11043: checking for $ac_hdr" >&5
11043 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11044   echo $ac_n "(cached) $ac_c" 1>&6
11045 else
11046   cat > conftest.$ac_ext <<EOF
11047 #line 11048 "configure"
11048 #include "confdefs.h"
11049 #include <$ac_hdr>
11050 EOF
11051 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11052 { (eval echo configure:11053: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11053 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11054 if test -z "$ac_err"; then
11055   rm -rf conftest*
11056   eval "ac_cv_header_$ac_safe=yes"
11057 else
11058   echo "$ac_err" >&5
11059   echo "configure: failed program was:" >&5
11060   cat conftest.$ac_ext >&5
11061   rm -rf conftest*
11062   eval "ac_cv_header_$ac_safe=no"
11063 fi
11064 rm -f conftest*
11065 fi
11066 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11067   echo "$ac_t""yes" 1>&6
11068     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11069   cat >> confdefs.h <<EOF
11070 #define $ac_tr_hdr 1
11071 EOF
11072  
11073 else
11074   echo "$ac_t""no" 1>&6
11075 fi
11076 done
11077
11078         
11079         if test $ac_cv_header_openssl_ssl_h = yes \
11080                 -o $ac_cv_header_ssl_h = yes ; then
11081                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
11082 echo "configure:11083: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
11083 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
11084 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11085   echo $ac_n "(cached) $ac_c" 1>&6
11086 else
11087   ac_save_LIBS="$LIBS"
11088 LIBS="-lssl -lcrypto $LIBS"
11089 cat > conftest.$ac_ext <<EOF
11090 #line 11091 "configure"
11091 #include "confdefs.h"
11092 /* Override any gcc2 internal prototype to avoid an error.  */
11093 /* We use char because int might match the return type of a gcc2
11094     builtin and then its argument prototype would still apply.  */
11095 char SSLeay_add_ssl_algorithms();
11096
11097 int main() {
11098 SSLeay_add_ssl_algorithms()
11099 ; return 0; }
11100 EOF
11101 if { (eval echo configure:11102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11102   rm -rf conftest*
11103   eval "ac_cv_lib_$ac_lib_var=yes"
11104 else
11105   echo "configure: failed program was:" >&5
11106   cat conftest.$ac_ext >&5
11107   rm -rf conftest*
11108   eval "ac_cv_lib_$ac_lib_var=no"
11109 fi
11110 rm -f conftest*
11111 LIBS="$ac_save_LIBS"
11112
11113 fi
11114 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11115   echo "$ac_t""yes" 1>&6
11116   have_ssleay=yes
11117                         need_rsaref=no
11118 else
11119   echo "$ac_t""no" 1>&6
11120 have_ssleay=no
11121 fi
11122
11123                         
11124                 if test $have_ssleay = no ; then
11125                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
11126 echo "configure:11127: checking for SSL_library_init in -lssl" >&5
11127 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
11128 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11129   echo $ac_n "(cached) $ac_c" 1>&6
11130 else
11131   ac_save_LIBS="$LIBS"
11132 LIBS="-lssl -lcrypto $LIBS"
11133 cat > conftest.$ac_ext <<EOF
11134 #line 11135 "configure"
11135 #include "confdefs.h"
11136 /* Override any gcc2 internal prototype to avoid an error.  */
11137 /* We use char because int might match the return type of a gcc2
11138     builtin and then its argument prototype would still apply.  */
11139 char SSL_library_init();
11140
11141 int main() {
11142 SSL_library_init()
11143 ; return 0; }
11144 EOF
11145 if { (eval echo configure:11146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11146   rm -rf conftest*
11147   eval "ac_cv_lib_$ac_lib_var=yes"
11148 else
11149   echo "configure: failed program was:" >&5
11150   cat conftest.$ac_ext >&5
11151   rm -rf conftest*
11152   eval "ac_cv_lib_$ac_lib_var=no"
11153 fi
11154 rm -f conftest*
11155 LIBS="$ac_save_LIBS"
11156
11157 fi
11158 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11159   echo "$ac_t""yes" 1>&6
11160   have_ssleay=yes
11161                                 need_rsaref=no
11162 else
11163   echo "$ac_t""no" 1>&6
11164 have_ssleay=no
11165 fi
11166
11167                 fi
11168
11169                 if test $have_ssleay = no ; then
11170                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
11171 echo "configure:11172: checking for ssl3_accept in -lssl" >&5
11172 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
11173 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11174   echo $ac_n "(cached) $ac_c" 1>&6
11175 else
11176   ac_save_LIBS="$LIBS"
11177 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
11178 cat > conftest.$ac_ext <<EOF
11179 #line 11180 "configure"
11180 #include "confdefs.h"
11181 /* Override any gcc2 internal prototype to avoid an error.  */
11182 /* We use char because int might match the return type of a gcc2
11183     builtin and then its argument prototype would still apply.  */
11184 char ssl3_accept();
11185
11186 int main() {
11187 ssl3_accept()
11188 ; return 0; }
11189 EOF
11190 if { (eval echo configure:11191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11191   rm -rf conftest*
11192   eval "ac_cv_lib_$ac_lib_var=yes"
11193 else
11194   echo "configure: failed program was:" >&5
11195   cat conftest.$ac_ext >&5
11196   rm -rf conftest*
11197   eval "ac_cv_lib_$ac_lib_var=no"
11198 fi
11199 rm -f conftest*
11200 LIBS="$ac_save_LIBS"
11201
11202 fi
11203 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11204   echo "$ac_t""yes" 1>&6
11205   have_ssleay=yes
11206                                 need_rsaref=yes
11207 else
11208   echo "$ac_t""no" 1>&6
11209 have_ssleay=no
11210 fi
11211
11212                 fi
11213
11214                 if test $have_ssleay = yes ; then
11215                         ol_with_tls=found
11216                         ol_link_tls=yes
11217
11218                         cat >> confdefs.h <<\EOF
11219 #define HAVE_SSLEAY 1
11220 EOF
11221
11222
11223                         if test $need_rsaref = yes; then
11224                                 cat >> confdefs.h <<\EOF
11225 #define HAVE_RSAREF 1
11226 EOF
11227
11228
11229                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
11230                         else
11231                                 TLS_LIBS="-lssl -lcrypto"
11232                         fi
11233                 fi
11234         fi
11235
11236 else
11237         echo "configure: warning: TLS data protection not supported!" 1>&2
11238 fi
11239
11240 WITH_TLS=no
11241 if test $ol_link_tls = yes ; then
11242         cat >> confdefs.h <<\EOF
11243 #define HAVE_TLS 1
11244 EOF
11245
11246         WITH_TLS=yes
11247
11248 elif test $ol_with_tls = auto ; then
11249         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
11250         echo "configure: warning: TLS data protection not supported!" 1>&2
11251
11252 elif test $ol_with_tls != no ; then
11253         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
11254 fi
11255
11256 if test $ol_enable_lmpasswd != no; then
11257         if test $ol_link_tls != yes ; then
11258                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
11259         fi
11260
11261         cat >> confdefs.h <<\EOF
11262 #define SLAPD_LMHASH 1
11263 EOF
11264
11265 fi
11266
11267 ol_link_threads=no
11268
11269 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11270         -o $ol_with_threads = nt ; then
11271
11272         
11273         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
11274 echo "configure:11275: checking for _beginthread" >&5
11275 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
11276   echo $ac_n "(cached) $ac_c" 1>&6
11277 else
11278   cat > conftest.$ac_ext <<EOF
11279 #line 11280 "configure"
11280 #include "confdefs.h"
11281 /* System header to define __stub macros and hopefully few prototypes,
11282     which can conflict with char _beginthread(); below.  */
11283 #include <assert.h>
11284 /* Override any gcc2 internal prototype to avoid an error.  */
11285 /* We use char because int might match the return type of a gcc2
11286     builtin and then its argument prototype would still apply.  */
11287 char _beginthread();
11288 char (*f)();
11289
11290 int main() {
11291
11292 /* The GNU C library defines this for functions which it implements
11293     to always fail with ENOSYS.  Some functions are actually named
11294     something starting with __ and the normal name is an alias.  */
11295 #if defined (__stub__beginthread) || defined (__stub____beginthread)
11296 choke me
11297 #else
11298 f = _beginthread;
11299 #endif
11300
11301 ; return 0; }
11302 EOF
11303 if { (eval echo configure:11304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11304   rm -rf conftest*
11305   eval "ac_cv_func__beginthread=yes"
11306 else
11307   echo "configure: failed program was:" >&5
11308   cat conftest.$ac_ext >&5
11309   rm -rf conftest*
11310   eval "ac_cv_func__beginthread=no"
11311 fi
11312 rm -f conftest*
11313 fi
11314
11315 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
11316   echo "$ac_t""yes" 1>&6
11317   :
11318 else
11319   echo "$ac_t""no" 1>&6
11320 fi
11321
11322
11323         if test $ac_cv_func__beginthread = yes ; then
11324                 cat >> confdefs.h <<\EOF
11325 #define HAVE_NT_THREADS 1
11326 EOF
11327
11328                 ol_cv_nt_threads=yes
11329         fi
11330
11331
11332         if test "$ol_cv_nt_threads" = yes ; then
11333                 ol_link_threads=nt
11334                 ol_with_threads=found
11335                 ol_with_yielding_select=yes
11336
11337                 cat >> confdefs.h <<\EOF
11338 #define HAVE_NT_SERVICE_MANAGER 1
11339 EOF
11340
11341                 cat >> confdefs.h <<\EOF
11342 #define HAVE_NT_EVENT_LOG 1
11343 EOF
11344
11345         fi
11346
11347         if test $ol_with_threads = nt ; then
11348                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
11349         fi
11350 fi
11351
11352 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11353         -o $ol_with_threads = posix ; then
11354
11355         for ac_hdr in pthread.h
11356 do
11357 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11358 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11359 echo "configure:11360: checking for $ac_hdr" >&5
11360 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11361   echo $ac_n "(cached) $ac_c" 1>&6
11362 else
11363   cat > conftest.$ac_ext <<EOF
11364 #line 11365 "configure"
11365 #include "confdefs.h"
11366 #include <$ac_hdr>
11367 EOF
11368 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11369 { (eval echo configure:11370: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11370 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11371 if test -z "$ac_err"; then
11372   rm -rf conftest*
11373   eval "ac_cv_header_$ac_safe=yes"
11374 else
11375   echo "$ac_err" >&5
11376   echo "configure: failed program was:" >&5
11377   cat conftest.$ac_ext >&5
11378   rm -rf conftest*
11379   eval "ac_cv_header_$ac_safe=no"
11380 fi
11381 rm -f conftest*
11382 fi
11383 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11384   echo "$ac_t""yes" 1>&6
11385     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11386   cat >> confdefs.h <<EOF
11387 #define $ac_tr_hdr 1
11388 EOF
11389  
11390 else
11391   echo "$ac_t""no" 1>&6
11392 fi
11393 done
11394
11395
11396         if test $ac_cv_header_pthread_h = yes ; then
11397                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
11398 echo "configure:11399: checking POSIX thread version" >&5
11399 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
11400   echo $ac_n "(cached) $ac_c" 1>&6
11401 else
11402   
11403         cat > conftest.$ac_ext <<EOF
11404 #line 11405 "configure"
11405 #include "confdefs.h"
11406
11407 #               include <pthread.h>
11408         
11409 int main() {
11410
11411                 int i = PTHREAD_CREATE_JOINABLE;
11412         
11413 ; return 0; }
11414 EOF
11415 if { (eval echo configure:11416: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11416   rm -rf conftest*
11417   
11418         cat > conftest.$ac_ext <<EOF
11419 #line 11420 "configure"
11420 #include "confdefs.h"
11421 #include <pthread.h>
11422 EOF
11423 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11424   egrep "pthread_detach" >/dev/null 2>&1; then
11425   rm -rf conftest*
11426   ol_cv_pthread_version=10
11427 else
11428   rm -rf conftest*
11429   ol_cv_pthread_version=8
11430 fi
11431 rm -f conftest*
11432
11433 else
11434   echo "configure: failed program was:" >&5
11435   cat conftest.$ac_ext >&5
11436   rm -rf conftest*
11437   
11438         cat > conftest.$ac_ext <<EOF
11439 #line 11440 "configure"
11440 #include "confdefs.h"
11441
11442 #               include <pthread.h>
11443 #               ifdef PTHREAD_CREATE_UNDETACHED
11444                 draft7
11445 #               endif
11446         
11447 EOF
11448 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11449   egrep "draft7" >/dev/null 2>&1; then
11450   rm -rf conftest*
11451   ol_cv_pthread_version=7
11452 else
11453   rm -rf conftest*
11454   
11455         cat > conftest.$ac_ext <<EOF
11456 #line 11457 "configure"
11457 #include "confdefs.h"
11458 #include <pthread.h>
11459 EOF
11460 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11461   egrep "pthread_attr_init" >/dev/null 2>&1; then
11462   rm -rf conftest*
11463   ol_cv_pthread_version=6
11464 else
11465   rm -rf conftest*
11466   
11467         cat > conftest.$ac_ext <<EOF
11468 #line 11469 "configure"
11469 #include "confdefs.h"
11470
11471 #               include <pthread.h>
11472 #ifdef          PTHREAD_MUTEX_INITIALIZER
11473                 draft5
11474 #endif
11475         
11476 EOF
11477 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11478   egrep "draft5" >/dev/null 2>&1; then
11479   rm -rf conftest*
11480   ol_cv_pthread_version=5
11481 else
11482   rm -rf conftest*
11483   ol_cv_pthread_version=4
11484 fi
11485 rm -f conftest*
11486  
11487 fi
11488 rm -f conftest*
11489  
11490 fi
11491 rm -f conftest*
11492  
11493 fi
11494 rm -f conftest*
11495
11496 fi
11497
11498 echo "$ac_t""$ol_cv_pthread_version" 1>&6
11499
11500
11501                 if test $ol_cv_pthread_version != 0 ; then
11502                         cat >> confdefs.h <<EOF
11503 #define HAVE_PTHREADS $ol_cv_pthread_version
11504 EOF
11505
11506                 else
11507                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
11508                 fi
11509
11510                 # consider threads found
11511                 ol_with_threads=found
11512
11513                 
11514         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
11515 echo "configure:11516: checking for LinuxThreads pthread.h" >&5
11516 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
11517   echo $ac_n "(cached) $ac_c" 1>&6
11518 else
11519   cat > conftest.$ac_ext <<EOF
11520 #line 11521 "configure"
11521 #include "confdefs.h"
11522 #include <pthread.h>
11523 EOF
11524 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11525   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
11526   rm -rf conftest*
11527   ol_cv_header_linux_threads=yes
11528 else
11529   rm -rf conftest*
11530   ol_cv_header_linux_threads=no
11531 fi
11532 rm -f conftest*
11533
11534                 
11535 fi
11536
11537 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
11538         if test $ol_cv_header_linux_threads = yes; then
11539                 cat >> confdefs.h <<\EOF
11540 #define HAVE_LINUX_THREADS 1
11541 EOF
11542
11543         fi
11544
11545                 
11546         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
11547 echo "configure:11548: checking for GNU Pth pthread.h" >&5
11548 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
11549   echo $ac_n "(cached) $ac_c" 1>&6
11550 else
11551   cat > conftest.$ac_ext <<EOF
11552 #line 11553 "configure"
11553 #include "confdefs.h"
11554 #include <pthread.h>
11555 #ifdef _POSIX_THREAD_IS_GNU_PTH
11556         __gnu_pth__;
11557 #endif
11558
11559 EOF
11560 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11561   egrep "__gnu_pth__" >/dev/null 2>&1; then
11562   rm -rf conftest*
11563   ol_cv_header_gnu_pth_pthread_h=yes
11564 else
11565   rm -rf conftest*
11566   ol_cv_header_gnu_pth_pthread_h=no
11567 fi
11568 rm -f conftest*
11569
11570                 
11571 fi
11572
11573 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
11574
11575
11576                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
11577                         for ac_hdr in sched.h
11578 do
11579 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11580 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11581 echo "configure:11582: checking for $ac_hdr" >&5
11582 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11583   echo $ac_n "(cached) $ac_c" 1>&6
11584 else
11585   cat > conftest.$ac_ext <<EOF
11586 #line 11587 "configure"
11587 #include "confdefs.h"
11588 #include <$ac_hdr>
11589 EOF
11590 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11591 { (eval echo configure:11592: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11592 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11593 if test -z "$ac_err"; then
11594   rm -rf conftest*
11595   eval "ac_cv_header_$ac_safe=yes"
11596 else
11597   echo "$ac_err" >&5
11598   echo "configure: failed program was:" >&5
11599   cat conftest.$ac_ext >&5
11600   rm -rf conftest*
11601   eval "ac_cv_header_$ac_safe=no"
11602 fi
11603 rm -f conftest*
11604 fi
11605 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11606   echo "$ac_t""yes" 1>&6
11607     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11608   cat >> confdefs.h <<EOF
11609 #define $ac_tr_hdr 1
11610 EOF
11611  
11612 else
11613   echo "$ac_t""no" 1>&6
11614 fi
11615 done
11616
11617                 fi
11618
11619                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
11620                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
11621 echo "configure:11622: checking for pthread_create in default libraries" >&5
11622 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
11623   echo $ac_n "(cached) $ac_c" 1>&6
11624 else
11625   
11626                 if test "$cross_compiling" = yes; then
11627   cat > conftest.$ac_ext <<EOF
11628 #line 11629 "configure"
11629 #include "confdefs.h"
11630 /* pthread test headers */
11631 #include <pthread.h>
11632 #if HAVE_PTHREADS < 7
11633 #include <errno.h>
11634 #endif
11635 #ifndef NULL
11636 #define NULL (void*)0
11637 #endif
11638
11639 static void *task(p)
11640         void *p;
11641 {
11642         return (void *) (p == NULL);
11643 }
11644
11645 int main() {
11646
11647         /* pthread test function */
11648 #ifndef PTHREAD_CREATE_DETACHED
11649 #define PTHREAD_CREATE_DETACHED 1
11650 #endif
11651         pthread_t t;
11652         int status;
11653         int detach = PTHREAD_CREATE_DETACHED;
11654
11655 #if HAVE_PTHREADS > 4
11656         /* Final pthreads */
11657         pthread_attr_t attr;
11658
11659         status = pthread_attr_init(&attr);
11660         if( status ) return status;
11661
11662 #if HAVE_PTHREADS < 7
11663         status = pthread_attr_setdetachstate(&attr, &detach);
11664         if( status < 0 ) status = errno;
11665 #else
11666         status = pthread_attr_setdetachstate(&attr, detach);
11667 #endif
11668         if( status ) return status;
11669         status = pthread_create( &t, &attr, task, NULL );
11670 #if HAVE_PTHREADS < 7
11671         if( status < 0 ) status = errno;
11672 #endif
11673         if( status ) return status;
11674 #else
11675         /* Draft 4 pthreads */
11676         status = pthread_create( &t, pthread_attr_default, task, NULL );
11677         if( status ) return errno;
11678
11679         /* give thread a chance to complete */
11680         /* it should remain joinable and hence detachable */
11681         sleep( 1 );
11682
11683         status = pthread_detach( &t );
11684         if( status ) return errno;
11685 #endif
11686
11687 #ifdef HAVE_LINUX_THREADS
11688         pthread_kill_other_threads_np();
11689 #endif
11690
11691         return 0;
11692
11693 ; return 0; }
11694 EOF
11695 if { (eval echo configure:11696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11696   rm -rf conftest*
11697   ol_cv_pthread_create=yes
11698 else
11699   echo "configure: failed program was:" >&5
11700   cat conftest.$ac_ext >&5
11701   rm -rf conftest*
11702   ol_cv_pthread_create=no
11703 fi
11704 rm -f conftest*
11705 else
11706   cat > conftest.$ac_ext <<EOF
11707 #line 11708 "configure"
11708 #include "confdefs.h"
11709 /* pthread test headers */
11710 #include <pthread.h>
11711 #if HAVE_PTHREADS < 7
11712 #include <errno.h>
11713 #endif
11714 #ifndef NULL
11715 #define NULL (void*)0
11716 #endif
11717
11718 static void *task(p)
11719         void *p;
11720 {
11721         return (void *) (p == NULL);
11722 }
11723
11724
11725 int main(argc, argv)
11726         int argc;
11727         char **argv;
11728 {
11729
11730         /* pthread test function */
11731 #ifndef PTHREAD_CREATE_DETACHED
11732 #define PTHREAD_CREATE_DETACHED 1
11733 #endif
11734         pthread_t t;
11735         int status;
11736         int detach = PTHREAD_CREATE_DETACHED;
11737
11738 #if HAVE_PTHREADS > 4
11739         /* Final pthreads */
11740         pthread_attr_t attr;
11741
11742         status = pthread_attr_init(&attr);
11743         if( status ) return status;
11744
11745 #if HAVE_PTHREADS < 7
11746         status = pthread_attr_setdetachstate(&attr, &detach);
11747         if( status < 0 ) status = errno;
11748 #else
11749         status = pthread_attr_setdetachstate(&attr, detach);
11750 #endif
11751         if( status ) return status;
11752         status = pthread_create( &t, &attr, task, NULL );
11753 #if HAVE_PTHREADS < 7
11754         if( status < 0 ) status = errno;
11755 #endif
11756         if( status ) return status;
11757 #else
11758         /* Draft 4 pthreads */
11759         status = pthread_create( &t, pthread_attr_default, task, NULL );
11760         if( status ) return errno;
11761
11762         /* give thread a chance to complete */
11763         /* it should remain joinable and hence detachable */
11764         sleep( 1 );
11765
11766         status = pthread_detach( &t );
11767         if( status ) return errno;
11768 #endif
11769
11770 #ifdef HAVE_LINUX_THREADS
11771         pthread_kill_other_threads_np();
11772 #endif
11773
11774         return 0;
11775
11776 }
11777
11778 EOF
11779 if { (eval echo configure:11780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11780 then
11781   ol_cv_pthread_create=yes
11782 else
11783   echo "configure: failed program was:" >&5
11784   cat conftest.$ac_ext >&5
11785   rm -fr conftest*
11786   ol_cv_pthread_create=no
11787 fi
11788 rm -fr conftest*
11789 fi
11790
11791 fi
11792
11793 echo "$ac_t""$ol_cv_pthread_create" 1>&6
11794
11795                 if test $ol_cv_pthread_create != no ; then
11796                         ol_link_threads=posix
11797                         ol_link_pthreads=""
11798                 fi
11799                 
11800                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
11801 if test "$ol_link_threads" = no ; then
11802         # try -kthread
11803         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
11804 echo "configure:11805: checking for pthread link with -kthread" >&5
11805 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
11806   echo $ac_n "(cached) $ac_c" 1>&6
11807 else
11808   
11809                 # save the flags
11810                 ol_LIBS="$LIBS"
11811                 LIBS="-kthread $LIBS"
11812
11813                 if test "$cross_compiling" = yes; then
11814   cat > conftest.$ac_ext <<EOF
11815 #line 11816 "configure"
11816 #include "confdefs.h"
11817 /* pthread test headers */
11818 #include <pthread.h>
11819 #if HAVE_PTHREADS < 7
11820 #include <errno.h>
11821 #endif
11822 #ifndef NULL
11823 #define NULL (void*)0
11824 #endif
11825
11826 static void *task(p)
11827         void *p;
11828 {
11829         return (void *) (p == NULL);
11830 }
11831
11832 int main() {
11833
11834         /* pthread test function */
11835 #ifndef PTHREAD_CREATE_DETACHED
11836 #define PTHREAD_CREATE_DETACHED 1
11837 #endif
11838         pthread_t t;
11839         int status;
11840         int detach = PTHREAD_CREATE_DETACHED;
11841
11842 #if HAVE_PTHREADS > 4
11843         /* Final pthreads */
11844         pthread_attr_t attr;
11845
11846         status = pthread_attr_init(&attr);
11847         if( status ) return status;
11848
11849 #if HAVE_PTHREADS < 7
11850         status = pthread_attr_setdetachstate(&attr, &detach);
11851         if( status < 0 ) status = errno;
11852 #else
11853         status = pthread_attr_setdetachstate(&attr, detach);
11854 #endif
11855         if( status ) return status;
11856         status = pthread_create( &t, &attr, task, NULL );
11857 #if HAVE_PTHREADS < 7
11858         if( status < 0 ) status = errno;
11859 #endif
11860         if( status ) return status;
11861 #else
11862         /* Draft 4 pthreads */
11863         status = pthread_create( &t, pthread_attr_default, task, NULL );
11864         if( status ) return errno;
11865
11866         /* give thread a chance to complete */
11867         /* it should remain joinable and hence detachable */
11868         sleep( 1 );
11869
11870         status = pthread_detach( &t );
11871         if( status ) return errno;
11872 #endif
11873
11874 #ifdef HAVE_LINUX_THREADS
11875         pthread_kill_other_threads_np();
11876 #endif
11877
11878         return 0;
11879
11880 ; return 0; }
11881 EOF
11882 if { (eval echo configure:11883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11883   rm -rf conftest*
11884   ol_cv_pthread_kthread=yes
11885 else
11886   echo "configure: failed program was:" >&5
11887   cat conftest.$ac_ext >&5
11888   rm -rf conftest*
11889   ol_cv_pthread_kthread=no
11890 fi
11891 rm -f conftest*
11892 else
11893   cat > conftest.$ac_ext <<EOF
11894 #line 11895 "configure"
11895 #include "confdefs.h"
11896 /* pthread test headers */
11897 #include <pthread.h>
11898 #if HAVE_PTHREADS < 7
11899 #include <errno.h>
11900 #endif
11901 #ifndef NULL
11902 #define NULL (void*)0
11903 #endif
11904
11905 static void *task(p)
11906         void *p;
11907 {
11908         return (void *) (p == NULL);
11909 }
11910
11911
11912 int main(argc, argv)
11913         int argc;
11914         char **argv;
11915 {
11916
11917         /* pthread test function */
11918 #ifndef PTHREAD_CREATE_DETACHED
11919 #define PTHREAD_CREATE_DETACHED 1
11920 #endif
11921         pthread_t t;
11922         int status;
11923         int detach = PTHREAD_CREATE_DETACHED;
11924
11925 #if HAVE_PTHREADS > 4
11926         /* Final pthreads */
11927         pthread_attr_t attr;
11928
11929         status = pthread_attr_init(&attr);
11930         if( status ) return status;
11931
11932 #if HAVE_PTHREADS < 7
11933         status = pthread_attr_setdetachstate(&attr, &detach);
11934         if( status < 0 ) status = errno;
11935 #else
11936         status = pthread_attr_setdetachstate(&attr, detach);
11937 #endif
11938         if( status ) return status;
11939         status = pthread_create( &t, &attr, task, NULL );
11940 #if HAVE_PTHREADS < 7
11941         if( status < 0 ) status = errno;
11942 #endif
11943         if( status ) return status;
11944 #else
11945         /* Draft 4 pthreads */
11946         status = pthread_create( &t, pthread_attr_default, task, NULL );
11947         if( status ) return errno;
11948
11949         /* give thread a chance to complete */
11950         /* it should remain joinable and hence detachable */
11951         sleep( 1 );
11952
11953         status = pthread_detach( &t );
11954         if( status ) return errno;
11955 #endif
11956
11957 #ifdef HAVE_LINUX_THREADS
11958         pthread_kill_other_threads_np();
11959 #endif
11960
11961         return 0;
11962
11963 }
11964
11965 EOF
11966 if { (eval echo configure:11967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11967 then
11968   ol_cv_pthread_kthread=yes
11969 else
11970   echo "configure: failed program was:" >&5
11971   cat conftest.$ac_ext >&5
11972   rm -fr conftest*
11973   ol_cv_pthread_kthread=no
11974 fi
11975 rm -fr conftest*
11976 fi
11977
11978
11979                 # restore the LIBS
11980                 LIBS="$ol_LIBS"
11981         
11982 fi
11983
11984 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
11985
11986         if test $ol_cv_pthread_kthread = yes ; then
11987                 ol_link_pthreads="-kthread"
11988                 ol_link_threads=posix
11989         fi
11990 fi
11991
11992                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
11993 if test "$ol_link_threads" = no ; then
11994         # try -pthread
11995         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
11996 echo "configure:11997: checking for pthread link with -pthread" >&5
11997 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
11998   echo $ac_n "(cached) $ac_c" 1>&6
11999 else
12000   
12001                 # save the flags
12002                 ol_LIBS="$LIBS"
12003                 LIBS="-pthread $LIBS"
12004
12005                 if test "$cross_compiling" = yes; then
12006   cat > conftest.$ac_ext <<EOF
12007 #line 12008 "configure"
12008 #include "confdefs.h"
12009 /* pthread test headers */
12010 #include <pthread.h>
12011 #if HAVE_PTHREADS < 7
12012 #include <errno.h>
12013 #endif
12014 #ifndef NULL
12015 #define NULL (void*)0
12016 #endif
12017
12018 static void *task(p)
12019         void *p;
12020 {
12021         return (void *) (p == NULL);
12022 }
12023
12024 int main() {
12025
12026         /* pthread test function */
12027 #ifndef PTHREAD_CREATE_DETACHED
12028 #define PTHREAD_CREATE_DETACHED 1
12029 #endif
12030         pthread_t t;
12031         int status;
12032         int detach = PTHREAD_CREATE_DETACHED;
12033
12034 #if HAVE_PTHREADS > 4
12035         /* Final pthreads */
12036         pthread_attr_t attr;
12037
12038         status = pthread_attr_init(&attr);
12039         if( status ) return status;
12040
12041 #if HAVE_PTHREADS < 7
12042         status = pthread_attr_setdetachstate(&attr, &detach);
12043         if( status < 0 ) status = errno;
12044 #else
12045         status = pthread_attr_setdetachstate(&attr, detach);
12046 #endif
12047         if( status ) return status;
12048         status = pthread_create( &t, &attr, task, NULL );
12049 #if HAVE_PTHREADS < 7
12050         if( status < 0 ) status = errno;
12051 #endif
12052         if( status ) return status;
12053 #else
12054         /* Draft 4 pthreads */
12055         status = pthread_create( &t, pthread_attr_default, task, NULL );
12056         if( status ) return errno;
12057
12058         /* give thread a chance to complete */
12059         /* it should remain joinable and hence detachable */
12060         sleep( 1 );
12061
12062         status = pthread_detach( &t );
12063         if( status ) return errno;
12064 #endif
12065
12066 #ifdef HAVE_LINUX_THREADS
12067         pthread_kill_other_threads_np();
12068 #endif
12069
12070         return 0;
12071
12072 ; return 0; }
12073 EOF
12074 if { (eval echo configure:12075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12075   rm -rf conftest*
12076   ol_cv_pthread_pthread=yes
12077 else
12078   echo "configure: failed program was:" >&5
12079   cat conftest.$ac_ext >&5
12080   rm -rf conftest*
12081   ol_cv_pthread_pthread=no
12082 fi
12083 rm -f conftest*
12084 else
12085   cat > conftest.$ac_ext <<EOF
12086 #line 12087 "configure"
12087 #include "confdefs.h"
12088 /* pthread test headers */
12089 #include <pthread.h>
12090 #if HAVE_PTHREADS < 7
12091 #include <errno.h>
12092 #endif
12093 #ifndef NULL
12094 #define NULL (void*)0
12095 #endif
12096
12097 static void *task(p)
12098         void *p;
12099 {
12100         return (void *) (p == NULL);
12101 }
12102
12103
12104 int main(argc, argv)
12105         int argc;
12106         char **argv;
12107 {
12108
12109         /* pthread test function */
12110 #ifndef PTHREAD_CREATE_DETACHED
12111 #define PTHREAD_CREATE_DETACHED 1
12112 #endif
12113         pthread_t t;
12114         int status;
12115         int detach = PTHREAD_CREATE_DETACHED;
12116
12117 #if HAVE_PTHREADS > 4
12118         /* Final pthreads */
12119         pthread_attr_t attr;
12120
12121         status = pthread_attr_init(&attr);
12122         if( status ) return status;
12123
12124 #if HAVE_PTHREADS < 7
12125         status = pthread_attr_setdetachstate(&attr, &detach);
12126         if( status < 0 ) status = errno;
12127 #else
12128         status = pthread_attr_setdetachstate(&attr, detach);
12129 #endif
12130         if( status ) return status;
12131         status = pthread_create( &t, &attr, task, NULL );
12132 #if HAVE_PTHREADS < 7
12133         if( status < 0 ) status = errno;
12134 #endif
12135         if( status ) return status;
12136 #else
12137         /* Draft 4 pthreads */
12138         status = pthread_create( &t, pthread_attr_default, task, NULL );
12139         if( status ) return errno;
12140
12141         /* give thread a chance to complete */
12142         /* it should remain joinable and hence detachable */
12143         sleep( 1 );
12144
12145         status = pthread_detach( &t );
12146         if( status ) return errno;
12147 #endif
12148
12149 #ifdef HAVE_LINUX_THREADS
12150         pthread_kill_other_threads_np();
12151 #endif
12152
12153         return 0;
12154
12155 }
12156
12157 EOF
12158 if { (eval echo configure:12159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12159 then
12160   ol_cv_pthread_pthread=yes
12161 else
12162   echo "configure: failed program was:" >&5
12163   cat conftest.$ac_ext >&5
12164   rm -fr conftest*
12165   ol_cv_pthread_pthread=no
12166 fi
12167 rm -fr conftest*
12168 fi
12169
12170
12171                 # restore the LIBS
12172                 LIBS="$ol_LIBS"
12173         
12174 fi
12175
12176 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
12177
12178         if test $ol_cv_pthread_pthread = yes ; then
12179                 ol_link_pthreads="-pthread"
12180                 ol_link_threads=posix
12181         fi
12182 fi
12183
12184                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
12185 if test "$ol_link_threads" = no ; then
12186         # try -pthreads
12187         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
12188 echo "configure:12189: checking for pthread link with -pthreads" >&5
12189 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
12190   echo $ac_n "(cached) $ac_c" 1>&6
12191 else
12192   
12193                 # save the flags
12194                 ol_LIBS="$LIBS"
12195                 LIBS="-pthreads $LIBS"
12196
12197                 if test "$cross_compiling" = yes; then
12198   cat > conftest.$ac_ext <<EOF
12199 #line 12200 "configure"
12200 #include "confdefs.h"
12201 /* pthread test headers */
12202 #include <pthread.h>
12203 #if HAVE_PTHREADS < 7
12204 #include <errno.h>
12205 #endif
12206 #ifndef NULL
12207 #define NULL (void*)0
12208 #endif
12209
12210 static void *task(p)
12211         void *p;
12212 {
12213         return (void *) (p == NULL);
12214 }
12215
12216 int main() {
12217
12218         /* pthread test function */
12219 #ifndef PTHREAD_CREATE_DETACHED
12220 #define PTHREAD_CREATE_DETACHED 1
12221 #endif
12222         pthread_t t;
12223         int status;
12224         int detach = PTHREAD_CREATE_DETACHED;
12225
12226 #if HAVE_PTHREADS > 4
12227         /* Final pthreads */
12228         pthread_attr_t attr;
12229
12230         status = pthread_attr_init(&attr);
12231         if( status ) return status;
12232
12233 #if HAVE_PTHREADS < 7
12234         status = pthread_attr_setdetachstate(&attr, &detach);
12235         if( status < 0 ) status = errno;
12236 #else
12237         status = pthread_attr_setdetachstate(&attr, detach);
12238 #endif
12239         if( status ) return status;
12240         status = pthread_create( &t, &attr, task, NULL );
12241 #if HAVE_PTHREADS < 7
12242         if( status < 0 ) status = errno;
12243 #endif
12244         if( status ) return status;
12245 #else
12246         /* Draft 4 pthreads */
12247         status = pthread_create( &t, pthread_attr_default, task, NULL );
12248         if( status ) return errno;
12249
12250         /* give thread a chance to complete */
12251         /* it should remain joinable and hence detachable */
12252         sleep( 1 );
12253
12254         status = pthread_detach( &t );
12255         if( status ) return errno;
12256 #endif
12257
12258 #ifdef HAVE_LINUX_THREADS
12259         pthread_kill_other_threads_np();
12260 #endif
12261
12262         return 0;
12263
12264 ; return 0; }
12265 EOF
12266 if { (eval echo configure:12267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12267   rm -rf conftest*
12268   ol_cv_pthread_pthreads=yes
12269 else
12270   echo "configure: failed program was:" >&5
12271   cat conftest.$ac_ext >&5
12272   rm -rf conftest*
12273   ol_cv_pthread_pthreads=no
12274 fi
12275 rm -f conftest*
12276 else
12277   cat > conftest.$ac_ext <<EOF
12278 #line 12279 "configure"
12279 #include "confdefs.h"
12280 /* pthread test headers */
12281 #include <pthread.h>
12282 #if HAVE_PTHREADS < 7
12283 #include <errno.h>
12284 #endif
12285 #ifndef NULL
12286 #define NULL (void*)0
12287 #endif
12288
12289 static void *task(p)
12290         void *p;
12291 {
12292         return (void *) (p == NULL);
12293 }
12294
12295
12296 int main(argc, argv)
12297         int argc;
12298         char **argv;
12299 {
12300
12301         /* pthread test function */
12302 #ifndef PTHREAD_CREATE_DETACHED
12303 #define PTHREAD_CREATE_DETACHED 1
12304 #endif
12305         pthread_t t;
12306         int status;
12307         int detach = PTHREAD_CREATE_DETACHED;
12308
12309 #if HAVE_PTHREADS > 4
12310         /* Final pthreads */
12311         pthread_attr_t attr;
12312
12313         status = pthread_attr_init(&attr);
12314         if( status ) return status;
12315
12316 #if HAVE_PTHREADS < 7
12317         status = pthread_attr_setdetachstate(&attr, &detach);
12318         if( status < 0 ) status = errno;
12319 #else
12320         status = pthread_attr_setdetachstate(&attr, detach);
12321 #endif
12322         if( status ) return status;
12323         status = pthread_create( &t, &attr, task, NULL );
12324 #if HAVE_PTHREADS < 7
12325         if( status < 0 ) status = errno;
12326 #endif
12327         if( status ) return status;
12328 #else
12329         /* Draft 4 pthreads */
12330         status = pthread_create( &t, pthread_attr_default, task, NULL );
12331         if( status ) return errno;
12332
12333         /* give thread a chance to complete */
12334         /* it should remain joinable and hence detachable */
12335         sleep( 1 );
12336
12337         status = pthread_detach( &t );
12338         if( status ) return errno;
12339 #endif
12340
12341 #ifdef HAVE_LINUX_THREADS
12342         pthread_kill_other_threads_np();
12343 #endif
12344
12345         return 0;
12346
12347 }
12348
12349 EOF
12350 if { (eval echo configure:12351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12351 then
12352   ol_cv_pthread_pthreads=yes
12353 else
12354   echo "configure: failed program was:" >&5
12355   cat conftest.$ac_ext >&5
12356   rm -fr conftest*
12357   ol_cv_pthread_pthreads=no
12358 fi
12359 rm -fr conftest*
12360 fi
12361
12362
12363                 # restore the LIBS
12364                 LIBS="$ol_LIBS"
12365         
12366 fi
12367
12368 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
12369
12370         if test $ol_cv_pthread_pthreads = yes ; then
12371                 ol_link_pthreads="-pthreads"
12372                 ol_link_threads=posix
12373         fi
12374 fi
12375
12376                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
12377 if test "$ol_link_threads" = no ; then
12378         # try -mthreads
12379         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
12380 echo "configure:12381: checking for pthread link with -mthreads" >&5
12381 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
12382   echo $ac_n "(cached) $ac_c" 1>&6
12383 else
12384   
12385                 # save the flags
12386                 ol_LIBS="$LIBS"
12387                 LIBS="-mthreads $LIBS"
12388
12389                 if test "$cross_compiling" = yes; then
12390   cat > conftest.$ac_ext <<EOF
12391 #line 12392 "configure"
12392 #include "confdefs.h"
12393 /* pthread test headers */
12394 #include <pthread.h>
12395 #if HAVE_PTHREADS < 7
12396 #include <errno.h>
12397 #endif
12398 #ifndef NULL
12399 #define NULL (void*)0
12400 #endif
12401
12402 static void *task(p)
12403         void *p;
12404 {
12405         return (void *) (p == NULL);
12406 }
12407
12408 int main() {
12409
12410         /* pthread test function */
12411 #ifndef PTHREAD_CREATE_DETACHED
12412 #define PTHREAD_CREATE_DETACHED 1
12413 #endif
12414         pthread_t t;
12415         int status;
12416         int detach = PTHREAD_CREATE_DETACHED;
12417
12418 #if HAVE_PTHREADS > 4
12419         /* Final pthreads */
12420         pthread_attr_t attr;
12421
12422         status = pthread_attr_init(&attr);
12423         if( status ) return status;
12424
12425 #if HAVE_PTHREADS < 7
12426         status = pthread_attr_setdetachstate(&attr, &detach);
12427         if( status < 0 ) status = errno;
12428 #else
12429         status = pthread_attr_setdetachstate(&attr, detach);
12430 #endif
12431         if( status ) return status;
12432         status = pthread_create( &t, &attr, task, NULL );
12433 #if HAVE_PTHREADS < 7
12434         if( status < 0 ) status = errno;
12435 #endif
12436         if( status ) return status;
12437 #else
12438         /* Draft 4 pthreads */
12439         status = pthread_create( &t, pthread_attr_default, task, NULL );
12440         if( status ) return errno;
12441
12442         /* give thread a chance to complete */
12443         /* it should remain joinable and hence detachable */
12444         sleep( 1 );
12445
12446         status = pthread_detach( &t );
12447         if( status ) return errno;
12448 #endif
12449
12450 #ifdef HAVE_LINUX_THREADS
12451         pthread_kill_other_threads_np();
12452 #endif
12453
12454         return 0;
12455
12456 ; return 0; }
12457 EOF
12458 if { (eval echo configure:12459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12459   rm -rf conftest*
12460   ol_cv_pthread_mthreads=yes
12461 else
12462   echo "configure: failed program was:" >&5
12463   cat conftest.$ac_ext >&5
12464   rm -rf conftest*
12465   ol_cv_pthread_mthreads=no
12466 fi
12467 rm -f conftest*
12468 else
12469   cat > conftest.$ac_ext <<EOF
12470 #line 12471 "configure"
12471 #include "confdefs.h"
12472 /* pthread test headers */
12473 #include <pthread.h>
12474 #if HAVE_PTHREADS < 7
12475 #include <errno.h>
12476 #endif
12477 #ifndef NULL
12478 #define NULL (void*)0
12479 #endif
12480
12481 static void *task(p)
12482         void *p;
12483 {
12484         return (void *) (p == NULL);
12485 }
12486
12487
12488 int main(argc, argv)
12489         int argc;
12490         char **argv;
12491 {
12492
12493         /* pthread test function */
12494 #ifndef PTHREAD_CREATE_DETACHED
12495 #define PTHREAD_CREATE_DETACHED 1
12496 #endif
12497         pthread_t t;
12498         int status;
12499         int detach = PTHREAD_CREATE_DETACHED;
12500
12501 #if HAVE_PTHREADS > 4
12502         /* Final pthreads */
12503         pthread_attr_t attr;
12504
12505         status = pthread_attr_init(&attr);
12506         if( status ) return status;
12507
12508 #if HAVE_PTHREADS < 7
12509         status = pthread_attr_setdetachstate(&attr, &detach);
12510         if( status < 0 ) status = errno;
12511 #else
12512         status = pthread_attr_setdetachstate(&attr, detach);
12513 #endif
12514         if( status ) return status;
12515         status = pthread_create( &t, &attr, task, NULL );
12516 #if HAVE_PTHREADS < 7
12517         if( status < 0 ) status = errno;
12518 #endif
12519         if( status ) return status;
12520 #else
12521         /* Draft 4 pthreads */
12522         status = pthread_create( &t, pthread_attr_default, task, NULL );
12523         if( status ) return errno;
12524
12525         /* give thread a chance to complete */
12526         /* it should remain joinable and hence detachable */
12527         sleep( 1 );
12528
12529         status = pthread_detach( &t );
12530         if( status ) return errno;
12531 #endif
12532
12533 #ifdef HAVE_LINUX_THREADS
12534         pthread_kill_other_threads_np();
12535 #endif
12536
12537         return 0;
12538
12539 }
12540
12541 EOF
12542 if { (eval echo configure:12543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12543 then
12544   ol_cv_pthread_mthreads=yes
12545 else
12546   echo "configure: failed program was:" >&5
12547   cat conftest.$ac_ext >&5
12548   rm -fr conftest*
12549   ol_cv_pthread_mthreads=no
12550 fi
12551 rm -fr conftest*
12552 fi
12553
12554
12555                 # restore the LIBS
12556                 LIBS="$ol_LIBS"
12557         
12558 fi
12559
12560 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
12561
12562         if test $ol_cv_pthread_mthreads = yes ; then
12563                 ol_link_pthreads="-mthreads"
12564                 ol_link_threads=posix
12565         fi
12566 fi
12567
12568                 # Pthread try link: -thread (ol_cv_pthread_thread)
12569 if test "$ol_link_threads" = no ; then
12570         # try -thread
12571         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
12572 echo "configure:12573: checking for pthread link with -thread" >&5
12573 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
12574   echo $ac_n "(cached) $ac_c" 1>&6
12575 else
12576   
12577                 # save the flags
12578                 ol_LIBS="$LIBS"
12579                 LIBS="-thread $LIBS"
12580
12581                 if test "$cross_compiling" = yes; then
12582   cat > conftest.$ac_ext <<EOF
12583 #line 12584 "configure"
12584 #include "confdefs.h"
12585 /* pthread test headers */
12586 #include <pthread.h>
12587 #if HAVE_PTHREADS < 7
12588 #include <errno.h>
12589 #endif
12590 #ifndef NULL
12591 #define NULL (void*)0
12592 #endif
12593
12594 static void *task(p)
12595         void *p;
12596 {
12597         return (void *) (p == NULL);
12598 }
12599
12600 int main() {
12601
12602         /* pthread test function */
12603 #ifndef PTHREAD_CREATE_DETACHED
12604 #define PTHREAD_CREATE_DETACHED 1
12605 #endif
12606         pthread_t t;
12607         int status;
12608         int detach = PTHREAD_CREATE_DETACHED;
12609
12610 #if HAVE_PTHREADS > 4
12611         /* Final pthreads */
12612         pthread_attr_t attr;
12613
12614         status = pthread_attr_init(&attr);
12615         if( status ) return status;
12616
12617 #if HAVE_PTHREADS < 7
12618         status = pthread_attr_setdetachstate(&attr, &detach);
12619         if( status < 0 ) status = errno;
12620 #else
12621         status = pthread_attr_setdetachstate(&attr, detach);
12622 #endif
12623         if( status ) return status;
12624         status = pthread_create( &t, &attr, task, NULL );
12625 #if HAVE_PTHREADS < 7
12626         if( status < 0 ) status = errno;
12627 #endif
12628         if( status ) return status;
12629 #else
12630         /* Draft 4 pthreads */
12631         status = pthread_create( &t, pthread_attr_default, task, NULL );
12632         if( status ) return errno;
12633
12634         /* give thread a chance to complete */
12635         /* it should remain joinable and hence detachable */
12636         sleep( 1 );
12637
12638         status = pthread_detach( &t );
12639         if( status ) return errno;
12640 #endif
12641
12642 #ifdef HAVE_LINUX_THREADS
12643         pthread_kill_other_threads_np();
12644 #endif
12645
12646         return 0;
12647
12648 ; return 0; }
12649 EOF
12650 if { (eval echo configure:12651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12651   rm -rf conftest*
12652   ol_cv_pthread_thread=yes
12653 else
12654   echo "configure: failed program was:" >&5
12655   cat conftest.$ac_ext >&5
12656   rm -rf conftest*
12657   ol_cv_pthread_thread=no
12658 fi
12659 rm -f conftest*
12660 else
12661   cat > conftest.$ac_ext <<EOF
12662 #line 12663 "configure"
12663 #include "confdefs.h"
12664 /* pthread test headers */
12665 #include <pthread.h>
12666 #if HAVE_PTHREADS < 7
12667 #include <errno.h>
12668 #endif
12669 #ifndef NULL
12670 #define NULL (void*)0
12671 #endif
12672
12673 static void *task(p)
12674         void *p;
12675 {
12676         return (void *) (p == NULL);
12677 }
12678
12679
12680 int main(argc, argv)
12681         int argc;
12682         char **argv;
12683 {
12684
12685         /* pthread test function */
12686 #ifndef PTHREAD_CREATE_DETACHED
12687 #define PTHREAD_CREATE_DETACHED 1
12688 #endif
12689         pthread_t t;
12690         int status;
12691         int detach = PTHREAD_CREATE_DETACHED;
12692
12693 #if HAVE_PTHREADS > 4
12694         /* Final pthreads */
12695         pthread_attr_t attr;
12696
12697         status = pthread_attr_init(&attr);
12698         if( status ) return status;
12699
12700 #if HAVE_PTHREADS < 7
12701         status = pthread_attr_setdetachstate(&attr, &detach);
12702         if( status < 0 ) status = errno;
12703 #else
12704         status = pthread_attr_setdetachstate(&attr, detach);
12705 #endif
12706         if( status ) return status;
12707         status = pthread_create( &t, &attr, task, NULL );
12708 #if HAVE_PTHREADS < 7
12709         if( status < 0 ) status = errno;
12710 #endif
12711         if( status ) return status;
12712 #else
12713         /* Draft 4 pthreads */
12714         status = pthread_create( &t, pthread_attr_default, task, NULL );
12715         if( status ) return errno;
12716
12717         /* give thread a chance to complete */
12718         /* it should remain joinable and hence detachable */
12719         sleep( 1 );
12720
12721         status = pthread_detach( &t );
12722         if( status ) return errno;
12723 #endif
12724
12725 #ifdef HAVE_LINUX_THREADS
12726         pthread_kill_other_threads_np();
12727 #endif
12728
12729         return 0;
12730
12731 }
12732
12733 EOF
12734 if { (eval echo configure:12735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12735 then
12736   ol_cv_pthread_thread=yes
12737 else
12738   echo "configure: failed program was:" >&5
12739   cat conftest.$ac_ext >&5
12740   rm -fr conftest*
12741   ol_cv_pthread_thread=no
12742 fi
12743 rm -fr conftest*
12744 fi
12745
12746
12747                 # restore the LIBS
12748                 LIBS="$ol_LIBS"
12749         
12750 fi
12751
12752 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
12753
12754         if test $ol_cv_pthread_thread = yes ; then
12755                 ol_link_pthreads="-thread"
12756                 ol_link_threads=posix
12757         fi
12758 fi
12759
12760
12761                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
12762 if test "$ol_link_threads" = no ; then
12763         # try -lpthread -lmach -lexc -lc_r
12764         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
12765 echo "configure:12766: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
12766 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
12767   echo $ac_n "(cached) $ac_c" 1>&6
12768 else
12769   
12770                 # save the flags
12771                 ol_LIBS="$LIBS"
12772                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
12773
12774                 if test "$cross_compiling" = yes; then
12775   cat > conftest.$ac_ext <<EOF
12776 #line 12777 "configure"
12777 #include "confdefs.h"
12778 /* pthread test headers */
12779 #include <pthread.h>
12780 #if HAVE_PTHREADS < 7
12781 #include <errno.h>
12782 #endif
12783 #ifndef NULL
12784 #define NULL (void*)0
12785 #endif
12786
12787 static void *task(p)
12788         void *p;
12789 {
12790         return (void *) (p == NULL);
12791 }
12792
12793 int main() {
12794
12795         /* pthread test function */
12796 #ifndef PTHREAD_CREATE_DETACHED
12797 #define PTHREAD_CREATE_DETACHED 1
12798 #endif
12799         pthread_t t;
12800         int status;
12801         int detach = PTHREAD_CREATE_DETACHED;
12802
12803 #if HAVE_PTHREADS > 4
12804         /* Final pthreads */
12805         pthread_attr_t attr;
12806
12807         status = pthread_attr_init(&attr);
12808         if( status ) return status;
12809
12810 #if HAVE_PTHREADS < 7
12811         status = pthread_attr_setdetachstate(&attr, &detach);
12812         if( status < 0 ) status = errno;
12813 #else
12814         status = pthread_attr_setdetachstate(&attr, detach);
12815 #endif
12816         if( status ) return status;
12817         status = pthread_create( &t, &attr, task, NULL );
12818 #if HAVE_PTHREADS < 7
12819         if( status < 0 ) status = errno;
12820 #endif
12821         if( status ) return status;
12822 #else
12823         /* Draft 4 pthreads */
12824         status = pthread_create( &t, pthread_attr_default, task, NULL );
12825         if( status ) return errno;
12826
12827         /* give thread a chance to complete */
12828         /* it should remain joinable and hence detachable */
12829         sleep( 1 );
12830
12831         status = pthread_detach( &t );
12832         if( status ) return errno;
12833 #endif
12834
12835 #ifdef HAVE_LINUX_THREADS
12836         pthread_kill_other_threads_np();
12837 #endif
12838
12839         return 0;
12840
12841 ; return 0; }
12842 EOF
12843 if { (eval echo configure:12844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12844   rm -rf conftest*
12845   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
12846 else
12847   echo "configure: failed program was:" >&5
12848   cat conftest.$ac_ext >&5
12849   rm -rf conftest*
12850   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
12851 fi
12852 rm -f conftest*
12853 else
12854   cat > conftest.$ac_ext <<EOF
12855 #line 12856 "configure"
12856 #include "confdefs.h"
12857 /* pthread test headers */
12858 #include <pthread.h>
12859 #if HAVE_PTHREADS < 7
12860 #include <errno.h>
12861 #endif
12862 #ifndef NULL
12863 #define NULL (void*)0
12864 #endif
12865
12866 static void *task(p)
12867         void *p;
12868 {
12869         return (void *) (p == NULL);
12870 }
12871
12872
12873 int main(argc, argv)
12874         int argc;
12875         char **argv;
12876 {
12877
12878         /* pthread test function */
12879 #ifndef PTHREAD_CREATE_DETACHED
12880 #define PTHREAD_CREATE_DETACHED 1
12881 #endif
12882         pthread_t t;
12883         int status;
12884         int detach = PTHREAD_CREATE_DETACHED;
12885
12886 #if HAVE_PTHREADS > 4
12887         /* Final pthreads */
12888         pthread_attr_t attr;
12889
12890         status = pthread_attr_init(&attr);
12891         if( status ) return status;
12892
12893 #if HAVE_PTHREADS < 7
12894         status = pthread_attr_setdetachstate(&attr, &detach);
12895         if( status < 0 ) status = errno;
12896 #else
12897         status = pthread_attr_setdetachstate(&attr, detach);
12898 #endif
12899         if( status ) return status;
12900         status = pthread_create( &t, &attr, task, NULL );
12901 #if HAVE_PTHREADS < 7
12902         if( status < 0 ) status = errno;
12903 #endif
12904         if( status ) return status;
12905 #else
12906         /* Draft 4 pthreads */
12907         status = pthread_create( &t, pthread_attr_default, task, NULL );
12908         if( status ) return errno;
12909
12910         /* give thread a chance to complete */
12911         /* it should remain joinable and hence detachable */
12912         sleep( 1 );
12913
12914         status = pthread_detach( &t );
12915         if( status ) return errno;
12916 #endif
12917
12918 #ifdef HAVE_LINUX_THREADS
12919         pthread_kill_other_threads_np();
12920 #endif
12921
12922         return 0;
12923
12924 }
12925
12926 EOF
12927 if { (eval echo configure:12928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12928 then
12929   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
12930 else
12931   echo "configure: failed program was:" >&5
12932   cat conftest.$ac_ext >&5
12933   rm -fr conftest*
12934   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
12935 fi
12936 rm -fr conftest*
12937 fi
12938
12939
12940                 # restore the LIBS
12941                 LIBS="$ol_LIBS"
12942         
12943 fi
12944
12945 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
12946
12947         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
12948                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
12949                 ol_link_threads=posix
12950         fi
12951 fi
12952
12953                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
12954 if test "$ol_link_threads" = no ; then
12955         # try -lpthread -lmach -lexc
12956         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
12957 echo "configure:12958: checking for pthread link with -lpthread -lmach -lexc" >&5
12958 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
12959   echo $ac_n "(cached) $ac_c" 1>&6
12960 else
12961   
12962                 # save the flags
12963                 ol_LIBS="$LIBS"
12964                 LIBS="-lpthread -lmach -lexc $LIBS"
12965
12966                 if test "$cross_compiling" = yes; then
12967   cat > conftest.$ac_ext <<EOF
12968 #line 12969 "configure"
12969 #include "confdefs.h"
12970 /* pthread test headers */
12971 #include <pthread.h>
12972 #if HAVE_PTHREADS < 7
12973 #include <errno.h>
12974 #endif
12975 #ifndef NULL
12976 #define NULL (void*)0
12977 #endif
12978
12979 static void *task(p)
12980         void *p;
12981 {
12982         return (void *) (p == NULL);
12983 }
12984
12985 int main() {
12986
12987         /* pthread test function */
12988 #ifndef PTHREAD_CREATE_DETACHED
12989 #define PTHREAD_CREATE_DETACHED 1
12990 #endif
12991         pthread_t t;
12992         int status;
12993         int detach = PTHREAD_CREATE_DETACHED;
12994
12995 #if HAVE_PTHREADS > 4
12996         /* Final pthreads */
12997         pthread_attr_t attr;
12998
12999         status = pthread_attr_init(&attr);
13000         if( status ) return status;
13001
13002 #if HAVE_PTHREADS < 7
13003         status = pthread_attr_setdetachstate(&attr, &detach);
13004         if( status < 0 ) status = errno;
13005 #else
13006         status = pthread_attr_setdetachstate(&attr, detach);
13007 #endif
13008         if( status ) return status;
13009         status = pthread_create( &t, &attr, task, NULL );
13010 #if HAVE_PTHREADS < 7
13011         if( status < 0 ) status = errno;
13012 #endif
13013         if( status ) return status;
13014 #else
13015         /* Draft 4 pthreads */
13016         status = pthread_create( &t, pthread_attr_default, task, NULL );
13017         if( status ) return errno;
13018
13019         /* give thread a chance to complete */
13020         /* it should remain joinable and hence detachable */
13021         sleep( 1 );
13022
13023         status = pthread_detach( &t );
13024         if( status ) return errno;
13025 #endif
13026
13027 #ifdef HAVE_LINUX_THREADS
13028         pthread_kill_other_threads_np();
13029 #endif
13030
13031         return 0;
13032
13033 ; return 0; }
13034 EOF
13035 if { (eval echo configure:13036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13036   rm -rf conftest*
13037   ol_cv_pthread_lpthread_lmach_lexc=yes
13038 else
13039   echo "configure: failed program was:" >&5
13040   cat conftest.$ac_ext >&5
13041   rm -rf conftest*
13042   ol_cv_pthread_lpthread_lmach_lexc=no
13043 fi
13044 rm -f conftest*
13045 else
13046   cat > conftest.$ac_ext <<EOF
13047 #line 13048 "configure"
13048 #include "confdefs.h"
13049 /* pthread test headers */
13050 #include <pthread.h>
13051 #if HAVE_PTHREADS < 7
13052 #include <errno.h>
13053 #endif
13054 #ifndef NULL
13055 #define NULL (void*)0
13056 #endif
13057
13058 static void *task(p)
13059         void *p;
13060 {
13061         return (void *) (p == NULL);
13062 }
13063
13064
13065 int main(argc, argv)
13066         int argc;
13067         char **argv;
13068 {
13069
13070         /* pthread test function */
13071 #ifndef PTHREAD_CREATE_DETACHED
13072 #define PTHREAD_CREATE_DETACHED 1
13073 #endif
13074         pthread_t t;
13075         int status;
13076         int detach = PTHREAD_CREATE_DETACHED;
13077
13078 #if HAVE_PTHREADS > 4
13079         /* Final pthreads */
13080         pthread_attr_t attr;
13081
13082         status = pthread_attr_init(&attr);
13083         if( status ) return status;
13084
13085 #if HAVE_PTHREADS < 7
13086         status = pthread_attr_setdetachstate(&attr, &detach);
13087         if( status < 0 ) status = errno;
13088 #else
13089         status = pthread_attr_setdetachstate(&attr, detach);
13090 #endif
13091         if( status ) return status;
13092         status = pthread_create( &t, &attr, task, NULL );
13093 #if HAVE_PTHREADS < 7
13094         if( status < 0 ) status = errno;
13095 #endif
13096         if( status ) return status;
13097 #else
13098         /* Draft 4 pthreads */
13099         status = pthread_create( &t, pthread_attr_default, task, NULL );
13100         if( status ) return errno;
13101
13102         /* give thread a chance to complete */
13103         /* it should remain joinable and hence detachable */
13104         sleep( 1 );
13105
13106         status = pthread_detach( &t );
13107         if( status ) return errno;
13108 #endif
13109
13110 #ifdef HAVE_LINUX_THREADS
13111         pthread_kill_other_threads_np();
13112 #endif
13113
13114         return 0;
13115
13116 }
13117
13118 EOF
13119 if { (eval echo configure:13120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13120 then
13121   ol_cv_pthread_lpthread_lmach_lexc=yes
13122 else
13123   echo "configure: failed program was:" >&5
13124   cat conftest.$ac_ext >&5
13125   rm -fr conftest*
13126   ol_cv_pthread_lpthread_lmach_lexc=no
13127 fi
13128 rm -fr conftest*
13129 fi
13130
13131
13132                 # restore the LIBS
13133                 LIBS="$ol_LIBS"
13134         
13135 fi
13136
13137 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
13138
13139         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
13140                 ol_link_pthreads="-lpthread -lmach -lexc"
13141                 ol_link_threads=posix
13142         fi
13143 fi
13144
13145
13146                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
13147 if test "$ol_link_threads" = no ; then
13148         # try -lpthread -Wl,-woff,85
13149         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
13150 echo "configure:13151: checking for pthread link with -lpthread -Wl,-woff,85" >&5
13151 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
13152   echo $ac_n "(cached) $ac_c" 1>&6
13153 else
13154   
13155                 # save the flags
13156                 ol_LIBS="$LIBS"
13157                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
13158
13159                 if test "$cross_compiling" = yes; then
13160   cat > conftest.$ac_ext <<EOF
13161 #line 13162 "configure"
13162 #include "confdefs.h"
13163 /* pthread test headers */
13164 #include <pthread.h>
13165 #if HAVE_PTHREADS < 7
13166 #include <errno.h>
13167 #endif
13168 #ifndef NULL
13169 #define NULL (void*)0
13170 #endif
13171
13172 static void *task(p)
13173         void *p;
13174 {
13175         return (void *) (p == NULL);
13176 }
13177
13178 int main() {
13179
13180         /* pthread test function */
13181 #ifndef PTHREAD_CREATE_DETACHED
13182 #define PTHREAD_CREATE_DETACHED 1
13183 #endif
13184         pthread_t t;
13185         int status;
13186         int detach = PTHREAD_CREATE_DETACHED;
13187
13188 #if HAVE_PTHREADS > 4
13189         /* Final pthreads */
13190         pthread_attr_t attr;
13191
13192         status = pthread_attr_init(&attr);
13193         if( status ) return status;
13194
13195 #if HAVE_PTHREADS < 7
13196         status = pthread_attr_setdetachstate(&attr, &detach);
13197         if( status < 0 ) status = errno;
13198 #else
13199         status = pthread_attr_setdetachstate(&attr, detach);
13200 #endif
13201         if( status ) return status;
13202         status = pthread_create( &t, &attr, task, NULL );
13203 #if HAVE_PTHREADS < 7
13204         if( status < 0 ) status = errno;
13205 #endif
13206         if( status ) return status;
13207 #else
13208         /* Draft 4 pthreads */
13209         status = pthread_create( &t, pthread_attr_default, task, NULL );
13210         if( status ) return errno;
13211
13212         /* give thread a chance to complete */
13213         /* it should remain joinable and hence detachable */
13214         sleep( 1 );
13215
13216         status = pthread_detach( &t );
13217         if( status ) return errno;
13218 #endif
13219
13220 #ifdef HAVE_LINUX_THREADS
13221         pthread_kill_other_threads_np();
13222 #endif
13223
13224         return 0;
13225
13226 ; return 0; }
13227 EOF
13228 if { (eval echo configure:13229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13229   rm -rf conftest*
13230   ol_cv_pthread_lib_lpthread_woff=yes
13231 else
13232   echo "configure: failed program was:" >&5
13233   cat conftest.$ac_ext >&5
13234   rm -rf conftest*
13235   ol_cv_pthread_lib_lpthread_woff=no
13236 fi
13237 rm -f conftest*
13238 else
13239   cat > conftest.$ac_ext <<EOF
13240 #line 13241 "configure"
13241 #include "confdefs.h"
13242 /* pthread test headers */
13243 #include <pthread.h>
13244 #if HAVE_PTHREADS < 7
13245 #include <errno.h>
13246 #endif
13247 #ifndef NULL
13248 #define NULL (void*)0
13249 #endif
13250
13251 static void *task(p)
13252         void *p;
13253 {
13254         return (void *) (p == NULL);
13255 }
13256
13257
13258 int main(argc, argv)
13259         int argc;
13260         char **argv;
13261 {
13262
13263         /* pthread test function */
13264 #ifndef PTHREAD_CREATE_DETACHED
13265 #define PTHREAD_CREATE_DETACHED 1
13266 #endif
13267         pthread_t t;
13268         int status;
13269         int detach = PTHREAD_CREATE_DETACHED;
13270
13271 #if HAVE_PTHREADS > 4
13272         /* Final pthreads */
13273         pthread_attr_t attr;
13274
13275         status = pthread_attr_init(&attr);
13276         if( status ) return status;
13277
13278 #if HAVE_PTHREADS < 7
13279         status = pthread_attr_setdetachstate(&attr, &detach);
13280         if( status < 0 ) status = errno;
13281 #else
13282         status = pthread_attr_setdetachstate(&attr, detach);
13283 #endif
13284         if( status ) return status;
13285         status = pthread_create( &t, &attr, task, NULL );
13286 #if HAVE_PTHREADS < 7
13287         if( status < 0 ) status = errno;
13288 #endif
13289         if( status ) return status;
13290 #else
13291         /* Draft 4 pthreads */
13292         status = pthread_create( &t, pthread_attr_default, task, NULL );
13293         if( status ) return errno;
13294
13295         /* give thread a chance to complete */
13296         /* it should remain joinable and hence detachable */
13297         sleep( 1 );
13298
13299         status = pthread_detach( &t );
13300         if( status ) return errno;
13301 #endif
13302
13303 #ifdef HAVE_LINUX_THREADS
13304         pthread_kill_other_threads_np();
13305 #endif
13306
13307         return 0;
13308
13309 }
13310
13311 EOF
13312 if { (eval echo configure:13313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13313 then
13314   ol_cv_pthread_lib_lpthread_woff=yes
13315 else
13316   echo "configure: failed program was:" >&5
13317   cat conftest.$ac_ext >&5
13318   rm -fr conftest*
13319   ol_cv_pthread_lib_lpthread_woff=no
13320 fi
13321 rm -fr conftest*
13322 fi
13323
13324
13325                 # restore the LIBS
13326                 LIBS="$ol_LIBS"
13327         
13328 fi
13329
13330 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
13331
13332         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
13333                 ol_link_pthreads="-lpthread -Wl,-woff,85"
13334                 ol_link_threads=posix
13335         fi
13336 fi
13337
13338
13339                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
13340 if test "$ol_link_threads" = no ; then
13341         # try -lpthread
13342         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
13343 echo "configure:13344: checking for pthread link with -lpthread" >&5
13344 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
13345   echo $ac_n "(cached) $ac_c" 1>&6
13346 else
13347   
13348                 # save the flags
13349                 ol_LIBS="$LIBS"
13350                 LIBS="-lpthread $LIBS"
13351
13352                 if test "$cross_compiling" = yes; then
13353   cat > conftest.$ac_ext <<EOF
13354 #line 13355 "configure"
13355 #include "confdefs.h"
13356 /* pthread test headers */
13357 #include <pthread.h>
13358 #if HAVE_PTHREADS < 7
13359 #include <errno.h>
13360 #endif
13361 #ifndef NULL
13362 #define NULL (void*)0
13363 #endif
13364
13365 static void *task(p)
13366         void *p;
13367 {
13368         return (void *) (p == NULL);
13369 }
13370
13371 int main() {
13372
13373         /* pthread test function */
13374 #ifndef PTHREAD_CREATE_DETACHED
13375 #define PTHREAD_CREATE_DETACHED 1
13376 #endif
13377         pthread_t t;
13378         int status;
13379         int detach = PTHREAD_CREATE_DETACHED;
13380
13381 #if HAVE_PTHREADS > 4
13382         /* Final pthreads */
13383         pthread_attr_t attr;
13384
13385         status = pthread_attr_init(&attr);
13386         if( status ) return status;
13387
13388 #if HAVE_PTHREADS < 7
13389         status = pthread_attr_setdetachstate(&attr, &detach);
13390         if( status < 0 ) status = errno;
13391 #else
13392         status = pthread_attr_setdetachstate(&attr, detach);
13393 #endif
13394         if( status ) return status;
13395         status = pthread_create( &t, &attr, task, NULL );
13396 #if HAVE_PTHREADS < 7
13397         if( status < 0 ) status = errno;
13398 #endif
13399         if( status ) return status;
13400 #else
13401         /* Draft 4 pthreads */
13402         status = pthread_create( &t, pthread_attr_default, task, NULL );
13403         if( status ) return errno;
13404
13405         /* give thread a chance to complete */
13406         /* it should remain joinable and hence detachable */
13407         sleep( 1 );
13408
13409         status = pthread_detach( &t );
13410         if( status ) return errno;
13411 #endif
13412
13413 #ifdef HAVE_LINUX_THREADS
13414         pthread_kill_other_threads_np();
13415 #endif
13416
13417         return 0;
13418
13419 ; return 0; }
13420 EOF
13421 if { (eval echo configure:13422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13422   rm -rf conftest*
13423   ol_cv_pthread_lpthread=yes
13424 else
13425   echo "configure: failed program was:" >&5
13426   cat conftest.$ac_ext >&5
13427   rm -rf conftest*
13428   ol_cv_pthread_lpthread=no
13429 fi
13430 rm -f conftest*
13431 else
13432   cat > conftest.$ac_ext <<EOF
13433 #line 13434 "configure"
13434 #include "confdefs.h"
13435 /* pthread test headers */
13436 #include <pthread.h>
13437 #if HAVE_PTHREADS < 7
13438 #include <errno.h>
13439 #endif
13440 #ifndef NULL
13441 #define NULL (void*)0
13442 #endif
13443
13444 static void *task(p)
13445         void *p;
13446 {
13447         return (void *) (p == NULL);
13448 }
13449
13450
13451 int main(argc, argv)
13452         int argc;
13453         char **argv;
13454 {
13455
13456         /* pthread test function */
13457 #ifndef PTHREAD_CREATE_DETACHED
13458 #define PTHREAD_CREATE_DETACHED 1
13459 #endif
13460         pthread_t t;
13461         int status;
13462         int detach = PTHREAD_CREATE_DETACHED;
13463
13464 #if HAVE_PTHREADS > 4
13465         /* Final pthreads */
13466         pthread_attr_t attr;
13467
13468         status = pthread_attr_init(&attr);
13469         if( status ) return status;
13470
13471 #if HAVE_PTHREADS < 7
13472         status = pthread_attr_setdetachstate(&attr, &detach);
13473         if( status < 0 ) status = errno;
13474 #else
13475         status = pthread_attr_setdetachstate(&attr, detach);
13476 #endif
13477         if( status ) return status;
13478         status = pthread_create( &t, &attr, task, NULL );
13479 #if HAVE_PTHREADS < 7
13480         if( status < 0 ) status = errno;
13481 #endif
13482         if( status ) return status;
13483 #else
13484         /* Draft 4 pthreads */
13485         status = pthread_create( &t, pthread_attr_default, task, NULL );
13486         if( status ) return errno;
13487
13488         /* give thread a chance to complete */
13489         /* it should remain joinable and hence detachable */
13490         sleep( 1 );
13491
13492         status = pthread_detach( &t );
13493         if( status ) return errno;
13494 #endif
13495
13496 #ifdef HAVE_LINUX_THREADS
13497         pthread_kill_other_threads_np();
13498 #endif
13499
13500         return 0;
13501
13502 }
13503
13504 EOF
13505 if { (eval echo configure:13506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13506 then
13507   ol_cv_pthread_lpthread=yes
13508 else
13509   echo "configure: failed program was:" >&5
13510   cat conftest.$ac_ext >&5
13511   rm -fr conftest*
13512   ol_cv_pthread_lpthread=no
13513 fi
13514 rm -fr conftest*
13515 fi
13516
13517
13518                 # restore the LIBS
13519                 LIBS="$ol_LIBS"
13520         
13521 fi
13522
13523 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
13524
13525         if test $ol_cv_pthread_lpthread = yes ; then
13526                 ol_link_pthreads="-lpthread"
13527                 ol_link_threads=posix
13528         fi
13529 fi
13530
13531                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
13532 if test "$ol_link_threads" = no ; then
13533         # try -lc_r
13534         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
13535 echo "configure:13536: checking for pthread link with -lc_r" >&5
13536 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
13537   echo $ac_n "(cached) $ac_c" 1>&6
13538 else
13539   
13540                 # save the flags
13541                 ol_LIBS="$LIBS"
13542                 LIBS="-lc_r $LIBS"
13543
13544                 if test "$cross_compiling" = yes; then
13545   cat > conftest.$ac_ext <<EOF
13546 #line 13547 "configure"
13547 #include "confdefs.h"
13548 /* pthread test headers */
13549 #include <pthread.h>
13550 #if HAVE_PTHREADS < 7
13551 #include <errno.h>
13552 #endif
13553 #ifndef NULL
13554 #define NULL (void*)0
13555 #endif
13556
13557 static void *task(p)
13558         void *p;
13559 {
13560         return (void *) (p == NULL);
13561 }
13562
13563 int main() {
13564
13565         /* pthread test function */
13566 #ifndef PTHREAD_CREATE_DETACHED
13567 #define PTHREAD_CREATE_DETACHED 1
13568 #endif
13569         pthread_t t;
13570         int status;
13571         int detach = PTHREAD_CREATE_DETACHED;
13572
13573 #if HAVE_PTHREADS > 4
13574         /* Final pthreads */
13575         pthread_attr_t attr;
13576
13577         status = pthread_attr_init(&attr);
13578         if( status ) return status;
13579
13580 #if HAVE_PTHREADS < 7
13581         status = pthread_attr_setdetachstate(&attr, &detach);
13582         if( status < 0 ) status = errno;
13583 #else
13584         status = pthread_attr_setdetachstate(&attr, detach);
13585 #endif
13586         if( status ) return status;
13587         status = pthread_create( &t, &attr, task, NULL );
13588 #if HAVE_PTHREADS < 7
13589         if( status < 0 ) status = errno;
13590 #endif
13591         if( status ) return status;
13592 #else
13593         /* Draft 4 pthreads */
13594         status = pthread_create( &t, pthread_attr_default, task, NULL );
13595         if( status ) return errno;
13596
13597         /* give thread a chance to complete */
13598         /* it should remain joinable and hence detachable */
13599         sleep( 1 );
13600
13601         status = pthread_detach( &t );
13602         if( status ) return errno;
13603 #endif
13604
13605 #ifdef HAVE_LINUX_THREADS
13606         pthread_kill_other_threads_np();
13607 #endif
13608
13609         return 0;
13610
13611 ; return 0; }
13612 EOF
13613 if { (eval echo configure:13614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13614   rm -rf conftest*
13615   ol_cv_pthread_lc_r=yes
13616 else
13617   echo "configure: failed program was:" >&5
13618   cat conftest.$ac_ext >&5
13619   rm -rf conftest*
13620   ol_cv_pthread_lc_r=no
13621 fi
13622 rm -f conftest*
13623 else
13624   cat > conftest.$ac_ext <<EOF
13625 #line 13626 "configure"
13626 #include "confdefs.h"
13627 /* pthread test headers */
13628 #include <pthread.h>
13629 #if HAVE_PTHREADS < 7
13630 #include <errno.h>
13631 #endif
13632 #ifndef NULL
13633 #define NULL (void*)0
13634 #endif
13635
13636 static void *task(p)
13637         void *p;
13638 {
13639         return (void *) (p == NULL);
13640 }
13641
13642
13643 int main(argc, argv)
13644         int argc;
13645         char **argv;
13646 {
13647
13648         /* pthread test function */
13649 #ifndef PTHREAD_CREATE_DETACHED
13650 #define PTHREAD_CREATE_DETACHED 1
13651 #endif
13652         pthread_t t;
13653         int status;
13654         int detach = PTHREAD_CREATE_DETACHED;
13655
13656 #if HAVE_PTHREADS > 4
13657         /* Final pthreads */
13658         pthread_attr_t attr;
13659
13660         status = pthread_attr_init(&attr);
13661         if( status ) return status;
13662
13663 #if HAVE_PTHREADS < 7
13664         status = pthread_attr_setdetachstate(&attr, &detach);
13665         if( status < 0 ) status = errno;
13666 #else
13667         status = pthread_attr_setdetachstate(&attr, detach);
13668 #endif
13669         if( status ) return status;
13670         status = pthread_create( &t, &attr, task, NULL );
13671 #if HAVE_PTHREADS < 7
13672         if( status < 0 ) status = errno;
13673 #endif
13674         if( status ) return status;
13675 #else
13676         /* Draft 4 pthreads */
13677         status = pthread_create( &t, pthread_attr_default, task, NULL );
13678         if( status ) return errno;
13679
13680         /* give thread a chance to complete */
13681         /* it should remain joinable and hence detachable */
13682         sleep( 1 );
13683
13684         status = pthread_detach( &t );
13685         if( status ) return errno;
13686 #endif
13687
13688 #ifdef HAVE_LINUX_THREADS
13689         pthread_kill_other_threads_np();
13690 #endif
13691
13692         return 0;
13693
13694 }
13695
13696 EOF
13697 if { (eval echo configure:13698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13698 then
13699   ol_cv_pthread_lc_r=yes
13700 else
13701   echo "configure: failed program was:" >&5
13702   cat conftest.$ac_ext >&5
13703   rm -fr conftest*
13704   ol_cv_pthread_lc_r=no
13705 fi
13706 rm -fr conftest*
13707 fi
13708
13709
13710                 # restore the LIBS
13711                 LIBS="$ol_LIBS"
13712         
13713 fi
13714
13715 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
13716
13717         if test $ol_cv_pthread_lc_r = yes ; then
13718                 ol_link_pthreads="-lc_r"
13719                 ol_link_threads=posix
13720         fi
13721 fi
13722
13723
13724                 # Pthread try link: -threads (ol_cv_pthread_threads)
13725 if test "$ol_link_threads" = no ; then
13726         # try -threads
13727         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
13728 echo "configure:13729: checking for pthread link with -threads" >&5
13729 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
13730   echo $ac_n "(cached) $ac_c" 1>&6
13731 else
13732   
13733                 # save the flags
13734                 ol_LIBS="$LIBS"
13735                 LIBS="-threads $LIBS"
13736
13737                 if test "$cross_compiling" = yes; then
13738   cat > conftest.$ac_ext <<EOF
13739 #line 13740 "configure"
13740 #include "confdefs.h"
13741 /* pthread test headers */
13742 #include <pthread.h>
13743 #if HAVE_PTHREADS < 7
13744 #include <errno.h>
13745 #endif
13746 #ifndef NULL
13747 #define NULL (void*)0
13748 #endif
13749
13750 static void *task(p)
13751         void *p;
13752 {
13753         return (void *) (p == NULL);
13754 }
13755
13756 int main() {
13757
13758         /* pthread test function */
13759 #ifndef PTHREAD_CREATE_DETACHED
13760 #define PTHREAD_CREATE_DETACHED 1
13761 #endif
13762         pthread_t t;
13763         int status;
13764         int detach = PTHREAD_CREATE_DETACHED;
13765
13766 #if HAVE_PTHREADS > 4
13767         /* Final pthreads */
13768         pthread_attr_t attr;
13769
13770         status = pthread_attr_init(&attr);
13771         if( status ) return status;
13772
13773 #if HAVE_PTHREADS < 7
13774         status = pthread_attr_setdetachstate(&attr, &detach);
13775         if( status < 0 ) status = errno;
13776 #else
13777         status = pthread_attr_setdetachstate(&attr, detach);
13778 #endif
13779         if( status ) return status;
13780         status = pthread_create( &t, &attr, task, NULL );
13781 #if HAVE_PTHREADS < 7
13782         if( status < 0 ) status = errno;
13783 #endif
13784         if( status ) return status;
13785 #else
13786         /* Draft 4 pthreads */
13787         status = pthread_create( &t, pthread_attr_default, task, NULL );
13788         if( status ) return errno;
13789
13790         /* give thread a chance to complete */
13791         /* it should remain joinable and hence detachable */
13792         sleep( 1 );
13793
13794         status = pthread_detach( &t );
13795         if( status ) return errno;
13796 #endif
13797
13798 #ifdef HAVE_LINUX_THREADS
13799         pthread_kill_other_threads_np();
13800 #endif
13801
13802         return 0;
13803
13804 ; return 0; }
13805 EOF
13806 if { (eval echo configure:13807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13807   rm -rf conftest*
13808   ol_cv_pthread_threads=yes
13809 else
13810   echo "configure: failed program was:" >&5
13811   cat conftest.$ac_ext >&5
13812   rm -rf conftest*
13813   ol_cv_pthread_threads=no
13814 fi
13815 rm -f conftest*
13816 else
13817   cat > conftest.$ac_ext <<EOF
13818 #line 13819 "configure"
13819 #include "confdefs.h"
13820 /* pthread test headers */
13821 #include <pthread.h>
13822 #if HAVE_PTHREADS < 7
13823 #include <errno.h>
13824 #endif
13825 #ifndef NULL
13826 #define NULL (void*)0
13827 #endif
13828
13829 static void *task(p)
13830         void *p;
13831 {
13832         return (void *) (p == NULL);
13833 }
13834
13835
13836 int main(argc, argv)
13837         int argc;
13838         char **argv;
13839 {
13840
13841         /* pthread test function */
13842 #ifndef PTHREAD_CREATE_DETACHED
13843 #define PTHREAD_CREATE_DETACHED 1
13844 #endif
13845         pthread_t t;
13846         int status;
13847         int detach = PTHREAD_CREATE_DETACHED;
13848
13849 #if HAVE_PTHREADS > 4
13850         /* Final pthreads */
13851         pthread_attr_t attr;
13852
13853         status = pthread_attr_init(&attr);
13854         if( status ) return status;
13855
13856 #if HAVE_PTHREADS < 7
13857         status = pthread_attr_setdetachstate(&attr, &detach);
13858         if( status < 0 ) status = errno;
13859 #else
13860         status = pthread_attr_setdetachstate(&attr, detach);
13861 #endif
13862         if( status ) return status;
13863         status = pthread_create( &t, &attr, task, NULL );
13864 #if HAVE_PTHREADS < 7
13865         if( status < 0 ) status = errno;
13866 #endif
13867         if( status ) return status;
13868 #else
13869         /* Draft 4 pthreads */
13870         status = pthread_create( &t, pthread_attr_default, task, NULL );
13871         if( status ) return errno;
13872
13873         /* give thread a chance to complete */
13874         /* it should remain joinable and hence detachable */
13875         sleep( 1 );
13876
13877         status = pthread_detach( &t );
13878         if( status ) return errno;
13879 #endif
13880
13881 #ifdef HAVE_LINUX_THREADS
13882         pthread_kill_other_threads_np();
13883 #endif
13884
13885         return 0;
13886
13887 }
13888
13889 EOF
13890 if { (eval echo configure:13891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13891 then
13892   ol_cv_pthread_threads=yes
13893 else
13894   echo "configure: failed program was:" >&5
13895   cat conftest.$ac_ext >&5
13896   rm -fr conftest*
13897   ol_cv_pthread_threads=no
13898 fi
13899 rm -fr conftest*
13900 fi
13901
13902
13903                 # restore the LIBS
13904                 LIBS="$ol_LIBS"
13905         
13906 fi
13907
13908 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
13909
13910         if test $ol_cv_pthread_threads = yes ; then
13911                 ol_link_pthreads="-threads"
13912                 ol_link_threads=posix
13913         fi
13914 fi
13915
13916
13917                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
13918 if test "$ol_link_threads" = no ; then
13919         # try -lpthreads -lmach -lexc -lc_r
13920         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
13921 echo "configure:13922: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
13922 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
13923   echo $ac_n "(cached) $ac_c" 1>&6
13924 else
13925   
13926                 # save the flags
13927                 ol_LIBS="$LIBS"
13928                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
13929
13930                 if test "$cross_compiling" = yes; then
13931   cat > conftest.$ac_ext <<EOF
13932 #line 13933 "configure"
13933 #include "confdefs.h"
13934 /* pthread test headers */
13935 #include <pthread.h>
13936 #if HAVE_PTHREADS < 7
13937 #include <errno.h>
13938 #endif
13939 #ifndef NULL
13940 #define NULL (void*)0
13941 #endif
13942
13943 static void *task(p)
13944         void *p;
13945 {
13946         return (void *) (p == NULL);
13947 }
13948
13949 int main() {
13950
13951         /* pthread test function */
13952 #ifndef PTHREAD_CREATE_DETACHED
13953 #define PTHREAD_CREATE_DETACHED 1
13954 #endif
13955         pthread_t t;
13956         int status;
13957         int detach = PTHREAD_CREATE_DETACHED;
13958
13959 #if HAVE_PTHREADS > 4
13960         /* Final pthreads */
13961         pthread_attr_t attr;
13962
13963         status = pthread_attr_init(&attr);
13964         if( status ) return status;
13965
13966 #if HAVE_PTHREADS < 7
13967         status = pthread_attr_setdetachstate(&attr, &detach);
13968         if( status < 0 ) status = errno;
13969 #else
13970         status = pthread_attr_setdetachstate(&attr, detach);
13971 #endif
13972         if( status ) return status;
13973         status = pthread_create( &t, &attr, task, NULL );
13974 #if HAVE_PTHREADS < 7
13975         if( status < 0 ) status = errno;
13976 #endif
13977         if( status ) return status;
13978 #else
13979         /* Draft 4 pthreads */
13980         status = pthread_create( &t, pthread_attr_default, task, NULL );
13981         if( status ) return errno;
13982
13983         /* give thread a chance to complete */
13984         /* it should remain joinable and hence detachable */
13985         sleep( 1 );
13986
13987         status = pthread_detach( &t );
13988         if( status ) return errno;
13989 #endif
13990
13991 #ifdef HAVE_LINUX_THREADS
13992         pthread_kill_other_threads_np();
13993 #endif
13994
13995         return 0;
13996
13997 ; return 0; }
13998 EOF
13999 if { (eval echo configure:14000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14000   rm -rf conftest*
14001   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
14002 else
14003   echo "configure: failed program was:" >&5
14004   cat conftest.$ac_ext >&5
14005   rm -rf conftest*
14006   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
14007 fi
14008 rm -f conftest*
14009 else
14010   cat > conftest.$ac_ext <<EOF
14011 #line 14012 "configure"
14012 #include "confdefs.h"
14013 /* pthread test headers */
14014 #include <pthread.h>
14015 #if HAVE_PTHREADS < 7
14016 #include <errno.h>
14017 #endif
14018 #ifndef NULL
14019 #define NULL (void*)0
14020 #endif
14021
14022 static void *task(p)
14023         void *p;
14024 {
14025         return (void *) (p == NULL);
14026 }
14027
14028
14029 int main(argc, argv)
14030         int argc;
14031         char **argv;
14032 {
14033
14034         /* pthread test function */
14035 #ifndef PTHREAD_CREATE_DETACHED
14036 #define PTHREAD_CREATE_DETACHED 1
14037 #endif
14038         pthread_t t;
14039         int status;
14040         int detach = PTHREAD_CREATE_DETACHED;
14041
14042 #if HAVE_PTHREADS > 4
14043         /* Final pthreads */
14044         pthread_attr_t attr;
14045
14046         status = pthread_attr_init(&attr);
14047         if( status ) return status;
14048
14049 #if HAVE_PTHREADS < 7
14050         status = pthread_attr_setdetachstate(&attr, &detach);
14051         if( status < 0 ) status = errno;
14052 #else
14053         status = pthread_attr_setdetachstate(&attr, detach);
14054 #endif
14055         if( status ) return status;
14056         status = pthread_create( &t, &attr, task, NULL );
14057 #if HAVE_PTHREADS < 7
14058         if( status < 0 ) status = errno;
14059 #endif
14060         if( status ) return status;
14061 #else
14062         /* Draft 4 pthreads */
14063         status = pthread_create( &t, pthread_attr_default, task, NULL );
14064         if( status ) return errno;
14065
14066         /* give thread a chance to complete */
14067         /* it should remain joinable and hence detachable */
14068         sleep( 1 );
14069
14070         status = pthread_detach( &t );
14071         if( status ) return errno;
14072 #endif
14073
14074 #ifdef HAVE_LINUX_THREADS
14075         pthread_kill_other_threads_np();
14076 #endif
14077
14078         return 0;
14079
14080 }
14081
14082 EOF
14083 if { (eval echo configure:14084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14084 then
14085   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
14086 else
14087   echo "configure: failed program was:" >&5
14088   cat conftest.$ac_ext >&5
14089   rm -fr conftest*
14090   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
14091 fi
14092 rm -fr conftest*
14093 fi
14094
14095
14096                 # restore the LIBS
14097                 LIBS="$ol_LIBS"
14098         
14099 fi
14100
14101 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
14102
14103         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
14104                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
14105                 ol_link_threads=posix
14106         fi
14107 fi
14108
14109                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
14110 if test "$ol_link_threads" = no ; then
14111         # try -lpthreads -lmach -lexc
14112         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
14113 echo "configure:14114: checking for pthread link with -lpthreads -lmach -lexc" >&5
14114 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
14115   echo $ac_n "(cached) $ac_c" 1>&6
14116 else
14117   
14118                 # save the flags
14119                 ol_LIBS="$LIBS"
14120                 LIBS="-lpthreads -lmach -lexc $LIBS"
14121
14122                 if test "$cross_compiling" = yes; then
14123   cat > conftest.$ac_ext <<EOF
14124 #line 14125 "configure"
14125 #include "confdefs.h"
14126 /* pthread test headers */
14127 #include <pthread.h>
14128 #if HAVE_PTHREADS < 7
14129 #include <errno.h>
14130 #endif
14131 #ifndef NULL
14132 #define NULL (void*)0
14133 #endif
14134
14135 static void *task(p)
14136         void *p;
14137 {
14138         return (void *) (p == NULL);
14139 }
14140
14141 int main() {
14142
14143         /* pthread test function */
14144 #ifndef PTHREAD_CREATE_DETACHED
14145 #define PTHREAD_CREATE_DETACHED 1
14146 #endif
14147         pthread_t t;
14148         int status;
14149         int detach = PTHREAD_CREATE_DETACHED;
14150
14151 #if HAVE_PTHREADS > 4
14152         /* Final pthreads */
14153         pthread_attr_t attr;
14154
14155         status = pthread_attr_init(&attr);
14156         if( status ) return status;
14157
14158 #if HAVE_PTHREADS < 7
14159         status = pthread_attr_setdetachstate(&attr, &detach);
14160         if( status < 0 ) status = errno;
14161 #else
14162         status = pthread_attr_setdetachstate(&attr, detach);
14163 #endif
14164         if( status ) return status;
14165         status = pthread_create( &t, &attr, task, NULL );
14166 #if HAVE_PTHREADS < 7
14167         if( status < 0 ) status = errno;
14168 #endif
14169         if( status ) return status;
14170 #else
14171         /* Draft 4 pthreads */
14172         status = pthread_create( &t, pthread_attr_default, task, NULL );
14173         if( status ) return errno;
14174
14175         /* give thread a chance to complete */
14176         /* it should remain joinable and hence detachable */
14177         sleep( 1 );
14178
14179         status = pthread_detach( &t );
14180         if( status ) return errno;
14181 #endif
14182
14183 #ifdef HAVE_LINUX_THREADS
14184         pthread_kill_other_threads_np();
14185 #endif
14186
14187         return 0;
14188
14189 ; return 0; }
14190 EOF
14191 if { (eval echo configure:14192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14192   rm -rf conftest*
14193   ol_cv_pthread_lpthreads_lmach_lexc=yes
14194 else
14195   echo "configure: failed program was:" >&5
14196   cat conftest.$ac_ext >&5
14197   rm -rf conftest*
14198   ol_cv_pthread_lpthreads_lmach_lexc=no
14199 fi
14200 rm -f conftest*
14201 else
14202   cat > conftest.$ac_ext <<EOF
14203 #line 14204 "configure"
14204 #include "confdefs.h"
14205 /* pthread test headers */
14206 #include <pthread.h>
14207 #if HAVE_PTHREADS < 7
14208 #include <errno.h>
14209 #endif
14210 #ifndef NULL
14211 #define NULL (void*)0
14212 #endif
14213
14214 static void *task(p)
14215         void *p;
14216 {
14217         return (void *) (p == NULL);
14218 }
14219
14220
14221 int main(argc, argv)
14222         int argc;
14223         char **argv;
14224 {
14225
14226         /* pthread test function */
14227 #ifndef PTHREAD_CREATE_DETACHED
14228 #define PTHREAD_CREATE_DETACHED 1
14229 #endif
14230         pthread_t t;
14231         int status;
14232         int detach = PTHREAD_CREATE_DETACHED;
14233
14234 #if HAVE_PTHREADS > 4
14235         /* Final pthreads */
14236         pthread_attr_t attr;
14237
14238         status = pthread_attr_init(&attr);
14239         if( status ) return status;
14240
14241 #if HAVE_PTHREADS < 7
14242         status = pthread_attr_setdetachstate(&attr, &detach);
14243         if( status < 0 ) status = errno;
14244 #else
14245         status = pthread_attr_setdetachstate(&attr, detach);
14246 #endif
14247         if( status ) return status;
14248         status = pthread_create( &t, &attr, task, NULL );
14249 #if HAVE_PTHREADS < 7
14250         if( status < 0 ) status = errno;
14251 #endif
14252         if( status ) return status;
14253 #else
14254         /* Draft 4 pthreads */
14255         status = pthread_create( &t, pthread_attr_default, task, NULL );
14256         if( status ) return errno;
14257
14258         /* give thread a chance to complete */
14259         /* it should remain joinable and hence detachable */
14260         sleep( 1 );
14261
14262         status = pthread_detach( &t );
14263         if( status ) return errno;
14264 #endif
14265
14266 #ifdef HAVE_LINUX_THREADS
14267         pthread_kill_other_threads_np();
14268 #endif
14269
14270         return 0;
14271
14272 }
14273
14274 EOF
14275 if { (eval echo configure:14276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14276 then
14277   ol_cv_pthread_lpthreads_lmach_lexc=yes
14278 else
14279   echo "configure: failed program was:" >&5
14280   cat conftest.$ac_ext >&5
14281   rm -fr conftest*
14282   ol_cv_pthread_lpthreads_lmach_lexc=no
14283 fi
14284 rm -fr conftest*
14285 fi
14286
14287
14288                 # restore the LIBS
14289                 LIBS="$ol_LIBS"
14290         
14291 fi
14292
14293 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
14294
14295         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
14296                 ol_link_pthreads="-lpthreads -lmach -lexc"
14297                 ol_link_threads=posix
14298         fi
14299 fi
14300
14301                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
14302 if test "$ol_link_threads" = no ; then
14303         # try -lpthreads -lexc
14304         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
14305 echo "configure:14306: checking for pthread link with -lpthreads -lexc" >&5
14306 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
14307   echo $ac_n "(cached) $ac_c" 1>&6
14308 else
14309   
14310                 # save the flags
14311                 ol_LIBS="$LIBS"
14312                 LIBS="-lpthreads -lexc $LIBS"
14313
14314                 if test "$cross_compiling" = yes; then
14315   cat > conftest.$ac_ext <<EOF
14316 #line 14317 "configure"
14317 #include "confdefs.h"
14318 /* pthread test headers */
14319 #include <pthread.h>
14320 #if HAVE_PTHREADS < 7
14321 #include <errno.h>
14322 #endif
14323 #ifndef NULL
14324 #define NULL (void*)0
14325 #endif
14326
14327 static void *task(p)
14328         void *p;
14329 {
14330         return (void *) (p == NULL);
14331 }
14332
14333 int main() {
14334
14335         /* pthread test function */
14336 #ifndef PTHREAD_CREATE_DETACHED
14337 #define PTHREAD_CREATE_DETACHED 1
14338 #endif
14339         pthread_t t;
14340         int status;
14341         int detach = PTHREAD_CREATE_DETACHED;
14342
14343 #if HAVE_PTHREADS > 4
14344         /* Final pthreads */
14345         pthread_attr_t attr;
14346
14347         status = pthread_attr_init(&attr);
14348         if( status ) return status;
14349
14350 #if HAVE_PTHREADS < 7
14351         status = pthread_attr_setdetachstate(&attr, &detach);
14352         if( status < 0 ) status = errno;
14353 #else
14354         status = pthread_attr_setdetachstate(&attr, detach);
14355 #endif
14356         if( status ) return status;
14357         status = pthread_create( &t, &attr, task, NULL );
14358 #if HAVE_PTHREADS < 7
14359         if( status < 0 ) status = errno;
14360 #endif
14361         if( status ) return status;
14362 #else
14363         /* Draft 4 pthreads */
14364         status = pthread_create( &t, pthread_attr_default, task, NULL );
14365         if( status ) return errno;
14366
14367         /* give thread a chance to complete */
14368         /* it should remain joinable and hence detachable */
14369         sleep( 1 );
14370
14371         status = pthread_detach( &t );
14372         if( status ) return errno;
14373 #endif
14374
14375 #ifdef HAVE_LINUX_THREADS
14376         pthread_kill_other_threads_np();
14377 #endif
14378
14379         return 0;
14380
14381 ; return 0; }
14382 EOF
14383 if { (eval echo configure:14384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14384   rm -rf conftest*
14385   ol_cv_pthread_lpthreads_lexc=yes
14386 else
14387   echo "configure: failed program was:" >&5
14388   cat conftest.$ac_ext >&5
14389   rm -rf conftest*
14390   ol_cv_pthread_lpthreads_lexc=no
14391 fi
14392 rm -f conftest*
14393 else
14394   cat > conftest.$ac_ext <<EOF
14395 #line 14396 "configure"
14396 #include "confdefs.h"
14397 /* pthread test headers */
14398 #include <pthread.h>
14399 #if HAVE_PTHREADS < 7
14400 #include <errno.h>
14401 #endif
14402 #ifndef NULL
14403 #define NULL (void*)0
14404 #endif
14405
14406 static void *task(p)
14407         void *p;
14408 {
14409         return (void *) (p == NULL);
14410 }
14411
14412
14413 int main(argc, argv)
14414         int argc;
14415         char **argv;
14416 {
14417
14418         /* pthread test function */
14419 #ifndef PTHREAD_CREATE_DETACHED
14420 #define PTHREAD_CREATE_DETACHED 1
14421 #endif
14422         pthread_t t;
14423         int status;
14424         int detach = PTHREAD_CREATE_DETACHED;
14425
14426 #if HAVE_PTHREADS > 4
14427         /* Final pthreads */
14428         pthread_attr_t attr;
14429
14430         status = pthread_attr_init(&attr);
14431         if( status ) return status;
14432
14433 #if HAVE_PTHREADS < 7
14434         status = pthread_attr_setdetachstate(&attr, &detach);
14435         if( status < 0 ) status = errno;
14436 #else
14437         status = pthread_attr_setdetachstate(&attr, detach);
14438 #endif
14439         if( status ) return status;
14440         status = pthread_create( &t, &attr, task, NULL );
14441 #if HAVE_PTHREADS < 7
14442         if( status < 0 ) status = errno;
14443 #endif
14444         if( status ) return status;
14445 #else
14446         /* Draft 4 pthreads */
14447         status = pthread_create( &t, pthread_attr_default, task, NULL );
14448         if( status ) return errno;
14449
14450         /* give thread a chance to complete */
14451         /* it should remain joinable and hence detachable */
14452         sleep( 1 );
14453
14454         status = pthread_detach( &t );
14455         if( status ) return errno;
14456 #endif
14457
14458 #ifdef HAVE_LINUX_THREADS
14459         pthread_kill_other_threads_np();
14460 #endif
14461
14462         return 0;
14463
14464 }
14465
14466 EOF
14467 if { (eval echo configure:14468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14468 then
14469   ol_cv_pthread_lpthreads_lexc=yes
14470 else
14471   echo "configure: failed program was:" >&5
14472   cat conftest.$ac_ext >&5
14473   rm -fr conftest*
14474   ol_cv_pthread_lpthreads_lexc=no
14475 fi
14476 rm -fr conftest*
14477 fi
14478
14479
14480                 # restore the LIBS
14481                 LIBS="$ol_LIBS"
14482         
14483 fi
14484
14485 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
14486
14487         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
14488                 ol_link_pthreads="-lpthreads -lexc"
14489                 ol_link_threads=posix
14490         fi
14491 fi
14492
14493
14494                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
14495 if test "$ol_link_threads" = no ; then
14496         # try -lpthreads
14497         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
14498 echo "configure:14499: checking for pthread link with -lpthreads" >&5
14499 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
14500   echo $ac_n "(cached) $ac_c" 1>&6
14501 else
14502   
14503                 # save the flags
14504                 ol_LIBS="$LIBS"
14505                 LIBS="-lpthreads $LIBS"
14506
14507                 if test "$cross_compiling" = yes; then
14508   cat > conftest.$ac_ext <<EOF
14509 #line 14510 "configure"
14510 #include "confdefs.h"
14511 /* pthread test headers */
14512 #include <pthread.h>
14513 #if HAVE_PTHREADS < 7
14514 #include <errno.h>
14515 #endif
14516 #ifndef NULL
14517 #define NULL (void*)0
14518 #endif
14519
14520 static void *task(p)
14521         void *p;
14522 {
14523         return (void *) (p == NULL);
14524 }
14525
14526 int main() {
14527
14528         /* pthread test function */
14529 #ifndef PTHREAD_CREATE_DETACHED
14530 #define PTHREAD_CREATE_DETACHED 1
14531 #endif
14532         pthread_t t;
14533         int status;
14534         int detach = PTHREAD_CREATE_DETACHED;
14535
14536 #if HAVE_PTHREADS > 4
14537         /* Final pthreads */
14538         pthread_attr_t attr;
14539
14540         status = pthread_attr_init(&attr);
14541         if( status ) return status;
14542
14543 #if HAVE_PTHREADS < 7
14544         status = pthread_attr_setdetachstate(&attr, &detach);
14545         if( status < 0 ) status = errno;
14546 #else
14547         status = pthread_attr_setdetachstate(&attr, detach);
14548 #endif
14549         if( status ) return status;
14550         status = pthread_create( &t, &attr, task, NULL );
14551 #if HAVE_PTHREADS < 7
14552         if( status < 0 ) status = errno;
14553 #endif
14554         if( status ) return status;
14555 #else
14556         /* Draft 4 pthreads */
14557         status = pthread_create( &t, pthread_attr_default, task, NULL );
14558         if( status ) return errno;
14559
14560         /* give thread a chance to complete */
14561         /* it should remain joinable and hence detachable */
14562         sleep( 1 );
14563
14564         status = pthread_detach( &t );
14565         if( status ) return errno;
14566 #endif
14567
14568 #ifdef HAVE_LINUX_THREADS
14569         pthread_kill_other_threads_np();
14570 #endif
14571
14572         return 0;
14573
14574 ; return 0; }
14575 EOF
14576 if { (eval echo configure:14577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14577   rm -rf conftest*
14578   ol_cv_pthread_lib_lpthreads=yes
14579 else
14580   echo "configure: failed program was:" >&5
14581   cat conftest.$ac_ext >&5
14582   rm -rf conftest*
14583   ol_cv_pthread_lib_lpthreads=no
14584 fi
14585 rm -f conftest*
14586 else
14587   cat > conftest.$ac_ext <<EOF
14588 #line 14589 "configure"
14589 #include "confdefs.h"
14590 /* pthread test headers */
14591 #include <pthread.h>
14592 #if HAVE_PTHREADS < 7
14593 #include <errno.h>
14594 #endif
14595 #ifndef NULL
14596 #define NULL (void*)0
14597 #endif
14598
14599 static void *task(p)
14600         void *p;
14601 {
14602         return (void *) (p == NULL);
14603 }
14604
14605
14606 int main(argc, argv)
14607         int argc;
14608         char **argv;
14609 {
14610
14611         /* pthread test function */
14612 #ifndef PTHREAD_CREATE_DETACHED
14613 #define PTHREAD_CREATE_DETACHED 1
14614 #endif
14615         pthread_t t;
14616         int status;
14617         int detach = PTHREAD_CREATE_DETACHED;
14618
14619 #if HAVE_PTHREADS > 4
14620         /* Final pthreads */
14621         pthread_attr_t attr;
14622
14623         status = pthread_attr_init(&attr);
14624         if( status ) return status;
14625
14626 #if HAVE_PTHREADS < 7
14627         status = pthread_attr_setdetachstate(&attr, &detach);
14628         if( status < 0 ) status = errno;
14629 #else
14630         status = pthread_attr_setdetachstate(&attr, detach);
14631 #endif
14632         if( status ) return status;
14633         status = pthread_create( &t, &attr, task, NULL );
14634 #if HAVE_PTHREADS < 7
14635         if( status < 0 ) status = errno;
14636 #endif
14637         if( status ) return status;
14638 #else
14639         /* Draft 4 pthreads */
14640         status = pthread_create( &t, pthread_attr_default, task, NULL );
14641         if( status ) return errno;
14642
14643         /* give thread a chance to complete */
14644         /* it should remain joinable and hence detachable */
14645         sleep( 1 );
14646
14647         status = pthread_detach( &t );
14648         if( status ) return errno;
14649 #endif
14650
14651 #ifdef HAVE_LINUX_THREADS
14652         pthread_kill_other_threads_np();
14653 #endif
14654
14655         return 0;
14656
14657 }
14658
14659 EOF
14660 if { (eval echo configure:14661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14661 then
14662   ol_cv_pthread_lib_lpthreads=yes
14663 else
14664   echo "configure: failed program was:" >&5
14665   cat conftest.$ac_ext >&5
14666   rm -fr conftest*
14667   ol_cv_pthread_lib_lpthreads=no
14668 fi
14669 rm -fr conftest*
14670 fi
14671
14672
14673                 # restore the LIBS
14674                 LIBS="$ol_LIBS"
14675         
14676 fi
14677
14678 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
14679
14680         if test $ol_cv_pthread_lib_lpthreads = yes ; then
14681                 ol_link_pthreads="-lpthreads"
14682                 ol_link_threads=posix
14683         fi
14684 fi
14685
14686
14687                 if test $ol_link_threads != no ; then
14688                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
14689
14690                                                 save_CPPFLAGS="$CPPFLAGS"
14691                         save_LIBS="$LIBS"
14692                         LIBS="$LTHREAD_LIBS $LIBS"
14693
14694                                                                                                 for ac_func in sched_yield pthread_yield thr_yield
14695 do
14696 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14697 echo "configure:14698: checking for $ac_func" >&5
14698 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14699   echo $ac_n "(cached) $ac_c" 1>&6
14700 else
14701   cat > conftest.$ac_ext <<EOF
14702 #line 14703 "configure"
14703 #include "confdefs.h"
14704 /* System header to define __stub macros and hopefully few prototypes,
14705     which can conflict with char $ac_func(); below.  */
14706 #include <assert.h>
14707 /* Override any gcc2 internal prototype to avoid an error.  */
14708 /* We use char because int might match the return type of a gcc2
14709     builtin and then its argument prototype would still apply.  */
14710 char $ac_func();
14711 char (*f)();
14712
14713 int main() {
14714
14715 /* The GNU C library defines this for functions which it implements
14716     to always fail with ENOSYS.  Some functions are actually named
14717     something starting with __ and the normal name is an alias.  */
14718 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14719 choke me
14720 #else
14721 f = $ac_func;
14722 #endif
14723
14724 ; return 0; }
14725 EOF
14726 if { (eval echo configure:14727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14727   rm -rf conftest*
14728   eval "ac_cv_func_$ac_func=yes"
14729 else
14730   echo "configure: failed program was:" >&5
14731   cat conftest.$ac_ext >&5
14732   rm -rf conftest*
14733   eval "ac_cv_func_$ac_func=no"
14734 fi
14735 rm -f conftest*
14736 fi
14737
14738 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14739   echo "$ac_t""yes" 1>&6
14740     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14741   cat >> confdefs.h <<EOF
14742 #define $ac_tr_func 1
14743 EOF
14744  
14745 else
14746   echo "$ac_t""no" 1>&6
14747 fi
14748 done
14749
14750
14751                         if test $ac_cv_func_sched_yield = no -a \
14752                                 $ac_cv_func_pthread_yield = no -a \
14753                                 $ac_cv_func_thr_yield = no ; then
14754                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
14755 echo "configure:14756: checking for sched_yield in -lrt" >&5
14756 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
14757 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14758   echo $ac_n "(cached) $ac_c" 1>&6
14759 else
14760   ac_save_LIBS="$LIBS"
14761 LIBS="-lrt  $LIBS"
14762 cat > conftest.$ac_ext <<EOF
14763 #line 14764 "configure"
14764 #include "confdefs.h"
14765 /* Override any gcc2 internal prototype to avoid an error.  */
14766 /* We use char because int might match the return type of a gcc2
14767     builtin and then its argument prototype would still apply.  */
14768 char sched_yield();
14769
14770 int main() {
14771 sched_yield()
14772 ; return 0; }
14773 EOF
14774 if { (eval echo configure:14775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14775   rm -rf conftest*
14776   eval "ac_cv_lib_$ac_lib_var=yes"
14777 else
14778   echo "configure: failed program was:" >&5
14779   cat conftest.$ac_ext >&5
14780   rm -rf conftest*
14781   eval "ac_cv_lib_$ac_lib_var=no"
14782 fi
14783 rm -f conftest*
14784 LIBS="$ac_save_LIBS"
14785
14786 fi
14787 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14788   echo "$ac_t""yes" 1>&6
14789   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
14790                                         cat >> confdefs.h <<\EOF
14791 #define HAVE_SCHED_YIELD 1
14792 EOF
14793
14794                                         ac_cv_func_sched_yield=yes
14795 else
14796   echo "$ac_t""no" 1>&6
14797 ac_cv_func_sched_yield=no
14798 fi
14799
14800                         fi
14801                         if test $ac_cv_func_sched_yield = no -a \
14802                                 $ac_cv_func_pthread_yield = no -a \
14803                                 "$ac_cv_func_thr_yield" = no ; then
14804                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
14805                         fi
14806
14807                                                 for ac_func in pthread_kill pthread_rwlock_destroy
14808 do
14809 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14810 echo "configure:14811: checking for $ac_func" >&5
14811 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14812   echo $ac_n "(cached) $ac_c" 1>&6
14813 else
14814   cat > conftest.$ac_ext <<EOF
14815 #line 14816 "configure"
14816 #include "confdefs.h"
14817 /* System header to define __stub macros and hopefully few prototypes,
14818     which can conflict with char $ac_func(); below.  */
14819 #include <assert.h>
14820 /* Override any gcc2 internal prototype to avoid an error.  */
14821 /* We use char because int might match the return type of a gcc2
14822     builtin and then its argument prototype would still apply.  */
14823 char $ac_func();
14824 char (*f)();
14825
14826 int main() {
14827
14828 /* The GNU C library defines this for functions which it implements
14829     to always fail with ENOSYS.  Some functions are actually named
14830     something starting with __ and the normal name is an alias.  */
14831 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14832 choke me
14833 #else
14834 f = $ac_func;
14835 #endif
14836
14837 ; return 0; }
14838 EOF
14839 if { (eval echo configure:14840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14840   rm -rf conftest*
14841   eval "ac_cv_func_$ac_func=yes"
14842 else
14843   echo "configure: failed program was:" >&5
14844   cat conftest.$ac_ext >&5
14845   rm -rf conftest*
14846   eval "ac_cv_func_$ac_func=no"
14847 fi
14848 rm -f conftest*
14849 fi
14850
14851 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14852   echo "$ac_t""yes" 1>&6
14853     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14854   cat >> confdefs.h <<EOF
14855 #define $ac_tr_func 1
14856 EOF
14857  
14858 else
14859   echo "$ac_t""no" 1>&6
14860 fi
14861 done
14862
14863
14864                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
14865 echo "configure:14866: checking for pthread_detach with <pthread.h>" >&5
14866 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
14867   echo $ac_n "(cached) $ac_c" 1>&6
14868 else
14869   
14870                                                                 cat > conftest.$ac_ext <<EOF
14871 #line 14872 "configure"
14872 #include "confdefs.h"
14873
14874 #include <pthread.h>
14875 #ifndef NULL
14876 #define NULL (void*)0
14877 #endif
14878
14879 int main() {
14880 pthread_detach(NULL);
14881 ; return 0; }
14882 EOF
14883 if { (eval echo configure:14884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14884   rm -rf conftest*
14885   ol_cv_func_pthread_detach=yes
14886 else
14887   echo "configure: failed program was:" >&5
14888   cat conftest.$ac_ext >&5
14889   rm -rf conftest*
14890   ol_cv_func_pthread_detach=no
14891 fi
14892 rm -f conftest*
14893                         
14894 fi
14895
14896 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
14897
14898                         if test $ol_cv_func_pthread_detach = no ; then
14899                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
14900                         fi
14901
14902                         cat >> confdefs.h <<\EOF
14903 #define HAVE_PTHREAD_DETACH 1
14904 EOF
14905
14906
14907                                                 for ac_func in \
14908                                 pthread_setconcurrency \
14909                                 pthread_getconcurrency \
14910                                 thr_setconcurrency \
14911                                 thr_getconcurrency \
14912                         
14913 do
14914 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14915 echo "configure:14916: checking for $ac_func" >&5
14916 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14917   echo $ac_n "(cached) $ac_c" 1>&6
14918 else
14919   cat > conftest.$ac_ext <<EOF
14920 #line 14921 "configure"
14921 #include "confdefs.h"
14922 /* System header to define __stub macros and hopefully few prototypes,
14923     which can conflict with char $ac_func(); below.  */
14924 #include <assert.h>
14925 /* Override any gcc2 internal prototype to avoid an error.  */
14926 /* We use char because int might match the return type of a gcc2
14927     builtin and then its argument prototype would still apply.  */
14928 char $ac_func();
14929 char (*f)();
14930
14931 int main() {
14932
14933 /* The GNU C library defines this for functions which it implements
14934     to always fail with ENOSYS.  Some functions are actually named
14935     something starting with __ and the normal name is an alias.  */
14936 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14937 choke me
14938 #else
14939 f = $ac_func;
14940 #endif
14941
14942 ; return 0; }
14943 EOF
14944 if { (eval echo configure:14945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14945   rm -rf conftest*
14946   eval "ac_cv_func_$ac_func=yes"
14947 else
14948   echo "configure: failed program was:" >&5
14949   cat conftest.$ac_ext >&5
14950   rm -rf conftest*
14951   eval "ac_cv_func_$ac_func=no"
14952 fi
14953 rm -f conftest*
14954 fi
14955
14956 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14957   echo "$ac_t""yes" 1>&6
14958     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14959   cat >> confdefs.h <<EOF
14960 #define $ac_tr_func 1
14961 EOF
14962  
14963 else
14964   echo "$ac_t""no" 1>&6
14965 fi
14966 done
14967
14968
14969                         
14970         for ac_func in pthread_kill_other_threads_np
14971 do
14972 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14973 echo "configure:14974: checking for $ac_func" >&5
14974 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14975   echo $ac_n "(cached) $ac_c" 1>&6
14976 else
14977   cat > conftest.$ac_ext <<EOF
14978 #line 14979 "configure"
14979 #include "confdefs.h"
14980 /* System header to define __stub macros and hopefully few prototypes,
14981     which can conflict with char $ac_func(); below.  */
14982 #include <assert.h>
14983 /* Override any gcc2 internal prototype to avoid an error.  */
14984 /* We use char because int might match the return type of a gcc2
14985     builtin and then its argument prototype would still apply.  */
14986 char $ac_func();
14987 char (*f)();
14988
14989 int main() {
14990
14991 /* The GNU C library defines this for functions which it implements
14992     to always fail with ENOSYS.  Some functions are actually named
14993     something starting with __ and the normal name is an alias.  */
14994 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14995 choke me
14996 #else
14997 f = $ac_func;
14998 #endif
14999
15000 ; return 0; }
15001 EOF
15002 if { (eval echo configure:15003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15003   rm -rf conftest*
15004   eval "ac_cv_func_$ac_func=yes"
15005 else
15006   echo "configure: failed program was:" >&5
15007   cat conftest.$ac_ext >&5
15008   rm -rf conftest*
15009   eval "ac_cv_func_$ac_func=no"
15010 fi
15011 rm -f conftest*
15012 fi
15013
15014 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15015   echo "$ac_t""yes" 1>&6
15016     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15017   cat >> confdefs.h <<EOF
15018 #define $ac_tr_func 1
15019 EOF
15020  
15021 else
15022   echo "$ac_t""no" 1>&6
15023 fi
15024 done
15025
15026         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
15027 echo "configure:15028: checking for LinuxThreads implementation" >&5
15028 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
15029   echo $ac_n "(cached) $ac_c" 1>&6
15030 else
15031   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
15032 fi
15033
15034 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
15035
15036                         
15037         
15038         
15039         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
15040 echo "configure:15041: checking for LinuxThreads consistency" >&5
15041 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
15042   echo $ac_n "(cached) $ac_c" 1>&6
15043 else
15044   
15045                 if test $ol_cv_header_linux_threads = yes -a \
15046                         $ol_cv_sys_linux_threads = yes; then
15047                         ol_cv_linux_threads=yes
15048                 elif test $ol_cv_header_linux_threads = no -a \
15049                         $ol_cv_sys_linux_threads = no; then
15050                         ol_cv_linux_threads=no
15051                 else
15052                         ol_cv_linux_threads=error
15053                 fi
15054         
15055 fi
15056
15057 echo "$ac_t""$ol_cv_linux_threads" 1>&6
15058
15059
15060                         if test $ol_cv_linux_threads = error; then
15061                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
15062                         fi
15063
15064                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
15065 echo "configure:15066: checking if pthread_create() works" >&5
15066 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
15067   echo $ac_n "(cached) $ac_c" 1>&6
15068 else
15069   
15070                         if test "$cross_compiling" = yes; then
15071                                 ol_cv_pthread_create_works=yes
15072 else
15073   cat > conftest.$ac_ext <<EOF
15074 #line 15075 "configure"
15075 #include "confdefs.h"
15076 /* pthread test headers */
15077 #include <pthread.h>
15078 #if HAVE_PTHREADS < 7
15079 #include <errno.h>
15080 #endif
15081 #ifndef NULL
15082 #define NULL (void*)0
15083 #endif
15084
15085 static void *task(p)
15086         void *p;
15087 {
15088         return (void *) (p == NULL);
15089 }
15090
15091
15092 int main(argc, argv)
15093         int argc;
15094         char **argv;
15095 {
15096
15097         /* pthread test function */
15098 #ifndef PTHREAD_CREATE_DETACHED
15099 #define PTHREAD_CREATE_DETACHED 1
15100 #endif
15101         pthread_t t;
15102         int status;
15103         int detach = PTHREAD_CREATE_DETACHED;
15104
15105 #if HAVE_PTHREADS > 4
15106         /* Final pthreads */
15107         pthread_attr_t attr;
15108
15109         status = pthread_attr_init(&attr);
15110         if( status ) return status;
15111
15112 #if HAVE_PTHREADS < 7
15113         status = pthread_attr_setdetachstate(&attr, &detach);
15114         if( status < 0 ) status = errno;
15115 #else
15116         status = pthread_attr_setdetachstate(&attr, detach);
15117 #endif
15118         if( status ) return status;
15119         status = pthread_create( &t, &attr, task, NULL );
15120 #if HAVE_PTHREADS < 7
15121         if( status < 0 ) status = errno;
15122 #endif
15123         if( status ) return status;
15124 #else
15125         /* Draft 4 pthreads */
15126         status = pthread_create( &t, pthread_attr_default, task, NULL );
15127         if( status ) return errno;
15128
15129         /* give thread a chance to complete */
15130         /* it should remain joinable and hence detachable */
15131         sleep( 1 );
15132
15133         status = pthread_detach( &t );
15134         if( status ) return errno;
15135 #endif
15136
15137 #ifdef HAVE_LINUX_THREADS
15138         pthread_kill_other_threads_np();
15139 #endif
15140
15141         return 0;
15142
15143 }
15144
15145 EOF
15146 if { (eval echo configure:15147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15147 then
15148   ol_cv_pthread_create_works=yes
15149 else
15150   echo "configure: failed program was:" >&5
15151   cat conftest.$ac_ext >&5
15152   rm -fr conftest*
15153   ol_cv_pthread_create_works=no
15154 fi
15155 rm -fr conftest*
15156 fi
15157
15158 fi
15159
15160 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
15161
15162                         if test $ol_cv_pthread_create_works = no ; then
15163                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
15164                         fi
15165
15166                                                 if test $ol_with_yielding_select = auto ; then
15167                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
15168 echo "configure:15169: checking if select yields when using pthreads" >&5
15169 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
15170   echo $ac_n "(cached) $ac_c" 1>&6
15171 else
15172   
15173                                 if test "$cross_compiling" = yes; then
15174   ol_cv_pthread_select_yields=cross
15175 else
15176   cat > conftest.$ac_ext <<EOF
15177 #line 15178 "configure"
15178 #include "confdefs.h"
15179
15180 #include <sys/types.h>
15181 #include <sys/time.h>
15182 #include <unistd.h>
15183 #include <pthread.h>
15184 #ifndef NULL
15185 #define NULL (void*) 0
15186 #endif
15187
15188 static int fildes[2];
15189
15190 static void *task(p)
15191         void *p;
15192 {
15193         int i;
15194         struct timeval tv;
15195
15196         fd_set rfds;
15197
15198         tv.tv_sec=10;
15199         tv.tv_usec=0;
15200
15201         FD_ZERO(&rfds);
15202         FD_SET(fildes[0], &rfds);
15203
15204         /* we're not interested in any fds */
15205         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
15206
15207         if(i < 0) {
15208                 perror("select");
15209                 exit(10);
15210         }
15211
15212         exit(0); /* if we exit here, the select blocked the whole process */
15213 }
15214
15215 int main(argc, argv)
15216         int argc;
15217         char **argv;
15218 {
15219         pthread_t t;
15220
15221         /* create a pipe to select */
15222         if(pipe(&fildes[0])) {
15223                 perror("select");
15224                 exit(1);
15225         }
15226
15227 #ifdef HAVE_PTHREAD_SETCONCURRENCY
15228         (void) pthread_setconcurrency(2);
15229 #else
15230 #ifdef HAVE_THR_SETCONCURRENCY
15231         /* Set Solaris LWP concurrency to 2 */
15232         thr_setconcurrency(2);
15233 #endif
15234 #endif
15235
15236 #if HAVE_PTHREADS < 6
15237         pthread_create(&t, pthread_attr_default, task, NULL);
15238 #else
15239         pthread_create(&t, NULL, task, NULL);
15240 #endif
15241
15242         /* make sure task runs first */
15243 #if HAVE_THR_YIELD
15244         thr_yield();
15245 #elif defined( HAVE_SCHED_YIELD )
15246         sched_yield();
15247 #elif defined( HAVE_PTHREAD_YIELD )
15248         pthread_yield();
15249 #endif
15250
15251         exit(2);
15252 }
15253 EOF
15254 if { (eval echo configure:15255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15255 then
15256   ol_cv_pthread_select_yields=no
15257 else
15258   echo "configure: failed program was:" >&5
15259   cat conftest.$ac_ext >&5
15260   rm -fr conftest*
15261   ol_cv_pthread_select_yields=yes
15262 fi
15263 rm -fr conftest*
15264 fi
15265
15266 fi
15267
15268 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
15269
15270                                 if test $ol_cv_pthread_select_yields = cross ; then
15271                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
15272                                 fi
15273
15274                                 if test $ol_cv_pthread_select_yields = yes ; then
15275                                         ol_with_yielding_select=yes
15276                                 fi
15277                         fi
15278
15279                                                 CPPFLAGS="$save_CPPFLAGS"
15280                         LIBS="$save_LIBS"
15281                 else
15282                         { echo "configure: error: could not locate usable POSIX Threads" 1>&2; exit 1; }
15283                 fi
15284         fi
15285
15286         if test $ol_with_threads = posix ; then
15287                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
15288         fi
15289 fi
15290
15291 if test $ol_with_threads = auto -o $ol_with_threads = yes \
15292         -o $ol_with_threads = mach ; then
15293
15294                 for ac_hdr in mach/cthreads.h cthreads.h
15295 do
15296 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15297 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15298 echo "configure:15299: checking for $ac_hdr" >&5
15299 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15300   echo $ac_n "(cached) $ac_c" 1>&6
15301 else
15302   cat > conftest.$ac_ext <<EOF
15303 #line 15304 "configure"
15304 #include "confdefs.h"
15305 #include <$ac_hdr>
15306 EOF
15307 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15308 { (eval echo configure:15309: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15309 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15310 if test -z "$ac_err"; then
15311   rm -rf conftest*
15312   eval "ac_cv_header_$ac_safe=yes"
15313 else
15314   echo "$ac_err" >&5
15315   echo "configure: failed program was:" >&5
15316   cat conftest.$ac_ext >&5
15317   rm -rf conftest*
15318   eval "ac_cv_header_$ac_safe=no"
15319 fi
15320 rm -f conftest*
15321 fi
15322 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15323   echo "$ac_t""yes" 1>&6
15324     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15325   cat >> confdefs.h <<EOF
15326 #define $ac_tr_hdr 1
15327 EOF
15328  
15329 else
15330   echo "$ac_t""no" 1>&6
15331 fi
15332 done
15333
15334         if test $ac_cv_header_mach_cthreads_h = yes ; then
15335                 ol_with_threads=found
15336
15337                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
15338 echo "configure:15339: checking for cthread_fork" >&5
15339 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
15340   echo $ac_n "(cached) $ac_c" 1>&6
15341 else
15342   cat > conftest.$ac_ext <<EOF
15343 #line 15344 "configure"
15344 #include "confdefs.h"
15345 /* System header to define __stub macros and hopefully few prototypes,
15346     which can conflict with char cthread_fork(); below.  */
15347 #include <assert.h>
15348 /* Override any gcc2 internal prototype to avoid an error.  */
15349 /* We use char because int might match the return type of a gcc2
15350     builtin and then its argument prototype would still apply.  */
15351 char cthread_fork();
15352 char (*f)();
15353
15354 int main() {
15355
15356 /* The GNU C library defines this for functions which it implements
15357     to always fail with ENOSYS.  Some functions are actually named
15358     something starting with __ and the normal name is an alias.  */
15359 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
15360 choke me
15361 #else
15362 f = cthread_fork;
15363 #endif
15364
15365 ; return 0; }
15366 EOF
15367 if { (eval echo configure:15368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15368   rm -rf conftest*
15369   eval "ac_cv_func_cthread_fork=yes"
15370 else
15371   echo "configure: failed program was:" >&5
15372   cat conftest.$ac_ext >&5
15373   rm -rf conftest*
15374   eval "ac_cv_func_cthread_fork=no"
15375 fi
15376 rm -f conftest*
15377 fi
15378
15379 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
15380   echo "$ac_t""yes" 1>&6
15381   ol_link_threads=yes
15382 else
15383   echo "$ac_t""no" 1>&6
15384 fi
15385
15386
15387                 if test $ol_link_threads = no ; then
15388                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
15389 echo "configure:15390: checking for cthread_fork with -all_load" >&5
15390 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
15391   echo $ac_n "(cached) $ac_c" 1>&6
15392 else
15393   
15394                                                                 save_LIBS="$LIBS"
15395                                 LIBS="-all_load $LIBS"
15396                                 cat > conftest.$ac_ext <<EOF
15397 #line 15398 "configure"
15398 #include "confdefs.h"
15399 #include <mach/cthreads.h>
15400 int main() {
15401
15402                                         cthread_fork((void *)0, (void *)0);
15403                                         
15404 ; return 0; }
15405 EOF
15406 if { (eval echo configure:15407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15407   rm -rf conftest*
15408   ol_cv_cthread_all_load=yes
15409 else
15410   echo "configure: failed program was:" >&5
15411   cat conftest.$ac_ext >&5
15412   rm -rf conftest*
15413   ol_cv_cthread_all_load=no
15414 fi
15415 rm -f conftest*
15416                                                                 LIBS="$save_LIBS"
15417                         
15418 fi
15419
15420 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
15421
15422                         if test $ol_cv_cthread_all_load = yes ; then
15423                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
15424                                 ol_link_threads=mach
15425                                 ol_with_threads=found
15426                         fi
15427                 fi
15428
15429         elif test $ac_cv_header_cthreads_h = yes ; then
15430                                 
15431                 ol_with_threads=found
15432  
15433                                 save_LIBS="$LIBS"
15434                 LIBS="$LIBS -lthreads"
15435                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
15436 echo "configure:15437: checking for cthread_fork" >&5
15437 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
15438   echo $ac_n "(cached) $ac_c" 1>&6
15439 else
15440   cat > conftest.$ac_ext <<EOF
15441 #line 15442 "configure"
15442 #include "confdefs.h"
15443 /* System header to define __stub macros and hopefully few prototypes,
15444     which can conflict with char cthread_fork(); below.  */
15445 #include <assert.h>
15446 /* Override any gcc2 internal prototype to avoid an error.  */
15447 /* We use char because int might match the return type of a gcc2
15448     builtin and then its argument prototype would still apply.  */
15449 char cthread_fork();
15450 char (*f)();
15451
15452 int main() {
15453
15454 /* The GNU C library defines this for functions which it implements
15455     to always fail with ENOSYS.  Some functions are actually named
15456     something starting with __ and the normal name is an alias.  */
15457 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
15458 choke me
15459 #else
15460 f = cthread_fork;
15461 #endif
15462
15463 ; return 0; }
15464 EOF
15465 if { (eval echo configure:15466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15466   rm -rf conftest*
15467   eval "ac_cv_func_cthread_fork=yes"
15468 else
15469   echo "configure: failed program was:" >&5
15470   cat conftest.$ac_ext >&5
15471   rm -rf conftest*
15472   eval "ac_cv_func_cthread_fork=no"
15473 fi
15474 rm -f conftest*
15475 fi
15476
15477 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
15478   echo "$ac_t""yes" 1>&6
15479   ol_link_threads=yes
15480 else
15481   echo "$ac_t""no" 1>&6
15482 fi
15483
15484                 LIBS="$save_LIBS"
15485
15486                 if test $ol_link_threads = yes ; then
15487                         LTHREAD_LIBS="-lthreads"
15488                         ol_link_threads=mach
15489                         ol_with_threads=found
15490                 else
15491                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
15492                 fi
15493
15494         elif test $ol_with_threads = mach ; then
15495                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
15496         fi
15497
15498         if test $ol_link_threads = mach ; then
15499                 cat >> confdefs.h <<\EOF
15500 #define HAVE_MACH_CTHREADS 1
15501 EOF
15502
15503         elif test $ol_with_threads = found ; then
15504                 { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
15505         fi
15506 fi
15507
15508 if test $ol_with_threads = auto -o $ol_with_threads = yes \
15509         -o $ol_with_threads = pth ; then
15510
15511         for ac_hdr in pth.h
15512 do
15513 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15514 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15515 echo "configure:15516: checking for $ac_hdr" >&5
15516 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15517   echo $ac_n "(cached) $ac_c" 1>&6
15518 else
15519   cat > conftest.$ac_ext <<EOF
15520 #line 15521 "configure"
15521 #include "confdefs.h"
15522 #include <$ac_hdr>
15523 EOF
15524 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15525 { (eval echo configure:15526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15526 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15527 if test -z "$ac_err"; then
15528   rm -rf conftest*
15529   eval "ac_cv_header_$ac_safe=yes"
15530 else
15531   echo "$ac_err" >&5
15532   echo "configure: failed program was:" >&5
15533   cat conftest.$ac_ext >&5
15534   rm -rf conftest*
15535   eval "ac_cv_header_$ac_safe=no"
15536 fi
15537 rm -f conftest*
15538 fi
15539 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15540   echo "$ac_t""yes" 1>&6
15541     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15542   cat >> confdefs.h <<EOF
15543 #define $ac_tr_hdr 1
15544 EOF
15545  
15546 else
15547   echo "$ac_t""no" 1>&6
15548 fi
15549 done
15550
15551
15552         if test $ac_cv_header_pth_h = yes ; then
15553                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
15554 echo "configure:15555: checking for pth_version in -lpth" >&5
15555 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
15556 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15557   echo $ac_n "(cached) $ac_c" 1>&6
15558 else
15559   ac_save_LIBS="$LIBS"
15560 LIBS="-lpth  $LIBS"
15561 cat > conftest.$ac_ext <<EOF
15562 #line 15563 "configure"
15563 #include "confdefs.h"
15564 /* Override any gcc2 internal prototype to avoid an error.  */
15565 /* We use char because int might match the return type of a gcc2
15566     builtin and then its argument prototype would still apply.  */
15567 char pth_version();
15568
15569 int main() {
15570 pth_version()
15571 ; return 0; }
15572 EOF
15573 if { (eval echo configure:15574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15574   rm -rf conftest*
15575   eval "ac_cv_lib_$ac_lib_var=yes"
15576 else
15577   echo "configure: failed program was:" >&5
15578   cat conftest.$ac_ext >&5
15579   rm -rf conftest*
15580   eval "ac_cv_lib_$ac_lib_var=no"
15581 fi
15582 rm -f conftest*
15583 LIBS="$ac_save_LIBS"
15584
15585 fi
15586 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15587   echo "$ac_t""yes" 1>&6
15588   have_pth=yes
15589 else
15590   echo "$ac_t""no" 1>&6
15591 have_pth=no
15592 fi
15593
15594
15595                 if test $have_pth = yes ; then
15596                         cat >> confdefs.h <<\EOF
15597 #define HAVE_GNU_PTH 1
15598 EOF
15599
15600                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
15601                         ol_link_threads=pth
15602                         ol_with_threads=found
15603
15604                         if test $ol_with_yielding_select = auto ; then
15605                                 ol_with_yielding_select=yes
15606                         fi
15607                 fi
15608         fi
15609 fi
15610
15611 if test $ol_with_threads = auto -o $ol_with_threads = yes \
15612         -o $ol_with_threads = lwp ; then
15613
15614                 for ac_hdr in thread.h synch.h
15615 do
15616 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15617 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15618 echo "configure:15619: checking for $ac_hdr" >&5
15619 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15620   echo $ac_n "(cached) $ac_c" 1>&6
15621 else
15622   cat > conftest.$ac_ext <<EOF
15623 #line 15624 "configure"
15624 #include "confdefs.h"
15625 #include <$ac_hdr>
15626 EOF
15627 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15628 { (eval echo configure:15629: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15629 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15630 if test -z "$ac_err"; then
15631   rm -rf conftest*
15632   eval "ac_cv_header_$ac_safe=yes"
15633 else
15634   echo "$ac_err" >&5
15635   echo "configure: failed program was:" >&5
15636   cat conftest.$ac_ext >&5
15637   rm -rf conftest*
15638   eval "ac_cv_header_$ac_safe=no"
15639 fi
15640 rm -f conftest*
15641 fi
15642 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15643   echo "$ac_t""yes" 1>&6
15644     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15645   cat >> confdefs.h <<EOF
15646 #define $ac_tr_hdr 1
15647 EOF
15648  
15649 else
15650   echo "$ac_t""no" 1>&6
15651 fi
15652 done
15653
15654         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
15655                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
15656 echo "configure:15657: checking for thr_create in -lthread" >&5
15657 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
15658 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15659   echo $ac_n "(cached) $ac_c" 1>&6
15660 else
15661   ac_save_LIBS="$LIBS"
15662 LIBS="-lthread  $LIBS"
15663 cat > conftest.$ac_ext <<EOF
15664 #line 15665 "configure"
15665 #include "confdefs.h"
15666 /* Override any gcc2 internal prototype to avoid an error.  */
15667 /* We use char because int might match the return type of a gcc2
15668     builtin and then its argument prototype would still apply.  */
15669 char thr_create();
15670
15671 int main() {
15672 thr_create()
15673 ; return 0; }
15674 EOF
15675 if { (eval echo configure:15676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15676   rm -rf conftest*
15677   eval "ac_cv_lib_$ac_lib_var=yes"
15678 else
15679   echo "configure: failed program was:" >&5
15680   cat conftest.$ac_ext >&5
15681   rm -rf conftest*
15682   eval "ac_cv_lib_$ac_lib_var=no"
15683 fi
15684 rm -f conftest*
15685 LIBS="$ac_save_LIBS"
15686
15687 fi
15688 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15689   echo "$ac_t""yes" 1>&6
15690   have_thr=yes
15691 else
15692   echo "$ac_t""no" 1>&6
15693 have_thr=no
15694 fi
15695
15696
15697                 if test $have_thr = yes ; then
15698                         cat >> confdefs.h <<\EOF
15699 #define HAVE_THR 1
15700 EOF
15701
15702                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
15703                         ol_link_threads=thr
15704
15705                         if test $ol_with_yielding_select = auto ; then
15706                                 ol_with_yielding_select=yes
15707                         fi
15708
15709                                                 for ac_func in \
15710                                 thr_setconcurrency \
15711                                 thr_getconcurrency \
15712                         
15713 do
15714 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15715 echo "configure:15716: checking for $ac_func" >&5
15716 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15717   echo $ac_n "(cached) $ac_c" 1>&6
15718 else
15719   cat > conftest.$ac_ext <<EOF
15720 #line 15721 "configure"
15721 #include "confdefs.h"
15722 /* System header to define __stub macros and hopefully few prototypes,
15723     which can conflict with char $ac_func(); below.  */
15724 #include <assert.h>
15725 /* Override any gcc2 internal prototype to avoid an error.  */
15726 /* We use char because int might match the return type of a gcc2
15727     builtin and then its argument prototype would still apply.  */
15728 char $ac_func();
15729 char (*f)();
15730
15731 int main() {
15732
15733 /* The GNU C library defines this for functions which it implements
15734     to always fail with ENOSYS.  Some functions are actually named
15735     something starting with __ and the normal name is an alias.  */
15736 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15737 choke me
15738 #else
15739 f = $ac_func;
15740 #endif
15741
15742 ; return 0; }
15743 EOF
15744 if { (eval echo configure:15745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15745   rm -rf conftest*
15746   eval "ac_cv_func_$ac_func=yes"
15747 else
15748   echo "configure: failed program was:" >&5
15749   cat conftest.$ac_ext >&5
15750   rm -rf conftest*
15751   eval "ac_cv_func_$ac_func=no"
15752 fi
15753 rm -f conftest*
15754 fi
15755
15756 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15757   echo "$ac_t""yes" 1>&6
15758     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15759   cat >> confdefs.h <<EOF
15760 #define $ac_tr_func 1
15761 EOF
15762  
15763 else
15764   echo "$ac_t""no" 1>&6
15765 fi
15766 done
15767
15768                 fi
15769         fi
15770
15771                 for ac_hdr in lwp/lwp.h
15772 do
15773 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15774 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15775 echo "configure:15776: checking for $ac_hdr" >&5
15776 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15777   echo $ac_n "(cached) $ac_c" 1>&6
15778 else
15779   cat > conftest.$ac_ext <<EOF
15780 #line 15781 "configure"
15781 #include "confdefs.h"
15782 #include <$ac_hdr>
15783 EOF
15784 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15785 { (eval echo configure:15786: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15786 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15787 if test -z "$ac_err"; then
15788   rm -rf conftest*
15789   eval "ac_cv_header_$ac_safe=yes"
15790 else
15791   echo "$ac_err" >&5
15792   echo "configure: failed program was:" >&5
15793   cat conftest.$ac_ext >&5
15794   rm -rf conftest*
15795   eval "ac_cv_header_$ac_safe=no"
15796 fi
15797 rm -f conftest*
15798 fi
15799 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15800   echo "$ac_t""yes" 1>&6
15801     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15802   cat >> confdefs.h <<EOF
15803 #define $ac_tr_hdr 1
15804 EOF
15805  
15806 else
15807   echo "$ac_t""no" 1>&6
15808 fi
15809 done
15810
15811         if test $ac_cv_header_lwp_lwp_h = yes ; then
15812                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
15813 echo "configure:15814: checking for lwp_create in -llwp" >&5
15814 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
15815 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15816   echo $ac_n "(cached) $ac_c" 1>&6
15817 else
15818   ac_save_LIBS="$LIBS"
15819 LIBS="-llwp  $LIBS"
15820 cat > conftest.$ac_ext <<EOF
15821 #line 15822 "configure"
15822 #include "confdefs.h"
15823 /* Override any gcc2 internal prototype to avoid an error.  */
15824 /* We use char because int might match the return type of a gcc2
15825     builtin and then its argument prototype would still apply.  */
15826 char lwp_create();
15827
15828 int main() {
15829 lwp_create()
15830 ; return 0; }
15831 EOF
15832 if { (eval echo configure:15833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15833   rm -rf conftest*
15834   eval "ac_cv_lib_$ac_lib_var=yes"
15835 else
15836   echo "configure: failed program was:" >&5
15837   cat conftest.$ac_ext >&5
15838   rm -rf conftest*
15839   eval "ac_cv_lib_$ac_lib_var=no"
15840 fi
15841 rm -f conftest*
15842 LIBS="$ac_save_LIBS"
15843
15844 fi
15845 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15846   echo "$ac_t""yes" 1>&6
15847   have_lwp=yes
15848 else
15849   echo "$ac_t""no" 1>&6
15850 have_lwp=no
15851 fi
15852
15853
15854                 if test $have_lwp = yes ; then
15855                         cat >> confdefs.h <<\EOF
15856 #define HAVE_LWP 1
15857 EOF
15858
15859                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
15860                         ol_link_threads=lwp
15861
15862                         if test $ol_with_yielding_select = auto ; then
15863                                 ol_with_yielding_select=no
15864                         fi
15865                 fi
15866         fi
15867 fi
15868
15869 if test $ol_with_yielding_select = yes ; then
15870         cat >> confdefs.h <<\EOF
15871 #define HAVE_YIELDING_SELECT 1
15872 EOF
15873
15874 fi
15875
15876 if test $ol_with_threads = manual ; then
15877                 ol_link_threads=yes
15878
15879         echo "configure: warning: thread defines and link options must be set manually" 1>&2
15880
15881         for ac_hdr in pthread.h sched.h
15882 do
15883 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15884 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15885 echo "configure:15886: checking for $ac_hdr" >&5
15886 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15887   echo $ac_n "(cached) $ac_c" 1>&6
15888 else
15889   cat > conftest.$ac_ext <<EOF
15890 #line 15891 "configure"
15891 #include "confdefs.h"
15892 #include <$ac_hdr>
15893 EOF
15894 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15895 { (eval echo configure:15896: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15896 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15897 if test -z "$ac_err"; then
15898   rm -rf conftest*
15899   eval "ac_cv_header_$ac_safe=yes"
15900 else
15901   echo "$ac_err" >&5
15902   echo "configure: failed program was:" >&5
15903   cat conftest.$ac_ext >&5
15904   rm -rf conftest*
15905   eval "ac_cv_header_$ac_safe=no"
15906 fi
15907 rm -f conftest*
15908 fi
15909 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15910   echo "$ac_t""yes" 1>&6
15911     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15912   cat >> confdefs.h <<EOF
15913 #define $ac_tr_hdr 1
15914 EOF
15915  
15916 else
15917   echo "$ac_t""no" 1>&6
15918 fi
15919 done
15920
15921         for ac_func in sched_yield pthread_yield
15922 do
15923 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15924 echo "configure:15925: checking for $ac_func" >&5
15925 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15926   echo $ac_n "(cached) $ac_c" 1>&6
15927 else
15928   cat > conftest.$ac_ext <<EOF
15929 #line 15930 "configure"
15930 #include "confdefs.h"
15931 /* System header to define __stub macros and hopefully few prototypes,
15932     which can conflict with char $ac_func(); below.  */
15933 #include <assert.h>
15934 /* Override any gcc2 internal prototype to avoid an error.  */
15935 /* We use char because int might match the return type of a gcc2
15936     builtin and then its argument prototype would still apply.  */
15937 char $ac_func();
15938 char (*f)();
15939
15940 int main() {
15941
15942 /* The GNU C library defines this for functions which it implements
15943     to always fail with ENOSYS.  Some functions are actually named
15944     something starting with __ and the normal name is an alias.  */
15945 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15946 choke me
15947 #else
15948 f = $ac_func;
15949 #endif
15950
15951 ; return 0; }
15952 EOF
15953 if { (eval echo configure:15954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15954   rm -rf conftest*
15955   eval "ac_cv_func_$ac_func=yes"
15956 else
15957   echo "configure: failed program was:" >&5
15958   cat conftest.$ac_ext >&5
15959   rm -rf conftest*
15960   eval "ac_cv_func_$ac_func=no"
15961 fi
15962 rm -f conftest*
15963 fi
15964
15965 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15966   echo "$ac_t""yes" 1>&6
15967     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15968   cat >> confdefs.h <<EOF
15969 #define $ac_tr_func 1
15970 EOF
15971  
15972 else
15973   echo "$ac_t""no" 1>&6
15974 fi
15975 done
15976
15977         
15978         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
15979 echo "configure:15980: checking for LinuxThreads pthread.h" >&5
15980 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
15981   echo $ac_n "(cached) $ac_c" 1>&6
15982 else
15983   cat > conftest.$ac_ext <<EOF
15984 #line 15985 "configure"
15985 #include "confdefs.h"
15986 #include <pthread.h>
15987 EOF
15988 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15989   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
15990   rm -rf conftest*
15991   ol_cv_header_linux_threads=yes
15992 else
15993   rm -rf conftest*
15994   ol_cv_header_linux_threads=no
15995 fi
15996 rm -f conftest*
15997
15998                 
15999 fi
16000
16001 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
16002         if test $ol_cv_header_linux_threads = yes; then
16003                 cat >> confdefs.h <<\EOF
16004 #define HAVE_LINUX_THREADS 1
16005 EOF
16006
16007         fi
16008
16009
16010         for ac_hdr in mach/cthreads.h
16011 do
16012 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16013 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16014 echo "configure:16015: checking for $ac_hdr" >&5
16015 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16016   echo $ac_n "(cached) $ac_c" 1>&6
16017 else
16018   cat > conftest.$ac_ext <<EOF
16019 #line 16020 "configure"
16020 #include "confdefs.h"
16021 #include <$ac_hdr>
16022 EOF
16023 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16024 { (eval echo configure:16025: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16025 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16026 if test -z "$ac_err"; then
16027   rm -rf conftest*
16028   eval "ac_cv_header_$ac_safe=yes"
16029 else
16030   echo "$ac_err" >&5
16031   echo "configure: failed program was:" >&5
16032   cat conftest.$ac_ext >&5
16033   rm -rf conftest*
16034   eval "ac_cv_header_$ac_safe=no"
16035 fi
16036 rm -f conftest*
16037 fi
16038 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16039   echo "$ac_t""yes" 1>&6
16040     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16041   cat >> confdefs.h <<EOF
16042 #define $ac_tr_hdr 1
16043 EOF
16044  
16045 else
16046   echo "$ac_t""no" 1>&6
16047 fi
16048 done
16049
16050         for ac_hdr in lwp/lwp.h
16051 do
16052 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16053 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16054 echo "configure:16055: checking for $ac_hdr" >&5
16055 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16056   echo $ac_n "(cached) $ac_c" 1>&6
16057 else
16058   cat > conftest.$ac_ext <<EOF
16059 #line 16060 "configure"
16060 #include "confdefs.h"
16061 #include <$ac_hdr>
16062 EOF
16063 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16064 { (eval echo configure:16065: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16065 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16066 if test -z "$ac_err"; then
16067   rm -rf conftest*
16068   eval "ac_cv_header_$ac_safe=yes"
16069 else
16070   echo "$ac_err" >&5
16071   echo "configure: failed program was:" >&5
16072   cat conftest.$ac_ext >&5
16073   rm -rf conftest*
16074   eval "ac_cv_header_$ac_safe=no"
16075 fi
16076 rm -f conftest*
16077 fi
16078 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16079   echo "$ac_t""yes" 1>&6
16080     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16081   cat >> confdefs.h <<EOF
16082 #define $ac_tr_hdr 1
16083 EOF
16084  
16085 else
16086   echo "$ac_t""no" 1>&6
16087 fi
16088 done
16089
16090         for ac_hdr in thread.h synch.h
16091 do
16092 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16093 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16094 echo "configure:16095: checking for $ac_hdr" >&5
16095 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16096   echo $ac_n "(cached) $ac_c" 1>&6
16097 else
16098   cat > conftest.$ac_ext <<EOF
16099 #line 16100 "configure"
16100 #include "confdefs.h"
16101 #include <$ac_hdr>
16102 EOF
16103 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16104 { (eval echo configure:16105: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16105 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16106 if test -z "$ac_err"; then
16107   rm -rf conftest*
16108   eval "ac_cv_header_$ac_safe=yes"
16109 else
16110   echo "$ac_err" >&5
16111   echo "configure: failed program was:" >&5
16112   cat conftest.$ac_ext >&5
16113   rm -rf conftest*
16114   eval "ac_cv_header_$ac_safe=no"
16115 fi
16116 rm -f conftest*
16117 fi
16118 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16119   echo "$ac_t""yes" 1>&6
16120     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16121   cat >> confdefs.h <<EOF
16122 #define $ac_tr_hdr 1
16123 EOF
16124  
16125 else
16126   echo "$ac_t""no" 1>&6
16127 fi
16128 done
16129
16130 fi
16131
16132 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
16133                         cat >> confdefs.h <<\EOF
16134 #define REENTRANT 1
16135 EOF
16136
16137         cat >> confdefs.h <<\EOF
16138 #define _REENTRANT 1
16139 EOF
16140
16141         cat >> confdefs.h <<\EOF
16142 #define THREAD_SAFE 1
16143 EOF
16144
16145         cat >> confdefs.h <<\EOF
16146 #define _THREAD_SAFE 1
16147 EOF
16148
16149         cat >> confdefs.h <<\EOF
16150 #define THREADSAFE 1
16151 EOF
16152
16153         cat >> confdefs.h <<\EOF
16154 #define _THREADSAFE 1
16155 EOF
16156
16157         cat >> confdefs.h <<\EOF
16158 #define _SGI_MP_SOURCE 1
16159 EOF
16160
16161
16162                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
16163 echo "configure:16164: checking for thread specific errno" >&5
16164 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
16165   echo $ac_n "(cached) $ac_c" 1>&6
16166 else
16167   
16168                 cat > conftest.$ac_ext <<EOF
16169 #line 16170 "configure"
16170 #include "confdefs.h"
16171 #include <errno.h>
16172 int main() {
16173 errno = 0;
16174 ; return 0; }
16175 EOF
16176 if { (eval echo configure:16177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16177   rm -rf conftest*
16178   ol_cv_errno_thread_specific=yes
16179 else
16180   echo "configure: failed program was:" >&5
16181   cat conftest.$ac_ext >&5
16182   rm -rf conftest*
16183   ol_cv_errno_thread_specific=no
16184 fi
16185 rm -f conftest*
16186         
16187 fi
16188
16189 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
16190
16191                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
16192 echo "configure:16193: checking for thread specific h_errno" >&5
16193 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
16194   echo $ac_n "(cached) $ac_c" 1>&6
16195 else
16196   
16197                 cat > conftest.$ac_ext <<EOF
16198 #line 16199 "configure"
16199 #include "confdefs.h"
16200 #include <netdb.h>
16201 int main() {
16202 h_errno = 0;
16203 ; return 0; }
16204 EOF
16205 if { (eval echo configure:16206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16206   rm -rf conftest*
16207   ol_cv_h_errno_thread_specific=yes
16208 else
16209   echo "configure: failed program was:" >&5
16210   cat conftest.$ac_ext >&5
16211   rm -rf conftest*
16212   ol_cv_h_errno_thread_specific=no
16213 fi
16214 rm -f conftest*
16215         
16216 fi
16217
16218 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
16219
16220         if test $ol_cv_errno_thread_specific != yes \
16221                 -o $ol_cv_h_errno_thread_specific != yes ; then
16222                 LIBS="$LTHREAD_LIBS $LIBS"
16223                 LTHREAD_LIBS=""
16224         fi
16225
16226 fi  
16227
16228 if test $ol_link_threads = no ; then
16229         if test $ol_with_threads = yes ; then
16230                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
16231         fi
16232
16233         if test $ol_with_threads = auto ; then
16234                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
16235                 ol_with_threads=no
16236         fi
16237
16238         cat >> confdefs.h <<\EOF
16239 #define NO_THREADS 1
16240 EOF
16241
16242         LTHREAD_LIBS=""
16243 fi
16244
16245 if test $ol_link_threads != no ; then
16246         cat >> confdefs.h <<\EOF
16247 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
16248 EOF
16249
16250 fi
16251
16252 for ac_func in \
16253         ctime_r                 \
16254         gethostbyname_r gethostbyaddr_r \
16255
16256 do
16257 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16258 echo "configure:16259: checking for $ac_func" >&5
16259 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16260   echo $ac_n "(cached) $ac_c" 1>&6
16261 else
16262   cat > conftest.$ac_ext <<EOF
16263 #line 16264 "configure"
16264 #include "confdefs.h"
16265 /* System header to define __stub macros and hopefully few prototypes,
16266     which can conflict with char $ac_func(); below.  */
16267 #include <assert.h>
16268 /* Override any gcc2 internal prototype to avoid an error.  */
16269 /* We use char because int might match the return type of a gcc2
16270     builtin and then its argument prototype would still apply.  */
16271 char $ac_func();
16272 char (*f)();
16273
16274 int main() {
16275
16276 /* The GNU C library defines this for functions which it implements
16277     to always fail with ENOSYS.  Some functions are actually named
16278     something starting with __ and the normal name is an alias.  */
16279 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16280 choke me
16281 #else
16282 f = $ac_func;
16283 #endif
16284
16285 ; return 0; }
16286 EOF
16287 if { (eval echo configure:16288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16288   rm -rf conftest*
16289   eval "ac_cv_func_$ac_func=yes"
16290 else
16291   echo "configure: failed program was:" >&5
16292   cat conftest.$ac_ext >&5
16293   rm -rf conftest*
16294   eval "ac_cv_func_$ac_func=no"
16295 fi
16296 rm -f conftest*
16297 fi
16298
16299 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16300   echo "$ac_t""yes" 1>&6
16301     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16302   cat >> confdefs.h <<EOF
16303 #define $ac_tr_func 1
16304 EOF
16305  
16306 else
16307   echo "$ac_t""no" 1>&6
16308 fi
16309 done
16310
16311
16312 if test "$ac_cv_func_ctime_r" = no ; then
16313         ol_cv_func_ctime_r_nargs=0
16314 else
16315         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
16316 echo "configure:16317: checking number of arguments of ctime_r" >&5
16317 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
16318   echo $ac_n "(cached) $ac_c" 1>&6
16319 else
16320   cat > conftest.$ac_ext <<EOF
16321 #line 16322 "configure"
16322 #include "confdefs.h"
16323 #include <time.h>
16324 int main() {
16325 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
16326 ; return 0; }
16327 EOF
16328 if { (eval echo configure:16329: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16329   rm -rf conftest*
16330   ol_cv_func_ctime_r_nargs3=yes
16331 else
16332   echo "configure: failed program was:" >&5
16333   cat conftest.$ac_ext >&5
16334   rm -rf conftest*
16335   ol_cv_func_ctime_r_nargs3=no
16336 fi
16337 rm -f conftest*
16338
16339         cat > conftest.$ac_ext <<EOF
16340 #line 16341 "configure"
16341 #include "confdefs.h"
16342 #include <time.h>
16343 int main() {
16344 time_t ti; char *buffer; ctime_r(&ti,buffer);
16345 ; return 0; }
16346 EOF
16347 if { (eval echo configure:16348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16348   rm -rf conftest*
16349   ol_cv_func_ctime_r_nargs2=yes
16350 else
16351   echo "configure: failed program was:" >&5
16352   cat conftest.$ac_ext >&5
16353   rm -rf conftest*
16354   ol_cv_func_ctime_r_nargs2=no
16355 fi
16356 rm -f conftest*
16357
16358         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
16359                 $ol_cv_func_ctime_r_nargs2 = no ; then
16360
16361                 ol_cv_func_ctime_r_nargs=3
16362
16363         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
16364                 $ol_cv_func_ctime_r_nargs2 = yes ; then
16365
16366                 ol_cv_func_ctime_r_nargs=2
16367
16368         else
16369                 ol_cv_func_ctime_r_nargs=0
16370         fi
16371   
16372 fi
16373
16374 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
16375
16376   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
16377         cat >> confdefs.h <<EOF
16378 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
16379 EOF
16380
16381   fi
16382
16383 fi
16384
16385 if test "$ac_cv_func_gethostbyname_r" = yes ; then
16386         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
16387 echo "configure:16388: checking number of arguments of gethostbyname_r" >&5
16388 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
16389   echo $ac_n "(cached) $ac_c" 1>&6
16390 else
16391   cat > conftest.$ac_ext <<EOF
16392 #line 16393 "configure"
16393 #include "confdefs.h"
16394 #include <sys/types.h>
16395 #include <sys/socket.h>
16396 #include <netinet/in.h>
16397 #include <netdb.h>
16398 #define BUFSIZE (sizeof(struct hostent)+10)
16399 int main() {
16400 struct hostent hent; char buffer[BUFSIZE];
16401                 int bufsize=BUFSIZE;int h_errno;
16402                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
16403                         buffer, bufsize, &h_errno);
16404 ; return 0; }
16405 EOF
16406 if { (eval echo configure:16407: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16407   rm -rf conftest*
16408   ol_cv_func_gethostbyname_r_nargs5=yes
16409 else
16410   echo "configure: failed program was:" >&5
16411   cat conftest.$ac_ext >&5
16412   rm -rf conftest*
16413   ol_cv_func_gethostbyname_r_nargs5=no
16414 fi
16415 rm -f conftest*
16416
16417         cat > conftest.$ac_ext <<EOF
16418 #line 16419 "configure"
16419 #include "confdefs.h"
16420 #include <sys/types.h>
16421 #include <sys/socket.h>
16422 #include <netinet/in.h>
16423 #include <netdb.h>
16424 #define BUFSIZE (sizeof(struct hostent)+10)
16425 int main() {
16426 struct hostent hent;struct hostent *rhent;
16427                 char buffer[BUFSIZE];
16428                 int bufsize=BUFSIZE;int h_errno;
16429                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
16430                         &rhent, &h_errno);
16431 ; return 0; }
16432 EOF
16433 if { (eval echo configure:16434: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16434   rm -rf conftest*
16435   ol_cv_func_gethostbyname_r_nargs6=yes
16436 else
16437   echo "configure: failed program was:" >&5
16438   cat conftest.$ac_ext >&5
16439   rm -rf conftest*
16440   ol_cv_func_gethostbyname_r_nargs6=no
16441 fi
16442 rm -f conftest*
16443
16444         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
16445                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
16446
16447                 ol_cv_func_gethostbyname_r_nargs=5
16448
16449         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
16450                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
16451
16452                 ol_cv_func_gethostbyname_r_nargs=6
16453
16454         else
16455                 ol_cv_func_gethostbyname_r_nargs=0
16456         fi
16457   
16458 fi
16459
16460 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
16461   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
16462         cat >> confdefs.h <<EOF
16463 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
16464 EOF
16465
16466   fi
16467
16468 else
16469         ol_cv_func_gethostbyname_r_nargs=0
16470 fi
16471  
16472 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
16473         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
16474 echo "configure:16475: checking number of arguments of gethostbyaddr_r" >&5
16475 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
16476   echo $ac_n "(cached) $ac_c" 1>&6
16477 else
16478   cat > conftest.$ac_ext <<EOF
16479 #line 16480 "configure"
16480 #include "confdefs.h"
16481 #include <sys/types.h>
16482 #include <sys/socket.h>
16483 #include <netinet/in.h>
16484 #include <netdb.h>
16485 #define BUFSIZE (sizeof(struct hostent)+10)
16486 int main() {
16487 struct hostent hent; char buffer[BUFSIZE]; 
16488             struct in_addr add;
16489             size_t alen=sizeof(struct in_addr);
16490             int bufsize=BUFSIZE;int h_errno;
16491                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
16492                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
16493 ; return 0; }
16494 EOF
16495 if { (eval echo configure:16496: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16496   rm -rf conftest*
16497   ol_cv_func_gethostbyaddr_r_nargs7=yes
16498 else
16499   echo "configure: failed program was:" >&5
16500   cat conftest.$ac_ext >&5
16501   rm -rf conftest*
16502   ol_cv_func_gethostbyaddr_r_nargs7=no
16503 fi
16504 rm -f conftest*
16505
16506         cat > conftest.$ac_ext <<EOF
16507 #line 16508 "configure"
16508 #include "confdefs.h"
16509 #include <sys/types.h>
16510 #include <sys/socket.h>
16511 #include <netinet/in.h>
16512 #include <netdb.h>
16513 #define BUFSIZE (sizeof(struct hostent)+10)
16514 int main() {
16515 struct hostent hent;
16516                 struct hostent *rhent; char buffer[BUFSIZE]; 
16517                 struct in_addr add;
16518                 size_t alen=sizeof(struct in_addr);
16519                 int bufsize=BUFSIZE;int h_errno;
16520                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
16521                         alen, AF_INET, &hent, buffer, bufsize, 
16522                         &rhent, &h_errno);
16523 ; return 0; }
16524 EOF
16525 if { (eval echo configure:16526: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16526   rm -rf conftest*
16527   ol_cv_func_gethostbyaddr_r_nargs8=yes
16528 else
16529   echo "configure: failed program was:" >&5
16530   cat conftest.$ac_ext >&5
16531   rm -rf conftest*
16532   ol_cv_func_gethostbyaddr_r_nargs8=no
16533 fi
16534 rm -f conftest*
16535
16536         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
16537                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
16538
16539                 ol_cv_func_gethostbyaddr_r_nargs=7
16540
16541         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
16542                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
16543
16544                 ol_cv_func_gethostbyaddr_r_nargs=8
16545
16546         else
16547                 ol_cv_func_gethostbyaddr_r_nargs=0
16548         fi
16549   
16550 fi
16551
16552 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
16553   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
16554     cat >> confdefs.h <<EOF
16555 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
16556 EOF
16557
16558   fi
16559
16560 else
16561         ol_cv_func_gethostbyaddr_r_nargs=0
16562 fi
16563
16564 ol_link_ldbm=no 
16565
16566 if test $ol_with_ldbm_api = auto \
16567         -o $ol_with_ldbm_api = berkeley \
16568         -o $ol_with_ldbm_api = bcompat ; then
16569
16570         if test $ol_with_ldbm_api = bcompat; then \
16571                 for ac_hdr in db_185.h db.h
16572 do
16573 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16574 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16575 echo "configure:16576: checking for $ac_hdr" >&5
16576 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16577   echo $ac_n "(cached) $ac_c" 1>&6
16578 else
16579   cat > conftest.$ac_ext <<EOF
16580 #line 16581 "configure"
16581 #include "confdefs.h"
16582 #include <$ac_hdr>
16583 EOF
16584 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16585 { (eval echo configure:16586: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16586 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16587 if test -z "$ac_err"; then
16588   rm -rf conftest*
16589   eval "ac_cv_header_$ac_safe=yes"
16590 else
16591   echo "$ac_err" >&5
16592   echo "configure: failed program was:" >&5
16593   cat conftest.$ac_ext >&5
16594   rm -rf conftest*
16595   eval "ac_cv_header_$ac_safe=no"
16596 fi
16597 rm -f conftest*
16598 fi
16599 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16600   echo "$ac_t""yes" 1>&6
16601     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16602   cat >> confdefs.h <<EOF
16603 #define $ac_tr_hdr 1
16604 EOF
16605  
16606 else
16607   echo "$ac_t""no" 1>&6
16608 fi
16609 done
16610
16611 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
16612         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
16613 echo "configure:16614: checking if Berkeley DB header compatibility" >&5
16614 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
16615   echo $ac_n "(cached) $ac_c" 1>&6
16616 else
16617   
16618                 cat > conftest.$ac_ext <<EOF
16619 #line 16620 "configure"
16620 #include "confdefs.h"
16621
16622 #if HAVE_DB_185_H
16623 #       include <db_185.h>
16624 #else
16625 #       include <db.h>
16626 #endif
16627
16628  /* this check could be improved */
16629 #ifndef DB_VERSION_MAJOR
16630 #       define DB_VERSION_MAJOR 1
16631 #endif
16632
16633 #if DB_VERSION_MAJOR == 1 
16634         __db_version_1
16635 #endif
16636
16637 EOF
16638 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16639   egrep "__db_version_1" >/dev/null 2>&1; then
16640   rm -rf conftest*
16641   ol_cv_header_db1=yes
16642 else
16643   rm -rf conftest*
16644   ol_cv_header_db1=no
16645 fi
16646 rm -f conftest*
16647
16648 fi
16649
16650 echo "$ac_t""$ol_cv_header_db1" 1>&6
16651
16652         if test $ol_cv_header_db1 = yes ; then
16653                 ol_cv_lib_db=no
16654 if test $ol_cv_lib_db = no ; then
16655         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
16656 echo "configure:16657: checking for Berkeley DB link (default)" >&5
16657 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
16658   echo $ac_n "(cached) $ac_c" 1>&6
16659 else
16660   
16661         ol_DB_LIB=
16662         ol_LIBS=$LIBS
16663         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16664
16665         cat > conftest.$ac_ext <<EOF
16666 #line 16667 "configure"
16667 #include "confdefs.h"
16668
16669 #ifdef HAVE_DB_185_H
16670 # include <db_185.h>
16671 #else
16672 # include <db.h>
16673 #endif
16674
16675 #ifndef DB_VERSION_MAJOR
16676 # define DB_VERSION_MAJOR 1
16677 #endif
16678
16679 #ifndef NULL
16680 #define NULL ((void*)0)
16681 #endif
16682
16683 int main() {
16684
16685 #if DB_VERSION_MAJOR > 1
16686         {
16687                 char *version;
16688                 int major, minor, patch;
16689
16690                 version = db_version( &major, &minor, &patch );
16691
16692                 if( major != DB_VERSION_MAJOR ||
16693                         minor < DB_VERSION_MINOR )
16694                 {
16695                         printf("Berkeley DB version mismatch\n"
16696                                 "\texpected: %s\n\tgot: %s\n",
16697                                 DB_VERSION_STRING, version);
16698                         return 1;
16699                 }
16700         }
16701 #endif
16702
16703 #if DB_VERSION_MAJOR > 2
16704         db_env_create( NULL, 0 );
16705 #elif DB_VERSION_MAJOR > 1
16706         db_appexit( NULL );
16707 #else
16708         (void) dbopen( NULL, 0, 0, 0, NULL);
16709 #endif
16710
16711 ; return 0; }
16712 EOF
16713 if { (eval echo configure:16714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16714   rm -rf conftest*
16715   ol_cv_db_none=yes
16716 else
16717   echo "configure: failed program was:" >&5
16718   cat conftest.$ac_ext >&5
16719   rm -rf conftest*
16720   ol_cv_db_none=no
16721 fi
16722 rm -f conftest*
16723
16724         LIBS="$ol_LIBS"
16725
16726 fi
16727
16728 echo "$ac_t""$ol_cv_db_none" 1>&6
16729
16730         if test $ol_cv_db_none = yes ; then
16731                 ol_cv_lib_db=yes
16732         fi
16733 fi
16734
16735 if test $ol_cv_lib_db = no ; then
16736         echo $ac_n "checking for Berkeley DB link (-ldb42)""... $ac_c" 1>&6
16737 echo "configure:16738: checking for Berkeley DB link (-ldb42)" >&5
16738 if eval "test \"\${ol_cv_db_db42+set}\" = set"; then
16739   echo $ac_n "(cached) $ac_c" 1>&6
16740 else
16741   
16742         ol_DB_LIB=-ldb42
16743         ol_LIBS=$LIBS
16744         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16745
16746         cat > conftest.$ac_ext <<EOF
16747 #line 16748 "configure"
16748 #include "confdefs.h"
16749
16750 #ifdef HAVE_DB_185_H
16751 # include <db_185.h>
16752 #else
16753 # include <db.h>
16754 #endif
16755
16756 #ifndef DB_VERSION_MAJOR
16757 # define DB_VERSION_MAJOR 1
16758 #endif
16759
16760 #ifndef NULL
16761 #define NULL ((void*)0)
16762 #endif
16763
16764 int main() {
16765
16766 #if DB_VERSION_MAJOR > 1
16767         {
16768                 char *version;
16769                 int major, minor, patch;
16770
16771                 version = db_version( &major, &minor, &patch );
16772
16773                 if( major != DB_VERSION_MAJOR ||
16774                         minor < DB_VERSION_MINOR )
16775                 {
16776                         printf("Berkeley DB version mismatch\n"
16777                                 "\texpected: %s\n\tgot: %s\n",
16778                                 DB_VERSION_STRING, version);
16779                         return 1;
16780                 }
16781         }
16782 #endif
16783
16784 #if DB_VERSION_MAJOR > 2
16785         db_env_create( NULL, 0 );
16786 #elif DB_VERSION_MAJOR > 1
16787         db_appexit( NULL );
16788 #else
16789         (void) dbopen( NULL, 0, 0, 0, NULL);
16790 #endif
16791
16792 ; return 0; }
16793 EOF
16794 if { (eval echo configure:16795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16795   rm -rf conftest*
16796   ol_cv_db_db42=yes
16797 else
16798   echo "configure: failed program was:" >&5
16799   cat conftest.$ac_ext >&5
16800   rm -rf conftest*
16801   ol_cv_db_db42=no
16802 fi
16803 rm -f conftest*
16804
16805         LIBS="$ol_LIBS"
16806
16807 fi
16808
16809 echo "$ac_t""$ol_cv_db_db42" 1>&6
16810
16811         if test $ol_cv_db_db42 = yes ; then
16812                 ol_cv_lib_db=-ldb42
16813         fi
16814 fi
16815
16816 if test $ol_cv_lib_db = no ; then
16817         echo $ac_n "checking for Berkeley DB link (-ldb-42)""... $ac_c" 1>&6
16818 echo "configure:16819: checking for Berkeley DB link (-ldb-42)" >&5
16819 if eval "test \"\${ol_cv_db_db_42+set}\" = set"; then
16820   echo $ac_n "(cached) $ac_c" 1>&6
16821 else
16822   
16823         ol_DB_LIB=-ldb-42
16824         ol_LIBS=$LIBS
16825         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16826
16827         cat > conftest.$ac_ext <<EOF
16828 #line 16829 "configure"
16829 #include "confdefs.h"
16830
16831 #ifdef HAVE_DB_185_H
16832 # include <db_185.h>
16833 #else
16834 # include <db.h>
16835 #endif
16836
16837 #ifndef DB_VERSION_MAJOR
16838 # define DB_VERSION_MAJOR 1
16839 #endif
16840
16841 #ifndef NULL
16842 #define NULL ((void*)0)
16843 #endif
16844
16845 int main() {
16846
16847 #if DB_VERSION_MAJOR > 1
16848         {
16849                 char *version;
16850                 int major, minor, patch;
16851
16852                 version = db_version( &major, &minor, &patch );
16853
16854                 if( major != DB_VERSION_MAJOR ||
16855                         minor < DB_VERSION_MINOR )
16856                 {
16857                         printf("Berkeley DB version mismatch\n"
16858                                 "\texpected: %s\n\tgot: %s\n",
16859                                 DB_VERSION_STRING, version);
16860                         return 1;
16861                 }
16862         }
16863 #endif
16864
16865 #if DB_VERSION_MAJOR > 2
16866         db_env_create( NULL, 0 );
16867 #elif DB_VERSION_MAJOR > 1
16868         db_appexit( NULL );
16869 #else
16870         (void) dbopen( NULL, 0, 0, 0, NULL);
16871 #endif
16872
16873 ; return 0; }
16874 EOF
16875 if { (eval echo configure:16876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16876   rm -rf conftest*
16877   ol_cv_db_db_42=yes
16878 else
16879   echo "configure: failed program was:" >&5
16880   cat conftest.$ac_ext >&5
16881   rm -rf conftest*
16882   ol_cv_db_db_42=no
16883 fi
16884 rm -f conftest*
16885
16886         LIBS="$ol_LIBS"
16887
16888 fi
16889
16890 echo "$ac_t""$ol_cv_db_db_42" 1>&6
16891
16892         if test $ol_cv_db_db_42 = yes ; then
16893                 ol_cv_lib_db=-ldb-42
16894         fi
16895 fi
16896
16897 if test $ol_cv_lib_db = no ; then
16898         echo $ac_n "checking for Berkeley DB link (-ldb-4.2)""... $ac_c" 1>&6
16899 echo "configure:16900: checking for Berkeley DB link (-ldb-4.2)" >&5
16900 if eval "test \"\${ol_cv_db_db_4_dot_2+set}\" = set"; then
16901   echo $ac_n "(cached) $ac_c" 1>&6
16902 else
16903   
16904         ol_DB_LIB=-ldb-4.2
16905         ol_LIBS=$LIBS
16906         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16907
16908         cat > conftest.$ac_ext <<EOF
16909 #line 16910 "configure"
16910 #include "confdefs.h"
16911
16912 #ifdef HAVE_DB_185_H
16913 # include <db_185.h>
16914 #else
16915 # include <db.h>
16916 #endif
16917
16918 #ifndef DB_VERSION_MAJOR
16919 # define DB_VERSION_MAJOR 1
16920 #endif
16921
16922 #ifndef NULL
16923 #define NULL ((void*)0)
16924 #endif
16925
16926 int main() {
16927
16928 #if DB_VERSION_MAJOR > 1
16929         {
16930                 char *version;
16931                 int major, minor, patch;
16932
16933                 version = db_version( &major, &minor, &patch );
16934
16935                 if( major != DB_VERSION_MAJOR ||
16936                         minor < DB_VERSION_MINOR )
16937                 {
16938                         printf("Berkeley DB version mismatch\n"
16939                                 "\texpected: %s\n\tgot: %s\n",
16940                                 DB_VERSION_STRING, version);
16941                         return 1;
16942                 }
16943         }
16944 #endif
16945
16946 #if DB_VERSION_MAJOR > 2
16947         db_env_create( NULL, 0 );
16948 #elif DB_VERSION_MAJOR > 1
16949         db_appexit( NULL );
16950 #else
16951         (void) dbopen( NULL, 0, 0, 0, NULL);
16952 #endif
16953
16954 ; return 0; }
16955 EOF
16956 if { (eval echo configure:16957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16957   rm -rf conftest*
16958   ol_cv_db_db_4_dot_2=yes
16959 else
16960   echo "configure: failed program was:" >&5
16961   cat conftest.$ac_ext >&5
16962   rm -rf conftest*
16963   ol_cv_db_db_4_dot_2=no
16964 fi
16965 rm -f conftest*
16966
16967         LIBS="$ol_LIBS"
16968
16969 fi
16970
16971 echo "$ac_t""$ol_cv_db_db_4_dot_2" 1>&6
16972
16973         if test $ol_cv_db_db_4_dot_2 = yes ; then
16974                 ol_cv_lib_db=-ldb-4.2
16975         fi
16976 fi
16977
16978 if test $ol_cv_lib_db = no ; then
16979         echo $ac_n "checking for Berkeley DB link (-ldb-4-2)""... $ac_c" 1>&6
16980 echo "configure:16981: checking for Berkeley DB link (-ldb-4-2)" >&5
16981 if eval "test \"\${ol_cv_db_db_4_2+set}\" = set"; then
16982   echo $ac_n "(cached) $ac_c" 1>&6
16983 else
16984   
16985         ol_DB_LIB=-ldb-4-2
16986         ol_LIBS=$LIBS
16987         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16988
16989         cat > conftest.$ac_ext <<EOF
16990 #line 16991 "configure"
16991 #include "confdefs.h"
16992
16993 #ifdef HAVE_DB_185_H
16994 # include <db_185.h>
16995 #else
16996 # include <db.h>
16997 #endif
16998
16999 #ifndef DB_VERSION_MAJOR
17000 # define DB_VERSION_MAJOR 1
17001 #endif
17002
17003 #ifndef NULL
17004 #define NULL ((void*)0)
17005 #endif
17006
17007 int main() {
17008
17009 #if DB_VERSION_MAJOR > 1
17010         {
17011                 char *version;
17012                 int major, minor, patch;
17013
17014                 version = db_version( &major, &minor, &patch );
17015
17016                 if( major != DB_VERSION_MAJOR ||
17017                         minor < DB_VERSION_MINOR )
17018                 {
17019                         printf("Berkeley DB version mismatch\n"
17020                                 "\texpected: %s\n\tgot: %s\n",
17021                                 DB_VERSION_STRING, version);
17022                         return 1;
17023                 }
17024         }
17025 #endif
17026
17027 #if DB_VERSION_MAJOR > 2
17028         db_env_create( NULL, 0 );
17029 #elif DB_VERSION_MAJOR > 1
17030         db_appexit( NULL );
17031 #else
17032         (void) dbopen( NULL, 0, 0, 0, NULL);
17033 #endif
17034
17035 ; return 0; }
17036 EOF
17037 if { (eval echo configure:17038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17038   rm -rf conftest*
17039   ol_cv_db_db_4_2=yes
17040 else
17041   echo "configure: failed program was:" >&5
17042   cat conftest.$ac_ext >&5
17043   rm -rf conftest*
17044   ol_cv_db_db_4_2=no
17045 fi
17046 rm -f conftest*
17047
17048         LIBS="$ol_LIBS"
17049
17050 fi
17051
17052 echo "$ac_t""$ol_cv_db_db_4_2" 1>&6
17053
17054         if test $ol_cv_db_db_4_2 = yes ; then
17055                 ol_cv_lib_db=-ldb-4-2
17056         fi
17057 fi
17058
17059 if test $ol_cv_lib_db = no ; then
17060         echo $ac_n "checking for Berkeley DB link (-ldb-4)""... $ac_c" 1>&6
17061 echo "configure:17062: checking for Berkeley DB link (-ldb-4)" >&5
17062 if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then
17063   echo $ac_n "(cached) $ac_c" 1>&6
17064 else
17065   
17066         ol_DB_LIB=-ldb-4
17067         ol_LIBS=$LIBS
17068         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17069
17070         cat > conftest.$ac_ext <<EOF
17071 #line 17072 "configure"
17072 #include "confdefs.h"
17073
17074 #ifdef HAVE_DB_185_H
17075 # include <db_185.h>
17076 #else
17077 # include <db.h>
17078 #endif
17079
17080 #ifndef DB_VERSION_MAJOR
17081 # define DB_VERSION_MAJOR 1
17082 #endif
17083
17084 #ifndef NULL
17085 #define NULL ((void*)0)
17086 #endif
17087
17088 int main() {
17089
17090 #if DB_VERSION_MAJOR > 1
17091         {
17092                 char *version;
17093                 int major, minor, patch;
17094
17095                 version = db_version( &major, &minor, &patch );
17096
17097                 if( major != DB_VERSION_MAJOR ||
17098                         minor < DB_VERSION_MINOR )
17099                 {
17100                         printf("Berkeley DB version mismatch\n"
17101                                 "\texpected: %s\n\tgot: %s\n",
17102                                 DB_VERSION_STRING, version);
17103                         return 1;
17104                 }
17105         }
17106 #endif
17107
17108 #if DB_VERSION_MAJOR > 2
17109         db_env_create( NULL, 0 );
17110 #elif DB_VERSION_MAJOR > 1
17111         db_appexit( NULL );
17112 #else
17113         (void) dbopen( NULL, 0, 0, 0, NULL);
17114 #endif
17115
17116 ; return 0; }
17117 EOF
17118 if { (eval echo configure:17119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17119   rm -rf conftest*
17120   ol_cv_db_db_4=yes
17121 else
17122   echo "configure: failed program was:" >&5
17123   cat conftest.$ac_ext >&5
17124   rm -rf conftest*
17125   ol_cv_db_db_4=no
17126 fi
17127 rm -f conftest*
17128
17129         LIBS="$ol_LIBS"
17130
17131 fi
17132
17133 echo "$ac_t""$ol_cv_db_db_4" 1>&6
17134
17135         if test $ol_cv_db_db_4 = yes ; then
17136                 ol_cv_lib_db=-ldb-4
17137         fi
17138 fi
17139
17140 if test $ol_cv_lib_db = no ; then
17141         echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
17142 echo "configure:17143: checking for Berkeley DB link (-ldb4)" >&5
17143 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
17144   echo $ac_n "(cached) $ac_c" 1>&6
17145 else
17146   
17147         ol_DB_LIB=-ldb4
17148         ol_LIBS=$LIBS
17149         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17150
17151         cat > conftest.$ac_ext <<EOF
17152 #line 17153 "configure"
17153 #include "confdefs.h"
17154
17155 #ifdef HAVE_DB_185_H
17156 # include <db_185.h>
17157 #else
17158 # include <db.h>
17159 #endif
17160
17161 #ifndef DB_VERSION_MAJOR
17162 # define DB_VERSION_MAJOR 1
17163 #endif
17164
17165 #ifndef NULL
17166 #define NULL ((void*)0)
17167 #endif
17168
17169 int main() {
17170
17171 #if DB_VERSION_MAJOR > 1
17172         {
17173                 char *version;
17174                 int major, minor, patch;
17175
17176                 version = db_version( &major, &minor, &patch );
17177
17178                 if( major != DB_VERSION_MAJOR ||
17179                         minor < DB_VERSION_MINOR )
17180                 {
17181                         printf("Berkeley DB version mismatch\n"
17182                                 "\texpected: %s\n\tgot: %s\n",
17183                                 DB_VERSION_STRING, version);
17184                         return 1;
17185                 }
17186         }
17187 #endif
17188
17189 #if DB_VERSION_MAJOR > 2
17190         db_env_create( NULL, 0 );
17191 #elif DB_VERSION_MAJOR > 1
17192         db_appexit( NULL );
17193 #else
17194         (void) dbopen( NULL, 0, 0, 0, NULL);
17195 #endif
17196
17197 ; return 0; }
17198 EOF
17199 if { (eval echo configure:17200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17200   rm -rf conftest*
17201   ol_cv_db_db4=yes
17202 else
17203   echo "configure: failed program was:" >&5
17204   cat conftest.$ac_ext >&5
17205   rm -rf conftest*
17206   ol_cv_db_db4=no
17207 fi
17208 rm -f conftest*
17209
17210         LIBS="$ol_LIBS"
17211
17212 fi
17213
17214 echo "$ac_t""$ol_cv_db_db4" 1>&6
17215
17216         if test $ol_cv_db_db4 = yes ; then
17217                 ol_cv_lib_db=-ldb4
17218         fi
17219 fi
17220
17221 if test $ol_cv_lib_db = no ; then
17222         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
17223 echo "configure:17224: checking for Berkeley DB link (-ldb)" >&5
17224 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
17225   echo $ac_n "(cached) $ac_c" 1>&6
17226 else
17227   
17228         ol_DB_LIB=-ldb
17229         ol_LIBS=$LIBS
17230         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17231
17232         cat > conftest.$ac_ext <<EOF
17233 #line 17234 "configure"
17234 #include "confdefs.h"
17235
17236 #ifdef HAVE_DB_185_H
17237 # include <db_185.h>
17238 #else
17239 # include <db.h>
17240 #endif
17241
17242 #ifndef DB_VERSION_MAJOR
17243 # define DB_VERSION_MAJOR 1
17244 #endif
17245
17246 #ifndef NULL
17247 #define NULL ((void*)0)
17248 #endif
17249
17250 int main() {
17251
17252 #if DB_VERSION_MAJOR > 1
17253         {
17254                 char *version;
17255                 int major, minor, patch;
17256
17257                 version = db_version( &major, &minor, &patch );
17258
17259                 if( major != DB_VERSION_MAJOR ||
17260                         minor < DB_VERSION_MINOR )
17261                 {
17262                         printf("Berkeley DB version mismatch\n"
17263                                 "\texpected: %s\n\tgot: %s\n",
17264                                 DB_VERSION_STRING, version);
17265                         return 1;
17266                 }
17267         }
17268 #endif
17269
17270 #if DB_VERSION_MAJOR > 2
17271         db_env_create( NULL, 0 );
17272 #elif DB_VERSION_MAJOR > 1
17273         db_appexit( NULL );
17274 #else
17275         (void) dbopen( NULL, 0, 0, 0, NULL);
17276 #endif
17277
17278 ; return 0; }
17279 EOF
17280 if { (eval echo configure:17281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17281   rm -rf conftest*
17282   ol_cv_db_db=yes
17283 else
17284   echo "configure: failed program was:" >&5
17285   cat conftest.$ac_ext >&5
17286   rm -rf conftest*
17287   ol_cv_db_db=no
17288 fi
17289 rm -f conftest*
17290
17291         LIBS="$ol_LIBS"
17292
17293 fi
17294
17295 echo "$ac_t""$ol_cv_db_db" 1>&6
17296
17297         if test $ol_cv_db_db = yes ; then
17298                 ol_cv_lib_db=-ldb
17299         fi
17300 fi
17301
17302 if test $ol_cv_lib_db = no ; then
17303         echo $ac_n "checking for Berkeley DB link (-ldb41)""... $ac_c" 1>&6
17304 echo "configure:17305: checking for Berkeley DB link (-ldb41)" >&5
17305 if eval "test \"\${ol_cv_db_db41+set}\" = set"; then
17306   echo $ac_n "(cached) $ac_c" 1>&6
17307 else
17308   
17309         ol_DB_LIB=-ldb41
17310         ol_LIBS=$LIBS
17311         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17312
17313         cat > conftest.$ac_ext <<EOF
17314 #line 17315 "configure"
17315 #include "confdefs.h"
17316
17317 #ifdef HAVE_DB_185_H
17318 # include <db_185.h>
17319 #else
17320 # include <db.h>
17321 #endif
17322
17323 #ifndef DB_VERSION_MAJOR
17324 # define DB_VERSION_MAJOR 1
17325 #endif
17326
17327 #ifndef NULL
17328 #define NULL ((void*)0)
17329 #endif
17330
17331 int main() {
17332
17333 #if DB_VERSION_MAJOR > 1
17334         {
17335                 char *version;
17336                 int major, minor, patch;
17337
17338                 version = db_version( &major, &minor, &patch );
17339
17340                 if( major != DB_VERSION_MAJOR ||
17341                         minor < DB_VERSION_MINOR )
17342                 {
17343                         printf("Berkeley DB version mismatch\n"
17344                                 "\texpected: %s\n\tgot: %s\n",
17345                                 DB_VERSION_STRING, version);
17346                         return 1;
17347                 }
17348         }
17349 #endif
17350
17351 #if DB_VERSION_MAJOR > 2
17352         db_env_create( NULL, 0 );
17353 #elif DB_VERSION_MAJOR > 1
17354         db_appexit( NULL );
17355 #else
17356         (void) dbopen( NULL, 0, 0, 0, NULL);
17357 #endif
17358
17359 ; return 0; }
17360 EOF
17361 if { (eval echo configure:17362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17362   rm -rf conftest*
17363   ol_cv_db_db41=yes
17364 else
17365   echo "configure: failed program was:" >&5
17366   cat conftest.$ac_ext >&5
17367   rm -rf conftest*
17368   ol_cv_db_db41=no
17369 fi
17370 rm -f conftest*
17371
17372         LIBS="$ol_LIBS"
17373
17374 fi
17375
17376 echo "$ac_t""$ol_cv_db_db41" 1>&6
17377
17378         if test $ol_cv_db_db41 = yes ; then
17379                 ol_cv_lib_db=-ldb41
17380         fi
17381 fi
17382
17383 if test $ol_cv_lib_db = no ; then
17384         echo $ac_n "checking for Berkeley DB link (-ldb-41)""... $ac_c" 1>&6
17385 echo "configure:17386: checking for Berkeley DB link (-ldb-41)" >&5
17386 if eval "test \"\${ol_cv_db_db_41+set}\" = set"; then
17387   echo $ac_n "(cached) $ac_c" 1>&6
17388 else
17389   
17390         ol_DB_LIB=-ldb-41
17391         ol_LIBS=$LIBS
17392         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17393
17394         cat > conftest.$ac_ext <<EOF
17395 #line 17396 "configure"
17396 #include "confdefs.h"
17397
17398 #ifdef HAVE_DB_185_H
17399 # include <db_185.h>
17400 #else
17401 # include <db.h>
17402 #endif
17403
17404 #ifndef DB_VERSION_MAJOR
17405 # define DB_VERSION_MAJOR 1
17406 #endif
17407
17408 #ifndef NULL
17409 #define NULL ((void*)0)
17410 #endif
17411
17412 int main() {
17413
17414 #if DB_VERSION_MAJOR > 1
17415         {
17416                 char *version;
17417                 int major, minor, patch;
17418
17419                 version = db_version( &major, &minor, &patch );
17420
17421                 if( major != DB_VERSION_MAJOR ||
17422                         minor < DB_VERSION_MINOR )
17423                 {
17424                         printf("Berkeley DB version mismatch\n"
17425                                 "\texpected: %s\n\tgot: %s\n",
17426                                 DB_VERSION_STRING, version);
17427                         return 1;
17428                 }
17429         }
17430 #endif
17431
17432 #if DB_VERSION_MAJOR > 2
17433         db_env_create( NULL, 0 );
17434 #elif DB_VERSION_MAJOR > 1
17435         db_appexit( NULL );
17436 #else
17437         (void) dbopen( NULL, 0, 0, 0, NULL);
17438 #endif
17439
17440 ; return 0; }
17441 EOF
17442 if { (eval echo configure:17443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17443   rm -rf conftest*
17444   ol_cv_db_db_41=yes
17445 else
17446   echo "configure: failed program was:" >&5
17447   cat conftest.$ac_ext >&5
17448   rm -rf conftest*
17449   ol_cv_db_db_41=no
17450 fi
17451 rm -f conftest*
17452
17453         LIBS="$ol_LIBS"
17454
17455 fi
17456
17457 echo "$ac_t""$ol_cv_db_db_41" 1>&6
17458
17459         if test $ol_cv_db_db_41 = yes ; then
17460                 ol_cv_lib_db=-ldb-41
17461         fi
17462 fi
17463
17464 if test $ol_cv_lib_db = no ; then
17465         echo $ac_n "checking for Berkeley DB link (-ldb-4.1)""... $ac_c" 1>&6
17466 echo "configure:17467: checking for Berkeley DB link (-ldb-4.1)" >&5
17467 if eval "test \"\${ol_cv_db_db_4_dot_1+set}\" = set"; then
17468   echo $ac_n "(cached) $ac_c" 1>&6
17469 else
17470   
17471         ol_DB_LIB=-ldb-4.1
17472         ol_LIBS=$LIBS
17473         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17474
17475         cat > conftest.$ac_ext <<EOF
17476 #line 17477 "configure"
17477 #include "confdefs.h"
17478
17479 #ifdef HAVE_DB_185_H
17480 # include <db_185.h>
17481 #else
17482 # include <db.h>
17483 #endif
17484
17485 #ifndef DB_VERSION_MAJOR
17486 # define DB_VERSION_MAJOR 1
17487 #endif
17488
17489 #ifndef NULL
17490 #define NULL ((void*)0)
17491 #endif
17492
17493 int main() {
17494
17495 #if DB_VERSION_MAJOR > 1
17496         {
17497                 char *version;
17498                 int major, minor, patch;
17499
17500                 version = db_version( &major, &minor, &patch );
17501
17502                 if( major != DB_VERSION_MAJOR ||
17503                         minor < DB_VERSION_MINOR )
17504                 {
17505                         printf("Berkeley DB version mismatch\n"
17506                                 "\texpected: %s\n\tgot: %s\n",
17507                                 DB_VERSION_STRING, version);
17508                         return 1;
17509                 }
17510         }
17511 #endif
17512
17513 #if DB_VERSION_MAJOR > 2
17514         db_env_create( NULL, 0 );
17515 #elif DB_VERSION_MAJOR > 1
17516         db_appexit( NULL );
17517 #else
17518         (void) dbopen( NULL, 0, 0, 0, NULL);
17519 #endif
17520
17521 ; return 0; }
17522 EOF
17523 if { (eval echo configure:17524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17524   rm -rf conftest*
17525   ol_cv_db_db_4_dot_1=yes
17526 else
17527   echo "configure: failed program was:" >&5
17528   cat conftest.$ac_ext >&5
17529   rm -rf conftest*
17530   ol_cv_db_db_4_dot_1=no
17531 fi
17532 rm -f conftest*
17533
17534         LIBS="$ol_LIBS"
17535
17536 fi
17537
17538 echo "$ac_t""$ol_cv_db_db_4_dot_1" 1>&6
17539
17540         if test $ol_cv_db_db_4_dot_1 = yes ; then
17541                 ol_cv_lib_db=-ldb-4.1
17542         fi
17543 fi
17544
17545 if test $ol_cv_lib_db = no ; then
17546         echo $ac_n "checking for Berkeley DB link (-ldb-4-1)""... $ac_c" 1>&6
17547 echo "configure:17548: checking for Berkeley DB link (-ldb-4-1)" >&5
17548 if eval "test \"\${ol_cv_db_db_4_1+set}\" = set"; then
17549   echo $ac_n "(cached) $ac_c" 1>&6
17550 else
17551   
17552         ol_DB_LIB=-ldb-4-1
17553         ol_LIBS=$LIBS
17554         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17555
17556         cat > conftest.$ac_ext <<EOF
17557 #line 17558 "configure"
17558 #include "confdefs.h"
17559
17560 #ifdef HAVE_DB_185_H
17561 # include <db_185.h>
17562 #else
17563 # include <db.h>
17564 #endif
17565
17566 #ifndef DB_VERSION_MAJOR
17567 # define DB_VERSION_MAJOR 1
17568 #endif
17569
17570 #ifndef NULL
17571 #define NULL ((void*)0)
17572 #endif
17573
17574 int main() {
17575
17576 #if DB_VERSION_MAJOR > 1
17577         {
17578                 char *version;
17579                 int major, minor, patch;
17580
17581                 version = db_version( &major, &minor, &patch );
17582
17583                 if( major != DB_VERSION_MAJOR ||
17584                         minor < DB_VERSION_MINOR )
17585                 {
17586                         printf("Berkeley DB version mismatch\n"
17587                                 "\texpected: %s\n\tgot: %s\n",
17588                                 DB_VERSION_STRING, version);
17589                         return 1;
17590                 }
17591         }
17592 #endif
17593
17594 #if DB_VERSION_MAJOR > 2
17595         db_env_create( NULL, 0 );
17596 #elif DB_VERSION_MAJOR > 1
17597         db_appexit( NULL );
17598 #else
17599         (void) dbopen( NULL, 0, 0, 0, NULL);
17600 #endif
17601
17602 ; return 0; }
17603 EOF
17604 if { (eval echo configure:17605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17605   rm -rf conftest*
17606   ol_cv_db_db_4_1=yes
17607 else
17608   echo "configure: failed program was:" >&5
17609   cat conftest.$ac_ext >&5
17610   rm -rf conftest*
17611   ol_cv_db_db_4_1=no
17612 fi
17613 rm -f conftest*
17614
17615         LIBS="$ol_LIBS"
17616
17617 fi
17618
17619 echo "$ac_t""$ol_cv_db_db_4_1" 1>&6
17620
17621         if test $ol_cv_db_db_4_1 = yes ; then
17622                 ol_cv_lib_db=-ldb-4-1
17623         fi
17624 fi
17625
17626 if test $ol_cv_lib_db = no ; then
17627         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
17628 echo "configure:17629: checking for Berkeley DB link (-ldb3)" >&5
17629 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
17630   echo $ac_n "(cached) $ac_c" 1>&6
17631 else
17632   
17633         ol_DB_LIB=-ldb3
17634         ol_LIBS=$LIBS
17635         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17636
17637         cat > conftest.$ac_ext <<EOF
17638 #line 17639 "configure"
17639 #include "confdefs.h"
17640
17641 #ifdef HAVE_DB_185_H
17642 # include <db_185.h>
17643 #else
17644 # include <db.h>
17645 #endif
17646
17647 #ifndef DB_VERSION_MAJOR
17648 # define DB_VERSION_MAJOR 1
17649 #endif
17650
17651 #ifndef NULL
17652 #define NULL ((void*)0)
17653 #endif
17654
17655 int main() {
17656
17657 #if DB_VERSION_MAJOR > 1
17658         {
17659                 char *version;
17660                 int major, minor, patch;
17661
17662                 version = db_version( &major, &minor, &patch );
17663
17664                 if( major != DB_VERSION_MAJOR ||
17665                         minor < DB_VERSION_MINOR )
17666                 {
17667                         printf("Berkeley DB version mismatch\n"
17668                                 "\texpected: %s\n\tgot: %s\n",
17669                                 DB_VERSION_STRING, version);
17670                         return 1;
17671                 }
17672         }
17673 #endif
17674
17675 #if DB_VERSION_MAJOR > 2
17676         db_env_create( NULL, 0 );
17677 #elif DB_VERSION_MAJOR > 1
17678         db_appexit( NULL );
17679 #else
17680         (void) dbopen( NULL, 0, 0, 0, NULL);
17681 #endif
17682
17683 ; return 0; }
17684 EOF
17685 if { (eval echo configure:17686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17686   rm -rf conftest*
17687   ol_cv_db_db3=yes
17688 else
17689   echo "configure: failed program was:" >&5
17690   cat conftest.$ac_ext >&5
17691   rm -rf conftest*
17692   ol_cv_db_db3=no
17693 fi
17694 rm -f conftest*
17695
17696         LIBS="$ol_LIBS"
17697
17698 fi
17699
17700 echo "$ac_t""$ol_cv_db_db3" 1>&6
17701
17702         if test $ol_cv_db_db3 = yes ; then
17703                 ol_cv_lib_db=-ldb3
17704         fi
17705 fi
17706
17707 if test $ol_cv_lib_db = no ; then
17708         echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6
17709 echo "configure:17710: checking for Berkeley DB link (-ldb-3)" >&5
17710 if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then
17711   echo $ac_n "(cached) $ac_c" 1>&6
17712 else
17713   
17714         ol_DB_LIB=-ldb-3
17715         ol_LIBS=$LIBS
17716         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17717
17718         cat > conftest.$ac_ext <<EOF
17719 #line 17720 "configure"
17720 #include "confdefs.h"
17721
17722 #ifdef HAVE_DB_185_H
17723 # include <db_185.h>
17724 #else
17725 # include <db.h>
17726 #endif
17727
17728 #ifndef DB_VERSION_MAJOR
17729 # define DB_VERSION_MAJOR 1
17730 #endif
17731
17732 #ifndef NULL
17733 #define NULL ((void*)0)
17734 #endif
17735
17736 int main() {
17737
17738 #if DB_VERSION_MAJOR > 1
17739         {
17740                 char *version;
17741                 int major, minor, patch;
17742
17743                 version = db_version( &major, &minor, &patch );
17744
17745                 if( major != DB_VERSION_MAJOR ||
17746                         minor < DB_VERSION_MINOR )
17747                 {
17748                         printf("Berkeley DB version mismatch\n"
17749                                 "\texpected: %s\n\tgot: %s\n",
17750                                 DB_VERSION_STRING, version);
17751                         return 1;
17752                 }
17753         }
17754 #endif
17755
17756 #if DB_VERSION_MAJOR > 2
17757         db_env_create( NULL, 0 );
17758 #elif DB_VERSION_MAJOR > 1
17759         db_appexit( NULL );
17760 #else
17761         (void) dbopen( NULL, 0, 0, 0, NULL);
17762 #endif
17763
17764 ; return 0; }
17765 EOF
17766 if { (eval echo configure:17767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17767   rm -rf conftest*
17768   ol_cv_db_db_3=yes
17769 else
17770   echo "configure: failed program was:" >&5
17771   cat conftest.$ac_ext >&5
17772   rm -rf conftest*
17773   ol_cv_db_db_3=no
17774 fi
17775 rm -f conftest*
17776
17777         LIBS="$ol_LIBS"
17778
17779 fi
17780
17781 echo "$ac_t""$ol_cv_db_db_3" 1>&6
17782
17783         if test $ol_cv_db_db_3 = yes ; then
17784                 ol_cv_lib_db=-ldb-3
17785         fi
17786 fi
17787
17788 if test $ol_cv_lib_db = no ; then
17789         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
17790 echo "configure:17791: checking for Berkeley DB link (-ldb2)" >&5
17791 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
17792   echo $ac_n "(cached) $ac_c" 1>&6
17793 else
17794   
17795         ol_DB_LIB=-ldb2
17796         ol_LIBS=$LIBS
17797         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17798
17799         cat > conftest.$ac_ext <<EOF
17800 #line 17801 "configure"
17801 #include "confdefs.h"
17802
17803 #ifdef HAVE_DB_185_H
17804 # include <db_185.h>
17805 #else
17806 # include <db.h>
17807 #endif
17808
17809 #ifndef DB_VERSION_MAJOR
17810 # define DB_VERSION_MAJOR 1
17811 #endif
17812
17813 #ifndef NULL
17814 #define NULL ((void*)0)
17815 #endif
17816
17817 int main() {
17818
17819 #if DB_VERSION_MAJOR > 1
17820         {
17821                 char *version;
17822                 int major, minor, patch;
17823
17824                 version = db_version( &major, &minor, &patch );
17825
17826                 if( major != DB_VERSION_MAJOR ||
17827                         minor < DB_VERSION_MINOR )
17828                 {
17829                         printf("Berkeley DB version mismatch\n"
17830                                 "\texpected: %s\n\tgot: %s\n",
17831                                 DB_VERSION_STRING, version);
17832                         return 1;
17833                 }
17834         }
17835 #endif
17836
17837 #if DB_VERSION_MAJOR > 2
17838         db_env_create( NULL, 0 );
17839 #elif DB_VERSION_MAJOR > 1
17840         db_appexit( NULL );
17841 #else
17842         (void) dbopen( NULL, 0, 0, 0, NULL);
17843 #endif
17844
17845 ; return 0; }
17846 EOF
17847 if { (eval echo configure:17848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17848   rm -rf conftest*
17849   ol_cv_db_db2=yes
17850 else
17851   echo "configure: failed program was:" >&5
17852   cat conftest.$ac_ext >&5
17853   rm -rf conftest*
17854   ol_cv_db_db2=no
17855 fi
17856 rm -f conftest*
17857
17858         LIBS="$ol_LIBS"
17859
17860 fi
17861
17862 echo "$ac_t""$ol_cv_db_db2" 1>&6
17863
17864         if test $ol_cv_db_db2 = yes ; then
17865                 ol_cv_lib_db=-ldb2
17866         fi
17867 fi
17868
17869 if test $ol_cv_lib_db = no ; then
17870         echo $ac_n "checking for Berkeley DB link (-ldb-2)""... $ac_c" 1>&6
17871 echo "configure:17872: checking for Berkeley DB link (-ldb-2)" >&5
17872 if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then
17873   echo $ac_n "(cached) $ac_c" 1>&6
17874 else
17875   
17876         ol_DB_LIB=-ldb-2
17877         ol_LIBS=$LIBS
17878         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17879
17880         cat > conftest.$ac_ext <<EOF
17881 #line 17882 "configure"
17882 #include "confdefs.h"
17883
17884 #ifdef HAVE_DB_185_H
17885 # include <db_185.h>
17886 #else
17887 # include <db.h>
17888 #endif
17889
17890 #ifndef DB_VERSION_MAJOR
17891 # define DB_VERSION_MAJOR 1
17892 #endif
17893
17894 #ifndef NULL
17895 #define NULL ((void*)0)
17896 #endif
17897
17898 int main() {
17899
17900 #if DB_VERSION_MAJOR > 1
17901         {
17902                 char *version;
17903                 int major, minor, patch;
17904
17905                 version = db_version( &major, &minor, &patch );
17906
17907                 if( major != DB_VERSION_MAJOR ||
17908                         minor < DB_VERSION_MINOR )
17909                 {
17910                         printf("Berkeley DB version mismatch\n"
17911                                 "\texpected: %s\n\tgot: %s\n",
17912                                 DB_VERSION_STRING, version);
17913                         return 1;
17914                 }
17915         }
17916 #endif
17917
17918 #if DB_VERSION_MAJOR > 2
17919         db_env_create( NULL, 0 );
17920 #elif DB_VERSION_MAJOR > 1
17921         db_appexit( NULL );
17922 #else
17923         (void) dbopen( NULL, 0, 0, 0, NULL);
17924 #endif
17925
17926 ; return 0; }
17927 EOF
17928 if { (eval echo configure:17929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17929   rm -rf conftest*
17930   ol_cv_db_db_2=yes
17931 else
17932   echo "configure: failed program was:" >&5
17933   cat conftest.$ac_ext >&5
17934   rm -rf conftest*
17935   ol_cv_db_db_2=no
17936 fi
17937 rm -f conftest*
17938
17939         LIBS="$ol_LIBS"
17940
17941 fi
17942
17943 echo "$ac_t""$ol_cv_db_db_2" 1>&6
17944
17945         if test $ol_cv_db_db_2 = yes ; then
17946                 ol_cv_lib_db=-ldb-2
17947         fi
17948 fi
17949
17950 if test $ol_cv_lib_db = no ; then
17951         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
17952 echo "configure:17953: checking for Berkeley DB link (-ldb1)" >&5
17953 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
17954   echo $ac_n "(cached) $ac_c" 1>&6
17955 else
17956   
17957         ol_DB_LIB=-ldb1
17958         ol_LIBS=$LIBS
17959         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17960
17961         cat > conftest.$ac_ext <<EOF
17962 #line 17963 "configure"
17963 #include "confdefs.h"
17964
17965 #ifdef HAVE_DB_185_H
17966 # include <db_185.h>
17967 #else
17968 # include <db.h>
17969 #endif
17970
17971 #ifndef DB_VERSION_MAJOR
17972 # define DB_VERSION_MAJOR 1
17973 #endif
17974
17975 #ifndef NULL
17976 #define NULL ((void*)0)
17977 #endif
17978
17979 int main() {
17980
17981 #if DB_VERSION_MAJOR > 1
17982         {
17983                 char *version;
17984                 int major, minor, patch;
17985
17986                 version = db_version( &major, &minor, &patch );
17987
17988                 if( major != DB_VERSION_MAJOR ||
17989                         minor < DB_VERSION_MINOR )
17990                 {
17991                         printf("Berkeley DB version mismatch\n"
17992                                 "\texpected: %s\n\tgot: %s\n",
17993                                 DB_VERSION_STRING, version);
17994                         return 1;
17995                 }
17996         }
17997 #endif
17998
17999 #if DB_VERSION_MAJOR > 2
18000         db_env_create( NULL, 0 );
18001 #elif DB_VERSION_MAJOR > 1
18002         db_appexit( NULL );
18003 #else
18004         (void) dbopen( NULL, 0, 0, 0, NULL);
18005 #endif
18006
18007 ; return 0; }
18008 EOF
18009 if { (eval echo configure:18010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18010   rm -rf conftest*
18011   ol_cv_db_db1=yes
18012 else
18013   echo "configure: failed program was:" >&5
18014   cat conftest.$ac_ext >&5
18015   rm -rf conftest*
18016   ol_cv_db_db1=no
18017 fi
18018 rm -f conftest*
18019
18020         LIBS="$ol_LIBS"
18021
18022 fi
18023
18024 echo "$ac_t""$ol_cv_db_db1" 1>&6
18025
18026         if test $ol_cv_db_db1 = yes ; then
18027                 ol_cv_lib_db=-ldb1
18028         fi
18029 fi
18030
18031 if test $ol_cv_lib_db = no ; then
18032         echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6
18033 echo "configure:18034: checking for Berkeley DB link (-ldb-1)" >&5
18034 if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then
18035   echo $ac_n "(cached) $ac_c" 1>&6
18036 else
18037   
18038         ol_DB_LIB=-ldb-1
18039         ol_LIBS=$LIBS
18040         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18041
18042         cat > conftest.$ac_ext <<EOF
18043 #line 18044 "configure"
18044 #include "confdefs.h"
18045
18046 #ifdef HAVE_DB_185_H
18047 # include <db_185.h>
18048 #else
18049 # include <db.h>
18050 #endif
18051
18052 #ifndef DB_VERSION_MAJOR
18053 # define DB_VERSION_MAJOR 1
18054 #endif
18055
18056 #ifndef NULL
18057 #define NULL ((void*)0)
18058 #endif
18059
18060 int main() {
18061
18062 #if DB_VERSION_MAJOR > 1
18063         {
18064                 char *version;
18065                 int major, minor, patch;
18066
18067                 version = db_version( &major, &minor, &patch );
18068
18069                 if( major != DB_VERSION_MAJOR ||
18070                         minor < DB_VERSION_MINOR )
18071                 {
18072                         printf("Berkeley DB version mismatch\n"
18073                                 "\texpected: %s\n\tgot: %s\n",
18074                                 DB_VERSION_STRING, version);
18075                         return 1;
18076                 }
18077         }
18078 #endif
18079
18080 #if DB_VERSION_MAJOR > 2
18081         db_env_create( NULL, 0 );
18082 #elif DB_VERSION_MAJOR > 1
18083         db_appexit( NULL );
18084 #else
18085         (void) dbopen( NULL, 0, 0, 0, NULL);
18086 #endif
18087
18088 ; return 0; }
18089 EOF
18090 if { (eval echo configure:18091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18091   rm -rf conftest*
18092   ol_cv_db_db_1=yes
18093 else
18094   echo "configure: failed program was:" >&5
18095   cat conftest.$ac_ext >&5
18096   rm -rf conftest*
18097   ol_cv_db_db_1=no
18098 fi
18099 rm -f conftest*
18100
18101         LIBS="$ol_LIBS"
18102
18103 fi
18104
18105 echo "$ac_t""$ol_cv_db_db_1" 1>&6
18106
18107         if test $ol_cv_db_db_1 = yes ; then
18108                 ol_cv_lib_db=-ldb-1
18109         fi
18110 fi
18111
18112
18113                 if test "$ol_cv_lib_db" != no ; then
18114                         ol_cv_berkeley_db=yes
18115                 fi
18116         fi
18117 fi
18118
18119         else
18120                 ol_cv_berkeley_db=no
18121 for ac_hdr in db.h
18122 do
18123 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
18124 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
18125 echo "configure:18126: checking for $ac_hdr" >&5
18126 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
18127   echo $ac_n "(cached) $ac_c" 1>&6
18128 else
18129   cat > conftest.$ac_ext <<EOF
18130 #line 18131 "configure"
18131 #include "confdefs.h"
18132 #include <$ac_hdr>
18133 EOF
18134 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
18135 { (eval echo configure:18136: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
18136 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
18137 if test -z "$ac_err"; then
18138   rm -rf conftest*
18139   eval "ac_cv_header_$ac_safe=yes"
18140 else
18141   echo "$ac_err" >&5
18142   echo "configure: failed program was:" >&5
18143   cat conftest.$ac_ext >&5
18144   rm -rf conftest*
18145   eval "ac_cv_header_$ac_safe=no"
18146 fi
18147 rm -f conftest*
18148 fi
18149 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
18150   echo "$ac_t""yes" 1>&6
18151     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
18152   cat >> confdefs.h <<EOF
18153 #define $ac_tr_hdr 1
18154 EOF
18155  
18156 else
18157   echo "$ac_t""no" 1>&6
18158 fi
18159 done
18160
18161 if test $ac_cv_header_db_h = yes; then
18162         ol_cv_lib_db=no
18163 if test $ol_cv_lib_db = no ; then
18164         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
18165 echo "configure:18166: checking for Berkeley DB link (default)" >&5
18166 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
18167   echo $ac_n "(cached) $ac_c" 1>&6
18168 else
18169   
18170         ol_DB_LIB=
18171         ol_LIBS=$LIBS
18172         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18173
18174         cat > conftest.$ac_ext <<EOF
18175 #line 18176 "configure"
18176 #include "confdefs.h"
18177
18178 #ifdef HAVE_DB_185_H
18179 # include <db_185.h>
18180 #else
18181 # include <db.h>
18182 #endif
18183
18184 #ifndef DB_VERSION_MAJOR
18185 # define DB_VERSION_MAJOR 1
18186 #endif
18187
18188 #ifndef NULL
18189 #define NULL ((void*)0)
18190 #endif
18191
18192 int main() {
18193
18194 #if DB_VERSION_MAJOR > 1
18195         {
18196                 char *version;
18197                 int major, minor, patch;
18198
18199                 version = db_version( &major, &minor, &patch );
18200
18201                 if( major != DB_VERSION_MAJOR ||
18202                         minor < DB_VERSION_MINOR )
18203                 {
18204                         printf("Berkeley DB version mismatch\n"
18205                                 "\texpected: %s\n\tgot: %s\n",
18206                                 DB_VERSION_STRING, version);
18207                         return 1;
18208                 }
18209         }
18210 #endif
18211
18212 #if DB_VERSION_MAJOR > 2
18213         db_env_create( NULL, 0 );
18214 #elif DB_VERSION_MAJOR > 1
18215         db_appexit( NULL );
18216 #else
18217         (void) dbopen( NULL, 0, 0, 0, NULL);
18218 #endif
18219
18220 ; return 0; }
18221 EOF
18222 if { (eval echo configure:18223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18223   rm -rf conftest*
18224   ol_cv_db_none=yes
18225 else
18226   echo "configure: failed program was:" >&5
18227   cat conftest.$ac_ext >&5
18228   rm -rf conftest*
18229   ol_cv_db_none=no
18230 fi
18231 rm -f conftest*
18232
18233         LIBS="$ol_LIBS"
18234
18235 fi
18236
18237 echo "$ac_t""$ol_cv_db_none" 1>&6
18238
18239         if test $ol_cv_db_none = yes ; then
18240                 ol_cv_lib_db=yes
18241         fi
18242 fi
18243
18244 if test $ol_cv_lib_db = no ; then
18245         echo $ac_n "checking for Berkeley DB link (-ldb42)""... $ac_c" 1>&6
18246 echo "configure:18247: checking for Berkeley DB link (-ldb42)" >&5
18247 if eval "test \"\${ol_cv_db_db42+set}\" = set"; then
18248   echo $ac_n "(cached) $ac_c" 1>&6
18249 else
18250   
18251         ol_DB_LIB=-ldb42
18252         ol_LIBS=$LIBS
18253         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18254
18255         cat > conftest.$ac_ext <<EOF
18256 #line 18257 "configure"
18257 #include "confdefs.h"
18258
18259 #ifdef HAVE_DB_185_H
18260 # include <db_185.h>
18261 #else
18262 # include <db.h>
18263 #endif
18264
18265 #ifndef DB_VERSION_MAJOR
18266 # define DB_VERSION_MAJOR 1
18267 #endif
18268
18269 #ifndef NULL
18270 #define NULL ((void*)0)
18271 #endif
18272
18273 int main() {
18274
18275 #if DB_VERSION_MAJOR > 1
18276         {
18277                 char *version;
18278                 int major, minor, patch;
18279
18280                 version = db_version( &major, &minor, &patch );
18281
18282                 if( major != DB_VERSION_MAJOR ||
18283                         minor < DB_VERSION_MINOR )
18284                 {
18285                         printf("Berkeley DB version mismatch\n"
18286                                 "\texpected: %s\n\tgot: %s\n",
18287                                 DB_VERSION_STRING, version);
18288                         return 1;
18289                 }
18290         }
18291 #endif
18292
18293 #if DB_VERSION_MAJOR > 2
18294         db_env_create( NULL, 0 );
18295 #elif DB_VERSION_MAJOR > 1
18296         db_appexit( NULL );
18297 #else
18298         (void) dbopen( NULL, 0, 0, 0, NULL);
18299 #endif
18300
18301 ; return 0; }
18302 EOF
18303 if { (eval echo configure:18304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18304   rm -rf conftest*
18305   ol_cv_db_db42=yes
18306 else
18307   echo "configure: failed program was:" >&5
18308   cat conftest.$ac_ext >&5
18309   rm -rf conftest*
18310   ol_cv_db_db42=no
18311 fi
18312 rm -f conftest*
18313
18314         LIBS="$ol_LIBS"
18315
18316 fi
18317
18318 echo "$ac_t""$ol_cv_db_db42" 1>&6
18319
18320         if test $ol_cv_db_db42 = yes ; then
18321                 ol_cv_lib_db=-ldb42
18322         fi
18323 fi
18324
18325 if test $ol_cv_lib_db = no ; then
18326         echo $ac_n "checking for Berkeley DB link (-ldb-42)""... $ac_c" 1>&6
18327 echo "configure:18328: checking for Berkeley DB link (-ldb-42)" >&5
18328 if eval "test \"\${ol_cv_db_db_42+set}\" = set"; then
18329   echo $ac_n "(cached) $ac_c" 1>&6
18330 else
18331   
18332         ol_DB_LIB=-ldb-42
18333         ol_LIBS=$LIBS
18334         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18335
18336         cat > conftest.$ac_ext <<EOF
18337 #line 18338 "configure"
18338 #include "confdefs.h"
18339
18340 #ifdef HAVE_DB_185_H
18341 # include <db_185.h>
18342 #else
18343 # include <db.h>
18344 #endif
18345
18346 #ifndef DB_VERSION_MAJOR
18347 # define DB_VERSION_MAJOR 1
18348 #endif
18349
18350 #ifndef NULL
18351 #define NULL ((void*)0)
18352 #endif
18353
18354 int main() {
18355
18356 #if DB_VERSION_MAJOR > 1
18357         {
18358                 char *version;
18359                 int major, minor, patch;
18360
18361                 version = db_version( &major, &minor, &patch );
18362
18363                 if( major != DB_VERSION_MAJOR ||
18364                         minor < DB_VERSION_MINOR )
18365                 {
18366                         printf("Berkeley DB version mismatch\n"
18367                                 "\texpected: %s\n\tgot: %s\n",
18368                                 DB_VERSION_STRING, version);
18369                         return 1;
18370                 }
18371         }
18372 #endif
18373
18374 #if DB_VERSION_MAJOR > 2
18375         db_env_create( NULL, 0 );
18376 #elif DB_VERSION_MAJOR > 1
18377         db_appexit( NULL );
18378 #else
18379         (void) dbopen( NULL, 0, 0, 0, NULL);
18380 #endif
18381
18382 ; return 0; }
18383 EOF
18384 if { (eval echo configure:18385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18385   rm -rf conftest*
18386   ol_cv_db_db_42=yes
18387 else
18388   echo "configure: failed program was:" >&5
18389   cat conftest.$ac_ext >&5
18390   rm -rf conftest*
18391   ol_cv_db_db_42=no
18392 fi
18393 rm -f conftest*
18394
18395         LIBS="$ol_LIBS"
18396
18397 fi
18398
18399 echo "$ac_t""$ol_cv_db_db_42" 1>&6
18400
18401         if test $ol_cv_db_db_42 = yes ; then
18402                 ol_cv_lib_db=-ldb-42
18403         fi
18404 fi
18405
18406 if test $ol_cv_lib_db = no ; then
18407         echo $ac_n "checking for Berkeley DB link (-ldb-4.2)""... $ac_c" 1>&6
18408 echo "configure:18409: checking for Berkeley DB link (-ldb-4.2)" >&5
18409 if eval "test \"\${ol_cv_db_db_4_dot_2+set}\" = set"; then
18410   echo $ac_n "(cached) $ac_c" 1>&6
18411 else
18412   
18413         ol_DB_LIB=-ldb-4.2
18414         ol_LIBS=$LIBS
18415         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18416
18417         cat > conftest.$ac_ext <<EOF
18418 #line 18419 "configure"
18419 #include "confdefs.h"
18420
18421 #ifdef HAVE_DB_185_H
18422 # include <db_185.h>
18423 #else
18424 # include <db.h>
18425 #endif
18426
18427 #ifndef DB_VERSION_MAJOR
18428 # define DB_VERSION_MAJOR 1
18429 #endif
18430
18431 #ifndef NULL
18432 #define NULL ((void*)0)
18433 #endif
18434
18435 int main() {
18436
18437 #if DB_VERSION_MAJOR > 1
18438         {
18439                 char *version;
18440                 int major, minor, patch;
18441
18442                 version = db_version( &major, &minor, &patch );
18443
18444                 if( major != DB_VERSION_MAJOR ||
18445                         minor < DB_VERSION_MINOR )
18446                 {
18447                         printf("Berkeley DB version mismatch\n"
18448                                 "\texpected: %s\n\tgot: %s\n",
18449                                 DB_VERSION_STRING, version);
18450                         return 1;
18451                 }
18452         }
18453 #endif
18454
18455 #if DB_VERSION_MAJOR > 2
18456         db_env_create( NULL, 0 );
18457 #elif DB_VERSION_MAJOR > 1
18458         db_appexit( NULL );
18459 #else
18460         (void) dbopen( NULL, 0, 0, 0, NULL);
18461 #endif
18462
18463 ; return 0; }
18464 EOF
18465 if { (eval echo configure:18466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18466   rm -rf conftest*
18467   ol_cv_db_db_4_dot_2=yes
18468 else
18469   echo "configure: failed program was:" >&5
18470   cat conftest.$ac_ext >&5
18471   rm -rf conftest*
18472   ol_cv_db_db_4_dot_2=no
18473 fi
18474 rm -f conftest*
18475
18476         LIBS="$ol_LIBS"
18477
18478 fi
18479
18480 echo "$ac_t""$ol_cv_db_db_4_dot_2" 1>&6
18481
18482         if test $ol_cv_db_db_4_dot_2 = yes ; then
18483                 ol_cv_lib_db=-ldb-4.2
18484         fi
18485 fi
18486
18487 if test $ol_cv_lib_db = no ; then
18488         echo $ac_n "checking for Berkeley DB link (-ldb-4-2)""... $ac_c" 1>&6
18489 echo "configure:18490: checking for Berkeley DB link (-ldb-4-2)" >&5
18490 if eval "test \"\${ol_cv_db_db_4_2+set}\" = set"; then
18491   echo $ac_n "(cached) $ac_c" 1>&6
18492 else
18493   
18494         ol_DB_LIB=-ldb-4-2
18495         ol_LIBS=$LIBS
18496         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18497
18498         cat > conftest.$ac_ext <<EOF
18499 #line 18500 "configure"
18500 #include "confdefs.h"
18501
18502 #ifdef HAVE_DB_185_H
18503 # include <db_185.h>
18504 #else
18505 # include <db.h>
18506 #endif
18507
18508 #ifndef DB_VERSION_MAJOR
18509 # define DB_VERSION_MAJOR 1
18510 #endif
18511
18512 #ifndef NULL
18513 #define NULL ((void*)0)
18514 #endif
18515
18516 int main() {
18517
18518 #if DB_VERSION_MAJOR > 1
18519         {
18520                 char *version;
18521                 int major, minor, patch;
18522
18523                 version = db_version( &major, &minor, &patch );
18524
18525                 if( major != DB_VERSION_MAJOR ||
18526                         minor < DB_VERSION_MINOR )
18527                 {
18528                         printf("Berkeley DB version mismatch\n"
18529                                 "\texpected: %s\n\tgot: %s\n",
18530                                 DB_VERSION_STRING, version);
18531                         return 1;
18532                 }
18533         }
18534 #endif
18535
18536 #if DB_VERSION_MAJOR > 2
18537         db_env_create( NULL, 0 );
18538 #elif DB_VERSION_MAJOR > 1
18539         db_appexit( NULL );
18540 #else
18541         (void) dbopen( NULL, 0, 0, 0, NULL);
18542 #endif
18543
18544 ; return 0; }
18545 EOF
18546 if { (eval echo configure:18547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18547   rm -rf conftest*
18548   ol_cv_db_db_4_2=yes
18549 else
18550   echo "configure: failed program was:" >&5
18551   cat conftest.$ac_ext >&5
18552   rm -rf conftest*
18553   ol_cv_db_db_4_2=no
18554 fi
18555 rm -f conftest*
18556
18557         LIBS="$ol_LIBS"
18558
18559 fi
18560
18561 echo "$ac_t""$ol_cv_db_db_4_2" 1>&6
18562
18563         if test $ol_cv_db_db_4_2 = yes ; then
18564                 ol_cv_lib_db=-ldb-4-2
18565         fi
18566 fi
18567
18568 if test $ol_cv_lib_db = no ; then
18569         echo $ac_n "checking for Berkeley DB link (-ldb-4)""... $ac_c" 1>&6
18570 echo "configure:18571: checking for Berkeley DB link (-ldb-4)" >&5
18571 if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then
18572   echo $ac_n "(cached) $ac_c" 1>&6
18573 else
18574   
18575         ol_DB_LIB=-ldb-4
18576         ol_LIBS=$LIBS
18577         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18578
18579         cat > conftest.$ac_ext <<EOF
18580 #line 18581 "configure"
18581 #include "confdefs.h"
18582
18583 #ifdef HAVE_DB_185_H
18584 # include <db_185.h>
18585 #else
18586 # include <db.h>
18587 #endif
18588
18589 #ifndef DB_VERSION_MAJOR
18590 # define DB_VERSION_MAJOR 1
18591 #endif
18592
18593 #ifndef NULL
18594 #define NULL ((void*)0)
18595 #endif
18596
18597 int main() {
18598
18599 #if DB_VERSION_MAJOR > 1
18600         {
18601                 char *version;
18602                 int major, minor, patch;
18603
18604                 version = db_version( &major, &minor, &patch );
18605
18606                 if( major != DB_VERSION_MAJOR ||
18607                         minor < DB_VERSION_MINOR )
18608                 {
18609                         printf("Berkeley DB version mismatch\n"
18610                                 "\texpected: %s\n\tgot: %s\n",
18611                                 DB_VERSION_STRING, version);
18612                         return 1;
18613                 }
18614         }
18615 #endif
18616
18617 #if DB_VERSION_MAJOR > 2
18618         db_env_create( NULL, 0 );
18619 #elif DB_VERSION_MAJOR > 1
18620         db_appexit( NULL );
18621 #else
18622         (void) dbopen( NULL, 0, 0, 0, NULL);
18623 #endif
18624
18625 ; return 0; }
18626 EOF
18627 if { (eval echo configure:18628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18628   rm -rf conftest*
18629   ol_cv_db_db_4=yes
18630 else
18631   echo "configure: failed program was:" >&5
18632   cat conftest.$ac_ext >&5
18633   rm -rf conftest*
18634   ol_cv_db_db_4=no
18635 fi
18636 rm -f conftest*
18637
18638         LIBS="$ol_LIBS"
18639
18640 fi
18641
18642 echo "$ac_t""$ol_cv_db_db_4" 1>&6
18643
18644         if test $ol_cv_db_db_4 = yes ; then
18645                 ol_cv_lib_db=-ldb-4
18646         fi
18647 fi
18648
18649 if test $ol_cv_lib_db = no ; then
18650         echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
18651 echo "configure:18652: checking for Berkeley DB link (-ldb4)" >&5
18652 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
18653   echo $ac_n "(cached) $ac_c" 1>&6
18654 else
18655   
18656         ol_DB_LIB=-ldb4
18657         ol_LIBS=$LIBS
18658         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18659
18660         cat > conftest.$ac_ext <<EOF
18661 #line 18662 "configure"
18662 #include "confdefs.h"
18663
18664 #ifdef HAVE_DB_185_H
18665 # include <db_185.h>
18666 #else
18667 # include <db.h>
18668 #endif
18669
18670 #ifndef DB_VERSION_MAJOR
18671 # define DB_VERSION_MAJOR 1
18672 #endif
18673
18674 #ifndef NULL
18675 #define NULL ((void*)0)
18676 #endif
18677
18678 int main() {
18679
18680 #if DB_VERSION_MAJOR > 1
18681         {
18682                 char *version;
18683                 int major, minor, patch;
18684
18685                 version = db_version( &major, &minor, &patch );
18686
18687                 if( major != DB_VERSION_MAJOR ||
18688                         minor < DB_VERSION_MINOR )
18689                 {
18690                         printf("Berkeley DB version mismatch\n"
18691                                 "\texpected: %s\n\tgot: %s\n",
18692                                 DB_VERSION_STRING, version);
18693                         return 1;
18694                 }
18695         }
18696 #endif
18697
18698 #if DB_VERSION_MAJOR > 2
18699         db_env_create( NULL, 0 );
18700 #elif DB_VERSION_MAJOR > 1
18701         db_appexit( NULL );
18702 #else
18703         (void) dbopen( NULL, 0, 0, 0, NULL);
18704 #endif
18705
18706 ; return 0; }
18707 EOF
18708 if { (eval echo configure:18709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18709   rm -rf conftest*
18710   ol_cv_db_db4=yes
18711 else
18712   echo "configure: failed program was:" >&5
18713   cat conftest.$ac_ext >&5
18714   rm -rf conftest*
18715   ol_cv_db_db4=no
18716 fi
18717 rm -f conftest*
18718
18719         LIBS="$ol_LIBS"
18720
18721 fi
18722
18723 echo "$ac_t""$ol_cv_db_db4" 1>&6
18724
18725         if test $ol_cv_db_db4 = yes ; then
18726                 ol_cv_lib_db=-ldb4
18727         fi
18728 fi
18729
18730 if test $ol_cv_lib_db = no ; then
18731         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
18732 echo "configure:18733: checking for Berkeley DB link (-ldb)" >&5
18733 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
18734   echo $ac_n "(cached) $ac_c" 1>&6
18735 else
18736   
18737         ol_DB_LIB=-ldb
18738         ol_LIBS=$LIBS
18739         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18740
18741         cat > conftest.$ac_ext <<EOF
18742 #line 18743 "configure"
18743 #include "confdefs.h"
18744
18745 #ifdef HAVE_DB_185_H
18746 # include <db_185.h>
18747 #else
18748 # include <db.h>
18749 #endif
18750
18751 #ifndef DB_VERSION_MAJOR
18752 # define DB_VERSION_MAJOR 1
18753 #endif
18754
18755 #ifndef NULL
18756 #define NULL ((void*)0)
18757 #endif
18758
18759 int main() {
18760
18761 #if DB_VERSION_MAJOR > 1
18762         {
18763                 char *version;
18764                 int major, minor, patch;
18765
18766                 version = db_version( &major, &minor, &patch );
18767
18768                 if( major != DB_VERSION_MAJOR ||
18769                         minor < DB_VERSION_MINOR )
18770                 {
18771                         printf("Berkeley DB version mismatch\n"
18772                                 "\texpected: %s\n\tgot: %s\n",
18773                                 DB_VERSION_STRING, version);
18774                         return 1;
18775                 }
18776         }
18777 #endif
18778
18779 #if DB_VERSION_MAJOR > 2
18780         db_env_create( NULL, 0 );
18781 #elif DB_VERSION_MAJOR > 1
18782         db_appexit( NULL );
18783 #else
18784         (void) dbopen( NULL, 0, 0, 0, NULL);
18785 #endif
18786
18787 ; return 0; }
18788 EOF
18789 if { (eval echo configure:18790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18790   rm -rf conftest*
18791   ol_cv_db_db=yes
18792 else
18793   echo "configure: failed program was:" >&5
18794   cat conftest.$ac_ext >&5
18795   rm -rf conftest*
18796   ol_cv_db_db=no
18797 fi
18798 rm -f conftest*
18799
18800         LIBS="$ol_LIBS"
18801
18802 fi
18803
18804 echo "$ac_t""$ol_cv_db_db" 1>&6
18805
18806         if test $ol_cv_db_db = yes ; then
18807                 ol_cv_lib_db=-ldb
18808         fi
18809 fi
18810
18811 if test $ol_cv_lib_db = no ; then
18812         echo $ac_n "checking for Berkeley DB link (-ldb41)""... $ac_c" 1>&6
18813 echo "configure:18814: checking for Berkeley DB link (-ldb41)" >&5
18814 if eval "test \"\${ol_cv_db_db41+set}\" = set"; then
18815   echo $ac_n "(cached) $ac_c" 1>&6
18816 else
18817   
18818         ol_DB_LIB=-ldb41
18819         ol_LIBS=$LIBS
18820         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18821
18822         cat > conftest.$ac_ext <<EOF
18823 #line 18824 "configure"
18824 #include "confdefs.h"
18825
18826 #ifdef HAVE_DB_185_H
18827 # include <db_185.h>
18828 #else
18829 # include <db.h>
18830 #endif
18831
18832 #ifndef DB_VERSION_MAJOR
18833 # define DB_VERSION_MAJOR 1
18834 #endif
18835
18836 #ifndef NULL
18837 #define NULL ((void*)0)
18838 #endif
18839
18840 int main() {
18841
18842 #if DB_VERSION_MAJOR > 1
18843         {
18844                 char *version;
18845                 int major, minor, patch;
18846
18847                 version = db_version( &major, &minor, &patch );
18848
18849                 if( major != DB_VERSION_MAJOR ||
18850                         minor < DB_VERSION_MINOR )
18851                 {
18852                         printf("Berkeley DB version mismatch\n"
18853                                 "\texpected: %s\n\tgot: %s\n",
18854                                 DB_VERSION_STRING, version);
18855                         return 1;
18856                 }
18857         }
18858 #endif
18859
18860 #if DB_VERSION_MAJOR > 2
18861         db_env_create( NULL, 0 );
18862 #elif DB_VERSION_MAJOR > 1
18863         db_appexit( NULL );
18864 #else
18865         (void) dbopen( NULL, 0, 0, 0, NULL);
18866 #endif
18867
18868 ; return 0; }
18869 EOF
18870 if { (eval echo configure:18871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18871   rm -rf conftest*
18872   ol_cv_db_db41=yes
18873 else
18874   echo "configure: failed program was:" >&5
18875   cat conftest.$ac_ext >&5
18876   rm -rf conftest*
18877   ol_cv_db_db41=no
18878 fi
18879 rm -f conftest*
18880
18881         LIBS="$ol_LIBS"
18882
18883 fi
18884
18885 echo "$ac_t""$ol_cv_db_db41" 1>&6
18886
18887         if test $ol_cv_db_db41 = yes ; then
18888                 ol_cv_lib_db=-ldb41
18889         fi
18890 fi
18891
18892 if test $ol_cv_lib_db = no ; then
18893         echo $ac_n "checking for Berkeley DB link (-ldb-41)""... $ac_c" 1>&6
18894 echo "configure:18895: checking for Berkeley DB link (-ldb-41)" >&5
18895 if eval "test \"\${ol_cv_db_db_41+set}\" = set"; then
18896   echo $ac_n "(cached) $ac_c" 1>&6
18897 else
18898   
18899         ol_DB_LIB=-ldb-41
18900         ol_LIBS=$LIBS
18901         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18902
18903         cat > conftest.$ac_ext <<EOF
18904 #line 18905 "configure"
18905 #include "confdefs.h"
18906
18907 #ifdef HAVE_DB_185_H
18908 # include <db_185.h>
18909 #else
18910 # include <db.h>
18911 #endif
18912
18913 #ifndef DB_VERSION_MAJOR
18914 # define DB_VERSION_MAJOR 1
18915 #endif
18916
18917 #ifndef NULL
18918 #define NULL ((void*)0)
18919 #endif
18920
18921 int main() {
18922
18923 #if DB_VERSION_MAJOR > 1
18924         {
18925                 char *version;
18926                 int major, minor, patch;
18927
18928                 version = db_version( &major, &minor, &patch );
18929
18930                 if( major != DB_VERSION_MAJOR ||
18931                         minor < DB_VERSION_MINOR )
18932                 {
18933                         printf("Berkeley DB version mismatch\n"
18934                                 "\texpected: %s\n\tgot: %s\n",
18935                                 DB_VERSION_STRING, version);
18936                         return 1;
18937                 }
18938         }
18939 #endif
18940
18941 #if DB_VERSION_MAJOR > 2
18942         db_env_create( NULL, 0 );
18943 #elif DB_VERSION_MAJOR > 1
18944         db_appexit( NULL );
18945 #else
18946         (void) dbopen( NULL, 0, 0, 0, NULL);
18947 #endif
18948
18949 ; return 0; }
18950 EOF
18951 if { (eval echo configure:18952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18952   rm -rf conftest*
18953   ol_cv_db_db_41=yes
18954 else
18955   echo "configure: failed program was:" >&5
18956   cat conftest.$ac_ext >&5
18957   rm -rf conftest*
18958   ol_cv_db_db_41=no
18959 fi
18960 rm -f conftest*
18961
18962         LIBS="$ol_LIBS"
18963
18964 fi
18965
18966 echo "$ac_t""$ol_cv_db_db_41" 1>&6
18967
18968         if test $ol_cv_db_db_41 = yes ; then
18969                 ol_cv_lib_db=-ldb-41
18970         fi
18971 fi
18972
18973 if test $ol_cv_lib_db = no ; then
18974         echo $ac_n "checking for Berkeley DB link (-ldb-4.1)""... $ac_c" 1>&6
18975 echo "configure:18976: checking for Berkeley DB link (-ldb-4.1)" >&5
18976 if eval "test \"\${ol_cv_db_db_4_dot_1+set}\" = set"; then
18977   echo $ac_n "(cached) $ac_c" 1>&6
18978 else
18979   
18980         ol_DB_LIB=-ldb-4.1
18981         ol_LIBS=$LIBS
18982         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18983
18984         cat > conftest.$ac_ext <<EOF
18985 #line 18986 "configure"
18986 #include "confdefs.h"
18987
18988 #ifdef HAVE_DB_185_H
18989 # include <db_185.h>
18990 #else
18991 # include <db.h>
18992 #endif
18993
18994 #ifndef DB_VERSION_MAJOR
18995 # define DB_VERSION_MAJOR 1
18996 #endif
18997
18998 #ifndef NULL
18999 #define NULL ((void*)0)
19000 #endif
19001
19002 int main() {
19003
19004 #if DB_VERSION_MAJOR > 1
19005         {
19006                 char *version;
19007                 int major, minor, patch;
19008
19009                 version = db_version( &major, &minor, &patch );
19010
19011                 if( major != DB_VERSION_MAJOR ||
19012                         minor < DB_VERSION_MINOR )
19013                 {
19014                         printf("Berkeley DB version mismatch\n"
19015                                 "\texpected: %s\n\tgot: %s\n",
19016                                 DB_VERSION_STRING, version);
19017                         return 1;
19018                 }
19019         }
19020 #endif
19021
19022 #if DB_VERSION_MAJOR > 2
19023         db_env_create( NULL, 0 );
19024 #elif DB_VERSION_MAJOR > 1
19025         db_appexit( NULL );
19026 #else
19027         (void) dbopen( NULL, 0, 0, 0, NULL);
19028 #endif
19029
19030 ; return 0; }
19031 EOF
19032 if { (eval echo configure:19033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19033   rm -rf conftest*
19034   ol_cv_db_db_4_dot_1=yes
19035 else
19036   echo "configure: failed program was:" >&5
19037   cat conftest.$ac_ext >&5
19038   rm -rf conftest*
19039   ol_cv_db_db_4_dot_1=no
19040 fi
19041 rm -f conftest*
19042
19043         LIBS="$ol_LIBS"
19044
19045 fi
19046
19047 echo "$ac_t""$ol_cv_db_db_4_dot_1" 1>&6
19048
19049         if test $ol_cv_db_db_4_dot_1 = yes ; then
19050                 ol_cv_lib_db=-ldb-4.1
19051         fi
19052 fi
19053
19054 if test $ol_cv_lib_db = no ; then
19055         echo $ac_n "checking for Berkeley DB link (-ldb-4-1)""... $ac_c" 1>&6
19056 echo "configure:19057: checking for Berkeley DB link (-ldb-4-1)" >&5
19057 if eval "test \"\${ol_cv_db_db_4_1+set}\" = set"; then
19058   echo $ac_n "(cached) $ac_c" 1>&6
19059 else
19060   
19061         ol_DB_LIB=-ldb-4-1
19062         ol_LIBS=$LIBS
19063         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
19064
19065         cat > conftest.$ac_ext <<EOF
19066 #line 19067 "configure"
19067 #include "confdefs.h"
19068
19069 #ifdef HAVE_DB_185_H
19070 # include <db_185.h>
19071 #else
19072 # include <db.h>
19073 #endif
19074
19075 #ifndef DB_VERSION_MAJOR
19076 # define DB_VERSION_MAJOR 1
19077 #endif
19078
19079 #ifndef NULL
19080 #define NULL ((void*)0)
19081 #endif
19082
19083 int main() {
19084
19085 #if DB_VERSION_MAJOR > 1
19086         {
19087                 char *version;
19088                 int major, minor, patch;
19089
19090                 version = db_version( &major, &minor, &patch );
19091
19092                 if( major != DB_VERSION_MAJOR ||
19093                         minor < DB_VERSION_MINOR )
19094                 {
19095                         printf("Berkeley DB version mismatch\n"
19096                                 "\texpected: %s\n\tgot: %s\n",
19097                                 DB_VERSION_STRING, version);
19098                         return 1;
19099                 }
19100         }
19101 #endif
19102
19103 #if DB_VERSION_MAJOR > 2
19104         db_env_create( NULL, 0 );
19105 #elif DB_VERSION_MAJOR > 1
19106         db_appexit( NULL );
19107 #else
19108         (void) dbopen( NULL, 0, 0, 0, NULL);
19109 #endif
19110
19111 ; return 0; }
19112 EOF
19113 if { (eval echo configure:19114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19114   rm -rf conftest*
19115   ol_cv_db_db_4_1=yes
19116 else
19117   echo "configure: failed program was:" >&5
19118   cat conftest.$ac_ext >&5
19119   rm -rf conftest*
19120   ol_cv_db_db_4_1=no
19121 fi
19122 rm -f conftest*
19123
19124         LIBS="$ol_LIBS"
19125
19126 fi
19127
19128 echo "$ac_t""$ol_cv_db_db_4_1" 1>&6
19129
19130         if test $ol_cv_db_db_4_1 = yes ; then
19131                 ol_cv_lib_db=-ldb-4-1
19132         fi
19133 fi
19134
19135 if test $ol_cv_lib_db = no ; then
19136         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
19137 echo "configure:19138: checking for Berkeley DB link (-ldb3)" >&5
19138 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
19139   echo $ac_n "(cached) $ac_c" 1>&6
19140 else
19141   
19142         ol_DB_LIB=-ldb3
19143         ol_LIBS=$LIBS
19144         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
19145
19146         cat > conftest.$ac_ext <<EOF
19147 #line 19148 "configure"
19148 #include "confdefs.h"
19149
19150 #ifdef HAVE_DB_185_H
19151 # include <db_185.h>
19152 #else
19153 # include <db.h>
19154 #endif
19155
19156 #ifndef DB_VERSION_MAJOR
19157 # define DB_VERSION_MAJOR 1
19158 #endif
19159
19160 #ifndef NULL
19161 #define NULL ((void*)0)
19162 #endif
19163
19164 int main() {
19165
19166 #if DB_VERSION_MAJOR > 1
19167         {
19168                 char *version;
19169                 int major, minor, patch;
19170
19171                 version = db_version( &major, &minor, &patch );
19172
19173                 if( major != DB_VERSION_MAJOR ||
19174                         minor < DB_VERSION_MINOR )
19175                 {
19176                         printf("Berkeley DB version mismatch\n"
19177                                 "\texpected: %s\n\tgot: %s\n",
19178                                 DB_VERSION_STRING, version);
19179                         return 1;
19180                 }
19181         }
19182 #endif
19183
19184 #if DB_VERSION_MAJOR > 2
19185         db_env_create( NULL, 0 );
19186 #elif DB_VERSION_MAJOR > 1
19187         db_appexit( NULL );
19188 #else
19189         (void) dbopen( NULL, 0, 0, 0, NULL);
19190 #endif
19191
19192 ; return 0; }
19193 EOF
19194 if { (eval echo configure:19195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19195   rm -rf conftest*
19196   ol_cv_db_db3=yes
19197 else
19198   echo "configure: failed program was:" >&5
19199   cat conftest.$ac_ext >&5
19200   rm -rf conftest*
19201   ol_cv_db_db3=no
19202 fi
19203 rm -f conftest*
19204
19205         LIBS="$ol_LIBS"
19206
19207 fi
19208
19209 echo "$ac_t""$ol_cv_db_db3" 1>&6
19210
19211         if test $ol_cv_db_db3 = yes ; then
19212                 ol_cv_lib_db=-ldb3
19213         fi
19214 fi
19215
19216 if test $ol_cv_lib_db = no ; then
19217         echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6
19218 echo "configure:19219: checking for Berkeley DB link (-ldb-3)" >&5
19219 if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then
19220   echo $ac_n "(cached) $ac_c" 1>&6
19221 else
19222   
19223         ol_DB_LIB=-ldb-3
19224         ol_LIBS=$LIBS
19225         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
19226
19227         cat > conftest.$ac_ext <<EOF
19228 #line 19229 "configure"
19229 #include "confdefs.h"
19230
19231 #ifdef HAVE_DB_185_H
19232 # include <db_185.h>
19233 #else
19234 # include <db.h>
19235 #endif
19236
19237 #ifndef DB_VERSION_MAJOR
19238 # define DB_VERSION_MAJOR 1
19239 #endif
19240
19241 #ifndef NULL
19242 #define NULL ((void*)0)
19243 #endif
19244
19245 int main() {
19246
19247 #if DB_VERSION_MAJOR > 1
19248         {
19249                 char *version;
19250                 int major, minor, patch;
19251
19252                 version = db_version( &major, &minor, &patch );
19253
19254                 if( major != DB_VERSION_MAJOR ||
19255                         minor < DB_VERSION_MINOR )
19256                 {
19257                         printf("Berkeley DB version mismatch\n"
19258                                 "\texpected: %s\n\tgot: %s\n",
19259                                 DB_VERSION_STRING, version);
19260                         return 1;
19261                 }
19262         }
19263 #endif
19264
19265 #if DB_VERSION_MAJOR > 2
19266         db_env_create( NULL, 0 );
19267 #elif DB_VERSION_MAJOR > 1
19268         db_appexit( NULL );
19269 #else
19270         (void) dbopen( NULL, 0, 0, 0, NULL);
19271 #endif
19272
19273 ; return 0; }
19274 EOF
19275 if { (eval echo configure:19276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19276   rm -rf conftest*
19277   ol_cv_db_db_3=yes
19278 else
19279   echo "configure: failed program was:" >&5
19280   cat conftest.$ac_ext >&5
19281   rm -rf conftest*
19282   ol_cv_db_db_3=no
19283 fi
19284 rm -f conftest*
19285
19286         LIBS="$ol_LIBS"
19287
19288 fi
19289
19290 echo "$ac_t""$ol_cv_db_db_3" 1>&6
19291
19292         if test $ol_cv_db_db_3 = yes ; then
19293                 ol_cv_lib_db=-ldb-3
19294         fi
19295 fi
19296
19297 if test $ol_cv_lib_db = no ; then
19298         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
19299 echo "configure:19300: checking for Berkeley DB link (-ldb2)" >&5
19300 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
19301   echo $ac_n "(cached) $ac_c" 1>&6
19302 else
19303   
19304         ol_DB_LIB=-ldb2
19305         ol_LIBS=$LIBS
19306         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
19307
19308         cat > conftest.$ac_ext <<EOF
19309 #line 19310 "configure"
19310 #include "confdefs.h"
19311
19312 #ifdef HAVE_DB_185_H
19313 # include <db_185.h>
19314 #else
19315 # include <db.h>
19316 #endif
19317
19318 #ifndef DB_VERSION_MAJOR
19319 # define DB_VERSION_MAJOR 1
19320 #endif
19321
19322 #ifndef NULL
19323 #define NULL ((void*)0)
19324 #endif
19325
19326 int main() {
19327
19328 #if DB_VERSION_MAJOR > 1
19329         {
19330                 char *version;
19331                 int major, minor, patch;
19332
19333                 version = db_version( &major, &minor, &patch );
19334
19335                 if( major != DB_VERSION_MAJOR ||
19336                         minor < DB_VERSION_MINOR )
19337                 {
19338                         printf("Berkeley DB version mismatch\n"
19339                                 "\texpected: %s\n\tgot: %s\n",
19340                                 DB_VERSION_STRING, version);
19341                         return 1;
19342                 }
19343         }
19344 #endif
19345
19346 #if DB_VERSION_MAJOR > 2
19347         db_env_create( NULL, 0 );
19348 #elif DB_VERSION_MAJOR > 1
19349         db_appexit( NULL );
19350 #else
19351         (void) dbopen( NULL, 0, 0, 0, NULL);
19352 #endif
19353
19354 ; return 0; }
19355 EOF
19356 if { (eval echo configure:19357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19357   rm -rf conftest*
19358   ol_cv_db_db2=yes
19359 else
19360   echo "configure: failed program was:" >&5
19361   cat conftest.$ac_ext >&5
19362   rm -rf conftest*
19363   ol_cv_db_db2=no
19364 fi
19365 rm -f conftest*
19366
19367         LIBS="$ol_LIBS"
19368
19369 fi
19370
19371 echo "$ac_t""$ol_cv_db_db2" 1>&6
19372
19373         if test $ol_cv_db_db2 = yes ; then
19374                 ol_cv_lib_db=-ldb2
19375         fi
19376 fi
19377
19378 if test $ol_cv_lib_db = no ; then
19379         echo $ac_n "checking for Berkeley DB link (-ldb-2)""... $ac_c" 1>&6
19380 echo "configure:19381: checking for Berkeley DB link (-ldb-2)" >&5
19381 if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then
19382   echo $ac_n "(cached) $ac_c" 1>&6
19383 else
19384   
19385         ol_DB_LIB=-ldb-2
19386         ol_LIBS=$LIBS
19387         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
19388
19389         cat > conftest.$ac_ext <<EOF
19390 #line 19391 "configure"
19391 #include "confdefs.h"
19392
19393 #ifdef HAVE_DB_185_H
19394 # include <db_185.h>
19395 #else
19396 # include <db.h>
19397 #endif
19398
19399 #ifndef DB_VERSION_MAJOR
19400 # define DB_VERSION_MAJOR 1
19401 #endif
19402
19403 #ifndef NULL
19404 #define NULL ((void*)0)
19405 #endif
19406
19407 int main() {
19408
19409 #if DB_VERSION_MAJOR > 1
19410         {
19411                 char *version;
19412                 int major, minor, patch;
19413
19414                 version = db_version( &major, &minor, &patch );
19415
19416                 if( major != DB_VERSION_MAJOR ||
19417                         minor < DB_VERSION_MINOR )
19418                 {
19419                         printf("Berkeley DB version mismatch\n"
19420                                 "\texpected: %s\n\tgot: %s\n",
19421                                 DB_VERSION_STRING, version);
19422                         return 1;
19423                 }
19424         }
19425 #endif
19426
19427 #if DB_VERSION_MAJOR > 2
19428         db_env_create( NULL, 0 );
19429 #elif DB_VERSION_MAJOR > 1
19430         db_appexit( NULL );
19431 #else
19432         (void) dbopen( NULL, 0, 0, 0, NULL);
19433 #endif
19434
19435 ; return 0; }
19436 EOF
19437 if { (eval echo configure:19438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19438   rm -rf conftest*
19439   ol_cv_db_db_2=yes
19440 else
19441   echo "configure: failed program was:" >&5
19442   cat conftest.$ac_ext >&5
19443   rm -rf conftest*
19444   ol_cv_db_db_2=no
19445 fi
19446 rm -f conftest*
19447
19448         LIBS="$ol_LIBS"
19449
19450 fi
19451
19452 echo "$ac_t""$ol_cv_db_db_2" 1>&6
19453
19454         if test $ol_cv_db_db_2 = yes ; then
19455                 ol_cv_lib_db=-ldb-2
19456         fi
19457 fi
19458
19459 if test $ol_cv_lib_db = no ; then
19460         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
19461 echo "configure:19462: checking for Berkeley DB link (-ldb1)" >&5
19462 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
19463   echo $ac_n "(cached) $ac_c" 1>&6
19464 else
19465   
19466         ol_DB_LIB=-ldb1
19467         ol_LIBS=$LIBS
19468         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
19469
19470         cat > conftest.$ac_ext <<EOF
19471 #line 19472 "configure"
19472 #include "confdefs.h"
19473
19474 #ifdef HAVE_DB_185_H
19475 # include <db_185.h>
19476 #else
19477 # include <db.h>
19478 #endif
19479
19480 #ifndef DB_VERSION_MAJOR
19481 # define DB_VERSION_MAJOR 1
19482 #endif
19483
19484 #ifndef NULL
19485 #define NULL ((void*)0)
19486 #endif
19487
19488 int main() {
19489
19490 #if DB_VERSION_MAJOR > 1
19491         {
19492                 char *version;
19493                 int major, minor, patch;
19494
19495                 version = db_version( &major, &minor, &patch );
19496
19497                 if( major != DB_VERSION_MAJOR ||
19498                         minor < DB_VERSION_MINOR )
19499                 {
19500                         printf("Berkeley DB version mismatch\n"
19501                                 "\texpected: %s\n\tgot: %s\n",
19502                                 DB_VERSION_STRING, version);
19503                         return 1;
19504                 }
19505         }
19506 #endif
19507
19508 #if DB_VERSION_MAJOR > 2
19509         db_env_create( NULL, 0 );
19510 #elif DB_VERSION_MAJOR > 1
19511         db_appexit( NULL );
19512 #else
19513         (void) dbopen( NULL, 0, 0, 0, NULL);
19514 #endif
19515
19516 ; return 0; }
19517 EOF
19518 if { (eval echo configure:19519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19519   rm -rf conftest*
19520   ol_cv_db_db1=yes
19521 else
19522   echo "configure: failed program was:" >&5
19523   cat conftest.$ac_ext >&5
19524   rm -rf conftest*
19525   ol_cv_db_db1=no
19526 fi
19527 rm -f conftest*
19528
19529         LIBS="$ol_LIBS"
19530
19531 fi
19532
19533 echo "$ac_t""$ol_cv_db_db1" 1>&6
19534
19535         if test $ol_cv_db_db1 = yes ; then
19536                 ol_cv_lib_db=-ldb1
19537         fi
19538 fi
19539
19540 if test $ol_cv_lib_db = no ; then
19541         echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6
19542 echo "configure:19543: checking for Berkeley DB link (-ldb-1)" >&5
19543 if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then
19544   echo $ac_n "(cached) $ac_c" 1>&6
19545 else
19546   
19547         ol_DB_LIB=-ldb-1
19548         ol_LIBS=$LIBS
19549         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
19550
19551         cat > conftest.$ac_ext <<EOF
19552 #line 19553 "configure"
19553 #include "confdefs.h"
19554
19555 #ifdef HAVE_DB_185_H
19556 # include <db_185.h>
19557 #else
19558 # include <db.h>
19559 #endif
19560
19561 #ifndef DB_VERSION_MAJOR
19562 # define DB_VERSION_MAJOR 1
19563 #endif
19564
19565 #ifndef NULL
19566 #define NULL ((void*)0)
19567 #endif
19568
19569 int main() {
19570
19571 #if DB_VERSION_MAJOR > 1
19572         {
19573                 char *version;
19574                 int major, minor, patch;
19575
19576                 version = db_version( &major, &minor, &patch );
19577
19578                 if( major != DB_VERSION_MAJOR ||
19579                         minor < DB_VERSION_MINOR )
19580                 {
19581                         printf("Berkeley DB version mismatch\n"
19582                                 "\texpected: %s\n\tgot: %s\n",
19583                                 DB_VERSION_STRING, version);
19584                         return 1;
19585                 }
19586         }
19587 #endif
19588
19589 #if DB_VERSION_MAJOR > 2
19590         db_env_create( NULL, 0 );
19591 #elif DB_VERSION_MAJOR > 1
19592         db_appexit( NULL );
19593 #else
19594         (void) dbopen( NULL, 0, 0, 0, NULL);
19595 #endif
19596
19597 ; return 0; }
19598 EOF
19599 if { (eval echo configure:19600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19600   rm -rf conftest*
19601   ol_cv_db_db_1=yes
19602 else
19603   echo "configure: failed program was:" >&5
19604   cat conftest.$ac_ext >&5
19605   rm -rf conftest*
19606   ol_cv_db_db_1=no
19607 fi
19608 rm -f conftest*
19609
19610         LIBS="$ol_LIBS"
19611
19612 fi
19613
19614 echo "$ac_t""$ol_cv_db_db_1" 1>&6
19615
19616         if test $ol_cv_db_db_1 = yes ; then
19617                 ol_cv_lib_db=-ldb-1
19618         fi
19619 fi
19620
19621
19622         if test "$ol_cv_lib_db" != no ; then
19623                 ol_cv_berkeley_db=yes
19624                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
19625 echo "configure:19626: checking for Berkeley DB thread support" >&5
19626 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
19627   echo $ac_n "(cached) $ac_c" 1>&6
19628 else
19629   
19630         ol_LIBS="$LIBS"
19631         LIBS="$LTHREAD_LIBS $LIBS"
19632         if test $ol_cv_lib_db != yes ; then
19633                 LIBS="$ol_cv_lib_db $LIBS"
19634         fi
19635
19636         if test "$cross_compiling" = yes; then
19637   ol_cv_berkeley_db_thread=cross
19638 else
19639   cat > conftest.$ac_ext <<EOF
19640 #line 19641 "configure"
19641 #include "confdefs.h"
19642
19643 #ifdef HAVE_DB_185_H
19644         choke me;
19645 #else
19646 #include <db.h>
19647 #endif
19648 #ifndef NULL
19649 #define NULL ((void *)0)
19650 #endif
19651 main()
19652 {
19653         int rc;
19654         u_int32_t flags = DB_CREATE |
19655 #ifdef DB_PRIVATE
19656                 DB_PRIVATE |
19657 #endif
19658                 DB_THREAD;
19659
19660 #if DB_VERSION_MAJOR > 2
19661         DB_ENV *env = NULL;
19662
19663         rc = db_env_create( &env, 0 );
19664
19665         flags |= DB_INIT_MPOOL;
19666 #ifdef DB_MPOOL_PRIVATE
19667         flags |= DB_MPOOL_PRIVATE;
19668 #endif
19669
19670         if( rc ) {
19671                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
19672                 return rc;
19673         }
19674
19675 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
19676         rc = env->open( env, NULL, flags, 0 );
19677 #else
19678         rc = env->open( env, NULL, NULL, flags, 0 );
19679 #endif
19680
19681         if ( rc == 0 ) {
19682                 rc = env->close( env, 0 );
19683         }
19684
19685         if( rc ) {
19686                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
19687                 return rc;
19688         }
19689
19690 #else
19691         DB_ENV env;
19692         memset( &env, '\0', sizeof(env) );
19693
19694         rc = db_appinit( NULL, NULL, &env, flags );
19695
19696         if( rc == 0 ) {
19697                 db_appexit( &env );
19698         }
19699
19700         unlink("__db_mpool.share");
19701         unlink("__db_lock.share");
19702 #endif
19703
19704         return rc;
19705 }
19706 EOF
19707 if { (eval echo configure:19708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
19708 then
19709   ol_cv_berkeley_db_thread=yes
19710 else
19711   echo "configure: failed program was:" >&5
19712   cat conftest.$ac_ext >&5
19713   rm -fr conftest*
19714   ol_cv_berkeley_db_thread=no
19715 fi
19716 rm -fr conftest*
19717 fi
19718
19719
19720         LIBS="$ol_LIBS"
19721
19722 fi
19723
19724 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
19725
19726         if test $ol_cv_berkeley_db_thread != no ; then
19727                 cat >> confdefs.h <<\EOF
19728 #define HAVE_BERKELEY_DB_THREAD 1
19729 EOF
19730
19731         fi
19732
19733         fi
19734 fi
19735
19736         fi
19737
19738         if test $ol_cv_berkeley_db != no ; then
19739                 cat >> confdefs.h <<\EOF
19740 #define HAVE_BERKELEY_DB 1
19741 EOF
19742
19743
19744                 ol_link_ldbm=berkeley
19745                 ol_with_ldbm_api=berkeley
19746
19747                 if test $ol_with_ldbm_type = hash ; then
19748                         cat >> confdefs.h <<\EOF
19749 #define LDBM_USE_DBHASH 1
19750 EOF
19751
19752                 else
19753                         cat >> confdefs.h <<\EOF
19754 #define LDBM_USE_DBBTREE 1
19755 EOF
19756
19757                 fi
19758
19759                                                 if test $ol_cv_lib_db != yes ; then
19760                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
19761                 fi
19762         fi
19763 fi
19764
19765 if test $ol_enable_bdb = yes -a $ol_link_ldbm != berkeley ; then
19766         { echo "configure: error: BDB: BerkeleyDB not available" 1>&2; exit 1; }
19767 elif test $ol_enable_bdb != no -a $ol_link_ldbm = berkeley ; then
19768         echo $ac_n "checking Berkeley DB version for BDB backend""... $ac_c" 1>&6
19769 echo "configure:19770: checking Berkeley DB version for BDB backend" >&5
19770 if eval "test \"\${ol_cv_bdb_compat+set}\" = set"; then
19771   echo $ac_n "(cached) $ac_c" 1>&6
19772 else
19773   
19774         cat > conftest.$ac_ext <<EOF
19775 #line 19776 "configure"
19776 #include "confdefs.h"
19777
19778 #include <db.h>
19779
19780  /* this check could be improved */
19781 #ifndef DB_VERSION_MAJOR
19782 #       define DB_VERSION_MAJOR 1
19783 #endif
19784 #ifndef DB_VERSION_MINOR
19785 #       define DB_VERSION_MINOR 0
19786 #endif
19787
19788 /* require 4.2 or later */
19789 #if (DB_VERSION_MAJOR >= 4) && (DB_VERSION_MINOR >= 2)
19790         __db_version_compat
19791 #endif
19792         
19793 EOF
19794 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
19795   egrep "__db_version_compat" >/dev/null 2>&1; then
19796   rm -rf conftest*
19797   ol_cv_bdb_compat=yes
19798 else
19799   rm -rf conftest*
19800   ol_cv_bdb_compat=no
19801 fi
19802 rm -f conftest*
19803
19804 fi
19805
19806 echo "$ac_t""$ol_cv_bdb_compat" 1>&6
19807
19808
19809         if test $ol_cv_bdb_compat = yes ; then
19810                 ol_enable_bdb=yes
19811         elif test $ol_enable_bdb = yes ; then
19812                 { echo "configure: error: BDB: BerkeleyDB version incompatible" 1>&2; exit 1; }
19813         else
19814                 ol_enable_bdb=no
19815         fi
19816 fi
19817 if test $ol_enable_hdb = yes -a $ol_link_ldbm != berkeley ; then
19818         { echo "configure: error: HDB: BerkeleyDB not available" 1>&2; exit 1; }
19819 fi
19820
19821 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
19822         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
19823         ol_with_ldbm_api=none
19824 fi
19825
19826 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
19827         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
19828 echo "configure:19829: checking for MDBM library" >&5
19829 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
19830   echo $ac_n "(cached) $ac_c" 1>&6
19831 else
19832         ol_LIBS="$LIBS"
19833         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
19834 echo "configure:19835: checking for mdbm_set_chain" >&5
19835 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
19836   echo $ac_n "(cached) $ac_c" 1>&6
19837 else
19838   cat > conftest.$ac_ext <<EOF
19839 #line 19840 "configure"
19840 #include "confdefs.h"
19841 /* System header to define __stub macros and hopefully few prototypes,
19842     which can conflict with char mdbm_set_chain(); below.  */
19843 #include <assert.h>
19844 /* Override any gcc2 internal prototype to avoid an error.  */
19845 /* We use char because int might match the return type of a gcc2
19846     builtin and then its argument prototype would still apply.  */
19847 char mdbm_set_chain();
19848 char (*f)();
19849
19850 int main() {
19851
19852 /* The GNU C library defines this for functions which it implements
19853     to always fail with ENOSYS.  Some functions are actually named
19854     something starting with __ and the normal name is an alias.  */
19855 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
19856 choke me
19857 #else
19858 f = mdbm_set_chain;
19859 #endif
19860
19861 ; return 0; }
19862 EOF
19863 if { (eval echo configure:19864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19864   rm -rf conftest*
19865   eval "ac_cv_func_mdbm_set_chain=yes"
19866 else
19867   echo "configure: failed program was:" >&5
19868   cat conftest.$ac_ext >&5
19869   rm -rf conftest*
19870   eval "ac_cv_func_mdbm_set_chain=no"
19871 fi
19872 rm -f conftest*
19873 fi
19874
19875 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
19876   echo "$ac_t""yes" 1>&6
19877   ol_cv_lib_mdbm=yes
19878 else
19879   echo "$ac_t""no" 1>&6
19880
19881                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
19882 echo "configure:19883: checking for mdbm_set_chain in -lmdbm" >&5
19883 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
19884 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19885   echo $ac_n "(cached) $ac_c" 1>&6
19886 else
19887   ac_save_LIBS="$LIBS"
19888 LIBS="-lmdbm  $LIBS"
19889 cat > conftest.$ac_ext <<EOF
19890 #line 19891 "configure"
19891 #include "confdefs.h"
19892 /* Override any gcc2 internal prototype to avoid an error.  */
19893 /* We use char because int might match the return type of a gcc2
19894     builtin and then its argument prototype would still apply.  */
19895 char mdbm_set_chain();
19896
19897 int main() {
19898 mdbm_set_chain()
19899 ; return 0; }
19900 EOF
19901 if { (eval echo configure:19902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19902   rm -rf conftest*
19903   eval "ac_cv_lib_$ac_lib_var=yes"
19904 else
19905   echo "configure: failed program was:" >&5
19906   cat conftest.$ac_ext >&5
19907   rm -rf conftest*
19908   eval "ac_cv_lib_$ac_lib_var=no"
19909 fi
19910 rm -f conftest*
19911 LIBS="$ac_save_LIBS"
19912
19913 fi
19914 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19915   echo "$ac_t""yes" 1>&6
19916   ol_cv_lib_mdbm=-lmdbm
19917 else
19918   echo "$ac_t""no" 1>&6
19919 ol_cv_lib_mdbm=no
19920 fi
19921
19922         
19923 fi
19924
19925         LIBS="$ol_LIBS"
19926
19927 fi
19928
19929 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
19930
19931
19932  for ac_hdr in mdbm.h
19933 do
19934 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19935 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19936 echo "configure:19937: checking for $ac_hdr" >&5
19937 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19938   echo $ac_n "(cached) $ac_c" 1>&6
19939 else
19940   cat > conftest.$ac_ext <<EOF
19941 #line 19942 "configure"
19942 #include "confdefs.h"
19943 #include <$ac_hdr>
19944 EOF
19945 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19946 { (eval echo configure:19947: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19947 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19948 if test -z "$ac_err"; then
19949   rm -rf conftest*
19950   eval "ac_cv_header_$ac_safe=yes"
19951 else
19952   echo "$ac_err" >&5
19953   echo "configure: failed program was:" >&5
19954   cat conftest.$ac_ext >&5
19955   rm -rf conftest*
19956   eval "ac_cv_header_$ac_safe=no"
19957 fi
19958 rm -f conftest*
19959 fi
19960 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19961   echo "$ac_t""yes" 1>&6
19962     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19963   cat >> confdefs.h <<EOF
19964 #define $ac_tr_hdr 1
19965 EOF
19966  
19967 else
19968   echo "$ac_t""no" 1>&6
19969 fi
19970 done
19971
19972  echo $ac_n "checking for db""... $ac_c" 1>&6
19973 echo "configure:19974: checking for db" >&5
19974 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
19975   echo $ac_n "(cached) $ac_c" 1>&6
19976 else
19977   
19978         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
19979                 ol_cv_mdbm=no
19980         else
19981                 ol_cv_mdbm=yes
19982         fi
19983
19984 fi
19985
19986 echo "$ac_t""$ol_cv_mdbm" 1>&6
19987  if test $ol_cv_mdbm = yes ; then
19988         cat >> confdefs.h <<\EOF
19989 #define HAVE_MDBM 1
19990 EOF
19991
19992  fi
19993
19994
19995         if test $ol_cv_mdbm = yes ; then
19996                 ol_link_ldbm=mdbm
19997                 ol_with_ldbm_api=mdbm
19998                 if test $ol_cv_lib_mdbm != yes ; then
19999                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
20000                 fi
20001         fi
20002 fi
20003
20004 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
20005         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
20006 echo "configure:20007: checking for GDBM library" >&5
20007 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
20008   echo $ac_n "(cached) $ac_c" 1>&6
20009 else
20010         ol_LIBS="$LIBS"
20011         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
20012 echo "configure:20013: checking for gdbm_open" >&5
20013 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
20014   echo $ac_n "(cached) $ac_c" 1>&6
20015 else
20016   cat > conftest.$ac_ext <<EOF
20017 #line 20018 "configure"
20018 #include "confdefs.h"
20019 /* System header to define __stub macros and hopefully few prototypes,
20020     which can conflict with char gdbm_open(); below.  */
20021 #include <assert.h>
20022 /* Override any gcc2 internal prototype to avoid an error.  */
20023 /* We use char because int might match the return type of a gcc2
20024     builtin and then its argument prototype would still apply.  */
20025 char gdbm_open();
20026 char (*f)();
20027
20028 int main() {
20029
20030 /* The GNU C library defines this for functions which it implements
20031     to always fail with ENOSYS.  Some functions are actually named
20032     something starting with __ and the normal name is an alias.  */
20033 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
20034 choke me
20035 #else
20036 f = gdbm_open;
20037 #endif
20038
20039 ; return 0; }
20040 EOF
20041 if { (eval echo configure:20042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20042   rm -rf conftest*
20043   eval "ac_cv_func_gdbm_open=yes"
20044 else
20045   echo "configure: failed program was:" >&5
20046   cat conftest.$ac_ext >&5
20047   rm -rf conftest*
20048   eval "ac_cv_func_gdbm_open=no"
20049 fi
20050 rm -f conftest*
20051 fi
20052
20053 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
20054   echo "$ac_t""yes" 1>&6
20055   ol_cv_lib_gdbm=yes
20056 else
20057   echo "$ac_t""no" 1>&6
20058
20059                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
20060 echo "configure:20061: checking for gdbm_open in -lgdbm" >&5
20061 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
20062 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20063   echo $ac_n "(cached) $ac_c" 1>&6
20064 else
20065   ac_save_LIBS="$LIBS"
20066 LIBS="-lgdbm  $LIBS"
20067 cat > conftest.$ac_ext <<EOF
20068 #line 20069 "configure"
20069 #include "confdefs.h"
20070 /* Override any gcc2 internal prototype to avoid an error.  */
20071 /* We use char because int might match the return type of a gcc2
20072     builtin and then its argument prototype would still apply.  */
20073 char gdbm_open();
20074
20075 int main() {
20076 gdbm_open()
20077 ; return 0; }
20078 EOF
20079 if { (eval echo configure:20080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20080   rm -rf conftest*
20081   eval "ac_cv_lib_$ac_lib_var=yes"
20082 else
20083   echo "configure: failed program was:" >&5
20084   cat conftest.$ac_ext >&5
20085   rm -rf conftest*
20086   eval "ac_cv_lib_$ac_lib_var=no"
20087 fi
20088 rm -f conftest*
20089 LIBS="$ac_save_LIBS"
20090
20091 fi
20092 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20093   echo "$ac_t""yes" 1>&6
20094   ol_cv_lib_gdbm=-lgdbm
20095 else
20096   echo "$ac_t""no" 1>&6
20097 ol_cv_lib_gdbm=no
20098 fi
20099
20100         
20101 fi
20102
20103         LIBS="$ol_LIBS"
20104
20105 fi
20106
20107 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
20108
20109
20110  for ac_hdr in gdbm.h
20111 do
20112 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20113 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20114 echo "configure:20115: checking for $ac_hdr" >&5
20115 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20116   echo $ac_n "(cached) $ac_c" 1>&6
20117 else
20118   cat > conftest.$ac_ext <<EOF
20119 #line 20120 "configure"
20120 #include "confdefs.h"
20121 #include <$ac_hdr>
20122 EOF
20123 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20124 { (eval echo configure:20125: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20125 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20126 if test -z "$ac_err"; then
20127   rm -rf conftest*
20128   eval "ac_cv_header_$ac_safe=yes"
20129 else
20130   echo "$ac_err" >&5
20131   echo "configure: failed program was:" >&5
20132   cat conftest.$ac_ext >&5
20133   rm -rf conftest*
20134   eval "ac_cv_header_$ac_safe=no"
20135 fi
20136 rm -f conftest*
20137 fi
20138 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20139   echo "$ac_t""yes" 1>&6
20140     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20141   cat >> confdefs.h <<EOF
20142 #define $ac_tr_hdr 1
20143 EOF
20144  
20145 else
20146   echo "$ac_t""no" 1>&6
20147 fi
20148 done
20149
20150  echo $ac_n "checking for db""... $ac_c" 1>&6
20151 echo "configure:20152: checking for db" >&5
20152 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
20153   echo $ac_n "(cached) $ac_c" 1>&6
20154 else
20155   
20156         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
20157                 ol_cv_gdbm=no
20158         else
20159                 ol_cv_gdbm=yes
20160         fi
20161
20162 fi
20163
20164 echo "$ac_t""$ol_cv_gdbm" 1>&6
20165  if test $ol_cv_gdbm = yes ; then
20166         cat >> confdefs.h <<\EOF
20167 #define HAVE_GDBM 1
20168 EOF
20169
20170  fi
20171
20172
20173         if test $ol_cv_gdbm = yes ; then
20174                 ol_link_ldbm=gdbm
20175                 ol_with_ldbm_api=gdbm
20176
20177                 if test $ol_cv_lib_gdbm != yes ; then
20178                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
20179                 fi
20180         fi
20181 fi
20182
20183 if test $ol_with_ldbm_api = ndbm ; then
20184         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
20185 echo "configure:20186: checking for NDBM library" >&5
20186 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
20187   echo $ac_n "(cached) $ac_c" 1>&6
20188 else
20189         ol_LIBS="$LIBS"
20190         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
20191 echo "configure:20192: checking for dbm_open" >&5
20192 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
20193   echo $ac_n "(cached) $ac_c" 1>&6
20194 else
20195   cat > conftest.$ac_ext <<EOF
20196 #line 20197 "configure"
20197 #include "confdefs.h"
20198 /* System header to define __stub macros and hopefully few prototypes,
20199     which can conflict with char dbm_open(); below.  */
20200 #include <assert.h>
20201 /* Override any gcc2 internal prototype to avoid an error.  */
20202 /* We use char because int might match the return type of a gcc2
20203     builtin and then its argument prototype would still apply.  */
20204 char dbm_open();
20205 char (*f)();
20206
20207 int main() {
20208
20209 /* The GNU C library defines this for functions which it implements
20210     to always fail with ENOSYS.  Some functions are actually named
20211     something starting with __ and the normal name is an alias.  */
20212 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
20213 choke me
20214 #else
20215 f = dbm_open;
20216 #endif
20217
20218 ; return 0; }
20219 EOF
20220 if { (eval echo configure:20221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20221   rm -rf conftest*
20222   eval "ac_cv_func_dbm_open=yes"
20223 else
20224   echo "configure: failed program was:" >&5
20225   cat conftest.$ac_ext >&5
20226   rm -rf conftest*
20227   eval "ac_cv_func_dbm_open=no"
20228 fi
20229 rm -f conftest*
20230 fi
20231
20232 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
20233   echo "$ac_t""yes" 1>&6
20234   ol_cv_lib_ndbm=yes
20235 else
20236   echo "$ac_t""no" 1>&6
20237
20238                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
20239 echo "configure:20240: checking for dbm_open in -lndbm" >&5
20240 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
20241 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20242   echo $ac_n "(cached) $ac_c" 1>&6
20243 else
20244   ac_save_LIBS="$LIBS"
20245 LIBS="-lndbm  $LIBS"
20246 cat > conftest.$ac_ext <<EOF
20247 #line 20248 "configure"
20248 #include "confdefs.h"
20249 /* Override any gcc2 internal prototype to avoid an error.  */
20250 /* We use char because int might match the return type of a gcc2
20251     builtin and then its argument prototype would still apply.  */
20252 char dbm_open();
20253
20254 int main() {
20255 dbm_open()
20256 ; return 0; }
20257 EOF
20258 if { (eval echo configure:20259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20259   rm -rf conftest*
20260   eval "ac_cv_lib_$ac_lib_var=yes"
20261 else
20262   echo "configure: failed program was:" >&5
20263   cat conftest.$ac_ext >&5
20264   rm -rf conftest*
20265   eval "ac_cv_lib_$ac_lib_var=no"
20266 fi
20267 rm -f conftest*
20268 LIBS="$ac_save_LIBS"
20269
20270 fi
20271 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20272   echo "$ac_t""yes" 1>&6
20273   ol_cv_lib_ndbm=-lndbm
20274 else
20275   echo "$ac_t""no" 1>&6
20276
20277                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
20278 echo "configure:20279: checking for dbm_open in -ldbm" >&5
20279 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
20280 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20281   echo $ac_n "(cached) $ac_c" 1>&6
20282 else
20283   ac_save_LIBS="$LIBS"
20284 LIBS="-ldbm  $LIBS"
20285 cat > conftest.$ac_ext <<EOF
20286 #line 20287 "configure"
20287 #include "confdefs.h"
20288 /* Override any gcc2 internal prototype to avoid an error.  */
20289 /* We use char because int might match the return type of a gcc2
20290     builtin and then its argument prototype would still apply.  */
20291 char dbm_open();
20292
20293 int main() {
20294 dbm_open()
20295 ; return 0; }
20296 EOF
20297 if { (eval echo configure:20298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20298   rm -rf conftest*
20299   eval "ac_cv_lib_$ac_lib_var=yes"
20300 else
20301   echo "configure: failed program was:" >&5
20302   cat conftest.$ac_ext >&5
20303   rm -rf conftest*
20304   eval "ac_cv_lib_$ac_lib_var=no"
20305 fi
20306 rm -f conftest*
20307 LIBS="$ac_save_LIBS"
20308
20309 fi
20310 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20311   echo "$ac_t""yes" 1>&6
20312   ol_cv_lib_ndbm=-ldbm
20313 else
20314   echo "$ac_t""no" 1>&6
20315 ol_cv_lib_ndbm=no
20316 fi
20317                 
20318 fi
20319
20320         
20321 fi
20322
20323         LIBS="$ol_LIBS"
20324
20325 fi
20326
20327 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
20328
20329
20330  for ac_hdr in ndbm.h
20331 do
20332 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20333 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20334 echo "configure:20335: checking for $ac_hdr" >&5
20335 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20336   echo $ac_n "(cached) $ac_c" 1>&6
20337 else
20338   cat > conftest.$ac_ext <<EOF
20339 #line 20340 "configure"
20340 #include "confdefs.h"
20341 #include <$ac_hdr>
20342 EOF
20343 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20344 { (eval echo configure:20345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20345 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20346 if test -z "$ac_err"; then
20347   rm -rf conftest*
20348   eval "ac_cv_header_$ac_safe=yes"
20349 else
20350   echo "$ac_err" >&5
20351   echo "configure: failed program was:" >&5
20352   cat conftest.$ac_ext >&5
20353   rm -rf conftest*
20354   eval "ac_cv_header_$ac_safe=no"
20355 fi
20356 rm -f conftest*
20357 fi
20358 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20359   echo "$ac_t""yes" 1>&6
20360     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20361   cat >> confdefs.h <<EOF
20362 #define $ac_tr_hdr 1
20363 EOF
20364  
20365 else
20366   echo "$ac_t""no" 1>&6
20367 fi
20368 done
20369
20370  echo $ac_n "checking for db""... $ac_c" 1>&6
20371 echo "configure:20372: checking for db" >&5
20372 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
20373   echo $ac_n "(cached) $ac_c" 1>&6
20374 else
20375   
20376         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
20377                 ol_cv_ndbm=no
20378         else
20379                 ol_cv_ndbm=yes
20380         fi
20381
20382 fi
20383
20384 echo "$ac_t""$ol_cv_ndbm" 1>&6
20385  if test $ol_cv_ndbm = yes ; then
20386         cat >> confdefs.h <<\EOF
20387 #define HAVE_NDBM 1
20388 EOF
20389
20390  fi
20391
20392
20393         if test $ol_cv_ndbm = yes ; then
20394                 ol_link_ldbm=ndbm
20395                 ol_with_ldbm_api=ndbm
20396
20397                 if test $ol_cv_lib_ndbm != yes ; then
20398                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
20399                 fi
20400         fi
20401 fi
20402
20403 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
20404         echo "configure: warning: could not find suitable LDBM backend" 1>&2
20405         if test $ol_enable_ldbm = yes ; then
20406                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
20407         fi
20408
20409         echo "configure: warning: disabling LDBM" 1>&2
20410         ol_enable_ldbm=no
20411 fi
20412
20413
20414 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
20415         BUILD_LIBS_DYNAMIC=shared
20416         cat >> confdefs.h <<\EOF
20417 #define LDAP_LIBS_DYNAMIC 1
20418 EOF
20419
20420         LTSTATIC=""
20421 else
20422         BUILD_LIBS_DYNAMIC=static
20423         LTSTATIC="-static"
20424 fi
20425
20426 if test $ol_enable_wrappers != no ; then
20427         for ac_hdr in tcpd.h
20428 do
20429 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20430 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20431 echo "configure:20432: checking for $ac_hdr" >&5
20432 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20433   echo $ac_n "(cached) $ac_c" 1>&6
20434 else
20435   cat > conftest.$ac_ext <<EOF
20436 #line 20437 "configure"
20437 #include "confdefs.h"
20438 #include <$ac_hdr>
20439 EOF
20440 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20441 { (eval echo configure:20442: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20442 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20443 if test -z "$ac_err"; then
20444   rm -rf conftest*
20445   eval "ac_cv_header_$ac_safe=yes"
20446 else
20447   echo "$ac_err" >&5
20448   echo "configure: failed program was:" >&5
20449   cat conftest.$ac_ext >&5
20450   rm -rf conftest*
20451   eval "ac_cv_header_$ac_safe=no"
20452 fi
20453 rm -f conftest*
20454 fi
20455 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20456   echo "$ac_t""yes" 1>&6
20457     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20458   cat >> confdefs.h <<EOF
20459 #define $ac_tr_hdr 1
20460 EOF
20461  
20462                 echo $ac_n "checking for TCP wrappers library""... $ac_c" 1>&6
20463 echo "configure:20464: checking for TCP wrappers library" >&5
20464                 save_LIBS="$LIBS"
20465                 LIBS="$LIBS -lwrap"
20466                 cat > conftest.$ac_ext <<EOF
20467 #line 20468 "configure"
20468 #include "confdefs.h"
20469
20470 #include <tcpd.h>
20471 int allow_severity = 0;
20472 int deny_severity  = 0;
20473
20474 struct request_info *req;
20475                 
20476 int main() {
20477
20478 hosts_access(req)
20479                 
20480 ; return 0; }
20481 EOF
20482 if { (eval echo configure:20483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20483   rm -rf conftest*
20484   echo "$ac_t""-lwrap" 1>&6
20485                 have_wrappers=yes
20486                 LIBS="$save_LIBS"
20487 else
20488   echo "configure: failed program was:" >&5
20489   cat conftest.$ac_ext >&5
20490   rm -rf conftest*
20491   
20492                                 LIBS="$LIBS -lnsl"
20493                 cat > conftest.$ac_ext <<EOF
20494 #line 20495 "configure"
20495 #include "confdefs.h"
20496
20497 #include <tcpd.h>
20498 int allow_severity = 0;
20499 int deny_severity  = 0;
20500
20501 struct request_info *req;
20502                 
20503 int main() {
20504
20505 hosts_access(req)
20506                 
20507 ; return 0; }
20508 EOF
20509 if { (eval echo configure:20510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20510   rm -rf conftest*
20511   echo "$ac_t""-lwrap -lnsl" 1>&6
20512                 have_wrappers=yes
20513                 LIBS="$save_LIBS -lnsl"
20514 else
20515   echo "configure: failed program was:" >&5
20516   cat conftest.$ac_ext >&5
20517   rm -rf conftest*
20518   
20519                 echo "$ac_t""no" 1>&6
20520                 have_wrappers=no
20521                 LIBS=$save_LIBS
20522 fi
20523 rm -f conftest*
20524 fi
20525 rm -f conftest*
20526 else
20527   echo "$ac_t""no" 1>&6
20528 have_wrappers=no
20529 fi
20530 done
20531
20532
20533         if test $have_wrappers = yes ; then
20534                 cat >> confdefs.h <<\EOF
20535 #define HAVE_TCPD 1
20536 EOF
20537
20538                 WRAP_LIBS="-lwrap"
20539         elif test $ol_enable_wrappers = yes ; then
20540                 { echo "configure: error: could not find TCP wrappers, select apppropriate options or disable" 1>&2; exit 1; }
20541         else
20542                 echo "configure: warning: could not find TCP wrappers, support disabled" 1>&2
20543                 WRAP_LIBS=""
20544         fi
20545 fi
20546
20547 if test $ol_enable_syslog != no ; then
20548         echo $ac_n "checking for openlog""... $ac_c" 1>&6
20549 echo "configure:20550: checking for openlog" >&5
20550 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
20551   echo $ac_n "(cached) $ac_c" 1>&6
20552 else
20553   cat > conftest.$ac_ext <<EOF
20554 #line 20555 "configure"
20555 #include "confdefs.h"
20556 /* System header to define __stub macros and hopefully few prototypes,
20557     which can conflict with char openlog(); below.  */
20558 #include <assert.h>
20559 /* Override any gcc2 internal prototype to avoid an error.  */
20560 /* We use char because int might match the return type of a gcc2
20561     builtin and then its argument prototype would still apply.  */
20562 char openlog();
20563 char (*f)();
20564
20565 int main() {
20566
20567 /* The GNU C library defines this for functions which it implements
20568     to always fail with ENOSYS.  Some functions are actually named
20569     something starting with __ and the normal name is an alias.  */
20570 #if defined (__stub_openlog) || defined (__stub___openlog)
20571 choke me
20572 #else
20573 f = openlog;
20574 #endif
20575
20576 ; return 0; }
20577 EOF
20578 if { (eval echo configure:20579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20579   rm -rf conftest*
20580   eval "ac_cv_func_openlog=yes"
20581 else
20582   echo "configure: failed program was:" >&5
20583   cat conftest.$ac_ext >&5
20584   rm -rf conftest*
20585   eval "ac_cv_func_openlog=no"
20586 fi
20587 rm -f conftest*
20588 fi
20589
20590 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
20591   echo "$ac_t""yes" 1>&6
20592   :
20593 else
20594   echo "$ac_t""no" 1>&6
20595 fi
20596
20597         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
20598                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
20599         fi
20600         ol_enable_syslog=$ac_cv_func_openlog
20601 fi
20602
20603
20604 ol_link_sql=no
20605 if test $ol_enable_sql != no ; then
20606         for ac_hdr in sql.h sqlext.h
20607 do
20608 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20609 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20610 echo "configure:20611: checking for $ac_hdr" >&5
20611 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20612   echo $ac_n "(cached) $ac_c" 1>&6
20613 else
20614   cat > conftest.$ac_ext <<EOF
20615 #line 20616 "configure"
20616 #include "confdefs.h"
20617 #include <$ac_hdr>
20618 EOF
20619 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20620 { (eval echo configure:20621: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20621 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20622 if test -z "$ac_err"; then
20623   rm -rf conftest*
20624   eval "ac_cv_header_$ac_safe=yes"
20625 else
20626   echo "$ac_err" >&5
20627   echo "configure: failed program was:" >&5
20628   cat conftest.$ac_ext >&5
20629   rm -rf conftest*
20630   eval "ac_cv_header_$ac_safe=no"
20631 fi
20632 rm -f conftest*
20633 fi
20634 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20635   echo "$ac_t""yes" 1>&6
20636     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20637   cat >> confdefs.h <<EOF
20638 #define $ac_tr_hdr 1
20639 EOF
20640  
20641 else
20642   echo "$ac_t""no" 1>&6
20643 { echo "configure: error: could not locate SQL headers" 1>&2; exit 1; }
20644         
20645 fi
20646 done
20647
20648
20649         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
20650 echo "configure:20651: checking for SQLDriverConnect in -liodbc" >&5
20651 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
20652 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20653   echo $ac_n "(cached) $ac_c" 1>&6
20654 else
20655   ac_save_LIBS="$LIBS"
20656 LIBS="-liodbc  $LIBS"
20657 cat > conftest.$ac_ext <<EOF
20658 #line 20659 "configure"
20659 #include "confdefs.h"
20660 /* Override any gcc2 internal prototype to avoid an error.  */
20661 /* We use char because int might match the return type of a gcc2
20662     builtin and then its argument prototype would still apply.  */
20663 char SQLDriverConnect();
20664
20665 int main() {
20666 SQLDriverConnect()
20667 ; return 0; }
20668 EOF
20669 if { (eval echo configure:20670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20670   rm -rf conftest*
20671   eval "ac_cv_lib_$ac_lib_var=yes"
20672 else
20673   echo "configure: failed program was:" >&5
20674   cat conftest.$ac_ext >&5
20675   rm -rf conftest*
20676   eval "ac_cv_lib_$ac_lib_var=no"
20677 fi
20678 rm -f conftest*
20679 LIBS="$ac_save_LIBS"
20680
20681 fi
20682 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20683   echo "$ac_t""yes" 1>&6
20684   have_iodbc=yes
20685 else
20686   echo "$ac_t""no" 1>&6
20687 have_iodbc=no
20688 fi
20689
20690         if test $have_iodbc = yes ; then
20691                 ol_link_sql="-liodbc"
20692         else
20693                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
20694 echo "configure:20695: checking for SQLDriverConnect in -lodbc" >&5
20695 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
20696 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20697   echo $ac_n "(cached) $ac_c" 1>&6
20698 else
20699   ac_save_LIBS="$LIBS"
20700 LIBS="-lodbc  $LIBS"
20701 cat > conftest.$ac_ext <<EOF
20702 #line 20703 "configure"
20703 #include "confdefs.h"
20704 /* Override any gcc2 internal prototype to avoid an error.  */
20705 /* We use char because int might match the return type of a gcc2
20706     builtin and then its argument prototype would still apply.  */
20707 char SQLDriverConnect();
20708
20709 int main() {
20710 SQLDriverConnect()
20711 ; return 0; }
20712 EOF
20713 if { (eval echo configure:20714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20714   rm -rf conftest*
20715   eval "ac_cv_lib_$ac_lib_var=yes"
20716 else
20717   echo "configure: failed program was:" >&5
20718   cat conftest.$ac_ext >&5
20719   rm -rf conftest*
20720   eval "ac_cv_lib_$ac_lib_var=no"
20721 fi
20722 rm -f conftest*
20723 LIBS="$ac_save_LIBS"
20724
20725 fi
20726 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20727   echo "$ac_t""yes" 1>&6
20728   have_odbc=yes
20729 else
20730   echo "$ac_t""no" 1>&6
20731 have_odbc=no
20732 fi
20733
20734                 if test $have_odbc = yes ; then
20735                         ol_link_sql="-lodbc"
20736                 fi
20737         fi
20738
20739         if test $ol_link_sql != no ; then
20740                 SLAPD_SQL_LIBS="$ol_link_sql"
20741
20742         elif test $ol_enable_sql != auto ; then
20743                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
20744         fi
20745 fi
20746
20747 ol_link_sasl=no
20748 ol_link_spasswd=no
20749 if test $ol_with_cyrus_sasl != no ; then
20750         for ac_hdr in sasl/sasl.h sasl.h
20751 do
20752 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20753 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20754 echo "configure:20755: checking for $ac_hdr" >&5
20755 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20756   echo $ac_n "(cached) $ac_c" 1>&6
20757 else
20758   cat > conftest.$ac_ext <<EOF
20759 #line 20760 "configure"
20760 #include "confdefs.h"
20761 #include <$ac_hdr>
20762 EOF
20763 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20764 { (eval echo configure:20765: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20765 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20766 if test -z "$ac_err"; then
20767   rm -rf conftest*
20768   eval "ac_cv_header_$ac_safe=yes"
20769 else
20770   echo "$ac_err" >&5
20771   echo "configure: failed program was:" >&5
20772   cat conftest.$ac_ext >&5
20773   rm -rf conftest*
20774   eval "ac_cv_header_$ac_safe=no"
20775 fi
20776 rm -f conftest*
20777 fi
20778 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20779   echo "$ac_t""yes" 1>&6
20780     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20781   cat >> confdefs.h <<EOF
20782 #define $ac_tr_hdr 1
20783 EOF
20784  
20785 else
20786   echo "$ac_t""no" 1>&6
20787 fi
20788 done
20789
20790
20791         if test $ac_cv_header_sasl_sasl_h = yes -o $ac_cv_header_sasl_h = yes; then
20792                 echo $ac_n "checking for sasl_client_init in -lsasl2""... $ac_c" 1>&6
20793 echo "configure:20794: checking for sasl_client_init in -lsasl2" >&5
20794 ac_lib_var=`echo sasl2'_'sasl_client_init | sed 'y%./+-:%__p__%'`
20795 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20796   echo $ac_n "(cached) $ac_c" 1>&6
20797 else
20798   ac_save_LIBS="$LIBS"
20799 LIBS="-lsasl2  $LIBS"
20800 cat > conftest.$ac_ext <<EOF
20801 #line 20802 "configure"
20802 #include "confdefs.h"
20803 /* Override any gcc2 internal prototype to avoid an error.  */
20804 /* We use char because int might match the return type of a gcc2
20805     builtin and then its argument prototype would still apply.  */
20806 char sasl_client_init();
20807
20808 int main() {
20809 sasl_client_init()
20810 ; return 0; }
20811 EOF
20812 if { (eval echo configure:20813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20813   rm -rf conftest*
20814   eval "ac_cv_lib_$ac_lib_var=yes"
20815 else
20816   echo "configure: failed program was:" >&5
20817   cat conftest.$ac_ext >&5
20818   rm -rf conftest*
20819   eval "ac_cv_lib_$ac_lib_var=no"
20820 fi
20821 rm -f conftest*
20822 LIBS="$ac_save_LIBS"
20823
20824 fi
20825 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20826   echo "$ac_t""yes" 1>&6
20827   ol_link_sasl="-lsasl2"
20828 else
20829   echo "$ac_t""no" 1>&6
20830 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
20831 echo "configure:20832: checking for sasl_client_init in -lsasl" >&5
20832 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
20833 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20834   echo $ac_n "(cached) $ac_c" 1>&6
20835 else
20836   ac_save_LIBS="$LIBS"
20837 LIBS="-lsasl  $LIBS"
20838 cat > conftest.$ac_ext <<EOF
20839 #line 20840 "configure"
20840 #include "confdefs.h"
20841 /* Override any gcc2 internal prototype to avoid an error.  */
20842 /* We use char because int might match the return type of a gcc2
20843     builtin and then its argument prototype would still apply.  */
20844 char sasl_client_init();
20845
20846 int main() {
20847 sasl_client_init()
20848 ; return 0; }
20849 EOF
20850 if { (eval echo configure:20851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20851   rm -rf conftest*
20852   eval "ac_cv_lib_$ac_lib_var=yes"
20853 else
20854   echo "configure: failed program was:" >&5
20855   cat conftest.$ac_ext >&5
20856   rm -rf conftest*
20857   eval "ac_cv_lib_$ac_lib_var=no"
20858 fi
20859 rm -f conftest*
20860 LIBS="$ac_save_LIBS"
20861
20862 fi
20863 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20864   echo "$ac_t""yes" 1>&6
20865   ol_link_sasl="-lsasl"
20866 else
20867   echo "$ac_t""no" 1>&6
20868 fi
20869
20870 fi
20871
20872         fi
20873
20874         if test $ol_link_sasl = no ; then
20875                 if test $ol_with_cyrus_sasl != auto ; then
20876                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
20877                 else
20878                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
20879                         echo "configure: warning: SASL authentication not supported!" 1>&2
20880                         if test $ol_link_tls = no ; then
20881                                 echo "configure: warning: Strong authentication not supported!" 1>&2
20882                         fi
20883                 fi
20884         else
20885                 echo $ac_n "checking Cyrus SASL library version""... $ac_c" 1>&6
20886 echo "configure:20887: checking Cyrus SASL library version" >&5
20887 if eval "test \"\${ol_cv_sasl_compat+set}\" = set"; then
20888   echo $ac_n "(cached) $ac_c" 1>&6
20889 else
20890   
20891         cat > conftest.$ac_ext <<EOF
20892 #line 20893 "configure"
20893 #include "confdefs.h"
20894
20895 #ifdef HAVE_SASL_SASL_H
20896 #include <sasl/sasl.h>
20897 #else
20898 #include <sasl.h>
20899 #endif
20900
20901 /* require 2.1.3 or later */
20902 #if SASL_VERSION_MAJOR == 2  && SASL_VERSION_MINOR > 1
20903         char *__sasl_compat = "2.2+ or better okay (we guess)";
20904 #elif SASL_VERSION_MAJOR == 2  && SASL_VERSION_MINOR == 1 \
20905         && SASL_VERSION_STEP >=3
20906         char *__sasl_compat = "2.1.3+ or better okay";
20907 #endif
20908         
20909 EOF
20910 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20911   egrep "__sasl_compat" >/dev/null 2>&1; then
20912   rm -rf conftest*
20913   ol_cv_sasl_compat=yes
20914 else
20915   rm -rf conftest*
20916   ol_cv_sasl_compat=no
20917 fi
20918 rm -f conftest*
20919
20920 fi
20921
20922 echo "$ac_t""$ol_cv_sasl_compat" 1>&6
20923
20924                 if test $ol_cv_sasl_compat = no ; then
20925                         ol_link_sasl=no
20926                         { echo "configure: error: Cyrus SASL library located but incompatible" 1>&2; exit 1; }
20927                 fi
20928
20929                 cat >> confdefs.h <<\EOF
20930 #define HAVE_CYRUS_SASL 1
20931 EOF
20932
20933                 SASL_LIBS="$ol_link_sasl"
20934                 if test $ol_enable_spasswd != no ; then
20935                         ol_link_spasswd=yes
20936                 fi
20937
20938                 ac_save_LIBS="$LIBS"
20939                 LIBS="$LIBS $ol_link_sasl"
20940                 echo $ac_n "checking for sasl_version""... $ac_c" 1>&6
20941 echo "configure:20942: checking for sasl_version" >&5
20942 if eval "test \"\${ac_cv_func_sasl_version+set}\" = set"; then
20943   echo $ac_n "(cached) $ac_c" 1>&6
20944 else
20945   cat > conftest.$ac_ext <<EOF
20946 #line 20947 "configure"
20947 #include "confdefs.h"
20948 /* System header to define __stub macros and hopefully few prototypes,
20949     which can conflict with char sasl_version(); below.  */
20950 #include <assert.h>
20951 /* Override any gcc2 internal prototype to avoid an error.  */
20952 /* We use char because int might match the return type of a gcc2
20953     builtin and then its argument prototype would still apply.  */
20954 char sasl_version();
20955 char (*f)();
20956
20957 int main() {
20958
20959 /* The GNU C library defines this for functions which it implements
20960     to always fail with ENOSYS.  Some functions are actually named
20961     something starting with __ and the normal name is an alias.  */
20962 #if defined (__stub_sasl_version) || defined (__stub___sasl_version)
20963 choke me
20964 #else
20965 f = sasl_version;
20966 #endif
20967
20968 ; return 0; }
20969 EOF
20970 if { (eval echo configure:20971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20971   rm -rf conftest*
20972   eval "ac_cv_func_sasl_version=yes"
20973 else
20974   echo "configure: failed program was:" >&5
20975   cat conftest.$ac_ext >&5
20976   rm -rf conftest*
20977   eval "ac_cv_func_sasl_version=no"
20978 fi
20979 rm -f conftest*
20980 fi
20981
20982 if eval "test \"`echo '$ac_cv_func_'sasl_version`\" = yes"; then
20983   echo "$ac_t""yes" 1>&6
20984   cat >> confdefs.h <<\EOF
20985 #define HAVE_SASL_VERSION 1
20986 EOF
20987
20988 else
20989   echo "$ac_t""no" 1>&6
20990 fi
20991
20992                 LIBS="$ac_save_LIBS"
20993         fi
20994
20995 else
20996         echo "configure: warning: SASL authentication not supported!" 1>&2
20997         if test $ol_link_tls = no ; then
20998                 echo "configure: warning: Strong authentication not supported!" 1>&2
20999         fi
21000 fi
21001
21002 if test $cross_compiling != yes -a "$ac_cv_mingw32" != yes ; then
21003         dev=no
21004         if test -r /dev/urandom ; then
21005                 dev="/dev/urandom";
21006         elif test -r /idev/urandom ; then
21007                 dev="/idev/urandom";
21008         elif test -r /dev/srandom ; then
21009                 dev="/dev/srandom";
21010         elif test -r /dev/random ; then
21011                 dev="/dev/random";
21012         elif test -r /idev/random ; then
21013                 dev="/idev/random";
21014         fi
21015
21016         if test $dev != no ; then
21017                 cat >> confdefs.h <<EOF
21018 #define URANDOM_DEVICE "$dev"
21019 EOF
21020
21021         fi
21022 fi
21023
21024 ol_link_fetch=no
21025 if test $ol_with_fetch != no ; then
21026         ol_LIBS=$LIBS
21027 LIBS="-lfetch -lcom_err $LIBS"
21028 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
21029 echo "configure:21030: checking fetch(3) library" >&5
21030 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
21031   echo $ac_n "(cached) $ac_c" 1>&6
21032 else
21033   
21034         cat > conftest.$ac_ext <<EOF
21035 #line 21036 "configure"
21036 #include "confdefs.h"
21037
21038 #include <sys/param.h>
21039 #include <stdio.h>
21040 #include <fetch.h>
21041 int main() {
21042 struct url *u = fetchParseURL("file:///"); 
21043 ; return 0; }
21044 EOF
21045 if { (eval echo configure:21046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21046   rm -rf conftest*
21047   ol_cv_lib_fetch=yes
21048 else
21049   echo "configure: failed program was:" >&5
21050   cat conftest.$ac_ext >&5
21051   rm -rf conftest*
21052   ol_cv_lib_fetch=no
21053 fi
21054 rm -f conftest*
21055 fi
21056
21057 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
21058 LIBS=$ol_LIBS
21059 if test $ol_cv_lib_fetch != no ; then
21060         ol_link_fetch="-lfetch -lcom_err"
21061         cat >> confdefs.h <<\EOF
21062 #define HAVE_FETCH 1
21063 EOF
21064
21065 fi
21066
21067
21068         if test $ol_cv_lib_fetch != no ; then
21069                 LUTIL_LIBS="$LUTIL_LIBS $ol_link_fetch"
21070                 ol_link_fetch=freebsd
21071
21072         elif test $ol_with_fetch != auto ; then
21073                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
21074         fi 
21075 fi
21076
21077 if test $ol_enable_crypt != no ; then
21078         save_LIBS="$LIBS"
21079         LIBS="$TLS_LIBS $LIBS"
21080
21081         echo $ac_n "checking for crypt""... $ac_c" 1>&6
21082 echo "configure:21083: checking for crypt" >&5
21083 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
21084   echo $ac_n "(cached) $ac_c" 1>&6
21085 else
21086   cat > conftest.$ac_ext <<EOF
21087 #line 21088 "configure"
21088 #include "confdefs.h"
21089 /* System header to define __stub macros and hopefully few prototypes,
21090     which can conflict with char crypt(); below.  */
21091 #include <assert.h>
21092 /* Override any gcc2 internal prototype to avoid an error.  */
21093 /* We use char because int might match the return type of a gcc2
21094     builtin and then its argument prototype would still apply.  */
21095 char crypt();
21096 char (*f)();
21097
21098 int main() {
21099
21100 /* The GNU C library defines this for functions which it implements
21101     to always fail with ENOSYS.  Some functions are actually named
21102     something starting with __ and the normal name is an alias.  */
21103 #if defined (__stub_crypt) || defined (__stub___crypt)
21104 choke me
21105 #else
21106 f = crypt;
21107 #endif
21108
21109 ; return 0; }
21110 EOF
21111 if { (eval echo configure:21112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21112   rm -rf conftest*
21113   eval "ac_cv_func_crypt=yes"
21114 else
21115   echo "configure: failed program was:" >&5
21116   cat conftest.$ac_ext >&5
21117   rm -rf conftest*
21118   eval "ac_cv_func_crypt=no"
21119 fi
21120 rm -f conftest*
21121 fi
21122
21123 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
21124   echo "$ac_t""yes" 1>&6
21125   have_crypt=yes
21126 else
21127   echo "$ac_t""no" 1>&6
21128
21129                 LIBS="$save_LIBS"
21130                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
21131 echo "configure:21132: checking for crypt in -lcrypt" >&5
21132 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
21133 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
21134   echo $ac_n "(cached) $ac_c" 1>&6
21135 else
21136   ac_save_LIBS="$LIBS"
21137 LIBS="-lcrypt  $LIBS"
21138 cat > conftest.$ac_ext <<EOF
21139 #line 21140 "configure"
21140 #include "confdefs.h"
21141 /* Override any gcc2 internal prototype to avoid an error.  */
21142 /* We use char because int might match the return type of a gcc2
21143     builtin and then its argument prototype would still apply.  */
21144 char crypt();
21145
21146 int main() {
21147 crypt()
21148 ; return 0; }
21149 EOF
21150 if { (eval echo configure:21151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21151   rm -rf conftest*
21152   eval "ac_cv_lib_$ac_lib_var=yes"
21153 else
21154   echo "configure: failed program was:" >&5
21155   cat conftest.$ac_ext >&5
21156   rm -rf conftest*
21157   eval "ac_cv_lib_$ac_lib_var=no"
21158 fi
21159 rm -f conftest*
21160 LIBS="$ac_save_LIBS"
21161
21162 fi
21163 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
21164   echo "$ac_t""yes" 1>&6
21165   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
21166                         have_crypt=yes
21167 else
21168   echo "$ac_t""no" 1>&6
21169 have_crypt=no
21170 fi
21171
21172 fi
21173
21174
21175         LIBS="$save_LIBS"
21176
21177         if test $have_crypt = yes ; then
21178                 cat >> confdefs.h <<\EOF
21179 #define HAVE_CRYPT 1
21180 EOF
21181
21182         else
21183                 echo "configure: warning: could not find crypt" 1>&2
21184                 if test $ol_enable_crypt = yes ; then
21185                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
21186                 fi
21187
21188                 echo "configure: warning: disabling crypt support" 1>&2
21189                 ol_enable_crypt=no
21190         fi
21191 fi
21192
21193 if test $ol_enable_proctitle != no ; then
21194         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
21195 echo "configure:21196: checking for setproctitle" >&5
21196 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
21197   echo $ac_n "(cached) $ac_c" 1>&6
21198 else
21199   cat > conftest.$ac_ext <<EOF
21200 #line 21201 "configure"
21201 #include "confdefs.h"
21202 /* System header to define __stub macros and hopefully few prototypes,
21203     which can conflict with char setproctitle(); below.  */
21204 #include <assert.h>
21205 /* Override any gcc2 internal prototype to avoid an error.  */
21206 /* We use char because int might match the return type of a gcc2
21207     builtin and then its argument prototype would still apply.  */
21208 char setproctitle();
21209 char (*f)();
21210
21211 int main() {
21212
21213 /* The GNU C library defines this for functions which it implements
21214     to always fail with ENOSYS.  Some functions are actually named
21215     something starting with __ and the normal name is an alias.  */
21216 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
21217 choke me
21218 #else
21219 f = setproctitle;
21220 #endif
21221
21222 ; return 0; }
21223 EOF
21224 if { (eval echo configure:21225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21225   rm -rf conftest*
21226   eval "ac_cv_func_setproctitle=yes"
21227 else
21228   echo "configure: failed program was:" >&5
21229   cat conftest.$ac_ext >&5
21230   rm -rf conftest*
21231   eval "ac_cv_func_setproctitle=no"
21232 fi
21233 rm -f conftest*
21234 fi
21235
21236 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
21237   echo "$ac_t""yes" 1>&6
21238   have_setproctitle=yes
21239 else
21240   echo "$ac_t""no" 1>&6
21241
21242                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
21243 echo "configure:21244: checking for setproctitle in -lutil" >&5
21244 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
21245 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
21246   echo $ac_n "(cached) $ac_c" 1>&6
21247 else
21248   ac_save_LIBS="$LIBS"
21249 LIBS="-lutil  $LIBS"
21250 cat > conftest.$ac_ext <<EOF
21251 #line 21252 "configure"
21252 #include "confdefs.h"
21253 /* Override any gcc2 internal prototype to avoid an error.  */
21254 /* We use char because int might match the return type of a gcc2
21255     builtin and then its argument prototype would still apply.  */
21256 char setproctitle();
21257
21258 int main() {
21259 setproctitle()
21260 ; return 0; }
21261 EOF
21262 if { (eval echo configure:21263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21263   rm -rf conftest*
21264   eval "ac_cv_lib_$ac_lib_var=yes"
21265 else
21266   echo "configure: failed program was:" >&5
21267   cat conftest.$ac_ext >&5
21268   rm -rf conftest*
21269   eval "ac_cv_lib_$ac_lib_var=no"
21270 fi
21271 rm -f conftest*
21272 LIBS="$ac_save_LIBS"
21273
21274 fi
21275 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
21276   echo "$ac_t""yes" 1>&6
21277   have_setproctitle=yes
21278                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
21279 else
21280   echo "$ac_t""no" 1>&6
21281 have_setproctitle=no
21282                         LIBOBJS="$LIBOBJS setproctitle.o"
21283                         LIBSRCS="$LIBSRCS setproctitle.c"
21284 fi
21285
21286 fi
21287
21288
21289         if test $have_setproctitle = yes ; then
21290                 cat >> confdefs.h <<\EOF
21291 #define HAVE_SETPROCTITLE 1
21292 EOF
21293
21294         fi
21295 fi
21296
21297 if test $ol_enable_slp != no ; then
21298         for ac_hdr in slp.h 
21299 do
21300 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
21301 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
21302 echo "configure:21303: checking for $ac_hdr" >&5
21303 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
21304   echo $ac_n "(cached) $ac_c" 1>&6
21305 else
21306   cat > conftest.$ac_ext <<EOF
21307 #line 21308 "configure"
21308 #include "confdefs.h"
21309 #include <$ac_hdr>
21310 EOF
21311 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
21312 { (eval echo configure:21313: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
21313 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
21314 if test -z "$ac_err"; then
21315   rm -rf conftest*
21316   eval "ac_cv_header_$ac_safe=yes"
21317 else
21318   echo "$ac_err" >&5
21319   echo "configure: failed program was:" >&5
21320   cat conftest.$ac_ext >&5
21321   rm -rf conftest*
21322   eval "ac_cv_header_$ac_safe=no"
21323 fi
21324 rm -f conftest*
21325 fi
21326 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
21327   echo "$ac_t""yes" 1>&6
21328     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
21329   cat >> confdefs.h <<EOF
21330 #define $ac_tr_hdr 1
21331 EOF
21332  
21333 else
21334   echo "$ac_t""no" 1>&6
21335 fi
21336 done
21337
21338
21339         if test $ac_cv_header_slp_h = yes ; then
21340                 echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
21341 echo "configure:21342: checking for SLPOpen in -lslp" >&5
21342 ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-:%__p__%'`
21343 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
21344   echo $ac_n "(cached) $ac_c" 1>&6
21345 else
21346   ac_save_LIBS="$LIBS"
21347 LIBS="-lslp  $LIBS"
21348 cat > conftest.$ac_ext <<EOF
21349 #line 21350 "configure"
21350 #include "confdefs.h"
21351 /* Override any gcc2 internal prototype to avoid an error.  */
21352 /* We use char because int might match the return type of a gcc2
21353     builtin and then its argument prototype would still apply.  */
21354 char SLPOpen();
21355
21356 int main() {
21357 SLPOpen()
21358 ; return 0; }
21359 EOF
21360 if { (eval echo configure:21361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21361   rm -rf conftest*
21362   eval "ac_cv_lib_$ac_lib_var=yes"
21363 else
21364   echo "configure: failed program was:" >&5
21365   cat conftest.$ac_ext >&5
21366   rm -rf conftest*
21367   eval "ac_cv_lib_$ac_lib_var=no"
21368 fi
21369 rm -f conftest*
21370 LIBS="$ac_save_LIBS"
21371
21372 fi
21373 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
21374   echo "$ac_t""yes" 1>&6
21375   have_slp=yes
21376 else
21377   echo "$ac_t""no" 1>&6
21378 have_slp=no
21379 fi
21380
21381                 if test $have_slp = yes ; then
21382                         cat >> confdefs.h <<\EOF
21383 #define HAVE_SLP 1
21384 EOF
21385
21386                         SLAPD_SLP_LIBS=-lslp
21387                 fi
21388
21389         elif test $ol_enable_slp = yes ; then
21390                 { echo "configure: error: SLP not found" 1>&2; exit 1; }
21391         fi
21392 fi
21393
21394
21395 echo $ac_n "checking long long""... $ac_c" 1>&6
21396 echo "configure:21397: checking long long" >&5
21397 if eval "test \"\${ol_cv_type_long_long+set}\" = set"; then
21398   echo $ac_n "(cached) $ac_c" 1>&6
21399 else
21400   
21401         cat > conftest.$ac_ext <<EOF
21402 #line 21403 "configure"
21403 #include "confdefs.h"
21404
21405 int main() {
21406 long long x;
21407 ; return 0; }
21408 EOF
21409 if { (eval echo configure:21410: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21410   rm -rf conftest*
21411   ol_cv_type_long_long=yes
21412 else
21413   echo "configure: failed program was:" >&5
21414   cat conftest.$ac_ext >&5
21415   rm -rf conftest*
21416   ol_cv_type_long_long=no
21417 fi
21418 rm -f conftest*
21419 fi
21420
21421 echo "$ac_t""$ol_cv_type_long_long" 1>&6
21422 if test $ol_cv_type_long_long = yes; then
21423         cat >> confdefs.h <<\EOF
21424 #define HAVE_LONG_LONG 1
21425 EOF
21426
21427 fi
21428
21429 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
21430 echo "configure:21431: checking for ANSI C header files" >&5
21431 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
21432   echo $ac_n "(cached) $ac_c" 1>&6
21433 else
21434   cat > conftest.$ac_ext <<EOF
21435 #line 21436 "configure"
21436 #include "confdefs.h"
21437 #include <stdlib.h>
21438 #include <stdarg.h>
21439 #include <string.h>
21440 #include <float.h>
21441 EOF
21442 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
21443 { (eval echo configure:21444: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
21444 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
21445 if test -z "$ac_err"; then
21446   rm -rf conftest*
21447   ac_cv_header_stdc=yes
21448 else
21449   echo "$ac_err" >&5
21450   echo "configure: failed program was:" >&5
21451   cat conftest.$ac_ext >&5
21452   rm -rf conftest*
21453   ac_cv_header_stdc=no
21454 fi
21455 rm -f conftest*
21456
21457 if test $ac_cv_header_stdc = yes; then
21458   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
21459 cat > conftest.$ac_ext <<EOF
21460 #line 21461 "configure"
21461 #include "confdefs.h"
21462 #include <string.h>
21463 EOF
21464 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21465   egrep "memchr" >/dev/null 2>&1; then
21466   :
21467 else
21468   rm -rf conftest*
21469   ac_cv_header_stdc=no
21470 fi
21471 rm -f conftest*
21472
21473 fi
21474
21475 if test $ac_cv_header_stdc = yes; then
21476   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
21477 cat > conftest.$ac_ext <<EOF
21478 #line 21479 "configure"
21479 #include "confdefs.h"
21480 #include <stdlib.h>
21481 EOF
21482 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21483   egrep "free" >/dev/null 2>&1; then
21484   :
21485 else
21486   rm -rf conftest*
21487   ac_cv_header_stdc=no
21488 fi
21489 rm -f conftest*
21490
21491 fi
21492
21493 if test $ac_cv_header_stdc = yes; then
21494   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
21495 if test "$cross_compiling" = yes; then
21496   :
21497 else
21498   cat > conftest.$ac_ext <<EOF
21499 #line 21500 "configure"
21500 #include "confdefs.h"
21501 #include <ctype.h>
21502 #if ((' ' & 0x0FF) == 0x020)
21503 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
21504 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
21505 #else
21506 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
21507  || ('j' <= (c) && (c) <= 'r') \
21508  || ('s' <= (c) && (c) <= 'z'))
21509 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
21510 #endif
21511 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
21512 int main () { int i; for (i = 0; i < 256; i++)
21513 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
21514 exit (0); }
21515
21516 EOF
21517 if { (eval echo configure:21518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
21518 then
21519   :
21520 else
21521   echo "configure: failed program was:" >&5
21522   cat conftest.$ac_ext >&5
21523   rm -fr conftest*
21524   ac_cv_header_stdc=no
21525 fi
21526 rm -fr conftest*
21527 fi
21528
21529 fi
21530 fi
21531
21532 echo "$ac_t""$ac_cv_header_stdc" 1>&6
21533 if test $ac_cv_header_stdc = yes; then
21534   cat >> confdefs.h <<\EOF
21535 #define STDC_HEADERS 1
21536 EOF
21537
21538 fi
21539
21540 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
21541 echo "configure:21542: checking for mode_t" >&5
21542 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
21543   echo $ac_n "(cached) $ac_c" 1>&6
21544 else
21545   cat > conftest.$ac_ext <<EOF
21546 #line 21547 "configure"
21547 #include "confdefs.h"
21548 #include <sys/types.h>
21549 #if STDC_HEADERS
21550 #include <stdlib.h>
21551 #include <stddef.h>
21552 #endif
21553
21554 EOF
21555 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21556   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21557   rm -rf conftest*
21558   eval "ac_cv_type_mode_t=yes"
21559 else
21560   rm -rf conftest*
21561   eval "ac_cv_type_mode_t=no"
21562 fi
21563 rm -f conftest*
21564
21565 fi
21566 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
21567   echo "$ac_t""yes" 1>&6
21568 else
21569   echo "$ac_t""no" 1>&6
21570   cat >> confdefs.h <<EOF
21571 #define mode_t int
21572 EOF
21573
21574 fi
21575
21576 echo $ac_n "checking for off_t""... $ac_c" 1>&6
21577 echo "configure:21578: checking for off_t" >&5
21578 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
21579   echo $ac_n "(cached) $ac_c" 1>&6
21580 else
21581   cat > conftest.$ac_ext <<EOF
21582 #line 21583 "configure"
21583 #include "confdefs.h"
21584 #include <sys/types.h>
21585 #if STDC_HEADERS
21586 #include <stdlib.h>
21587 #include <stddef.h>
21588 #endif
21589
21590 EOF
21591 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21592   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21593   rm -rf conftest*
21594   eval "ac_cv_type_off_t=yes"
21595 else
21596   rm -rf conftest*
21597   eval "ac_cv_type_off_t=no"
21598 fi
21599 rm -f conftest*
21600
21601 fi
21602 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
21603   echo "$ac_t""yes" 1>&6
21604 else
21605   echo "$ac_t""no" 1>&6
21606   cat >> confdefs.h <<EOF
21607 #define off_t long
21608 EOF
21609
21610 fi
21611
21612 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
21613 echo "configure:21614: checking for pid_t" >&5
21614 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
21615   echo $ac_n "(cached) $ac_c" 1>&6
21616 else
21617   cat > conftest.$ac_ext <<EOF
21618 #line 21619 "configure"
21619 #include "confdefs.h"
21620 #include <sys/types.h>
21621 #if STDC_HEADERS
21622 #include <stdlib.h>
21623 #include <stddef.h>
21624 #endif
21625
21626 EOF
21627 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21628   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21629   rm -rf conftest*
21630   eval "ac_cv_type_pid_t=yes"
21631 else
21632   rm -rf conftest*
21633   eval "ac_cv_type_pid_t=no"
21634 fi
21635 rm -f conftest*
21636
21637 fi
21638 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
21639   echo "$ac_t""yes" 1>&6
21640 else
21641   echo "$ac_t""no" 1>&6
21642   cat >> confdefs.h <<EOF
21643 #define pid_t int
21644 EOF
21645
21646 fi
21647
21648 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
21649 echo "configure:21650: checking for ptrdiff_t" >&5
21650 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
21651   echo $ac_n "(cached) $ac_c" 1>&6
21652 else
21653   cat > conftest.$ac_ext <<EOF
21654 #line 21655 "configure"
21655 #include "confdefs.h"
21656 #include <stddef.h>
21657 int main() {
21658 ptrdiff_t p
21659 ; return 0; }
21660 EOF
21661 if { (eval echo configure:21662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21662   rm -rf conftest*
21663   am_cv_type_ptrdiff_t=yes
21664 else
21665   echo "configure: failed program was:" >&5
21666   cat conftest.$ac_ext >&5
21667   rm -rf conftest*
21668   am_cv_type_ptrdiff_t=no
21669 fi
21670 rm -f conftest*
21671 fi
21672
21673 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
21674    if test $am_cv_type_ptrdiff_t = yes; then
21675      cat >> confdefs.h <<\EOF
21676 #define HAVE_PTRDIFF_T 1
21677 EOF
21678
21679    fi
21680
21681 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
21682 echo "configure:21683: checking return type of signal handlers" >&5
21683 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
21684   echo $ac_n "(cached) $ac_c" 1>&6
21685 else
21686   cat > conftest.$ac_ext <<EOF
21687 #line 21688 "configure"
21688 #include "confdefs.h"
21689 #include <sys/types.h>
21690 #include <signal.h>
21691 #ifdef signal
21692 #undef signal
21693 #endif
21694 #ifdef __cplusplus
21695 extern "C" void (*signal (int, void (*)(int)))(int);
21696 #else
21697 void (*signal ()) ();
21698 #endif
21699
21700 int main() {
21701 int i;
21702 ; return 0; }
21703 EOF
21704 if { (eval echo configure:21705: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21705   rm -rf conftest*
21706   ac_cv_type_signal=void
21707 else
21708   echo "configure: failed program was:" >&5
21709   cat conftest.$ac_ext >&5
21710   rm -rf conftest*
21711   ac_cv_type_signal=int
21712 fi
21713 rm -f conftest*
21714 fi
21715
21716 echo "$ac_t""$ac_cv_type_signal" 1>&6
21717 cat >> confdefs.h <<EOF
21718 #define RETSIGTYPE $ac_cv_type_signal
21719 EOF
21720
21721
21722 echo $ac_n "checking for size_t""... $ac_c" 1>&6
21723 echo "configure:21724: checking for size_t" >&5
21724 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
21725   echo $ac_n "(cached) $ac_c" 1>&6
21726 else
21727   cat > conftest.$ac_ext <<EOF
21728 #line 21729 "configure"
21729 #include "confdefs.h"
21730 #include <sys/types.h>
21731 #if STDC_HEADERS
21732 #include <stdlib.h>
21733 #include <stddef.h>
21734 #endif
21735
21736 EOF
21737 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21738   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21739   rm -rf conftest*
21740   eval "ac_cv_type_size_t=yes"
21741 else
21742   rm -rf conftest*
21743   eval "ac_cv_type_size_t=no"
21744 fi
21745 rm -f conftest*
21746
21747 fi
21748 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
21749   echo "$ac_t""yes" 1>&6
21750 else
21751   echo "$ac_t""no" 1>&6
21752   cat >> confdefs.h <<EOF
21753 #define size_t unsigned
21754 EOF
21755
21756 fi
21757
21758
21759 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
21760 echo "configure:21761: checking for ssize_t" >&5
21761 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
21762   echo $ac_n "(cached) $ac_c" 1>&6
21763 else
21764   cat > conftest.$ac_ext <<EOF
21765 #line 21766 "configure"
21766 #include "confdefs.h"
21767 #include <sys/types.h>
21768 #if STDC_HEADERS
21769 #include <stdlib.h>
21770 #include <stddef.h>
21771 #endif
21772
21773 EOF
21774 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21775   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21776   rm -rf conftest*
21777   eval "ac_cv_type_ssize_t=yes"
21778 else
21779   rm -rf conftest*
21780   eval "ac_cv_type_ssize_t=no"
21781 fi
21782 rm -f conftest*
21783
21784 fi
21785 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
21786   echo "$ac_t""yes" 1>&6
21787 else
21788   echo "$ac_t""no" 1>&6
21789   cat >> confdefs.h <<EOF
21790 #define ssize_t signed int
21791 EOF
21792
21793 fi
21794
21795 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
21796 echo "configure:21797: checking for caddr_t" >&5
21797 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
21798   echo $ac_n "(cached) $ac_c" 1>&6
21799 else
21800   cat > conftest.$ac_ext <<EOF
21801 #line 21802 "configure"
21802 #include "confdefs.h"
21803 #include <sys/types.h>
21804 #if STDC_HEADERS
21805 #include <stdlib.h>
21806 #include <stddef.h>
21807 #endif
21808
21809 EOF
21810 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21811   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21812   rm -rf conftest*
21813   eval "ac_cv_type_caddr_t=yes"
21814 else
21815   rm -rf conftest*
21816   eval "ac_cv_type_caddr_t=no"
21817 fi
21818 rm -f conftest*
21819
21820 fi
21821 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
21822   echo "$ac_t""yes" 1>&6
21823 else
21824   echo "$ac_t""no" 1>&6
21825   cat >> confdefs.h <<EOF
21826 #define caddr_t char *
21827 EOF
21828
21829 fi
21830
21831
21832 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
21833 echo "configure:21834: checking for socklen_t" >&5
21834 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
21835   echo $ac_n "(cached) $ac_c" 1>&6
21836 else
21837   cat > conftest.$ac_ext <<EOF
21838 #line 21839 "configure"
21839 #include "confdefs.h"
21840
21841 #ifdef HAVE_SYS_TYPES_H
21842 #include <sys/types.h>
21843 #endif
21844 #ifdef HAVE_SYS_SOCKET_H
21845 #include <sys/socket.h>
21846 #endif
21847
21848 int main() {
21849 socklen_t len;
21850 ; return 0; }
21851 EOF
21852 if { (eval echo configure:21853: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21853   rm -rf conftest*
21854   ol_cv_type_socklen_t=yes
21855 else
21856   echo "configure: failed program was:" >&5
21857   cat conftest.$ac_ext >&5
21858   rm -rf conftest*
21859   ol_cv_type_socklen_t=no
21860 fi
21861 rm -f conftest*
21862 fi
21863
21864 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
21865   if test $ol_cv_type_socklen_t = no; then
21866     cat >> confdefs.h <<\EOF
21867 #define socklen_t int
21868 EOF
21869
21870   fi
21871  
21872 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
21873 echo "configure:21874: checking for member st_blksize in aggregate type struct stat" >&5
21874 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
21875   echo $ac_n "(cached) $ac_c" 1>&6
21876 else
21877   cat > conftest.$ac_ext <<EOF
21878 #line 21879 "configure"
21879 #include "confdefs.h"
21880 #include <sys/types.h>
21881 #include <sys/stat.h>
21882 int main() {
21883 struct stat foo; foo.st_blksize;
21884 ; return 0; }
21885 EOF
21886 if { (eval echo configure:21887: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21887   rm -rf conftest*
21888   ac_cv_c_struct_member_st_blksize=yes
21889 else
21890   echo "configure: failed program was:" >&5
21891   cat conftest.$ac_ext >&5
21892   rm -rf conftest*
21893   ac_cv_c_struct_member_st_blksize=no
21894 fi
21895 rm -f conftest*
21896 fi
21897
21898 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
21899 st_blksize="$ac_cv_c_struct_member_st_blksize"
21900 if test $ac_cv_c_struct_member_st_blksize = yes; then
21901   cat >> confdefs.h <<\EOF
21902 #define HAVE_ST_BLKSIZE 1
21903 EOF
21904
21905 fi
21906
21907 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
21908 echo "configure:21909: checking whether time.h and sys/time.h may both be included" >&5
21909 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
21910   echo $ac_n "(cached) $ac_c" 1>&6
21911 else
21912   cat > conftest.$ac_ext <<EOF
21913 #line 21914 "configure"
21914 #include "confdefs.h"
21915 #include <sys/types.h>
21916 #include <sys/time.h>
21917 #include <time.h>
21918 int main() {
21919 struct tm *tp;
21920 ; return 0; }
21921 EOF
21922 if { (eval echo configure:21923: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21923   rm -rf conftest*
21924   ac_cv_header_time=yes
21925 else
21926   echo "configure: failed program was:" >&5
21927   cat conftest.$ac_ext >&5
21928   rm -rf conftest*
21929   ac_cv_header_time=no
21930 fi
21931 rm -f conftest*
21932 fi
21933
21934 echo "$ac_t""$ac_cv_header_time" 1>&6
21935 if test $ac_cv_header_time = yes; then
21936   cat >> confdefs.h <<\EOF
21937 #define TIME_WITH_SYS_TIME 1
21938 EOF
21939
21940 fi
21941
21942 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
21943 echo "configure:21944: checking whether struct tm is in sys/time.h or time.h" >&5
21944 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
21945   echo $ac_n "(cached) $ac_c" 1>&6
21946 else
21947   cat > conftest.$ac_ext <<EOF
21948 #line 21949 "configure"
21949 #include "confdefs.h"
21950 #include <sys/types.h>
21951 #include <time.h>
21952 int main() {
21953 struct tm *tp; tp->tm_sec;
21954 ; return 0; }
21955 EOF
21956 if { (eval echo configure:21957: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21957   rm -rf conftest*
21958   ac_cv_struct_tm=time.h
21959 else
21960   echo "configure: failed program was:" >&5
21961   cat conftest.$ac_ext >&5
21962   rm -rf conftest*
21963   ac_cv_struct_tm=sys/time.h
21964 fi
21965 rm -f conftest*
21966 fi
21967
21968 echo "$ac_t""$ac_cv_struct_tm" 1>&6
21969 if test $ac_cv_struct_tm = sys/time.h; then
21970   cat >> confdefs.h <<\EOF
21971 #define TM_IN_SYS_TIME 1
21972 EOF
21973
21974 fi
21975
21976 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
21977 echo "configure:21978: checking for uid_t in sys/types.h" >&5
21978 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
21979   echo $ac_n "(cached) $ac_c" 1>&6
21980 else
21981   cat > conftest.$ac_ext <<EOF
21982 #line 21983 "configure"
21983 #include "confdefs.h"
21984 #include <sys/types.h>
21985 EOF
21986 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21987   egrep "uid_t" >/dev/null 2>&1; then
21988   rm -rf conftest*
21989   ac_cv_type_uid_t=yes
21990 else
21991   rm -rf conftest*
21992   ac_cv_type_uid_t=no
21993 fi
21994 rm -f conftest*
21995
21996 fi
21997
21998 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
21999 if test $ac_cv_type_uid_t = no; then
22000   cat >> confdefs.h <<\EOF
22001 #define uid_t int
22002 EOF
22003
22004   cat >> confdefs.h <<\EOF
22005 #define gid_t int
22006 EOF
22007
22008 fi
22009
22010 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
22011 echo "configure:22012: checking for sig_atomic_t" >&5
22012 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
22013   echo $ac_n "(cached) $ac_c" 1>&6
22014 else
22015   cat > conftest.$ac_ext <<EOF
22016 #line 22017 "configure"
22017 #include "confdefs.h"
22018 #include <signal.h>
22019 int main() {
22020 sig_atomic_t atomic;
22021 ; return 0; }
22022 EOF
22023 if { (eval echo configure:22024: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22024   rm -rf conftest*
22025   ol_cv_type_sig_atomic_t=yes
22026 else
22027   echo "configure: failed program was:" >&5
22028   cat conftest.$ac_ext >&5
22029   rm -rf conftest*
22030   ol_cv_type_sig_atomic_t=no
22031 fi
22032 rm -f conftest*
22033 fi
22034
22035 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
22036   if test $ol_cv_type_sig_atomic_t = no; then
22037     cat >> confdefs.h <<\EOF
22038 #define sig_atomic_t int
22039 EOF
22040
22041   fi
22042  
22043
22044
22045 # test for pw_gecos in struct passwd
22046 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
22047 echo "configure:22048: checking struct passwd for pw_gecos" >&5
22048 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
22049   echo $ac_n "(cached) $ac_c" 1>&6
22050 else
22051   
22052         cat > conftest.$ac_ext <<EOF
22053 #line 22054 "configure"
22054 #include "confdefs.h"
22055 #include <pwd.h>
22056 int main() {
22057
22058         struct passwd pwd;
22059         pwd.pw_gecos = pwd.pw_name;
22060
22061 ; return 0; }
22062 EOF
22063 if { (eval echo configure:22064: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22064   rm -rf conftest*
22065   ol_cv_struct_passwd_pw_gecos=yes
22066 else
22067   echo "configure: failed program was:" >&5
22068   cat conftest.$ac_ext >&5
22069   rm -rf conftest*
22070   ol_cv_struct_passwd_pw_gecos=no
22071 fi
22072 rm -f conftest*
22073 fi
22074
22075 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
22076 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
22077         cat >> confdefs.h <<\EOF
22078 #define HAVE_PW_GECOS 1
22079 EOF
22080
22081 fi
22082
22083 # test for pw_passwd in struct passwd
22084 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
22085 echo "configure:22086: checking struct passwd for pw_passwd" >&5
22086 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
22087   echo $ac_n "(cached) $ac_c" 1>&6
22088 else
22089   
22090         cat > conftest.$ac_ext <<EOF
22091 #line 22092 "configure"
22092 #include "confdefs.h"
22093 #include <pwd.h>
22094 int main() {
22095
22096         struct passwd pwd;
22097         pwd.pw_passwd = pwd.pw_name;
22098
22099 ; return 0; }
22100 EOF
22101 if { (eval echo configure:22102: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22102   rm -rf conftest*
22103   ol_cv_struct_passwd_pw_passwd=yes
22104 else
22105   echo "configure: failed program was:" >&5
22106   cat conftest.$ac_ext >&5
22107   rm -rf conftest*
22108   ol_cv_struct_passwd_pw_passwd=no
22109 fi
22110 rm -f conftest*
22111 fi
22112
22113 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
22114 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
22115         cat >> confdefs.h <<\EOF
22116 #define HAVE_PW_PASSWD 1
22117 EOF
22118
22119 fi
22120
22121
22122 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
22123 echo "configure:22124: checking if toupper() requires islower()" >&5
22124 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
22125   echo $ac_n "(cached) $ac_c" 1>&6
22126 else
22127   
22128         if test "$cross_compiling" = yes; then
22129   ol_cv_c_upper_lower=safe
22130 else
22131   cat > conftest.$ac_ext <<EOF
22132 #line 22133 "configure"
22133 #include "confdefs.h"
22134
22135 #include <ctype.h>
22136 main()
22137 {
22138         if ('C' == toupper('C'))
22139                 exit(0);
22140         else
22141                 exit(1);
22142 }
22143 EOF
22144 if { (eval echo configure:22145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
22145 then
22146   ol_cv_c_upper_lower=no
22147 else
22148   echo "configure: failed program was:" >&5
22149   cat conftest.$ac_ext >&5
22150   rm -fr conftest*
22151   ol_cv_c_upper_lower=yes
22152 fi
22153 rm -fr conftest*
22154 fi
22155
22156 fi
22157
22158 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
22159 if test $ol_cv_c_upper_lower != no ; then
22160         cat >> confdefs.h <<\EOF
22161 #define C_UPPER_LOWER 1
22162 EOF
22163
22164 fi
22165
22166 echo $ac_n "checking for working const""... $ac_c" 1>&6
22167 echo "configure:22168: checking for working const" >&5
22168 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
22169   echo $ac_n "(cached) $ac_c" 1>&6
22170 else
22171   cat > conftest.$ac_ext <<EOF
22172 #line 22173 "configure"
22173 #include "confdefs.h"
22174
22175 int main() {
22176
22177 /* Ultrix mips cc rejects this.  */
22178 typedef int charset[2]; const charset x;
22179 /* SunOS 4.1.1 cc rejects this.  */
22180 char const *const *ccp;
22181 char **p;
22182 /* NEC SVR4.0.2 mips cc rejects this.  */
22183 struct point {int x, y;};
22184 static struct point const zero = {0,0};
22185 /* AIX XL C 1.02.0.0 rejects this.
22186    It does not let you subtract one const X* pointer from another in an arm
22187    of an if-expression whose if-part is not a constant expression */
22188 const char *g = "string";
22189 ccp = &g + (g ? g-g : 0);
22190 /* HPUX 7.0 cc rejects these. */
22191 ++ccp;
22192 p = (char**) ccp;
22193 ccp = (char const *const *) p;
22194 { /* SCO 3.2v4 cc rejects this.  */
22195   char *t;
22196   char const *s = 0 ? (char *) 0 : (char const *) 0;
22197
22198   *t++ = 0;
22199 }
22200 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
22201   int x[] = {25, 17};
22202   const int *foo = &x[0];
22203   ++foo;
22204 }
22205 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
22206   typedef const int *iptr;
22207   iptr p = 0;
22208   ++p;
22209 }
22210 { /* AIX XL C 1.02.0.0 rejects this saying
22211      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
22212   struct s { int j; const int *ap[3]; };
22213   struct s *b; b->j = 5;
22214 }
22215 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
22216   const int foo = 10;
22217 }
22218
22219 ; return 0; }
22220 EOF
22221 if { (eval echo configure:22222: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22222   rm -rf conftest*
22223   ac_cv_c_const=yes
22224 else
22225   echo "configure: failed program was:" >&5
22226   cat conftest.$ac_ext >&5
22227   rm -rf conftest*
22228   ac_cv_c_const=no
22229 fi
22230 rm -f conftest*
22231 fi
22232
22233 echo "$ac_t""$ac_cv_c_const" 1>&6
22234 if test $ac_cv_c_const = no; then
22235   cat >> confdefs.h <<\EOF
22236 #define const 
22237 EOF
22238
22239 fi
22240
22241 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
22242 echo "configure:22243: checking if compiler understands volatile" >&5
22243 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
22244   echo $ac_n "(cached) $ac_c" 1>&6
22245 else
22246   cat > conftest.$ac_ext <<EOF
22247 #line 22248 "configure"
22248 #include "confdefs.h"
22249 int x, y, z;
22250 int main() {
22251 volatile int a; int * volatile b = x ? &y : &z;
22252       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
22253       *b = 0;
22254 ; return 0; }
22255 EOF
22256 if { (eval echo configure:22257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22257   rm -rf conftest*
22258   ol_cv_c_volatile=yes
22259 else
22260   echo "configure: failed program was:" >&5
22261   cat conftest.$ac_ext >&5
22262   rm -rf conftest*
22263   ol_cv_c_volatile=no
22264 fi
22265 rm -f conftest*
22266 fi
22267
22268 echo "$ac_t""$ol_cv_c_volatile" 1>&6
22269   if test $ol_cv_c_volatile = yes; then
22270     : 
22271   else
22272     cat >> confdefs.h <<\EOF
22273 #define volatile 
22274 EOF
22275
22276   fi
22277  
22278
22279 if test $cross_compiling = yes ; then
22280         cat >> confdefs.h <<\EOF
22281 #define CROSS_COMPILING 1
22282 EOF
22283
22284 else
22285         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
22286 echo "configure:22287: checking whether byte ordering is bigendian" >&5
22287 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
22288   echo $ac_n "(cached) $ac_c" 1>&6
22289 else
22290   ac_cv_c_bigendian=unknown
22291 # See if sys/param.h defines the BYTE_ORDER macro.
22292 cat > conftest.$ac_ext <<EOF
22293 #line 22294 "configure"
22294 #include "confdefs.h"
22295 #include <sys/types.h>
22296 #include <sys/param.h>
22297 int main() {
22298
22299 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
22300  bogus endian macros
22301 #endif
22302 ; return 0; }
22303 EOF
22304 if { (eval echo configure:22305: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22305   rm -rf conftest*
22306   # It does; now see whether it defined to BIG_ENDIAN or not.
22307 cat > conftest.$ac_ext <<EOF
22308 #line 22309 "configure"
22309 #include "confdefs.h"
22310 #include <sys/types.h>
22311 #include <sys/param.h>
22312 int main() {
22313
22314 #if BYTE_ORDER != BIG_ENDIAN
22315  not big endian
22316 #endif
22317 ; return 0; }
22318 EOF
22319 if { (eval echo configure:22320: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22320   rm -rf conftest*
22321   ac_cv_c_bigendian=yes
22322 else
22323   echo "configure: failed program was:" >&5
22324   cat conftest.$ac_ext >&5
22325   rm -rf conftest*
22326   ac_cv_c_bigendian=no
22327 fi
22328 rm -f conftest*
22329 else
22330   echo "configure: failed program was:" >&5
22331   cat conftest.$ac_ext >&5
22332 fi
22333 rm -f conftest*
22334 if test $ac_cv_c_bigendian = unknown; then
22335 if test "$cross_compiling" = yes; then
22336     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
22337 else
22338   cat > conftest.$ac_ext <<EOF
22339 #line 22340 "configure"
22340 #include "confdefs.h"
22341 main () {
22342   /* Are we little or big endian?  From Harbison&Steele.  */
22343   union
22344   {
22345     long l;
22346     char c[sizeof (long)];
22347   } u;
22348   u.l = 1;
22349   exit (u.c[sizeof (long) - 1] == 1);
22350 }
22351 EOF
22352 if { (eval echo configure:22353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
22353 then
22354   ac_cv_c_bigendian=no
22355 else
22356   echo "configure: failed program was:" >&5
22357   cat conftest.$ac_ext >&5
22358   rm -fr conftest*
22359   ac_cv_c_bigendian=yes
22360 fi
22361 rm -fr conftest*
22362 fi
22363
22364 fi
22365 fi
22366
22367 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
22368 if test $ac_cv_c_bigendian = yes; then
22369   cat >> confdefs.h <<\EOF
22370 #define WORDS_BIGENDIAN 1
22371 EOF
22372
22373 fi
22374
22375 fi
22376
22377 echo $ac_n "checking size of short""... $ac_c" 1>&6
22378 echo "configure:22379: checking size of short" >&5 
22379 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
22380   echo $ac_n "(cached) $ac_c" 1>&6
22381 else
22382   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
22383   cat > conftest.$ac_ext <<EOF
22384 #line 22385 "configure"
22385 #include "confdefs.h"
22386 #include "confdefs.h" 
22387 #include <sys/types.h> 
22388  
22389
22390 int main() {
22391 switch (0) case 0: case (sizeof (short) == $ac_size):;
22392 ; return 0; }
22393 EOF
22394 if { (eval echo configure:22395: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22395   rm -rf conftest*
22396   ac_cv_sizeof_short=$ac_size
22397 else
22398   echo "configure: failed program was:" >&5
22399   cat conftest.$ac_ext >&5
22400 fi
22401 rm -f conftest* 
22402   if test x$ac_cv_sizeof_short != x ; then break; fi 
22403 done 
22404
22405 fi
22406  
22407 if test x$ac_cv_sizeof_short = x ; then 
22408   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
22409 fi 
22410 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
22411 cat >> confdefs.h <<EOF
22412 #define SIZEOF_SHORT $ac_cv_sizeof_short
22413 EOF
22414  
22415  
22416 echo $ac_n "checking size of int""... $ac_c" 1>&6
22417 echo "configure:22418: checking size of int" >&5 
22418 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
22419   echo $ac_n "(cached) $ac_c" 1>&6
22420 else
22421   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
22422   cat > conftest.$ac_ext <<EOF
22423 #line 22424 "configure"
22424 #include "confdefs.h"
22425 #include "confdefs.h" 
22426 #include <sys/types.h> 
22427  
22428
22429 int main() {
22430 switch (0) case 0: case (sizeof (int) == $ac_size):;
22431 ; return 0; }
22432 EOF
22433 if { (eval echo configure:22434: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22434   rm -rf conftest*
22435   ac_cv_sizeof_int=$ac_size
22436 else
22437   echo "configure: failed program was:" >&5
22438   cat conftest.$ac_ext >&5
22439 fi
22440 rm -f conftest* 
22441   if test x$ac_cv_sizeof_int != x ; then break; fi 
22442 done 
22443
22444 fi
22445  
22446 if test x$ac_cv_sizeof_int = x ; then 
22447   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
22448 fi 
22449 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
22450 cat >> confdefs.h <<EOF
22451 #define SIZEOF_INT $ac_cv_sizeof_int
22452 EOF
22453  
22454  
22455 echo $ac_n "checking size of long""... $ac_c" 1>&6
22456 echo "configure:22457: checking size of long" >&5 
22457 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
22458   echo $ac_n "(cached) $ac_c" 1>&6
22459 else
22460   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
22461   cat > conftest.$ac_ext <<EOF
22462 #line 22463 "configure"
22463 #include "confdefs.h"
22464 #include "confdefs.h" 
22465 #include <sys/types.h> 
22466  
22467
22468 int main() {
22469 switch (0) case 0: case (sizeof (long) == $ac_size):;
22470 ; return 0; }
22471 EOF
22472 if { (eval echo configure:22473: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22473   rm -rf conftest*
22474   ac_cv_sizeof_long=$ac_size
22475 else
22476   echo "configure: failed program was:" >&5
22477   cat conftest.$ac_ext >&5
22478 fi
22479 rm -f conftest* 
22480   if test x$ac_cv_sizeof_long != x ; then break; fi 
22481 done 
22482
22483 fi
22484  
22485 if test x$ac_cv_sizeof_long = x ; then 
22486   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
22487 fi 
22488 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
22489 cat >> confdefs.h <<EOF
22490 #define SIZEOF_LONG $ac_cv_sizeof_long
22491 EOF
22492  
22493
22494
22495 if test "$ac_cv_sizeof_int" -lt 4 ; then
22496         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
22497
22498         cat >> confdefs.h <<\EOF
22499 #define LBER_INT_T long
22500 EOF
22501
22502 else
22503         cat >> confdefs.h <<\EOF
22504 #define LBER_INT_T int
22505 EOF
22506
22507 fi
22508
22509 cat >> confdefs.h <<\EOF
22510 #define LBER_LEN_T long
22511 EOF
22512
22513 cat >> confdefs.h <<\EOF
22514 #define LBER_SOCKET_T int
22515 EOF
22516
22517 cat >> confdefs.h <<\EOF
22518 #define LBER_TAG_T long
22519 EOF
22520
22521
22522 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
22523 echo "configure:22524: checking for 8-bit clean memcmp" >&5
22524 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
22525   echo $ac_n "(cached) $ac_c" 1>&6
22526 else
22527   if test "$cross_compiling" = yes; then
22528   ac_cv_func_memcmp_clean=no
22529 else
22530   cat > conftest.$ac_ext <<EOF
22531 #line 22532 "configure"
22532 #include "confdefs.h"
22533
22534 main()
22535 {
22536   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
22537   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
22538 }
22539
22540 EOF
22541 if { (eval echo configure:22542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
22542 then
22543   ac_cv_func_memcmp_clean=yes
22544 else
22545   echo "configure: failed program was:" >&5
22546   cat conftest.$ac_ext >&5
22547   rm -fr conftest*
22548   ac_cv_func_memcmp_clean=no
22549 fi
22550 rm -fr conftest*
22551 fi
22552
22553 fi
22554
22555 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
22556 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
22557
22558 echo $ac_n "checking for strftime""... $ac_c" 1>&6
22559 echo "configure:22560: checking for strftime" >&5
22560 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
22561   echo $ac_n "(cached) $ac_c" 1>&6
22562 else
22563   cat > conftest.$ac_ext <<EOF
22564 #line 22565 "configure"
22565 #include "confdefs.h"
22566 /* System header to define __stub macros and hopefully few prototypes,
22567     which can conflict with char strftime(); below.  */
22568 #include <assert.h>
22569 /* Override any gcc2 internal prototype to avoid an error.  */
22570 /* We use char because int might match the return type of a gcc2
22571     builtin and then its argument prototype would still apply.  */
22572 char strftime();
22573 char (*f)();
22574
22575 int main() {
22576
22577 /* The GNU C library defines this for functions which it implements
22578     to always fail with ENOSYS.  Some functions are actually named
22579     something starting with __ and the normal name is an alias.  */
22580 #if defined (__stub_strftime) || defined (__stub___strftime)
22581 choke me
22582 #else
22583 f = strftime;
22584 #endif
22585
22586 ; return 0; }
22587 EOF
22588 if { (eval echo configure:22589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22589   rm -rf conftest*
22590   eval "ac_cv_func_strftime=yes"
22591 else
22592   echo "configure: failed program was:" >&5
22593   cat conftest.$ac_ext >&5
22594   rm -rf conftest*
22595   eval "ac_cv_func_strftime=no"
22596 fi
22597 rm -f conftest*
22598 fi
22599
22600 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
22601   echo "$ac_t""yes" 1>&6
22602   cat >> confdefs.h <<\EOF
22603 #define HAVE_STRFTIME 1
22604 EOF
22605
22606 else
22607   echo "$ac_t""no" 1>&6
22608 # strftime is in -lintl on SCO UNIX.
22609 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
22610 echo "configure:22611: checking for strftime in -lintl" >&5
22611 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
22612 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
22613   echo $ac_n "(cached) $ac_c" 1>&6
22614 else
22615   ac_save_LIBS="$LIBS"
22616 LIBS="-lintl  $LIBS"
22617 cat > conftest.$ac_ext <<EOF
22618 #line 22619 "configure"
22619 #include "confdefs.h"
22620 /* Override any gcc2 internal prototype to avoid an error.  */
22621 /* We use char because int might match the return type of a gcc2
22622     builtin and then its argument prototype would still apply.  */
22623 char strftime();
22624
22625 int main() {
22626 strftime()
22627 ; return 0; }
22628 EOF
22629 if { (eval echo configure:22630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22630   rm -rf conftest*
22631   eval "ac_cv_lib_$ac_lib_var=yes"
22632 else
22633   echo "configure: failed program was:" >&5
22634   cat conftest.$ac_ext >&5
22635   rm -rf conftest*
22636   eval "ac_cv_lib_$ac_lib_var=no"
22637 fi
22638 rm -f conftest*
22639 LIBS="$ac_save_LIBS"
22640
22641 fi
22642 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
22643   echo "$ac_t""yes" 1>&6
22644   cat >> confdefs.h <<\EOF
22645 #define HAVE_STRFTIME 1
22646 EOF
22647
22648 LIBS="-lintl $LIBS"
22649 else
22650   echo "$ac_t""no" 1>&6
22651 fi
22652
22653 fi
22654
22655
22656 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
22657 echo "configure:22658: checking for inet_aton()" >&5
22658 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
22659   echo $ac_n "(cached) $ac_c" 1>&6
22660 else
22661   cat > conftest.$ac_ext <<EOF
22662 #line 22663 "configure"
22663 #include "confdefs.h"
22664
22665 #ifdef HAVE_SYS_TYPES_H
22666 #       include <sys/types.h>
22667 #endif
22668 #ifdef HAVE_SYS_SOCKET_H
22669 #       include <sys/socket.h>
22670 #       ifdef HAVE_SYS_SELECT_H
22671 #               include <sys/select.h>
22672 #       endif
22673 #       include <netinet/in.h>
22674 #       ifdef HAVE_ARPA_INET_H
22675 #               include <arpa/inet.h>
22676 #       endif
22677 #endif
22678
22679 int main() {
22680 struct in_addr in;
22681 int rc = inet_aton( "255.255.255.255", &in );
22682 ; return 0; }
22683 EOF
22684 if { (eval echo configure:22685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22685   rm -rf conftest*
22686   ol_cv_func_inet_aton=yes
22687 else
22688   echo "configure: failed program was:" >&5
22689   cat conftest.$ac_ext >&5
22690   rm -rf conftest*
22691   ol_cv_func_inet_aton=no
22692 fi
22693 rm -f conftest*
22694 fi
22695
22696 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
22697   if test $ol_cv_func_inet_aton != no; then
22698     cat >> confdefs.h <<\EOF
22699 #define HAVE_INET_ATON 1
22700 EOF
22701
22702   fi
22703  
22704
22705 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
22706 echo "configure:22707: checking for _spawnlp" >&5
22707 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
22708   echo $ac_n "(cached) $ac_c" 1>&6
22709 else
22710   cat > conftest.$ac_ext <<EOF
22711 #line 22712 "configure"
22712 #include "confdefs.h"
22713 /* System header to define __stub macros and hopefully few prototypes,
22714     which can conflict with char _spawnlp(); below.  */
22715 #include <assert.h>
22716 /* Override any gcc2 internal prototype to avoid an error.  */
22717 /* We use char because int might match the return type of a gcc2
22718     builtin and then its argument prototype would still apply.  */
22719 char _spawnlp();
22720 char (*f)();
22721
22722 int main() {
22723
22724 /* The GNU C library defines this for functions which it implements
22725     to always fail with ENOSYS.  Some functions are actually named
22726     something starting with __ and the normal name is an alias.  */
22727 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
22728 choke me
22729 #else
22730 f = _spawnlp;
22731 #endif
22732
22733 ; return 0; }
22734 EOF
22735 if { (eval echo configure:22736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22736   rm -rf conftest*
22737   eval "ac_cv_func__spawnlp=yes"
22738 else
22739   echo "configure: failed program was:" >&5
22740   cat conftest.$ac_ext >&5
22741   rm -rf conftest*
22742   eval "ac_cv_func__spawnlp=no"
22743 fi
22744 rm -f conftest*
22745 fi
22746
22747 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
22748   echo "$ac_t""yes" 1>&6
22749   cat >> confdefs.h <<\EOF
22750 #define HAVE_SPAWNLP 1
22751 EOF
22752
22753 else
22754   echo "$ac_t""no" 1>&6
22755 fi
22756
22757
22758 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
22759 echo "configure:22760: checking for _snprintf" >&5
22760 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
22761   echo $ac_n "(cached) $ac_c" 1>&6
22762 else
22763   cat > conftest.$ac_ext <<EOF
22764 #line 22765 "configure"
22765 #include "confdefs.h"
22766 /* System header to define __stub macros and hopefully few prototypes,
22767     which can conflict with char _snprintf(); below.  */
22768 #include <assert.h>
22769 /* Override any gcc2 internal prototype to avoid an error.  */
22770 /* We use char because int might match the return type of a gcc2
22771     builtin and then its argument prototype would still apply.  */
22772 char _snprintf();
22773 char (*f)();
22774
22775 int main() {
22776
22777 /* The GNU C library defines this for functions which it implements
22778     to always fail with ENOSYS.  Some functions are actually named
22779     something starting with __ and the normal name is an alias.  */
22780 #if defined (__stub__snprintf) || defined (__stub____snprintf)
22781 choke me
22782 #else
22783 f = _snprintf;
22784 #endif
22785
22786 ; return 0; }
22787 EOF
22788 if { (eval echo configure:22789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22789   rm -rf conftest*
22790   eval "ac_cv_func__snprintf=yes"
22791 else
22792   echo "configure: failed program was:" >&5
22793   cat conftest.$ac_ext >&5
22794   rm -rf conftest*
22795   eval "ac_cv_func__snprintf=no"
22796 fi
22797 rm -f conftest*
22798 fi
22799
22800 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
22801   echo "$ac_t""yes" 1>&6
22802   ac_cv_func_snprintf=yes
22803         cat >> confdefs.h <<\EOF
22804 #define snprintf _snprintf
22805 EOF
22806
22807
22808 else
22809   echo "$ac_t""no" 1>&6
22810 fi
22811
22812
22813 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
22814 echo "configure:22815: checking for _vsnprintf" >&5
22815 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
22816   echo $ac_n "(cached) $ac_c" 1>&6
22817 else
22818   cat > conftest.$ac_ext <<EOF
22819 #line 22820 "configure"
22820 #include "confdefs.h"
22821 /* System header to define __stub macros and hopefully few prototypes,
22822     which can conflict with char _vsnprintf(); below.  */
22823 #include <assert.h>
22824 /* Override any gcc2 internal prototype to avoid an error.  */
22825 /* We use char because int might match the return type of a gcc2
22826     builtin and then its argument prototype would still apply.  */
22827 char _vsnprintf();
22828 char (*f)();
22829
22830 int main() {
22831
22832 /* The GNU C library defines this for functions which it implements
22833     to always fail with ENOSYS.  Some functions are actually named
22834     something starting with __ and the normal name is an alias.  */
22835 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
22836 choke me
22837 #else
22838 f = _vsnprintf;
22839 #endif
22840
22841 ; return 0; }
22842 EOF
22843 if { (eval echo configure:22844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22844   rm -rf conftest*
22845   eval "ac_cv_func__vsnprintf=yes"
22846 else
22847   echo "configure: failed program was:" >&5
22848   cat conftest.$ac_ext >&5
22849   rm -rf conftest*
22850   eval "ac_cv_func__vsnprintf=no"
22851 fi
22852 rm -f conftest*
22853 fi
22854
22855 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
22856   echo "$ac_t""yes" 1>&6
22857   ac_cv_func_vsnprintf=yes
22858         cat >> confdefs.h <<\EOF
22859 #define vsnprintf _vsnprintf
22860 EOF
22861
22862
22863 else
22864   echo "$ac_t""no" 1>&6
22865 fi
22866
22867
22868 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
22869 echo "configure:22870: checking for vprintf" >&5
22870 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
22871   echo $ac_n "(cached) $ac_c" 1>&6
22872 else
22873   cat > conftest.$ac_ext <<EOF
22874 #line 22875 "configure"
22875 #include "confdefs.h"
22876 /* System header to define __stub macros and hopefully few prototypes,
22877     which can conflict with char vprintf(); below.  */
22878 #include <assert.h>
22879 /* Override any gcc2 internal prototype to avoid an error.  */
22880 /* We use char because int might match the return type of a gcc2
22881     builtin and then its argument prototype would still apply.  */
22882 char vprintf();
22883 char (*f)();
22884
22885 int main() {
22886
22887 /* The GNU C library defines this for functions which it implements
22888     to always fail with ENOSYS.  Some functions are actually named
22889     something starting with __ and the normal name is an alias.  */
22890 #if defined (__stub_vprintf) || defined (__stub___vprintf)
22891 choke me
22892 #else
22893 f = vprintf;
22894 #endif
22895
22896 ; return 0; }
22897 EOF
22898 if { (eval echo configure:22899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22899   rm -rf conftest*
22900   eval "ac_cv_func_vprintf=yes"
22901 else
22902   echo "configure: failed program was:" >&5
22903   cat conftest.$ac_ext >&5
22904   rm -rf conftest*
22905   eval "ac_cv_func_vprintf=no"
22906 fi
22907 rm -f conftest*
22908 fi
22909
22910 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
22911   echo "$ac_t""yes" 1>&6
22912   cat >> confdefs.h <<\EOF
22913 #define HAVE_VPRINTF 1
22914 EOF
22915
22916 else
22917   echo "$ac_t""no" 1>&6
22918 fi
22919
22920 if test "$ac_cv_func_vprintf" != yes; then
22921 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
22922 echo "configure:22923: checking for _doprnt" >&5
22923 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
22924   echo $ac_n "(cached) $ac_c" 1>&6
22925 else
22926   cat > conftest.$ac_ext <<EOF
22927 #line 22928 "configure"
22928 #include "confdefs.h"
22929 /* System header to define __stub macros and hopefully few prototypes,
22930     which can conflict with char _doprnt(); below.  */
22931 #include <assert.h>
22932 /* Override any gcc2 internal prototype to avoid an error.  */
22933 /* We use char because int might match the return type of a gcc2
22934     builtin and then its argument prototype would still apply.  */
22935 char _doprnt();
22936 char (*f)();
22937
22938 int main() {
22939
22940 /* The GNU C library defines this for functions which it implements
22941     to always fail with ENOSYS.  Some functions are actually named
22942     something starting with __ and the normal name is an alias.  */
22943 #if defined (__stub__doprnt) || defined (__stub____doprnt)
22944 choke me
22945 #else
22946 f = _doprnt;
22947 #endif
22948
22949 ; return 0; }
22950 EOF
22951 if { (eval echo configure:22952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22952   rm -rf conftest*
22953   eval "ac_cv_func__doprnt=yes"
22954 else
22955   echo "configure: failed program was:" >&5
22956   cat conftest.$ac_ext >&5
22957   rm -rf conftest*
22958   eval "ac_cv_func__doprnt=no"
22959 fi
22960 rm -f conftest*
22961 fi
22962
22963 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
22964   echo "$ac_t""yes" 1>&6
22965   cat >> confdefs.h <<\EOF
22966 #define HAVE_DOPRNT 1
22967 EOF
22968
22969 else
22970   echo "$ac_t""no" 1>&6
22971 fi
22972
22973 fi
22974
22975
22976 if test $ac_cv_func_vprintf = yes ; then
22977                 for ac_func in snprintf vsnprintf
22978 do
22979 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
22980 echo "configure:22981: checking for $ac_func" >&5
22981 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
22982   echo $ac_n "(cached) $ac_c" 1>&6
22983 else
22984   cat > conftest.$ac_ext <<EOF
22985 #line 22986 "configure"
22986 #include "confdefs.h"
22987 /* System header to define __stub macros and hopefully few prototypes,
22988     which can conflict with char $ac_func(); below.  */
22989 #include <assert.h>
22990 /* Override any gcc2 internal prototype to avoid an error.  */
22991 /* We use char because int might match the return type of a gcc2
22992     builtin and then its argument prototype would still apply.  */
22993 char $ac_func();
22994 char (*f)();
22995
22996 int main() {
22997
22998 /* The GNU C library defines this for functions which it implements
22999     to always fail with ENOSYS.  Some functions are actually named
23000     something starting with __ and the normal name is an alias.  */
23001 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
23002 choke me
23003 #else
23004 f = $ac_func;
23005 #endif
23006
23007 ; return 0; }
23008 EOF
23009 if { (eval echo configure:23010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
23010   rm -rf conftest*
23011   eval "ac_cv_func_$ac_func=yes"
23012 else
23013   echo "configure: failed program was:" >&5
23014   cat conftest.$ac_ext >&5
23015   rm -rf conftest*
23016   eval "ac_cv_func_$ac_func=no"
23017 fi
23018 rm -f conftest*
23019 fi
23020
23021 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
23022   echo "$ac_t""yes" 1>&6
23023     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
23024   cat >> confdefs.h <<EOF
23025 #define $ac_tr_func 1
23026 EOF
23027  
23028 else
23029   echo "$ac_t""no" 1>&6
23030 fi
23031 done
23032
23033 fi
23034
23035 for ac_func in \
23036         bcopy                   \
23037         closesocket             \
23038         chroot                  \
23039         endgrent                \
23040         endpwent                \
23041         fcntl                   \
23042         flock                   \
23043         fstat                   \
23044         getdtablesize   \
23045         getgrgid                \
23046         gethostname             \
23047         getpass                 \
23048         getpassphrase   \
23049         getpwuid                \
23050         getpwnam                \
23051         getspnam                \
23052         gettimeofday    \
23053         initgroups              \
23054         lockf                   \
23055         memcpy                  \
23056         memmove                 \
23057         mkstemp                 \
23058         mktemp                  \
23059         pipe                    \
23060         read                    \
23061         recv                    \
23062         recvfrom                \
23063         setpwfile               \
23064         setgid                  \
23065         setegid                 \
23066         setsid                  \
23067         setuid                  \
23068         seteuid                 \
23069         sigaction               \
23070         signal                  \
23071         sigset                  \
23072         strdup                  \
23073         strerror                \
23074         strpbrk                 \
23075         strrchr                 \
23076         strsep                  \
23077         strstr                  \
23078         strtol                  \
23079         strtoul                 \
23080         strtoq                  \
23081         strtouq                 \
23082         strtoll                 \
23083         strspn                  \
23084         sysconf                 \
23085         usleep                  \
23086         waitpid                 \
23087         wait4                   \
23088         write                   \
23089         send                    \
23090         sendmsg                 \
23091         sendto                  \
23092
23093 do
23094 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
23095 echo "configure:23096: checking for $ac_func" >&5
23096 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
23097   echo $ac_n "(cached) $ac_c" 1>&6
23098 else
23099   cat > conftest.$ac_ext <<EOF
23100 #line 23101 "configure"
23101 #include "confdefs.h"
23102 /* System header to define __stub macros and hopefully few prototypes,
23103     which can conflict with char $ac_func(); below.  */
23104 #include <assert.h>
23105 /* Override any gcc2 internal prototype to avoid an error.  */
23106 /* We use char because int might match the return type of a gcc2
23107     builtin and then its argument prototype would still apply.  */
23108 char $ac_func();
23109 char (*f)();
23110
23111 int main() {
23112
23113 /* The GNU C library defines this for functions which it implements
23114     to always fail with ENOSYS.  Some functions are actually named
23115     something starting with __ and the normal name is an alias.  */
23116 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
23117 choke me
23118 #else
23119 f = $ac_func;
23120 #endif
23121
23122 ; return 0; }
23123 EOF
23124 if { (eval echo configure:23125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
23125   rm -rf conftest*
23126   eval "ac_cv_func_$ac_func=yes"
23127 else
23128   echo "configure: failed program was:" >&5
23129   cat conftest.$ac_ext >&5
23130   rm -rf conftest*
23131   eval "ac_cv_func_$ac_func=no"
23132 fi
23133 rm -f conftest*
23134 fi
23135
23136 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
23137   echo "$ac_t""yes" 1>&6
23138     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
23139   cat >> confdefs.h <<EOF
23140 #define $ac_tr_func 1
23141 EOF
23142  
23143 else
23144   echo "$ac_t""no" 1>&6
23145 fi
23146 done
23147
23148
23149 for ac_func in getopt getpeereid
23150 do
23151 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
23152 echo "configure:23153: checking for $ac_func" >&5
23153 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
23154   echo $ac_n "(cached) $ac_c" 1>&6
23155 else
23156   cat > conftest.$ac_ext <<EOF
23157 #line 23158 "configure"
23158 #include "confdefs.h"
23159 /* System header to define __stub macros and hopefully few prototypes,
23160     which can conflict with char $ac_func(); below.  */
23161 #include <assert.h>
23162 /* Override any gcc2 internal prototype to avoid an error.  */
23163 /* We use char because int might match the return type of a gcc2
23164     builtin and then its argument prototype would still apply.  */
23165 char $ac_func();
23166 char (*f)();
23167
23168 int main() {
23169
23170 /* The GNU C library defines this for functions which it implements
23171     to always fail with ENOSYS.  Some functions are actually named
23172     something starting with __ and the normal name is an alias.  */
23173 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
23174 choke me
23175 #else
23176 f = $ac_func;
23177 #endif
23178
23179 ; return 0; }
23180 EOF
23181 if { (eval echo configure:23182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
23182   rm -rf conftest*
23183   eval "ac_cv_func_$ac_func=yes"
23184 else
23185   echo "configure: failed program was:" >&5
23186   cat conftest.$ac_ext >&5
23187   rm -rf conftest*
23188   eval "ac_cv_func_$ac_func=no"
23189 fi
23190 rm -f conftest*
23191 fi
23192
23193 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
23194   echo "$ac_t""yes" 1>&6
23195     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
23196   cat >> confdefs.h <<EOF
23197 #define $ac_tr_func 1
23198 EOF
23199  
23200 else
23201   echo "$ac_t""no" 1>&6
23202 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
23203 fi
23204 done
23205
23206
23207
23208 if test "$ac_cv_func_getopt" != yes; then
23209         LIBSRCS="$LIBSRCS getopt.c"
23210 fi
23211 if test "$ac_cv_func_getpeereid" != yes; then
23212         echo $ac_n "checking for msg_accrights in msghdr""... $ac_c" 1>&6
23213 echo "configure:23214: checking for msg_accrights in msghdr" >&5
23214 if eval "test \"\${ol_cv_msghdr_msg_accrights+set}\" = set"; then
23215   echo $ac_n "(cached) $ac_c" 1>&6
23216 else
23217   cat > conftest.$ac_ext <<EOF
23218 #line 23219 "configure"
23219 #include "confdefs.h"
23220 #include <sys/socket.h>
23221 int main() {
23222 struct msghdr m; m.msg_accrightslen=0
23223 ; return 0; }
23224 EOF
23225 if { (eval echo configure:23226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
23226   rm -rf conftest*
23227   ol_cv_msghdr_msg_accrights=yes
23228 else
23229   echo "configure: failed program was:" >&5
23230   cat conftest.$ac_ext >&5
23231   rm -rf conftest*
23232   ol_cv_msghdr_msg_accrights=no
23233 fi
23234 rm -f conftest*
23235         
23236 fi
23237
23238 echo "$ac_t""$ol_cv_msghdr_msg_accrights" 1>&6
23239   if test $ol_cv_msghdr_msg_accrights = "yes" ; then
23240         cat >> confdefs.h <<\EOF
23241 #define HAVE_MSGHDR_MSG_ACCRIGHTS 1
23242 EOF
23243
23244   fi
23245
23246         LIBSRCS="$LIBSRCS getpeereid.c"
23247 fi
23248 if test "$ac_cv_func_snprintf" != yes -o "$ac_cv_func_vsnprintf" != yes; then
23249         if test "$ac_cv_func_snprintf" != yes; then
23250                 cat >> confdefs.h <<\EOF
23251 #define snprintf ber_pvt_snprintf
23252 EOF
23253
23254         fi
23255         if test "$ac_cv_func_vsnprintf" != yes; then
23256                 cat >> confdefs.h <<\EOF
23257 #define vsnprintf ber_pvt_vsnprintf
23258 EOF
23259
23260         fi
23261 fi
23262
23263 # Check Configuration
23264 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
23265 echo "configure:23266: checking declaration of sys_errlist" >&5
23266 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
23267   echo $ac_n "(cached) $ac_c" 1>&6
23268 else
23269   
23270         cat > conftest.$ac_ext <<EOF
23271 #line 23272 "configure"
23272 #include "confdefs.h"
23273
23274 #include <stdio.h>
23275 #include <sys/types.h>
23276 #include <errno.h>
23277 #ifdef WINNT
23278 #include <stdlib.h>
23279 #endif 
23280 int main() {
23281 char *c = (char *) *sys_errlist
23282 ; return 0; }
23283 EOF
23284 if { (eval echo configure:23285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
23285   rm -rf conftest*
23286   ol_cv_dcl_sys_errlist=yes
23287         ol_cv_have_sys_errlist=yes
23288 else
23289   echo "configure: failed program was:" >&5
23290   cat conftest.$ac_ext >&5
23291   rm -rf conftest*
23292   ol_cv_dcl_sys_errlist=no
23293 fi
23294 rm -f conftest*
23295 fi
23296
23297 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
23298 #
23299 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
23300 if test $ol_cv_dcl_sys_errlist = no ; then
23301         cat >> confdefs.h <<\EOF
23302 #define DECL_SYS_ERRLIST 1
23303 EOF
23304
23305
23306         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
23307 echo "configure:23308: checking existence of sys_errlist" >&5
23308 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
23309   echo $ac_n "(cached) $ac_c" 1>&6
23310 else
23311   
23312                 cat > conftest.$ac_ext <<EOF
23313 #line 23314 "configure"
23314 #include "confdefs.h"
23315 #include <errno.h>
23316 int main() {
23317 char *c = (char *) *sys_errlist
23318 ; return 0; }
23319 EOF
23320 if { (eval echo configure:23321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
23321   rm -rf conftest*
23322   ol_cv_have_sys_errlist=yes
23323 else
23324   echo "configure: failed program was:" >&5
23325   cat conftest.$ac_ext >&5
23326   rm -rf conftest*
23327   ol_cv_have_sys_errlist=no
23328 fi
23329 rm -f conftest*
23330 fi
23331
23332 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
23333 fi
23334 if test $ol_cv_have_sys_errlist = yes ; then
23335         cat >> confdefs.h <<\EOF
23336 #define HAVE_SYS_ERRLIST 1
23337 EOF
23338
23339 fi
23340
23341
23342
23343 if test "$ol_enable_slapi" != no ; then
23344                         for ac_hdr in ltdl.h
23345 do
23346 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
23347 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
23348 echo "configure:23349: checking for $ac_hdr" >&5
23349 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
23350   echo $ac_n "(cached) $ac_c" 1>&6
23351 else
23352   cat > conftest.$ac_ext <<EOF
23353 #line 23354 "configure"
23354 #include "confdefs.h"
23355 #include <$ac_hdr>
23356 EOF
23357 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
23358 { (eval echo configure:23359: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
23359 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
23360 if test -z "$ac_err"; then
23361   rm -rf conftest*
23362   eval "ac_cv_header_$ac_safe=yes"
23363 else
23364   echo "$ac_err" >&5
23365   echo "configure: failed program was:" >&5
23366   cat conftest.$ac_ext >&5
23367   rm -rf conftest*
23368   eval "ac_cv_header_$ac_safe=no"
23369 fi
23370 rm -f conftest*
23371 fi
23372 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
23373   echo "$ac_t""yes" 1>&6
23374     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
23375   cat >> confdefs.h <<EOF
23376 #define $ac_tr_hdr 1
23377 EOF
23378  
23379 else
23380   echo "$ac_t""no" 1>&6
23381 fi
23382 done
23383
23384
23385         if test $ac_cv_header_ltdl_h != yes ; then
23386                 { echo "configure: error: could not locate <ltdl.h>" 1>&2; exit 1; }
23387         fi
23388         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
23389 echo "configure:23390: checking for lt_dlinit in -lltdl" >&5
23390 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
23391 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
23392   echo $ac_n "(cached) $ac_c" 1>&6
23393 else
23394   ac_save_LIBS="$LIBS"
23395 LIBS="-lltdl  $LIBS"
23396 cat > conftest.$ac_ext <<EOF
23397 #line 23398 "configure"
23398 #include "confdefs.h"
23399 /* Override any gcc2 internal prototype to avoid an error.  */
23400 /* We use char because int might match the return type of a gcc2
23401     builtin and then its argument prototype would still apply.  */
23402 char lt_dlinit();
23403
23404 int main() {
23405 lt_dlinit()
23406 ; return 0; }
23407 EOF
23408 if { (eval echo configure:23409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
23409   rm -rf conftest*
23410   eval "ac_cv_lib_$ac_lib_var=yes"
23411 else
23412   echo "configure: failed program was:" >&5
23413   cat conftest.$ac_ext >&5
23414   rm -rf conftest*
23415   eval "ac_cv_lib_$ac_lib_var=no"
23416 fi
23417 rm -f conftest*
23418 LIBS="$ac_save_LIBS"
23419
23420 fi
23421 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
23422   echo "$ac_t""yes" 1>&6
23423   
23424                 SLAPI_LIBS=-lltdl
23425                 LIBSLAPI=libslapi.a
23426                 LIBSLAPITOOLS=../libslapi.a
23427                 cat >> confdefs.h <<\EOF
23428 #define HAVE_LIBLTDL 1
23429 EOF
23430
23431         
23432 else
23433   echo "$ac_t""no" 1>&6
23434 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
23435 fi
23436
23437
23438         cat >> confdefs.h <<\EOF
23439 #define LDAP_SLAPI 1
23440 EOF
23441
23442 fi
23443
23444 if test "$ol_enable_debug" != no ; then
23445         cat >> confdefs.h <<\EOF
23446 #define LDAP_DEBUG 1
23447 EOF
23448
23449 fi
23450 if test "$ol_enable_syslog" = yes ; then
23451         cat >> confdefs.h <<\EOF
23452 #define LDAP_SYSLOG 1
23453 EOF
23454
23455 fi
23456 if test "$ol_link_kbind" != no ; then
23457         cat >> confdefs.h <<\EOF
23458 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
23459 EOF
23460
23461 fi
23462 if test "$ol_enable_proctitle" != no ; then
23463         cat >> confdefs.h <<\EOF
23464 #define LDAP_PROCTITLE 1
23465 EOF
23466
23467 fi
23468 if test "$ol_enable_referrals" != no ; then
23469         cat >> confdefs.h <<\EOF
23470 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
23471 EOF
23472
23473 fi
23474 if test "$ol_enable_local" != no; then
23475         cat >> confdefs.h <<\EOF
23476 #define LDAP_PF_LOCAL 1
23477 EOF
23478
23479 fi
23480 if test "$ol_link_ipv6" != no; then
23481         cat >> confdefs.h <<\EOF
23482 #define LDAP_PF_INET6 1
23483 EOF
23484
23485 fi
23486 if test "$ol_enable_cleartext" != no ; then
23487         cat >> confdefs.h <<\EOF
23488 #define SLAPD_CLEARTEXT 1
23489 EOF
23490
23491 fi
23492 if test "$ol_enable_crypt" != no ; then
23493         cat >> confdefs.h <<\EOF
23494 #define SLAPD_CRYPT 1
23495 EOF
23496
23497 fi
23498 if test "$ol_link_kpasswd" != no ; then
23499         cat >> confdefs.h <<\EOF
23500 #define SLAPD_KPASSWD 1
23501 EOF
23502
23503 fi
23504 if test "$ol_link_spasswd" != no ; then
23505         cat >> confdefs.h <<\EOF
23506 #define SLAPD_SPASSWD 1
23507 EOF
23508
23509 fi
23510 if test "$ol_enable_multimaster" != no ; then
23511         cat >> confdefs.h <<\EOF
23512 #define SLAPD_MULTIMASTER 1
23513 EOF
23514
23515 fi
23516 if test "$ol_enable_rlookups" != no ; then
23517         cat >> confdefs.h <<\EOF
23518 #define SLAPD_RLOOKUPS 1
23519 EOF
23520
23521 fi
23522 if test "$ol_enable_aci" != no ; then
23523         cat >> confdefs.h <<\EOF
23524 #define SLAPD_ACI_ENABLED 1
23525 EOF
23526
23527 fi
23528
23529 if test "$ol_link_modules" != no ; then
23530         cat >> confdefs.h <<\EOF
23531 #define SLAPD_MODULES 1
23532 EOF
23533
23534         BUILD_SLAPD=yes
23535         SLAPD_MODULES_LDFLAGS="-dlopen self"
23536 fi
23537
23538 cat >> confdefs.h <<\EOF
23539 #define SLAPD_MOD_STATIC 1
23540 EOF
23541
23542 cat >> confdefs.h <<\EOF
23543 #define SLAPD_MOD_DYNAMIC 2
23544 EOF
23545
23546
23547 if test "$ol_enable_bdb" != no ; then
23548         cat >> confdefs.h <<\EOF
23549 #define SLAPD_BDB 1
23550 EOF
23551
23552         BUILD_SLAPD=yes
23553         BUILD_BDB=yes
23554         if test "$ol_with_bdb_module" != static ; then
23555                 cat >> confdefs.h <<\EOF
23556 #define SLAPD_BDB_DYNAMIC 1
23557 EOF
23558
23559                 BUILD_BDB=mod
23560                 BUILD_BDB_DYNAMIC=shared
23561                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-bdb"
23562         else
23563                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-bdb"
23564         fi
23565 fi
23566
23567 if test "$ol_link_dnssrv" != no ; then
23568         cat >> confdefs.h <<\EOF
23569 #define SLAPD_DNSSRV 1
23570 EOF
23571
23572         BUILD_SLAPD=yes
23573         BUILD_DNSSRV=yes
23574         if test "$ol_with_dnssrv_module" != static ; then
23575                 cat >> confdefs.h <<\EOF
23576 #define SLAPD_DNSSRV_DYNAMIC 1
23577 EOF
23578
23579                 BUILD_DNSSRV=mod
23580                 BUILD_DNSSRV_DYNAMIC=shared
23581                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-dnssrv"
23582         else
23583                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-dnssrv"
23584         fi
23585 fi
23586
23587 if test "$ol_enable_hdb" != no ; then
23588         cat >> confdefs.h <<\EOF
23589 #define SLAPD_HDB 1
23590 EOF
23591
23592         BUILD_SLAPD=yes
23593         BUILD_HDB=yes
23594         if test "$ol_with_hdb_module" != static ; then
23595                 cat >> confdefs.h <<\EOF
23596 #define SLAPD_HDB_DYNAMIC 1
23597 EOF
23598
23599                 BUILD_HDB=mod
23600                 BUILD_HDB_DYNAMIC=shared
23601                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-hdb"
23602         else
23603                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-hdb"
23604         fi
23605 fi
23606
23607 if test "$ol_enable_ldap" != no ; then
23608         cat >> confdefs.h <<\EOF
23609 #define SLAPD_LDAP 1
23610 EOF
23611
23612         BUILD_SLAPD=yes
23613         BUILD_LDAP=yes
23614         if test "$ol_with_ldap_module" != static ; then
23615                 cat >> confdefs.h <<\EOF
23616 #define SLAPD_LDAP_DYNAMIC 1
23617 EOF
23618
23619                 BUILD_LDAP=mod
23620                 BUILD_LDAP_DYNAMIC=shared
23621                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldap"
23622         else
23623                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldap"
23624         fi
23625 fi
23626
23627 if test "$ol_link_ldbm" != no -a $ol_enable_ldbm != no; then
23628         cat >> confdefs.h <<\EOF
23629 #define SLAPD_LDBM 1
23630 EOF
23631
23632         BUILD_SLAPD=yes
23633         BUILD_LDBM=yes
23634         if test "$ol_with_ldbm_module" != static ; then
23635                 cat >> confdefs.h <<\EOF
23636 #define SLAPD_LDBM_DYNAMIC 1
23637 EOF
23638
23639                 BUILD_LDBM=mod
23640                 BUILD_LDBM_DYNAMIC=shared
23641                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldbm"
23642         else
23643                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldbm"
23644         fi
23645 fi
23646
23647 if test "$ol_enable_meta" != no ; then
23648         if test "$ol_enable_ldap" = no ; then
23649                 { echo "configure: error: need --enable-ldap to use --enable-meta" 1>&2; exit 1; }
23650         fi
23651         if test "$ol_enable_rewrite" = no ; then
23652                 { echo "configure: error: need --enable-rewrite to use --enable-meta" 1>&2; exit 1; }
23653         fi
23654         cat >> confdefs.h <<\EOF
23655 #define SLAPD_META 1
23656 EOF
23657
23658         BUILD_SLAPD=yes
23659         BUILD_META=yes
23660         BUILD_REWRITE=yes
23661         if test "$ol_with_meta_module" != static ; then
23662                 cat >> confdefs.h <<\EOF
23663 #define SLAPD_META_DYNAMIC 1
23664 EOF
23665
23666                 BUILD_META=mod
23667                 BUILD_META_DYNAMIC=shared
23668                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-meta"
23669         else
23670                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-meta"
23671         fi
23672 fi
23673
23674 if test "$ol_enable_monitor" != no ; then
23675         cat >> confdefs.h <<\EOF
23676 #define SLAPD_MONITOR 1
23677 EOF
23678
23679         BUILD_SLAPD=yes
23680         BUILD_MONITOR=yes
23681         if test "$ol_with_monitor_module" != static ; then
23682                 cat >> confdefs.h <<\EOF
23683 #define SLAPD_MONITOR_DYNAMIC 1
23684 EOF
23685
23686                 BUILD_MONITOR=mod
23687                 BUILD_MONITOR_DYNAMIC=shared
23688                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-monitor"
23689         else
23690                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-monitor"
23691         fi
23692 fi
23693
23694 if test "$ol_enable_null" != no ; then
23695         cat >> confdefs.h <<\EOF
23696 #define SLAPD_NULL 1
23697 EOF
23698
23699         BUILD_SLAPD=yes
23700         BUILD_NULL=yes
23701         if test "$ol_with_null_module" != static ; then
23702                 cat >> confdefs.h <<\EOF
23703 #define SLAPD_NULL_DYNAMIC 1
23704 EOF
23705
23706                 BUILD_NULL=mod
23707                 BUILD_NULL_DYNAMIC=shared
23708                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-null"
23709         else
23710                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-null"
23711         fi
23712 fi
23713
23714 if test "$ol_enable_passwd" != no ; then
23715         cat >> confdefs.h <<\EOF
23716 #define SLAPD_PASSWD 1
23717 EOF
23718
23719         BUILD_SLAPD=yes
23720         BUILD_PASSWD=yes
23721         if test "$ol_with_passwd_module" != static ; then
23722                 cat >> confdefs.h <<\EOF
23723 #define SLAPD_PASSWD_DYNAMIC 1
23724 EOF
23725
23726                 BUILD_PASSWD=mod
23727                 BUILD_PASSWD_DYNAMIC=shared
23728                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-passwd"
23729         else
23730                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-passwd"
23731         fi
23732 fi
23733
23734 if test "$ol_link_perl" != no ; then
23735         cat >> confdefs.h <<\EOF
23736 #define SLAPD_PERL 1
23737 EOF
23738
23739         BUILD_SLAPD=yes
23740         BUILD_PERL=yes
23741         if test "$ol_with_perl_module" != static ; then
23742                 cat >> confdefs.h <<\EOF
23743 #define SLAPD_PERL_DYNAMIC 1
23744 EOF
23745
23746                 BUILD_PERL=mod
23747                 BUILD_PERL_DYNAMIC=shared
23748                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-perl"
23749         else
23750                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-perl"
23751         fi
23752 fi
23753
23754 if test "$ol_enable_shell" != no ; then
23755         if test "$ol_link_thread" != no ; then
23756                 echo "configure: warning: Use of --without-threads is recommended with back-shell" 1>&2
23757         fi
23758         cat >> confdefs.h <<\EOF
23759 #define SLAPD_SHELL 1
23760 EOF
23761
23762         BUILD_SLAPD=yes
23763         BUILD_SHELL=yes
23764         if test "$ol_with_shell_module" != static ; then
23765                 cat >> confdefs.h <<\EOF
23766 #define SLAPD_SHELL_DYNAMIC 1
23767 EOF
23768
23769                 BUILD_SHELL=mod
23770                 BUILD_SHELL_DYNAMIC=shared
23771                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-shell"
23772         else
23773                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-shell"
23774         fi
23775 fi
23776
23777 if test "$ol_link_sql" != no ; then
23778         cat >> confdefs.h <<\EOF
23779 #define SLAPD_SQL 1
23780 EOF
23781
23782         BUILD_SLAPD=yes
23783         BUILD_SQL=yes
23784         if test "$ol_with_sql_module" != static; then
23785                 cat >> confdefs.h <<\EOF
23786 #define SLAPD_SQL_DYNAMIC 1
23787 EOF
23788
23789                 BUILD_SQL=mod
23790                 BUILD_SQL_DYNAMIC=shared
23791                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-sql"
23792         else
23793                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-sql"
23794         fi
23795 fi
23796
23797 if test "$ol_with_dyngroup" != no ; then
23798         BUILD_DYNGROUP=$ol_with_dyngroup
23799         if test "$ol_with_dyngroup" = mod ; then
23800                 MFLAG=SLAPD_MOD_DYNAMIC
23801                 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS dyngroup.la"
23802         else
23803                 MFLAG=SLAPD_MOD_STATIC
23804         fi
23805         cat >> confdefs.h <<EOF
23806 #define SLAPD_OVER_DYNGROUP $MFLAG
23807 EOF
23808
23809 fi
23810
23811 if test "$ol_with_proxycache" != no ; then
23812         BUILD_PROXYCACHE=$ol_with_proxycache
23813         if test "$ol_with_proxycache" = mod ; then
23814                 MFLAG=SLAPD_MOD_DYNAMIC
23815                 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS pcache.la"
23816         else
23817                 MFLAG=SLAPD_MOD_STATIC
23818         fi
23819         cat >> confdefs.h <<EOF
23820 #define SLAPD_OVER_PROXYCACHE $MFLAG
23821 EOF
23822
23823 fi
23824
23825 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
23826         $BUILD_SLAPD = yes ; then
23827         BUILD_SLURPD=yes
23828 fi
23829
23830 if test "$ol_enable_rewrite" != no ; then
23831         cat >> confdefs.h <<\EOF
23832 #define ENABLE_REWRITE 1
23833 EOF
23834
23835         BUILD_REWRITE=yes
23836 fi
23837
23838 if test "$ol_enable_slapi" != no ; then
23839         cat >> confdefs.h <<\EOF
23840 #define ENABLE_SLAPI 1
23841 EOF
23842
23843         BUILD_SLAPI=yes
23844         SLAPD_SLAPI_DEPEND=libslapi.a
23845 fi
23846
23847
23848
23849 if test "$ac_cv_mingw32" = yes ; then
23850         PLAT=NT
23851         SLAPD_MODULES_LDFLAGS=
23852 else
23853         PLAT=UNIX
23854 fi
23855
23856 if test -z "$SLAPD_STATIC_BACKENDS"; then
23857         SLAPD_NO_STATIC='#'
23858 else
23859         SLAPD_NO_STATIC=
23860 fi
23861
23862
23863
23864
23865
23866
23867
23868   
23869   
23870   
23871   
23872   
23873   
23874   
23875   
23876   
23877   
23878   
23879   
23880   
23881   
23882   
23883   
23884   
23885   
23886   
23887   
23888   
23889   
23890   
23891   
23892   
23893   
23894   
23895   
23896
23897
23898
23899
23900
23901
23902
23903
23904
23905
23906
23907
23908
23909
23910
23911
23912
23913
23914
23915
23916
23917
23918
23919
23920
23921
23922
23923
23924
23925
23926
23927
23928
23929
23930
23931
23932
23933
23934 # Check whether --with-xxinstall or --without-xxinstall was given.
23935 if test "${with_xxinstall+set}" = set; then
23936   withval="$with_xxinstall"
23937   :
23938 fi
23939
23940
23941
23942 trap '' 1 2 15
23943
23944 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
23945
23946 test "x$prefix" = xNONE && prefix=$ac_default_prefix
23947 # Let make expand exec_prefix.
23948 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
23949
23950 # Any assignment to VPATH causes Sun make to only execute
23951 # the first set of double-colon rules, so remove it if not needed.
23952 # If there is a colon in the path, we need to keep it.
23953 if test "x$srcdir" = x.; then
23954   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
23955 fi
23956
23957 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
23958
23959 DEFS=-DHAVE_CONFIG_H
23960
23961 # Without the "./", some shells look in PATH for config.status.
23962 : ${CONFIG_STATUS=./config.status}
23963
23964 echo creating $CONFIG_STATUS
23965 rm -f $CONFIG_STATUS
23966 cat > $CONFIG_STATUS <<EOF
23967 #! /bin/sh
23968 # Generated automatically by configure.
23969 # Run this file to recreate the current configuration.
23970 # This directory was configured as follows,
23971 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
23972 #
23973 # $0 $ac_configure_args
23974 #
23975 # Compiler output produced by configure, useful for debugging
23976 # configure, is in ./config.log if it exists.
23977
23978 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
23979 for ac_option
23980 do
23981   case "\$ac_option" in
23982   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
23983     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
23984     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
23985   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
23986     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
23987     exit 0 ;;
23988   -help | --help | --hel | --he | --h)
23989     echo "\$ac_cs_usage"; exit 0 ;;
23990   *) echo "\$ac_cs_usage"; exit 1 ;;
23991   esac
23992 done
23993
23994 ac_given_srcdir=$srcdir
23995 ac_given_INSTALL="$INSTALL"
23996
23997 trap 'rm -fr `echo "\
23998 Makefile:build/top.mk:Makefile.in:build/dir.mk \
23999 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
24000 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
24001 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
24002 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
24003 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
24004 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
24005 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
24006 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
24007 include/Makefile:build/top.mk:include/Makefile.in \
24008 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
24009 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
24010 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
24011 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
24012 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
24013 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
24014 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
24015 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
24016 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
24017 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
24018 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
24019 servers/slapd/back-hdb/Makefile:build/top.mk:servers/slapd/back-hdb/Makefile.in:build/mod.mk \
24020 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
24021 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
24022 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
24023 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
24024 servers/slapd/back-null/Makefile:build/top.mk:servers/slapd/back-null/Makefile.in:build/mod.mk \
24025 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
24026 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
24027 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
24028 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
24029 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
24030 servers/slapd/slapi/Makefile:build/top.mk:servers/slapd/slapi/Makefile.in:build/lib.mk:build/lib-shared.mk  \
24031 servers/slapd/overlays/Makefile:build/top.mk:servers/slapd/overlays/Makefile.in:build/lib.mk \
24032 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
24033 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
24034 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
24035 tests/run \
24036 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
24037  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
24038 EOF
24039 cat >> $CONFIG_STATUS <<EOF
24040
24041 # Protect against being on the right side of a sed subst in config.status.
24042 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
24043  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
24044 $ac_vpsub
24045 $extrasub
24046 s%@SHELL@%$SHELL%g
24047 s%@CFLAGS@%$CFLAGS%g
24048 s%@CPPFLAGS@%$CPPFLAGS%g
24049 s%@CXXFLAGS@%$CXXFLAGS%g
24050 s%@FFLAGS@%$FFLAGS%g
24051 s%@DEFS@%$DEFS%g
24052 s%@LDFLAGS@%$LDFLAGS%g
24053 s%@LIBS@%$LIBS%g
24054 s%@exec_prefix@%$exec_prefix%g
24055 s%@prefix@%$prefix%g
24056 s%@program_transform_name@%$program_transform_name%g
24057 s%@bindir@%$bindir%g
24058 s%@sbindir@%$sbindir%g
24059 s%@libexecdir@%$libexecdir%g
24060 s%@datadir@%$datadir%g
24061 s%@sysconfdir@%$sysconfdir%g
24062 s%@sharedstatedir@%$sharedstatedir%g
24063 s%@localstatedir@%$localstatedir%g
24064 s%@libdir@%$libdir%g
24065 s%@includedir@%$includedir%g
24066 s%@oldincludedir@%$oldincludedir%g
24067 s%@infodir@%$infodir%g
24068 s%@mandir@%$mandir%g
24069 s%@host@%$host%g
24070 s%@host_alias@%$host_alias%g
24071 s%@host_cpu@%$host_cpu%g
24072 s%@host_vendor@%$host_vendor%g
24073 s%@host_os@%$host_os%g
24074 s%@target@%$target%g
24075 s%@target_alias@%$target_alias%g
24076 s%@target_cpu@%$target_cpu%g
24077 s%@target_vendor@%$target_vendor%g
24078 s%@target_os@%$target_os%g
24079 s%@build@%$build%g
24080 s%@build_alias@%$build_alias%g
24081 s%@build_cpu@%$build_cpu%g
24082 s%@build_vendor@%$build_vendor%g
24083 s%@build_os@%$build_os%g
24084 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
24085 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
24086 s%@INSTALL_DATA@%$INSTALL_DATA%g
24087 s%@PACKAGE@%$PACKAGE%g
24088 s%@VERSION@%$VERSION%g
24089 s%@ACLOCAL@%$ACLOCAL%g
24090 s%@AUTOCONF@%$AUTOCONF%g
24091 s%@AUTOMAKE@%$AUTOMAKE%g
24092 s%@AUTOHEADER@%$AUTOHEADER%g
24093 s%@MAKEINFO@%$MAKEINFO%g
24094 s%@install_sh@%$install_sh%g
24095 s%@AMTAR@%$AMTAR%g
24096 s%@AWK@%$AWK%g
24097 s%@AMTARFLAGS@%$AMTARFLAGS%g
24098 s%@SET_MAKE@%$SET_MAKE%g
24099 s%@OPENLDAP_LIBVERSION@%$OPENLDAP_LIBVERSION%g
24100 s%@OPENLDAP_RELEASE_DATE@%$OPENLDAP_RELEASE_DATE%g
24101 s%@top_builddir@%$top_builddir%g
24102 s%@ldap_subdir@%$ldap_subdir%g
24103 s%@CC@%$CC%g
24104 s%@AR@%$AR%g
24105 s%@LN_S@%$LN_S%g
24106 s%@OBJEXT@%$OBJEXT%g
24107 s%@EXEEXT@%$EXEEXT%g
24108 s%@ECHO@%$ECHO%g
24109 s%@RANLIB@%$RANLIB%g
24110 s%@STRIP@%$STRIP%g
24111 s%@DLLTOOL@%$DLLTOOL%g
24112 s%@AS@%$AS%g
24113 s%@OBJDUMP@%$OBJDUMP%g
24114 s%@CPP@%$CPP%g
24115 s%@LIBTOOL@%$LIBTOOL%g
24116 s%@LN_H@%$LN_H%g
24117 s%@PERLBIN@%$PERLBIN%g
24118 s%@OL_MKDEP@%$OL_MKDEP%g
24119 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
24120 s%@LTSTATIC@%$LTSTATIC%g
24121 s%@LIBOBJS@%$LIBOBJS%g
24122 s%@LIBSRCS@%$LIBSRCS%g
24123 s%@PLAT@%$PLAT%g
24124 s%@WITH_TLS@%$WITH_TLS%g
24125 s%@BUILD_LIBS_DYNAMIC@%$BUILD_LIBS_DYNAMIC%g
24126 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
24127 s%@BUILD_SLAPI@%$BUILD_SLAPI%g
24128 s%@SLAPD_SLAPI_DEPEND@%$SLAPD_SLAPI_DEPEND%g
24129 s%@BUILD_BDB@%$BUILD_BDB%g
24130 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
24131 s%@BUILD_HDB@%$BUILD_HDB%g
24132 s%@BUILD_LDAP@%$BUILD_LDAP%g
24133 s%@BUILD_LDBM@%$BUILD_LDBM%g
24134 s%@BUILD_META@%$BUILD_META%g
24135 s%@BUILD_MONITOR@%$BUILD_MONITOR%g
24136 s%@BUILD_NULL@%$BUILD_NULL%g
24137 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
24138 s%@BUILD_PERL@%$BUILD_PERL%g
24139 s%@BUILD_SHELL@%$BUILD_SHELL%g
24140 s%@BUILD_SQL@%$BUILD_SQL%g
24141 s%@BUILD_BDB_DYNAMIC@%$BUILD_BDB_DYNAMIC%g
24142 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
24143 s%@BUILD_HDB_DYNAMIC@%$BUILD_HDB_DYNAMIC%g
24144 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
24145 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
24146 s%@BUILD_META_DYNAMIC@%$BUILD_META_DYNAMIC%g
24147 s%@BUILD_MONITOR_DYNAMIC@%$BUILD_MONITOR_DYNAMIC%g
24148 s%@BUILD_NULL_DYNAMIC@%$BUILD_NULL_DYNAMIC%g
24149 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
24150 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
24151 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
24152 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
24153 s%@BUILD_DYNGROUP@%$BUILD_DYNGROUP%g
24154 s%@BUILD_PROXYCACHE@%$BUILD_PROXYCACHE%g
24155 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
24156 s%@LDAP_LIBS@%$LDAP_LIBS%g
24157 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
24158 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
24159 s%@LDBM_LIBS@%$LDBM_LIBS%g
24160 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
24161 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
24162 s%@WRAP_LIBS@%$WRAP_LIBS%g
24163 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
24164 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
24165 s%@SLAPD_NO_STATIC@%$SLAPD_NO_STATIC%g
24166 s%@SLAPD_STATIC_BACKENDS@%$SLAPD_STATIC_BACKENDS%g
24167 s%@SLAPD_DYNAMIC_BACKENDS@%$SLAPD_DYNAMIC_BACKENDS%g
24168 s%@SLAPD_DYNAMIC_OVERLAYS@%$SLAPD_DYNAMIC_OVERLAYS%g
24169 s%@PERL_CPPFLAGS@%$PERL_CPPFLAGS%g
24170 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
24171 s%@MOD_PERL_LDFLAGS@%$MOD_PERL_LDFLAGS%g
24172 s%@KRB4_LIBS@%$KRB4_LIBS%g
24173 s%@KRB5_LIBS@%$KRB5_LIBS%g
24174 s%@SASL_LIBS@%$SASL_LIBS%g
24175 s%@TLS_LIBS@%$TLS_LIBS%g
24176 s%@MODULES_LIBS@%$MODULES_LIBS%g
24177 s%@SLAPI_LIBS@%$SLAPI_LIBS%g
24178 s%@LIBSLAPI@%$LIBSLAPI%g
24179 s%@LIBSLAPITOOLS@%$LIBSLAPITOOLS%g
24180 s%@AUTH_LIBS@%$AUTH_LIBS%g
24181 s%@SLAPD_SLP_LIBS@%$SLAPD_SLP_LIBS%g
24182 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
24183 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
24184 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
24185
24186 CEOF
24187 EOF
24188
24189 cat >> $CONFIG_STATUS <<\EOF
24190
24191 # Split the substitutions into bite-sized pieces for seds with
24192 # small command number limits, like on Digital OSF/1 and HP-UX.
24193 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
24194 ac_file=1 # Number of current file.
24195 ac_beg=1 # First line for current file.
24196 ac_end=$ac_max_sed_cmds # Line after last line for current file.
24197 ac_more_lines=:
24198 ac_sed_cmds=""
24199 while $ac_more_lines; do
24200   if test $ac_beg -gt 1; then
24201     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
24202   else
24203     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
24204   fi
24205   if test ! -s conftest.s$ac_file; then
24206     ac_more_lines=false
24207     rm -f conftest.s$ac_file
24208   else
24209     if test -z "$ac_sed_cmds"; then
24210       ac_sed_cmds="sed -f conftest.s$ac_file"
24211     else
24212       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
24213     fi
24214     ac_file=`expr $ac_file + 1`
24215     ac_beg=$ac_end
24216     ac_end=`expr $ac_end + $ac_max_sed_cmds`
24217   fi
24218 done
24219 if test -z "$ac_sed_cmds"; then
24220   ac_sed_cmds=cat
24221 fi
24222 EOF
24223
24224 cat >> $CONFIG_STATUS <<EOF
24225
24226 CONFIG_FILES=\${CONFIG_FILES-"\
24227 Makefile:build/top.mk:Makefile.in:build/dir.mk \
24228 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
24229 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
24230 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
24231 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
24232 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
24233 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
24234 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
24235 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
24236 include/Makefile:build/top.mk:include/Makefile.in \
24237 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
24238 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
24239 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
24240 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
24241 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
24242 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
24243 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
24244 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
24245 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
24246 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
24247 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
24248 servers/slapd/back-hdb/Makefile:build/top.mk:servers/slapd/back-hdb/Makefile.in:build/mod.mk \
24249 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
24250 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
24251 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
24252 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
24253 servers/slapd/back-null/Makefile:build/top.mk:servers/slapd/back-null/Makefile.in:build/mod.mk \
24254 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
24255 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
24256 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
24257 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
24258 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
24259 servers/slapd/slapi/Makefile:build/top.mk:servers/slapd/slapi/Makefile.in:build/lib.mk:build/lib-shared.mk  \
24260 servers/slapd/overlays/Makefile:build/top.mk:servers/slapd/overlays/Makefile.in:build/lib.mk \
24261 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
24262 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
24263 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
24264 tests/run \
24265 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
24266 "}
24267 EOF
24268 cat >> $CONFIG_STATUS <<\EOF
24269 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
24270   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
24271   case "$ac_file" in
24272   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
24273        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
24274   *) ac_file_in="${ac_file}.in" ;;
24275   esac
24276
24277   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
24278
24279   # Remove last slash and all that follows it.  Not all systems have dirname.
24280   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
24281   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
24282     # The file is in a subdirectory.
24283     test ! -d "$ac_dir" && mkdir "$ac_dir"
24284     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
24285     # A "../" for each directory in $ac_dir_suffix.
24286     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
24287   else
24288     ac_dir_suffix= ac_dots=
24289   fi
24290
24291   case "$ac_given_srcdir" in
24292   .)  srcdir=.
24293       if test -z "$ac_dots"; then top_srcdir=.
24294       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
24295   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
24296   *) # Relative path.
24297     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
24298     top_srcdir="$ac_dots$ac_given_srcdir" ;;
24299   esac
24300
24301   case "$ac_given_INSTALL" in
24302   [/$]*) INSTALL="$ac_given_INSTALL" ;;
24303   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
24304   esac
24305
24306   echo creating "$ac_file"
24307   rm -f "$ac_file"
24308   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
24309   case "$ac_file" in
24310   *[Mm]akefile*) ac_comsub="1i\\
24311 # $configure_input" ;;
24312   *) ac_comsub= ;;
24313   esac
24314
24315   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
24316   sed -e "$ac_comsub
24317 s%@configure_input@%$configure_input%g
24318 s%@srcdir@%$srcdir%g
24319 s%@top_srcdir@%$top_srcdir%g
24320 s%@INSTALL@%$INSTALL%g
24321 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
24322 fi; done
24323 rm -f conftest.s*
24324
24325 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
24326 # NAME is the cpp macro being defined and VALUE is the value it is being given.
24327 #
24328 # ac_d sets the value in "#define NAME VALUE" lines.
24329 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
24330 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
24331 ac_dC='\3'
24332 ac_dD='%g'
24333 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
24334 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
24335 ac_uB='\([      ]\)%\1#\2define\3'
24336 ac_uC=' '
24337 ac_uD='\4%g'
24338 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
24339 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
24340 ac_eB='$%\1#\2define\3'
24341 ac_eC=' '
24342 ac_eD='%g'
24343
24344 if test "${CONFIG_HEADERS+set}" != set; then
24345 EOF
24346 cat >> $CONFIG_STATUS <<EOF
24347   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
24348 EOF
24349 cat >> $CONFIG_STATUS <<\EOF
24350 fi
24351 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
24352   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
24353   case "$ac_file" in
24354   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
24355        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
24356   *) ac_file_in="${ac_file}.in" ;;
24357   esac
24358
24359   echo creating $ac_file
24360
24361   rm -f conftest.frag conftest.in conftest.out
24362   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
24363   cat $ac_file_inputs > conftest.in
24364
24365 EOF
24366
24367 # Transform confdefs.h into a sed script conftest.vals that substitutes
24368 # the proper values into config.h.in to produce config.h.  And first:
24369 # Protect against being on the right side of a sed subst in config.status.
24370 # Protect against being in an unquoted here document in config.status.
24371 rm -f conftest.vals
24372 cat > conftest.hdr <<\EOF
24373 s/[\\&%]/\\&/g
24374 s%[\\$`]%\\&%g
24375 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
24376 s%ac_d%ac_u%gp
24377 s%ac_u%ac_e%gp
24378 EOF
24379 sed -n -f conftest.hdr confdefs.h > conftest.vals
24380 rm -f conftest.hdr
24381
24382 # This sed command replaces #undef with comments.  This is necessary, for
24383 # example, in the case of _POSIX_SOURCE, which is predefined and required
24384 # on some systems where configure will not decide to define it.
24385 cat >> conftest.vals <<\EOF
24386 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
24387 EOF
24388
24389 # Break up conftest.vals because some shells have a limit on
24390 # the size of here documents, and old seds have small limits too.
24391
24392 rm -f conftest.tail
24393 while :
24394 do
24395   ac_lines=`grep -c . conftest.vals`
24396   # grep -c gives empty output for an empty file on some AIX systems.
24397   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
24398   # Write a limited-size here document to conftest.frag.
24399   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
24400   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
24401   echo 'CEOF
24402   sed -f conftest.frag conftest.in > conftest.out
24403   rm -f conftest.in
24404   mv conftest.out conftest.in
24405 ' >> $CONFIG_STATUS
24406   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
24407   rm -f conftest.vals
24408   mv conftest.tail conftest.vals
24409 done
24410 rm -f conftest.vals
24411
24412 cat >> $CONFIG_STATUS <<\EOF
24413   rm -f conftest.frag conftest.h
24414   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
24415   cat conftest.in >> conftest.h
24416   rm -f conftest.in
24417   if cmp -s $ac_file conftest.h 2>/dev/null; then
24418     echo "$ac_file is unchanged"
24419     rm -f conftest.h
24420   else
24421     # Remove last slash and all that follows it.  Not all systems have dirname.
24422       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
24423       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
24424       # The file is in a subdirectory.
24425       test ! -d "$ac_dir" && mkdir "$ac_dir"
24426     fi
24427     rm -f $ac_file
24428     mv conftest.h $ac_file
24429   fi
24430 fi; done
24431
24432 EOF
24433 cat >> $CONFIG_STATUS <<EOF
24434
24435 EOF
24436 cat >> $CONFIG_STATUS <<\EOF
24437
24438 chmod +x tests/run
24439 date > stamp-h
24440 echo Please run \"make depend\" to build dependencies
24441
24442 exit 0
24443 EOF
24444 chmod +x $CONFIG_STATUS
24445 rm -fr confdefs* $ac_clean_files
24446 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
24447