]> git.sur5r.net Git - openldap/blob - configure
ITS#3560: fix "chldren:" typo
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.478.2.22 2005/01/11 01:34:47 hyc Exp  
4
5 # This work is part of OpenLDAP Software <http://www.openldap.org/>.
6 #
7 # Copyright 1998-2005 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-2005 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   --with-cyrus-sasl       with Cyrus SASL support [auto]"
49 ac_help="$ac_help
50   --with-fetch            with fetch(3) URL support [auto]"
51 ac_help="$ac_help
52   --with-threads          with threads [auto]"
53 ac_help="$ac_help
54   --with-tls              with TLS/SSL support [auto]"
55 ac_help="$ac_help
56   --with-yielding-select  with implicitly yielding select [auto]"
57 ac_help="$ac_help
58
59 SLAPD (Standalone LDAP Daemon) Options:"
60 ac_help="$ac_help
61   --enable-slapd          enable building slapd [yes]"
62 ac_help="$ac_help
63     --enable-aci          enable per-object ACIs (experimental) [no]"
64 ac_help="$ac_help
65     --enable-cleartext    enable cleartext passwords [yes]"
66 ac_help="$ac_help
67     --enable-crypt        enable crypt(3) passwords [no]"
68 ac_help="$ac_help
69     --enable-lmpasswd     enable LAN Manager passwords [no]"
70 ac_help="$ac_help
71     --enable-spasswd      enable (Cyrus) SASL password verification [no]"
72 ac_help="$ac_help
73     --enable-modules      enable dynamic module support [no]"
74 ac_help="$ac_help
75     --enable-rewrite      enable DN rewriting in back-ldap and the rwm overlay [auto]"
76 ac_help="$ac_help
77     --enable-rlookups     enable reverse lookups of client hostnames [no]"
78 ac_help="$ac_help
79     --enable-slapi        enable SLAPI support (experimental) [no]"
80 ac_help="$ac_help
81     --enable-slp          enable SLPv2 support [no]"
82 ac_help="$ac_help
83     --enable-wrappers     enable tcp wrapper support [no]"
84 ac_help="$ac_help
85
86 SLAPD Backend Options:"
87 ac_help="$ac_help
88     --enable-bdb          enable Berkeley DB backend no|yes|mod [yes]"
89 ac_help="$ac_help
90     --enable-dnssrv       enable dnssrv backend no|yes|mod [no]"
91 ac_help="$ac_help
92     --enable-hdb          enable Hierarchical DB backend no|yes|mod [no]"
93 ac_help="$ac_help
94     --enable-ldap         enable ldap backend no|yes|mod [no]"
95 ac_help="$ac_help
96     --enable-ldbm         enable ldbm backend no|yes|mod [no]"
97 ac_help="$ac_help
98       --with-ldbm-api     with LDBM API auto|berkeley|bcompat|mdbm|gdbm [auto]"
99 ac_help="$ac_help
100       --with-ldbm-type    use LDBM type auto|btree|hash [auto]"
101 ac_help="$ac_help
102     --enable-meta         enable metadirectory backend no|yes|mod [no]"
103 ac_help="$ac_help
104     --enable-monitor      enable monitor backend no|yes|mod [yes]"
105 ac_help="$ac_help
106     --enable-null         enable null backend no|yes|mod [no]"
107 ac_help="$ac_help
108     --enable-passwd       enable passwd backend no|yes|mod [no]"
109 ac_help="$ac_help
110     --enable-perl         enable perl backend no|yes|mod [no]"
111 ac_help="$ac_help
112     --enable-shell        enable shell backend no|yes|mod [no]"
113 ac_help="$ac_help
114     --enable-sql          enable sql backend no|yes|mod [no]"
115 ac_help="$ac_help
116
117 SLAPD Overlay Options:"
118 ac_help="$ac_help
119     --enable-dyngroup     Dynamic Group overlay no|yes|mod [no]"
120 ac_help="$ac_help
121     --enable-proxycache   Proxy Cache overlay no|yes|mod [no]"
122 ac_help="$ac_help
123
124 SLURPD (Replication Daemon) Options:"
125 ac_help="$ac_help
126   --enable-slurpd         enable building slurpd [auto]"
127 ac_help="$ac_help
128
129 Library Generation & Linking Options"
130 ac_help="$ac_help
131   --enable-static[=PKGS]  build static libraries [default=yes]"
132 ac_help="$ac_help
133   --enable-shared[=PKGS]  build shared libraries [default=yes]"
134 ac_help="$ac_help
135   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
136 ac_help="$ac_help
137   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
138
139 # Find the correct PATH separator.  Usually this is `:', but
140 # DJGPP uses `;' like DOS.
141 if test "X${PATH_SEPARATOR+set}" != Xset; then
142   UNAME=${UNAME-`uname 2>/dev/null`}
143   case X$UNAME in
144     *-DOS) lt_cv_sys_path_separator=';' ;;
145     *)     lt_cv_sys_path_separator=':' ;;
146   esac
147   PATH_SEPARATOR=$lt_cv_sys_path_separator
148 fi
149
150
151 # Check that we are running under the correct shell.
152 SHELL=${CONFIG_SHELL-/bin/sh}
153
154 case X$ECHO in
155 X*--fallback-echo)
156   # Remove one level of quotation (which was required for Make).
157   ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
158   ;;
159 esac
160
161 echo=${ECHO-echo}
162 if test "X$1" = X--no-reexec; then
163   # Discard the --no-reexec flag, and continue.
164   shift
165 elif test "X$1" = X--fallback-echo; then
166   # Avoid inline document here, it may be left over
167   :
168 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
169   # Yippee, $echo works!
170   :
171 else
172   # Restart under the correct shell.
173   exec $SHELL "$0" --no-reexec ${1+"$@"}
174 fi
175
176 if test "X$1" = X--fallback-echo; then
177   # used as fallback echo
178   shift
179   cat <<EOF
180
181 EOF
182   exit 0
183 fi
184
185 # The HP-UX ksh and POSIX shell print the target directory to stdout
186 # if CDPATH is set.
187 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
188
189 if test -z "$ECHO"; then
190 if test "X${echo_test_string+set}" != Xset; then
191 # find a string as large as possible, as long as the shell can cope with it
192   for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
193     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
194     if (echo_test_string="`eval $cmd`") 2>/dev/null &&
195        echo_test_string="`eval $cmd`" &&
196        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
197     then
198       break
199     fi
200   done
201 fi
202
203 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
204    echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
205    test "X$echo_testing_string" = "X$echo_test_string"; then
206   :
207 else
208   # The Solaris, AIX, and Digital Unix default echo programs unquote
209   # backslashes.  This makes it impossible to quote backslashes using
210   #   echo "$something" | sed 's/\\/\\\\/g'
211   #
212   # So, first we look for a working echo in the user's PATH.
213
214   IFS="${IFS=   }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
215   for dir in $PATH /usr/ucb; do
216     if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
217        test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
218        echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
219        test "X$echo_testing_string" = "X$echo_test_string"; then
220       echo="$dir/echo"
221       break
222     fi
223   done
224   IFS="$save_ifs"
225
226   if test "X$echo" = Xecho; then
227     # We didn't find a better echo, so look for alternatives.
228     if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
229        echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
230        test "X$echo_testing_string" = "X$echo_test_string"; then
231       # This shell has a builtin print -r that does the trick.
232       echo='print -r'
233     elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
234          test "X$CONFIG_SHELL" != X/bin/ksh; then
235       # If we have ksh, try running configure again with it.
236       ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
237       export ORIGINAL_CONFIG_SHELL
238       CONFIG_SHELL=/bin/ksh
239       export CONFIG_SHELL
240       exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
241     else
242       # Try using printf.
243       echo='printf %s\n'
244       if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
245          echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
246          test "X$echo_testing_string" = "X$echo_test_string"; then
247         # Cool, printf works
248         :
249       elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
250            test "X$echo_testing_string" = 'X\t' &&
251            echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
252            test "X$echo_testing_string" = "X$echo_test_string"; then
253         CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
254         export CONFIG_SHELL
255         SHELL="$CONFIG_SHELL"
256         export SHELL
257         echo="$CONFIG_SHELL $0 --fallback-echo"
258       elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
259            test "X$echo_testing_string" = 'X\t' &&
260            echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
261            test "X$echo_testing_string" = "X$echo_test_string"; then
262         echo="$CONFIG_SHELL $0 --fallback-echo"
263       else
264         # maybe with a smaller string...
265         prev=:
266
267         for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
268           if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
269           then
270             break
271           fi
272           prev="$cmd"
273         done
274
275         if test "$prev" != 'sed 50q "$0"'; then
276           echo_test_string=`eval $prev`
277           export echo_test_string
278           exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
279         else
280           # Oops.  We lost completely, so just stick with echo.
281           echo=echo
282         fi
283       fi
284     fi
285   fi
286 fi
287 fi
288
289 # Copy echo and quote the copy suitably for passing to libtool from
290 # the Makefile, instead of quoting the original, which is used later.
291 ECHO=$echo
292 if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
293    ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
294 fi
295
296
297 ac_help="$ac_help
298   --disable-libtool-lock  avoid locking (might break parallel builds)"
299 ac_help="$ac_help
300   --with-pic              try to use only PIC/non-PIC objects [default=use both]"
301 ac_help="$ac_help
302
303 See INSTALL file for further details."
304
305 # Initialize some variables set by options.
306 # The variables have the same names as the options, with
307 # dashes changed to underlines.
308 build=NONE
309 cache_file=./config.cache
310 exec_prefix=NONE
311 host=NONE
312 no_create=
313 nonopt=NONE
314 no_recursion=
315 prefix=NONE
316 program_prefix=NONE
317 program_suffix=NONE
318 program_transform_name=s,x,x,
319 silent=
320 site=
321 srcdir=
322 target=NONE
323 verbose=
324 x_includes=NONE
325 x_libraries=NONE
326 bindir='${exec_prefix}/bin'
327 sbindir='${exec_prefix}/sbin'
328 libexecdir='${exec_prefix}/libexec'
329 datadir='${prefix}/share'
330 sysconfdir='${prefix}/etc'
331 sharedstatedir='${prefix}/com'
332 localstatedir='${prefix}/var'
333 libdir='${exec_prefix}/lib'
334 includedir='${prefix}/include'
335 oldincludedir='/usr/include'
336 infodir='${prefix}/info'
337 mandir='${prefix}/man'
338
339 # Initialize some other variables.
340 subdirs=
341 MFLAGS= MAKEFLAGS=
342 SHELL=${CONFIG_SHELL-/bin/sh}
343 # Maximum number of lines to put in a shell here document.
344 ac_max_here_lines=12
345
346 ac_prev=
347 for ac_option
348 do
349
350   # If the previous option needs an argument, assign it.
351   if test -n "$ac_prev"; then
352     eval "$ac_prev=\$ac_option"
353     ac_prev=
354     continue
355   fi
356
357   case "$ac_option" in
358   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
359   *) ac_optarg= ;;
360   esac
361
362   # Accept the important Cygnus configure options, so we can diagnose typos.
363
364   case "$ac_option" in
365
366   -bindir | --bindir | --bindi | --bind | --bin | --bi)
367     ac_prev=bindir ;;
368   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
369     bindir="$ac_optarg" ;;
370
371   -build | --build | --buil | --bui | --bu)
372     ac_prev=build ;;
373   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
374     build="$ac_optarg" ;;
375
376   -cache-file | --cache-file | --cache-fil | --cache-fi \
377   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
378     ac_prev=cache_file ;;
379   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
380   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
381     cache_file="$ac_optarg" ;;
382
383   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
384     ac_prev=datadir ;;
385   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
386   | --da=*)
387     datadir="$ac_optarg" ;;
388
389   -disable-* | --disable-*)
390     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
391     # Reject names that are not valid shell variable names.
392     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
393       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
394     fi
395     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
396     eval "enable_${ac_feature}=no" ;;
397
398   -enable-* | --enable-*)
399     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
400     # Reject names that are not valid shell variable names.
401     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
402       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
403     fi
404     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
405     case "$ac_option" in
406       *=*) ;;
407       *) ac_optarg=yes ;;
408     esac
409     eval "enable_${ac_feature}='$ac_optarg'" ;;
410
411   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
412   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
413   | --exec | --exe | --ex)
414     ac_prev=exec_prefix ;;
415   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
416   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
417   | --exec=* | --exe=* | --ex=*)
418     exec_prefix="$ac_optarg" ;;
419
420   -gas | --gas | --ga | --g)
421     # Obsolete; use --with-gas.
422     with_gas=yes ;;
423
424   -help | --help | --hel | --he)
425     # Omit some internal or obsolete options to make the list less imposing.
426     # This message is too long to be a string in the A/UX 3.1 sh.
427     cat << EOF
428 Usage: configure [options] [host]
429 Options: [defaults in brackets after descriptions]
430 Configuration:
431   --cache-file=FILE       cache test results in FILE
432   --help                  print this message
433   --no-create             do not create output files
434   --quiet, --silent       do not print \`checking...' messages
435   --version               print the version of autoconf that created configure
436 Directory and file names:
437   --prefix=PREFIX         install architecture-independent files in PREFIX
438                           [$ac_default_prefix]
439   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
440                           [same as prefix]
441   --bindir=DIR            user executables in DIR [EPREFIX/bin]
442   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
443   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
444   --datadir=DIR           read-only architecture-independent data in DIR
445                           [PREFIX/share]
446   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
447   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
448                           [PREFIX/com]
449   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
450   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
451   --includedir=DIR        C header files in DIR [PREFIX/include]
452   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
453   --infodir=DIR           info documentation in DIR [PREFIX/info]
454   --mandir=DIR            man documentation in DIR [PREFIX/man]
455   --srcdir=DIR            find the sources in DIR [configure dir or ..]
456   --program-prefix=PREFIX prepend PREFIX to installed program names
457   --program-suffix=SUFFIX append SUFFIX to installed program names
458   --program-transform-name=PROGRAM
459                           run sed PROGRAM on installed program names
460 EOF
461     cat << EOF
462 Host type:
463   --build=BUILD           configure for building on BUILD [BUILD=HOST]
464   --host=HOST             configure for HOST [guessed]
465   --target=TARGET         configure for TARGET [TARGET=HOST]
466 Features and packages:
467   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
468   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
469   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
470   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
471   --x-includes=DIR        X include files are in DIR
472   --x-libraries=DIR       X library files are in DIR
473 EOF
474     if test -n "$ac_help"; then
475       echo "--enable and --with options recognized:$ac_help"
476     fi
477     exit 0 ;;
478
479   -host | --host | --hos | --ho)
480     ac_prev=host ;;
481   -host=* | --host=* | --hos=* | --ho=*)
482     host="$ac_optarg" ;;
483
484   -includedir | --includedir | --includedi | --included | --include \
485   | --includ | --inclu | --incl | --inc)
486     ac_prev=includedir ;;
487   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
488   | --includ=* | --inclu=* | --incl=* | --inc=*)
489     includedir="$ac_optarg" ;;
490
491   -infodir | --infodir | --infodi | --infod | --info | --inf)
492     ac_prev=infodir ;;
493   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
494     infodir="$ac_optarg" ;;
495
496   -libdir | --libdir | --libdi | --libd)
497     ac_prev=libdir ;;
498   -libdir=* | --libdir=* | --libdi=* | --libd=*)
499     libdir="$ac_optarg" ;;
500
501   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
502   | --libexe | --libex | --libe)
503     ac_prev=libexecdir ;;
504   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
505   | --libexe=* | --libex=* | --libe=*)
506     libexecdir="$ac_optarg" ;;
507
508   -localstatedir | --localstatedir | --localstatedi | --localstated \
509   | --localstate | --localstat | --localsta | --localst \
510   | --locals | --local | --loca | --loc | --lo)
511     ac_prev=localstatedir ;;
512   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
513   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
514   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
515     localstatedir="$ac_optarg" ;;
516
517   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
518     ac_prev=mandir ;;
519   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
520     mandir="$ac_optarg" ;;
521
522   -nfp | --nfp | --nf)
523     # Obsolete; use --without-fp.
524     with_fp=no ;;
525
526   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
527   | --no-cr | --no-c)
528     no_create=yes ;;
529
530   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
531   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
532     no_recursion=yes ;;
533
534   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
535   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
536   | --oldin | --oldi | --old | --ol | --o)
537     ac_prev=oldincludedir ;;
538   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
539   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
540   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
541     oldincludedir="$ac_optarg" ;;
542
543   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
544     ac_prev=prefix ;;
545   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
546     prefix="$ac_optarg" ;;
547
548   -program-prefix | --program-prefix | --program-prefi | --program-pref \
549   | --program-pre | --program-pr | --program-p)
550     ac_prev=program_prefix ;;
551   -program-prefix=* | --program-prefix=* | --program-prefi=* \
552   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
553     program_prefix="$ac_optarg" ;;
554
555   -program-suffix | --program-suffix | --program-suffi | --program-suff \
556   | --program-suf | --program-su | --program-s)
557     ac_prev=program_suffix ;;
558   -program-suffix=* | --program-suffix=* | --program-suffi=* \
559   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
560     program_suffix="$ac_optarg" ;;
561
562   -program-transform-name | --program-transform-name \
563   | --program-transform-nam | --program-transform-na \
564   | --program-transform-n | --program-transform- \
565   | --program-transform | --program-transfor \
566   | --program-transfo | --program-transf \
567   | --program-trans | --program-tran \
568   | --progr-tra | --program-tr | --program-t)
569     ac_prev=program_transform_name ;;
570   -program-transform-name=* | --program-transform-name=* \
571   | --program-transform-nam=* | --program-transform-na=* \
572   | --program-transform-n=* | --program-transform-=* \
573   | --program-transform=* | --program-transfor=* \
574   | --program-transfo=* | --program-transf=* \
575   | --program-trans=* | --program-tran=* \
576   | --progr-tra=* | --program-tr=* | --program-t=*)
577     program_transform_name="$ac_optarg" ;;
578
579   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
580   | -silent | --silent | --silen | --sile | --sil)
581     silent=yes ;;
582
583   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
584     ac_prev=sbindir ;;
585   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
586   | --sbi=* | --sb=*)
587     sbindir="$ac_optarg" ;;
588
589   -sharedstatedir | --sharedstatedir | --sharedstatedi \
590   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
591   | --sharedst | --shareds | --shared | --share | --shar \
592   | --sha | --sh)
593     ac_prev=sharedstatedir ;;
594   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
595   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
596   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
597   | --sha=* | --sh=*)
598     sharedstatedir="$ac_optarg" ;;
599
600   -site | --site | --sit)
601     ac_prev=site ;;
602   -site=* | --site=* | --sit=*)
603     site="$ac_optarg" ;;
604
605   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
606     ac_prev=srcdir ;;
607   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
608     srcdir="$ac_optarg" ;;
609
610   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
611   | --syscon | --sysco | --sysc | --sys | --sy)
612     ac_prev=sysconfdir ;;
613   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
614   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
615     sysconfdir="$ac_optarg" ;;
616
617   -target | --target | --targe | --targ | --tar | --ta | --t)
618     ac_prev=target ;;
619   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
620     target="$ac_optarg" ;;
621
622   -v | -verbose | --verbose | --verbos | --verbo | --verb)
623     verbose=yes ;;
624
625   -version | --version | --versio | --versi | --vers)
626     echo "configure generated by autoconf version 2.13.1"
627     exit 0 ;;
628
629   -with-* | --with-*)
630     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
631     # Reject names that are not valid shell variable names.
632     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
633       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
634     fi
635     ac_package=`echo $ac_package| sed 's/-/_/g'`
636     case "$ac_option" in
637       *=*) ;;
638       *) ac_optarg=yes ;;
639     esac
640     eval "with_${ac_package}='$ac_optarg'" ;;
641
642   -without-* | --without-*)
643     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
644     # Reject names that are not valid shell variable names.
645     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
646       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
647     fi
648     ac_package=`echo $ac_package| sed 's/-/_/g'`
649     eval "with_${ac_package}=no" ;;
650
651   --x)
652     # Obsolete; use --with-x.
653     with_x=yes ;;
654
655   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
656   | --x-incl | --x-inc | --x-in | --x-i)
657     ac_prev=x_includes ;;
658   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
659   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
660     x_includes="$ac_optarg" ;;
661
662   -x-libraries | --x-libraries | --x-librarie | --x-librari \
663   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
664     ac_prev=x_libraries ;;
665   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
666   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
667     x_libraries="$ac_optarg" ;;
668
669   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
670     ;;
671
672   *)
673     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
674       echo "configure: warning: $ac_option: invalid host type" 1>&2
675     fi
676     if test "x$nonopt" != xNONE; then
677       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
678     fi
679     nonopt="$ac_option"
680     ;;
681
682   esac
683 done
684
685 if test -n "$ac_prev"; then
686   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
687 fi
688
689 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
690
691 # File descriptor usage:
692 # 0 standard input
693 # 1 file creation
694 # 2 errors and warnings
695 # 3 some systems may open it to /dev/tty
696 # 4 used on the Kubota Titan
697 # 6 checking for... messages and results
698 # 5 compiler messages saved in config.log
699 if test "$silent" = yes; then
700   exec 6>/dev/null
701 else
702   exec 6>&1
703 fi
704 exec 5>./config.log
705
706 echo "\
707 This file contains any messages produced by compilers while
708 running configure, to aid debugging if configure makes a mistake.
709 " 1>&5
710
711 # Strip out --no-create and --no-recursion so they do not pile up.
712 # Also quote any args containing shell metacharacters.
713 ac_configure_args=
714 for ac_arg
715 do
716   case "$ac_arg" in
717   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
718   | --no-cr | --no-c) ;;
719   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
720   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
721   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
722   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
723   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
724   esac
725 done
726
727 # NLS nuisances.
728 # Only set these to C if already set.  These must not be set unconditionally
729 # because not all systems understand e.g. LANG=C (notably SCO).
730 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
731 # Non-C LC_CTYPE values break the ctype check.
732 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
733 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
734 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
735 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
736
737 # confdefs.h avoids OS command line length limits that DEFS can exceed.
738 rm -rf conftest* confdefs.h
739 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
740 echo > confdefs.h
741
742 # A filename unique to this package, relative to the directory that
743 # configure is in, which we can look for to find out if srcdir is correct.
744 ac_unique_file=build/version.sh
745
746 # Find the source files, if location was not specified.
747 if test -z "$srcdir"; then
748   ac_srcdir_defaulted=yes
749   # Try the directory containing this script, then its parent.
750   ac_prog=$0
751   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
752   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
753   srcdir=$ac_confdir
754   if test ! -r $srcdir/$ac_unique_file; then
755     srcdir=..
756   fi
757 else
758   ac_srcdir_defaulted=no
759 fi
760 if test ! -r $srcdir/$ac_unique_file; then
761   if test "$ac_srcdir_defaulted" = yes; then
762     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
763   else
764     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
765   fi
766 fi
767 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
768
769 # Prefer explicitly selected file to automatically selected ones.
770 if test -z "$CONFIG_SITE"; then
771   if test "x$prefix" != xNONE; then
772     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
773   else
774     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
775   fi
776 fi
777 for ac_site_file in $CONFIG_SITE; do
778   if test -r "$ac_site_file"; then
779     echo "loading site script $ac_site_file"
780     . "$ac_site_file"
781   fi
782 done
783
784
785 ac_ext=c
786 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
787 ac_cpp='$CPP $CPPFLAGS'
788 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
789 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
790 cross_compiling=$ac_cv_prog_cc_cross
791
792 ac_exeext=
793 ac_objext=o
794 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
795   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
796   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
797     ac_n= ac_c='
798 ' ac_t='        '
799   else
800     ac_n=-n ac_c= ac_t=
801   fi
802 else
803   ac_n= ac_c='\c' ac_t=
804 fi
805
806
807 # set unset (borrowed from autoconf 2.49c)
808 if (OL_FOO=OL_FOO; unset OL_FOO) >/dev/null 2>&1; then
809   ol_unset=unset
810 else
811   ol_unset=false
812 fi
813 # unset CDPATH
814 $ol_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
815
816 ac_aux_dir=
817 for ac_dir in build $srcdir/build; do
818   if test -f $ac_dir/install-sh; then
819     ac_aux_dir=$ac_dir
820     ac_install_sh="$ac_aux_dir/install-sh -c"
821     break
822   elif test -f $ac_dir/install.sh; then
823     ac_aux_dir=$ac_dir
824     ac_install_sh="$ac_aux_dir/install.sh -c"
825     break
826   elif test -f $ac_dir/shtool; then
827     ac_aux_dir=$ac_dir
828     ac_install_sh="$ac_aux_dir/shtool install -c"
829     break
830   fi
831 done
832 if test -z "$ac_aux_dir"; then
833   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
834 fi
835 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
836 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
837 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
838
839 eval `$ac_aux_dir/version.sh`
840 if test -z "$OL_STRING"; then
841         { echo "configure: error: could not determine version" 1>&2; exit 1; }
842 fi
843
844 if test -f "$ac_aux_dir/shtool" -a ! -d $ac_aux_dir/shtool; then
845         ac_cv_shtool="$ac_aux_dir/shtool"
846 else
847         { echo "configure: error: no shtool found in $ac_aux_dir" 1>&2; exit 1; }
848 fi
849
850 SHTOOL="$ac_cv_shtool"
851
852 TB="`$SHTOOL echo -e '%B' 2>/dev/null`"
853 TN="`$SHTOOL echo -e '%b' 2>/dev/null`"
854
855 OPENLDAP_CVS=""
856 if test -d $ac_aux_dir/CVS; then
857         OPENLDAP_CVS="(from CVS sources) "
858 fi
859
860 echo "Configuring ${TB}${OL_STRING}${TN} ${OPENLDAP_CVS}..."
861
862
863 echo $ac_n "checking host system type""... $ac_c" 1>&6
864 echo "configure:865: checking host system type" >&5
865 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
866
867 # Make sure we can run config.sub.
868   if $ac_config_sub sun4 >/dev/null 2>&1; then :
869     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
870   fi
871
872   ac_cv_host_alias=$host
873   case "$ac_cv_host_alias" in
874   NONE)
875     case $nonopt in
876     NONE)
877       if ac_cv_host_alias=`$ac_config_guess`; then :
878       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
879       fi ;;
880     *) ac_cv_host_alias=$nonopt ;;
881     esac ;;
882   esac
883
884   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
885   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
886   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
887   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
888 else
889   echo $ac_n "(cached) $ac_c" 1>&6
890 fi
891
892 echo "$ac_t""$ac_cv_host" 1>&6
893
894 host=$ac_cv_host
895 host_alias=$ac_cv_host_alias
896 host_cpu=$ac_cv_host_cpu
897 host_vendor=$ac_cv_host_vendor
898 host_os=$ac_cv_host_os
899
900
901
902
903
904 echo $ac_n "checking target system type""... $ac_c" 1>&6
905 echo "configure:906: checking target system type" >&5
906 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
907
908 # Make sure we can run config.sub.
909   if $ac_config_sub sun4 >/dev/null 2>&1; then :
910     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
911   fi
912
913   ac_cv_target_alias=$target
914   case "$ac_cv_target_alias" in
915   NONE)
916     case $nonopt in
917     NONE)
918       ac_cv_target_alias=$host_alias ;;
919
920     *) ac_cv_target_alias=$nonopt ;;
921     esac ;;
922   esac
923
924   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
925   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
926   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
927   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
928 else
929   echo $ac_n "(cached) $ac_c" 1>&6
930 fi
931
932 echo "$ac_t""$ac_cv_target" 1>&6
933
934 target=$ac_cv_target
935 target_alias=$ac_cv_target_alias
936 target_cpu=$ac_cv_target_cpu
937 target_vendor=$ac_cv_target_vendor
938 target_os=$ac_cv_target_os
939
940
941
942
943
944 echo $ac_n "checking build system type""... $ac_c" 1>&6
945 echo "configure:946: checking build system type" >&5
946 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
947
948 # Make sure we can run config.sub.
949   if $ac_config_sub sun4 >/dev/null 2>&1; then :
950     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
951   fi
952
953   ac_cv_build_alias=$build
954   case "$ac_cv_build_alias" in
955   NONE)
956     case $nonopt in
957     NONE)
958       ac_cv_build_alias=$host_alias ;;
959
960     *) ac_cv_build_alias=$nonopt ;;
961     esac ;;
962   esac
963
964   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
965   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
966   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
967   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
968 else
969   echo $ac_n "(cached) $ac_c" 1>&6
970 fi
971
972 echo "$ac_t""$ac_cv_build" 1>&6
973
974 build=$ac_cv_build
975 build_alias=$ac_cv_build_alias
976 build_cpu=$ac_cv_build_cpu
977 build_vendor=$ac_cv_build_vendor
978 build_os=$ac_cv_build_os
979
980
981
982
983
984 # Do some error checking and defaulting for the host and target type.
985 # The inputs are:
986 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
987 #
988 # The rules are:
989 # 1. You are not allowed to specify --host, --target, and nonopt at the
990 #    same time.
991 # 2. Host defaults to nonopt.
992 # 3. If nonopt is not specified, then host defaults to the current host,
993 #    as determined by config.guess.
994 # 4. Target and build default to nonopt.
995 # 5. If nonopt is not specified, then target and build default to host.
996
997 # The aliases save the names the user supplied, while $host etc.
998 # will get canonicalized.
999 case $host---$target---$nonopt in
1000 NONE---*---* | *---NONE---* | *---*---NONE) ;;
1001 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
1002 esac
1003
1004 test "$host_alias" != "$target_alias" &&
1005   test "$program_prefix$program_suffix$program_transform_name" = \
1006     NONENONEs,x,x, &&
1007   program_prefix=${target_alias}-
1008
1009
1010 # Find a good install program.  We prefer a C program (faster),
1011 # so one script is as good as another.  But avoid the broken or
1012 # incompatible versions:
1013 # SysV /etc/install, /usr/sbin/install
1014 # SunOS /usr/etc/install
1015 # IRIX /sbin/install
1016 # AIX /bin/install
1017 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1018 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1019 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1020 # ./install, which can be erroneously created by make from ./install.sh.
1021 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1022 echo "configure:1023: checking for a BSD compatible install" >&5
1023 if test -z "$INSTALL"; then
1024 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
1025   echo $ac_n "(cached) $ac_c" 1>&6
1026 else
1027     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1028   for ac_dir in $PATH; do
1029     # Account for people who put trailing slashes in PATH elements.
1030     case "$ac_dir/" in
1031     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1032     *)
1033       # OSF1 and SCO ODT 3.0 have their own names for install.
1034       # Don't use installbsd from OSF since it installs stuff as root
1035       # by default.
1036       for ac_prog in ginstall scoinst install; do
1037         if test -f $ac_dir/$ac_prog; then
1038           if test $ac_prog = install &&
1039             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1040             # AIX install.  It has an incompatible calling convention.
1041             :
1042           elif test $ac_prog = install &&
1043             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
1044             # program-specific install script used by HP pwplus--don't use.
1045             :
1046           else
1047             ac_cv_path_install="$ac_dir/$ac_prog -c"
1048             break 2
1049           fi
1050         fi
1051       done
1052       ;;
1053     esac
1054   done
1055   IFS="$ac_save_IFS"
1056
1057 fi
1058   if test "${ac_cv_path_install+set}" = set; then
1059     INSTALL="$ac_cv_path_install"
1060   else
1061     # As a last resort, use the slow shell script.  We don't cache a
1062     # path for INSTALL within a source directory, because that will
1063     # break other packages using the cache if that directory is
1064     # removed, or if the path is relative.
1065     INSTALL="$ac_install_sh"
1066   fi
1067 fi
1068 echo "$ac_t""$INSTALL" 1>&6
1069
1070 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1071 # It thinks the first close brace ends the variable substitution.
1072 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1073
1074 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
1075
1076 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1077
1078 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
1079 echo "configure:1080: checking whether build environment is sane" >&5
1080 # Just in case
1081 sleep 1
1082 echo timestamp > conftestfile
1083 # Do `set' in a subshell so we don't clobber the current shell's
1084 # arguments.  Must try -L first in case configure is actually a
1085 # symlink; some systems play weird games with the mod time of symlinks
1086 # (eg FreeBSD returns the mod time of the symlink's containing
1087 # directory).
1088 if (
1089    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1090    if test "$*" = "X"; then
1091       # -L didn't work.
1092       set X `ls -t $srcdir/configure conftestfile`
1093    fi
1094    if test "$*" != "X $srcdir/configure conftestfile" \
1095       && test "$*" != "X conftestfile $srcdir/configure"; then
1096
1097       # If neither matched, then we have a broken ls.  This can happen
1098       # if, for instance, CONFIG_SHELL is bash and it inherits a
1099       # broken ls alias from the environment.  This has actually
1100       # happened.  Such a system could not be considered "sane".
1101       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
1102 alias in your environment" 1>&2; exit 1; }
1103    fi
1104
1105    test "$2" = conftestfile
1106    )
1107 then
1108    # Ok.
1109    :
1110 else
1111    { echo "configure: error: newly created file is older than distributed files!
1112 Check your system clock" 1>&2; exit 1; }
1113 fi
1114 rm -f conftest*
1115 echo "$ac_t""yes" 1>&6
1116 if test "$program_transform_name" = s,x,x,; then
1117   program_transform_name=
1118 else
1119   # Double any \ or $.  echo might interpret backslashes.
1120   cat <<\EOF_SED > conftestsed
1121 s,\\,\\\\,g; s,\$,$$,g
1122 EOF_SED
1123   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
1124   rm -f conftestsed
1125 fi
1126 test "$program_prefix" != NONE &&
1127   program_transform_name="s,^,${program_prefix},;$program_transform_name"
1128 # Use a double $ so make ignores it.
1129 test "$program_suffix" != NONE &&
1130   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
1131
1132 # sed with no file args requires a program.
1133 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
1134
1135 for ac_prog in mawk gawk nawk awk
1136 do
1137 # Extract the first word of "$ac_prog", so it can be a program name with args.
1138 set dummy $ac_prog; ac_word=$2
1139 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1140 echo "configure:1141: checking for $ac_word" >&5
1141 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
1142   echo $ac_n "(cached) $ac_c" 1>&6
1143 else
1144   if test -n "$AWK"; then
1145   ac_cv_prog_AWK="$AWK" # Let the user override the test.
1146 else
1147   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1148   ac_dummy="$PATH"
1149   for ac_dir in $ac_dummy; do
1150     test -z "$ac_dir" && ac_dir=.
1151     if test -f $ac_dir/$ac_word; then
1152       ac_cv_prog_AWK="$ac_prog"
1153       break
1154     fi
1155   done
1156   IFS="$ac_save_ifs"
1157 fi
1158 fi
1159 AWK="$ac_cv_prog_AWK"
1160 if test -n "$AWK"; then
1161   echo "$ac_t""$AWK" 1>&6
1162 else
1163   echo "$ac_t""no" 1>&6
1164 fi
1165
1166 test -n "$AWK" && break
1167 done
1168
1169 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1170 echo "configure:1171: checking whether ${MAKE-make} sets \${MAKE}" >&5
1171 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1172 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1173   echo $ac_n "(cached) $ac_c" 1>&6
1174 else
1175   cat > conftestmake <<\EOF
1176 all:
1177         @echo 'ac_maketemp="${MAKE}"'
1178 EOF
1179 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1180 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1181 if test -n "$ac_maketemp"; then
1182   eval ac_cv_prog_make_${ac_make}_set=yes
1183 else
1184   eval ac_cv_prog_make_${ac_make}_set=no
1185 fi
1186 rm -f conftestmake
1187 fi
1188 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1189   echo "$ac_t""yes" 1>&6
1190   SET_MAKE=
1191 else
1192   echo "$ac_t""no" 1>&6
1193   SET_MAKE="MAKE=${MAKE-make}"
1194 fi
1195
1196
1197
1198 PACKAGE=$OL_PACKAGE
1199
1200 VERSION=$OL_VERSION
1201
1202 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1203   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
1204 fi
1205
1206
1207
1208 missing_dir=`cd $ac_aux_dir && pwd`
1209 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1210 echo "configure:1211: checking for working aclocal" >&5
1211 # Run test in a subshell; some versions of sh will print an error if
1212 # an executable is not found, even if stderr is redirected.
1213 # Redirect stdin to placate older versions of autoconf.  Sigh.
1214 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1215    ACLOCAL=aclocal
1216    echo "$ac_t""found" 1>&6
1217 else
1218    ACLOCAL="$missing_dir/missing aclocal"
1219    echo "$ac_t""missing" 1>&6
1220 fi
1221
1222 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1223 echo "configure:1224: checking for working autoconf" >&5
1224 # Run test in a subshell; some versions of sh will print an error if
1225 # an executable is not found, even if stderr is redirected.
1226 # Redirect stdin to placate older versions of autoconf.  Sigh.
1227 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1228    AUTOCONF=autoconf
1229    echo "$ac_t""found" 1>&6
1230 else
1231    AUTOCONF="$missing_dir/missing autoconf"
1232    echo "$ac_t""missing" 1>&6
1233 fi
1234
1235 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1236 echo "configure:1237: checking for working automake" >&5
1237 # Run test in a subshell; some versions of sh will print an error if
1238 # an executable is not found, even if stderr is redirected.
1239 # Redirect stdin to placate older versions of autoconf.  Sigh.
1240 if (automake --version) < /dev/null > /dev/null 2>&1; then
1241    AUTOMAKE=automake
1242    echo "$ac_t""found" 1>&6
1243 else
1244    AUTOMAKE="$missing_dir/missing automake"
1245    echo "$ac_t""missing" 1>&6
1246 fi
1247
1248 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1249 echo "configure:1250: checking for working autoheader" >&5
1250 # Run test in a subshell; some versions of sh will print an error if
1251 # an executable is not found, even if stderr is redirected.
1252 # Redirect stdin to placate older versions of autoconf.  Sigh.
1253 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1254    AUTOHEADER=autoheader
1255    echo "$ac_t""found" 1>&6
1256 else
1257    AUTOHEADER="$missing_dir/missing autoheader"
1258    echo "$ac_t""missing" 1>&6
1259 fi
1260
1261 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1262 echo "configure:1263: checking for working makeinfo" >&5
1263 # Run test in a subshell; some versions of sh will print an error if
1264 # an executable is not found, even if stderr is redirected.
1265 # Redirect stdin to placate older versions of autoconf.  Sigh.
1266 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1267    MAKEINFO=makeinfo
1268    echo "$ac_t""found" 1>&6
1269 else
1270    MAKEINFO="$missing_dir/missing makeinfo"
1271    echo "$ac_t""missing" 1>&6
1272 fi
1273
1274 install_sh="$missing_dir/install-sh"
1275 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1276
1277 for ac_prog in gnutar gtar tar
1278 do
1279 # Extract the first word of "$ac_prog", so it can be a program name with args.
1280 set dummy $ac_prog; ac_word=$2
1281 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1282 echo "configure:1283: checking for $ac_word" >&5
1283 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1284   echo $ac_n "(cached) $ac_c" 1>&6
1285 else
1286   if test -n "$AMTAR"; then
1287   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1288 else
1289   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1290   ac_dummy="$PATH"
1291   for ac_dir in $ac_dummy; do
1292     test -z "$ac_dir" && ac_dir=.
1293     if test -f $ac_dir/$ac_word; then
1294       ac_cv_prog_AMTAR="$ac_prog"
1295       break
1296     fi
1297   done
1298   IFS="$ac_save_ifs"
1299 fi
1300 fi
1301 AMTAR="$ac_cv_prog_AMTAR"
1302 if test -n "$AMTAR"; then
1303   echo "$ac_t""$AMTAR" 1>&6
1304 else
1305   echo "$ac_t""no" 1>&6
1306 fi
1307
1308 test -n "$AMTAR" && break
1309 done
1310
1311
1312 AMTARFLAGS=
1313 if test -n "$AMTAR"; then
1314   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1315         AMTARFLAGS=o
1316   fi
1317 fi
1318
1319 cat >> confdefs.h <<EOF
1320 #define OPENLDAP_PACKAGE "$PACKAGE"
1321 EOF
1322
1323 cat >> confdefs.h <<EOF
1324 #define OPENLDAP_VERSION "$VERSION"
1325 EOF
1326
1327
1328 cat >> confdefs.h <<EOF
1329 #define LDAP_VENDOR_VERSION $OL_API_INC
1330 EOF
1331
1332 cat >> confdefs.h <<EOF
1333 #define LDAP_VENDOR_VERSION_MAJOR $OL_MAJOR
1334 EOF
1335
1336 cat >> confdefs.h <<EOF
1337 #define LDAP_VENDOR_VERSION_MINOR $OL_MINOR
1338 EOF
1339
1340 cat >> confdefs.h <<EOF
1341 #define LDAP_VENDOR_VERSION_PATCH $OL_PATCH
1342 EOF
1343
1344
1345 OPENLDAP_LIBRELEASE=$OL_API_LIB_RELEASE
1346
1347 OPENLDAP_LIBVERSION=$OL_API_LIB_VERSION
1348
1349 OPENLDAP_RELEASE_DATE="$OL_RELEASE_DATE"
1350
1351
1352
1353 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1354 echo "configure:1355: checking configure arguments" >&5
1355
1356
1357 top_builddir=`pwd`
1358
1359 ldap_subdir="/openldap"
1360
1361 # Check whether --with-subdir or --without-subdir was given.
1362 if test "${with_subdir+set}" = set; then
1363   withval="$with_subdir"
1364   case "$withval" in
1365         no) ldap_subdir=""
1366                 ;;
1367         yes)
1368                 ;;
1369         /*|\\*)
1370                 ldap_subdir="$withval"
1371                 ;;
1372         *)
1373                 ldap_subdir="/$withval"
1374                 ;;
1375 esac
1376
1377 fi
1378
1379
1380 # OpenLDAP --enable-debug
1381         # Check whether --enable-debug or --disable-debug was given.
1382 if test "${enable_debug+set}" = set; then
1383   enableval="$enable_debug"
1384   
1385         ol_arg=invalid
1386         for ol_val in auto yes no ; do
1387                 if test "$enableval" = "$ol_val" ; then
1388                         ol_arg="$ol_val"
1389                 fi
1390         done
1391         if test "$ol_arg" = "invalid" ; then
1392                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1393         fi
1394         ol_enable_debug="$ol_arg"
1395
1396 else
1397         ol_enable_debug="yes"
1398 fi
1399 # end --enable-debug
1400 # OpenLDAP --enable-dynamic
1401         # Check whether --enable-dynamic or --disable-dynamic was given.
1402 if test "${enable_dynamic+set}" = set; then
1403   enableval="$enable_dynamic"
1404   
1405         ol_arg=invalid
1406         for ol_val in auto yes no ; do
1407                 if test "$enableval" = "$ol_val" ; then
1408                         ol_arg="$ol_val"
1409                 fi
1410         done
1411         if test "$ol_arg" = "invalid" ; then
1412                 { echo "configure: error: bad value $enableval for --enable-dynamic" 1>&2; exit 1; }
1413         fi
1414         ol_enable_dynamic="$ol_arg"
1415
1416 else
1417         ol_enable_dynamic="no"
1418 fi
1419 # end --enable-dynamic
1420 # OpenLDAP --enable-syslog
1421         # Check whether --enable-syslog or --disable-syslog was given.
1422 if test "${enable_syslog+set}" = set; then
1423   enableval="$enable_syslog"
1424   
1425         ol_arg=invalid
1426         for ol_val in auto yes no ; do
1427                 if test "$enableval" = "$ol_val" ; then
1428                         ol_arg="$ol_val"
1429                 fi
1430         done
1431         if test "$ol_arg" = "invalid" ; then
1432                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1433         fi
1434         ol_enable_syslog="$ol_arg"
1435
1436 else
1437         ol_enable_syslog="auto"
1438 fi
1439 # end --enable-syslog
1440 # OpenLDAP --enable-proctitle
1441         # Check whether --enable-proctitle or --disable-proctitle was given.
1442 if test "${enable_proctitle+set}" = set; then
1443   enableval="$enable_proctitle"
1444   
1445         ol_arg=invalid
1446         for ol_val in auto yes no ; do
1447                 if test "$enableval" = "$ol_val" ; then
1448                         ol_arg="$ol_val"
1449                 fi
1450         done
1451         if test "$ol_arg" = "invalid" ; then
1452                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1453         fi
1454         ol_enable_proctitle="$ol_arg"
1455
1456 else
1457         ol_enable_proctitle="yes"
1458 fi
1459 # end --enable-proctitle
1460 ol_enable_referrals=${ol_enable_referrals-no}
1461 ol_enable_kbind=${ol_enable_kbind-no}
1462 # OpenLDAP --enable-ipv6
1463         # Check whether --enable-ipv6 or --disable-ipv6 was given.
1464 if test "${enable_ipv6+set}" = set; then
1465   enableval="$enable_ipv6"
1466   
1467         ol_arg=invalid
1468         for ol_val in auto yes no ; do
1469                 if test "$enableval" = "$ol_val" ; then
1470                         ol_arg="$ol_val"
1471                 fi
1472         done
1473         if test "$ol_arg" = "invalid" ; then
1474                 { echo "configure: error: bad value $enableval for --enable-ipv6" 1>&2; exit 1; }
1475         fi
1476         ol_enable_ipv6="$ol_arg"
1477
1478 else
1479         ol_enable_ipv6="auto"
1480 fi
1481 # end --enable-ipv6
1482 # OpenLDAP --enable-local
1483         # Check whether --enable-local or --disable-local was given.
1484 if test "${enable_local+set}" = set; then
1485   enableval="$enable_local"
1486   
1487         ol_arg=invalid
1488         for ol_val in auto yes no ; do
1489                 if test "$enableval" = "$ol_val" ; then
1490                         ol_arg="$ol_val"
1491                 fi
1492         done
1493         if test "$ol_arg" = "invalid" ; then
1494                 { echo "configure: error: bad value $enableval for --enable-local" 1>&2; exit 1; }
1495         fi
1496         ol_enable_local="$ol_arg"
1497
1498 else
1499         ol_enable_local="auto"
1500 fi
1501 # end --enable-local
1502
1503
1504 # OpenLDAP --with-cyrus_sasl
1505         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1506 if test "${with_cyrus_sasl+set}" = set; then
1507   withval="$with_cyrus_sasl"
1508   
1509         ol_arg=invalid
1510         for ol_val in auto yes no  ; do
1511                 if test "$withval" = "$ol_val" ; then
1512                         ol_arg="$ol_val"
1513                 fi
1514         done
1515         if test "$ol_arg" = "invalid" ; then
1516                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1517         fi
1518         ol_with_cyrus_sasl="$ol_arg"
1519
1520 else
1521         ol_with_cyrus_sasl="auto"
1522 fi
1523 # end --with-cyrus_sasl
1524
1525 # OpenLDAP --with-fetch
1526         # Check whether --with-fetch or --without-fetch was given.
1527 if test "${with_fetch+set}" = set; then
1528   withval="$with_fetch"
1529   
1530         ol_arg=invalid
1531         for ol_val in auto yes no  ; do
1532                 if test "$withval" = "$ol_val" ; then
1533                         ol_arg="$ol_val"
1534                 fi
1535         done
1536         if test "$ol_arg" = "invalid" ; then
1537                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1538         fi
1539         ol_with_fetch="$ol_arg"
1540
1541 else
1542         ol_with_fetch="auto"
1543 fi
1544 # end --with-fetch
1545
1546 ol_with_kerberos=${ol_with_kerberos-auto}
1547 # OpenLDAP --with-threads
1548         # Check whether --with-threads or --without-threads was given.
1549 if test "${with_threads+set}" = set; then
1550   withval="$with_threads"
1551   
1552         ol_arg=invalid
1553         for ol_val in auto nt posix mach pth lwp yes no manual  ; do
1554                 if test "$withval" = "$ol_val" ; then
1555                         ol_arg="$ol_val"
1556                 fi
1557         done
1558         if test "$ol_arg" = "invalid" ; then
1559                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1560         fi
1561         ol_with_threads="$ol_arg"
1562
1563 else
1564         ol_with_threads="auto"
1565 fi
1566 # end --with-threads
1567
1568 # OpenLDAP --with-tls
1569         # Check whether --with-tls or --without-tls was given.
1570 if test "${with_tls+set}" = set; then
1571   withval="$with_tls"
1572   
1573         ol_arg=invalid
1574         for ol_val in auto ssleay openssl yes no  ; do
1575                 if test "$withval" = "$ol_val" ; then
1576                         ol_arg="$ol_val"
1577                 fi
1578         done
1579         if test "$ol_arg" = "invalid" ; then
1580                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1581         fi
1582         ol_with_tls="$ol_arg"
1583
1584 else
1585         ol_with_tls="auto"
1586 fi
1587 # end --with-tls
1588
1589 # OpenLDAP --with-yielding_select
1590         # Check whether --with-yielding_select or --without-yielding_select was given.
1591 if test "${with_yielding_select+set}" = set; then
1592   withval="$with_yielding_select"
1593   
1594         ol_arg=invalid
1595         for ol_val in auto yes no manual  ; do
1596                 if test "$withval" = "$ol_val" ; then
1597                         ol_arg="$ol_val"
1598                 fi
1599         done
1600         if test "$ol_arg" = "invalid" ; then
1601                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1602         fi
1603         ol_with_yielding_select="$ol_arg"
1604
1605 else
1606         ol_with_yielding_select="auto"
1607 fi
1608 # end --with-yielding_select
1609
1610
1611
1612 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1613 if test "${with_xxslapdoptions+set}" = set; then
1614   withval="$with_xxslapdoptions"
1615   :
1616 fi
1617
1618 # OpenLDAP --enable-slapd
1619         # Check whether --enable-slapd or --disable-slapd was given.
1620 if test "${enable_slapd+set}" = set; then
1621   enableval="$enable_slapd"
1622   
1623         ol_arg=invalid
1624         for ol_val in auto yes no ; do
1625                 if test "$enableval" = "$ol_val" ; then
1626                         ol_arg="$ol_val"
1627                 fi
1628         done
1629         if test "$ol_arg" = "invalid" ; then
1630                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1631         fi
1632         ol_enable_slapd="$ol_arg"
1633
1634 else
1635         ol_enable_slapd="yes"
1636 fi
1637 # end --enable-slapd
1638 # OpenLDAP --enable-aci
1639         # Check whether --enable-aci or --disable-aci was given.
1640 if test "${enable_aci+set}" = set; then
1641   enableval="$enable_aci"
1642   
1643         ol_arg=invalid
1644         for ol_val in auto yes no ; do
1645                 if test "$enableval" = "$ol_val" ; then
1646                         ol_arg="$ol_val"
1647                 fi
1648         done
1649         if test "$ol_arg" = "invalid" ; then
1650                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1651         fi
1652         ol_enable_aci="$ol_arg"
1653
1654 else
1655         ol_enable_aci="no"
1656 fi
1657 # end --enable-aci
1658 # OpenLDAP --enable-cleartext
1659         # Check whether --enable-cleartext or --disable-cleartext was given.
1660 if test "${enable_cleartext+set}" = set; then
1661   enableval="$enable_cleartext"
1662   
1663         ol_arg=invalid
1664         for ol_val in auto yes no ; do
1665                 if test "$enableval" = "$ol_val" ; then
1666                         ol_arg="$ol_val"
1667                 fi
1668         done
1669         if test "$ol_arg" = "invalid" ; then
1670                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1671         fi
1672         ol_enable_cleartext="$ol_arg"
1673
1674 else
1675         ol_enable_cleartext="yes"
1676 fi
1677 # end --enable-cleartext
1678 # OpenLDAP --enable-crypt
1679         # Check whether --enable-crypt or --disable-crypt was given.
1680 if test "${enable_crypt+set}" = set; then
1681   enableval="$enable_crypt"
1682   
1683         ol_arg=invalid
1684         for ol_val in auto yes no ; do
1685                 if test "$enableval" = "$ol_val" ; then
1686                         ol_arg="$ol_val"
1687                 fi
1688         done
1689         if test "$ol_arg" = "invalid" ; then
1690                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1691         fi
1692         ol_enable_crypt="$ol_arg"
1693
1694 else
1695         ol_enable_crypt="no"
1696 fi
1697 # end --enable-crypt
1698 # OpenLDAP --enable-lmpasswd
1699         # Check whether --enable-lmpasswd or --disable-lmpasswd was given.
1700 if test "${enable_lmpasswd+set}" = set; then
1701   enableval="$enable_lmpasswd"
1702   
1703         ol_arg=invalid
1704         for ol_val in auto yes no ; do
1705                 if test "$enableval" = "$ol_val" ; then
1706                         ol_arg="$ol_val"
1707                 fi
1708         done
1709         if test "$ol_arg" = "invalid" ; then
1710                 { echo "configure: error: bad value $enableval for --enable-lmpasswd" 1>&2; exit 1; }
1711         fi
1712         ol_enable_lmpasswd="$ol_arg"
1713
1714 else
1715         ol_enable_lmpasswd="no"
1716 fi
1717 # end --enable-lmpasswd
1718 # OpenLDAP --enable-spasswd
1719         # Check whether --enable-spasswd or --disable-spasswd was given.
1720 if test "${enable_spasswd+set}" = set; then
1721   enableval="$enable_spasswd"
1722   
1723         ol_arg=invalid
1724         for ol_val in auto yes no ; do
1725                 if test "$enableval" = "$ol_val" ; then
1726                         ol_arg="$ol_val"
1727                 fi
1728         done
1729         if test "$ol_arg" = "invalid" ; then
1730                 { echo "configure: error: bad value $enableval for --enable-spasswd" 1>&2; exit 1; }
1731         fi
1732         ol_enable_spasswd="$ol_arg"
1733
1734 else
1735         ol_enable_spasswd="no"
1736 fi
1737 # end --enable-spasswd
1738 # OpenLDAP --enable-modules
1739         # Check whether --enable-modules or --disable-modules was given.
1740 if test "${enable_modules+set}" = set; then
1741   enableval="$enable_modules"
1742   
1743         ol_arg=invalid
1744         for ol_val in auto yes no ; do
1745                 if test "$enableval" = "$ol_val" ; then
1746                         ol_arg="$ol_val"
1747                 fi
1748         done
1749         if test "$ol_arg" = "invalid" ; then
1750                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1751         fi
1752         ol_enable_modules="$ol_arg"
1753
1754 else
1755         ol_enable_modules="no"
1756 fi
1757 # end --enable-modules
1758 ol_enable_multimaster=${ol_enable_multimaster-no}
1759 # OpenLDAP --enable-rewrite
1760         # Check whether --enable-rewrite or --disable-rewrite was given.
1761 if test "${enable_rewrite+set}" = set; then
1762   enableval="$enable_rewrite"
1763   
1764         ol_arg=invalid
1765         for ol_val in auto yes no ; do
1766                 if test "$enableval" = "$ol_val" ; then
1767                         ol_arg="$ol_val"
1768                 fi
1769         done
1770         if test "$ol_arg" = "invalid" ; then
1771                 { echo "configure: error: bad value $enableval for --enable-rewrite" 1>&2; exit 1; }
1772         fi
1773         ol_enable_rewrite="$ol_arg"
1774
1775 else
1776         ol_enable_rewrite="auto"
1777 fi
1778 # end --enable-rewrite
1779 # OpenLDAP --enable-rlookups
1780         # Check whether --enable-rlookups or --disable-rlookups was given.
1781 if test "${enable_rlookups+set}" = set; then
1782   enableval="$enable_rlookups"
1783   
1784         ol_arg=invalid
1785         for ol_val in auto yes no ; do
1786                 if test "$enableval" = "$ol_val" ; then
1787                         ol_arg="$ol_val"
1788                 fi
1789         done
1790         if test "$ol_arg" = "invalid" ; then
1791                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1792         fi
1793         ol_enable_rlookups="$ol_arg"
1794
1795 else
1796         ol_enable_rlookups="no"
1797 fi
1798 # end --enable-rlookups
1799 # OpenLDAP --enable-slapi
1800         # Check whether --enable-slapi or --disable-slapi was given.
1801 if test "${enable_slapi+set}" = set; then
1802   enableval="$enable_slapi"
1803   
1804         ol_arg=invalid
1805         for ol_val in auto yes no ; do
1806                 if test "$enableval" = "$ol_val" ; then
1807                         ol_arg="$ol_val"
1808                 fi
1809         done
1810         if test "$ol_arg" = "invalid" ; then
1811                 { echo "configure: error: bad value $enableval for --enable-slapi" 1>&2; exit 1; }
1812         fi
1813         ol_enable_slapi="$ol_arg"
1814
1815 else
1816         ol_enable_slapi="no"
1817 fi
1818 # end --enable-slapi
1819 # OpenLDAP --enable-slp
1820         # Check whether --enable-slp or --disable-slp was given.
1821 if test "${enable_slp+set}" = set; then
1822   enableval="$enable_slp"
1823   
1824         ol_arg=invalid
1825         for ol_val in auto yes no ; do
1826                 if test "$enableval" = "$ol_val" ; then
1827                         ol_arg="$ol_val"
1828                 fi
1829         done
1830         if test "$ol_arg" = "invalid" ; then
1831                 { echo "configure: error: bad value $enableval for --enable-slp" 1>&2; exit 1; }
1832         fi
1833         ol_enable_slp="$ol_arg"
1834
1835 else
1836         ol_enable_slp="no"
1837 fi
1838 # end --enable-slp
1839 # OpenLDAP --enable-wrappers
1840         # Check whether --enable-wrappers or --disable-wrappers was given.
1841 if test "${enable_wrappers+set}" = set; then
1842   enableval="$enable_wrappers"
1843   
1844         ol_arg=invalid
1845         for ol_val in auto yes no ; do
1846                 if test "$enableval" = "$ol_val" ; then
1847                         ol_arg="$ol_val"
1848                 fi
1849         done
1850         if test "$ol_arg" = "invalid" ; then
1851                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1852         fi
1853         ol_enable_wrappers="$ol_arg"
1854
1855 else
1856         ol_enable_wrappers="no"
1857 fi
1858 # end --enable-wrappers
1859
1860 Backends="bdb dnssrv hdb ldap ldbm meta monitor null \
1861         passwd perl shell sql"
1862
1863 # Check whether --with-xxslapoverlays or --without-xxslapoverlays was given.
1864 if test "${with_xxslapoverlays+set}" = set; then
1865   withval="$with_xxslapoverlays"
1866   :
1867 fi
1868
1869
1870 # OpenLDAP --enable-bdb
1871         # Check whether --enable-bdb or --disable-bdb was given.
1872 if test "${enable_bdb+set}" = set; then
1873   enableval="$enable_bdb"
1874   
1875         ol_arg=invalid
1876         for ol_val in no yes mod ; do
1877                 if test "$enableval" = "$ol_val" ; then
1878                         ol_arg="$ol_val"
1879                 fi
1880         done
1881         if test "$ol_arg" = "invalid" ; then
1882                 { echo "configure: error: bad value $enableval for --enable-bdb" 1>&2; exit 1; }
1883         fi
1884         ol_enable_bdb="$ol_arg"
1885
1886 else
1887         ol_enable_bdb="yes"
1888 fi
1889 # end --enable-bdb
1890 # OpenLDAP --enable-dnssrv
1891         # Check whether --enable-dnssrv or --disable-dnssrv was given.
1892 if test "${enable_dnssrv+set}" = set; then
1893   enableval="$enable_dnssrv"
1894   
1895         ol_arg=invalid
1896         for ol_val in no yes mod ; do
1897                 if test "$enableval" = "$ol_val" ; then
1898                         ol_arg="$ol_val"
1899                 fi
1900         done
1901         if test "$ol_arg" = "invalid" ; then
1902                 { echo "configure: error: bad value $enableval for --enable-dnssrv" 1>&2; exit 1; }
1903         fi
1904         ol_enable_dnssrv="$ol_arg"
1905
1906 else
1907         ol_enable_dnssrv="no"
1908 fi
1909 # end --enable-dnssrv
1910 # OpenLDAP --enable-hdb
1911         # Check whether --enable-hdb or --disable-hdb was given.
1912 if test "${enable_hdb+set}" = set; then
1913   enableval="$enable_hdb"
1914   
1915         ol_arg=invalid
1916         for ol_val in no yes mod ; do
1917                 if test "$enableval" = "$ol_val" ; then
1918                         ol_arg="$ol_val"
1919                 fi
1920         done
1921         if test "$ol_arg" = "invalid" ; then
1922                 { echo "configure: error: bad value $enableval for --enable-hdb" 1>&2; exit 1; }
1923         fi
1924         ol_enable_hdb="$ol_arg"
1925
1926 else
1927         ol_enable_hdb="no"
1928 fi
1929 # end --enable-hdb
1930 # OpenLDAP --enable-ldap
1931         # Check whether --enable-ldap or --disable-ldap was given.
1932 if test "${enable_ldap+set}" = set; then
1933   enableval="$enable_ldap"
1934   
1935         ol_arg=invalid
1936         for ol_val in no yes mod ; do
1937                 if test "$enableval" = "$ol_val" ; then
1938                         ol_arg="$ol_val"
1939                 fi
1940         done
1941         if test "$ol_arg" = "invalid" ; then
1942                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1943         fi
1944         ol_enable_ldap="$ol_arg"
1945
1946 else
1947         ol_enable_ldap="no"
1948 fi
1949 # end --enable-ldap
1950 # OpenLDAP --enable-ldbm
1951         # Check whether --enable-ldbm or --disable-ldbm was given.
1952 if test "${enable_ldbm+set}" = set; then
1953   enableval="$enable_ldbm"
1954   
1955         ol_arg=invalid
1956         for ol_val in no yes mod ; do
1957                 if test "$enableval" = "$ol_val" ; then
1958                         ol_arg="$ol_val"
1959                 fi
1960         done
1961         if test "$ol_arg" = "invalid" ; then
1962                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1963         fi
1964         ol_enable_ldbm="$ol_arg"
1965
1966 else
1967         ol_enable_ldbm="no"
1968 fi
1969 # end --enable-ldbm
1970 # OpenLDAP --with-ldbm_api
1971         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1972 if test "${with_ldbm_api+set}" = set; then
1973   withval="$with_ldbm_api"
1974   
1975         ol_arg=invalid
1976         for ol_val in auto berkeley bcompat mdbm gdbm ; do
1977                 if test "$withval" = "$ol_val" ; then
1978                         ol_arg="$ol_val"
1979                 fi
1980         done
1981         if test "$ol_arg" = "invalid" ; then
1982                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1983         fi
1984         ol_with_ldbm_api="$ol_arg"
1985
1986 else
1987         ol_with_ldbm_api="auto"
1988 fi
1989 # end --with-ldbm_api
1990
1991 # OpenLDAP --with-ldbm_type
1992         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1993 if test "${with_ldbm_type+set}" = set; then
1994   withval="$with_ldbm_type"
1995   
1996         ol_arg=invalid
1997         for ol_val in auto btree hash ; do
1998                 if test "$withval" = "$ol_val" ; then
1999                         ol_arg="$ol_val"
2000                 fi
2001         done
2002         if test "$ol_arg" = "invalid" ; then
2003                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
2004         fi
2005         ol_with_ldbm_type="$ol_arg"
2006
2007 else
2008         ol_with_ldbm_type="auto"
2009 fi
2010 # end --with-ldbm_type
2011
2012 # OpenLDAP --enable-meta
2013         # Check whether --enable-meta or --disable-meta was given.
2014 if test "${enable_meta+set}" = set; then
2015   enableval="$enable_meta"
2016   
2017         ol_arg=invalid
2018         for ol_val in no yes mod ; do
2019                 if test "$enableval" = "$ol_val" ; then
2020                         ol_arg="$ol_val"
2021                 fi
2022         done
2023         if test "$ol_arg" = "invalid" ; then
2024                 { echo "configure: error: bad value $enableval for --enable-meta" 1>&2; exit 1; }
2025         fi
2026         ol_enable_meta="$ol_arg"
2027
2028 else
2029         ol_enable_meta="no"
2030 fi
2031 # end --enable-meta
2032 # OpenLDAP --enable-monitor
2033         # Check whether --enable-monitor or --disable-monitor was given.
2034 if test "${enable_monitor+set}" = set; then
2035   enableval="$enable_monitor"
2036   
2037         ol_arg=invalid
2038         for ol_val in no yes mod ; do
2039                 if test "$enableval" = "$ol_val" ; then
2040                         ol_arg="$ol_val"
2041                 fi
2042         done
2043         if test "$ol_arg" = "invalid" ; then
2044                 { echo "configure: error: bad value $enableval for --enable-monitor" 1>&2; exit 1; }
2045         fi
2046         ol_enable_monitor="$ol_arg"
2047
2048 else
2049         ol_enable_monitor="yes"
2050 fi
2051 # end --enable-monitor
2052 # OpenLDAP --enable-null
2053         # Check whether --enable-null or --disable-null was given.
2054 if test "${enable_null+set}" = set; then
2055   enableval="$enable_null"
2056   
2057         ol_arg=invalid
2058         for ol_val in no yes mod ; do
2059                 if test "$enableval" = "$ol_val" ; then
2060                         ol_arg="$ol_val"
2061                 fi
2062         done
2063         if test "$ol_arg" = "invalid" ; then
2064                 { echo "configure: error: bad value $enableval for --enable-null" 1>&2; exit 1; }
2065         fi
2066         ol_enable_null="$ol_arg"
2067
2068 else
2069         ol_enable_null="no"
2070 fi
2071 # end --enable-null
2072 # OpenLDAP --enable-passwd
2073         # Check whether --enable-passwd or --disable-passwd was given.
2074 if test "${enable_passwd+set}" = set; then
2075   enableval="$enable_passwd"
2076   
2077         ol_arg=invalid
2078         for ol_val in no yes mod ; do
2079                 if test "$enableval" = "$ol_val" ; then
2080                         ol_arg="$ol_val"
2081                 fi
2082         done
2083         if test "$ol_arg" = "invalid" ; then
2084                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
2085         fi
2086         ol_enable_passwd="$ol_arg"
2087
2088 else
2089         ol_enable_passwd="no"
2090 fi
2091 # end --enable-passwd
2092 # OpenLDAP --enable-perl
2093         # Check whether --enable-perl or --disable-perl was given.
2094 if test "${enable_perl+set}" = set; then
2095   enableval="$enable_perl"
2096   
2097         ol_arg=invalid
2098         for ol_val in no yes mod ; do
2099                 if test "$enableval" = "$ol_val" ; then
2100                         ol_arg="$ol_val"
2101                 fi
2102         done
2103         if test "$ol_arg" = "invalid" ; then
2104                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
2105         fi
2106         ol_enable_perl="$ol_arg"
2107
2108 else
2109         ol_enable_perl="no"
2110 fi
2111 # end --enable-perl
2112 # OpenLDAP --enable-shell
2113         # Check whether --enable-shell or --disable-shell was given.
2114 if test "${enable_shell+set}" = set; then
2115   enableval="$enable_shell"
2116   
2117         ol_arg=invalid
2118         for ol_val in no yes mod ; do
2119                 if test "$enableval" = "$ol_val" ; then
2120                         ol_arg="$ol_val"
2121                 fi
2122         done
2123         if test "$ol_arg" = "invalid" ; then
2124                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
2125         fi
2126         ol_enable_shell="$ol_arg"
2127
2128 else
2129         ol_enable_shell="no"
2130 fi
2131 # end --enable-shell
2132 # OpenLDAP --enable-sql
2133         # Check whether --enable-sql or --disable-sql was given.
2134 if test "${enable_sql+set}" = set; then
2135   enableval="$enable_sql"
2136   
2137         ol_arg=invalid
2138         for ol_val in no yes mod ; do
2139                 if test "$enableval" = "$ol_val" ; then
2140                         ol_arg="$ol_val"
2141                 fi
2142         done
2143         if test "$ol_arg" = "invalid" ; then
2144                 { echo "configure: error: bad value $enableval for --enable-sql" 1>&2; exit 1; }
2145         fi
2146         ol_enable_sql="$ol_arg"
2147
2148 else
2149         ol_enable_sql="no"
2150 fi
2151 # end --enable-sql
2152
2153 Overlays="dyngroup proxycache"
2154
2155 # Check whether --with-xxslapoverlays or --without-xxslapoverlays was given.
2156 if test "${with_xxslapoverlays+set}" = set; then
2157   withval="$with_xxslapoverlays"
2158   :
2159 fi
2160
2161
2162 # OpenLDAP --enable-dyngroup
2163         # Check whether --enable-dyngroup or --disable-dyngroup was given.
2164 if test "${enable_dyngroup+set}" = set; then
2165   enableval="$enable_dyngroup"
2166   
2167         ol_arg=invalid
2168         for ol_val in no yes mod ; do
2169                 if test "$enableval" = "$ol_val" ; then
2170                         ol_arg="$ol_val"
2171                 fi
2172         done
2173         if test "$ol_arg" = "invalid" ; then
2174                 { echo "configure: error: bad value $enableval for --enable-dyngroup" 1>&2; exit 1; }
2175         fi
2176         ol_enable_dyngroup="$ol_arg"
2177
2178 else
2179         ol_enable_dyngroup="no"
2180 fi
2181 # end --enable-dyngroup
2182
2183 # OpenLDAP --enable-proxycache
2184         # Check whether --enable-proxycache or --disable-proxycache was given.
2185 if test "${enable_proxycache+set}" = set; then
2186   enableval="$enable_proxycache"
2187   
2188         ol_arg=invalid
2189         for ol_val in no yes mod ; do
2190                 if test "$enableval" = "$ol_val" ; then
2191                         ol_arg="$ol_val"
2192                 fi
2193         done
2194         if test "$ol_arg" = "invalid" ; then
2195                 { echo "configure: error: bad value $enableval for --enable-proxycache" 1>&2; exit 1; }
2196         fi
2197         ol_enable_proxycache="$ol_arg"
2198
2199 else
2200         ol_enable_proxycache="no"
2201 fi
2202 # end --enable-proxycache
2203
2204
2205 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2206 if test "${with_xxslurpdoptions+set}" = set; then
2207   withval="$with_xxslurpdoptions"
2208   :
2209 fi
2210
2211 # OpenLDAP --enable-slurpd
2212         # Check whether --enable-slurpd or --disable-slurpd was given.
2213 if test "${enable_slurpd+set}" = set; then
2214   enableval="$enable_slurpd"
2215   
2216         ol_arg=invalid
2217         for ol_val in auto yes no ; do
2218                 if test "$enableval" = "$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 $enableval for --enable-slurpd" 1>&2; exit 1; }
2224         fi
2225         ol_enable_slurpd="$ol_arg"
2226
2227 else
2228         ol_enable_slurpd="auto"
2229 fi
2230 # end --enable-slurpd
2231
2232 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2233 if test "${with_xxliboptions+set}" = set; then
2234   withval="$with_xxliboptions"
2235   :
2236 fi
2237
2238 # Check whether --enable-static or --disable-static was given.
2239 if test "${enable_static+set}" = set; then
2240   enableval="$enable_static"
2241   p=${PACKAGE-default}
2242 case $enableval in
2243 yes) enable_static=yes ;;
2244 no) enable_static=no ;;
2245 *)
2246   enable_static=no
2247   # Look at the argument we got.  We use all the common list separators.
2248   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2249   for pkg in $enableval; do
2250     if test "X$pkg" = "X$p"; then
2251       enable_static=yes
2252     fi
2253   done
2254   IFS="$ac_save_ifs"
2255   ;;
2256 esac
2257 else
2258   enable_static=yes
2259 fi
2260
2261 # Check whether --enable-shared or --disable-shared was given.
2262 if test "${enable_shared+set}" = set; then
2263   enableval="$enable_shared"
2264   p=${PACKAGE-default}
2265 case $enableval in
2266 yes) enable_shared=yes ;;
2267 no) enable_shared=no ;;
2268 *)
2269   enable_shared=no
2270   # Look at the argument we got.  We use all the common list separators.
2271   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2272   for pkg in $enableval; do
2273     if test "X$pkg" = "X$p"; then
2274       enable_shared=yes
2275     fi
2276   done
2277   IFS="$ac_save_ifs"
2278   ;;
2279 esac
2280 else
2281   enable_shared=yes
2282 fi
2283
2284
2285
2286 # validate options
2287 if test $ol_enable_slapd = no ; then
2288                 if test $ol_enable_slapi = yes ; then
2289                 echo "configure: warning: slapd disabled, ignoring --enable-slapi argument" 1>&2
2290         fi
2291         for i in $Backends; do
2292                 eval "ol_tmp=\$ol_enable_$i"
2293                 if test $ol_tmp != no ; then
2294                         echo "configure: warning: slapd disabled, ignoring --enable-$i argument" 1>&2
2295                         eval "ol_enable_$i=no"
2296                 fi
2297         done
2298         if test $ol_enable_modules = yes ; then
2299                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2300         fi
2301         if test $ol_enable_multimaster = yes ; then
2302                 echo "configure: warning: slapd disabled, ignoring --enable-multimaster argument" 1>&2
2303         fi
2304         if test $ol_enable_wrappers = yes ; then
2305                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2306         fi
2307         if test $ol_enable_rlookups = yes ; then
2308                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2309         fi
2310         if test $ol_enable_aci = yes ; then
2311                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2312         fi
2313         if test $ol_with_ldbm_api != auto ; then
2314                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2315         fi
2316         if test $ol_with_ldbm_type != auto ; then
2317                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2318         fi
2319         if test $ol_enable_slurpd = yes ; then
2320                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2321         fi
2322         if test $ol_enable_rewrite = yes ; then
2323                 echo "configure: warning: slapd disabled, ignoring --enable-rewrite argument" 1>&2
2324         fi
2325                 for i in $Overlays; do
2326                 eval "ol_tmp=\$ol_enable_$i"
2327                 if test $ol_tmp != no ; then
2328                         echo "configure: warning: slapd disabled, ignoring --enable-$i argument" 1>&2
2329                         eval "ol_enable_$i=no"
2330                 fi
2331         done
2332
2333         # force settings to no
2334         ol_enable_slapi=no
2335
2336         ol_enable_modules=no
2337         ol_enable_multimaster=no
2338         ol_enable_rlookups=no
2339         ol_enable_aci=no
2340         ol_enable_wrappers=no
2341
2342         ol_with_ldbm_api=no
2343         ol_with_ldbm_type=no
2344
2345         ol_enable_slurpd=no
2346
2347         ol_enable_rewrite=no
2348
2349 elif test $ol_enable_ldbm = no ; then
2350         
2351         if test $ol_with_ldbm_api != auto ; then
2352                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2353         fi
2354
2355         if test $ol_with_ldbm_type != auto ; then
2356                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2357         fi
2358
2359         if test $ol_enable_modules != yes -a \
2360                 $ol_enable_bdb = no -a \
2361                 $ol_enable_dnssrv = no -a \
2362                 $ol_enable_hdb = no -a \
2363                 $ol_enable_ldap = no -a \
2364                 $ol_enable_meta = no -a \
2365                 $ol_enable_monitor = no -a \
2366                 $ol_enable_null = no -a \
2367                 $ol_enable_passwd = no -a \
2368                 $ol_enable_perl = no -a \
2369                 $ol_enable_shell = no -a \
2370                 $ol_enable_sql = no ; then
2371
2372                 if test $ol_enable_slapd = yes ; then
2373                         { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2374                 else
2375                         echo "configure: warning: skipping slapd, no backend specified" 1>&2
2376                         ol_enable_slapd=no
2377                 fi
2378         fi
2379
2380         ol_with_ldbm_api=no
2381         ol_with_ldbm_type=no
2382
2383         if test $ol_enable_bdb != no -o $ol_enable_hdb != no; then
2384                 ol_with_ldbm_api=berkeley
2385         fi
2386
2387 else
2388                 if test $ol_with_ldbm_api = gdbm -a \
2389                 $ol_with_ldbm_type = btree ; then
2390                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2391         fi
2392         if test $ol_with_ldbm_api = mdbm -a \
2393                 $ol_with_ldbm_type = btree ; then
2394                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2395         fi
2396         if test $ol_with_ldbm_api = ndbm -a \
2397                 $ol_with_ldbm_type = btree ; then
2398                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2399         fi
2400
2401         if test $ol_enable_bdb != no -o $ol_enable_hdb != no ; then
2402                 if test $ol_with_ldbm_api = auto ; then
2403                         ol_with_ldbm_api=berkeley
2404                 elif test $ol_with_ldbm_api != berkeley ; then
2405                         { echo "configure: error: LDBM API not compatible with BDB/HDB" 1>&2; exit 1; }
2406                 fi
2407         fi
2408 fi
2409
2410 if test $ol_enable_meta = yes -a $ol_enable_ldap = no ; then
2411         { echo "configure: error: --enable-meta requires --enable-ldap" 1>&2; exit 1; }
2412 fi
2413
2414 if test $ol_enable_slurpd = yes ; then
2415                 if test $ol_with_threads = no ; then
2416                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2417         fi
2418 fi
2419
2420 if test $ol_enable_lmpasswd = yes ; then
2421         if test $ol_with_tls = no ; then
2422                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
2423         fi
2424 fi
2425
2426 if test $ol_enable_kbind = yes ; then
2427         if test $ol_with_kerberos = no ; then
2428                 { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
2429         elif test $ol_with_kerberos = auto ; then
2430                 ol_with_kerberos=yes
2431         fi
2432
2433 elif test $ol_enable_kbind = no ; then
2434         if test $ol_with_kerberos = auto ; then
2435                 ol_with_kerberos=no
2436         elif test $ol_with_kerberos != no ; then
2437                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2438                 ol_with_kerberos=no
2439         fi
2440 fi
2441
2442 if test $ol_enable_spasswd = yes ; then
2443         if test $ol_with_cyrus_sasl = no ; then
2444                 { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
2445         fi
2446         ol_with_cyrus_sasl=yes
2447 fi
2448
2449 echo "$ac_t""done" 1>&6
2450
2451 LDAP_LIBS=
2452 LDBM_LIBS=
2453 LTHREAD_LIBS=
2454 LUTIL_LIBS=
2455
2456 SLAPD_LIBS=
2457 SLURPD_LIBS=
2458
2459 BUILD_SLAPD=no
2460 BUILD_SLURPD=no
2461
2462 BUILD_THREAD=no
2463
2464 BUILD_SLAPI=no
2465 SLAPD_SLAPI_DEPEND=
2466
2467 BUILD_BDB=no
2468 BUILD_DNSSRV=no
2469 BUILD_HDB=no
2470 BUILD_LDAP=no
2471 BUILD_LDBM=no
2472 BUILD_META=no
2473 BUILD_MONITOR=no
2474 BUILD_NULL=no
2475 BUILD_PASSWD=no
2476 BUILD_PERL=no
2477 BUILD_SHELL=no
2478 BUILD_SQL=no
2479
2480 BUILD_DYNGROUP=no
2481 BUILD_PROXYCACHE=no
2482
2483 SLAPD_DYNAMIC_OVERLAYS=
2484
2485 SLAPD_MODULES_LDFLAGS=
2486 SLAPD_MODULES_CPPFLAGS=
2487
2488 SLAPD_STATIC_BACKENDS=
2489 SLAPD_DYNAMIC_BACKENDS=
2490
2491 SLAPD_PERL_LDFLAGS=
2492 MOD_PERL_LDFLAGS=
2493 PERL_CPPFLAGS=
2494
2495 SLAPD_SQL_LDFLAGS=
2496 SLAPD_SQL_LIBS=
2497 SLAPD_SQL_INCLUDES=
2498
2499 KRB4_LIBS=
2500 KRB5_LIBS=
2501 SASL_LIBS=
2502 TLS_LIBS=
2503 MODULES_LIBS=
2504 SLAPI_LIBS=
2505 LIBSLAPI=
2506 LIBSLAPITOOLS=
2507 AUTH_LIBS=
2508
2509 SLAPD_SLP_LIBS=
2510
2511
2512 # Find a good install program.  We prefer a C program (faster),
2513 # so one script is as good as another.  But avoid the broken or
2514 # incompatible versions:
2515 # SysV /etc/install, /usr/sbin/install
2516 # SunOS /usr/etc/install
2517 # IRIX /sbin/install
2518 # AIX /bin/install
2519 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2520 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2521 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2522 # ./install, which can be erroneously created by make from ./install.sh.
2523 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
2524 echo "configure:2525: checking for a BSD compatible install" >&5
2525 if test -z "$INSTALL"; then
2526 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
2527   echo $ac_n "(cached) $ac_c" 1>&6
2528 else
2529     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
2530   for ac_dir in $PATH; do
2531     # Account for people who put trailing slashes in PATH elements.
2532     case "$ac_dir/" in
2533     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
2534     *)
2535       # OSF1 and SCO ODT 3.0 have their own names for install.
2536       # Don't use installbsd from OSF since it installs stuff as root
2537       # by default.
2538       for ac_prog in ginstall scoinst install; do
2539         if test -f $ac_dir/$ac_prog; then
2540           if test $ac_prog = install &&
2541             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
2542             # AIX install.  It has an incompatible calling convention.
2543             :
2544           elif test $ac_prog = install &&
2545             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
2546             # program-specific install script used by HP pwplus--don't use.
2547             :
2548           else
2549             ac_cv_path_install="$ac_dir/$ac_prog -c"
2550             break 2
2551           fi
2552         fi
2553       done
2554       ;;
2555     esac
2556   done
2557   IFS="$ac_save_IFS"
2558
2559 fi
2560   if test "${ac_cv_path_install+set}" = set; then
2561     INSTALL="$ac_cv_path_install"
2562   else
2563     # As a last resort, use the slow shell script.  We don't cache a
2564     # path for INSTALL within a source directory, because that will
2565     # break other packages using the cache if that directory is
2566     # removed, or if the path is relative.
2567     INSTALL="$ac_install_sh"
2568   fi
2569 fi
2570 echo "$ac_t""$INSTALL" 1>&6
2571
2572 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2573 # It thinks the first close brace ends the variable substitution.
2574 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2575
2576 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2577
2578 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2579
2580
2581 cat >> confdefs.h <<\EOF
2582 #define HAVE_MKVERSION 1
2583 EOF
2584
2585
2586
2587
2588 ol_aix_threads=no
2589 case "$target" in
2590 *-*-aix*)       if test -z "$CC" ; then
2591                 case "$ol_with_threads" in
2592                 auto | yes |  posix) ol_aix_threads=yes ;;
2593                 esac
2594         fi
2595 ;;
2596 esac
2597
2598 if test $ol_aix_threads = yes ; then
2599         if test -z "${CC}" ; then
2600                 for ac_prog in cc_r xlc_r cc
2601 do
2602 # Extract the first word of "$ac_prog", so it can be a program name with args.
2603 set dummy $ac_prog; ac_word=$2
2604 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2605 echo "configure:2606: checking for $ac_word" >&5
2606 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2607   echo $ac_n "(cached) $ac_c" 1>&6
2608 else
2609   if test -n "$CC"; then
2610   ac_cv_prog_CC="$CC" # Let the user override the test.
2611 else
2612   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2613   ac_dummy="$PATH"
2614   for ac_dir in $ac_dummy; do
2615     test -z "$ac_dir" && ac_dir=.
2616     if test -f $ac_dir/$ac_word; then
2617       ac_cv_prog_CC="$ac_prog"
2618       break
2619     fi
2620   done
2621   IFS="$ac_save_ifs"
2622 fi
2623 fi
2624 CC="$ac_cv_prog_CC"
2625 if test -n "$CC"; then
2626   echo "$ac_t""$CC" 1>&6
2627 else
2628   echo "$ac_t""no" 1>&6
2629 fi
2630
2631 test -n "$CC" && break
2632 done
2633
2634
2635                 if test "$CC" = cc ; then
2636                                                 if test $ol_with_threads != auto ; then
2637                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2638                         else
2639                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2640                         fi
2641                         ol_with_threads=no
2642                 fi
2643         fi
2644
2645         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2646                 ol_with_threads=posix
2647                 ol_cv_pthread_create=yes
2648         fi
2649 fi
2650
2651 if test -z "${CC}"; then
2652         for ac_prog in cc gcc
2653 do
2654 # Extract the first word of "$ac_prog", so it can be a program name with args.
2655 set dummy $ac_prog; ac_word=$2
2656 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2657 echo "configure:2658: checking for $ac_word" >&5
2658 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2659   echo $ac_n "(cached) $ac_c" 1>&6
2660 else
2661   if test -n "$CC"; then
2662   ac_cv_prog_CC="$CC" # Let the user override the test.
2663 else
2664   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2665   ac_dummy="$PATH"
2666   for ac_dir in $ac_dummy; do
2667     test -z "$ac_dir" && ac_dir=.
2668     if test -f $ac_dir/$ac_word; then
2669       ac_cv_prog_CC="$ac_prog"
2670       break
2671     fi
2672   done
2673   IFS="$ac_save_ifs"
2674 fi
2675 fi
2676 CC="$ac_cv_prog_CC"
2677 if test -n "$CC"; then
2678   echo "$ac_t""$CC" 1>&6
2679 else
2680   echo "$ac_t""no" 1>&6
2681 fi
2682
2683 test -n "$CC" && break
2684 done
2685 test -n "$CC" || CC="missing"
2686
2687
2688         if test "${CC}" = "missing" ; then
2689                 { echo "configure: error: Unable to locate cc(1) or suitable replacement.  Check PATH or set CC." 1>&2; exit 1; }
2690         fi
2691 fi
2692
2693 if test -z "${AR}"; then
2694         for ac_prog in ar gar
2695 do
2696 # Extract the first word of "$ac_prog", so it can be a program name with args.
2697 set dummy $ac_prog; ac_word=$2
2698 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2699 echo "configure:2700: checking for $ac_word" >&5
2700 if eval "test \"\${ac_cv_prog_AR+set}\" = set"; then
2701   echo $ac_n "(cached) $ac_c" 1>&6
2702 else
2703   if test -n "$AR"; then
2704   ac_cv_prog_AR="$AR" # Let the user override the test.
2705 else
2706   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2707   ac_dummy="$PATH"
2708   for ac_dir in $ac_dummy; do
2709     test -z "$ac_dir" && ac_dir=.
2710     if test -f $ac_dir/$ac_word; then
2711       ac_cv_prog_AR="$ac_prog"
2712       break
2713     fi
2714   done
2715   IFS="$ac_save_ifs"
2716 fi
2717 fi
2718 AR="$ac_cv_prog_AR"
2719 if test -n "$AR"; then
2720   echo "$ac_t""$AR" 1>&6
2721 else
2722   echo "$ac_t""no" 1>&6
2723 fi
2724
2725 test -n "$AR" && break
2726 done
2727 test -n "$AR" || AR="missing"
2728
2729
2730         if test "${AR}" = "missing" ; then
2731                 { echo "configure: error: Unable to locate ar(1) or suitable replacement.  Check PATH or set AR." 1>&2; exit 1; }
2732         fi
2733 fi
2734
2735
2736
2737 # Find the correct PATH separator.  Usually this is `:', but
2738 # DJGPP uses `;' like DOS.
2739 if test "X${PATH_SEPARATOR+set}" != Xset; then
2740   UNAME=${UNAME-`uname 2>/dev/null`}
2741   case X$UNAME in
2742     *-DOS) lt_cv_sys_path_separator=';' ;;
2743     *)     lt_cv_sys_path_separator=':' ;;
2744   esac
2745   PATH_SEPARATOR=$lt_cv_sys_path_separator
2746 fi
2747
2748 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
2749 echo "configure:2750: checking for Cygwin environment" >&5
2750 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
2751   echo $ac_n "(cached) $ac_c" 1>&6
2752 else
2753   cat > conftest.$ac_ext <<EOF
2754 #line 2755 "configure"
2755 #include "confdefs.h"
2756
2757 int main() {
2758
2759 #ifndef __CYGWIN__
2760 #define __CYGWIN__ __CYGWIN32__
2761 #endif
2762 return __CYGWIN__;
2763 ; return 0; }
2764 EOF
2765 if { (eval echo configure:2766: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2766   rm -rf conftest*
2767   ac_cv_cygwin=yes
2768 else
2769   echo "configure: failed program was:" >&5
2770   cat conftest.$ac_ext >&5
2771   rm -rf conftest*
2772   ac_cv_cygwin=no
2773 fi
2774 rm -f conftest*
2775 fi
2776
2777 echo "$ac_t""$ac_cv_cygwin" 1>&6
2778 CYGWIN=
2779 test "$ac_cv_cygwin" = yes && CYGWIN=yes
2780 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
2781 echo "configure:2782: checking for mingw32 environment" >&5
2782 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
2783   echo $ac_n "(cached) $ac_c" 1>&6
2784 else
2785   cat > conftest.$ac_ext <<EOF
2786 #line 2787 "configure"
2787 #include "confdefs.h"
2788
2789 int main() {
2790 return __MINGW32__;
2791 ; return 0; }
2792 EOF
2793 if { (eval echo configure:2794: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2794   rm -rf conftest*
2795   ac_cv_mingw32=yes
2796 else
2797   echo "configure: failed program was:" >&5
2798   cat conftest.$ac_ext >&5
2799   rm -rf conftest*
2800   ac_cv_mingw32=no
2801 fi
2802 rm -f conftest*
2803 fi
2804
2805 echo "$ac_t""$ac_cv_mingw32" 1>&6
2806 MINGW32=
2807 test "$ac_cv_mingw32" = yes && MINGW32=yes
2808 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
2809 echo "configure:2810: checking for EMX OS/2 environment" >&5
2810 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
2811   echo $ac_n "(cached) $ac_c" 1>&6
2812 else
2813   cat > conftest.$ac_ext <<EOF
2814 #line 2815 "configure"
2815 #include "confdefs.h"
2816
2817 int main() {
2818 return __EMX__;
2819 ; return 0; }
2820 EOF
2821 if { (eval echo configure:2822: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2822   rm -rf conftest*
2823   ac_cv_emxos2=yes
2824 else
2825   echo "configure: failed program was:" >&5
2826   cat conftest.$ac_ext >&5
2827   rm -rf conftest*
2828   ac_cv_emxos2=no
2829 fi
2830 rm -f conftest*
2831 fi
2832
2833 echo "$ac_t""$ac_cv_emxos2" 1>&6
2834 EMXOS2=
2835 test "$ac_cv_emxos2" = yes && EMXOS2=yes
2836 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2837 echo "configure:2838: checking how to run the C preprocessor" >&5
2838 # On Suns, sometimes $CPP names a directory.
2839 if test -n "$CPP" && test -d "$CPP"; then
2840   CPP=
2841 fi
2842 if test -z "$CPP"; then
2843 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
2844   echo $ac_n "(cached) $ac_c" 1>&6
2845 else
2846     # This must be in double quotes, not single quotes, because CPP may get
2847   # substituted into the Makefile and "${CC-cc}" will confuse make.
2848   CPP="${CC-cc} -E"
2849   # On the NeXT, cc -E runs the code through the compiler's parser,
2850   # not just through cpp.
2851   cat > conftest.$ac_ext <<EOF
2852 #line 2853 "configure"
2853 #include "confdefs.h"
2854 #include <assert.h>
2855 Syntax Error
2856 EOF
2857 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2858 { (eval echo configure:2859: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2859 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2860 if test -z "$ac_err"; then
2861   :
2862 else
2863   echo "$ac_err" >&5
2864   echo "configure: failed program was:" >&5
2865   cat conftest.$ac_ext >&5
2866   rm -rf conftest*
2867   CPP="${CC-cc} -E -traditional-cpp"
2868   cat > conftest.$ac_ext <<EOF
2869 #line 2870 "configure"
2870 #include "confdefs.h"
2871 #include <assert.h>
2872 Syntax Error
2873 EOF
2874 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2875 { (eval echo configure:2876: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2876 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2877 if test -z "$ac_err"; then
2878   :
2879 else
2880   echo "$ac_err" >&5
2881   echo "configure: failed program was:" >&5
2882   cat conftest.$ac_ext >&5
2883   rm -rf conftest*
2884   CPP="${CC-cc} -nologo -E"
2885   cat > conftest.$ac_ext <<EOF
2886 #line 2887 "configure"
2887 #include "confdefs.h"
2888 #include <assert.h>
2889 Syntax Error
2890 EOF
2891 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2892 { (eval echo configure:2893: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2893 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2894 if test -z "$ac_err"; then
2895   :
2896 else
2897   echo "$ac_err" >&5
2898   echo "configure: failed program was:" >&5
2899   cat conftest.$ac_ext >&5
2900   rm -rf conftest*
2901   CPP=/lib/cpp
2902 fi
2903 rm -f conftest*
2904 fi
2905 rm -f conftest*
2906 fi
2907 rm -f conftest*
2908   ac_cv_prog_CPP="$CPP"
2909 fi
2910   CPP="$ac_cv_prog_CPP"
2911 else
2912   ac_cv_prog_CPP="$CPP"
2913 fi
2914 echo "$ac_t""$CPP" 1>&6
2915
2916 # Check whether --enable-fast-install or --disable-fast-install was given.
2917 if test "${enable_fast_install+set}" = set; then
2918   enableval="$enable_fast_install"
2919   p=${PACKAGE-default}
2920 case $enableval in
2921 yes) enable_fast_install=yes ;;
2922 no) enable_fast_install=no ;;
2923 *)
2924   enable_fast_install=no
2925   # Look at the argument we got.  We use all the common list separators.
2926   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2927   for pkg in $enableval; do
2928     if test "X$pkg" = "X$p"; then
2929       enable_fast_install=yes
2930     fi
2931   done
2932   IFS="$ac_save_ifs"
2933   ;;
2934 esac
2935 else
2936   enable_fast_install=yes
2937 fi
2938
2939 # Extract the first word of "gcc", so it can be a program name with args.
2940 set dummy gcc; ac_word=$2
2941 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2942 echo "configure:2943: checking for $ac_word" >&5
2943 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2944   echo $ac_n "(cached) $ac_c" 1>&6
2945 else
2946   if test -n "$CC"; then
2947   ac_cv_prog_CC="$CC" # Let the user override the test.
2948 else
2949   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2950   ac_dummy="$PATH"
2951   for ac_dir in $ac_dummy; do
2952     test -z "$ac_dir" && ac_dir=.
2953     if test -f $ac_dir/$ac_word; then
2954       ac_cv_prog_CC="gcc"
2955       break
2956     fi
2957   done
2958   IFS="$ac_save_ifs"
2959 fi
2960 fi
2961 CC="$ac_cv_prog_CC"
2962 if test -n "$CC"; then
2963   echo "$ac_t""$CC" 1>&6
2964 else
2965   echo "$ac_t""no" 1>&6
2966 fi
2967
2968 if test -z "$CC"; then
2969   # Extract the first word of "cc", so it can be a program name with args.
2970 set dummy cc; ac_word=$2
2971 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2972 echo "configure:2973: checking for $ac_word" >&5
2973 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2974   echo $ac_n "(cached) $ac_c" 1>&6
2975 else
2976   if test -n "$CC"; then
2977   ac_cv_prog_CC="$CC" # Let the user override the test.
2978 else
2979   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2980   ac_prog_rejected=no
2981   ac_dummy="$PATH"
2982   for ac_dir in $ac_dummy; do
2983     test -z "$ac_dir" && ac_dir=.
2984     if test -f $ac_dir/$ac_word; then
2985       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2986         ac_prog_rejected=yes
2987         continue
2988       fi
2989       ac_cv_prog_CC="cc"
2990       break
2991     fi
2992   done
2993   IFS="$ac_save_ifs"
2994 if test $ac_prog_rejected = yes; then
2995   # We found a bogon in the path, so make sure we never use it.
2996   set dummy $ac_cv_prog_CC
2997   shift
2998   if test $# -gt 0; then
2999     # We chose a different compiler from the bogus one.
3000     # However, it has the same basename, so the bogon will be chosen
3001     # first if we set CC to just the basename; use the full file name.
3002     shift
3003     set dummy "$ac_dir/$ac_word" "$@"
3004     shift
3005     ac_cv_prog_CC="$@"
3006   fi
3007 fi
3008 fi
3009 fi
3010 CC="$ac_cv_prog_CC"
3011 if test -n "$CC"; then
3012   echo "$ac_t""$CC" 1>&6
3013 else
3014   echo "$ac_t""no" 1>&6
3015 fi
3016
3017   if test -z "$CC"; then
3018     case "`uname -s`" in
3019     *win32* | *WIN32* | *CYGWIN*)
3020       # Extract the first word of "cl", so it can be a program name with args.
3021 set dummy cl; ac_word=$2
3022 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3023 echo "configure:3024: checking for $ac_word" >&5
3024 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3025   echo $ac_n "(cached) $ac_c" 1>&6
3026 else
3027   if test -n "$CC"; then
3028   ac_cv_prog_CC="$CC" # Let the user override the test.
3029 else
3030   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3031   ac_dummy="$PATH"
3032   for ac_dir in $ac_dummy; do
3033     test -z "$ac_dir" && ac_dir=.
3034     if test -f $ac_dir/$ac_word; then
3035       ac_cv_prog_CC="cl"
3036       break
3037     fi
3038   done
3039   IFS="$ac_save_ifs"
3040 fi
3041 fi
3042 CC="$ac_cv_prog_CC"
3043 if test -n "$CC"; then
3044   echo "$ac_t""$CC" 1>&6
3045 else
3046   echo "$ac_t""no" 1>&6
3047 fi
3048  ;;
3049     esac
3050   fi
3051   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
3052 fi
3053
3054 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
3055 echo "configure:3056: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
3056
3057 ac_ext=c
3058 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3059 ac_cpp='$CPP $CPPFLAGS'
3060 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3061 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3062 cross_compiling=$ac_cv_prog_cc_cross
3063
3064 cat > conftest.$ac_ext << EOF
3065
3066 #line 3067 "configure"
3067 #include "confdefs.h"
3068
3069 main(){return(0);}
3070 EOF
3071 if { (eval echo configure:3072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3072   ac_cv_prog_cc_works=yes
3073   # If we can't run a trivial program, we are probably using a cross compiler.
3074   if (./conftest; exit) 2>/dev/null; then
3075     ac_cv_prog_cc_cross=no
3076   else
3077     ac_cv_prog_cc_cross=yes
3078   fi
3079 else
3080   echo "configure: failed program was:" >&5
3081   cat conftest.$ac_ext >&5
3082   ac_cv_prog_cc_works=no
3083 fi
3084 rm -fr conftest*
3085 ac_ext=c
3086 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3087 ac_cpp='$CPP $CPPFLAGS'
3088 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3089 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3090 cross_compiling=$ac_cv_prog_cc_cross
3091
3092 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
3093 if test $ac_cv_prog_cc_works = no; then
3094   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
3095 fi
3096 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
3097 echo "configure:3098: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
3098 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
3099 cross_compiling=$ac_cv_prog_cc_cross
3100
3101 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
3102 echo "configure:3103: checking whether we are using GNU C" >&5
3103 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
3104   echo $ac_n "(cached) $ac_c" 1>&6
3105 else
3106   cat > conftest.c <<EOF
3107 #ifdef __GNUC__
3108   yes;
3109 #endif
3110 EOF
3111 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3112: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
3112   ac_cv_prog_gcc=yes
3113 else
3114   ac_cv_prog_gcc=no
3115 fi
3116 fi
3117
3118 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
3119
3120 if test $ac_cv_prog_gcc = yes; then
3121   GCC=yes
3122 else
3123   GCC=
3124 fi
3125
3126 ac_test_CFLAGS="${CFLAGS+set}"
3127 ac_save_CFLAGS="$CFLAGS"
3128 CFLAGS=
3129 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
3130 echo "configure:3131: checking whether ${CC-cc} accepts -g" >&5
3131 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
3132   echo $ac_n "(cached) $ac_c" 1>&6
3133 else
3134   echo 'void f(){}' > conftest.c
3135 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
3136   ac_cv_prog_cc_g=yes
3137 else
3138   ac_cv_prog_cc_g=no
3139 fi
3140 rm -f conftest*
3141
3142 fi
3143
3144 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
3145 if test "$ac_test_CFLAGS" = set; then
3146   CFLAGS="$ac_save_CFLAGS"
3147 elif test $ac_cv_prog_cc_g = yes; then
3148   if test "$GCC" = yes; then
3149     CFLAGS="-g -O2"
3150   else
3151     CFLAGS="-g"
3152   fi
3153 else
3154   if test "$GCC" = yes; then
3155     CFLAGS="-O2"
3156   else
3157     CFLAGS=
3158   fi
3159 fi
3160
3161 # Check whether --with-gnu-ld or --without-gnu-ld was given.
3162 if test "${with_gnu_ld+set}" = set; then
3163   withval="$with_gnu_ld"
3164   test "$withval" = no || with_gnu_ld=yes
3165 else
3166   with_gnu_ld=no
3167 fi
3168
3169 ac_prog=ld
3170 if test "$GCC" = yes; then
3171   # Check if gcc -print-prog-name=ld gives a path.
3172   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
3173 echo "configure:3174: checking for ld used by GCC" >&5
3174   case $host in
3175   *-*-mingw*)
3176     # gcc leaves a trailing carriage return which upsets mingw
3177     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3178   *)
3179     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3180   esac
3181   case $ac_prog in
3182     # Accept absolute paths.
3183     [\\/]* | [A-Za-z]:[\\/]*)
3184       re_direlt='/[^/][^/]*/\.\./'
3185       # Canonicalize the path of ld
3186       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3187       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3188         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3189       done
3190       test -z "$LD" && LD="$ac_prog"
3191       ;;
3192   "")
3193     # If it fails, then pretend we aren't using GCC.
3194     ac_prog=ld
3195     ;;
3196   *)
3197     # If it is relative, then search for the first ld in PATH.
3198     with_gnu_ld=unknown
3199     ;;
3200   esac
3201 elif test "$with_gnu_ld" = yes; then
3202   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
3203 echo "configure:3204: checking for GNU ld" >&5
3204 else
3205   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
3206 echo "configure:3207: checking for non-GNU ld" >&5
3207 fi
3208 if eval "test \"\${lt_cv_path_LD+set}\" = set"; then
3209   echo $ac_n "(cached) $ac_c" 1>&6
3210 else
3211   if test -z "$LD"; then
3212   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3213   for ac_dir in $PATH; do
3214     test -z "$ac_dir" && ac_dir=.
3215     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3216       lt_cv_path_LD="$ac_dir/$ac_prog"
3217       # Check to see if the program is GNU ld.  I'd rather use --version,
3218       # but apparently some GNU ld's only accept -v.
3219       # Break only if it was the GNU/non-GNU ld that we prefer.
3220       if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3221         test "$with_gnu_ld" != no && break
3222       else
3223         test "$with_gnu_ld" != yes && break
3224       fi
3225     fi
3226   done
3227   IFS="$ac_save_ifs"
3228 else
3229   lt_cv_path_LD="$LD" # Let the user override the test with a path.
3230 fi
3231 fi
3232
3233 LD="$lt_cv_path_LD"
3234 if test -n "$LD"; then
3235   echo "$ac_t""$LD" 1>&6
3236 else
3237   echo "$ac_t""no" 1>&6
3238 fi
3239 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
3240 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
3241 echo "configure:3242: checking if the linker ($LD) is GNU ld" >&5
3242 if eval "test \"\${lt_cv_prog_gnu_ld+set}\" = set"; then
3243   echo $ac_n "(cached) $ac_c" 1>&6
3244 else
3245   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
3246 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3247   lt_cv_prog_gnu_ld=yes
3248 else
3249   lt_cv_prog_gnu_ld=no
3250 fi
3251 fi
3252
3253 echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
3254 with_gnu_ld=$lt_cv_prog_gnu_ld
3255
3256
3257 echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
3258 echo "configure:3259: checking for $LD option to reload object files" >&5
3259 if eval "test \"\${lt_cv_ld_reload_flag+set}\" = set"; then
3260   echo $ac_n "(cached) $ac_c" 1>&6
3261 else
3262   lt_cv_ld_reload_flag='-r'
3263 fi
3264
3265 echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6
3266 reload_flag=$lt_cv_ld_reload_flag
3267 test -n "$reload_flag" && reload_flag=" $reload_flag"
3268
3269 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
3270 echo "configure:3271: checking for BSD-compatible nm" >&5
3271 if eval "test \"\${lt_cv_path_NM+set}\" = set"; then
3272   echo $ac_n "(cached) $ac_c" 1>&6
3273 else
3274   if test -n "$NM"; then
3275   # Let the user override the test.
3276   lt_cv_path_NM="$NM"
3277 else
3278   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3279   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3280     test -z "$ac_dir" && ac_dir=.
3281     tmp_nm=$ac_dir/${ac_tool_prefix}nm
3282     if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
3283       # Check to see if the nm accepts a BSD-compat flag.
3284       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3285       #   nm: unknown option "B" ignored
3286       # Tru64's nm complains that /dev/null is an invalid object file
3287       if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
3288         lt_cv_path_NM="$tmp_nm -B"
3289         break
3290       elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3291         lt_cv_path_NM="$tmp_nm -p"
3292         break
3293       else
3294         lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3295         continue # so that we can try to find one that supports BSD flags
3296       fi
3297     fi
3298   done
3299   IFS="$ac_save_ifs"
3300   test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
3301 fi
3302 fi
3303
3304 NM="$lt_cv_path_NM"
3305 echo "$ac_t""$NM" 1>&6
3306
3307 echo $ac_n "checking for a sed that does not truncate output""... $ac_c" 1>&6
3308 echo "configure:3309: checking for a sed that does not truncate output" >&5
3309 if eval "test \"\${lt_cv_path_SED+set}\" = set"; then
3310   echo $ac_n "(cached) $ac_c" 1>&6
3311 else
3312   # Loop through the user's path and test for sed and gsed.
3313 # Then use that list of sed's as ones to test for truncation.
3314 as_executable_p="test -f"
3315 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3316 for as_dir in $PATH
3317 do
3318   IFS=$as_save_IFS
3319   test -z "$as_dir" && as_dir=.
3320   for ac_prog in sed gsed; do
3321     for ac_exec_ext in '' $ac_executable_extensions; do
3322       if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
3323         _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
3324       fi
3325     done
3326   done
3327 done
3328
3329   # Create a temporary directory, and hook for its removal unless debugging.
3330 $debug ||
3331 {
3332   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
3333   trap '{ (exit 1); exit 1; }' 1 2 13 15
3334 }
3335
3336 # Create a (secure) tmp directory for tmp files.
3337 : ${TMPDIR=/tmp}
3338 {
3339   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
3340   test -n "$tmp" && test -d "$tmp"
3341 }  ||
3342 {
3343   tmp=$TMPDIR/sed$$-$RANDOM
3344   (umask 077 && mkdir $tmp)
3345 } ||
3346 {
3347    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
3348    { (exit 1); exit 1; }
3349 }
3350   _max=0
3351   _count=0
3352   # Add /usr/xpg4/bin/sed as it is typically found on Solaris
3353   # along with /bin/sed that truncates output.
3354   for _sed in $_sed_list /usr/xpg4/bin/sed; do
3355     test ! -f ${_sed} && break
3356     cat /dev/null > "$tmp/sed.in"
3357     _count=0
3358     echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
3359     # Check for GNU sed and select it if it is found.
3360     if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
3361       lt_cv_path_SED=${_sed}
3362       break
3363     fi
3364     while true; do
3365       cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
3366       mv "$tmp/sed.tmp" "$tmp/sed.in"
3367       cp "$tmp/sed.in" "$tmp/sed.nl"
3368       echo >>"$tmp/sed.nl"
3369       ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
3370       cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
3371       # 40000 chars as input seems more than enough
3372       test $_count -gt 10 && break
3373       _count=`expr $_count + 1`
3374       if test $_count -gt $_max; then
3375         _max=$_count
3376         lt_cv_path_SED=$_sed
3377       fi
3378     done
3379   done
3380   rm -rf "$tmp"
3381
3382 fi
3383
3384 if test "X$SED" != "X"; then
3385   lt_cv_path_SED=$SED
3386 else
3387   SED=$lt_cv_path_SED
3388 fi
3389 echo "$ac_t""$SED" 1>&6
3390
3391 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3392 echo "configure:3393: checking whether ln -s works" >&5
3393 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3394   echo $ac_n "(cached) $ac_c" 1>&6
3395 else
3396   rm -f conftestdata
3397 if ln -s X conftestdata 2>/dev/null
3398 then
3399   rm -f conftestdata
3400   ac_cv_prog_LN_S="ln -s"
3401 else
3402   ac_cv_prog_LN_S=ln
3403 fi
3404 fi
3405 LN_S="$ac_cv_prog_LN_S"
3406 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3407   echo "$ac_t""yes" 1>&6
3408 else
3409   echo "$ac_t""no" 1>&6
3410 fi
3411
3412 echo $ac_n "checking how to recognise dependent libraries""... $ac_c" 1>&6
3413 echo "configure:3414: checking how to recognise dependent libraries" >&5
3414 if eval "test \"\${lt_cv_deplibs_check_method+set}\" = set"; then
3415   echo $ac_n "(cached) $ac_c" 1>&6
3416 else
3417   lt_cv_file_magic_cmd='$MAGIC_CMD'
3418 lt_cv_file_magic_test_file=
3419 lt_cv_deplibs_check_method='unknown'
3420 # Need to set the preceding variable on all platforms that support
3421 # interlibrary dependencies.
3422 # 'none' -- dependencies not supported.
3423 # `unknown' -- same as none, but documents that we really don't know.
3424 # 'pass_all' -- all dependencies passed with no checks.
3425 # 'test_compile' -- check by making test program.
3426 # 'file_magic [[regex]]' -- check by looking for files in library path
3427 # which responds to the $file_magic_cmd with a given egrep regex.
3428 # If you have `file' or equivalent on your system and you're not sure
3429 # whether `pass_all' will *always* work, you probably want this one.
3430
3431 case $host_os in
3432 aix4* | aix5*)
3433   lt_cv_deplibs_check_method=pass_all
3434   ;;
3435
3436 beos*)
3437   lt_cv_deplibs_check_method=pass_all
3438   ;;
3439
3440 bsdi4*)
3441   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
3442   lt_cv_file_magic_cmd='/usr/bin/file -L'
3443   lt_cv_file_magic_test_file=/shlib/libc.so
3444   ;;
3445
3446 cygwin* | mingw* | pw32*)
3447   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3448   lt_cv_file_magic_cmd='$OBJDUMP -f'
3449   ;;
3450
3451 darwin* | rhapsody*)
3452   lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
3453   lt_cv_file_magic_cmd='/usr/bin/file -L'
3454   case "$host_os" in
3455   rhapsody* | darwin1.[012])
3456     lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
3457     ;;
3458   *) # Darwin 1.3 on
3459     lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
3460     ;;
3461   esac
3462   ;;
3463
3464 freebsd*)
3465   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3466     case $host_cpu in
3467     i*86 )
3468       # Not sure whether the presence of OpenBSD here was a mistake.
3469       # Let's accept both of them until this is cleared up.
3470       lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
3471       lt_cv_file_magic_cmd=/usr/bin/file
3472       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3473       ;;
3474     esac
3475   else
3476     lt_cv_deplibs_check_method=pass_all
3477   fi
3478   ;;
3479
3480 gnu*)
3481   lt_cv_deplibs_check_method=pass_all
3482   ;;
3483
3484 hpux10.20*|hpux11*)
3485   lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
3486   lt_cv_file_magic_cmd=/usr/bin/file
3487   lt_cv_file_magic_test_file=/usr/lib/libc.sl
3488   ;;
3489
3490 irix5* | irix6* | nonstopux*)
3491   case $host_os in
3492   irix5* | nonstopux*)
3493     # this will be overridden with pass_all, but let us keep it just in case
3494     lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
3495     ;;
3496   *)
3497     case $LD in
3498     *-32|*"-32 ") libmagic=32-bit;;
3499     *-n32|*"-n32 ") libmagic=N32;;
3500     *-64|*"-64 ") libmagic=64-bit;;
3501     *) libmagic=never-match;;
3502     esac
3503     # this will be overridden with pass_all, but let us keep it just in case
3504     lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
3505     ;;
3506   esac
3507   lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
3508   lt_cv_deplibs_check_method=pass_all
3509   ;;
3510
3511 # This must be Linux ELF.
3512 linux-gnu*)
3513   case $host_cpu in
3514   alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64*)
3515     lt_cv_deplibs_check_method=pass_all ;;
3516   *)
3517     # glibc up to 2.1.1 does not perform some relocations on ARM
3518     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
3519   esac
3520   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
3521   ;;
3522
3523 netbsd*)
3524   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3525     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
3526   else
3527     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
3528   fi
3529   ;;
3530
3531 newos6*)
3532   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
3533   lt_cv_file_magic_cmd=/usr/bin/file
3534   lt_cv_file_magic_test_file=/usr/lib/libnls.so
3535   ;;
3536
3537 openbsd*)
3538   lt_cv_file_magic_cmd=/usr/bin/file
3539   lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3540   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3541     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
3542   else
3543     lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
3544   fi
3545   ;;
3546
3547 openedition*)
3548   lt_cv_deplibs_check_method=pass_all
3549   ;;
3550
3551 osf3* | osf4* | osf5*)
3552   # this will be overridden with pass_all, but let us keep it just in case
3553   lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
3554   lt_cv_file_magic_test_file=/shlib/libc.so
3555   lt_cv_deplibs_check_method=pass_all
3556   ;;
3557
3558 sco3.2v5*)
3559   lt_cv_deplibs_check_method=pass_all
3560   ;;
3561
3562 solaris*)
3563   lt_cv_deplibs_check_method=pass_all
3564   lt_cv_file_magic_test_file=/lib/libc.so
3565   ;;
3566
3567 sysv5uw[78]* | sysv4*uw2*)
3568   lt_cv_deplibs_check_method=pass_all
3569   ;;
3570
3571 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
3572   case $host_vendor in
3573   motorola)
3574     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]'
3575     lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3576     ;;
3577   ncr)
3578     lt_cv_deplibs_check_method=pass_all
3579     ;;
3580   sequent)
3581     lt_cv_file_magic_cmd='/bin/file'
3582     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
3583     ;;
3584   sni)
3585     lt_cv_file_magic_cmd='/bin/file'
3586     lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
3587     lt_cv_file_magic_test_file=/lib/libc.so
3588     ;;
3589   siemens)
3590     lt_cv_deplibs_check_method=pass_all
3591     ;;
3592   esac
3593   ;;
3594 esac
3595
3596 fi
3597
3598 echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6
3599 file_magic_cmd=$lt_cv_file_magic_cmd
3600 deplibs_check_method=$lt_cv_deplibs_check_method
3601
3602 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
3603 echo "configure:3604: checking for object suffix" >&5
3604 if eval "test \"\${ac_cv_objext+set}\" = set"; then
3605   echo $ac_n "(cached) $ac_c" 1>&6
3606 else
3607   rm -f conftest*
3608 echo 'int i = 1;' > conftest.$ac_ext
3609 if { (eval echo configure:3610: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3610   for ac_file in conftest.*; do
3611     case $ac_file in
3612     *.c) ;;
3613     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
3614     esac
3615   done
3616 else
3617   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
3618 fi
3619 rm -f conftest*
3620 fi
3621
3622 echo "$ac_t""$ac_cv_objext" 1>&6
3623 OBJEXT=$ac_cv_objext
3624 ac_objext=$ac_cv_objext
3625
3626
3627
3628
3629 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
3630 echo "configure:3631: checking for executable suffix" >&5
3631 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
3632   echo $ac_n "(cached) $ac_c" 1>&6
3633 else
3634   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
3635   ac_cv_exeext=.exe
3636 else
3637   rm -f conftest*
3638   echo 'int main () { return 0; }' > conftest.$ac_ext
3639   ac_cv_exeext=
3640   if { (eval echo configure:3641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
3641     for file in conftest.*; do
3642       case $file in
3643       *.c | *.C | *.o | *.obj | *.xcoff) ;;
3644       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
3645       esac
3646     done
3647   else
3648     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
3649   fi
3650   rm -f conftest*
3651   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
3652 fi
3653 fi
3654
3655 EXEEXT=""
3656 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
3657 echo "$ac_t""${ac_cv_exeext}" 1>&6
3658 ac_exeext=$EXEEXT
3659
3660 if test $host != $build; then
3661   ac_tool_prefix=${host_alias}-
3662 else
3663   ac_tool_prefix=
3664 fi
3665
3666
3667
3668
3669 # Check for command to grab the raw symbol name followed by C symbol from nm.
3670 echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
3671 echo "configure:3672: checking command to parse $NM output" >&5
3672 if eval "test \"\${lt_cv_sys_global_symbol_pipe+set}\" = set"; then
3673   echo $ac_n "(cached) $ac_c" 1>&6
3674 else
3675   
3676 # These are sane defaults that work on at least a few old systems.
3677 # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3678
3679 # Character class describing NM global symbol codes.
3680 symcode='[BCDEGRST]'
3681
3682 # Regexp to match symbols that can be accessed directly from C.
3683 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
3684
3685 # Transform the above into a raw symbol and a C symbol.
3686 symxfrm='\1 \2\3 \3'
3687
3688 # Transform an extracted symbol line into a proper C declaration
3689 lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
3690
3691 # Transform an extracted symbol line into symbol name and symbol address
3692 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'"
3693
3694 # Define system-specific variables.
3695 case $host_os in
3696 aix*)
3697   symcode='[BCDT]'
3698   ;;
3699 cygwin* | mingw* | pw32*)
3700   symcode='[ABCDGISTW]'
3701   ;;
3702 hpux*) # Its linker distinguishes data from code symbols
3703   lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3704   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'"
3705   ;;
3706 irix* | nonstopux*)
3707   symcode='[BCDEGRST]'
3708   ;;
3709 osf*)
3710   symcode='[BCDEGQRST]'
3711   ;;
3712 solaris* | sysv5*)
3713   symcode='[BDT]'
3714   ;;
3715 sysv4)
3716   symcode='[DFNSTU]'
3717   ;;
3718 esac
3719
3720 # Handle CRLF in mingw tool chain
3721 opt_cr=
3722 case $host_os in
3723 mingw*)
3724   opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
3725   ;;
3726 esac
3727
3728 # If we're using GNU nm, then use its standard symbol codes.
3729 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
3730   symcode='[ABCDGISTW]'
3731 fi
3732
3733 # Try without a prefix undercore, then with it.
3734 for ac_symprfx in "" "_"; do
3735
3736   # Write the raw and C identifiers.
3737 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[         ]\($symcode$symcode*\)[         ][      ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
3738
3739   # Check to see that the pipe works correctly.
3740   pipe_works=no
3741   rm -f conftest*
3742   cat > conftest.$ac_ext <<EOF
3743 #ifdef __cplusplus
3744 extern "C" {
3745 #endif
3746 char nm_test_var;
3747 void nm_test_func(){}
3748 #ifdef __cplusplus
3749 }
3750 #endif
3751 int main(){nm_test_var='a';nm_test_func();return(0);}
3752 EOF
3753
3754   if { (eval echo configure:3755: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3755     # Now try to grab the symbols.
3756     nlist=conftest.nm
3757     if { (eval echo configure:3758: \"$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
3758       # Try sorting and uniquifying the output.
3759       if sort "$nlist" | uniq > "$nlist"T; then
3760         mv -f "$nlist"T "$nlist"
3761       else
3762         rm -f "$nlist"T
3763       fi
3764
3765       # Make sure that we snagged all the symbols we need.
3766       if egrep ' nm_test_var$' "$nlist" >/dev/null; then
3767         if egrep ' nm_test_func$' "$nlist" >/dev/null; then
3768           cat <<EOF > conftest.$ac_ext
3769 #ifdef __cplusplus
3770 extern "C" {
3771 #endif
3772
3773 EOF
3774           # Now generate the symbol file.
3775           eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
3776
3777           cat <<EOF >> conftest.$ac_ext
3778 #if defined (__STDC__) && __STDC__
3779 # define lt_ptr void *
3780 #else
3781 # define lt_ptr char *
3782 # define const
3783 #endif
3784
3785 /* The mapping between symbol names and symbols. */
3786 const struct {
3787   const char *name;
3788   lt_ptr address;
3789 }
3790 lt_preloaded_symbols[] =
3791 {
3792 EOF
3793           sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
3794           cat <<\EOF >> conftest.$ac_ext
3795   {0, (lt_ptr) 0}
3796 };
3797
3798 #ifdef __cplusplus
3799 }
3800 #endif
3801 EOF
3802           # Now try linking the two files.
3803           mv conftest.$ac_objext conftstm.$ac_objext
3804           save_LIBS="$LIBS"
3805           save_CFLAGS="$CFLAGS"
3806           LIBS="conftstm.$ac_objext"
3807           CFLAGS="$CFLAGS$no_builtin_flag"
3808           if { (eval echo configure:3809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest$ac_exeext; then
3809             pipe_works=yes
3810           fi
3811           LIBS="$save_LIBS"
3812           CFLAGS="$save_CFLAGS"
3813         else
3814           echo "cannot find nm_test_func in $nlist" >&5
3815         fi
3816       else
3817         echo "cannot find nm_test_var in $nlist" >&5
3818       fi
3819     else
3820       echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
3821     fi
3822   else
3823     echo "$progname: failed program was:" >&5
3824     cat conftest.$ac_ext >&5
3825   fi
3826   rm -f conftest* conftst*
3827
3828   # Do not use the global_symbol_pipe unless it works.
3829   if test "$pipe_works" = yes; then
3830     break
3831   else
3832     lt_cv_sys_global_symbol_pipe=
3833   fi
3834 done
3835
3836 fi
3837
3838 global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
3839 if test -z "$lt_cv_sys_global_symbol_pipe"; then
3840   global_symbol_to_cdecl=
3841   global_symbol_to_c_name_address=
3842 else
3843   global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
3844   global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
3845 fi
3846 if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
3847 then
3848   echo "$ac_t""failed" 1>&6
3849 else
3850   echo "$ac_t""ok" 1>&6
3851 fi
3852
3853 for ac_hdr in dlfcn.h
3854 do
3855 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3856 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3857 echo "configure:3858: checking for $ac_hdr" >&5
3858 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3859   echo $ac_n "(cached) $ac_c" 1>&6
3860 else
3861   cat > conftest.$ac_ext <<EOF
3862 #line 3863 "configure"
3863 #include "confdefs.h"
3864 #include <$ac_hdr>
3865 EOF
3866 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3867 { (eval echo configure:3868: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3868 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3869 if test -z "$ac_err"; then
3870   rm -rf conftest*
3871   eval "ac_cv_header_$ac_safe=yes"
3872 else
3873   echo "$ac_err" >&5
3874   echo "configure: failed program was:" >&5
3875   cat conftest.$ac_ext >&5
3876   rm -rf conftest*
3877   eval "ac_cv_header_$ac_safe=no"
3878 fi
3879 rm -f conftest*
3880 fi
3881 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3882   echo "$ac_t""yes" 1>&6
3883     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3884   cat >> confdefs.h <<EOF
3885 #define $ac_tr_hdr 1
3886 EOF
3887  
3888 else
3889   echo "$ac_t""no" 1>&6
3890 fi
3891 done
3892
3893
3894
3895
3896
3897
3898 # Only perform the check for file, if the check method requires it
3899 case $deplibs_check_method in
3900 file_magic*)
3901   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
3902     echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
3903 echo "configure:3904: checking for ${ac_tool_prefix}file" >&5
3904 if eval "test \"\${lt_cv_path_MAGIC_CMD+set}\" = set"; then
3905   echo $ac_n "(cached) $ac_c" 1>&6
3906 else
3907   case $MAGIC_CMD in
3908   /*)
3909   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
3910   ;;
3911   ?:/*)
3912   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
3913   ;;
3914   *)
3915   ac_save_MAGIC_CMD="$MAGIC_CMD"
3916   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3917   ac_dummy="/usr/bin:$PATH"
3918   for ac_dir in $ac_dummy; do
3919     test -z "$ac_dir" && ac_dir=.
3920     if test -f $ac_dir/${ac_tool_prefix}file; then
3921       lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
3922       if test -n "$file_magic_test_file"; then
3923         case $deplibs_check_method in
3924         "file_magic "*)
3925           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
3926           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3927           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3928             egrep "$file_magic_regex" > /dev/null; then
3929             :
3930           else
3931             cat <<EOF 1>&2
3932
3933 *** Warning: the command libtool uses to detect shared libraries,
3934 *** $file_magic_cmd, produces output that libtool cannot recognize.
3935 *** The result is that libtool may fail to recognize shared libraries
3936 *** as such.  This will affect the creation of libtool libraries that
3937 *** depend on shared libraries, but programs linked with such libtool
3938 *** libraries will work regardless of this problem.  Nevertheless, you
3939 *** may want to report the problem to your system manager and/or to
3940 *** bug-libtool@gnu.org
3941
3942 EOF
3943           fi ;;
3944         esac
3945       fi
3946       break
3947     fi
3948   done
3949   IFS="$ac_save_ifs"
3950   MAGIC_CMD="$ac_save_MAGIC_CMD"
3951   ;;
3952 esac
3953 fi
3954
3955 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3956 if test -n "$MAGIC_CMD"; then
3957   echo "$ac_t""$MAGIC_CMD" 1>&6
3958 else
3959   echo "$ac_t""no" 1>&6
3960 fi
3961
3962 if test -z "$lt_cv_path_MAGIC_CMD"; then
3963   if test -n "$ac_tool_prefix"; then
3964     echo $ac_n "checking for file""... $ac_c" 1>&6
3965 echo "configure:3966: checking for file" >&5
3966 if eval "test \"\${lt_cv_path_MAGIC_CMD+set}\" = set"; then
3967   echo $ac_n "(cached) $ac_c" 1>&6
3968 else
3969   case $MAGIC_CMD in
3970   /*)
3971   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
3972   ;;
3973   ?:/*)
3974   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
3975   ;;
3976   *)
3977   ac_save_MAGIC_CMD="$MAGIC_CMD"
3978   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3979   ac_dummy="/usr/bin:$PATH"
3980   for ac_dir in $ac_dummy; do
3981     test -z "$ac_dir" && ac_dir=.
3982     if test -f $ac_dir/file; then
3983       lt_cv_path_MAGIC_CMD="$ac_dir/file"
3984       if test -n "$file_magic_test_file"; then
3985         case $deplibs_check_method in
3986         "file_magic "*)
3987           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
3988           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3989           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3990             egrep "$file_magic_regex" > /dev/null; then
3991             :
3992           else
3993             cat <<EOF 1>&2
3994
3995 *** Warning: the command libtool uses to detect shared libraries,
3996 *** $file_magic_cmd, produces output that libtool cannot recognize.
3997 *** The result is that libtool may fail to recognize shared libraries
3998 *** as such.  This will affect the creation of libtool libraries that
3999 *** depend on shared libraries, but programs linked with such libtool
4000 *** libraries will work regardless of this problem.  Nevertheless, you
4001 *** may want to report the problem to your system manager and/or to
4002 *** bug-libtool@gnu.org
4003
4004 EOF
4005           fi ;;
4006         esac
4007       fi
4008       break
4009     fi
4010   done
4011   IFS="$ac_save_ifs"
4012   MAGIC_CMD="$ac_save_MAGIC_CMD"
4013   ;;
4014 esac
4015 fi
4016
4017 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4018 if test -n "$MAGIC_CMD"; then
4019   echo "$ac_t""$MAGIC_CMD" 1>&6
4020 else
4021   echo "$ac_t""no" 1>&6
4022 fi
4023
4024   else
4025     MAGIC_CMD=:
4026   fi
4027 fi
4028
4029   fi
4030   ;;
4031 esac
4032
4033 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
4034 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
4035 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4036 echo "configure:4037: checking for $ac_word" >&5
4037 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
4038   echo $ac_n "(cached) $ac_c" 1>&6
4039 else
4040   if test -n "$RANLIB"; then
4041   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
4042 else
4043   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4044   ac_dummy="$PATH"
4045   for ac_dir in $ac_dummy; do
4046     test -z "$ac_dir" && ac_dir=.
4047     if test -f $ac_dir/$ac_word; then
4048       ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
4049       break
4050     fi
4051   done
4052   IFS="$ac_save_ifs"
4053 fi
4054 fi
4055 RANLIB="$ac_cv_prog_RANLIB"
4056 if test -n "$RANLIB"; then
4057   echo "$ac_t""$RANLIB" 1>&6
4058 else
4059   echo "$ac_t""no" 1>&6
4060 fi
4061
4062
4063 if test -z "$ac_cv_prog_RANLIB"; then
4064 if test -n "$ac_tool_prefix"; then
4065   # Extract the first word of "ranlib", so it can be a program name with args.
4066 set dummy ranlib; ac_word=$2
4067 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4068 echo "configure:4069: checking for $ac_word" >&5
4069 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
4070   echo $ac_n "(cached) $ac_c" 1>&6
4071 else
4072   if test -n "$RANLIB"; then
4073   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
4074 else
4075   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4076   ac_dummy="$PATH"
4077   for ac_dir in $ac_dummy; do
4078     test -z "$ac_dir" && ac_dir=.
4079     if test -f $ac_dir/$ac_word; then
4080       ac_cv_prog_RANLIB="ranlib"
4081       break
4082     fi
4083   done
4084   IFS="$ac_save_ifs"
4085   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
4086 fi
4087 fi
4088 RANLIB="$ac_cv_prog_RANLIB"
4089 if test -n "$RANLIB"; then
4090   echo "$ac_t""$RANLIB" 1>&6
4091 else
4092   echo "$ac_t""no" 1>&6
4093 fi
4094
4095 else
4096   RANLIB=":"
4097 fi
4098 fi
4099
4100 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
4101 set dummy ${ac_tool_prefix}strip; ac_word=$2
4102 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4103 echo "configure:4104: checking for $ac_word" >&5
4104 if eval "test \"\${ac_cv_prog_STRIP+set}\" = set"; then
4105   echo $ac_n "(cached) $ac_c" 1>&6
4106 else
4107   if test -n "$STRIP"; then
4108   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
4109 else
4110   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4111   ac_dummy="$PATH"
4112   for ac_dir in $ac_dummy; do
4113     test -z "$ac_dir" && ac_dir=.
4114     if test -f $ac_dir/$ac_word; then
4115       ac_cv_prog_STRIP="${ac_tool_prefix}strip"
4116       break
4117     fi
4118   done
4119   IFS="$ac_save_ifs"
4120 fi
4121 fi
4122 STRIP="$ac_cv_prog_STRIP"
4123 if test -n "$STRIP"; then
4124   echo "$ac_t""$STRIP" 1>&6
4125 else
4126   echo "$ac_t""no" 1>&6
4127 fi
4128
4129
4130 if test -z "$ac_cv_prog_STRIP"; then
4131 if test -n "$ac_tool_prefix"; then
4132   # Extract the first word of "strip", so it can be a program name with args.
4133 set dummy strip; ac_word=$2
4134 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4135 echo "configure:4136: checking for $ac_word" >&5
4136 if eval "test \"\${ac_cv_prog_STRIP+set}\" = set"; then
4137   echo $ac_n "(cached) $ac_c" 1>&6
4138 else
4139   if test -n "$STRIP"; then
4140   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
4141 else
4142   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4143   ac_dummy="$PATH"
4144   for ac_dir in $ac_dummy; do
4145     test -z "$ac_dir" && ac_dir=.
4146     if test -f $ac_dir/$ac_word; then
4147       ac_cv_prog_STRIP="strip"
4148       break
4149     fi
4150   done
4151   IFS="$ac_save_ifs"
4152   test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
4153 fi
4154 fi
4155 STRIP="$ac_cv_prog_STRIP"
4156 if test -n "$STRIP"; then
4157   echo "$ac_t""$STRIP" 1>&6
4158 else
4159   echo "$ac_t""no" 1>&6
4160 fi
4161
4162 else
4163   STRIP=":"
4164 fi
4165 fi
4166
4167
4168 enable_dlopen=yes
4169 enable_win32_dll=yes
4170
4171 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
4172 if test "${enable_libtool_lock+set}" = set; then
4173   enableval="$enable_libtool_lock"
4174   :
4175 fi
4176
4177 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
4178
4179 # Some flags need to be propagated to the compiler or linker for good
4180 # libtool support.
4181 case $host in
4182 *-*-irix6*)
4183   # Find out which ABI we are using.
4184   echo '#line 4185 "configure"' > conftest.$ac_ext
4185   if { (eval echo configure:4186: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4186     case `/usr/bin/file conftest.$ac_objext` in
4187     *32-bit*)
4188       LD="${LD-ld} -32"
4189       ;;
4190     *N32*)
4191       LD="${LD-ld} -n32"
4192       ;;
4193     *64-bit*)
4194       LD="${LD-ld} -64"
4195       ;;
4196     esac
4197   fi
4198   rm -rf conftest*
4199   ;;
4200
4201 *-*-sco3.2v5*)
4202   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
4203   SAVE_CFLAGS="$CFLAGS"
4204   CFLAGS="$CFLAGS -belf"
4205   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
4206 echo "configure:4207: checking whether the C compiler needs -belf" >&5
4207 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
4208   echo $ac_n "(cached) $ac_c" 1>&6
4209 else
4210   
4211      ac_ext=c
4212 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
4213 ac_cpp='$CPP $CPPFLAGS'
4214 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
4215 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
4216 cross_compiling=$ac_cv_prog_cc_cross
4217
4218      cat > conftest.$ac_ext <<EOF
4219 #line 4220 "configure"
4220 #include "confdefs.h"
4221
4222 int main() {
4223
4224 ; return 0; }
4225 EOF
4226 if { (eval echo configure:4227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4227   rm -rf conftest*
4228   lt_cv_cc_needs_belf=yes
4229 else
4230   echo "configure: failed program was:" >&5
4231   cat conftest.$ac_ext >&5
4232   rm -rf conftest*
4233   lt_cv_cc_needs_belf=no
4234 fi
4235 rm -f conftest*
4236      ac_ext=c
4237 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
4238 ac_cpp='$CPP $CPPFLAGS'
4239 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
4240 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
4241 cross_compiling=$ac_cv_prog_cc_cross
4242
4243 fi
4244
4245 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
4246   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
4247     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
4248     CFLAGS="$SAVE_CFLAGS"
4249   fi
4250   ;;
4251
4252 *-*-cygwin* | *-*-mingw* | *-*-pw32*)
4253   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
4254 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
4255 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4256 echo "configure:4257: checking for $ac_word" >&5
4257 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
4258   echo $ac_n "(cached) $ac_c" 1>&6
4259 else
4260   if test -n "$DLLTOOL"; then
4261   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
4262 else
4263   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4264   ac_dummy="$PATH"
4265   for ac_dir in $ac_dummy; do
4266     test -z "$ac_dir" && ac_dir=.
4267     if test -f $ac_dir/$ac_word; then
4268       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
4269       break
4270     fi
4271   done
4272   IFS="$ac_save_ifs"
4273 fi
4274 fi
4275 DLLTOOL="$ac_cv_prog_DLLTOOL"
4276 if test -n "$DLLTOOL"; then
4277   echo "$ac_t""$DLLTOOL" 1>&6
4278 else
4279   echo "$ac_t""no" 1>&6
4280 fi
4281
4282
4283 if test -z "$ac_cv_prog_DLLTOOL"; then
4284 if test -n "$ac_tool_prefix"; then
4285   # Extract the first word of "dlltool", so it can be a program name with args.
4286 set dummy dlltool; ac_word=$2
4287 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4288 echo "configure:4289: checking for $ac_word" >&5
4289 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
4290   echo $ac_n "(cached) $ac_c" 1>&6
4291 else
4292   if test -n "$DLLTOOL"; then
4293   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
4294 else
4295   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4296   ac_dummy="$PATH"
4297   for ac_dir in $ac_dummy; do
4298     test -z "$ac_dir" && ac_dir=.
4299     if test -f $ac_dir/$ac_word; then
4300       ac_cv_prog_DLLTOOL="dlltool"
4301       break
4302     fi
4303   done
4304   IFS="$ac_save_ifs"
4305   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
4306 fi
4307 fi
4308 DLLTOOL="$ac_cv_prog_DLLTOOL"
4309 if test -n "$DLLTOOL"; then
4310   echo "$ac_t""$DLLTOOL" 1>&6
4311 else
4312   echo "$ac_t""no" 1>&6
4313 fi
4314
4315 else
4316   DLLTOOL="false"
4317 fi
4318 fi
4319
4320   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
4321 set dummy ${ac_tool_prefix}as; ac_word=$2
4322 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4323 echo "configure:4324: checking for $ac_word" >&5
4324 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
4325   echo $ac_n "(cached) $ac_c" 1>&6
4326 else
4327   if test -n "$AS"; then
4328   ac_cv_prog_AS="$AS" # Let the user override the test.
4329 else
4330   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4331   ac_dummy="$PATH"
4332   for ac_dir in $ac_dummy; do
4333     test -z "$ac_dir" && ac_dir=.
4334     if test -f $ac_dir/$ac_word; then
4335       ac_cv_prog_AS="${ac_tool_prefix}as"
4336       break
4337     fi
4338   done
4339   IFS="$ac_save_ifs"
4340 fi
4341 fi
4342 AS="$ac_cv_prog_AS"
4343 if test -n "$AS"; then
4344   echo "$ac_t""$AS" 1>&6
4345 else
4346   echo "$ac_t""no" 1>&6
4347 fi
4348
4349
4350 if test -z "$ac_cv_prog_AS"; then
4351 if test -n "$ac_tool_prefix"; then
4352   # Extract the first word of "as", so it can be a program name with args.
4353 set dummy as; ac_word=$2
4354 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4355 echo "configure:4356: checking for $ac_word" >&5
4356 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
4357   echo $ac_n "(cached) $ac_c" 1>&6
4358 else
4359   if test -n "$AS"; then
4360   ac_cv_prog_AS="$AS" # Let the user override the test.
4361 else
4362   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4363   ac_dummy="$PATH"
4364   for ac_dir in $ac_dummy; do
4365     test -z "$ac_dir" && ac_dir=.
4366     if test -f $ac_dir/$ac_word; then
4367       ac_cv_prog_AS="as"
4368       break
4369     fi
4370   done
4371   IFS="$ac_save_ifs"
4372   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
4373 fi
4374 fi
4375 AS="$ac_cv_prog_AS"
4376 if test -n "$AS"; then
4377   echo "$ac_t""$AS" 1>&6
4378 else
4379   echo "$ac_t""no" 1>&6
4380 fi
4381
4382 else
4383   AS="false"
4384 fi
4385 fi
4386
4387   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
4388 set dummy ${ac_tool_prefix}objdump; ac_word=$2
4389 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4390 echo "configure:4391: checking for $ac_word" >&5
4391 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
4392   echo $ac_n "(cached) $ac_c" 1>&6
4393 else
4394   if test -n "$OBJDUMP"; then
4395   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
4396 else
4397   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4398   ac_dummy="$PATH"
4399   for ac_dir in $ac_dummy; do
4400     test -z "$ac_dir" && ac_dir=.
4401     if test -f $ac_dir/$ac_word; then
4402       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
4403       break
4404     fi
4405   done
4406   IFS="$ac_save_ifs"
4407 fi
4408 fi
4409 OBJDUMP="$ac_cv_prog_OBJDUMP"
4410 if test -n "$OBJDUMP"; then
4411   echo "$ac_t""$OBJDUMP" 1>&6
4412 else
4413   echo "$ac_t""no" 1>&6
4414 fi
4415
4416
4417 if test -z "$ac_cv_prog_OBJDUMP"; then
4418 if test -n "$ac_tool_prefix"; then
4419   # Extract the first word of "objdump", so it can be a program name with args.
4420 set dummy objdump; ac_word=$2
4421 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4422 echo "configure:4423: checking for $ac_word" >&5
4423 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
4424   echo $ac_n "(cached) $ac_c" 1>&6
4425 else
4426   if test -n "$OBJDUMP"; then
4427   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
4428 else
4429   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4430   ac_dummy="$PATH"
4431   for ac_dir in $ac_dummy; do
4432     test -z "$ac_dir" && ac_dir=.
4433     if test -f $ac_dir/$ac_word; then
4434       ac_cv_prog_OBJDUMP="objdump"
4435       break
4436     fi
4437   done
4438   IFS="$ac_save_ifs"
4439   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
4440 fi
4441 fi
4442 OBJDUMP="$ac_cv_prog_OBJDUMP"
4443 if test -n "$OBJDUMP"; then
4444   echo "$ac_t""$OBJDUMP" 1>&6
4445 else
4446   echo "$ac_t""no" 1>&6
4447 fi
4448
4449 else
4450   OBJDUMP="false"
4451 fi
4452 fi
4453
4454
4455   # recent cygwin and mingw systems supply a stub DllMain which the user
4456   # can override, but on older systems we have to supply one
4457   echo $ac_n "checking if libtool should supply DllMain function""... $ac_c" 1>&6
4458 echo "configure:4459: checking if libtool should supply DllMain function" >&5
4459 if eval "test \"\${lt_cv_need_dllmain+set}\" = set"; then
4460   echo $ac_n "(cached) $ac_c" 1>&6
4461 else
4462   cat > conftest.$ac_ext <<EOF
4463 #line 4464 "configure"
4464 #include "confdefs.h"
4465
4466 int main() {
4467 extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
4468       DllMain (0, 0, 0);
4469 ; return 0; }
4470 EOF
4471 if { (eval echo configure:4472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4472   rm -rf conftest*
4473   lt_cv_need_dllmain=no
4474 else
4475   echo "configure: failed program was:" >&5
4476   cat conftest.$ac_ext >&5
4477   rm -rf conftest*
4478   lt_cv_need_dllmain=yes
4479 fi
4480 rm -f conftest*
4481 fi
4482
4483 echo "$ac_t""$lt_cv_need_dllmain" 1>&6
4484
4485   case $host/$CC in
4486   *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
4487     # old mingw systems require "-dll" to link a DLL, while more recent ones
4488     # require "-mdll"
4489     SAVE_CFLAGS="$CFLAGS"
4490     CFLAGS="$CFLAGS -mdll"
4491     echo $ac_n "checking how to link DLLs""... $ac_c" 1>&6
4492 echo "configure:4493: checking how to link DLLs" >&5
4493 if eval "test \"\${lt_cv_cc_dll_switch+set}\" = set"; then
4494   echo $ac_n "(cached) $ac_c" 1>&6
4495 else
4496   cat > conftest.$ac_ext <<EOF
4497 #line 4498 "configure"
4498 #include "confdefs.h"
4499
4500 int main() {
4501
4502 ; return 0; }
4503 EOF
4504 if { (eval echo configure:4505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4505   rm -rf conftest*
4506   lt_cv_cc_dll_switch=-mdll
4507 else
4508   echo "configure: failed program was:" >&5
4509   cat conftest.$ac_ext >&5
4510   rm -rf conftest*
4511   lt_cv_cc_dll_switch=-dll
4512 fi
4513 rm -f conftest*
4514 fi
4515
4516 echo "$ac_t""$lt_cv_cc_dll_switch" 1>&6
4517     CFLAGS="$SAVE_CFLAGS" ;;
4518   *-*-cygwin* | *-*-pw32*)
4519     # cygwin systems need to pass --dll to the linker, and not link
4520     # crt.o which will require a WinMain@16 definition.
4521     lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
4522   esac
4523   ;;
4524   
4525 esac
4526
4527 # Sed substitution that helps us do robust quoting.  It backslashifies
4528 # metacharacters that are still active within double-quoted strings.
4529 Xsed='sed -e s/^X//'
4530 sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
4531
4532 # Same as above, but do not quote variable references.
4533 double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
4534
4535 # Sed substitution to delay expansion of an escaped shell variable in a
4536 # double_quote_subst'ed string.
4537 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
4538
4539 # Constants:
4540 rm="rm -f"
4541
4542 # Global variables:
4543 default_ofile=libtool
4544 can_build_shared=yes
4545
4546 # All known linkers require a `.a' archive for static linking (except M$VC,
4547 # which needs '.lib').
4548 libext=a
4549 ltmain="$ac_aux_dir/ltmain.sh"
4550 ofile="$default_ofile"
4551 with_gnu_ld="$lt_cv_prog_gnu_ld"
4552 need_locks="$enable_libtool_lock"
4553
4554 old_CC="$CC"
4555 old_CFLAGS="$CFLAGS"
4556
4557 # Set sane defaults for various variables
4558 test -z "$AR" && AR=ar
4559 test -z "$AR_FLAGS" && AR_FLAGS=cru
4560 test -z "$AS" && AS=as
4561 test -z "$CC" && CC=cc
4562 test -z "$DLLTOOL" && DLLTOOL=dlltool
4563 test -z "$LD" && LD=ld
4564 test -z "$LN_S" && LN_S="ln -s"
4565 test -z "$MAGIC_CMD" && MAGIC_CMD=file
4566 test -z "$NM" && NM=nm
4567 test -z "$OBJDUMP" && OBJDUMP=objdump
4568 test -z "$RANLIB" && RANLIB=:
4569 test -z "$STRIP" && STRIP=:
4570 test -z "$ac_objext" && ac_objext=o
4571
4572 if test x"$host" != x"$build"; then
4573   ac_tool_prefix=${host_alias}-
4574 else
4575   ac_tool_prefix=
4576 fi
4577
4578 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
4579 case $host_os in
4580 linux-gnu*) ;;
4581 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
4582 esac
4583
4584 case $host_os in
4585 aix3*)
4586   # AIX sometimes has problems with the GCC collect2 program.  For some
4587   # reason, if we set the COLLECT_NAMES environment variable, the problems
4588   # vanish in a puff of smoke.
4589   if test "X${COLLECT_NAMES+set}" != Xset; then
4590     COLLECT_NAMES=
4591     export COLLECT_NAMES
4592   fi
4593   ;;
4594 esac
4595
4596 # Determine commands to create old-style static archives.
4597 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
4598 old_postinstall_cmds='chmod 644 $oldlib'
4599 old_postuninstall_cmds=
4600
4601 if test -n "$RANLIB"; then
4602   case $host_os in
4603   openbsd*)
4604     old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
4605     ;;
4606   *)
4607     old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
4608     ;;
4609   esac
4610   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
4611 fi
4612
4613 # Allow CC to be a program name with arguments.
4614 set dummy $CC
4615 compiler="$2"
4616
4617 echo $ac_n "checking for objdir""... $ac_c" 1>&6
4618 echo "configure:4619: checking for objdir" >&5
4619 rm -f .libs 2>/dev/null
4620 mkdir .libs 2>/dev/null
4621 if test -d .libs; then
4622   objdir=.libs
4623 else
4624   # MS-DOS does not allow filenames that begin with a dot.
4625   objdir=_libs
4626 fi
4627 rmdir .libs 2>/dev/null
4628 echo "$ac_t""$objdir" 1>&6
4629
4630
4631 # Check whether --with-pic or --without-pic was given.
4632 if test "${with_pic+set}" = set; then
4633   withval="$with_pic"
4634   pic_mode="$withval"
4635 else
4636   pic_mode=default
4637 fi
4638
4639 test -z "$pic_mode" && pic_mode=default
4640
4641 # We assume here that the value for lt_cv_prog_cc_pic will not be cached
4642 # in isolation, and that seeing it set (from the cache) indicates that
4643 # the associated values are set (in the cache) correctly too.
4644 echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6
4645 echo "configure:4646: checking for $compiler option to produce PIC" >&5
4646 if eval "test \"\${lt_cv_prog_cc_pic+set}\" = set"; then
4647   echo $ac_n "(cached) $ac_c" 1>&6
4648 else
4649    lt_cv_prog_cc_pic=
4650   lt_cv_prog_cc_shlib=
4651   lt_cv_prog_cc_wl=
4652   lt_cv_prog_cc_static=
4653   lt_cv_prog_cc_no_builtin=
4654   lt_cv_prog_cc_can_build_shared=$can_build_shared
4655
4656   if test "$GCC" = yes; then
4657     lt_cv_prog_cc_wl='-Wl,'
4658     lt_cv_prog_cc_static='-static'
4659
4660     case $host_os in
4661     aix*)
4662       # Below there is a dirty hack to force normal static linking with -ldl
4663       # The problem is because libdl dynamically linked with both libc and
4664       # libC (AIX C++ library), which obviously doesn't included in libraries
4665       # list by gcc. This cause undefined symbols with -static flags.
4666       # This hack allows C programs to be linked with "-static -ldl", but
4667       # not sure about C++ programs.
4668       lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
4669       ;;
4670     amigaos*)
4671       # FIXME: we need at least 68020 code to build shared libraries, but
4672       # adding the `-m68020' flag to GCC prevents building anything better,
4673       # like `-m68040'.
4674       lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
4675       ;;
4676     beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4677       # PIC is the default for these OSes.
4678       ;;
4679     darwin* | rhapsody*)
4680       # PIC is the default on this platform
4681       # Common symbols not allowed in MH_DYLIB files
4682       lt_cv_prog_cc_pic='-fno-common'
4683       ;;
4684     cygwin* | mingw* | pw32* | os2*)
4685       # This hack is so that the source file can tell whether it is being
4686       # built for inclusion in a dll (and should export symbols for example).
4687       lt_cv_prog_cc_pic='-DDLL_EXPORT'
4688       ;;
4689     sysv4*MP*)
4690       if test -d /usr/nec; then
4691          lt_cv_prog_cc_pic=-Kconform_pic
4692       fi
4693       ;;
4694     *)
4695       lt_cv_prog_cc_pic='-fPIC'
4696       ;;
4697     esac
4698   else
4699     # PORTME Check for PIC flags for the system compiler.
4700     case $host_os in
4701     aix3* | aix4* | aix5*)
4702       lt_cv_prog_cc_wl='-Wl,'
4703       # All AIX code is PIC.
4704       if test "$host_cpu" = ia64; then
4705         # AIX 5 now supports IA64 processor
4706         lt_cv_prog_cc_static='-Bstatic'
4707       else
4708         lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
4709       fi
4710       ;;
4711
4712     hpux9* | hpux10* | hpux11*)
4713       # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
4714       lt_cv_prog_cc_wl='-Wl,'
4715       lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
4716       lt_cv_prog_cc_pic='+Z'
4717       ;;
4718
4719     irix5* | irix6* | nonstopux*)
4720       lt_cv_prog_cc_wl='-Wl,'
4721       lt_cv_prog_cc_static='-non_shared'
4722       # PIC (with -KPIC) is the default.
4723       ;;
4724
4725     cygwin* | mingw* | pw32* | os2*)
4726       # This hack is so that the source file can tell whether it is being
4727       # built for inclusion in a dll (and should export symbols for example).
4728       lt_cv_prog_cc_pic='-DDLL_EXPORT'
4729       ;;
4730
4731     newsos6)
4732       lt_cv_prog_cc_pic='-KPIC'
4733       lt_cv_prog_cc_static='-Bstatic'
4734       ;;
4735     
4736     openedition)
4737       # XPLINK code is PIC by default
4738       ;;
4739
4740     osf3* | osf4* | osf5*)
4741       # All OSF/1 code is PIC.
4742       lt_cv_prog_cc_wl='-Wl,'
4743       lt_cv_prog_cc_static='-non_shared'
4744       ;;
4745
4746     sco3.2v5*)
4747       lt_cv_prog_cc_pic='-Kpic'
4748       lt_cv_prog_cc_static='-dn'
4749       lt_cv_prog_cc_shlib='-belf'
4750       ;;
4751
4752     solaris*)
4753       lt_cv_prog_cc_pic='-KPIC'
4754       lt_cv_prog_cc_static='-Bstatic'
4755       lt_cv_prog_cc_wl='-Wl,'
4756       ;;
4757
4758     sunos4*)
4759       lt_cv_prog_cc_pic='-PIC'
4760       lt_cv_prog_cc_static='-Bstatic'
4761       lt_cv_prog_cc_wl='-Qoption ld '
4762       ;;
4763
4764     sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
4765       lt_cv_prog_cc_pic='-KPIC'
4766       lt_cv_prog_cc_static='-Bstatic'
4767       lt_cv_prog_cc_wl='-Wl,'
4768       ;;
4769
4770     uts4*)
4771       lt_cv_prog_cc_pic='-pic'
4772       lt_cv_prog_cc_static='-Bstatic'
4773       ;;
4774
4775     sysv4*MP*)
4776       if test -d /usr/nec ;then
4777         lt_cv_prog_cc_pic='-Kconform_pic'
4778         lt_cv_prog_cc_static='-Bstatic'
4779       fi
4780       ;;
4781
4782     *)
4783       lt_cv_prog_cc_can_build_shared=no
4784       ;;
4785     esac
4786   fi
4787
4788 fi
4789
4790 if test -z "$lt_cv_prog_cc_pic"; then
4791   echo "$ac_t""none" 1>&6
4792 else
4793   echo "$ac_t""$lt_cv_prog_cc_pic" 1>&6
4794
4795   # Check to make sure the pic_flag actually works.
4796   echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6
4797 echo "configure:4798: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
4798   if eval "test \"\${lt_cv_prog_cc_pic_works+set}\" = set"; then
4799   echo $ac_n "(cached) $ac_c" 1>&6
4800 else
4801       save_CFLAGS="$CFLAGS"
4802     CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
4803     cat > conftest.$ac_ext <<EOF
4804 #line 4805 "configure"
4805 #include "confdefs.h"
4806
4807 int main() {
4808
4809 ; return 0; }
4810 EOF
4811 if { (eval echo configure:4812: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4812   rm -rf conftest*
4813         case $host_os in
4814       hpux9* | hpux10* | hpux11*)
4815         # On HP-UX, both CC and GCC only warn that PIC is supported... then
4816         # they create non-PIC objects.  So, if there were any warnings, we
4817         # assume that PIC is not supported.
4818         if test -s conftest.err; then
4819           lt_cv_prog_cc_pic_works=no
4820         else
4821           lt_cv_prog_cc_pic_works=yes
4822         fi
4823         ;;
4824       *)
4825         lt_cv_prog_cc_pic_works=yes
4826         ;;
4827       esac
4828     
4829 else
4830   echo "configure: failed program was:" >&5
4831   cat conftest.$ac_ext >&5
4832   rm -rf conftest*
4833         lt_cv_prog_cc_pic_works=no
4834     
4835 fi
4836 rm -f conftest*
4837     CFLAGS="$save_CFLAGS"
4838   
4839 fi
4840
4841
4842   if test "X$lt_cv_prog_cc_pic_works" = Xno; then
4843     lt_cv_prog_cc_pic=
4844     lt_cv_prog_cc_can_build_shared=no
4845   else
4846     lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
4847   fi
4848
4849   echo "$ac_t""$lt_cv_prog_cc_pic_works" 1>&6
4850 fi
4851
4852 # Check for any special shared library compilation flags.
4853 if test -n "$lt_cv_prog_cc_shlib"; then
4854   echo "configure: warning: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" 1>&2
4855   if echo "$old_CC $old_CFLAGS " | egrep -e "[  ]$lt_cv_prog_cc_shlib[  ]" >/dev/null; then :
4856   else
4857    echo "configure: warning: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2
4858     lt_cv_prog_cc_can_build_shared=no
4859   fi
4860 fi
4861
4862 echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6
4863 echo "configure:4864: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
4864 if eval "test \"\${lt_cv_prog_cc_static_works+set}\" = set"; then
4865   echo $ac_n "(cached) $ac_c" 1>&6
4866 else
4867     lt_cv_prog_cc_static_works=no
4868   save_LDFLAGS="$LDFLAGS"
4869   LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
4870   cat > conftest.$ac_ext <<EOF
4871 #line 4872 "configure"
4872 #include "confdefs.h"
4873
4874 int main() {
4875
4876 ; return 0; }
4877 EOF
4878 if { (eval echo configure:4879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4879   rm -rf conftest*
4880   lt_cv_prog_cc_static_works=yes
4881 else
4882   echo "configure: failed program was:" >&5
4883   cat conftest.$ac_ext >&5
4884 fi
4885 rm -f conftest*
4886   LDFLAGS="$save_LDFLAGS"
4887
4888 fi
4889
4890
4891 # Belt *and* braces to stop my trousers falling down:
4892 test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
4893 echo "$ac_t""$lt_cv_prog_cc_static_works" 1>&6
4894
4895 pic_flag="$lt_cv_prog_cc_pic"
4896 special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
4897 wl="$lt_cv_prog_cc_wl"
4898 link_static_flag="$lt_cv_prog_cc_static"
4899 no_builtin_flag="$lt_cv_prog_cc_no_builtin"
4900 can_build_shared="$lt_cv_prog_cc_can_build_shared"
4901
4902
4903 # Check to see if options -o and -c are simultaneously supported by compiler
4904 echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6
4905 echo "configure:4906: checking if $compiler supports -c -o file.$ac_objext" >&5
4906 if eval "test \"\${lt_cv_compiler_c_o+set}\" = set"; then
4907   echo $ac_n "(cached) $ac_c" 1>&6
4908 else
4909   
4910 $rm -r conftest 2>/dev/null
4911 mkdir conftest
4912 cd conftest
4913 echo "int some_variable = 0;" > conftest.$ac_ext
4914 mkdir out
4915 # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
4916 # that will create temporary files in the current directory regardless of
4917 # the output directory.  Thus, making CWD read-only will cause this test
4918 # to fail, enabling locking or at least warning the user not to do parallel
4919 # builds.
4920 chmod -w .
4921 save_CFLAGS="$CFLAGS"
4922 CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
4923 compiler_c_o=no
4924 if { (eval echo configure:4925: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
4925   # The compiler can only warn and ignore the option if not recognized
4926   # So say no if there are warnings
4927   if test -s out/conftest.err; then
4928     lt_cv_compiler_c_o=no
4929   else
4930     lt_cv_compiler_c_o=yes
4931   fi
4932 else
4933   # Append any errors to the config.log.
4934   cat out/conftest.err 1>&5
4935   lt_cv_compiler_c_o=no
4936 fi
4937 CFLAGS="$save_CFLAGS"
4938 chmod u+w .
4939 $rm conftest* out/*
4940 rmdir out
4941 cd ..
4942 rmdir conftest
4943 $rm -r conftest 2>/dev/null
4944
4945 fi
4946
4947 compiler_c_o=$lt_cv_compiler_c_o
4948 echo "$ac_t""$compiler_c_o" 1>&6
4949
4950 if test x"$compiler_c_o" = x"yes"; then
4951   # Check to see if we can write to a .lo
4952   echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6
4953 echo "configure:4954: checking if $compiler supports -c -o file.lo" >&5
4954   if eval "test \"\${lt_cv_compiler_o_lo+set}\" = set"; then
4955   echo $ac_n "(cached) $ac_c" 1>&6
4956 else
4957   
4958   lt_cv_compiler_o_lo=no
4959   save_CFLAGS="$CFLAGS"
4960   CFLAGS="$CFLAGS -c -o conftest.lo"
4961   save_objext="$ac_objext"
4962   ac_objext=lo
4963   cat > conftest.$ac_ext <<EOF
4964 #line 4965 "configure"
4965 #include "confdefs.h"
4966
4967 int main() {
4968 int some_variable = 0;
4969 ; return 0; }
4970 EOF
4971 if { (eval echo configure:4972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4972   rm -rf conftest*
4973       # The compiler can only warn and ignore the option if not recognized
4974     # So say no if there are warnings
4975     if test -s conftest.err; then
4976       lt_cv_compiler_o_lo=no
4977     else
4978       lt_cv_compiler_o_lo=yes
4979     fi
4980   
4981 else
4982   echo "configure: failed program was:" >&5
4983   cat conftest.$ac_ext >&5
4984 fi
4985 rm -f conftest*
4986   ac_objext="$save_objext"
4987   CFLAGS="$save_CFLAGS"
4988   
4989 fi
4990
4991   compiler_o_lo=$lt_cv_compiler_o_lo
4992   echo "$ac_t""$compiler_o_lo" 1>&6
4993 else
4994   compiler_o_lo=no
4995 fi
4996
4997 # Check to see if we can do hard links to lock some files if needed
4998 hard_links="nottested"
4999 if test "$compiler_c_o" = no && test "$need_locks" != no; then
5000   # do not overwrite the value of need_locks provided by the user
5001   echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6
5002 echo "configure:5003: checking if we can lock with hard links" >&5
5003   hard_links=yes
5004   $rm conftest*
5005   ln conftest.a conftest.b 2>/dev/null && hard_links=no
5006   touch conftest.a
5007   ln conftest.a conftest.b 2>&5 || hard_links=no
5008   ln conftest.a conftest.b 2>/dev/null && hard_links=no
5009   echo "$ac_t""$hard_links" 1>&6
5010   if test "$hard_links" = no; then
5011     echo "configure: warning: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" 1>&2
5012     need_locks=warn
5013   fi
5014 else
5015   need_locks=no
5016 fi
5017
5018 if test "$GCC" = yes; then
5019   # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
5020   echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6
5021 echo "configure:5022: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
5022   echo "int some_variable = 0;" > conftest.$ac_ext
5023   save_CFLAGS="$CFLAGS"
5024   CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
5025   compiler_rtti_exceptions=no
5026   cat > conftest.$ac_ext <<EOF
5027 #line 5028 "configure"
5028 #include "confdefs.h"
5029
5030 int main() {
5031 int some_variable = 0;
5032 ; return 0; }
5033 EOF
5034 if { (eval echo configure:5035: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5035   rm -rf conftest*
5036       # The compiler can only warn and ignore the option if not recognized
5037     # So say no if there are warnings
5038     if test -s conftest.err; then
5039       compiler_rtti_exceptions=no
5040     else
5041       compiler_rtti_exceptions=yes
5042     fi
5043   
5044 else
5045   echo "configure: failed program was:" >&5
5046   cat conftest.$ac_ext >&5
5047 fi
5048 rm -f conftest*
5049   CFLAGS="$save_CFLAGS"
5050   echo "$ac_t""$compiler_rtti_exceptions" 1>&6
5051
5052   if test "$compiler_rtti_exceptions" = "yes"; then
5053     no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
5054   else
5055     no_builtin_flag=' -fno-builtin'
5056   fi
5057 fi
5058
5059 # See if the linker supports building shared libraries.
5060 echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6
5061 echo "configure:5062: checking whether the linker ($LD) supports shared libraries" >&5
5062
5063 allow_undefined_flag=
5064 no_undefined_flag=
5065 need_lib_prefix=unknown
5066 need_version=unknown
5067 # when you set need_version to no, make sure it does not cause -set_version
5068 # flags to be left without arguments
5069 archive_cmds=
5070 archive_expsym_cmds=
5071 old_archive_from_new_cmds=
5072 old_archive_from_expsyms_cmds=
5073 export_dynamic_flag_spec=
5074 whole_archive_flag_spec=
5075 thread_safe_flag_spec=
5076 hardcode_into_libs=no
5077 hardcode_libdir_flag_spec=
5078 hardcode_libdir_separator=
5079 hardcode_direct=no
5080 hardcode_minus_L=no
5081 hardcode_shlibpath_var=unsupported
5082 runpath_var=
5083 link_all_deplibs=unknown
5084 always_export_symbols=no
5085 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
5086 # include_expsyms should be a list of space-separated symbols to be *always*
5087 # included in the symbol list
5088 include_expsyms=
5089 # exclude_expsyms can be an egrep regular expression of symbols to exclude
5090 # it will be wrapped by ` (' and `)$', so one must not match beginning or
5091 # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5092 # as well as any symbol that contains `d'.
5093 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
5094 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5095 # platforms (ab)use it in PIC code, but their linkers get confused if
5096 # the symbol is explicitly referenced.  Since portable code cannot
5097 # rely on this symbol name, it's probably fine to never include it in
5098 # preloaded symbol tables.
5099 extract_expsyms_cmds=
5100
5101 case $host_os in
5102 cygwin* | mingw* | pw32*)
5103   # FIXME: the MSVC++ port hasn't been tested in a loooong time
5104   # When not using gcc, we currently assume that we are using
5105   # Microsoft Visual C++.
5106   if test "$GCC" != yes; then
5107     with_gnu_ld=no
5108   fi
5109   ;;
5110 openbsd*)
5111   with_gnu_ld=no
5112   ;;
5113 esac
5114
5115 ld_shlibs=yes
5116 if test "$with_gnu_ld" = yes; then
5117   # If archive_cmds runs LD, not CC, wlarc should be empty
5118   wlarc='${wl}'
5119
5120   # See if GNU ld supports shared libraries.
5121   case $host_os in
5122   aix3* | aix4* | aix5*)
5123     # On AIX, the GNU linker is very broken
5124     # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
5125     ld_shlibs=no
5126     cat <<EOF 1>&2
5127
5128 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
5129 *** to be unable to reliably create shared libraries on AIX.
5130 *** Therefore, libtool is disabling shared libraries support.  If you
5131 *** really care for shared libraries, you may want to modify your PATH
5132 *** so that a non-GNU linker is found, and then restart.
5133
5134 EOF
5135     ;;
5136
5137   amigaos*)
5138     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)'
5139     hardcode_libdir_flag_spec='-L$libdir'
5140     hardcode_minus_L=yes
5141
5142     # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
5143     # that the semantics of dynamic libraries on AmigaOS, at least up
5144     # to version 4, is to share data among multiple programs linked
5145     # with the same dynamic library.  Since this doesn't match the
5146     # behavior of shared libraries on other platforms, we can use
5147     # them.
5148     ld_shlibs=no
5149     ;;
5150
5151   beos*)
5152     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5153       allow_undefined_flag=unsupported
5154       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5155       # support --undefined.  This deserves some investigation.  FIXME
5156       archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5157     else
5158       ld_shlibs=no
5159     fi
5160     ;;
5161
5162   cygwin* | mingw* | pw32*)
5163     # hardcode_libdir_flag_spec is actually meaningless, as there is
5164     # no search path for DLLs.
5165     hardcode_libdir_flag_spec='-L$libdir'
5166     allow_undefined_flag=unsupported
5167     always_export_symbols=yes
5168
5169     extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
5170       sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
5171       test -f $output_objdir/impgen.exe || (cd $output_objdir && \
5172       if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
5173       else $CC -o impgen impgen.c ; fi)~
5174       $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
5175
5176     old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
5177
5178     # cygwin and mingw dlls have different entry points and sets of symbols
5179     # to exclude.
5180     # FIXME: what about values for MSVC?
5181     dll_entry=__cygwin_dll_entry@12
5182     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
5183     case $host_os in
5184     mingw*)
5185       # mingw values
5186       dll_entry=_DllMainCRTStartup@12
5187       dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
5188       ;;
5189     esac
5190
5191     # mingw and cygwin differ, and it's simplest to just exclude the union
5192     # of the two symbol sets.
5193     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
5194
5195     # recent cygwin and mingw systems supply a stub DllMain which the user
5196     # can override, but on older systems we have to supply one (in ltdll.c)
5197     if test "x$lt_cv_need_dllmain" = "xyes"; then
5198       ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
5199       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~
5200         test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
5201     else
5202       ltdll_obj=
5203       ltdll_cmds=
5204     fi
5205
5206     # Extract the symbol export list from an `--export-all' def file,
5207     # then regenerate the def file from the symbol export list, so that
5208     # the compiled dll only exports the symbol export list.
5209     # Be careful not to strip the DATA tag left be newer dlltools.
5210     export_symbols_cmds="$ltdll_cmds"'
5211       $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
5212       sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
5213
5214     # If the export-symbols file already is a .def file (1st line
5215     # is EXPORTS), use it as is.
5216     # If DATA tags from a recent dlltool are present, honour them!
5217     archive_expsym_cmds='if test "x`sed 1q $export_symbols`" = xEXPORTS; then
5218         cp $export_symbols $output_objdir/$soname-def;
5219       else
5220         echo EXPORTS > $output_objdir/$soname-def;
5221         _lt_hint=1;
5222         cat $export_symbols | while read symbol; do
5223          set dummy \$symbol;
5224          case \$# in
5225            2) echo "   \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
5226            4) echo "   \$2 \$3 \$4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
5227            *) echo "     \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
5228          esac;
5229          _lt_hint=`expr 1 + \$_lt_hint`;
5230         done;
5231       fi~
5232       '"$ltdll_cmds"'
5233       $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~
5234       $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~
5235       $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~
5236       $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~
5237       $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
5238     ;;
5239
5240   netbsd*)
5241     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5242       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5243       wlarc=
5244     else
5245       archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5246       archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5247     fi
5248     ;;
5249
5250   solaris* | sysv5*)
5251     if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
5252       ld_shlibs=no
5253       cat <<EOF 1>&2
5254
5255 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
5256 *** create shared libraries on Solaris systems.  Therefore, libtool
5257 *** is disabling shared libraries support.  We urge you to upgrade GNU
5258 *** binutils to release 2.9.1 or newer.  Another option is to modify
5259 *** your PATH or compiler configuration so that the native linker is
5260 *** used, and then restart.
5261
5262 EOF
5263     elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5264       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5265       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5266     else
5267       ld_shlibs=no
5268     fi
5269     ;;
5270
5271   sunos4*)
5272     archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5273     wlarc=
5274     hardcode_direct=yes
5275     hardcode_shlibpath_var=no
5276     ;;
5277
5278   *)
5279     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5280       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5281       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5282     else
5283       ld_shlibs=no
5284     fi
5285     ;;
5286   esac
5287
5288   if test "$ld_shlibs" = yes; then
5289     runpath_var=LD_RUN_PATH
5290     hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
5291     export_dynamic_flag_spec='${wl}--export-dynamic'
5292     case $host_os in
5293     cygwin* | mingw* | pw32*)
5294       # dlltool doesn't understand --whole-archive et. al.
5295       whole_archive_flag_spec=
5296       ;;
5297     *)
5298       # ancient GNU ld didn't support --whole-archive et. al.
5299       if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
5300         whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5301       else
5302         whole_archive_flag_spec=
5303       fi
5304       ;;
5305     esac
5306   fi
5307 else
5308   # PORTME fill in a description of your system's linker (not GNU ld)
5309   case $host_os in
5310   aix3*)
5311     allow_undefined_flag=unsupported
5312     always_export_symbols=yes
5313     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'
5314     # Note: this linker hardcodes the directories in LIBPATH if there
5315     # are no directories specified by -L.
5316     hardcode_minus_L=yes
5317     if test "$GCC" = yes && test -z "$link_static_flag"; then
5318       # Neither direct hardcoding nor static linking is supported with a
5319       # broken collect2.
5320       hardcode_direct=unsupported
5321     fi
5322     ;;
5323
5324   aix4* | aix5*)
5325     if test "$host_cpu" = ia64; then
5326       # On IA64, the linker does run time linking by default, so we don't
5327       # have to do anything special.
5328       aix_use_runtimelinking=no
5329       exp_sym_flag='-Bexport'
5330       no_entry_flag=""
5331     else
5332       aix_use_runtimelinking=no
5333
5334       # Test if we are trying to use run time linking or normal
5335       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5336       # need to do runtime linking.
5337       case $host_os in aix4.[23]|aix4.[23].*|aix5*)
5338         for ld_flag in $LDFLAGS; do
5339           case $ld_flag in
5340           *-brtl*)
5341             aix_use_runtimelinking=yes
5342             break
5343           ;;
5344           esac
5345         done
5346       esac
5347
5348       exp_sym_flag='-bexport'
5349       no_entry_flag='-bnoentry'
5350     fi
5351
5352     # When large executables or shared objects are built, AIX ld can
5353     # have problems creating the table of contents.  If linking a library
5354     # or program results in "error TOC overflow" add -mminimal-toc to
5355     # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5356     # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5357
5358     hardcode_direct=yes
5359     archive_cmds=''
5360     hardcode_libdir_separator=':'
5361     if test "$GCC" = yes; then
5362       case $host_os in aix4.[012]|aix4.[012].*)
5363         collect2name=`${CC} -print-prog-name=collect2`
5364         if test -f "$collect2name" && \
5365           strings "$collect2name" | grep resolve_lib_name >/dev/null
5366         then
5367           # We have reworked collect2
5368           hardcode_direct=yes
5369         else
5370           # We have old collect2
5371           hardcode_direct=unsupported
5372           # It fails to find uninstalled libraries when the uninstalled
5373           # path is not listed in the libpath.  Setting hardcode_minus_L
5374           # to unsupported forces relinking
5375           hardcode_minus_L=yes
5376           hardcode_libdir_flag_spec='-L$libdir'
5377           hardcode_libdir_separator=
5378         fi
5379       esac
5380
5381       shared_flag='-shared'
5382     else
5383       # not using gcc
5384       if test "$host_cpu" = ia64; then
5385         shared_flag='${wl}-G'
5386       else
5387         if test "$aix_use_runtimelinking" = yes; then
5388           shared_flag='${wl}-G'
5389         else
5390           shared_flag='${wl}-bM:SRE'
5391         fi
5392       fi
5393     fi
5394
5395     # It seems that -bexpall can do strange things, so it is better to
5396     # generate a list of symbols to export.
5397     always_export_symbols=yes
5398     if test "$aix_use_runtimelinking" = yes; then
5399       # Warning - without using the other runtime loading flags (-brtl),
5400       # -berok will link without error, but may produce a broken library.
5401       allow_undefined_flag='-berok'
5402       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
5403       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"
5404     else
5405       if test "$host_cpu" = ia64; then
5406         hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
5407         allow_undefined_flag="-z nodefs"
5408         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"
5409       else
5410         hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
5411         # Warning - without using the other run time loading flags,
5412         # -berok will link without error, but may produce a broken library.
5413         allow_undefined_flag='${wl}-berok'
5414         # This is a bit strange, but is similar to how AIX traditionally builds
5415         # it's shared libraries.
5416         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'
5417       fi
5418     fi
5419     ;;
5420
5421   amigaos*)
5422     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)'
5423     hardcode_libdir_flag_spec='-L$libdir'
5424     hardcode_minus_L=yes
5425     # see comment about different semantics on the GNU ld section
5426     ld_shlibs=no
5427     ;;
5428
5429   cygwin* | mingw* | pw32*)
5430     # When not using gcc, we currently assume that we are using
5431     # Microsoft Visual C++.
5432     # hardcode_libdir_flag_spec is actually meaningless, as there is
5433     # no search path for DLLs.
5434     hardcode_libdir_flag_spec=' '
5435     allow_undefined_flag=unsupported
5436     # Tell ltmain to make .lib files, not .a files.
5437     libext=lib
5438     # FIXME: Setting linknames here is a bad hack.
5439     archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
5440     # The linker will automatically build a .lib file if we build a DLL.
5441     old_archive_from_new_cmds='true'
5442     # FIXME: Should let the user specify the lib program.
5443     old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
5444     fix_srcfile_path='`cygpath -w "$srcfile"`'
5445     ;;
5446
5447   darwin* | rhapsody*)
5448     case "$host_os" in
5449     rhapsody* | darwin1.[012])
5450       allow_undefined_flag='-undefined suppress'
5451       ;;
5452     *) # Darwin 1.3 on
5453       allow_undefined_flag='-flat_namespace -undefined suppress'
5454       ;;
5455     esac
5456     # FIXME: Relying on posixy $() will cause problems for
5457     #        cross-compilation, but unfortunately the echo tests do not
5458     #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
5459     #        `"' quotes if we put them in here... so don't!
5460     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)'
5461     # We need to add '_' to the symbols in $export_symbols first
5462     #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
5463     hardcode_direct=yes
5464     hardcode_shlibpath_var=no
5465     whole_archive_flag_spec='-all_load $convenience'
5466     ;;
5467
5468   freebsd1*)
5469     ld_shlibs=no
5470     ;;
5471
5472   # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5473   # support.  Future versions do this automatically, but an explicit c++rt0.o
5474   # does not break anything, and helps significantly (at the cost of a little
5475   # extra space).
5476   freebsd2.2*)
5477     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5478     hardcode_libdir_flag_spec='-R$libdir'
5479     hardcode_direct=yes
5480     hardcode_shlibpath_var=no
5481     ;;
5482
5483   # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5484   freebsd2*)
5485     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5486     hardcode_direct=yes
5487     hardcode_minus_L=yes
5488     hardcode_shlibpath_var=no
5489     ;;
5490
5491   # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5492   freebsd*)
5493     archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
5494     hardcode_libdir_flag_spec='-R$libdir'
5495     hardcode_direct=yes
5496     hardcode_shlibpath_var=no
5497     ;;
5498
5499   hpux9* | hpux10* | hpux11*)
5500     case $host_os in
5501     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' ;;
5502     *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
5503     esac
5504     hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
5505     hardcode_libdir_separator=:
5506     hardcode_direct=yes
5507     hardcode_minus_L=yes # Not in the search PATH, but as the default
5508                          # location of the library.
5509     export_dynamic_flag_spec='${wl}-E'
5510     ;;
5511
5512   irix5* | irix6* | nonstopux*)
5513     if test "$GCC" = yes; then
5514       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'
5515       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5516     else
5517       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'
5518       hardcode_libdir_flag_spec='-rpath $libdir'
5519     fi
5520     hardcode_libdir_separator=:
5521     link_all_deplibs=yes
5522     ;;
5523
5524   netbsd*)
5525     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5526       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5527     else
5528       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5529     fi
5530     hardcode_libdir_flag_spec='-R$libdir'
5531     hardcode_direct=yes
5532     hardcode_shlibpath_var=no
5533     ;;
5534
5535   newsos6)
5536     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5537     hardcode_direct=yes
5538     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5539     hardcode_libdir_separator=:
5540     hardcode_shlibpath_var=no
5541     ;;
5542
5543   openbsd*)
5544     hardcode_direct=yes
5545     hardcode_shlibpath_var=no
5546     if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5547       archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5548       hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
5549       export_dynamic_flag_spec='${wl}-E'
5550     else
5551       case "$host_os" in
5552       openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
5553         archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5554         hardcode_libdir_flag_spec='-R$libdir'
5555         ;;
5556       *)
5557         archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5558         hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
5559         ;;
5560       esac
5561     fi
5562     ;;
5563
5564   openedition*)
5565     archive_cmds="\$CC -Wl,DLL \$libobjs \$deplibs \$compiler_flags -o \$lib &&
5566         cp \$linknames \$output_objdir && linknames=''"
5567     export_dynamic_flag_spec="-Wl,DLL"
5568     ;;
5569
5570   os2*)
5571     hardcode_libdir_flag_spec='-L$libdir'
5572     hardcode_minus_L=yes
5573     allow_undefined_flag=unsupported
5574     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'
5575     old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
5576     ;;
5577
5578   osf3*)
5579     if test "$GCC" = yes; then
5580       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
5581       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'
5582     else
5583       allow_undefined_flag=' -expect_unresolved \*'
5584       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'
5585     fi
5586     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5587     hardcode_libdir_separator=:
5588     ;;
5589
5590   osf4* | osf5*)        # as osf3* with the addition of -msym flag
5591     if test "$GCC" = yes; then
5592       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
5593       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'
5594       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5595     else
5596       allow_undefined_flag=' -expect_unresolved \*'
5597       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'
5598       archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
5599       $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'
5600
5601       #Both c and cxx compiler support -rpath directly
5602       hardcode_libdir_flag_spec='-rpath $libdir'
5603     fi
5604     hardcode_libdir_separator=:
5605     ;;
5606
5607   sco3.2v5*)
5608     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5609     hardcode_shlibpath_var=no
5610     runpath_var=LD_RUN_PATH
5611     hardcode_runpath_var=yes
5612     export_dynamic_flag_spec='${wl}-Bexport'
5613     ;;
5614
5615   solaris*)
5616     # gcc --version < 3.0 without binutils cannot create self contained
5617     # shared libraries reliably, requiring libgcc.a to resolve some of
5618     # the object symbols generated in some cases.  Libraries that use
5619     # assert need libgcc.a to resolve __eprintf, for example.  Linking
5620     # a copy of libgcc.a into every shared library to guarantee resolving
5621     # such symbols causes other problems:  According to Tim Van Holder
5622     # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
5623     # (to the application) exception stack for one thing.
5624     no_undefined_flag=' -z defs'
5625     if test "$GCC" = yes; then
5626       case `$CC --version 2>/dev/null` in
5627       [12].*)
5628         cat <<EOF 1>&2
5629
5630 *** Warning: Releases of GCC earlier than version 3.0 cannot reliably
5631 *** create self contained shared libraries on Solaris systems, without
5632 *** introducing a dependency on libgcc.a.  Therefore, libtool is disabling
5633 *** -no-undefined support, which will at least allow you to build shared
5634 *** libraries.  However, you may find that when you link such libraries
5635 *** into an application without using GCC, you have to manually add
5636 *** \`gcc --print-libgcc-file-name\` to the link command.  We urge you to
5637 *** upgrade to a newer version of GCC.  Another option is to rebuild your
5638 *** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
5639
5640 EOF
5641         no_undefined_flag=
5642         ;;
5643       esac
5644     fi
5645     # $CC -shared without GNU ld will not create a library from C++
5646     # object files and a static libstdc++, better avoid it by now
5647     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
5648     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
5649                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
5650     hardcode_libdir_flag_spec='-R$libdir'
5651     hardcode_shlibpath_var=no
5652     case $host_os in
5653     solaris2.[0-5] | solaris2.[0-5].*) ;;
5654     *) # Supported since Solaris 2.6 (maybe 2.5.1?)
5655       whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
5656     esac
5657     link_all_deplibs=yes
5658     ;;
5659
5660   sunos4*)
5661     if test "x$host_vendor" = xsequent; then
5662       # Use $CC to link under sequent, because it throws in some extra .o
5663       # files that make .init and .fini sections work.
5664       archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5665     else
5666       archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5667     fi
5668     hardcode_libdir_flag_spec='-L$libdir'
5669     hardcode_direct=yes
5670     hardcode_minus_L=yes
5671     hardcode_shlibpath_var=no
5672     ;;
5673
5674   sysv4)
5675     case $host_vendor in
5676       sni)
5677         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5678         hardcode_direct=yes # is this really true???
5679         ;;
5680       siemens)
5681         ## LD is ld it makes a PLAMLIB
5682         ## CC just makes a GrossModule.
5683         archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5684         reload_cmds='$CC -r -o $output$reload_objs'
5685         hardcode_direct=no
5686         ;;
5687       motorola)
5688         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5689         hardcode_direct=no #Motorola manual says yes, but my tests say they lie
5690         ;;
5691     esac
5692     runpath_var='LD_RUN_PATH'
5693     hardcode_shlibpath_var=no
5694     ;;
5695
5696   sysv4.3*)
5697     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5698     hardcode_shlibpath_var=no
5699     export_dynamic_flag_spec='-Bexport'
5700     ;;
5701
5702   sysv5*)
5703     no_undefined_flag=' -z text'
5704     # $CC -shared without GNU ld will not create a library from C++
5705     # object files and a static libstdc++, better avoid it by now
5706     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
5707     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
5708                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
5709     hardcode_libdir_flag_spec=
5710     hardcode_shlibpath_var=no
5711     runpath_var='LD_RUN_PATH'
5712     ;;
5713
5714   uts4*)
5715     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5716     hardcode_libdir_flag_spec='-L$libdir'
5717     hardcode_shlibpath_var=no
5718     ;;
5719
5720   dgux*)
5721     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5722     hardcode_libdir_flag_spec='-L$libdir'
5723     hardcode_shlibpath_var=no
5724     ;;
5725
5726   sysv4*MP*)
5727     if test -d /usr/nec; then
5728       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5729       hardcode_shlibpath_var=no
5730       runpath_var=LD_RUN_PATH
5731       hardcode_runpath_var=yes
5732       ld_shlibs=yes
5733     fi
5734     ;;
5735
5736   sysv4.2uw2*)
5737     archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5738     hardcode_direct=yes
5739     hardcode_minus_L=no
5740     hardcode_shlibpath_var=no
5741     hardcode_runpath_var=yes
5742     runpath_var=LD_RUN_PATH
5743     ;;
5744
5745   sysv5uw7* | unixware7*)
5746     no_undefined_flag='${wl}-z ${wl}text'
5747     if test "$GCC" = yes; then
5748       archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5749     else
5750       archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5751     fi
5752     runpath_var='LD_RUN_PATH'
5753     hardcode_shlibpath_var=no
5754     ;;
5755
5756   *)
5757     ld_shlibs=no
5758     ;;
5759   esac
5760 fi
5761 echo "$ac_t""$ld_shlibs" 1>&6
5762 test "$ld_shlibs" = no && can_build_shared=no
5763
5764 # Check hardcoding attributes.
5765 echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6
5766 echo "configure:5767: checking how to hardcode library paths into programs" >&5
5767 hardcode_action=
5768 if test -n "$hardcode_libdir_flag_spec" || \
5769    test -n "$runpath_var"; then
5770
5771   # We can hardcode non-existant directories.
5772   if test "$hardcode_direct" != no &&
5773      # If the only mechanism to avoid hardcoding is shlibpath_var, we
5774      # have to relink, otherwise we might link with an installed library
5775      # when we should be linking with a yet-to-be-installed one
5776      ## test "$hardcode_shlibpath_var" != no &&
5777      test "$hardcode_minus_L" != no; then
5778     # Linking always hardcodes the temporary library directory.
5779     hardcode_action=relink
5780   else
5781     # We can link without hardcoding, and we can hardcode nonexisting dirs.
5782     hardcode_action=immediate
5783   fi
5784 else
5785   # We cannot hardcode anything, or else we can only hardcode existing
5786   # directories.
5787   hardcode_action=unsupported
5788 fi
5789 echo "$ac_t""$hardcode_action" 1>&6
5790
5791 striplib=
5792 old_striplib=
5793 echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6
5794 echo "configure:5795: checking whether stripping libraries is possible" >&5
5795 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
5796   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
5797   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
5798   echo "$ac_t""yes" 1>&6
5799 else
5800   echo "$ac_t""no" 1>&6
5801 fi
5802
5803 reload_cmds='$LD$reload_flag -o $output$reload_objs'
5804 test -z "$deplibs_check_method" && deplibs_check_method=unknown
5805
5806 # PORTME Fill in your ld.so characteristics
5807 echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6
5808 echo "configure:5809: checking dynamic linker characteristics" >&5
5809 library_names_spec=
5810 libname_spec='lib$name'
5811 soname_spec=
5812 postinstall_cmds=
5813 postuninstall_cmds=
5814 finish_cmds=
5815 finish_eval=
5816 shlibpath_var=
5817 shlibpath_overrides_runpath=unknown
5818 version_type=none
5819 dynamic_linker="$host_os ld.so"
5820 sys_lib_dlsearch_path_spec="/lib /usr/lib"
5821 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
5822
5823 case $host_os in
5824 aix3*)
5825   version_type=linux
5826   library_names_spec='${libname}${release}.so$versuffix $libname.a'
5827   shlibpath_var=LIBPATH
5828
5829   # AIX has no versioning support, so we append a major version to the name.
5830   soname_spec='${libname}${release}.so$major'
5831   ;;
5832
5833 aix4* | aix5*)
5834   version_type=linux
5835   need_lib_prefix=no
5836   need_version=no
5837   hardcode_into_libs=yes
5838   if test "$host_cpu" = ia64; then
5839     # AIX 5 supports IA64
5840     library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
5841     shlibpath_var=LD_LIBRARY_PATH
5842   else
5843     # With GCC up to 2.95.x, collect2 would create an import file
5844     # for dependence libraries.  The import file would start with
5845     # the line `#! .'.  This would cause the generated library to
5846     # depend on `.', always an invalid library.  This was fixed in
5847     # development snapshots of GCC prior to 3.0.
5848     case $host_os in
5849       aix4 | aix4.[01] | aix4.[01].*)
5850         if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
5851              echo ' yes '
5852              echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
5853           :
5854         else
5855           can_build_shared=no
5856         fi
5857         ;;
5858     esac
5859     # AIX (on Power*) has no versioning support, so currently we can
5860     # not hardcode correct soname into executable. Probably we can
5861     # add versioning support to collect2, so additional links can
5862     # be useful in future.
5863     if test "$aix_use_runtimelinking" = yes; then
5864       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
5865       # instead of lib<name>.a to let people know that these are not
5866       # typical AIX shared libraries.
5867       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
5868     else
5869       # We preserve .a as extension for shared libraries through AIX4.2
5870       # and later when we are not doing run time linking.
5871       library_names_spec='${libname}${release}.a $libname.a'
5872       soname_spec='${libname}${release}.so$major'
5873     fi
5874     shlibpath_var=LIBPATH
5875   fi
5876   hardcode_into_libs=yes
5877   ;;
5878
5879 amigaos*)
5880   library_names_spec='$libname.ixlibrary $libname.a'
5881   # Create ${libname}_ixlibrary.a entries in /sys/libs.
5882   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'
5883   ;;
5884
5885 beos*)
5886   library_names_spec='${libname}.so'
5887   dynamic_linker="$host_os ld.so"
5888   shlibpath_var=LIBRARY_PATH
5889   ;;
5890
5891 bsdi4*)
5892   version_type=linux
5893   need_version=no
5894   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
5895   soname_spec='${libname}${release}.so$major'
5896   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
5897   shlibpath_var=LD_LIBRARY_PATH
5898   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
5899   sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
5900   export_dynamic_flag_spec=-rdynamic
5901   # the default ld.so.conf also contains /usr/contrib/lib and
5902   # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
5903   # libtool to hard-code these into programs
5904   ;;
5905
5906 cygwin* | mingw* | pw32*)
5907   version_type=windows
5908   need_version=no
5909   need_lib_prefix=no
5910   case $GCC,$host_os in
5911   yes,cygwin*)
5912     library_names_spec='$libname.dll.a'
5913     soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
5914     postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
5915       dldir=$destdir/`dirname \$dlpath`~
5916       test -d \$dldir || mkdir -p \$dldir~
5917       $install_prog .libs/$dlname \$dldir/$dlname'
5918     postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
5919       dlpath=$dir/\$dldll~
5920        $rm \$dlpath'
5921     ;;
5922   yes,mingw*)
5923     library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
5924     sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
5925     ;;
5926   yes,pw32*)
5927     library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll'
5928     ;;
5929   *)
5930     library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
5931     ;;
5932   esac
5933   dynamic_linker='Win32 ld.exe'
5934   # FIXME: first we should search . and the directory the executable is in
5935   shlibpath_var=PATH
5936   ;;
5937
5938 darwin* | rhapsody*)
5939   dynamic_linker="$host_os dyld"
5940   version_type=darwin
5941   need_lib_prefix=no
5942   need_version=no
5943   # FIXME: Relying on posixy $() will cause problems for
5944   #        cross-compilation, but unfortunately the echo tests do not
5945   #        yet detect zsh echo's removal of \ escapes.
5946   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)'
5947   soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
5948   shlibpath_overrides_runpath=yes
5949   shlibpath_var=DYLD_LIBRARY_PATH
5950   ;;
5951
5952 freebsd1*)
5953   dynamic_linker=no
5954   ;;
5955
5956 freebsd*)
5957   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
5958   version_type=freebsd-$objformat
5959   case $version_type in
5960     freebsd-elf*)
5961       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
5962       need_version=no
5963       need_lib_prefix=no
5964       ;;
5965     freebsd-*)
5966       library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
5967       need_version=yes
5968       ;;
5969   esac
5970   shlibpath_var=LD_LIBRARY_PATH
5971   case $host_os in
5972   freebsd2*)
5973     shlibpath_overrides_runpath=yes
5974     ;;
5975   *)
5976     shlibpath_overrides_runpath=no
5977     hardcode_into_libs=yes
5978     ;;
5979   esac
5980   ;;
5981
5982 gnu*)
5983   version_type=linux
5984   need_lib_prefix=no
5985   need_version=no
5986   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
5987   soname_spec='${libname}${release}.so$major'
5988   shlibpath_var=LD_LIBRARY_PATH
5989   hardcode_into_libs=yes
5990   ;;
5991
5992 hpux9* | hpux10* | hpux11*)
5993   # Give a soname corresponding to the major version so that dld.sl refuses to
5994   # link against other versions.
5995   dynamic_linker="$host_os dld.sl"
5996   version_type=sunos
5997   need_lib_prefix=no
5998   need_version=no
5999   shlibpath_var=SHLIB_PATH
6000   shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
6001   library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
6002   soname_spec='${libname}${release}.sl$major'
6003   # HP-UX runs *really* slowly unless shared libraries are mode 555.
6004   postinstall_cmds='chmod 555 $lib'
6005   ;;
6006
6007 irix5* | irix6* | nonstopux*)
6008   case $host_os in
6009     nonstopux*) version_type=nonstopux ;;
6010     *)          version_type=irix ;;
6011   esac
6012   need_lib_prefix=no
6013   need_version=no
6014   soname_spec='${libname}${release}.so$major'
6015   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
6016   case $host_os in
6017   irix5* | nonstopux*)
6018     libsuff= shlibsuff=
6019     ;;
6020   *)
6021     case $LD in # libtool.m4 will add one of these switches to LD
6022     *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
6023     *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
6024     *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
6025     *) libsuff= shlibsuff= libmagic=never-match;;
6026     esac
6027     ;;
6028   esac
6029   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
6030   shlibpath_overrides_runpath=no
6031   sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
6032   sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
6033   ;;
6034
6035 # No shared lib support for Linux oldld, aout, or coff.
6036 linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
6037   dynamic_linker=no
6038   ;;
6039
6040 # This must be Linux ELF.
6041 linux-gnu*)
6042   version_type=linux
6043   need_lib_prefix=no
6044   need_version=no
6045   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6046   soname_spec='${libname}${release}.so$major'
6047   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
6048   shlibpath_var=LD_LIBRARY_PATH
6049   shlibpath_overrides_runpath=no
6050   # This implies no fast_install, which is unacceptable.
6051   # Some rework will be needed to allow for fast_install
6052   # before this can be enabled.
6053   hardcode_into_libs=yes
6054
6055   # We used to test for /lib/ld.so.1 and disable shared libraries on
6056   # powerpc, because MkLinux only supported shared libraries with the
6057   # GNU dynamic linker.  Since this was broken with cross compilers,
6058   # most powerpc-linux boxes support dynamic linking these days and
6059   # people can always --disable-shared, the test was removed, and we
6060   # assume the GNU/Linux dynamic linker is in use.
6061   dynamic_linker='GNU/Linux ld.so'
6062   ;;
6063
6064 netbsd*)
6065   version_type=sunos
6066   need_lib_prefix=no
6067   need_version=no
6068   if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6069     library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6070     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6071     dynamic_linker='NetBSD (a.out) ld.so'
6072   else
6073     library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
6074     soname_spec='${libname}${release}.so$major'
6075     dynamic_linker='NetBSD ld.elf_so'
6076   fi
6077   shlibpath_var=LD_LIBRARY_PATH
6078   shlibpath_overrides_runpath=yes
6079   hardcode_into_libs=yes
6080   ;;
6081
6082 newsos6)
6083   version_type=linux
6084   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6085   shlibpath_var=LD_LIBRARY_PATH
6086   shlibpath_overrides_runpath=yes
6087   ;;
6088
6089 openbsd*)
6090   version_type=sunos
6091   need_lib_prefix=no
6092   need_version=no
6093   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6094     case "$host_os" in
6095     openbsd2.[89] | openbsd2.[89].*)
6096       shlibpath_overrides_runpath=no
6097       ;;
6098     *)
6099       shlibpath_overrides_runpath=yes
6100       ;;
6101     esac
6102   else
6103     shlibpath_overrides_runpath=yes
6104   fi
6105   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6106   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6107   shlibpath_var=LD_LIBRARY_PATH
6108   ;;
6109
6110 openedition*)
6111   need_lib_prefix=no
6112   need_version=no
6113   shlibpath_overrides_runpath=yes
6114   shlibpath_var=LIBPATH
6115   postinstall_cmds="rm \$destdir/\$linkname; cp \$linkname \$destdir; chmod a+x \$lib"
6116   # the library's exports are in libname.x; this is the file that must
6117   # actually be linked with to use a DLL.
6118   library_names_spec="\${libname}\${release}.so\$versuffix \${libname}.x"
6119   ;;
6120
6121 os2*)
6122   libname_spec='$name'
6123   need_lib_prefix=no
6124   library_names_spec='$libname.dll $libname.a'
6125   dynamic_linker='OS/2 ld.exe'
6126   shlibpath_var=LIBPATH
6127   ;;
6128
6129 osf3* | osf4* | osf5*)
6130   version_type=osf
6131   need_version=no
6132   soname_spec='${libname}${release}.so$major'
6133   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6134   shlibpath_var=LD_LIBRARY_PATH
6135   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
6136   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
6137   hardcode_into_libs=yes
6138   ;;
6139
6140 sco3.2v5*)
6141   version_type=osf
6142   soname_spec='${libname}${release}.so$major'
6143   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6144   shlibpath_var=LD_LIBRARY_PATH
6145   ;;
6146
6147 solaris*)
6148   version_type=linux
6149   need_lib_prefix=no
6150   need_version=no
6151   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6152   soname_spec='${libname}${release}.so$major'
6153   shlibpath_var=LD_LIBRARY_PATH
6154   shlibpath_overrides_runpath=yes
6155   hardcode_into_libs=yes
6156   # ldd complains unless libraries are executable
6157   postinstall_cmds='chmod +x $lib'
6158   ;;
6159
6160 sunos4*)
6161   version_type=sunos
6162   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6163   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
6164   shlibpath_var=LD_LIBRARY_PATH
6165   shlibpath_overrides_runpath=yes
6166   if test "$with_gnu_ld" = yes; then
6167     need_lib_prefix=no
6168   fi
6169   need_version=yes
6170   ;;
6171
6172 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6173   version_type=linux
6174   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6175   soname_spec='${libname}${release}.so$major'
6176   shlibpath_var=LD_LIBRARY_PATH
6177   case $host_vendor in
6178     sni)
6179       shlibpath_overrides_runpath=no
6180       need_lib_prefix=no
6181       export_dynamic_flag_spec='${wl}-Blargedynsym'
6182       runpath_var=LD_RUN_PATH
6183       ;;
6184     siemens)
6185       need_lib_prefix=no
6186       ;;
6187     motorola)
6188       need_lib_prefix=no
6189       need_version=no
6190       shlibpath_overrides_runpath=no
6191       sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
6192       ;;
6193   esac
6194   ;;
6195
6196 uts4*)
6197   version_type=linux
6198   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6199   soname_spec='${libname}${release}.so$major'
6200   shlibpath_var=LD_LIBRARY_PATH
6201   ;;
6202
6203 dgux*)
6204   version_type=linux
6205   need_lib_prefix=no
6206   need_version=no
6207   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6208   soname_spec='${libname}${release}.so$major'
6209   shlibpath_var=LD_LIBRARY_PATH
6210   ;;
6211
6212 sysv4*MP*)
6213   if test -d /usr/nec ;then
6214     version_type=linux
6215     library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
6216     soname_spec='$libname.so.$major'
6217     shlibpath_var=LD_LIBRARY_PATH
6218   fi
6219   ;;
6220
6221 *)
6222   dynamic_linker=no
6223   ;;
6224 esac
6225 echo "$ac_t""$dynamic_linker" 1>&6
6226 test "$dynamic_linker" = no && can_build_shared=no
6227
6228 # Report the final consequences.
6229 echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6
6230 echo "configure:6231: checking if libtool supports shared libraries" >&5
6231 echo "$ac_t""$can_build_shared" 1>&6
6232
6233 echo $ac_n "checking whether to build shared libraries""... $ac_c" 1>&6
6234 echo "configure:6235: checking whether to build shared libraries" >&5
6235 test "$can_build_shared" = "no" && enable_shared=no
6236
6237 # On AIX, shared libraries and static libraries use the same namespace, and
6238 # are all built from PIC.
6239 case "$host_os" in
6240 aix3*)
6241   test "$enable_shared" = yes && enable_static=no
6242   if test -n "$RANLIB"; then
6243     archive_cmds="$archive_cmds~\$RANLIB \$lib"
6244     postinstall_cmds='$RANLIB $lib'
6245   fi
6246   ;;
6247
6248 aix4*)
6249   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6250     test "$enable_shared" = yes && enable_static=no
6251   fi
6252   ;;
6253 esac
6254 echo "$ac_t""$enable_shared" 1>&6
6255
6256 echo $ac_n "checking whether to build static libraries""... $ac_c" 1>&6
6257 echo "configure:6258: checking whether to build static libraries" >&5
6258 # Make sure either enable_shared or enable_static is yes.
6259 test "$enable_shared" = yes || enable_static=yes
6260 echo "$ac_t""$enable_static" 1>&6
6261
6262 if test "$hardcode_action" = relink; then
6263   # Fast installation is not supported
6264   enable_fast_install=no
6265 elif test "$shlibpath_overrides_runpath" = yes ||
6266      test "$enable_shared" = no; then
6267   # Fast installation is not necessary
6268   enable_fast_install=needless
6269 fi
6270
6271 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
6272 if test "$GCC" = yes; then
6273   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
6274 fi
6275
6276 if test "x$enable_dlopen" != xyes; then
6277   enable_dlopen=unknown
6278   enable_dlopen_self=unknown
6279   enable_dlopen_self_static=unknown
6280 else
6281   lt_cv_dlopen=no
6282   lt_cv_dlopen_libs=
6283
6284   case $host_os in
6285   beos*)
6286     lt_cv_dlopen="load_add_on"
6287     lt_cv_dlopen_libs=
6288     lt_cv_dlopen_self=yes
6289     ;;
6290
6291   cygwin* | mingw* | pw32*)
6292     lt_cv_dlopen="LoadLibrary"
6293     lt_cv_dlopen_libs=
6294    ;;
6295
6296   *)
6297     echo $ac_n "checking for dllload""... $ac_c" 1>&6
6298 echo "configure:6299: checking for dllload" >&5
6299 if eval "test \"\${ac_cv_func_dllload+set}\" = set"; then
6300   echo $ac_n "(cached) $ac_c" 1>&6
6301 else
6302   cat > conftest.$ac_ext <<EOF
6303 #line 6304 "configure"
6304 #include "confdefs.h"
6305 /* System header to define __stub macros and hopefully few prototypes,
6306     which can conflict with char dllload(); below.  */
6307 #include <assert.h>
6308 /* Override any gcc2 internal prototype to avoid an error.  */
6309 /* We use char because int might match the return type of a gcc2
6310     builtin and then its argument prototype would still apply.  */
6311 char dllload();
6312 char (*f)();
6313
6314 int main() {
6315
6316 /* The GNU C library defines this for functions which it implements
6317     to always fail with ENOSYS.  Some functions are actually named
6318     something starting with __ and the normal name is an alias.  */
6319 #if defined (__stub_dllload) || defined (__stub___dllload)
6320 choke me
6321 #else
6322 f = dllload;
6323 #endif
6324
6325 ; return 0; }
6326 EOF
6327 if { (eval echo configure:6328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6328   rm -rf conftest*
6329   eval "ac_cv_func_dllload=yes"
6330 else
6331   echo "configure: failed program was:" >&5
6332   cat conftest.$ac_ext >&5
6333   rm -rf conftest*
6334   eval "ac_cv_func_dllload=no"
6335 fi
6336 rm -f conftest*
6337 fi
6338
6339 if eval "test \"`echo '$ac_cv_func_'dllload`\" = yes"; then
6340   echo "$ac_t""yes" 1>&6
6341   lt_cv_dlopen="dllload"
6342 else
6343   echo "$ac_t""no" 1>&6
6344 echo $ac_n "checking for shl_load""... $ac_c" 1>&6
6345 echo "configure:6346: checking for shl_load" >&5
6346 if eval "test \"\${ac_cv_func_shl_load+set}\" = set"; then
6347   echo $ac_n "(cached) $ac_c" 1>&6
6348 else
6349   cat > conftest.$ac_ext <<EOF
6350 #line 6351 "configure"
6351 #include "confdefs.h"
6352 /* System header to define __stub macros and hopefully few prototypes,
6353     which can conflict with char shl_load(); below.  */
6354 #include <assert.h>
6355 /* Override any gcc2 internal prototype to avoid an error.  */
6356 /* We use char because int might match the return type of a gcc2
6357     builtin and then its argument prototype would still apply.  */
6358 char shl_load();
6359 char (*f)();
6360
6361 int main() {
6362
6363 /* The GNU C library defines this for functions which it implements
6364     to always fail with ENOSYS.  Some functions are actually named
6365     something starting with __ and the normal name is an alias.  */
6366 #if defined (__stub_shl_load) || defined (__stub___shl_load)
6367 choke me
6368 #else
6369 f = shl_load;
6370 #endif
6371
6372 ; return 0; }
6373 EOF
6374 if { (eval echo configure:6375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6375   rm -rf conftest*
6376   eval "ac_cv_func_shl_load=yes"
6377 else
6378   echo "configure: failed program was:" >&5
6379   cat conftest.$ac_ext >&5
6380   rm -rf conftest*
6381   eval "ac_cv_func_shl_load=no"
6382 fi
6383 rm -f conftest*
6384 fi
6385
6386 if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
6387   echo "$ac_t""yes" 1>&6
6388   lt_cv_dlopen="shl_load"
6389 else
6390   echo "$ac_t""no" 1>&6
6391 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
6392 echo "configure:6393: checking for shl_load in -ldld" >&5
6393 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-:%__p__%'`
6394 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6395   echo $ac_n "(cached) $ac_c" 1>&6
6396 else
6397   ac_save_LIBS="$LIBS"
6398 LIBS="-ldld  $LIBS"
6399 cat > conftest.$ac_ext <<EOF
6400 #line 6401 "configure"
6401 #include "confdefs.h"
6402 /* Override any gcc2 internal prototype to avoid an error.  */
6403 /* We use char because int might match the return type of a gcc2
6404     builtin and then its argument prototype would still apply.  */
6405 char shl_load();
6406
6407 int main() {
6408 shl_load()
6409 ; return 0; }
6410 EOF
6411 if { (eval echo configure:6412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6412   rm -rf conftest*
6413   eval "ac_cv_lib_$ac_lib_var=yes"
6414 else
6415   echo "configure: failed program was:" >&5
6416   cat conftest.$ac_ext >&5
6417   rm -rf conftest*
6418   eval "ac_cv_lib_$ac_lib_var=no"
6419 fi
6420 rm -f conftest*
6421 LIBS="$ac_save_LIBS"
6422
6423 fi
6424 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6425   echo "$ac_t""yes" 1>&6
6426   lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
6427 else
6428   echo "$ac_t""no" 1>&6
6429 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
6430 echo "configure:6431: checking for dlopen" >&5
6431 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
6432   echo $ac_n "(cached) $ac_c" 1>&6
6433 else
6434   cat > conftest.$ac_ext <<EOF
6435 #line 6436 "configure"
6436 #include "confdefs.h"
6437 /* System header to define __stub macros and hopefully few prototypes,
6438     which can conflict with char dlopen(); below.  */
6439 #include <assert.h>
6440 /* Override any gcc2 internal prototype to avoid an error.  */
6441 /* We use char because int might match the return type of a gcc2
6442     builtin and then its argument prototype would still apply.  */
6443 char dlopen();
6444 char (*f)();
6445
6446 int main() {
6447
6448 /* The GNU C library defines this for functions which it implements
6449     to always fail with ENOSYS.  Some functions are actually named
6450     something starting with __ and the normal name is an alias.  */
6451 #if defined (__stub_dlopen) || defined (__stub___dlopen)
6452 choke me
6453 #else
6454 f = dlopen;
6455 #endif
6456
6457 ; return 0; }
6458 EOF
6459 if { (eval echo configure:6460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6460   rm -rf conftest*
6461   eval "ac_cv_func_dlopen=yes"
6462 else
6463   echo "configure: failed program was:" >&5
6464   cat conftest.$ac_ext >&5
6465   rm -rf conftest*
6466   eval "ac_cv_func_dlopen=no"
6467 fi
6468 rm -f conftest*
6469 fi
6470
6471 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
6472   echo "$ac_t""yes" 1>&6
6473   lt_cv_dlopen="dlopen"
6474 else
6475   echo "$ac_t""no" 1>&6
6476 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
6477 echo "configure:6478: checking for dlopen in -ldl" >&5
6478 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
6479 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6480   echo $ac_n "(cached) $ac_c" 1>&6
6481 else
6482   ac_save_LIBS="$LIBS"
6483 LIBS="-ldl  $LIBS"
6484 cat > conftest.$ac_ext <<EOF
6485 #line 6486 "configure"
6486 #include "confdefs.h"
6487 /* Override any gcc2 internal prototype to avoid an error.  */
6488 /* We use char because int might match the return type of a gcc2
6489     builtin and then its argument prototype would still apply.  */
6490 char dlopen();
6491
6492 int main() {
6493 dlopen()
6494 ; return 0; }
6495 EOF
6496 if { (eval echo configure:6497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6497   rm -rf conftest*
6498   eval "ac_cv_lib_$ac_lib_var=yes"
6499 else
6500   echo "configure: failed program was:" >&5
6501   cat conftest.$ac_ext >&5
6502   rm -rf conftest*
6503   eval "ac_cv_lib_$ac_lib_var=no"
6504 fi
6505 rm -f conftest*
6506 LIBS="$ac_save_LIBS"
6507
6508 fi
6509 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6510   echo "$ac_t""yes" 1>&6
6511   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
6512 else
6513   echo "$ac_t""no" 1>&6
6514 echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
6515 echo "configure:6516: checking for dlopen in -lsvld" >&5
6516 ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-:%__p__%'`
6517 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6518   echo $ac_n "(cached) $ac_c" 1>&6
6519 else
6520   ac_save_LIBS="$LIBS"
6521 LIBS="-lsvld  $LIBS"
6522 cat > conftest.$ac_ext <<EOF
6523 #line 6524 "configure"
6524 #include "confdefs.h"
6525 /* Override any gcc2 internal prototype to avoid an error.  */
6526 /* We use char because int might match the return type of a gcc2
6527     builtin and then its argument prototype would still apply.  */
6528 char dlopen();
6529
6530 int main() {
6531 dlopen()
6532 ; return 0; }
6533 EOF
6534 if { (eval echo configure:6535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6535   rm -rf conftest*
6536   eval "ac_cv_lib_$ac_lib_var=yes"
6537 else
6538   echo "configure: failed program was:" >&5
6539   cat conftest.$ac_ext >&5
6540   rm -rf conftest*
6541   eval "ac_cv_lib_$ac_lib_var=no"
6542 fi
6543 rm -f conftest*
6544 LIBS="$ac_save_LIBS"
6545
6546 fi
6547 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6548   echo "$ac_t""yes" 1>&6
6549   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
6550 else
6551   echo "$ac_t""no" 1>&6
6552 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
6553 echo "configure:6554: checking for dld_link in -ldld" >&5
6554 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-:%__p__%'`
6555 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6556   echo $ac_n "(cached) $ac_c" 1>&6
6557 else
6558   ac_save_LIBS="$LIBS"
6559 LIBS="-ldld  $LIBS"
6560 cat > conftest.$ac_ext <<EOF
6561 #line 6562 "configure"
6562 #include "confdefs.h"
6563 /* Override any gcc2 internal prototype to avoid an error.  */
6564 /* We use char because int might match the return type of a gcc2
6565     builtin and then its argument prototype would still apply.  */
6566 char dld_link();
6567
6568 int main() {
6569 dld_link()
6570 ; return 0; }
6571 EOF
6572 if { (eval echo configure:6573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6573   rm -rf conftest*
6574   eval "ac_cv_lib_$ac_lib_var=yes"
6575 else
6576   echo "configure: failed program was:" >&5
6577   cat conftest.$ac_ext >&5
6578   rm -rf conftest*
6579   eval "ac_cv_lib_$ac_lib_var=no"
6580 fi
6581 rm -f conftest*
6582 LIBS="$ac_save_LIBS"
6583
6584 fi
6585 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6586   echo "$ac_t""yes" 1>&6
6587   lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
6588 else
6589   echo "$ac_t""no" 1>&6
6590 fi
6591
6592               
6593 fi
6594
6595             
6596 fi
6597
6598           
6599 fi
6600
6601         
6602 fi
6603
6604       
6605 fi
6606
6607     
6608 fi
6609
6610     ;;
6611   esac
6612
6613   if test "x$lt_cv_dlopen" != xno; then
6614     enable_dlopen=yes
6615   else
6616     enable_dlopen=no
6617   fi
6618
6619   case $lt_cv_dlopen in
6620   dlopen)
6621     save_CPPFLAGS="$CPPFLAGS"
6622         test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
6623
6624     save_LDFLAGS="$LDFLAGS"
6625     eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
6626
6627     save_LIBS="$LIBS"
6628     LIBS="$lt_cv_dlopen_libs $LIBS"
6629
6630     echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
6631 echo "configure:6632: checking whether a program can dlopen itself" >&5
6632 if eval "test \"\${lt_cv_dlopen_self+set}\" = set"; then
6633   echo $ac_n "(cached) $ac_c" 1>&6
6634 else
6635           if test "$cross_compiling" = yes; then :
6636   lt_cv_dlopen_self=cross
6637 else
6638     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
6639   lt_status=$lt_dlunknown
6640   cat > conftest.$ac_ext <<EOF
6641 #line 6642 "configure"
6642 #include "confdefs.h"
6643
6644 #if HAVE_DLFCN_H
6645 #include <dlfcn.h>
6646 #endif
6647
6648 #include <stdio.h>
6649
6650 #ifdef RTLD_GLOBAL
6651 #  define LT_DLGLOBAL           RTLD_GLOBAL
6652 #else
6653 #  ifdef DL_GLOBAL
6654 #    define LT_DLGLOBAL         DL_GLOBAL
6655 #  else
6656 #    define LT_DLGLOBAL         0
6657 #  endif
6658 #endif
6659
6660 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
6661    find out it does not work in some platform. */
6662 #ifndef LT_DLLAZY_OR_NOW
6663 #  ifdef RTLD_LAZY
6664 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
6665 #  else
6666 #    ifdef DL_LAZY
6667 #      define LT_DLLAZY_OR_NOW          DL_LAZY
6668 #    else
6669 #      ifdef RTLD_NOW
6670 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
6671 #      else
6672 #        ifdef DL_NOW
6673 #          define LT_DLLAZY_OR_NOW      DL_NOW
6674 #        else
6675 #          define LT_DLLAZY_OR_NOW      0
6676 #        endif
6677 #      endif
6678 #    endif
6679 #  endif
6680 #endif
6681
6682 #ifdef __cplusplus
6683 extern "C" void exit (int);
6684 #endif
6685
6686 void fnord() { int i=42;}
6687 int main ()
6688 {
6689   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
6690   int status = $lt_dlunknown;
6691
6692   if (self)
6693     {
6694       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
6695       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
6696       /* dlclose (self); */
6697     }
6698
6699     exit (status);
6700 }
6701 EOF
6702   if { (eval echo configure:6703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
6703     (./conftest; exit; ) 2>/dev/null
6704     lt_status=$?
6705     case x$lt_status in
6706       x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
6707       x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
6708       x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
6709     esac
6710   else :
6711     # compilation failed
6712     lt_cv_dlopen_self=no
6713   fi
6714 fi
6715 rm -fr conftest*
6716
6717     
6718 fi
6719
6720 echo "$ac_t""$lt_cv_dlopen_self" 1>&6
6721
6722     if test "x$lt_cv_dlopen_self" = xyes; then
6723       LDFLAGS="$LDFLAGS $link_static_flag"
6724       echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
6725 echo "configure:6726: checking whether a statically linked program can dlopen itself" >&5
6726 if eval "test \"\${lt_cv_dlopen_self_static+set}\" = set"; then
6727   echo $ac_n "(cached) $ac_c" 1>&6
6728 else
6729           if test "$cross_compiling" = yes; then :
6730   lt_cv_dlopen_self_static=cross
6731 else
6732     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
6733   lt_status=$lt_dlunknown
6734   cat > conftest.$ac_ext <<EOF
6735 #line 6736 "configure"
6736 #include "confdefs.h"
6737
6738 #if HAVE_DLFCN_H
6739 #include <dlfcn.h>
6740 #endif
6741
6742 #include <stdio.h>
6743
6744 #ifdef RTLD_GLOBAL
6745 #  define LT_DLGLOBAL           RTLD_GLOBAL
6746 #else
6747 #  ifdef DL_GLOBAL
6748 #    define LT_DLGLOBAL         DL_GLOBAL
6749 #  else
6750 #    define LT_DLGLOBAL         0
6751 #  endif
6752 #endif
6753
6754 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
6755    find out it does not work in some platform. */
6756 #ifndef LT_DLLAZY_OR_NOW
6757 #  ifdef RTLD_LAZY
6758 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
6759 #  else
6760 #    ifdef DL_LAZY
6761 #      define LT_DLLAZY_OR_NOW          DL_LAZY
6762 #    else
6763 #      ifdef RTLD_NOW
6764 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
6765 #      else
6766 #        ifdef DL_NOW
6767 #          define LT_DLLAZY_OR_NOW      DL_NOW
6768 #        else
6769 #          define LT_DLLAZY_OR_NOW      0
6770 #        endif
6771 #      endif
6772 #    endif
6773 #  endif
6774 #endif
6775
6776 #ifdef __cplusplus
6777 extern "C" void exit (int);
6778 #endif
6779
6780 void fnord() { int i=42;}
6781 int main ()
6782 {
6783   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
6784   int status = $lt_dlunknown;
6785
6786   if (self)
6787     {
6788       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
6789       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
6790       /* dlclose (self); */
6791     }
6792
6793     exit (status);
6794 }
6795 EOF
6796   if { (eval echo configure:6797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
6797     (./conftest; exit; ) 2>/dev/null
6798     lt_status=$?
6799     case x$lt_status in
6800       x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
6801       x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
6802       x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
6803     esac
6804   else :
6805     # compilation failed
6806     lt_cv_dlopen_self_static=no
6807   fi
6808 fi
6809 rm -fr conftest*
6810
6811       
6812 fi
6813
6814 echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
6815     fi
6816
6817     CPPFLAGS="$save_CPPFLAGS"
6818     LDFLAGS="$save_LDFLAGS"
6819     LIBS="$save_LIBS"
6820     ;;
6821   esac
6822
6823   case $lt_cv_dlopen_self in
6824   yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
6825   *) enable_dlopen_self=unknown ;;
6826   esac
6827
6828   case $lt_cv_dlopen_self_static in
6829   yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
6830   *) enable_dlopen_self_static=unknown ;;
6831   esac
6832 fi
6833
6834
6835 if test "$enable_shared" = yes && test "$GCC" = yes; then
6836   case $archive_cmds in
6837   *'~'*)
6838     # FIXME: we may have to deal with multi-command sequences.
6839     ;;
6840   '$CC '*)
6841     # Test whether the compiler implicitly links with -lc since on some
6842     # systems, -lgcc has to come before -lc. If gcc already passes -lc
6843     # to ld, don't add -lc before -lgcc.
6844     echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6
6845 echo "configure:6846: checking whether -lc should be explicitly linked in" >&5
6846     if eval "test \"\${lt_cv_archive_cmds_need_lc+set}\" = set"; then
6847   echo $ac_n "(cached) $ac_c" 1>&6
6848 else
6849   $rm conftest*
6850     echo 'static int dummy;' > conftest.$ac_ext
6851
6852     if { (eval echo configure:6853: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6853       soname=conftest
6854       lib=conftest
6855       libobjs=conftest.$ac_objext
6856       deplibs=
6857       wl=$lt_cv_prog_cc_wl
6858       compiler_flags=-v
6859       linker_flags=-v
6860       verstring=
6861       output_objdir=.
6862       libname=conftest
6863       save_allow_undefined_flag=$allow_undefined_flag
6864       allow_undefined_flag=
6865       if { (eval echo configure:6866: \"$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; }
6866       then
6867         lt_cv_archive_cmds_need_lc=no
6868       else
6869         lt_cv_archive_cmds_need_lc=yes
6870       fi
6871       allow_undefined_flag=$save_allow_undefined_flag
6872     else
6873       cat conftest.err 1>&5
6874     fi
6875 fi
6876
6877     echo "$ac_t""$lt_cv_archive_cmds_need_lc" 1>&6
6878     ;;
6879   esac
6880 fi
6881 need_lc=${lt_cv_archive_cmds_need_lc-yes}
6882
6883 # The second clause should only fire when bootstrapping the
6884 # libtool distribution, otherwise you forgot to ship ltmain.sh
6885 # with your package, and you will get complaints that there are
6886 # no rules to generate ltmain.sh.
6887 if test -f "$ltmain"; then
6888   :
6889 else
6890   # If there is no Makefile yet, we rely on a make rule to execute
6891   # `config.status --recheck' to rerun these tests and create the
6892   # libtool script then.
6893   test -f Makefile && make "$ltmain"
6894 fi
6895
6896 if test -f "$ltmain"; then
6897   trap "$rm \"${ofile}T\"; exit 1" 1 2 15
6898   $rm -f "${ofile}T"
6899
6900   echo creating $ofile
6901
6902   # Now quote all the things that may contain metacharacters while being
6903   # careful not to overquote the AC_SUBSTed values.  We take copies of the
6904   # variables and quote the copies for generation of the libtool script.
6905   for var in echo old_CC old_CFLAGS SED \
6906     AR AR_FLAGS CC LD LN_S NM SHELL \
6907     reload_flag reload_cmds wl \
6908     pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
6909     thread_safe_flag_spec whole_archive_flag_spec libname_spec \
6910     library_names_spec soname_spec \
6911     RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
6912     old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
6913     postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
6914     old_striplib striplib file_magic_cmd export_symbols_cmds \
6915     deplibs_check_method allow_undefined_flag no_undefined_flag \
6916     finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
6917     global_symbol_to_c_name_address \
6918     hardcode_libdir_flag_spec hardcode_libdir_separator  \
6919     sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
6920     compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
6921
6922     case $var in
6923     reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
6924     old_postinstall_cmds | old_postuninstall_cmds | \
6925     export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
6926     extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
6927     postinstall_cmds | postuninstall_cmds | \
6928     finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
6929       # Double-quote double-evaled strings.
6930       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
6931       ;;
6932     *)
6933       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
6934       ;;
6935     esac
6936   done
6937
6938   cat <<__EOF__ > "${ofile}T"
6939 #! $SHELL
6940
6941 # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
6942 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
6943 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
6944 #
6945 # Copyright (C) 1996-2000 Free Software Foundation, Inc.
6946 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
6947 #
6948 # This program is free software; you can redistribute it and/or modify
6949 # it under the terms of the GNU General Public License as published by
6950 # the Free Software Foundation; either version 2 of the License, or
6951 # (at your option) any later version.
6952 #
6953 # This program is distributed in the hope that it will be useful, but
6954 # WITHOUT ANY WARRANTY; without even the implied warranty of
6955 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
6956 # General Public License for more details.
6957 #
6958 # You should have received a copy of the GNU General Public License
6959 # along with this program; if not, write to the Free Software
6960 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
6961 #
6962 # As a special exception to the GNU General Public License, if you
6963 # distribute this file as part of a program that contains a
6964 # configuration script generated by Autoconf, you may include it under
6965 # the same distribution terms that you use for the rest of that program.
6966
6967 # A sed that does not truncate output.
6968 SED=$lt_SED
6969
6970 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
6971 Xsed="${SED} -e s/^X//"
6972
6973 # The HP-UX ksh and POSIX shell print the target directory to stdout
6974 # if CDPATH is set.
6975 if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
6976
6977 # ### BEGIN LIBTOOL CONFIG
6978
6979 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
6980
6981 # Shell to use when invoking shell scripts.
6982 SHELL=$lt_SHELL
6983
6984 # Whether or not to build shared libraries.
6985 build_libtool_libs=$enable_shared
6986
6987 # Whether or not to build static libraries.
6988 build_old_libs=$enable_static
6989
6990 # Whether or not to add -lc for building shared libraries.
6991 build_libtool_need_lc=$need_lc
6992
6993 # Whether or not to optimize for fast installation.
6994 fast_install=$enable_fast_install
6995
6996 # The host system.
6997 host_alias=$host_alias
6998 host=$host
6999
7000 # An echo program that does not interpret backslashes.
7001 echo=$lt_echo
7002
7003 # The archiver.
7004 AR=$lt_AR
7005 AR_FLAGS=$lt_AR_FLAGS
7006
7007 # The default C compiler.
7008 CC=$lt_CC
7009
7010 # Is the compiler the GNU C compiler?
7011 with_gcc=$GCC
7012
7013 # The linker used to build libraries.
7014 LD=$lt_LD
7015
7016 # Whether we need hard or soft links.
7017 LN_S=$lt_LN_S
7018
7019 # A BSD-compatible nm program.
7020 NM=$lt_NM
7021
7022 # A symbol stripping program
7023 STRIP=$STRIP
7024
7025 # Used to examine libraries when file_magic_cmd begins "file"
7026 MAGIC_CMD=$MAGIC_CMD
7027
7028 # Used on cygwin: DLL creation program.
7029 DLLTOOL="$DLLTOOL"
7030
7031 # Used on cygwin: object dumper.
7032 OBJDUMP="$OBJDUMP"
7033
7034 # Used on cygwin: assembler.
7035 AS="$AS"
7036
7037 # The name of the directory that contains temporary libtool files.
7038 objdir=$objdir
7039
7040 # How to create reloadable object files.
7041 reload_flag=$lt_reload_flag
7042 reload_cmds=$lt_reload_cmds
7043
7044 # How to pass a linker flag through the compiler.
7045 wl=$lt_wl
7046
7047 # Object file suffix (normally "o").
7048 objext="$ac_objext"
7049
7050 # Old archive suffix (normally "a").
7051 libext="$libext"
7052
7053 # Executable file suffix (normally "").
7054 exeext="$exeext"
7055
7056 # Additional compiler flags for building library objects.
7057 pic_flag=$lt_pic_flag
7058 pic_mode=$pic_mode
7059
7060 # Does compiler simultaneously support -c and -o options?
7061 compiler_c_o=$lt_compiler_c_o
7062
7063 # Can we write directly to a .lo ?
7064 compiler_o_lo=$lt_compiler_o_lo
7065
7066 # Must we lock files when doing compilation ?
7067 need_locks=$lt_need_locks
7068
7069 # Do we need the lib prefix for modules?
7070 need_lib_prefix=$need_lib_prefix
7071
7072 # Do we need a version for libraries?
7073 need_version=$need_version
7074
7075 # Whether dlopen is supported.
7076 dlopen_support=$enable_dlopen
7077
7078 # Whether dlopen of programs is supported.
7079 dlopen_self=$enable_dlopen_self
7080
7081 # Whether dlopen of statically linked programs is supported.
7082 dlopen_self_static=$enable_dlopen_self_static
7083
7084 # Compiler flag to prevent dynamic linking.
7085 link_static_flag=$lt_link_static_flag
7086
7087 # Compiler flag to turn off builtin functions.
7088 no_builtin_flag=$lt_no_builtin_flag
7089
7090 # Compiler flag to allow reflexive dlopens.
7091 export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
7092
7093 # Compiler flag to generate shared objects directly from archives.
7094 whole_archive_flag_spec=$lt_whole_archive_flag_spec
7095
7096 # Compiler flag to generate thread-safe objects.
7097 thread_safe_flag_spec=$lt_thread_safe_flag_spec
7098
7099 # Library versioning type.
7100 version_type=$version_type
7101
7102 # Format of library name prefix.
7103 libname_spec=$lt_libname_spec
7104
7105 # List of archive names.  First name is the real one, the rest are links.
7106 # The last name is the one that the linker finds with -lNAME.
7107 library_names_spec=$lt_library_names_spec
7108
7109 # The coded name of the library, if different from the real name.
7110 soname_spec=$lt_soname_spec
7111
7112 # Commands used to build and install an old-style archive.
7113 RANLIB=$lt_RANLIB
7114 old_archive_cmds=$lt_old_archive_cmds
7115 old_postinstall_cmds=$lt_old_postinstall_cmds
7116 old_postuninstall_cmds=$lt_old_postuninstall_cmds
7117
7118 # Create an old-style archive from a shared archive.
7119 old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
7120
7121 # Create a temporary old-style archive to link instead of a shared archive.
7122 old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
7123
7124 # Commands used to build and install a shared archive.
7125 archive_cmds=$lt_archive_cmds
7126 archive_expsym_cmds=$lt_archive_expsym_cmds
7127 postinstall_cmds=$lt_postinstall_cmds
7128 postuninstall_cmds=$lt_postuninstall_cmds
7129
7130 # Commands to strip libraries.
7131 old_striplib=$lt_old_striplib
7132 striplib=$lt_striplib
7133
7134 # Method to check whether dependent libraries are shared objects.
7135 deplibs_check_method=$lt_deplibs_check_method
7136
7137 # Command to use when deplibs_check_method == file_magic.
7138 file_magic_cmd=$lt_file_magic_cmd
7139
7140 # Flag that allows shared libraries with undefined symbols to be built.
7141 allow_undefined_flag=$lt_allow_undefined_flag
7142
7143 # Flag that forces no undefined symbols.
7144 no_undefined_flag=$lt_no_undefined_flag
7145
7146 # Commands used to finish a libtool library installation in a directory.
7147 finish_cmds=$lt_finish_cmds
7148
7149 # Same as above, but a single script fragment to be evaled but not shown.
7150 finish_eval=$lt_finish_eval
7151
7152 # Take the output of nm and produce a listing of raw symbols and C names.
7153 global_symbol_pipe=$lt_global_symbol_pipe
7154
7155 # Transform the output of nm in a proper C declaration
7156 global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
7157
7158 # Transform the output of nm in a C name address pair
7159 global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
7160
7161 # This is the shared library runtime path variable.
7162 runpath_var=$runpath_var
7163
7164 # This is the shared library path variable.
7165 shlibpath_var=$shlibpath_var
7166
7167 # Is shlibpath searched before the hard-coded library search path?
7168 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
7169
7170 # How to hardcode a shared library path into an executable.
7171 hardcode_action=$hardcode_action
7172
7173 # Whether we should hardcode library paths into libraries.
7174 hardcode_into_libs=$hardcode_into_libs
7175
7176 # Flag to hardcode \$libdir into a binary during linking.
7177 # This must work even if \$libdir does not exist.
7178 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
7179
7180 # Whether we need a single -rpath flag with a separated argument.
7181 hardcode_libdir_separator=$lt_hardcode_libdir_separator
7182
7183 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
7184 # resulting binary.
7185 hardcode_direct=$hardcode_direct
7186
7187 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7188 # resulting binary.
7189 hardcode_minus_L=$hardcode_minus_L
7190
7191 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7192 # the resulting binary.
7193 hardcode_shlibpath_var=$hardcode_shlibpath_var
7194
7195 # Variables whose values should be saved in libtool wrapper scripts and
7196 # restored at relink time.
7197 variables_saved_for_relink="$variables_saved_for_relink"
7198
7199 # Whether libtool must link a program against all its dependency libraries.
7200 link_all_deplibs=$link_all_deplibs
7201
7202 # Compile-time system search path for libraries
7203 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
7204
7205 # Run-time system search path for libraries
7206 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
7207
7208 # Fix the shell variable \$srcfile for the compiler.
7209 fix_srcfile_path="$fix_srcfile_path"
7210
7211 # Set to yes if exported symbols are required.
7212 always_export_symbols=$always_export_symbols
7213
7214 # The commands to list exported symbols.
7215 export_symbols_cmds=$lt_export_symbols_cmds
7216
7217 # The commands to extract the exported symbol list from a shared archive.
7218 extract_expsyms_cmds=$lt_extract_expsyms_cmds
7219
7220 # Symbols that should not be listed in the preloaded symbols.
7221 exclude_expsyms=$lt_exclude_expsyms
7222
7223 # Symbols that must always be exported.
7224 include_expsyms=$lt_include_expsyms
7225
7226 # ### END LIBTOOL CONFIG
7227
7228 __EOF__
7229
7230   case $host_os in
7231   aix3*)
7232     cat <<\EOF >> "${ofile}T"
7233
7234 # AIX sometimes has problems with the GCC collect2 program.  For some
7235 # reason, if we set the COLLECT_NAMES environment variable, the problems
7236 # vanish in a puff of smoke.
7237 if test "X${COLLECT_NAMES+set}" != Xset; then
7238   COLLECT_NAMES=
7239   export COLLECT_NAMES
7240 fi
7241 EOF
7242     ;;
7243   esac
7244
7245   case $host_os in
7246   cygwin* | mingw* | pw32* | os2*)
7247     cat <<'EOF' >> "${ofile}T"
7248       # This is a source program that is used to create dlls on Windows
7249       # Don't remove nor modify the starting and closing comments
7250 # /* ltdll.c starts here */
7251 # #define WIN32_LEAN_AND_MEAN
7252 # #include <windows.h>
7253 # #undef WIN32_LEAN_AND_MEAN
7254 # #include <stdio.h>
7255 #
7256 # #ifndef __CYGWIN__
7257 # #  ifdef __CYGWIN32__
7258 # #    define __CYGWIN__ __CYGWIN32__
7259 # #  endif
7260 # #endif
7261 #
7262 # #ifdef __cplusplus
7263 # extern "C" {
7264 # #endif
7265 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
7266 # #ifdef __cplusplus
7267 # }
7268 # #endif
7269 #
7270 # #ifdef __CYGWIN__
7271 # #include <cygwin/cygwin_dll.h>
7272 # DECLARE_CYGWIN_DLL( DllMain );
7273 # #endif
7274 # HINSTANCE __hDllInstance_base;
7275 #
7276 # BOOL APIENTRY
7277 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
7278 # {
7279 #   __hDllInstance_base = hInst;
7280 #   return TRUE;
7281 # }
7282 # /* ltdll.c ends here */
7283         # This is a source program that is used to create import libraries
7284         # on Windows for dlls which lack them. Don't remove nor modify the
7285         # starting and closing comments
7286 # /* impgen.c starts here */
7287 # /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
7288 #
7289 #  This file is part of GNU libtool.
7290 #
7291 #  This program is free software; you can redistribute it and/or modify
7292 #  it under the terms of the GNU General Public License as published by
7293 #  the Free Software Foundation; either version 2 of the License, or
7294 #  (at your option) any later version.
7295 #
7296 #  This program is distributed in the hope that it will be useful,
7297 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
7298 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
7299 #  GNU General Public License for more details.
7300 #
7301 #  You should have received a copy of the GNU General Public License
7302 #  along with this program; if not, write to the Free Software
7303 #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
7304 #  */
7305 #
7306 # #include <stdio.h>            /* for printf() */
7307 # #include <unistd.h>           /* for open(), lseek(), read() */
7308 # #include <fcntl.h>            /* for O_RDONLY, O_BINARY */
7309 # #include <string.h>           /* for strdup() */
7310 #
7311 # /* O_BINARY isn't required (or even defined sometimes) under Unix */
7312 # #ifndef O_BINARY
7313 # #define O_BINARY 0
7314 # #endif
7315 #
7316 # static unsigned int
7317 # pe_get16 (fd, offset)
7318 #      int fd;
7319 #      int offset;
7320 # {
7321 #   unsigned char b[2];
7322 #   lseek (fd, offset, SEEK_SET);
7323 #   read (fd, b, 2);
7324 #   return b[0] + (b[1]<<8);
7325 # }
7326 #
7327 # static unsigned int
7328 # pe_get32 (fd, offset)
7329 #     int fd;
7330 #     int offset;
7331 # {
7332 #   unsigned char b[4];
7333 #   lseek (fd, offset, SEEK_SET);
7334 #   read (fd, b, 4);
7335 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
7336 # }
7337 #
7338 # static unsigned int
7339 # pe_as32 (ptr)
7340 #      void *ptr;
7341 # {
7342 #   unsigned char *b = ptr;
7343 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
7344 # }
7345 #
7346 # int
7347 # main (argc, argv)
7348 #     int argc;
7349 #     char *argv[];
7350 # {
7351 #     int dll;
7352 #     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
7353 #     unsigned long export_rva, export_size, nsections, secptr, expptr;
7354 #     unsigned long name_rvas, nexp;
7355 #     unsigned char *expdata, *erva;
7356 #     char *filename, *dll_name;
7357 #
7358 #     filename = argv[1];
7359 #
7360 #     dll = open(filename, O_RDONLY|O_BINARY);
7361 #     if (dll < 1)
7362 #       return 1;
7363 #
7364 #     dll_name = filename;
7365 #
7366 #     for (i=0; filename[i]; i++)
7367 #       if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
7368 #           dll_name = filename + i +1;
7369 #
7370 #     pe_header_offset = pe_get32 (dll, 0x3c);
7371 #     opthdr_ofs = pe_header_offset + 4 + 20;
7372 #     num_entries = pe_get32 (dll, opthdr_ofs + 92);
7373 #
7374 #     if (num_entries < 1) /* no exports */
7375 #       return 1;
7376 #
7377 #     export_rva = pe_get32 (dll, opthdr_ofs + 96);
7378 #     export_size = pe_get32 (dll, opthdr_ofs + 100);
7379 #     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
7380 #     secptr = (pe_header_offset + 4 + 20 +
7381 #             pe_get16 (dll, pe_header_offset + 4 + 16));
7382 #
7383 #     expptr = 0;
7384 #     for (i = 0; i < nsections; i++)
7385 #     {
7386 #       char sname[8];
7387 #       unsigned long secptr1 = secptr + 40 * i;
7388 #       unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
7389 #       unsigned long vsize = pe_get32 (dll, secptr1 + 16);
7390 #       unsigned long fptr = pe_get32 (dll, secptr1 + 20);
7391 #       lseek(dll, secptr1, SEEK_SET);
7392 #       read(dll, sname, 8);
7393 #       if (vaddr <= export_rva && vaddr+vsize > export_rva)
7394 #       {
7395 #           expptr = fptr + (export_rva - vaddr);
7396 #           if (export_rva + export_size > vaddr + vsize)
7397 #               export_size = vsize - (export_rva - vaddr);
7398 #           break;
7399 #       }
7400 #     }
7401 #
7402 #     expdata = (unsigned char*)malloc(export_size);
7403 #     lseek (dll, expptr, SEEK_SET);
7404 #     read (dll, expdata, export_size);
7405 #     erva = expdata - export_rva;
7406 #
7407 #     nexp = pe_as32 (expdata+24);
7408 #     name_rvas = pe_as32 (expdata+32);
7409 #
7410 #     printf ("EXPORTS\n");
7411 #     for (i = 0; i<nexp; i++)
7412 #     {
7413 #       unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
7414 #       printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
7415 #     }
7416 #
7417 #     return 0;
7418 # }
7419 # /* impgen.c ends here */
7420
7421 EOF
7422     ;;
7423   esac
7424
7425   # We use sed instead of cat because bash on DJGPP gets confused if
7426   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
7427   # text mode, it properly converts lines to CR/LF.  This bash problem
7428   # is reportedly fixed, but why not run on old versions too?
7429   sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
7430
7431   mv -f "${ofile}T" "$ofile" || \
7432     (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
7433   chmod +x "$ofile"
7434 fi
7435
7436
7437
7438
7439
7440 # This can be used to rebuild libtool when needed
7441 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
7442
7443 # Always use our own libtool.
7444 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
7445
7446 # Prevent multiple expansion
7447
7448
7449
7450 # test for ln hardlink support
7451 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
7452 echo "configure:7453: checking whether ln works" >&5
7453 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
7454   echo $ac_n "(cached) $ac_c" 1>&6
7455 else
7456   rm -f conftest.src conftest.dst
7457 echo "conftest" > conftest.src
7458 if ln conftest.src conftest.dst 2>/dev/null
7459 then
7460   ol_cv_prog_LN_H="ln"
7461 else
7462   ol_cv_prog_LN_H="cp"
7463 fi
7464 rm -f conftest.src conftest.dst
7465
7466 fi
7467 LN_H="$ol_cv_prog_LN_H"
7468 if test "$ol_cv_prog_LN_H" = "ln"; then
7469         echo "$ac_t""yes" 1>&6
7470 else
7471         echo "$ac_t""no" 1>&6
7472 fi
7473
7474 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
7475 echo "configure:7476: checking whether ln -s works" >&5
7476 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
7477   echo $ac_n "(cached) $ac_c" 1>&6
7478 else
7479   rm -f conftestdata
7480 if ln -s X conftestdata 2>/dev/null
7481 then
7482   rm -f conftestdata
7483   ac_cv_prog_LN_S="ln -s"
7484 else
7485   ac_cv_prog_LN_S=ln
7486 fi
7487 fi
7488 LN_S="$ac_cv_prog_LN_S"
7489 if test "$ac_cv_prog_LN_S" = "ln -s"; then
7490   echo "$ac_t""yes" 1>&6
7491 else
7492   echo "$ac_t""no" 1>&6
7493 fi
7494
7495
7496 ol_link_perl=no
7497 if test $ol_enable_perl != no ; then
7498         # Extract the first word of "perl", so it can be a program name with args.
7499 set dummy perl; ac_word=$2
7500 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7501 echo "configure:7502: checking for $ac_word" >&5
7502 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
7503   echo $ac_n "(cached) $ac_c" 1>&6
7504 else
7505   case "$PERLBIN" in
7506   /*)
7507   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
7508   ;;
7509   ?:/*)
7510   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
7511   ;;
7512   *)
7513   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7514   ac_dummy="$PATH"
7515   for ac_dir in $ac_dummy; do 
7516     test -z "$ac_dir" && ac_dir=.
7517     if test -f $ac_dir/$ac_word; then
7518       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
7519       break
7520     fi
7521   done
7522   IFS="$ac_save_ifs"
7523   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
7524   ;;
7525 esac
7526 fi
7527 PERLBIN="$ac_cv_path_PERLBIN"
7528 if test -n "$PERLBIN"; then
7529   echo "$ac_t""$PERLBIN" 1>&6
7530 else
7531   echo "$ac_t""no" 1>&6
7532 fi
7533
7534
7535         if test "no$PERLBIN" = "no" ; then
7536                 if test $ol_enable_perl = yes ; then
7537                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
7538                 fi
7539
7540         else
7541                 PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
7542                 PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e 's/ -lc / /' -e 's/ -lc$//'`"
7543
7544                 if test x"$ol_enable_perl" = "xyes" ; then
7545                         SLAPD_PERL_LDFLAGS="$PERL_LDFLAGS"
7546                 else
7547                         MOD_PERL_LDFLAGS="$PERL_LDFLAGS"
7548                 fi
7549                                 ol_link_perl=yes
7550         fi
7551 fi
7552
7553 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
7554 echo "configure:7555: checking how to run the C preprocessor" >&5
7555 # On Suns, sometimes $CPP names a directory.
7556 if test -n "$CPP" && test -d "$CPP"; then
7557   CPP=
7558 fi
7559 if test -z "$CPP"; then
7560 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
7561   echo $ac_n "(cached) $ac_c" 1>&6
7562 else
7563     # This must be in double quotes, not single quotes, because CPP may get
7564   # substituted into the Makefile and "${CC-cc}" will confuse make.
7565   CPP="${CC-cc} -E"
7566   # On the NeXT, cc -E runs the code through the compiler's parser,
7567   # not just through cpp.
7568   cat > conftest.$ac_ext <<EOF
7569 #line 7570 "configure"
7570 #include "confdefs.h"
7571 #include <assert.h>
7572 Syntax Error
7573 EOF
7574 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7575 { (eval echo configure:7576: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7576 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7577 if test -z "$ac_err"; then
7578   :
7579 else
7580   echo "$ac_err" >&5
7581   echo "configure: failed program was:" >&5
7582   cat conftest.$ac_ext >&5
7583   rm -rf conftest*
7584   CPP="${CC-cc} -E -traditional-cpp"
7585   cat > conftest.$ac_ext <<EOF
7586 #line 7587 "configure"
7587 #include "confdefs.h"
7588 #include <assert.h>
7589 Syntax Error
7590 EOF
7591 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7592 { (eval echo configure:7593: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7593 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7594 if test -z "$ac_err"; then
7595   :
7596 else
7597   echo "$ac_err" >&5
7598   echo "configure: failed program was:" >&5
7599   cat conftest.$ac_ext >&5
7600   rm -rf conftest*
7601   CPP="${CC-cc} -nologo -E"
7602   cat > conftest.$ac_ext <<EOF
7603 #line 7604 "configure"
7604 #include "confdefs.h"
7605 #include <assert.h>
7606 Syntax Error
7607 EOF
7608 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7609 { (eval echo configure:7610: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7610 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7611 if test -z "$ac_err"; then
7612   :
7613 else
7614   echo "$ac_err" >&5
7615   echo "configure: failed program was:" >&5
7616   cat conftest.$ac_ext >&5
7617   rm -rf conftest*
7618   CPP=/lib/cpp
7619 fi
7620 rm -f conftest*
7621 fi
7622 rm -f conftest*
7623 fi
7624 rm -f conftest*
7625   ac_cv_prog_CPP="$CPP"
7626 fi
7627   CPP="$ac_cv_prog_CPP"
7628 else
7629   ac_cv_prog_CPP="$CPP"
7630 fi
7631 echo "$ac_t""$CPP" 1>&6
7632
7633
7634
7635 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
7636 echo "configure:7637: checking for Cygwin environment" >&5
7637 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
7638   echo $ac_n "(cached) $ac_c" 1>&6
7639 else
7640   cat > conftest.$ac_ext <<EOF
7641 #line 7642 "configure"
7642 #include "confdefs.h"
7643
7644 int main() {
7645
7646 #ifndef __CYGWIN__
7647 #define __CYGWIN__ __CYGWIN32__
7648 #endif
7649 return __CYGWIN__;
7650 ; return 0; }
7651 EOF
7652 if { (eval echo configure:7653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7653   rm -rf conftest*
7654   ac_cv_cygwin=yes
7655 else
7656   echo "configure: failed program was:" >&5
7657   cat conftest.$ac_ext >&5
7658   rm -rf conftest*
7659   ac_cv_cygwin=no
7660 fi
7661 rm -f conftest*
7662 fi
7663
7664 echo "$ac_t""$ac_cv_cygwin" 1>&6
7665 CYGWIN=
7666 test "$ac_cv_cygwin" = yes && CYGWIN=yes
7667 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
7668 echo "configure:7669: checking for mingw32 environment" >&5
7669 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
7670   echo $ac_n "(cached) $ac_c" 1>&6
7671 else
7672   cat > conftest.$ac_ext <<EOF
7673 #line 7674 "configure"
7674 #include "confdefs.h"
7675
7676 int main() {
7677 return __MINGW32__;
7678 ; return 0; }
7679 EOF
7680 if { (eval echo configure:7681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7681   rm -rf conftest*
7682   ac_cv_mingw32=yes
7683 else
7684   echo "configure: failed program was:" >&5
7685   cat conftest.$ac_ext >&5
7686   rm -rf conftest*
7687   ac_cv_mingw32=no
7688 fi
7689 rm -f conftest*
7690 fi
7691
7692 echo "$ac_t""$ac_cv_mingw32" 1>&6
7693 MINGW32=
7694 test "$ac_cv_mingw32" = yes && MINGW32=yes
7695
7696
7697
7698 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
7699 echo "configure:7700: checking for executable suffix" >&5
7700 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
7701   echo $ac_n "(cached) $ac_c" 1>&6
7702 else
7703   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
7704   ac_cv_exeext=.exe
7705 else
7706   rm -f conftest*
7707   echo 'int main () { return 0; }' > conftest.$ac_ext
7708   ac_cv_exeext=
7709   if { (eval echo configure:7710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
7710     for file in conftest.*; do
7711       case $file in
7712       *.c | *.C | *.o | *.obj | *.xcoff) ;;
7713       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
7714       esac
7715     done
7716   else
7717     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
7718   fi
7719   rm -f conftest*
7720   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
7721 fi
7722 fi
7723
7724 EXEEXT=""
7725 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
7726 echo "$ac_t""${ac_cv_exeext}" 1>&6
7727 ac_exeext=$EXEEXT
7728
7729 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
7730 echo "configure:7731: checking for object suffix" >&5
7731 if eval "test \"\${ac_cv_objext+set}\" = set"; then
7732   echo $ac_n "(cached) $ac_c" 1>&6
7733 else
7734   rm -f conftest*
7735 echo 'int i = 1;' > conftest.$ac_ext
7736 if { (eval echo configure:7737: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7737   for ac_file in conftest.*; do
7738     case $ac_file in
7739     *.c) ;;
7740     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
7741     esac
7742   done
7743 else
7744   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
7745 fi
7746 rm -f conftest*
7747 fi
7748
7749 echo "$ac_t""$ac_cv_objext" 1>&6
7750 OBJEXT=$ac_cv_objext
7751 ac_objext=$ac_cv_objext
7752
7753
7754 cat >> confdefs.h <<EOF
7755 #define EXEEXT "${EXEEXT}"
7756 EOF
7757
7758
7759 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
7760 echo "configure:7761: checking for be_app in -lbe" >&5
7761 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
7762 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
7763   echo $ac_n "(cached) $ac_c" 1>&6
7764 else
7765   ac_save_LIBS="$LIBS"
7766 LIBS="-lbe -lroot -lnet $LIBS"
7767 cat > conftest.$ac_ext <<EOF
7768 #line 7769 "configure"
7769 #include "confdefs.h"
7770 /* Override any gcc2 internal prototype to avoid an error.  */
7771 /* We use char because int might match the return type of a gcc2
7772     builtin and then its argument prototype would still apply.  */
7773 char be_app();
7774
7775 int main() {
7776 be_app()
7777 ; return 0; }
7778 EOF
7779 if { (eval echo configure:7780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7780   rm -rf conftest*
7781   eval "ac_cv_lib_$ac_lib_var=yes"
7782 else
7783   echo "configure: failed program was:" >&5
7784   cat conftest.$ac_ext >&5
7785   rm -rf conftest*
7786   eval "ac_cv_lib_$ac_lib_var=no"
7787 fi
7788 rm -f conftest*
7789 LIBS="$ac_save_LIBS"
7790
7791 fi
7792 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7793   echo "$ac_t""yes" 1>&6
7794   LIBS="$LIBS -lbe -lroot -lnet"
7795 else
7796   echo "$ac_t""no" 1>&6
7797 :
7798 fi
7799
7800
7801
7802
7803
7804 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
7805 echo "configure:7806: checking for ${CC-cc} option to accept ANSI C" >&5
7806 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
7807   echo $ac_n "(cached) $ac_c" 1>&6
7808 else
7809   am_cv_prog_cc_stdc=no
7810 ac_save_CC="$CC"
7811 # Don't try gcc -ansi; that turns off useful extensions and
7812 # breaks some systems' header files.
7813 # AIX                   -qlanglvl=ansi
7814 # Ultrix and OSF/1      -std1
7815 # HP-UX 10.20 and later -Ae
7816 # HP-UX older versions  -Aa -D_HPUX_SOURCE
7817 # SVR4                  -Xc -D__EXTENSIONS__
7818 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
7819 do
7820   CC="$ac_save_CC $ac_arg"
7821   cat > conftest.$ac_ext <<EOF
7822 #line 7823 "configure"
7823 #include "confdefs.h"
7824 #include <stdarg.h>
7825 #include <stdio.h>
7826 #include <sys/types.h>
7827 #include <sys/stat.h>
7828 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
7829 struct buf { int x; };
7830 FILE * (*rcsopen) (struct buf *, struct stat *, int);
7831 static char *e (p, i)
7832      char **p;
7833      int i;
7834 {
7835   return p[i];
7836 }
7837 static char *f (char * (*g) (char **, int), char **p, ...)
7838 {
7839   char *s;
7840   va_list v;
7841   va_start (v,p);
7842   s = g (p, va_arg (v,int));
7843   va_end (v);
7844   return s;
7845 }
7846 int test (int i, double x);
7847 struct s1 {int (*f) (int a);};
7848 struct s2 {int (*f) (double a);};
7849 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
7850 int argc;
7851 char **argv;
7852
7853 int main() {
7854
7855 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
7856
7857 ; return 0; }
7858 EOF
7859 if { (eval echo configure:7860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7860   rm -rf conftest*
7861   am_cv_prog_cc_stdc="$ac_arg"; break
7862 else
7863   echo "configure: failed program was:" >&5
7864   cat conftest.$ac_ext >&5
7865 fi
7866 rm -f conftest*
7867 done
7868 CC="$ac_save_CC"
7869
7870 fi
7871
7872 if test -z "$am_cv_prog_cc_stdc"; then
7873   echo "$ac_t""none needed" 1>&6
7874 else
7875   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
7876 fi
7877 case "x$am_cv_prog_cc_stdc" in
7878   x|xno) ;;
7879   *) CC="$CC $am_cv_prog_cc_stdc" ;;
7880 esac
7881
7882 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
7883         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
7884 fi
7885
7886 # test for make depend flag
7887 OL_MKDEP=
7888 OL_MKDEP_FLAGS=
7889 if test -z "${MKDEP}"; then
7890         OL_MKDEP="${CC-cc}"
7891         if test -z "${MKDEP_FLAGS}"; then
7892                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
7893 echo "configure:7894: checking for ${OL_MKDEP} depend flag" >&5
7894 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
7895   echo $ac_n "(cached) $ac_c" 1>&6
7896 else
7897   
7898                         ol_cv_mkdep=no
7899                         for flag in "-M" "-xM"; do
7900                                 cat > conftest.c <<EOF
7901  noCode;
7902 EOF
7903                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:7904: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
7904                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
7905                                 then
7906                                         if test ! -f conftest."${ac_object}" ; then
7907                                                 ol_cv_mkdep=$flag
7908                                                 OL_MKDEP_FLAGS="$flag"
7909                                                 break
7910                                         fi
7911                                 fi
7912                         done
7913                         rm -f conftest*
7914                 
7915 fi
7916
7917 echo "$ac_t""$ol_cv_mkdep" 1>&6
7918         else
7919                 cc_cv_mkdep=yes
7920                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
7921         fi
7922 else
7923         cc_cv_mkdep=yes
7924         OL_MKDEP="${MKDEP}"
7925         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
7926 fi
7927
7928
7929
7930 if test "${ol_cv_mkdep}" = no ; then
7931         # this will soon become an error
7932         echo "configure: warning: do not know how to generate dependencies" 1>&2
7933 fi
7934
7935 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
7936 echo "configure:7937: checking for afopen in -ls" >&5
7937 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
7938 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
7939   echo $ac_n "(cached) $ac_c" 1>&6
7940 else
7941   ac_save_LIBS="$LIBS"
7942 LIBS="-ls  $LIBS"
7943 cat > conftest.$ac_ext <<EOF
7944 #line 7945 "configure"
7945 #include "confdefs.h"
7946 /* Override any gcc2 internal prototype to avoid an error.  */
7947 /* We use char because int might match the return type of a gcc2
7948     builtin and then its argument prototype would still apply.  */
7949 char afopen();
7950
7951 int main() {
7952 afopen()
7953 ; return 0; }
7954 EOF
7955 if { (eval echo configure:7956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7956   rm -rf conftest*
7957   eval "ac_cv_lib_$ac_lib_var=yes"
7958 else
7959   echo "configure: failed program was:" >&5
7960   cat conftest.$ac_ext >&5
7961   rm -rf conftest*
7962   eval "ac_cv_lib_$ac_lib_var=no"
7963 fi
7964 rm -f conftest*
7965 LIBS="$ac_save_LIBS"
7966
7967 fi
7968 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7969   echo "$ac_t""yes" 1>&6
7970   
7971         AUTH_LIBS=-ls
7972         cat >> confdefs.h <<\EOF
7973 #define HAVE_AIX_SECURITY 1
7974 EOF
7975
7976
7977 else
7978   echo "$ac_t""no" 1>&6
7979 fi
7980
7981
7982 case "$target" in
7983 *-ibm-openedition)
7984         ac_cv_func_getopt=no
7985         cat >> confdefs.h <<\EOF
7986 #define BOTH_STRINGS_H 1
7987 EOF
7988
7989         ;;
7990 esac
7991
7992 ol_link_modules=no
7993 if test $ol_enable_modules != no ; then
7994         for ac_hdr in ltdl.h
7995 do
7996 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7997 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7998 echo "configure:7999: checking for $ac_hdr" >&5
7999 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8000   echo $ac_n "(cached) $ac_c" 1>&6
8001 else
8002   cat > conftest.$ac_ext <<EOF
8003 #line 8004 "configure"
8004 #include "confdefs.h"
8005 #include <$ac_hdr>
8006 EOF
8007 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8008 { (eval echo configure:8009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8009 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8010 if test -z "$ac_err"; then
8011   rm -rf conftest*
8012   eval "ac_cv_header_$ac_safe=yes"
8013 else
8014   echo "$ac_err" >&5
8015   echo "configure: failed program was:" >&5
8016   cat conftest.$ac_ext >&5
8017   rm -rf conftest*
8018   eval "ac_cv_header_$ac_safe=no"
8019 fi
8020 rm -f conftest*
8021 fi
8022 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8023   echo "$ac_t""yes" 1>&6
8024     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8025   cat >> confdefs.h <<EOF
8026 #define $ac_tr_hdr 1
8027 EOF
8028  
8029 else
8030   echo "$ac_t""no" 1>&6
8031 fi
8032 done
8033
8034
8035         if test $ac_cv_header_ltdl_h = no ; then
8036                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
8037         fi
8038
8039         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
8040 echo "configure:8041: checking for lt_dlinit in -lltdl" >&5
8041 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
8042 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8043   echo $ac_n "(cached) $ac_c" 1>&6
8044 else
8045   ac_save_LIBS="$LIBS"
8046 LIBS="-lltdl  $LIBS"
8047 cat > conftest.$ac_ext <<EOF
8048 #line 8049 "configure"
8049 #include "confdefs.h"
8050 /* Override any gcc2 internal prototype to avoid an error.  */
8051 /* We use char because int might match the return type of a gcc2
8052     builtin and then its argument prototype would still apply.  */
8053 char lt_dlinit();
8054
8055 int main() {
8056 lt_dlinit()
8057 ; return 0; }
8058 EOF
8059 if { (eval echo configure:8060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8060   rm -rf conftest*
8061   eval "ac_cv_lib_$ac_lib_var=yes"
8062 else
8063   echo "configure: failed program was:" >&5
8064   cat conftest.$ac_ext >&5
8065   rm -rf conftest*
8066   eval "ac_cv_lib_$ac_lib_var=no"
8067 fi
8068 rm -f conftest*
8069 LIBS="$ac_save_LIBS"
8070
8071 fi
8072 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8073   echo "$ac_t""yes" 1>&6
8074   
8075                 MODULES_LIBS=-lltdl
8076                 cat >> confdefs.h <<\EOF
8077 #define HAVE_LIBLTDL 1
8078 EOF
8079
8080         
8081 else
8082   echo "$ac_t""no" 1>&6
8083 fi
8084
8085
8086         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
8087                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
8088         fi
8089         ol_link_modules=yes
8090
8091 else
8092         for i in $Backends; do
8093                 eval "ol_tmp=\$ol_enable_$i"
8094                 if test $ol_tmp = mod ; then
8095                         echo "configure: warning: building static $i backend" 1>&2
8096                         eval "ol_enable_$i=yes"
8097                 fi
8098         done
8099         for i in $Overlays; do
8100                 eval "ol_tmp=\$ol_enable_$i"
8101                 if test $ol_tmp = mod ; then
8102                         echo "configure: warning: building static $i overlay" 1>&2
8103                         eval "ol_enable_$i=yes"
8104                 fi
8105         done
8106 fi
8107
8108 # test for EBCDIC
8109 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
8110 echo "configure:8111: checking for EBCDIC" >&5
8111 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
8112   echo $ac_n "(cached) $ac_c" 1>&6
8113 else
8114   
8115         cat > conftest.$ac_ext <<EOF
8116 #line 8117 "configure"
8117 #include "confdefs.h"
8118
8119 #if !('M' == 0xd4)
8120 #include <__ASCII__/generate_error.h>
8121 #endif
8122
8123 EOF
8124 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8125 { (eval echo configure:8126: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8126 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8127 if test -z "$ac_err"; then
8128   rm -rf conftest*
8129   ol_cv_cpp_ebcdic=yes
8130 else
8131   echo "$ac_err" >&5
8132   echo "configure: failed program was:" >&5
8133   cat conftest.$ac_ext >&5
8134   rm -rf conftest*
8135   ol_cv_cpp_ebcdic=no
8136 fi
8137 rm -f conftest*
8138 fi
8139
8140 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
8141 if test $ol_cv_cpp_ebcdic = yes ; then
8142         cat >> confdefs.h <<\EOF
8143 #define HAVE_EBCDIC 1
8144 EOF
8145
8146 fi
8147
8148 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
8149 echo "configure:8150: checking for ANSI C header files" >&5
8150 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
8151   echo $ac_n "(cached) $ac_c" 1>&6
8152 else
8153   cat > conftest.$ac_ext <<EOF
8154 #line 8155 "configure"
8155 #include "confdefs.h"
8156 #include <stdlib.h>
8157 #include <stdarg.h>
8158 #include <string.h>
8159 #include <float.h>
8160 EOF
8161 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8162 { (eval echo configure:8163: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8163 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8164 if test -z "$ac_err"; then
8165   rm -rf conftest*
8166   ol_cv_header_stdc=yes
8167 else
8168   echo "$ac_err" >&5
8169   echo "configure: failed program was:" >&5
8170   cat conftest.$ac_ext >&5
8171   rm -rf conftest*
8172   ol_cv_header_stdc=no
8173 fi
8174 rm -f conftest*
8175
8176 if test $ol_cv_header_stdc = yes; then
8177   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
8178 cat > conftest.$ac_ext <<EOF
8179 #line 8180 "configure"
8180 #include "confdefs.h"
8181 #include <string.h>
8182 EOF
8183 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8184   egrep "memchr" >/dev/null 2>&1; then
8185   :
8186 else
8187   rm -rf conftest*
8188   ol_cv_header_stdc=no
8189 fi
8190 rm -f conftest*
8191
8192 fi
8193
8194 if test $ol_cv_header_stdc = yes; then
8195   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
8196 cat > conftest.$ac_ext <<EOF
8197 #line 8198 "configure"
8198 #include "confdefs.h"
8199 #include <stdlib.h>
8200 EOF
8201 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8202   egrep "free" >/dev/null 2>&1; then
8203   :
8204 else
8205   rm -rf conftest*
8206   ol_cv_header_stdc=no
8207 fi
8208 rm -f conftest*
8209
8210 fi
8211
8212 if test $ol_cv_header_stdc = yes; then
8213   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
8214 if test "$cross_compiling" = yes; then
8215   :
8216 else
8217   cat > conftest.$ac_ext <<EOF
8218 #line 8219 "configure"
8219 #include "confdefs.h"
8220 #include <ctype.h>
8221 #ifndef HAVE_EBCDIC
8222 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
8223 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
8224 #else
8225 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
8226                 || ('j' <= (c) && (c) <= 'r') \
8227                 || ('s' <= (c) && (c) <= 'z'))
8228 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
8229 #endif
8230 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
8231 int main () { int i; for (i = 0; i < 256; i++)
8232 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
8233 exit (0); }
8234
8235 EOF
8236 if { (eval echo configure:8237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8237 then
8238   :
8239 else
8240   echo "configure: failed program was:" >&5
8241   cat conftest.$ac_ext >&5
8242   rm -fr conftest*
8243   ol_cv_header_stdc=no
8244 fi
8245 rm -fr conftest*
8246 fi
8247
8248 fi
8249 fi
8250
8251 echo "$ac_t""$ol_cv_header_stdc" 1>&6
8252 if test $ol_cv_header_stdc = yes; then
8253   cat >> confdefs.h <<\EOF
8254 #define STDC_HEADERS 1
8255 EOF
8256
8257 fi
8258 ac_cv_header_stdc=disable
8259
8260
8261 if test $ol_cv_header_stdc != yes; then
8262         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
8263 fi
8264
8265 ac_header_dirent=no
8266 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
8267 do
8268 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8269 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
8270 echo "configure:8271: checking for $ac_hdr that defines DIR" >&5
8271 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
8272   echo $ac_n "(cached) $ac_c" 1>&6
8273 else
8274   cat > conftest.$ac_ext <<EOF
8275 #line 8276 "configure"
8276 #include "confdefs.h"
8277 #include <sys/types.h>
8278 #include <$ac_hdr>
8279 int main() {
8280 DIR *dirp = 0;
8281 ; return 0; }
8282 EOF
8283 if { (eval echo configure:8284: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8284   rm -rf conftest*
8285   eval "ac_cv_header_dirent_$ac_safe=yes"
8286 else
8287   echo "configure: failed program was:" >&5
8288   cat conftest.$ac_ext >&5
8289   rm -rf conftest*
8290   eval "ac_cv_header_dirent_$ac_safe=no"
8291 fi
8292 rm -f conftest*
8293 fi
8294 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
8295   echo "$ac_t""yes" 1>&6
8296     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8297   cat >> confdefs.h <<EOF
8298 #define $ac_tr_hdr 1
8299 EOF
8300  ac_header_dirent=$ac_hdr; break
8301 else
8302   echo "$ac_t""no" 1>&6
8303 fi
8304 done
8305 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
8306 if test $ac_header_dirent = dirent.h; then
8307 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
8308 echo "configure:8309: checking for opendir in -ldir" >&5
8309 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
8310 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8311   echo $ac_n "(cached) $ac_c" 1>&6
8312 else
8313   ac_save_LIBS="$LIBS"
8314 LIBS="-ldir  $LIBS"
8315 cat > conftest.$ac_ext <<EOF
8316 #line 8317 "configure"
8317 #include "confdefs.h"
8318 /* Override any gcc2 internal prototype to avoid an error.  */
8319 /* We use char because int might match the return type of a gcc2
8320     builtin and then its argument prototype would still apply.  */
8321 char opendir();
8322
8323 int main() {
8324 opendir()
8325 ; return 0; }
8326 EOF
8327 if { (eval echo configure:8328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8328   rm -rf conftest*
8329   eval "ac_cv_lib_$ac_lib_var=yes"
8330 else
8331   echo "configure: failed program was:" >&5
8332   cat conftest.$ac_ext >&5
8333   rm -rf conftest*
8334   eval "ac_cv_lib_$ac_lib_var=no"
8335 fi
8336 rm -f conftest*
8337 LIBS="$ac_save_LIBS"
8338
8339 fi
8340 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8341   echo "$ac_t""yes" 1>&6
8342   LIBS="$LIBS -ldir"
8343 else
8344   echo "$ac_t""no" 1>&6
8345 fi
8346
8347 else
8348 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
8349 echo "configure:8350: checking for opendir in -lx" >&5
8350 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
8351 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8352   echo $ac_n "(cached) $ac_c" 1>&6
8353 else
8354   ac_save_LIBS="$LIBS"
8355 LIBS="-lx  $LIBS"
8356 cat > conftest.$ac_ext <<EOF
8357 #line 8358 "configure"
8358 #include "confdefs.h"
8359 /* Override any gcc2 internal prototype to avoid an error.  */
8360 /* We use char because int might match the return type of a gcc2
8361     builtin and then its argument prototype would still apply.  */
8362 char opendir();
8363
8364 int main() {
8365 opendir()
8366 ; return 0; }
8367 EOF
8368 if { (eval echo configure:8369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8369   rm -rf conftest*
8370   eval "ac_cv_lib_$ac_lib_var=yes"
8371 else
8372   echo "configure: failed program was:" >&5
8373   cat conftest.$ac_ext >&5
8374   rm -rf conftest*
8375   eval "ac_cv_lib_$ac_lib_var=no"
8376 fi
8377 rm -f conftest*
8378 LIBS="$ac_save_LIBS"
8379
8380 fi
8381 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8382   echo "$ac_t""yes" 1>&6
8383   LIBS="$LIBS -lx"
8384 else
8385   echo "$ac_t""no" 1>&6
8386 fi
8387
8388 fi
8389
8390 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
8391 echo "configure:8392: checking for sys/wait.h that is POSIX.1 compatible" >&5
8392 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
8393   echo $ac_n "(cached) $ac_c" 1>&6
8394 else
8395   cat > conftest.$ac_ext <<EOF
8396 #line 8397 "configure"
8397 #include "confdefs.h"
8398 #include <sys/types.h>
8399 #include <sys/wait.h>
8400 #ifndef WEXITSTATUS
8401 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
8402 #endif
8403 #ifndef WIFEXITED
8404 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
8405 #endif
8406 int main() {
8407 int s;
8408 wait (&s);
8409 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
8410 ; return 0; }
8411 EOF
8412 if { (eval echo configure:8413: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8413   rm -rf conftest*
8414   ac_cv_header_sys_wait_h=yes
8415 else
8416   echo "configure: failed program was:" >&5
8417   cat conftest.$ac_ext >&5
8418   rm -rf conftest*
8419   ac_cv_header_sys_wait_h=no
8420 fi
8421 rm -f conftest*
8422 fi
8423
8424 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
8425 if test $ac_cv_header_sys_wait_h = yes; then
8426   cat >> confdefs.h <<\EOF
8427 #define HAVE_SYS_WAIT_H 1
8428 EOF
8429
8430 fi
8431
8432 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
8433 echo "configure:8434: checking POSIX termios" >&5
8434 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
8435   echo $ac_n "(cached) $ac_c" 1>&6
8436 else
8437   cat > conftest.$ac_ext <<EOF
8438 #line 8439 "configure"
8439 #include "confdefs.h"
8440 #include <sys/types.h>
8441 #include <unistd.h>
8442 #include <termios.h>
8443 int main() {
8444 /* SunOS 4.0.3 has termios.h but not the library calls.  */
8445    tcgetattr(0, 0);
8446 ; return 0; }
8447 EOF
8448 if { (eval echo configure:8449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8449   rm -rf conftest*
8450   am_cv_sys_posix_termios=yes
8451 else
8452   echo "configure: failed program was:" >&5
8453   cat conftest.$ac_ext >&5
8454   rm -rf conftest*
8455   am_cv_sys_posix_termios=no
8456 fi
8457 rm -f conftest*
8458 fi
8459
8460 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
8461
8462
8463  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
8464 echo "configure:8465: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
8465 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
8466   echo $ac_n "(cached) $ac_c" 1>&6
8467 else
8468   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
8469
8470   gwinsz_in_termios_h=no
8471   if test $am_cv_sys_posix_termios = yes; then
8472     cat > conftest.$ac_ext <<EOF
8473 #line 8474 "configure"
8474 #include "confdefs.h"
8475 #include <sys/types.h>
8476 #     include <termios.h>
8477 #     ifdef TIOCGWINSZ
8478         yes
8479 #     endif
8480     
8481 EOF
8482 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8483   egrep "yes" >/dev/null 2>&1; then
8484   rm -rf conftest*
8485   gwinsz_in_termios_h=yes
8486 fi
8487 rm -f conftest*
8488
8489   fi
8490
8491   if test $gwinsz_in_termios_h = no; then
8492     cat > conftest.$ac_ext <<EOF
8493 #line 8494 "configure"
8494 #include "confdefs.h"
8495 #include <sys/types.h>
8496 #     include <sys/ioctl.h>
8497 #     ifdef TIOCGWINSZ
8498         yes
8499 #     endif
8500     
8501 EOF
8502 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8503   egrep "yes" >/dev/null 2>&1; then
8504   rm -rf conftest*
8505   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
8506 fi
8507 rm -f conftest*
8508
8509   fi
8510   
8511 fi
8512
8513 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
8514   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
8515     cat >> confdefs.h <<\EOF
8516 #define GWINSZ_IN_SYS_IOCTL 1
8517 EOF
8518
8519   fi
8520
8521 if test $am_cv_sys_posix_termios = yes ; then
8522         cat >> confdefs.h <<\EOF
8523 #define HAVE_POSIX_TERMIOS 1
8524 EOF
8525
8526 fi
8527
8528 for ac_hdr in \
8529         arpa/inet.h             \
8530         arpa/nameser.h  \
8531         assert.h                \
8532         bits/types.h    \
8533         conio.h                 \
8534         crypt.h                 \
8535         direct.h                \
8536         errno.h                 \
8537         fcntl.h                 \
8538         filio.h                 \
8539         getopt.h                \
8540         grp.h                   \
8541         io.h                    \
8542         libutil.h               \
8543         limits.h                \
8544         locale.h                \
8545         netinet/tcp.h   \
8546         malloc.h                \
8547         memory.h                \
8548         psap.h                  \
8549         pwd.h                   \
8550         process.h               \
8551         resolv.h                \
8552         sgtty.h                 \
8553         shadow.h                \
8554         stddef.h                \
8555         string.h                \
8556         strings.h               \
8557         sysexits.h              \
8558         sys/file.h              \
8559         sys/filio.h             \
8560         sys/errno.h             \
8561         sys/ioctl.h             \
8562         sys/param.h             \
8563         sys/resource.h  \
8564         sys/select.h    \
8565         sys/socket.h    \
8566         sys/stat.h              \
8567         sys/syslog.h    \
8568         sys/time.h              \
8569         sys/types.h             \
8570         sys/ucred.h             \
8571         sys/uio.h               \
8572         syslog.h                \
8573         termios.h               \
8574         unistd.h                \
8575         winsock.h               \
8576         winsock2.h              \
8577
8578 do
8579 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8580 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8581 echo "configure:8582: checking for $ac_hdr" >&5
8582 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8583   echo $ac_n "(cached) $ac_c" 1>&6
8584 else
8585   cat > conftest.$ac_ext <<EOF
8586 #line 8587 "configure"
8587 #include "confdefs.h"
8588 #include <$ac_hdr>
8589 EOF
8590 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8591 { (eval echo configure:8592: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8592 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8593 if test -z "$ac_err"; then
8594   rm -rf conftest*
8595   eval "ac_cv_header_$ac_safe=yes"
8596 else
8597   echo "$ac_err" >&5
8598   echo "configure: failed program was:" >&5
8599   cat conftest.$ac_ext >&5
8600   rm -rf conftest*
8601   eval "ac_cv_header_$ac_safe=no"
8602 fi
8603 rm -f conftest*
8604 fi
8605 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8606   echo "$ac_t""yes" 1>&6
8607     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8608   cat >> confdefs.h <<EOF
8609 #define $ac_tr_hdr 1
8610 EOF
8611  
8612 else
8613   echo "$ac_t""no" 1>&6
8614 fi
8615 done
8616
8617
8618
8619
8620 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
8621 echo "configure:8622: checking for sigset in -lV3" >&5
8622 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
8623 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8624   echo $ac_n "(cached) $ac_c" 1>&6
8625 else
8626   ac_save_LIBS="$LIBS"
8627 LIBS="-lV3  $LIBS"
8628 cat > conftest.$ac_ext <<EOF
8629 #line 8630 "configure"
8630 #include "confdefs.h"
8631 /* Override any gcc2 internal prototype to avoid an error.  */
8632 /* We use char because int might match the return type of a gcc2
8633     builtin and then its argument prototype would still apply.  */
8634 char sigset();
8635
8636 int main() {
8637 sigset()
8638 ; return 0; }
8639 EOF
8640 if { (eval echo configure:8641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8641   rm -rf conftest*
8642   eval "ac_cv_lib_$ac_lib_var=yes"
8643 else
8644   echo "configure: failed program was:" >&5
8645   cat conftest.$ac_ext >&5
8646   rm -rf conftest*
8647   eval "ac_cv_lib_$ac_lib_var=no"
8648 fi
8649 rm -f conftest*
8650 LIBS="$ac_save_LIBS"
8651
8652 fi
8653 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8654   echo "$ac_t""yes" 1>&6
8655     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8656     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8657   cat >> confdefs.h <<EOF
8658 #define $ac_tr_lib 1
8659 EOF
8660
8661   LIBS="-lV3 $LIBS"
8662
8663 else
8664   echo "$ac_t""no" 1>&6
8665 fi
8666
8667
8668 if test "$ac_cv_header_winsock_h" = yes; then
8669 echo $ac_n "checking for winsock""... $ac_c" 1>&6
8670 echo "configure:8671: checking for winsock" >&5
8671 if eval "test \"\${ol_cv_winsock+set}\" = set"; then
8672   echo $ac_n "(cached) $ac_c" 1>&6
8673 else
8674   save_LIBS="$LIBS"
8675 for curlib in ws2_32 wsock32; do
8676         LIBS="$LIBS -l$curlib"
8677         cat > conftest.$ac_ext <<EOF
8678 #line 8679 "configure"
8679 #include "confdefs.h"
8680 #include <winsock.h>
8681                         
8682 int main() {
8683
8684                         socket(0,0,0);
8685                         select(0,NULL,NULL,NULL,NULL);
8686                         closesocket(0);
8687                         gethostname(NULL,0);
8688                         
8689 ; return 0; }
8690 EOF
8691 if { (eval echo configure:8692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8692   rm -rf conftest*
8693   ol_cv_winsock=yes
8694 else
8695   echo "configure: failed program was:" >&5
8696   cat conftest.$ac_ext >&5
8697   rm -rf conftest*
8698   ol_cv_winsock=no
8699 fi
8700 rm -f conftest*
8701
8702         if test $ol_cv_winsock = yes; then
8703                 cat >> confdefs.h <<\EOF
8704 #define HAVE_WINSOCK 1
8705 EOF
8706
8707                 ac_cv_func_socket=yes
8708                 ac_cv_func_select=yes
8709                 ac_cv_func_closesocket=yes
8710                 ac_cv_func_gethostname=yes
8711                 if test $curlib = ws2_32; then
8712                         ol_cv_winsock=winsock2
8713                         cat >> confdefs.h <<\EOF
8714 #define HAVE_WINSOCK2 1
8715 EOF
8716
8717                 fi
8718                 break
8719         fi
8720         LIBS="$save_LIBS"
8721 done
8722 fi
8723
8724 echo "$ac_t""$ol_cv_winsock" 1>&6
8725 fi
8726
8727
8728 echo $ac_n "checking for socket""... $ac_c" 1>&6
8729 echo "configure:8730: checking for socket" >&5
8730 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
8731   echo $ac_n "(cached) $ac_c" 1>&6
8732 else
8733   cat > conftest.$ac_ext <<EOF
8734 #line 8735 "configure"
8735 #include "confdefs.h"
8736 /* System header to define __stub macros and hopefully few prototypes,
8737     which can conflict with char socket(); below.  */
8738 #include <assert.h>
8739 /* Override any gcc2 internal prototype to avoid an error.  */
8740 /* We use char because int might match the return type of a gcc2
8741     builtin and then its argument prototype would still apply.  */
8742 char socket();
8743 char (*f)();
8744
8745 int main() {
8746
8747 /* The GNU C library defines this for functions which it implements
8748     to always fail with ENOSYS.  Some functions are actually named
8749     something starting with __ and the normal name is an alias.  */
8750 #if defined (__stub_socket) || defined (__stub___socket)
8751 choke me
8752 #else
8753 f = socket;
8754 #endif
8755
8756 ; return 0; }
8757 EOF
8758 if { (eval echo configure:8759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8759   rm -rf conftest*
8760   eval "ac_cv_func_socket=yes"
8761 else
8762   echo "configure: failed program was:" >&5
8763   cat conftest.$ac_ext >&5
8764   rm -rf conftest*
8765   eval "ac_cv_func_socket=no"
8766 fi
8767 rm -f conftest*
8768 fi
8769
8770 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
8771   echo "$ac_t""yes" 1>&6
8772   :
8773 else
8774   echo "$ac_t""no" 1>&6
8775         
8776         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
8777 echo "configure:8778: checking for main in -lsocket" >&5
8778 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
8779 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8780   echo $ac_n "(cached) $ac_c" 1>&6
8781 else
8782   ac_save_LIBS="$LIBS"
8783 LIBS="-lsocket  $LIBS"
8784 cat > conftest.$ac_ext <<EOF
8785 #line 8786 "configure"
8786 #include "confdefs.h"
8787
8788 int main() {
8789 main()
8790 ; return 0; }
8791 EOF
8792 if { (eval echo configure:8793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8793   rm -rf conftest*
8794   eval "ac_cv_lib_$ac_lib_var=yes"
8795 else
8796   echo "configure: failed program was:" >&5
8797   cat conftest.$ac_ext >&5
8798   rm -rf conftest*
8799   eval "ac_cv_lib_$ac_lib_var=no"
8800 fi
8801 rm -f conftest*
8802 LIBS="$ac_save_LIBS"
8803
8804 fi
8805 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8806   echo "$ac_t""yes" 1>&6
8807     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8808     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8809   cat >> confdefs.h <<EOF
8810 #define $ac_tr_lib 1
8811 EOF
8812
8813   LIBS="-lsocket $LIBS"
8814
8815 else
8816   echo "$ac_t""no" 1>&6
8817 fi
8818
8819         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
8820 echo "configure:8821: checking for main in -lnet" >&5
8821 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
8822 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8823   echo $ac_n "(cached) $ac_c" 1>&6
8824 else
8825   ac_save_LIBS="$LIBS"
8826 LIBS="-lnet  $LIBS"
8827 cat > conftest.$ac_ext <<EOF
8828 #line 8829 "configure"
8829 #include "confdefs.h"
8830
8831 int main() {
8832 main()
8833 ; return 0; }
8834 EOF
8835 if { (eval echo configure:8836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8836   rm -rf conftest*
8837   eval "ac_cv_lib_$ac_lib_var=yes"
8838 else
8839   echo "configure: failed program was:" >&5
8840   cat conftest.$ac_ext >&5
8841   rm -rf conftest*
8842   eval "ac_cv_lib_$ac_lib_var=no"
8843 fi
8844 rm -f conftest*
8845 LIBS="$ac_save_LIBS"
8846
8847 fi
8848 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8849   echo "$ac_t""yes" 1>&6
8850     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8851     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8852   cat >> confdefs.h <<EOF
8853 #define $ac_tr_lib 1
8854 EOF
8855
8856   LIBS="-lnet $LIBS"
8857
8858 else
8859   echo "$ac_t""no" 1>&6
8860 fi
8861
8862         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
8863 echo "configure:8864: checking for main in -lnsl_s" >&5
8864 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
8865 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8866   echo $ac_n "(cached) $ac_c" 1>&6
8867 else
8868   ac_save_LIBS="$LIBS"
8869 LIBS="-lnsl_s  $LIBS"
8870 cat > conftest.$ac_ext <<EOF
8871 #line 8872 "configure"
8872 #include "confdefs.h"
8873
8874 int main() {
8875 main()
8876 ; return 0; }
8877 EOF
8878 if { (eval echo configure:8879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8879   rm -rf conftest*
8880   eval "ac_cv_lib_$ac_lib_var=yes"
8881 else
8882   echo "configure: failed program was:" >&5
8883   cat conftest.$ac_ext >&5
8884   rm -rf conftest*
8885   eval "ac_cv_lib_$ac_lib_var=no"
8886 fi
8887 rm -f conftest*
8888 LIBS="$ac_save_LIBS"
8889
8890 fi
8891 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8892   echo "$ac_t""yes" 1>&6
8893     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8894     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8895   cat >> confdefs.h <<EOF
8896 #define $ac_tr_lib 1
8897 EOF
8898
8899   LIBS="-lnsl_s $LIBS"
8900
8901 else
8902   echo "$ac_t""no" 1>&6
8903 fi
8904
8905         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
8906 echo "configure:8907: checking for main in -lnsl" >&5
8907 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
8908 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8909   echo $ac_n "(cached) $ac_c" 1>&6
8910 else
8911   ac_save_LIBS="$LIBS"
8912 LIBS="-lnsl  $LIBS"
8913 cat > conftest.$ac_ext <<EOF
8914 #line 8915 "configure"
8915 #include "confdefs.h"
8916
8917 int main() {
8918 main()
8919 ; return 0; }
8920 EOF
8921 if { (eval echo configure:8922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8922   rm -rf conftest*
8923   eval "ac_cv_lib_$ac_lib_var=yes"
8924 else
8925   echo "configure: failed program was:" >&5
8926   cat conftest.$ac_ext >&5
8927   rm -rf conftest*
8928   eval "ac_cv_lib_$ac_lib_var=no"
8929 fi
8930 rm -f conftest*
8931 LIBS="$ac_save_LIBS"
8932
8933 fi
8934 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8935   echo "$ac_t""yes" 1>&6
8936     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8937     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8938   cat >> confdefs.h <<EOF
8939 #define $ac_tr_lib 1
8940 EOF
8941
8942   LIBS="-lnsl $LIBS"
8943
8944 else
8945   echo "$ac_t""no" 1>&6
8946 fi
8947
8948         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
8949 echo "configure:8950: checking for socket in -linet" >&5
8950 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
8951 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8952   echo $ac_n "(cached) $ac_c" 1>&6
8953 else
8954   ac_save_LIBS="$LIBS"
8955 LIBS="-linet  $LIBS"
8956 cat > conftest.$ac_ext <<EOF
8957 #line 8958 "configure"
8958 #include "confdefs.h"
8959 /* Override any gcc2 internal prototype to avoid an error.  */
8960 /* We use char because int might match the return type of a gcc2
8961     builtin and then its argument prototype would still apply.  */
8962 char socket();
8963
8964 int main() {
8965 socket()
8966 ; return 0; }
8967 EOF
8968 if { (eval echo configure:8969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8969   rm -rf conftest*
8970   eval "ac_cv_lib_$ac_lib_var=yes"
8971 else
8972   echo "configure: failed program was:" >&5
8973   cat conftest.$ac_ext >&5
8974   rm -rf conftest*
8975   eval "ac_cv_lib_$ac_lib_var=no"
8976 fi
8977 rm -f conftest*
8978 LIBS="$ac_save_LIBS"
8979
8980 fi
8981 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8982   echo "$ac_t""yes" 1>&6
8983     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8984     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8985   cat >> confdefs.h <<EOF
8986 #define $ac_tr_lib 1
8987 EOF
8988
8989   LIBS="-linet $LIBS"
8990
8991 else
8992   echo "$ac_t""no" 1>&6
8993 fi
8994
8995         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
8996 echo "configure:8997: checking for main in -lgen" >&5
8997 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
8998 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8999   echo $ac_n "(cached) $ac_c" 1>&6
9000 else
9001   ac_save_LIBS="$LIBS"
9002 LIBS="-lgen  $LIBS"
9003 cat > conftest.$ac_ext <<EOF
9004 #line 9005 "configure"
9005 #include "confdefs.h"
9006
9007 int main() {
9008 main()
9009 ; return 0; }
9010 EOF
9011 if { (eval echo configure:9012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9012   rm -rf conftest*
9013   eval "ac_cv_lib_$ac_lib_var=yes"
9014 else
9015   echo "configure: failed program was:" >&5
9016   cat conftest.$ac_ext >&5
9017   rm -rf conftest*
9018   eval "ac_cv_lib_$ac_lib_var=no"
9019 fi
9020 rm -f conftest*
9021 LIBS="$ac_save_LIBS"
9022
9023 fi
9024 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9025   echo "$ac_t""yes" 1>&6
9026     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9027     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9028   cat >> confdefs.h <<EOF
9029 #define $ac_tr_lib 1
9030 EOF
9031
9032   LIBS="-lgen $LIBS"
9033
9034 else
9035   echo "$ac_t""no" 1>&6
9036 fi
9037
9038
9039 fi
9040
9041
9042 echo $ac_n "checking for select""... $ac_c" 1>&6
9043 echo "configure:9044: checking for select" >&5
9044 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
9045   echo $ac_n "(cached) $ac_c" 1>&6
9046 else
9047   cat > conftest.$ac_ext <<EOF
9048 #line 9049 "configure"
9049 #include "confdefs.h"
9050 /* System header to define __stub macros and hopefully few prototypes,
9051     which can conflict with char select(); below.  */
9052 #include <assert.h>
9053 /* Override any gcc2 internal prototype to avoid an error.  */
9054 /* We use char because int might match the return type of a gcc2
9055     builtin and then its argument prototype would still apply.  */
9056 char select();
9057 char (*f)();
9058
9059 int main() {
9060
9061 /* The GNU C library defines this for functions which it implements
9062     to always fail with ENOSYS.  Some functions are actually named
9063     something starting with __ and the normal name is an alias.  */
9064 #if defined (__stub_select) || defined (__stub___select)
9065 choke me
9066 #else
9067 f = select;
9068 #endif
9069
9070 ; return 0; }
9071 EOF
9072 if { (eval echo configure:9073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9073   rm -rf conftest*
9074   eval "ac_cv_func_select=yes"
9075 else
9076   echo "configure: failed program was:" >&5
9077   cat conftest.$ac_ext >&5
9078   rm -rf conftest*
9079   eval "ac_cv_func_select=no"
9080 fi
9081 rm -f conftest*
9082 fi
9083
9084 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
9085   echo "$ac_t""yes" 1>&6
9086   :
9087 else
9088   echo "$ac_t""no" 1>&6
9089 { echo "configure: error: select() required." 1>&2; exit 1; }
9090 fi
9091
9092
9093 if test "${ac_cv_header_winsock_h}" != yes; then
9094                                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
9095 echo "configure:9096: checking types of arguments for select()" >&5
9096  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
9097   echo $ac_n "(cached) $ac_c" 1>&6
9098 else
9099    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
9100   echo $ac_n "(cached) $ac_c" 1>&6
9101 else
9102     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
9103   echo $ac_n "(cached) $ac_c" 1>&6
9104 else
9105      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
9106      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
9107       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
9108        cat > conftest.$ac_ext <<EOF
9109 #line 9110 "configure"
9110 #include "confdefs.h"
9111 #ifdef HAVE_SYS_TYPES_H
9112 #include <sys/types.h>
9113 #endif
9114 #ifdef HAVE_SYS_TIME_H
9115 #include <sys/time.h>
9116 #endif
9117 #ifdef HAVE_SYS_SELECT_H
9118 #include <sys/select.h>
9119 #endif
9120 #ifdef HAVE_SYS_SOCKET_H
9121 #include <sys/socket.h>
9122 #endif
9123 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);
9124 int main() {
9125
9126 ; return 0; }
9127 EOF
9128 if { (eval echo configure:9129: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9129   rm -rf conftest*
9130           ac_not_found=no ; break 3
9131 else
9132   echo "configure: failed program was:" >&5
9133   cat conftest.$ac_ext >&5
9134   rm -rf conftest*
9135   ac_not_found=yes
9136 fi
9137 rm -f conftest*
9138       done
9139      done
9140     done
9141    
9142 fi
9143   
9144 fi
9145  
9146 fi
9147  if test "$ac_not_found" = yes; then
9148   ac_cv_func_select_arg1=int 
9149   ac_cv_func_select_arg234='int *' 
9150   ac_cv_func_select_arg5='struct timeval *'
9151  fi
9152  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
9153  cat >> confdefs.h <<EOF
9154 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
9155 EOF
9156
9157  cat >> confdefs.h <<EOF
9158 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
9159 EOF
9160
9161  cat >> confdefs.h <<EOF
9162 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
9163 EOF
9164
9165
9166 fi
9167
9168
9169 for ac_hdr in regex.h 
9170 do
9171 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9172 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9173 echo "configure:9174: checking for $ac_hdr" >&5
9174 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9175   echo $ac_n "(cached) $ac_c" 1>&6
9176 else
9177   cat > conftest.$ac_ext <<EOF
9178 #line 9179 "configure"
9179 #include "confdefs.h"
9180 #include <$ac_hdr>
9181 EOF
9182 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9183 { (eval echo configure:9184: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9184 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9185 if test -z "$ac_err"; then
9186   rm -rf conftest*
9187   eval "ac_cv_header_$ac_safe=yes"
9188 else
9189   echo "$ac_err" >&5
9190   echo "configure: failed program was:" >&5
9191   cat conftest.$ac_ext >&5
9192   rm -rf conftest*
9193   eval "ac_cv_header_$ac_safe=no"
9194 fi
9195 rm -f conftest*
9196 fi
9197 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9198   echo "$ac_t""yes" 1>&6
9199     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9200   cat >> confdefs.h <<EOF
9201 #define $ac_tr_hdr 1
9202 EOF
9203  
9204 else
9205   echo "$ac_t""no" 1>&6
9206 fi
9207 done
9208
9209 if test "$ac_cv_header_regex_h" != yes ; then
9210         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
9211 fi
9212
9213 echo $ac_n "checking for library containing regfree""... $ac_c" 1>&6
9214 echo "configure:9215: checking for library containing regfree" >&5
9215 if eval "test \"\${ac_cv_search_regfree+set}\" = set"; then
9216   echo $ac_n "(cached) $ac_c" 1>&6
9217 else
9218   ac_func_search_save_LIBS="$LIBS"
9219 ac_cv_search_regfree="no"
9220 cat > conftest.$ac_ext <<EOF
9221 #line 9222 "configure"
9222 #include "confdefs.h"
9223 /* Override any gcc2 internal prototype to avoid an error.  */
9224 /* We use char because int might match the return type of a gcc2
9225     builtin and then its argument prototype would still apply.  */
9226 char regfree();
9227
9228 int main() {
9229 regfree()
9230 ; return 0; }
9231 EOF
9232 if { (eval echo configure:9233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9233   rm -rf conftest*
9234   ac_cv_search_regfree="none required"
9235 else
9236   echo "configure: failed program was:" >&5
9237   cat conftest.$ac_ext >&5
9238 fi
9239 rm -f conftest*
9240 test "$ac_cv_search_regfree" = "no" && for ac_lib in regex gnuregex; do
9241 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9242 cat > conftest.$ac_ext <<EOF
9243 #line 9244 "configure"
9244 #include "confdefs.h"
9245 /* Override any gcc2 internal prototype to avoid an error.  */
9246 /* We use char because int might match the return type of a gcc2
9247     builtin and then its argument prototype would still apply.  */
9248 char regfree();
9249
9250 int main() {
9251 regfree()
9252 ; return 0; }
9253 EOF
9254 if { (eval echo configure:9255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9255   rm -rf conftest*
9256   ac_cv_search_regfree="-l$ac_lib"
9257 break
9258 else
9259   echo "configure: failed program was:" >&5
9260   cat conftest.$ac_ext >&5
9261 fi
9262 rm -f conftest*
9263 done
9264 LIBS="$ac_func_search_save_LIBS"
9265 fi
9266
9267 echo "$ac_t""$ac_cv_search_regfree" 1>&6
9268 if test "$ac_cv_search_regfree" != "no"; then
9269   test "$ac_cv_search_regfree" = "none required" || LIBS="$ac_cv_search_regfree $LIBS"
9270   :
9271 else :
9272   { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
9273 fi
9274
9275
9276 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
9277 echo "configure:9278: checking for compatible POSIX regex" >&5
9278 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
9279   echo $ac_n "(cached) $ac_c" 1>&6
9280 else
9281   
9282         if test "$cross_compiling" = yes; then
9283   ol_cv_c_posix_regex=cross
9284 else
9285   cat > conftest.$ac_ext <<EOF
9286 #line 9287 "configure"
9287 #include "confdefs.h"
9288
9289 #include <sys/types.h>
9290 #include <regex.h>
9291 static char *pattern, *string;
9292 main()
9293 {
9294         int rc;
9295         regex_t re;
9296
9297         pattern = "^A";
9298
9299         if(regcomp(&re, pattern, 0)) {
9300                 return -1;
9301         }
9302         
9303         string = "ALL MATCH";
9304         
9305         rc = regexec(&re, string, 0, (void*)0, 0);
9306
9307         regfree(&re);
9308
9309         return rc;
9310 }
9311 EOF
9312 if { (eval echo configure:9313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9313 then
9314   ol_cv_c_posix_regex=yes
9315 else
9316   echo "configure: failed program was:" >&5
9317   cat conftest.$ac_ext >&5
9318   rm -fr conftest*
9319   ol_cv_c_posix_regex=no
9320 fi
9321 rm -fr conftest*
9322 fi
9323
9324 fi
9325
9326 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
9327
9328 if test "$ol_cv_c_posix_regex" = no ; then
9329         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
9330 fi
9331
9332
9333 have_uuid=no
9334 for ac_hdr in sys/uuid.h
9335 do
9336 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9337 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9338 echo "configure:9339: checking for $ac_hdr" >&5
9339 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9340   echo $ac_n "(cached) $ac_c" 1>&6
9341 else
9342   cat > conftest.$ac_ext <<EOF
9343 #line 9344 "configure"
9344 #include "confdefs.h"
9345 #include <$ac_hdr>
9346 EOF
9347 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9348 { (eval echo configure:9349: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9349 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9350 if test -z "$ac_err"; then
9351   rm -rf conftest*
9352   eval "ac_cv_header_$ac_safe=yes"
9353 else
9354   echo "$ac_err" >&5
9355   echo "configure: failed program was:" >&5
9356   cat conftest.$ac_ext >&5
9357   rm -rf conftest*
9358   eval "ac_cv_header_$ac_safe=no"
9359 fi
9360 rm -f conftest*
9361 fi
9362 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9363   echo "$ac_t""yes" 1>&6
9364     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9365   cat >> confdefs.h <<EOF
9366 #define $ac_tr_hdr 1
9367 EOF
9368  
9369 else
9370   echo "$ac_t""no" 1>&6
9371 fi
9372 done
9373
9374 if test $ac_cv_header_sys_uuid_h = yes ; then
9375         save_LIBS="$LIBS"
9376         
9377 echo $ac_n "checking for library containing uuid_to_str""... $ac_c" 1>&6
9378 echo "configure:9379: checking for library containing uuid_to_str" >&5
9379 if eval "test \"\${ac_cv_search_uuid_to_str+set}\" = set"; then
9380   echo $ac_n "(cached) $ac_c" 1>&6
9381 else
9382   ac_func_search_save_LIBS="$LIBS"
9383 ac_cv_search_uuid_to_str="no"
9384 cat > conftest.$ac_ext <<EOF
9385 #line 9386 "configure"
9386 #include "confdefs.h"
9387 /* Override any gcc2 internal prototype to avoid an error.  */
9388 /* We use char because int might match the return type of a gcc2
9389     builtin and then its argument prototype would still apply.  */
9390 char uuid_to_str();
9391
9392 int main() {
9393 uuid_to_str()
9394 ; return 0; }
9395 EOF
9396 if { (eval echo configure:9397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9397   rm -rf conftest*
9398   ac_cv_search_uuid_to_str="none required"
9399 else
9400   echo "configure: failed program was:" >&5
9401   cat conftest.$ac_ext >&5
9402 fi
9403 rm -f conftest*
9404 test "$ac_cv_search_uuid_to_str" = "no" && for ac_lib in uuid; do
9405 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9406 cat > conftest.$ac_ext <<EOF
9407 #line 9408 "configure"
9408 #include "confdefs.h"
9409 /* Override any gcc2 internal prototype to avoid an error.  */
9410 /* We use char because int might match the return type of a gcc2
9411     builtin and then its argument prototype would still apply.  */
9412 char uuid_to_str();
9413
9414 int main() {
9415 uuid_to_str()
9416 ; return 0; }
9417 EOF
9418 if { (eval echo configure:9419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9419   rm -rf conftest*
9420   ac_cv_search_uuid_to_str="-l$ac_lib"
9421 break
9422 else
9423   echo "configure: failed program was:" >&5
9424   cat conftest.$ac_ext >&5
9425 fi
9426 rm -f conftest*
9427 done
9428 LIBS="$ac_func_search_save_LIBS"
9429 fi
9430
9431 echo "$ac_t""$ac_cv_search_uuid_to_str" 1>&6
9432 if test "$ac_cv_search_uuid_to_str" != "no"; then
9433   test "$ac_cv_search_uuid_to_str" = "none required" || LIBS="$ac_cv_search_uuid_to_str $LIBS"
9434   have_uuid=yes
9435 else :
9436   :
9437 fi
9438         LIBS="$save_LIBS"
9439
9440         if test have_uuid = yes ; then
9441                 cat >> confdefs.h <<\EOF
9442 #define HAVE_UUID_TO_STR 1
9443 EOF
9444
9445
9446                 test "$ac_cv_search_uuid_to_str" = "none required" || \
9447                         SLAPD_LIBS="$SLAPD_LIBS $ac_cv_search_uuid_to_str"
9448         fi
9449 fi
9450
9451 if test $have_uuid = no ; then
9452         echo $ac_n "checking to see if -lrpcrt4 is needed for win32 UUID support""... $ac_c" 1>&6
9453 echo "configure:9454: checking to see if -lrpcrt4 is needed for win32 UUID support" >&5
9454         save_LIBS="$LIBS"
9455         LIBS="$LIBS -lrpcrt4"
9456         cat > conftest.$ac_ext <<EOF
9457 #line 9458 "configure"
9458 #include "confdefs.h"
9459
9460                 int __stdcall UuidCreate(void *);
9461                 int __stdcall UuidToStringA(void *,void **);
9462                 
9463 int main() {
9464
9465                 UuidCreate(0);
9466                 UuidToStringA(0,0);
9467                 
9468 ; return 0; }
9469 EOF
9470 if { (eval echo configure:9471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9471   rm -rf conftest*
9472   need_rpcrt=yes
9473 else
9474   echo "configure: failed program was:" >&5
9475   cat conftest.$ac_ext >&5
9476   rm -rf conftest*
9477   need_rpcrt=no
9478 fi
9479 rm -f conftest*
9480         if test $need_rpcrt = yes; then
9481                 SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
9482         fi
9483         LIBS="$save_LIBS"
9484         echo "$ac_t""$need_rpcrt" 1>&6
9485 fi
9486
9487 ol_link_dnssrv=no
9488 echo $ac_n "checking for res_query""... $ac_c" 1>&6
9489 echo "configure:9490: checking for res_query" >&5
9490 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
9491   echo $ac_n "(cached) $ac_c" 1>&6
9492 else
9493   cat > conftest.$ac_ext <<EOF
9494 #line 9495 "configure"
9495 #include "confdefs.h"
9496 /* System header to define __stub macros and hopefully few prototypes,
9497     which can conflict with char res_query(); below.  */
9498 #include <assert.h>
9499 /* Override any gcc2 internal prototype to avoid an error.  */
9500 /* We use char because int might match the return type of a gcc2
9501     builtin and then its argument prototype would still apply.  */
9502 char res_query();
9503 char (*f)();
9504
9505 int main() {
9506
9507 /* The GNU C library defines this for functions which it implements
9508     to always fail with ENOSYS.  Some functions are actually named
9509     something starting with __ and the normal name is an alias.  */
9510 #if defined (__stub_res_query) || defined (__stub___res_query)
9511 choke me
9512 #else
9513 f = res_query;
9514 #endif
9515
9516 ; return 0; }
9517 EOF
9518 if { (eval echo configure:9519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9519   rm -rf conftest*
9520   eval "ac_cv_func_res_query=yes"
9521 else
9522   echo "configure: failed program was:" >&5
9523   cat conftest.$ac_ext >&5
9524   rm -rf conftest*
9525   eval "ac_cv_func_res_query=no"
9526 fi
9527 rm -f conftest*
9528 fi
9529
9530 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
9531   echo "$ac_t""yes" 1>&6
9532   :
9533 else
9534   echo "$ac_t""no" 1>&6
9535 fi
9536
9537 if test $ac_cv_func_res_query = no ; then 
9538         echo $ac_n "checking for __res_query""... $ac_c" 1>&6
9539 echo "configure:9540: checking for __res_query" >&5
9540 if eval "test \"\${ac_cv_func___res_query+set}\" = set"; then
9541   echo $ac_n "(cached) $ac_c" 1>&6
9542 else
9543   cat > conftest.$ac_ext <<EOF
9544 #line 9545 "configure"
9545 #include "confdefs.h"
9546 /* System header to define __stub macros and hopefully few prototypes,
9547     which can conflict with char __res_query(); below.  */
9548 #include <assert.h>
9549 /* Override any gcc2 internal prototype to avoid an error.  */
9550 /* We use char because int might match the return type of a gcc2
9551     builtin and then its argument prototype would still apply.  */
9552 char __res_query();
9553 char (*f)();
9554
9555 int main() {
9556
9557 /* The GNU C library defines this for functions which it implements
9558     to always fail with ENOSYS.  Some functions are actually named
9559     something starting with __ and the normal name is an alias.  */
9560 #if defined (__stub___res_query) || defined (__stub_____res_query)
9561 choke me
9562 #else
9563 f = __res_query;
9564 #endif
9565
9566 ; return 0; }
9567 EOF
9568 if { (eval echo configure:9569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9569   rm -rf conftest*
9570   eval "ac_cv_func___res_query=yes"
9571 else
9572   echo "configure: failed program was:" >&5
9573   cat conftest.$ac_ext >&5
9574   rm -rf conftest*
9575   eval "ac_cv_func___res_query=no"
9576 fi
9577 rm -f conftest*
9578 fi
9579
9580 if eval "test \"`echo '$ac_cv_func_'__res_query`\" = yes"; then
9581   echo "$ac_t""yes" 1>&6
9582   :
9583 else
9584   echo "$ac_t""no" 1>&6
9585 fi
9586
9587         ac_cv_func_res_query=$ac_cv_func___res_query
9588 fi
9589
9590 if test $ac_cv_func_res_query = no ; then 
9591         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
9592 echo "configure:9593: checking for res_query in -lbind" >&5
9593 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
9594 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9595   echo $ac_n "(cached) $ac_c" 1>&6
9596 else
9597   ac_save_LIBS="$LIBS"
9598 LIBS="-lbind  $LIBS"
9599 cat > conftest.$ac_ext <<EOF
9600 #line 9601 "configure"
9601 #include "confdefs.h"
9602 /* Override any gcc2 internal prototype to avoid an error.  */
9603 /* We use char because int might match the return type of a gcc2
9604     builtin and then its argument prototype would still apply.  */
9605 char res_query();
9606
9607 int main() {
9608 res_query()
9609 ; return 0; }
9610 EOF
9611 if { (eval echo configure:9612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9612   rm -rf conftest*
9613   eval "ac_cv_lib_$ac_lib_var=yes"
9614 else
9615   echo "configure: failed program was:" >&5
9616   cat conftest.$ac_ext >&5
9617   rm -rf conftest*
9618   eval "ac_cv_lib_$ac_lib_var=no"
9619 fi
9620 rm -f conftest*
9621 LIBS="$ac_save_LIBS"
9622
9623 fi
9624 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9625   echo "$ac_t""yes" 1>&6
9626     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9627     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9628   cat >> confdefs.h <<EOF
9629 #define $ac_tr_lib 1
9630 EOF
9631
9632   LIBS="-lbind $LIBS"
9633
9634 else
9635   echo "$ac_t""no" 1>&6
9636 fi
9637
9638         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
9639 fi
9640
9641 if test $ac_cv_func_res_query = no ; then 
9642         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
9643 echo "configure:9644: checking for __res_query in -lbind" >&5
9644 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
9645 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9646   echo $ac_n "(cached) $ac_c" 1>&6
9647 else
9648   ac_save_LIBS="$LIBS"
9649 LIBS="-lbind  $LIBS"
9650 cat > conftest.$ac_ext <<EOF
9651 #line 9652 "configure"
9652 #include "confdefs.h"
9653 /* Override any gcc2 internal prototype to avoid an error.  */
9654 /* We use char because int might match the return type of a gcc2
9655     builtin and then its argument prototype would still apply.  */
9656 char __res_query();
9657
9658 int main() {
9659 __res_query()
9660 ; return 0; }
9661 EOF
9662 if { (eval echo configure:9663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9663   rm -rf conftest*
9664   eval "ac_cv_lib_$ac_lib_var=yes"
9665 else
9666   echo "configure: failed program was:" >&5
9667   cat conftest.$ac_ext >&5
9668   rm -rf conftest*
9669   eval "ac_cv_lib_$ac_lib_var=no"
9670 fi
9671 rm -f conftest*
9672 LIBS="$ac_save_LIBS"
9673
9674 fi
9675 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9676   echo "$ac_t""yes" 1>&6
9677     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9678     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9679   cat >> confdefs.h <<EOF
9680 #define $ac_tr_lib 1
9681 EOF
9682
9683   LIBS="-lbind $LIBS"
9684
9685 else
9686   echo "$ac_t""no" 1>&6
9687 fi
9688
9689         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
9690 fi
9691
9692 if test $ac_cv_func_res_query = no ; then 
9693         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
9694 echo "configure:9695: checking for res_query in -lresolv" >&5
9695 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
9696 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9697   echo $ac_n "(cached) $ac_c" 1>&6
9698 else
9699   ac_save_LIBS="$LIBS"
9700 LIBS="-lresolv  $LIBS"
9701 cat > conftest.$ac_ext <<EOF
9702 #line 9703 "configure"
9703 #include "confdefs.h"
9704 /* Override any gcc2 internal prototype to avoid an error.  */
9705 /* We use char because int might match the return type of a gcc2
9706     builtin and then its argument prototype would still apply.  */
9707 char res_query();
9708
9709 int main() {
9710 res_query()
9711 ; return 0; }
9712 EOF
9713 if { (eval echo configure:9714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9714   rm -rf conftest*
9715   eval "ac_cv_lib_$ac_lib_var=yes"
9716 else
9717   echo "configure: failed program was:" >&5
9718   cat conftest.$ac_ext >&5
9719   rm -rf conftest*
9720   eval "ac_cv_lib_$ac_lib_var=no"
9721 fi
9722 rm -f conftest*
9723 LIBS="$ac_save_LIBS"
9724
9725 fi
9726 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9727   echo "$ac_t""yes" 1>&6
9728     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9729     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9730   cat >> confdefs.h <<EOF
9731 #define $ac_tr_lib 1
9732 EOF
9733
9734   LIBS="-lresolv $LIBS"
9735
9736 else
9737   echo "$ac_t""no" 1>&6
9738 fi
9739
9740         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
9741 fi
9742
9743 if test $ac_cv_func_res_query = no ; then 
9744         echo $ac_n "checking for __res_query in -lresolv""... $ac_c" 1>&6
9745 echo "configure:9746: checking for __res_query in -lresolv" >&5
9746 ac_lib_var=`echo resolv'_'__res_query | sed 'y%./+-:%__p__%'`
9747 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9748   echo $ac_n "(cached) $ac_c" 1>&6
9749 else
9750   ac_save_LIBS="$LIBS"
9751 LIBS="-lresolv  $LIBS"
9752 cat > conftest.$ac_ext <<EOF
9753 #line 9754 "configure"
9754 #include "confdefs.h"
9755 /* Override any gcc2 internal prototype to avoid an error.  */
9756 /* We use char because int might match the return type of a gcc2
9757     builtin and then its argument prototype would still apply.  */
9758 char __res_query();
9759
9760 int main() {
9761 __res_query()
9762 ; return 0; }
9763 EOF
9764 if { (eval echo configure:9765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9765   rm -rf conftest*
9766   eval "ac_cv_lib_$ac_lib_var=yes"
9767 else
9768   echo "configure: failed program was:" >&5
9769   cat conftest.$ac_ext >&5
9770   rm -rf conftest*
9771   eval "ac_cv_lib_$ac_lib_var=no"
9772 fi
9773 rm -f conftest*
9774 LIBS="$ac_save_LIBS"
9775
9776 fi
9777 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9778   echo "$ac_t""yes" 1>&6
9779     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9780     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9781   cat >> confdefs.h <<EOF
9782 #define $ac_tr_lib 1
9783 EOF
9784
9785   LIBS="-lresolv $LIBS"
9786
9787 else
9788   echo "$ac_t""no" 1>&6
9789 fi
9790
9791         ac_cv_func_res_query=$ac_cv_lib_resolv___res_query
9792 fi
9793
9794 if test $ac_cv_func_res_query = no ; then 
9795         echo $ac_n "checking for _res_9_query in -lresolv""... $ac_c" 1>&6
9796 echo "configure:9797: checking for _res_9_query in -lresolv" >&5
9797 ac_lib_var=`echo resolv'_'_res_9_query | sed 'y%./+-:%__p__%'`
9798 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9799   echo $ac_n "(cached) $ac_c" 1>&6
9800 else
9801   ac_save_LIBS="$LIBS"
9802 LIBS="-lresolv  $LIBS"
9803 cat > conftest.$ac_ext <<EOF
9804 #line 9805 "configure"
9805 #include "confdefs.h"
9806 /* Override any gcc2 internal prototype to avoid an error.  */
9807 /* We use char because int might match the return type of a gcc2
9808     builtin and then its argument prototype would still apply.  */
9809 char _res_9_query();
9810
9811 int main() {
9812 _res_9_query()
9813 ; return 0; }
9814 EOF
9815 if { (eval echo configure:9816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9816   rm -rf conftest*
9817   eval "ac_cv_lib_$ac_lib_var=yes"
9818 else
9819   echo "configure: failed program was:" >&5
9820   cat conftest.$ac_ext >&5
9821   rm -rf conftest*
9822   eval "ac_cv_lib_$ac_lib_var=no"
9823 fi
9824 rm -f conftest*
9825 LIBS="$ac_save_LIBS"
9826
9827 fi
9828 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9829   echo "$ac_t""yes" 1>&6
9830     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9831     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9832   cat >> confdefs.h <<EOF
9833 #define $ac_tr_lib 1
9834 EOF
9835
9836   LIBS="-lresolv $LIBS"
9837
9838 else
9839   echo "$ac_t""no" 1>&6
9840 fi
9841
9842         ac_cv_func_res_query=$ac_cv_lib_resolv_res_9_query
9843 fi
9844
9845 if test "$ac_cv_func_res_query" = yes ; then
9846         cat >> confdefs.h <<\EOF
9847 #define HAVE_RES_QUERY 1
9848 EOF
9849
9850
9851         if test $ol_enable_dnssrv != no ; then
9852                 ol_link_dnssrv=yes
9853         fi
9854 fi
9855
9856 if test "$ol_enable_dnssrv" != no -a "$ol_link_dnssrv" = no ; then
9857         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
9858 fi
9859
9860 for ac_func in getaddrinfo getnameinfo gai_strerror inet_ntop 
9861 do
9862 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9863 echo "configure:9864: checking for $ac_func" >&5
9864 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9865   echo $ac_n "(cached) $ac_c" 1>&6
9866 else
9867   cat > conftest.$ac_ext <<EOF
9868 #line 9869 "configure"
9869 #include "confdefs.h"
9870 /* System header to define __stub macros and hopefully few prototypes,
9871     which can conflict with char $ac_func(); below.  */
9872 #include <assert.h>
9873 /* Override any gcc2 internal prototype to avoid an error.  */
9874 /* We use char because int might match the return type of a gcc2
9875     builtin and then its argument prototype would still apply.  */
9876 char $ac_func();
9877 char (*f)();
9878
9879 int main() {
9880
9881 /* The GNU C library defines this for functions which it implements
9882     to always fail with ENOSYS.  Some functions are actually named
9883     something starting with __ and the normal name is an alias.  */
9884 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9885 choke me
9886 #else
9887 f = $ac_func;
9888 #endif
9889
9890 ; return 0; }
9891 EOF
9892 if { (eval echo configure:9893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9893   rm -rf conftest*
9894   eval "ac_cv_func_$ac_func=yes"
9895 else
9896   echo "configure: failed program was:" >&5
9897   cat conftest.$ac_ext >&5
9898   rm -rf conftest*
9899   eval "ac_cv_func_$ac_func=no"
9900 fi
9901 rm -f conftest*
9902 fi
9903
9904 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9905   echo "$ac_t""yes" 1>&6
9906     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9907   cat >> confdefs.h <<EOF
9908 #define $ac_tr_func 1
9909 EOF
9910  
9911 else
9912   echo "$ac_t""no" 1>&6
9913 fi
9914 done
9915
9916
9917 ol_link_ipv6=no
9918 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
9919         if test $ol_enable_ipv6 = yes ; then
9920                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
9921         fi
9922 elif test $ol_enable_ipv6 != no ; then
9923         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
9924 echo "configure:9925: checking INET6_ADDRSTRLEN" >&5
9925 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
9926   echo $ac_n "(cached) $ac_c" 1>&6
9927 else
9928   
9929                 cat > conftest.$ac_ext <<EOF
9930 #line 9931 "configure"
9931 #include "confdefs.h"
9932
9933 #                       include <netinet/in.h>
9934 #                       ifdef INET6_ADDRSTRLEN
9935                                 __has_inet6_addrstrlen__;
9936 #                       endif
9937                 
9938 EOF
9939 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9940   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
9941   rm -rf conftest*
9942   ol_cv_inet6_addrstrlen=yes
9943 else
9944   rm -rf conftest*
9945   ol_cv_inet6_addrstrlen=no
9946 fi
9947 rm -f conftest*
9948
9949 fi
9950
9951 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
9952
9953
9954         echo $ac_n "checking struct sockaddr_storage""... $ac_c" 1>&6
9955 echo "configure:9956: checking struct sockaddr_storage" >&5
9956 if eval "test \"\${ol_cv_struct_sockaddr_storage+set}\" = set"; then
9957   echo $ac_n "(cached) $ac_c" 1>&6
9958 else
9959   
9960                 cat > conftest.$ac_ext <<EOF
9961 #line 9962 "configure"
9962 #include "confdefs.h"
9963
9964 #include <sys/types.h>
9965 #include <sys/socket.h>
9966
9967 int main() {
9968
9969                         struct sockaddr_storage ss;
9970
9971 ; return 0; }
9972 EOF
9973 if { (eval echo configure:9974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9974   rm -rf conftest*
9975   ol_cv_struct_sockaddr_storage=yes
9976 else
9977   echo "configure: failed program was:" >&5
9978   cat conftest.$ac_ext >&5
9979   rm -rf conftest*
9980   ol_cv_struct_sockaddr_storage=no
9981 fi
9982 rm -f conftest*
9983 fi
9984
9985 echo "$ac_t""$ol_cv_struct_sockaddr_storage" 1>&6
9986
9987         if test $ol_cv_inet6_addrstrlen = yes \
9988                 -a $ol_cv_struct_sockaddr_storage = yes ; then
9989                 ol_link_ipv6=yes
9990         elif test $ol_enable_ipv6 = yes \
9991                         -a $ol_cv_inet6_addrstrlen = no ; then
9992                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
9993         elif test $ol_enable_ipv6 = yes \
9994                         -a $ol_cv_struct_sockaddr_storage = no ; then
9995                 { echo "configure: error: IPv6 support requires struct sockaddr_storage" 1>&2; exit 1; }
9996         fi
9997 fi
9998
9999 if test $ol_enable_local != no ; then
10000         for ac_hdr in sys/un.h 
10001 do
10002 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10003 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10004 echo "configure:10005: checking for $ac_hdr" >&5
10005 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10006   echo $ac_n "(cached) $ac_c" 1>&6
10007 else
10008   cat > conftest.$ac_ext <<EOF
10009 #line 10010 "configure"
10010 #include "confdefs.h"
10011 #include <$ac_hdr>
10012 EOF
10013 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10014 { (eval echo configure:10015: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10015 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10016 if test -z "$ac_err"; then
10017   rm -rf conftest*
10018   eval "ac_cv_header_$ac_safe=yes"
10019 else
10020   echo "$ac_err" >&5
10021   echo "configure: failed program was:" >&5
10022   cat conftest.$ac_ext >&5
10023   rm -rf conftest*
10024   eval "ac_cv_header_$ac_safe=no"
10025 fi
10026 rm -f conftest*
10027 fi
10028 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10029   echo "$ac_t""yes" 1>&6
10030     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10031   cat >> confdefs.h <<EOF
10032 #define $ac_tr_hdr 1
10033 EOF
10034  
10035 else
10036   echo "$ac_t""no" 1>&6
10037 fi
10038 done
10039
10040
10041         if test $ol_enable_local = auto ; then
10042                 ol_enable_local=$ac_cv_header_sys_un_h
10043         elif test $ac_cv_header_sys_un_h = no ; then
10044                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
10045         fi
10046 fi
10047
10048 ol_link_kbind=no
10049 ol_link_krb5=no
10050 ol_link_krb4=no
10051
10052 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
10053         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
10054         -o $ol_with_kerberos = k425 ; then
10055
10056         for ac_hdr in krb5.h
10057 do
10058 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10059 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10060 echo "configure:10061: checking for $ac_hdr" >&5
10061 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10062   echo $ac_n "(cached) $ac_c" 1>&6
10063 else
10064   cat > conftest.$ac_ext <<EOF
10065 #line 10066 "configure"
10066 #include "confdefs.h"
10067 #include <$ac_hdr>
10068 EOF
10069 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10070 { (eval echo configure:10071: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10071 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10072 if test -z "$ac_err"; then
10073   rm -rf conftest*
10074   eval "ac_cv_header_$ac_safe=yes"
10075 else
10076   echo "$ac_err" >&5
10077   echo "configure: failed program was:" >&5
10078   cat conftest.$ac_ext >&5
10079   rm -rf conftest*
10080   eval "ac_cv_header_$ac_safe=no"
10081 fi
10082 rm -f conftest*
10083 fi
10084 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10085   echo "$ac_t""yes" 1>&6
10086     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10087   cat >> confdefs.h <<EOF
10088 #define $ac_tr_hdr 1
10089 EOF
10090  
10091 else
10092   echo "$ac_t""no" 1>&6
10093 fi
10094 done
10095
10096
10097         if test $ac_cv_header_krb5_h = yes ; then
10098                                 for ac_hdr in heim_err.h
10099 do
10100 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10101 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10102 echo "configure:10103: checking for $ac_hdr" >&5
10103 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10104   echo $ac_n "(cached) $ac_c" 1>&6
10105 else
10106   cat > conftest.$ac_ext <<EOF
10107 #line 10108 "configure"
10108 #include "confdefs.h"
10109 #include <$ac_hdr>
10110 EOF
10111 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10112 { (eval echo configure:10113: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10113 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10114 if test -z "$ac_err"; then
10115   rm -rf conftest*
10116   eval "ac_cv_header_$ac_safe=yes"
10117 else
10118   echo "$ac_err" >&5
10119   echo "configure: failed program was:" >&5
10120   cat conftest.$ac_ext >&5
10121   rm -rf conftest*
10122   eval "ac_cv_header_$ac_safe=no"
10123 fi
10124 rm -f conftest*
10125 fi
10126 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10127   echo "$ac_t""yes" 1>&6
10128     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10129   cat >> confdefs.h <<EOF
10130 #define $ac_tr_hdr 1
10131 EOF
10132  
10133 else
10134   echo "$ac_t""no" 1>&6
10135 fi
10136 done
10137
10138                 if test $ac_cv_header_heim_err_h = yes ; then
10139                         krb5_impl=heimdal
10140                 else
10141                         krb5_impl=mit
10142                 fi
10143
10144                 if test $krb5_impl = mit; then
10145                         echo $ac_n "checking for main in -lk5crypto""... $ac_c" 1>&6
10146 echo "configure:10147: checking for main in -lk5crypto" >&5
10147 ac_lib_var=`echo k5crypto'_'main | sed 'y%./+-:%__p__%'`
10148 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10149   echo $ac_n "(cached) $ac_c" 1>&6
10150 else
10151   ac_save_LIBS="$LIBS"
10152 LIBS="-lk5crypto  $LIBS"
10153 cat > conftest.$ac_ext <<EOF
10154 #line 10155 "configure"
10155 #include "confdefs.h"
10156
10157 int main() {
10158 main()
10159 ; return 0; }
10160 EOF
10161 if { (eval echo configure:10162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10162   rm -rf conftest*
10163   eval "ac_cv_lib_$ac_lib_var=yes"
10164 else
10165   echo "configure: failed program was:" >&5
10166   cat conftest.$ac_ext >&5
10167   rm -rf conftest*
10168   eval "ac_cv_lib_$ac_lib_var=no"
10169 fi
10170 rm -f conftest*
10171 LIBS="$ac_save_LIBS"
10172
10173 fi
10174 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10175   echo "$ac_t""yes" 1>&6
10176   krb5crypto=k5crypto
10177 else
10178   echo "$ac_t""no" 1>&6
10179 krb5crypto=crypto
10180 fi
10181
10182
10183                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
10184 echo "configure:10185: checking for main in -lkrb5" >&5
10185 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
10186 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10187   echo $ac_n "(cached) $ac_c" 1>&6
10188 else
10189   ac_save_LIBS="$LIBS"
10190 LIBS="-lkrb5 -l$krb5crypto -lcom_err $LIBS"
10191 cat > conftest.$ac_ext <<EOF
10192 #line 10193 "configure"
10193 #include "confdefs.h"
10194
10195 int main() {
10196 main()
10197 ; return 0; }
10198 EOF
10199 if { (eval echo configure:10200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10200   rm -rf conftest*
10201   eval "ac_cv_lib_$ac_lib_var=yes"
10202 else
10203   echo "configure: failed program was:" >&5
10204   cat conftest.$ac_ext >&5
10205   rm -rf conftest*
10206   eval "ac_cv_lib_$ac_lib_var=no"
10207 fi
10208 rm -f conftest*
10209 LIBS="$ac_save_LIBS"
10210
10211 fi
10212 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10213   echo "$ac_t""yes" 1>&6
10214   have_krb5=yes
10215                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lcom_err"
10216 else
10217   echo "$ac_t""no" 1>&6
10218 have_krb5=no
10219 fi
10220
10221
10222                 elif test $krb5_impl = heimdal; then
10223                         echo $ac_n "checking for main in -ldes""... $ac_c" 1>&6
10224 echo "configure:10225: checking for main in -ldes" >&5
10225 ac_lib_var=`echo des'_'main | sed 'y%./+-:%__p__%'`
10226 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10227   echo $ac_n "(cached) $ac_c" 1>&6
10228 else
10229   ac_save_LIBS="$LIBS"
10230 LIBS="-ldes  $LIBS"
10231 cat > conftest.$ac_ext <<EOF
10232 #line 10233 "configure"
10233 #include "confdefs.h"
10234
10235 int main() {
10236 main()
10237 ; return 0; }
10238 EOF
10239 if { (eval echo configure:10240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10240   rm -rf conftest*
10241   eval "ac_cv_lib_$ac_lib_var=yes"
10242 else
10243   echo "configure: failed program was:" >&5
10244   cat conftest.$ac_ext >&5
10245   rm -rf conftest*
10246   eval "ac_cv_lib_$ac_lib_var=no"
10247 fi
10248 rm -f conftest*
10249 LIBS="$ac_save_LIBS"
10250
10251 fi
10252 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10253   echo "$ac_t""yes" 1>&6
10254   krb5crypto=des
10255 else
10256   echo "$ac_t""no" 1>&6
10257 krb5crypto=crypto
10258 fi
10259
10260
10261                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
10262 echo "configure:10263: checking for main in -lkrb5" >&5
10263 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
10264 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10265   echo $ac_n "(cached) $ac_c" 1>&6
10266 else
10267   ac_save_LIBS="$LIBS"
10268 LIBS="-lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err $LIBS"
10269 cat > conftest.$ac_ext <<EOF
10270 #line 10271 "configure"
10271 #include "confdefs.h"
10272
10273 int main() {
10274 main()
10275 ; return 0; }
10276 EOF
10277 if { (eval echo configure:10278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10278   rm -rf conftest*
10279   eval "ac_cv_lib_$ac_lib_var=yes"
10280 else
10281   echo "configure: failed program was:" >&5
10282   cat conftest.$ac_ext >&5
10283   rm -rf conftest*
10284   eval "ac_cv_lib_$ac_lib_var=no"
10285 fi
10286 rm -f conftest*
10287 LIBS="$ac_save_LIBS"
10288
10289 fi
10290 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10291   echo "$ac_t""yes" 1>&6
10292   have_krb5=yes
10293                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err"
10294 else
10295   echo "$ac_t""no" 1>&6
10296 have_krb5=no
10297 fi
10298
10299
10300                         cat >> confdefs.h <<\EOF
10301 #define HAVE_HEIMDAL_KERBEROS 1
10302 EOF
10303
10304
10305                 else
10306                         have_krb5=no
10307                         echo "configure: warning: Unrecognized Kerberos5 Implementation" 1>&2
10308                 fi
10309
10310                 if test $have_krb5 = yes ; then
10311                         ol_link_krb5=yes
10312
10313                         cat >> confdefs.h <<\EOF
10314 #define HAVE_KRB5 1
10315 EOF
10316
10317
10318                         if test $ol_with_kerberos = k5only ; then
10319                                 ol_with_kerberos=found
10320                         fi
10321
10322                 elif test $ol_with_kerberos != auto ; then
10323                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
10324                 fi
10325
10326         fi
10327 fi
10328
10329 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
10330         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
10331
10332         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
10333 do
10334 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10335 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10336 echo "configure:10337: checking for $ac_hdr" >&5
10337 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10338   echo $ac_n "(cached) $ac_c" 1>&6
10339 else
10340   cat > conftest.$ac_ext <<EOF
10341 #line 10342 "configure"
10342 #include "confdefs.h"
10343 #include <$ac_hdr>
10344 EOF
10345 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10346 { (eval echo configure:10347: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10347 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10348 if test -z "$ac_err"; then
10349   rm -rf conftest*
10350   eval "ac_cv_header_$ac_safe=yes"
10351 else
10352   echo "$ac_err" >&5
10353   echo "configure: failed program was:" >&5
10354   cat conftest.$ac_ext >&5
10355   rm -rf conftest*
10356   eval "ac_cv_header_$ac_safe=no"
10357 fi
10358 rm -f conftest*
10359 fi
10360 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10361   echo "$ac_t""yes" 1>&6
10362     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10363   cat >> confdefs.h <<EOF
10364 #define $ac_tr_hdr 1
10365 EOF
10366  
10367 else
10368   echo "$ac_t""no" 1>&6
10369 fi
10370 done
10371
10372
10373         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
10374                 if test $krb5_impl = mit; then
10375                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
10376 echo "configure:10377: checking for main in -lkrb4" >&5
10377 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
10378 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10379   echo $ac_n "(cached) $ac_c" 1>&6
10380 else
10381   ac_save_LIBS="$LIBS"
10382 LIBS="-lkrb4 -ldes425 -lkrb5 -l$krb5crypto -lcom_err $LIBS"
10383 cat > conftest.$ac_ext <<EOF
10384 #line 10385 "configure"
10385 #include "confdefs.h"
10386
10387 int main() {
10388 main()
10389 ; return 0; }
10390 EOF
10391 if { (eval echo configure:10392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10392   rm -rf conftest*
10393   eval "ac_cv_lib_$ac_lib_var=yes"
10394 else
10395   echo "configure: failed program was:" >&5
10396   cat conftest.$ac_ext >&5
10397   rm -rf conftest*
10398   eval "ac_cv_lib_$ac_lib_var=no"
10399 fi
10400 rm -f conftest*
10401 LIBS="$ac_save_LIBS"
10402
10403 fi
10404 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10405   echo "$ac_t""yes" 1>&6
10406   have_k425=yes
10407                                 KRB4_LIBS="-lkrb4 -ldes425"
10408 else
10409   echo "$ac_t""no" 1>&6
10410 have_k425=no
10411 fi
10412
10413
10414                 elif test $krb5_impl = heimdal; then
10415                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
10416 echo "configure:10417: checking for main in -lkrb4" >&5
10417 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
10418 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10419   echo $ac_n "(cached) $ac_c" 1>&6
10420 else
10421   ac_save_LIBS="$LIBS"
10422 LIBS="-lkrb4 -lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err $LIBS"
10423 cat > conftest.$ac_ext <<EOF
10424 #line 10425 "configure"
10425 #include "confdefs.h"
10426
10427 int main() {
10428 main()
10429 ; return 0; }
10430 EOF
10431 if { (eval echo configure:10432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10432   rm -rf conftest*
10433   eval "ac_cv_lib_$ac_lib_var=yes"
10434 else
10435   echo "configure: failed program was:" >&5
10436   cat conftest.$ac_ext >&5
10437   rm -rf conftest*
10438   eval "ac_cv_lib_$ac_lib_var=no"
10439 fi
10440 rm -f conftest*
10441 LIBS="$ac_save_LIBS"
10442
10443 fi
10444 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10445   echo "$ac_t""yes" 1>&6
10446   have_k425=yes
10447                                 KRB4_LIBS="-lkrb4"
10448 else
10449   echo "$ac_t""no" 1>&6
10450 have_k425=no
10451 fi
10452
10453
10454                 else
10455                         have_425=no
10456                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
10457                 fi
10458
10459                 if test $have_k425 = yes ; then
10460                         ol_with_kerberos=found
10461                         ol_link_krb4=yes
10462
10463                         cat >> confdefs.h <<\EOF
10464 #define HAVE_KRB425 1
10465 EOF
10466
10467                         cat >> confdefs.h <<\EOF
10468 #define HAVE_KRB4 1
10469 EOF
10470
10471
10472                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
10473 echo "configure:10474: checking for des_debug in Kerberos libraries" >&5
10474 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
10475   echo $ac_n "(cached) $ac_c" 1>&6
10476 else
10477   
10478                                                                 save_LIBS="$LIBS"
10479                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
10480                                 cat > conftest.$ac_ext <<EOF
10481 #line 10482 "configure"
10482 #include "confdefs.h"
10483
10484 #include <kerberosIV/krb.h>
10485 #include <kerberosIV/des.h>
10486 extern int des_debug;
10487
10488 int main() {
10489
10490 des_debug = 1;
10491
10492 ; return 0; }
10493 EOF
10494 if { (eval echo configure:10495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10495   rm -rf conftest*
10496   ol_cv_var_des_debug=yes
10497 else
10498   echo "configure: failed program was:" >&5
10499   cat conftest.$ac_ext >&5
10500   rm -rf conftest*
10501   ol_cv_var_des_debug=no
10502 fi
10503 rm -f conftest*
10504                                                                 LIBS="$save_LIBS"
10505                         
10506 fi
10507
10508 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
10509
10510                         if test $ol_cv_var_des_debug = yes ; then
10511                                 cat >> confdefs.h <<\EOF
10512 #define HAVE_DES_DEBUG 1
10513 EOF
10514
10515                         fi
10516
10517                         LIBS="$save_LIBS"
10518                 fi
10519         fi
10520 fi
10521
10522 if test $ol_link_krb5 = yes ; then
10523         ol_with_kerberos=found
10524 fi
10525
10526 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
10527         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
10528
10529         for ac_hdr in krb.h des.h krb-archaeology.h 
10530 do
10531 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10532 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10533 echo "configure:10534: checking for $ac_hdr" >&5
10534 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10535   echo $ac_n "(cached) $ac_c" 1>&6
10536 else
10537   cat > conftest.$ac_ext <<EOF
10538 #line 10539 "configure"
10539 #include "confdefs.h"
10540 #include <$ac_hdr>
10541 EOF
10542 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10543 { (eval echo configure:10544: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10544 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10545 if test -z "$ac_err"; then
10546   rm -rf conftest*
10547   eval "ac_cv_header_$ac_safe=yes"
10548 else
10549   echo "$ac_err" >&5
10550   echo "configure: failed program was:" >&5
10551   cat conftest.$ac_ext >&5
10552   rm -rf conftest*
10553   eval "ac_cv_header_$ac_safe=no"
10554 fi
10555 rm -f conftest*
10556 fi
10557 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10558   echo "$ac_t""yes" 1>&6
10559     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10560   cat >> confdefs.h <<EOF
10561 #define $ac_tr_hdr 1
10562 EOF
10563  
10564 else
10565   echo "$ac_t""no" 1>&6
10566 fi
10567 done
10568
10569
10570         if test $ac_cv_header_krb_h = yes ; then
10571                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
10572 echo "configure:10573: checking for main in -lkrb" >&5
10573 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
10574 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10575   echo $ac_n "(cached) $ac_c" 1>&6
10576 else
10577   ac_save_LIBS="$LIBS"
10578 LIBS="-lkrb -ldes $LIBS"
10579 cat > conftest.$ac_ext <<EOF
10580 #line 10581 "configure"
10581 #include "confdefs.h"
10582
10583 int main() {
10584 main()
10585 ; return 0; }
10586 EOF
10587 if { (eval echo configure:10588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10588   rm -rf conftest*
10589   eval "ac_cv_lib_$ac_lib_var=yes"
10590 else
10591   echo "configure: failed program was:" >&5
10592   cat conftest.$ac_ext >&5
10593   rm -rf conftest*
10594   eval "ac_cv_lib_$ac_lib_var=no"
10595 fi
10596 rm -f conftest*
10597 LIBS="$ac_save_LIBS"
10598
10599 fi
10600 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10601   echo "$ac_t""yes" 1>&6
10602   have_k4=yes
10603 else
10604   echo "$ac_t""no" 1>&6
10605 have_k4=no
10606 fi
10607
10608
10609                 if test $have_k4 = yes ; then
10610                         ol_with_kerberos=found
10611                         ol_link_krb4=yes
10612
10613                         cat >> confdefs.h <<\EOF
10614 #define HAVE_KRB4 1
10615 EOF
10616
10617
10618                         KRB4_LIBS="-lkrb -ldes"
10619
10620                         if test $ac_cv_header_krb_archaeology_h = yes ; then
10621                                 cat >> confdefs.h <<\EOF
10622 #define HAVE_KTH_KERBEROS 1
10623 EOF
10624
10625                         fi
10626                 fi
10627         fi
10628 fi
10629
10630 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
10631         ol_link_kbind=yes
10632
10633 elif test $ol_enable_kbind = yes ; then
10634         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
10635 fi
10636
10637 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
10638         cat >> confdefs.h <<\EOF
10639 #define HAVE_KERBEROS 1
10640 EOF
10641
10642
10643 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
10644         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
10645 fi
10646
10647 ol_link_tls=no
10648 if test $ol_with_tls != no ; then
10649         for ac_hdr in openssl/ssl.h ssl.h
10650 do
10651 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10652 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10653 echo "configure:10654: checking for $ac_hdr" >&5
10654 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10655   echo $ac_n "(cached) $ac_c" 1>&6
10656 else
10657   cat > conftest.$ac_ext <<EOF
10658 #line 10659 "configure"
10659 #include "confdefs.h"
10660 #include <$ac_hdr>
10661 EOF
10662 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10663 { (eval echo configure:10664: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10664 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10665 if test -z "$ac_err"; then
10666   rm -rf conftest*
10667   eval "ac_cv_header_$ac_safe=yes"
10668 else
10669   echo "$ac_err" >&5
10670   echo "configure: failed program was:" >&5
10671   cat conftest.$ac_ext >&5
10672   rm -rf conftest*
10673   eval "ac_cv_header_$ac_safe=no"
10674 fi
10675 rm -f conftest*
10676 fi
10677 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10678   echo "$ac_t""yes" 1>&6
10679     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10680   cat >> confdefs.h <<EOF
10681 #define $ac_tr_hdr 1
10682 EOF
10683  
10684 else
10685   echo "$ac_t""no" 1>&6
10686 fi
10687 done
10688
10689         
10690         if test $ac_cv_header_openssl_ssl_h = yes \
10691                 -o $ac_cv_header_ssl_h = yes ; then
10692                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
10693 echo "configure:10694: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
10694 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
10695 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10696   echo $ac_n "(cached) $ac_c" 1>&6
10697 else
10698   ac_save_LIBS="$LIBS"
10699 LIBS="-lssl -lcrypto $LIBS"
10700 cat > conftest.$ac_ext <<EOF
10701 #line 10702 "configure"
10702 #include "confdefs.h"
10703 /* Override any gcc2 internal prototype to avoid an error.  */
10704 /* We use char because int might match the return type of a gcc2
10705     builtin and then its argument prototype would still apply.  */
10706 char SSLeay_add_ssl_algorithms();
10707
10708 int main() {
10709 SSLeay_add_ssl_algorithms()
10710 ; return 0; }
10711 EOF
10712 if { (eval echo configure:10713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10713   rm -rf conftest*
10714   eval "ac_cv_lib_$ac_lib_var=yes"
10715 else
10716   echo "configure: failed program was:" >&5
10717   cat conftest.$ac_ext >&5
10718   rm -rf conftest*
10719   eval "ac_cv_lib_$ac_lib_var=no"
10720 fi
10721 rm -f conftest*
10722 LIBS="$ac_save_LIBS"
10723
10724 fi
10725 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10726   echo "$ac_t""yes" 1>&6
10727   have_ssleay=yes
10728                         need_rsaref=no
10729 else
10730   echo "$ac_t""no" 1>&6
10731 have_ssleay=no
10732 fi
10733
10734                         
10735                 if test $have_ssleay = no ; then
10736                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
10737 echo "configure:10738: checking for SSL_library_init in -lssl" >&5
10738 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
10739 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10740   echo $ac_n "(cached) $ac_c" 1>&6
10741 else
10742   ac_save_LIBS="$LIBS"
10743 LIBS="-lssl -lcrypto $LIBS"
10744 cat > conftest.$ac_ext <<EOF
10745 #line 10746 "configure"
10746 #include "confdefs.h"
10747 /* Override any gcc2 internal prototype to avoid an error.  */
10748 /* We use char because int might match the return type of a gcc2
10749     builtin and then its argument prototype would still apply.  */
10750 char SSL_library_init();
10751
10752 int main() {
10753 SSL_library_init()
10754 ; return 0; }
10755 EOF
10756 if { (eval echo configure:10757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10757   rm -rf conftest*
10758   eval "ac_cv_lib_$ac_lib_var=yes"
10759 else
10760   echo "configure: failed program was:" >&5
10761   cat conftest.$ac_ext >&5
10762   rm -rf conftest*
10763   eval "ac_cv_lib_$ac_lib_var=no"
10764 fi
10765 rm -f conftest*
10766 LIBS="$ac_save_LIBS"
10767
10768 fi
10769 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10770   echo "$ac_t""yes" 1>&6
10771   have_ssleay=yes
10772                                 need_rsaref=no
10773 else
10774   echo "$ac_t""no" 1>&6
10775 have_ssleay=no
10776 fi
10777
10778                 fi
10779
10780                 if test $have_ssleay = no ; then
10781                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
10782 echo "configure:10783: checking for ssl3_accept in -lssl" >&5
10783 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
10784 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10785   echo $ac_n "(cached) $ac_c" 1>&6
10786 else
10787   ac_save_LIBS="$LIBS"
10788 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
10789 cat > conftest.$ac_ext <<EOF
10790 #line 10791 "configure"
10791 #include "confdefs.h"
10792 /* Override any gcc2 internal prototype to avoid an error.  */
10793 /* We use char because int might match the return type of a gcc2
10794     builtin and then its argument prototype would still apply.  */
10795 char ssl3_accept();
10796
10797 int main() {
10798 ssl3_accept()
10799 ; return 0; }
10800 EOF
10801 if { (eval echo configure:10802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10802   rm -rf conftest*
10803   eval "ac_cv_lib_$ac_lib_var=yes"
10804 else
10805   echo "configure: failed program was:" >&5
10806   cat conftest.$ac_ext >&5
10807   rm -rf conftest*
10808   eval "ac_cv_lib_$ac_lib_var=no"
10809 fi
10810 rm -f conftest*
10811 LIBS="$ac_save_LIBS"
10812
10813 fi
10814 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10815   echo "$ac_t""yes" 1>&6
10816   have_ssleay=yes
10817                                 need_rsaref=yes
10818 else
10819   echo "$ac_t""no" 1>&6
10820 have_ssleay=no
10821 fi
10822
10823                 fi
10824
10825                 if test $have_ssleay = yes ; then
10826                         ol_with_tls=found
10827                         ol_link_tls=yes
10828
10829                         cat >> confdefs.h <<\EOF
10830 #define HAVE_SSLEAY 1
10831 EOF
10832
10833
10834                         if test $need_rsaref = yes; then
10835                                 cat >> confdefs.h <<\EOF
10836 #define HAVE_RSAREF 1
10837 EOF
10838
10839
10840                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
10841                         else
10842                                 TLS_LIBS="-lssl -lcrypto"
10843                         fi
10844                 fi
10845         fi
10846
10847 else
10848         echo "configure: warning: TLS data protection not supported!" 1>&2
10849 fi
10850
10851 WITH_TLS=no
10852 if test $ol_link_tls = yes ; then
10853         cat >> confdefs.h <<\EOF
10854 #define HAVE_TLS 1
10855 EOF
10856
10857         WITH_TLS=yes
10858
10859 elif test $ol_with_tls = auto ; then
10860         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
10861         echo "configure: warning: TLS data protection not supported!" 1>&2
10862
10863 elif test $ol_with_tls != no ; then
10864         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
10865 fi
10866
10867 if test $ol_enable_lmpasswd != no; then
10868         if test $ol_link_tls != yes ; then
10869                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
10870         fi
10871
10872         cat >> confdefs.h <<\EOF
10873 #define SLAPD_LMHASH 1
10874 EOF
10875
10876 fi
10877
10878 ol_link_threads=no
10879
10880 if test $ol_with_threads = auto -o $ol_with_threads = yes \
10881         -o $ol_with_threads = nt ; then
10882
10883         
10884         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
10885 echo "configure:10886: checking for _beginthread" >&5
10886 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
10887   echo $ac_n "(cached) $ac_c" 1>&6
10888 else
10889   cat > conftest.$ac_ext <<EOF
10890 #line 10891 "configure"
10891 #include "confdefs.h"
10892 /* System header to define __stub macros and hopefully few prototypes,
10893     which can conflict with char _beginthread(); below.  */
10894 #include <assert.h>
10895 /* Override any gcc2 internal prototype to avoid an error.  */
10896 /* We use char because int might match the return type of a gcc2
10897     builtin and then its argument prototype would still apply.  */
10898 char _beginthread();
10899 char (*f)();
10900
10901 int main() {
10902
10903 /* The GNU C library defines this for functions which it implements
10904     to always fail with ENOSYS.  Some functions are actually named
10905     something starting with __ and the normal name is an alias.  */
10906 #if defined (__stub__beginthread) || defined (__stub____beginthread)
10907 choke me
10908 #else
10909 f = _beginthread;
10910 #endif
10911
10912 ; return 0; }
10913 EOF
10914 if { (eval echo configure:10915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10915   rm -rf conftest*
10916   eval "ac_cv_func__beginthread=yes"
10917 else
10918   echo "configure: failed program was:" >&5
10919   cat conftest.$ac_ext >&5
10920   rm -rf conftest*
10921   eval "ac_cv_func__beginthread=no"
10922 fi
10923 rm -f conftest*
10924 fi
10925
10926 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
10927   echo "$ac_t""yes" 1>&6
10928   :
10929 else
10930   echo "$ac_t""no" 1>&6
10931 fi
10932
10933
10934         if test $ac_cv_func__beginthread = yes ; then
10935                 cat >> confdefs.h <<\EOF
10936 #define HAVE_NT_THREADS 1
10937 EOF
10938
10939                 ol_cv_nt_threads=yes
10940         fi
10941
10942
10943         if test "$ol_cv_nt_threads" = yes ; then
10944                 ol_link_threads=nt
10945                 ol_with_threads=found
10946                 ol_with_yielding_select=yes
10947
10948                 cat >> confdefs.h <<\EOF
10949 #define HAVE_NT_SERVICE_MANAGER 1
10950 EOF
10951
10952                 cat >> confdefs.h <<\EOF
10953 #define HAVE_NT_EVENT_LOG 1
10954 EOF
10955
10956         fi
10957
10958         if test $ol_with_threads = nt ; then
10959                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
10960         fi
10961 fi
10962
10963 if test $ol_with_threads = auto -o $ol_with_threads = yes \
10964         -o $ol_with_threads = posix ; then
10965
10966         for ac_hdr in pthread.h
10967 do
10968 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10969 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10970 echo "configure:10971: checking for $ac_hdr" >&5
10971 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10972   echo $ac_n "(cached) $ac_c" 1>&6
10973 else
10974   cat > conftest.$ac_ext <<EOF
10975 #line 10976 "configure"
10976 #include "confdefs.h"
10977 #include <$ac_hdr>
10978 EOF
10979 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10980 { (eval echo configure:10981: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10981 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10982 if test -z "$ac_err"; then
10983   rm -rf conftest*
10984   eval "ac_cv_header_$ac_safe=yes"
10985 else
10986   echo "$ac_err" >&5
10987   echo "configure: failed program was:" >&5
10988   cat conftest.$ac_ext >&5
10989   rm -rf conftest*
10990   eval "ac_cv_header_$ac_safe=no"
10991 fi
10992 rm -f conftest*
10993 fi
10994 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10995   echo "$ac_t""yes" 1>&6
10996     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10997   cat >> confdefs.h <<EOF
10998 #define $ac_tr_hdr 1
10999 EOF
11000  
11001 else
11002   echo "$ac_t""no" 1>&6
11003 fi
11004 done
11005
11006
11007         if test $ac_cv_header_pthread_h = yes ; then
11008                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
11009 echo "configure:11010: checking POSIX thread version" >&5
11010 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
11011   echo $ac_n "(cached) $ac_c" 1>&6
11012 else
11013   
11014         cat > conftest.$ac_ext <<EOF
11015 #line 11016 "configure"
11016 #include "confdefs.h"
11017
11018 #               include <pthread.h>
11019         
11020 int main() {
11021
11022                 int i = PTHREAD_CREATE_JOINABLE;
11023         
11024 ; return 0; }
11025 EOF
11026 if { (eval echo configure:11027: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11027   rm -rf conftest*
11028   
11029         cat > conftest.$ac_ext <<EOF
11030 #line 11031 "configure"
11031 #include "confdefs.h"
11032 #include <pthread.h>
11033 EOF
11034 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11035   egrep "pthread_detach" >/dev/null 2>&1; then
11036   rm -rf conftest*
11037   ol_cv_pthread_version=10
11038 else
11039   rm -rf conftest*
11040   ol_cv_pthread_version=8
11041 fi
11042 rm -f conftest*
11043
11044 else
11045   echo "configure: failed program was:" >&5
11046   cat conftest.$ac_ext >&5
11047   rm -rf conftest*
11048   
11049         cat > conftest.$ac_ext <<EOF
11050 #line 11051 "configure"
11051 #include "confdefs.h"
11052
11053 #               include <pthread.h>
11054 #               ifdef PTHREAD_CREATE_UNDETACHED
11055                 draft7
11056 #               endif
11057         
11058 EOF
11059 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11060   egrep "draft7" >/dev/null 2>&1; then
11061   rm -rf conftest*
11062   ol_cv_pthread_version=7
11063 else
11064   rm -rf conftest*
11065   
11066         cat > conftest.$ac_ext <<EOF
11067 #line 11068 "configure"
11068 #include "confdefs.h"
11069 #include <pthread.h>
11070 EOF
11071 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11072   egrep "pthread_attr_init" >/dev/null 2>&1; then
11073   rm -rf conftest*
11074   ol_cv_pthread_version=6
11075 else
11076   rm -rf conftest*
11077   
11078         cat > conftest.$ac_ext <<EOF
11079 #line 11080 "configure"
11080 #include "confdefs.h"
11081
11082 #               include <pthread.h>
11083 #ifdef          PTHREAD_MUTEX_INITIALIZER
11084                 draft5
11085 #endif
11086         
11087 EOF
11088 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11089   egrep "draft5" >/dev/null 2>&1; then
11090   rm -rf conftest*
11091   ol_cv_pthread_version=5
11092 else
11093   rm -rf conftest*
11094   ol_cv_pthread_version=4
11095 fi
11096 rm -f conftest*
11097  
11098 fi
11099 rm -f conftest*
11100  
11101 fi
11102 rm -f conftest*
11103  
11104 fi
11105 rm -f conftest*
11106
11107 fi
11108
11109 echo "$ac_t""$ol_cv_pthread_version" 1>&6
11110
11111
11112                 if test $ol_cv_pthread_version != 0 ; then
11113                         cat >> confdefs.h <<EOF
11114 #define HAVE_PTHREADS $ol_cv_pthread_version
11115 EOF
11116
11117                 else
11118                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
11119                 fi
11120
11121                 # consider threads found
11122                 ol_with_threads=found
11123
11124                 
11125         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
11126 echo "configure:11127: checking for LinuxThreads pthread.h" >&5
11127 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
11128   echo $ac_n "(cached) $ac_c" 1>&6
11129 else
11130   cat > conftest.$ac_ext <<EOF
11131 #line 11132 "configure"
11132 #include "confdefs.h"
11133 #include <pthread.h>
11134 EOF
11135 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11136   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
11137   rm -rf conftest*
11138   ol_cv_header_linux_threads=yes
11139 else
11140   rm -rf conftest*
11141   ol_cv_header_linux_threads=no
11142 fi
11143 rm -f conftest*
11144
11145                 
11146 fi
11147
11148 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
11149         if test $ol_cv_header_linux_threads = yes; then
11150                 cat >> confdefs.h <<\EOF
11151 #define HAVE_LINUX_THREADS 1
11152 EOF
11153
11154         fi
11155
11156                 
11157         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
11158 echo "configure:11159: checking for GNU Pth pthread.h" >&5
11159 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
11160   echo $ac_n "(cached) $ac_c" 1>&6
11161 else
11162   cat > conftest.$ac_ext <<EOF
11163 #line 11164 "configure"
11164 #include "confdefs.h"
11165 #include <pthread.h>
11166 #ifdef _POSIX_THREAD_IS_GNU_PTH
11167         __gnu_pth__;
11168 #endif
11169
11170 EOF
11171 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11172   egrep "__gnu_pth__" >/dev/null 2>&1; then
11173   rm -rf conftest*
11174   ol_cv_header_gnu_pth_pthread_h=yes
11175 else
11176   rm -rf conftest*
11177   ol_cv_header_gnu_pth_pthread_h=no
11178 fi
11179 rm -f conftest*
11180
11181                 
11182 fi
11183
11184 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
11185
11186
11187                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
11188                         for ac_hdr in sched.h
11189 do
11190 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11191 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11192 echo "configure:11193: checking for $ac_hdr" >&5
11193 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11194   echo $ac_n "(cached) $ac_c" 1>&6
11195 else
11196   cat > conftest.$ac_ext <<EOF
11197 #line 11198 "configure"
11198 #include "confdefs.h"
11199 #include <$ac_hdr>
11200 EOF
11201 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11202 { (eval echo configure:11203: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11203 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11204 if test -z "$ac_err"; then
11205   rm -rf conftest*
11206   eval "ac_cv_header_$ac_safe=yes"
11207 else
11208   echo "$ac_err" >&5
11209   echo "configure: failed program was:" >&5
11210   cat conftest.$ac_ext >&5
11211   rm -rf conftest*
11212   eval "ac_cv_header_$ac_safe=no"
11213 fi
11214 rm -f conftest*
11215 fi
11216 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11217   echo "$ac_t""yes" 1>&6
11218     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11219   cat >> confdefs.h <<EOF
11220 #define $ac_tr_hdr 1
11221 EOF
11222  
11223 else
11224   echo "$ac_t""no" 1>&6
11225 fi
11226 done
11227
11228                 fi
11229
11230                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
11231                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
11232 echo "configure:11233: checking for pthread_create in default libraries" >&5
11233 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
11234   echo $ac_n "(cached) $ac_c" 1>&6
11235 else
11236   
11237                 if test "$cross_compiling" = yes; then
11238   cat > conftest.$ac_ext <<EOF
11239 #line 11240 "configure"
11240 #include "confdefs.h"
11241 /* pthread test headers */
11242 #include <pthread.h>
11243 #if HAVE_PTHREADS < 7
11244 #include <errno.h>
11245 #endif
11246 #ifndef NULL
11247 #define NULL (void*)0
11248 #endif
11249
11250 static void *task(p)
11251         void *p;
11252 {
11253         return (void *) (p == NULL);
11254 }
11255
11256 int main() {
11257
11258         /* pthread test function */
11259 #ifndef PTHREAD_CREATE_DETACHED
11260 #define PTHREAD_CREATE_DETACHED 1
11261 #endif
11262         pthread_t t;
11263         int status;
11264         int detach = PTHREAD_CREATE_DETACHED;
11265
11266 #if HAVE_PTHREADS > 4
11267         /* Final pthreads */
11268         pthread_attr_t attr;
11269
11270         status = pthread_attr_init(&attr);
11271         if( status ) return status;
11272
11273 #if HAVE_PTHREADS < 7
11274         status = pthread_attr_setdetachstate(&attr, &detach);
11275         if( status < 0 ) status = errno;
11276 #else
11277         status = pthread_attr_setdetachstate(&attr, detach);
11278 #endif
11279         if( status ) return status;
11280         status = pthread_create( &t, &attr, task, NULL );
11281 #if HAVE_PTHREADS < 7
11282         if( status < 0 ) status = errno;
11283 #endif
11284         if( status ) return status;
11285 #else
11286         /* Draft 4 pthreads */
11287         status = pthread_create( &t, pthread_attr_default, task, NULL );
11288         if( status ) return errno;
11289
11290         /* give thread a chance to complete */
11291         /* it should remain joinable and hence detachable */
11292         sleep( 1 );
11293
11294         status = pthread_detach( &t );
11295         if( status ) return errno;
11296 #endif
11297
11298 #ifdef HAVE_LINUX_THREADS
11299         pthread_kill_other_threads_np();
11300 #endif
11301
11302         return 0;
11303
11304 ; return 0; }
11305 EOF
11306 if { (eval echo configure:11307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11307   rm -rf conftest*
11308   ol_cv_pthread_create=yes
11309 else
11310   echo "configure: failed program was:" >&5
11311   cat conftest.$ac_ext >&5
11312   rm -rf conftest*
11313   ol_cv_pthread_create=no
11314 fi
11315 rm -f conftest*
11316 else
11317   cat > conftest.$ac_ext <<EOF
11318 #line 11319 "configure"
11319 #include "confdefs.h"
11320 /* pthread test headers */
11321 #include <pthread.h>
11322 #if HAVE_PTHREADS < 7
11323 #include <errno.h>
11324 #endif
11325 #ifndef NULL
11326 #define NULL (void*)0
11327 #endif
11328
11329 static void *task(p)
11330         void *p;
11331 {
11332         return (void *) (p == NULL);
11333 }
11334
11335
11336 int main(argc, argv)
11337         int argc;
11338         char **argv;
11339 {
11340
11341         /* pthread test function */
11342 #ifndef PTHREAD_CREATE_DETACHED
11343 #define PTHREAD_CREATE_DETACHED 1
11344 #endif
11345         pthread_t t;
11346         int status;
11347         int detach = PTHREAD_CREATE_DETACHED;
11348
11349 #if HAVE_PTHREADS > 4
11350         /* Final pthreads */
11351         pthread_attr_t attr;
11352
11353         status = pthread_attr_init(&attr);
11354         if( status ) return status;
11355
11356 #if HAVE_PTHREADS < 7
11357         status = pthread_attr_setdetachstate(&attr, &detach);
11358         if( status < 0 ) status = errno;
11359 #else
11360         status = pthread_attr_setdetachstate(&attr, detach);
11361 #endif
11362         if( status ) return status;
11363         status = pthread_create( &t, &attr, task, NULL );
11364 #if HAVE_PTHREADS < 7
11365         if( status < 0 ) status = errno;
11366 #endif
11367         if( status ) return status;
11368 #else
11369         /* Draft 4 pthreads */
11370         status = pthread_create( &t, pthread_attr_default, task, NULL );
11371         if( status ) return errno;
11372
11373         /* give thread a chance to complete */
11374         /* it should remain joinable and hence detachable */
11375         sleep( 1 );
11376
11377         status = pthread_detach( &t );
11378         if( status ) return errno;
11379 #endif
11380
11381 #ifdef HAVE_LINUX_THREADS
11382         pthread_kill_other_threads_np();
11383 #endif
11384
11385         return 0;
11386
11387 }
11388
11389 EOF
11390 if { (eval echo configure:11391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11391 then
11392   ol_cv_pthread_create=yes
11393 else
11394   echo "configure: failed program was:" >&5
11395   cat conftest.$ac_ext >&5
11396   rm -fr conftest*
11397   ol_cv_pthread_create=no
11398 fi
11399 rm -fr conftest*
11400 fi
11401
11402 fi
11403
11404 echo "$ac_t""$ol_cv_pthread_create" 1>&6
11405
11406                 if test $ol_cv_pthread_create != no ; then
11407                         ol_link_threads=posix
11408                         ol_link_pthreads=""
11409                 fi
11410                 
11411                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
11412 if test "$ol_link_threads" = no ; then
11413         # try -kthread
11414         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
11415 echo "configure:11416: checking for pthread link with -kthread" >&5
11416 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
11417   echo $ac_n "(cached) $ac_c" 1>&6
11418 else
11419   
11420                 # save the flags
11421                 ol_LIBS="$LIBS"
11422                 LIBS="-kthread $LIBS"
11423
11424                 if test "$cross_compiling" = yes; then
11425   cat > conftest.$ac_ext <<EOF
11426 #line 11427 "configure"
11427 #include "confdefs.h"
11428 /* pthread test headers */
11429 #include <pthread.h>
11430 #if HAVE_PTHREADS < 7
11431 #include <errno.h>
11432 #endif
11433 #ifndef NULL
11434 #define NULL (void*)0
11435 #endif
11436
11437 static void *task(p)
11438         void *p;
11439 {
11440         return (void *) (p == NULL);
11441 }
11442
11443 int main() {
11444
11445         /* pthread test function */
11446 #ifndef PTHREAD_CREATE_DETACHED
11447 #define PTHREAD_CREATE_DETACHED 1
11448 #endif
11449         pthread_t t;
11450         int status;
11451         int detach = PTHREAD_CREATE_DETACHED;
11452
11453 #if HAVE_PTHREADS > 4
11454         /* Final pthreads */
11455         pthread_attr_t attr;
11456
11457         status = pthread_attr_init(&attr);
11458         if( status ) return status;
11459
11460 #if HAVE_PTHREADS < 7
11461         status = pthread_attr_setdetachstate(&attr, &detach);
11462         if( status < 0 ) status = errno;
11463 #else
11464         status = pthread_attr_setdetachstate(&attr, detach);
11465 #endif
11466         if( status ) return status;
11467         status = pthread_create( &t, &attr, task, NULL );
11468 #if HAVE_PTHREADS < 7
11469         if( status < 0 ) status = errno;
11470 #endif
11471         if( status ) return status;
11472 #else
11473         /* Draft 4 pthreads */
11474         status = pthread_create( &t, pthread_attr_default, task, NULL );
11475         if( status ) return errno;
11476
11477         /* give thread a chance to complete */
11478         /* it should remain joinable and hence detachable */
11479         sleep( 1 );
11480
11481         status = pthread_detach( &t );
11482         if( status ) return errno;
11483 #endif
11484
11485 #ifdef HAVE_LINUX_THREADS
11486         pthread_kill_other_threads_np();
11487 #endif
11488
11489         return 0;
11490
11491 ; return 0; }
11492 EOF
11493 if { (eval echo configure:11494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11494   rm -rf conftest*
11495   ol_cv_pthread_kthread=yes
11496 else
11497   echo "configure: failed program was:" >&5
11498   cat conftest.$ac_ext >&5
11499   rm -rf conftest*
11500   ol_cv_pthread_kthread=no
11501 fi
11502 rm -f conftest*
11503 else
11504   cat > conftest.$ac_ext <<EOF
11505 #line 11506 "configure"
11506 #include "confdefs.h"
11507 /* pthread test headers */
11508 #include <pthread.h>
11509 #if HAVE_PTHREADS < 7
11510 #include <errno.h>
11511 #endif
11512 #ifndef NULL
11513 #define NULL (void*)0
11514 #endif
11515
11516 static void *task(p)
11517         void *p;
11518 {
11519         return (void *) (p == NULL);
11520 }
11521
11522
11523 int main(argc, argv)
11524         int argc;
11525         char **argv;
11526 {
11527
11528         /* pthread test function */
11529 #ifndef PTHREAD_CREATE_DETACHED
11530 #define PTHREAD_CREATE_DETACHED 1
11531 #endif
11532         pthread_t t;
11533         int status;
11534         int detach = PTHREAD_CREATE_DETACHED;
11535
11536 #if HAVE_PTHREADS > 4
11537         /* Final pthreads */
11538         pthread_attr_t attr;
11539
11540         status = pthread_attr_init(&attr);
11541         if( status ) return status;
11542
11543 #if HAVE_PTHREADS < 7
11544         status = pthread_attr_setdetachstate(&attr, &detach);
11545         if( status < 0 ) status = errno;
11546 #else
11547         status = pthread_attr_setdetachstate(&attr, detach);
11548 #endif
11549         if( status ) return status;
11550         status = pthread_create( &t, &attr, task, NULL );
11551 #if HAVE_PTHREADS < 7
11552         if( status < 0 ) status = errno;
11553 #endif
11554         if( status ) return status;
11555 #else
11556         /* Draft 4 pthreads */
11557         status = pthread_create( &t, pthread_attr_default, task, NULL );
11558         if( status ) return errno;
11559
11560         /* give thread a chance to complete */
11561         /* it should remain joinable and hence detachable */
11562         sleep( 1 );
11563
11564         status = pthread_detach( &t );
11565         if( status ) return errno;
11566 #endif
11567
11568 #ifdef HAVE_LINUX_THREADS
11569         pthread_kill_other_threads_np();
11570 #endif
11571
11572         return 0;
11573
11574 }
11575
11576 EOF
11577 if { (eval echo configure:11578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11578 then
11579   ol_cv_pthread_kthread=yes
11580 else
11581   echo "configure: failed program was:" >&5
11582   cat conftest.$ac_ext >&5
11583   rm -fr conftest*
11584   ol_cv_pthread_kthread=no
11585 fi
11586 rm -fr conftest*
11587 fi
11588
11589
11590                 # restore the LIBS
11591                 LIBS="$ol_LIBS"
11592         
11593 fi
11594
11595 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
11596
11597         if test $ol_cv_pthread_kthread = yes ; then
11598                 ol_link_pthreads="-kthread"
11599                 ol_link_threads=posix
11600         fi
11601 fi
11602
11603                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
11604 if test "$ol_link_threads" = no ; then
11605         # try -pthread
11606         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
11607 echo "configure:11608: checking for pthread link with -pthread" >&5
11608 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
11609   echo $ac_n "(cached) $ac_c" 1>&6
11610 else
11611   
11612                 # save the flags
11613                 ol_LIBS="$LIBS"
11614                 LIBS="-pthread $LIBS"
11615
11616                 if test "$cross_compiling" = yes; then
11617   cat > conftest.$ac_ext <<EOF
11618 #line 11619 "configure"
11619 #include "confdefs.h"
11620 /* pthread test headers */
11621 #include <pthread.h>
11622 #if HAVE_PTHREADS < 7
11623 #include <errno.h>
11624 #endif
11625 #ifndef NULL
11626 #define NULL (void*)0
11627 #endif
11628
11629 static void *task(p)
11630         void *p;
11631 {
11632         return (void *) (p == NULL);
11633 }
11634
11635 int main() {
11636
11637         /* pthread test function */
11638 #ifndef PTHREAD_CREATE_DETACHED
11639 #define PTHREAD_CREATE_DETACHED 1
11640 #endif
11641         pthread_t t;
11642         int status;
11643         int detach = PTHREAD_CREATE_DETACHED;
11644
11645 #if HAVE_PTHREADS > 4
11646         /* Final pthreads */
11647         pthread_attr_t attr;
11648
11649         status = pthread_attr_init(&attr);
11650         if( status ) return status;
11651
11652 #if HAVE_PTHREADS < 7
11653         status = pthread_attr_setdetachstate(&attr, &detach);
11654         if( status < 0 ) status = errno;
11655 #else
11656         status = pthread_attr_setdetachstate(&attr, detach);
11657 #endif
11658         if( status ) return status;
11659         status = pthread_create( &t, &attr, task, NULL );
11660 #if HAVE_PTHREADS < 7
11661         if( status < 0 ) status = errno;
11662 #endif
11663         if( status ) return status;
11664 #else
11665         /* Draft 4 pthreads */
11666         status = pthread_create( &t, pthread_attr_default, task, NULL );
11667         if( status ) return errno;
11668
11669         /* give thread a chance to complete */
11670         /* it should remain joinable and hence detachable */
11671         sleep( 1 );
11672
11673         status = pthread_detach( &t );
11674         if( status ) return errno;
11675 #endif
11676
11677 #ifdef HAVE_LINUX_THREADS
11678         pthread_kill_other_threads_np();
11679 #endif
11680
11681         return 0;
11682
11683 ; return 0; }
11684 EOF
11685 if { (eval echo configure:11686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11686   rm -rf conftest*
11687   ol_cv_pthread_pthread=yes
11688 else
11689   echo "configure: failed program was:" >&5
11690   cat conftest.$ac_ext >&5
11691   rm -rf conftest*
11692   ol_cv_pthread_pthread=no
11693 fi
11694 rm -f conftest*
11695 else
11696   cat > conftest.$ac_ext <<EOF
11697 #line 11698 "configure"
11698 #include "confdefs.h"
11699 /* pthread test headers */
11700 #include <pthread.h>
11701 #if HAVE_PTHREADS < 7
11702 #include <errno.h>
11703 #endif
11704 #ifndef NULL
11705 #define NULL (void*)0
11706 #endif
11707
11708 static void *task(p)
11709         void *p;
11710 {
11711         return (void *) (p == NULL);
11712 }
11713
11714
11715 int main(argc, argv)
11716         int argc;
11717         char **argv;
11718 {
11719
11720         /* pthread test function */
11721 #ifndef PTHREAD_CREATE_DETACHED
11722 #define PTHREAD_CREATE_DETACHED 1
11723 #endif
11724         pthread_t t;
11725         int status;
11726         int detach = PTHREAD_CREATE_DETACHED;
11727
11728 #if HAVE_PTHREADS > 4
11729         /* Final pthreads */
11730         pthread_attr_t attr;
11731
11732         status = pthread_attr_init(&attr);
11733         if( status ) return status;
11734
11735 #if HAVE_PTHREADS < 7
11736         status = pthread_attr_setdetachstate(&attr, &detach);
11737         if( status < 0 ) status = errno;
11738 #else
11739         status = pthread_attr_setdetachstate(&attr, detach);
11740 #endif
11741         if( status ) return status;
11742         status = pthread_create( &t, &attr, task, NULL );
11743 #if HAVE_PTHREADS < 7
11744         if( status < 0 ) status = errno;
11745 #endif
11746         if( status ) return status;
11747 #else
11748         /* Draft 4 pthreads */
11749         status = pthread_create( &t, pthread_attr_default, task, NULL );
11750         if( status ) return errno;
11751
11752         /* give thread a chance to complete */
11753         /* it should remain joinable and hence detachable */
11754         sleep( 1 );
11755
11756         status = pthread_detach( &t );
11757         if( status ) return errno;
11758 #endif
11759
11760 #ifdef HAVE_LINUX_THREADS
11761         pthread_kill_other_threads_np();
11762 #endif
11763
11764         return 0;
11765
11766 }
11767
11768 EOF
11769 if { (eval echo configure:11770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11770 then
11771   ol_cv_pthread_pthread=yes
11772 else
11773   echo "configure: failed program was:" >&5
11774   cat conftest.$ac_ext >&5
11775   rm -fr conftest*
11776   ol_cv_pthread_pthread=no
11777 fi
11778 rm -fr conftest*
11779 fi
11780
11781
11782                 # restore the LIBS
11783                 LIBS="$ol_LIBS"
11784         
11785 fi
11786
11787 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
11788
11789         if test $ol_cv_pthread_pthread = yes ; then
11790                 ol_link_pthreads="-pthread"
11791                 ol_link_threads=posix
11792         fi
11793 fi
11794
11795                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
11796 if test "$ol_link_threads" = no ; then
11797         # try -pthreads
11798         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
11799 echo "configure:11800: checking for pthread link with -pthreads" >&5
11800 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
11801   echo $ac_n "(cached) $ac_c" 1>&6
11802 else
11803   
11804                 # save the flags
11805                 ol_LIBS="$LIBS"
11806                 LIBS="-pthreads $LIBS"
11807
11808                 if test "$cross_compiling" = yes; then
11809   cat > conftest.$ac_ext <<EOF
11810 #line 11811 "configure"
11811 #include "confdefs.h"
11812 /* pthread test headers */
11813 #include <pthread.h>
11814 #if HAVE_PTHREADS < 7
11815 #include <errno.h>
11816 #endif
11817 #ifndef NULL
11818 #define NULL (void*)0
11819 #endif
11820
11821 static void *task(p)
11822         void *p;
11823 {
11824         return (void *) (p == NULL);
11825 }
11826
11827 int main() {
11828
11829         /* pthread test function */
11830 #ifndef PTHREAD_CREATE_DETACHED
11831 #define PTHREAD_CREATE_DETACHED 1
11832 #endif
11833         pthread_t t;
11834         int status;
11835         int detach = PTHREAD_CREATE_DETACHED;
11836
11837 #if HAVE_PTHREADS > 4
11838         /* Final pthreads */
11839         pthread_attr_t attr;
11840
11841         status = pthread_attr_init(&attr);
11842         if( status ) return status;
11843
11844 #if HAVE_PTHREADS < 7
11845         status = pthread_attr_setdetachstate(&attr, &detach);
11846         if( status < 0 ) status = errno;
11847 #else
11848         status = pthread_attr_setdetachstate(&attr, detach);
11849 #endif
11850         if( status ) return status;
11851         status = pthread_create( &t, &attr, task, NULL );
11852 #if HAVE_PTHREADS < 7
11853         if( status < 0 ) status = errno;
11854 #endif
11855         if( status ) return status;
11856 #else
11857         /* Draft 4 pthreads */
11858         status = pthread_create( &t, pthread_attr_default, task, NULL );
11859         if( status ) return errno;
11860
11861         /* give thread a chance to complete */
11862         /* it should remain joinable and hence detachable */
11863         sleep( 1 );
11864
11865         status = pthread_detach( &t );
11866         if( status ) return errno;
11867 #endif
11868
11869 #ifdef HAVE_LINUX_THREADS
11870         pthread_kill_other_threads_np();
11871 #endif
11872
11873         return 0;
11874
11875 ; return 0; }
11876 EOF
11877 if { (eval echo configure:11878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11878   rm -rf conftest*
11879   ol_cv_pthread_pthreads=yes
11880 else
11881   echo "configure: failed program was:" >&5
11882   cat conftest.$ac_ext >&5
11883   rm -rf conftest*
11884   ol_cv_pthread_pthreads=no
11885 fi
11886 rm -f conftest*
11887 else
11888   cat > conftest.$ac_ext <<EOF
11889 #line 11890 "configure"
11890 #include "confdefs.h"
11891 /* pthread test headers */
11892 #include <pthread.h>
11893 #if HAVE_PTHREADS < 7
11894 #include <errno.h>
11895 #endif
11896 #ifndef NULL
11897 #define NULL (void*)0
11898 #endif
11899
11900 static void *task(p)
11901         void *p;
11902 {
11903         return (void *) (p == NULL);
11904 }
11905
11906
11907 int main(argc, argv)
11908         int argc;
11909         char **argv;
11910 {
11911
11912         /* pthread test function */
11913 #ifndef PTHREAD_CREATE_DETACHED
11914 #define PTHREAD_CREATE_DETACHED 1
11915 #endif
11916         pthread_t t;
11917         int status;
11918         int detach = PTHREAD_CREATE_DETACHED;
11919
11920 #if HAVE_PTHREADS > 4
11921         /* Final pthreads */
11922         pthread_attr_t attr;
11923
11924         status = pthread_attr_init(&attr);
11925         if( status ) return status;
11926
11927 #if HAVE_PTHREADS < 7
11928         status = pthread_attr_setdetachstate(&attr, &detach);
11929         if( status < 0 ) status = errno;
11930 #else
11931         status = pthread_attr_setdetachstate(&attr, detach);
11932 #endif
11933         if( status ) return status;
11934         status = pthread_create( &t, &attr, task, NULL );
11935 #if HAVE_PTHREADS < 7
11936         if( status < 0 ) status = errno;
11937 #endif
11938         if( status ) return status;
11939 #else
11940         /* Draft 4 pthreads */
11941         status = pthread_create( &t, pthread_attr_default, task, NULL );
11942         if( status ) return errno;
11943
11944         /* give thread a chance to complete */
11945         /* it should remain joinable and hence detachable */
11946         sleep( 1 );
11947
11948         status = pthread_detach( &t );
11949         if( status ) return errno;
11950 #endif
11951
11952 #ifdef HAVE_LINUX_THREADS
11953         pthread_kill_other_threads_np();
11954 #endif
11955
11956         return 0;
11957
11958 }
11959
11960 EOF
11961 if { (eval echo configure:11962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11962 then
11963   ol_cv_pthread_pthreads=yes
11964 else
11965   echo "configure: failed program was:" >&5
11966   cat conftest.$ac_ext >&5
11967   rm -fr conftest*
11968   ol_cv_pthread_pthreads=no
11969 fi
11970 rm -fr conftest*
11971 fi
11972
11973
11974                 # restore the LIBS
11975                 LIBS="$ol_LIBS"
11976         
11977 fi
11978
11979 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
11980
11981         if test $ol_cv_pthread_pthreads = yes ; then
11982                 ol_link_pthreads="-pthreads"
11983                 ol_link_threads=posix
11984         fi
11985 fi
11986
11987                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
11988 if test "$ol_link_threads" = no ; then
11989         # try -mthreads
11990         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
11991 echo "configure:11992: checking for pthread link with -mthreads" >&5
11992 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
11993   echo $ac_n "(cached) $ac_c" 1>&6
11994 else
11995   
11996                 # save the flags
11997                 ol_LIBS="$LIBS"
11998                 LIBS="-mthreads $LIBS"
11999
12000                 if test "$cross_compiling" = yes; then
12001   cat > conftest.$ac_ext <<EOF
12002 #line 12003 "configure"
12003 #include "confdefs.h"
12004 /* pthread test headers */
12005 #include <pthread.h>
12006 #if HAVE_PTHREADS < 7
12007 #include <errno.h>
12008 #endif
12009 #ifndef NULL
12010 #define NULL (void*)0
12011 #endif
12012
12013 static void *task(p)
12014         void *p;
12015 {
12016         return (void *) (p == NULL);
12017 }
12018
12019 int main() {
12020
12021         /* pthread test function */
12022 #ifndef PTHREAD_CREATE_DETACHED
12023 #define PTHREAD_CREATE_DETACHED 1
12024 #endif
12025         pthread_t t;
12026         int status;
12027         int detach = PTHREAD_CREATE_DETACHED;
12028
12029 #if HAVE_PTHREADS > 4
12030         /* Final pthreads */
12031         pthread_attr_t attr;
12032
12033         status = pthread_attr_init(&attr);
12034         if( status ) return status;
12035
12036 #if HAVE_PTHREADS < 7
12037         status = pthread_attr_setdetachstate(&attr, &detach);
12038         if( status < 0 ) status = errno;
12039 #else
12040         status = pthread_attr_setdetachstate(&attr, detach);
12041 #endif
12042         if( status ) return status;
12043         status = pthread_create( &t, &attr, task, NULL );
12044 #if HAVE_PTHREADS < 7
12045         if( status < 0 ) status = errno;
12046 #endif
12047         if( status ) return status;
12048 #else
12049         /* Draft 4 pthreads */
12050         status = pthread_create( &t, pthread_attr_default, task, NULL );
12051         if( status ) return errno;
12052
12053         /* give thread a chance to complete */
12054         /* it should remain joinable and hence detachable */
12055         sleep( 1 );
12056
12057         status = pthread_detach( &t );
12058         if( status ) return errno;
12059 #endif
12060
12061 #ifdef HAVE_LINUX_THREADS
12062         pthread_kill_other_threads_np();
12063 #endif
12064
12065         return 0;
12066
12067 ; return 0; }
12068 EOF
12069 if { (eval echo configure:12070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12070   rm -rf conftest*
12071   ol_cv_pthread_mthreads=yes
12072 else
12073   echo "configure: failed program was:" >&5
12074   cat conftest.$ac_ext >&5
12075   rm -rf conftest*
12076   ol_cv_pthread_mthreads=no
12077 fi
12078 rm -f conftest*
12079 else
12080   cat > conftest.$ac_ext <<EOF
12081 #line 12082 "configure"
12082 #include "confdefs.h"
12083 /* pthread test headers */
12084 #include <pthread.h>
12085 #if HAVE_PTHREADS < 7
12086 #include <errno.h>
12087 #endif
12088 #ifndef NULL
12089 #define NULL (void*)0
12090 #endif
12091
12092 static void *task(p)
12093         void *p;
12094 {
12095         return (void *) (p == NULL);
12096 }
12097
12098
12099 int main(argc, argv)
12100         int argc;
12101         char **argv;
12102 {
12103
12104         /* pthread test function */
12105 #ifndef PTHREAD_CREATE_DETACHED
12106 #define PTHREAD_CREATE_DETACHED 1
12107 #endif
12108         pthread_t t;
12109         int status;
12110         int detach = PTHREAD_CREATE_DETACHED;
12111
12112 #if HAVE_PTHREADS > 4
12113         /* Final pthreads */
12114         pthread_attr_t attr;
12115
12116         status = pthread_attr_init(&attr);
12117         if( status ) return status;
12118
12119 #if HAVE_PTHREADS < 7
12120         status = pthread_attr_setdetachstate(&attr, &detach);
12121         if( status < 0 ) status = errno;
12122 #else
12123         status = pthread_attr_setdetachstate(&attr, detach);
12124 #endif
12125         if( status ) return status;
12126         status = pthread_create( &t, &attr, task, NULL );
12127 #if HAVE_PTHREADS < 7
12128         if( status < 0 ) status = errno;
12129 #endif
12130         if( status ) return status;
12131 #else
12132         /* Draft 4 pthreads */
12133         status = pthread_create( &t, pthread_attr_default, task, NULL );
12134         if( status ) return errno;
12135
12136         /* give thread a chance to complete */
12137         /* it should remain joinable and hence detachable */
12138         sleep( 1 );
12139
12140         status = pthread_detach( &t );
12141         if( status ) return errno;
12142 #endif
12143
12144 #ifdef HAVE_LINUX_THREADS
12145         pthread_kill_other_threads_np();
12146 #endif
12147
12148         return 0;
12149
12150 }
12151
12152 EOF
12153 if { (eval echo configure:12154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12154 then
12155   ol_cv_pthread_mthreads=yes
12156 else
12157   echo "configure: failed program was:" >&5
12158   cat conftest.$ac_ext >&5
12159   rm -fr conftest*
12160   ol_cv_pthread_mthreads=no
12161 fi
12162 rm -fr conftest*
12163 fi
12164
12165
12166                 # restore the LIBS
12167                 LIBS="$ol_LIBS"
12168         
12169 fi
12170
12171 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
12172
12173         if test $ol_cv_pthread_mthreads = yes ; then
12174                 ol_link_pthreads="-mthreads"
12175                 ol_link_threads=posix
12176         fi
12177 fi
12178
12179                 # Pthread try link: -thread (ol_cv_pthread_thread)
12180 if test "$ol_link_threads" = no ; then
12181         # try -thread
12182         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
12183 echo "configure:12184: checking for pthread link with -thread" >&5
12184 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
12185   echo $ac_n "(cached) $ac_c" 1>&6
12186 else
12187   
12188                 # save the flags
12189                 ol_LIBS="$LIBS"
12190                 LIBS="-thread $LIBS"
12191
12192                 if test "$cross_compiling" = yes; then
12193   cat > conftest.$ac_ext <<EOF
12194 #line 12195 "configure"
12195 #include "confdefs.h"
12196 /* pthread test headers */
12197 #include <pthread.h>
12198 #if HAVE_PTHREADS < 7
12199 #include <errno.h>
12200 #endif
12201 #ifndef NULL
12202 #define NULL (void*)0
12203 #endif
12204
12205 static void *task(p)
12206         void *p;
12207 {
12208         return (void *) (p == NULL);
12209 }
12210
12211 int main() {
12212
12213         /* pthread test function */
12214 #ifndef PTHREAD_CREATE_DETACHED
12215 #define PTHREAD_CREATE_DETACHED 1
12216 #endif
12217         pthread_t t;
12218         int status;
12219         int detach = PTHREAD_CREATE_DETACHED;
12220
12221 #if HAVE_PTHREADS > 4
12222         /* Final pthreads */
12223         pthread_attr_t attr;
12224
12225         status = pthread_attr_init(&attr);
12226         if( status ) return status;
12227
12228 #if HAVE_PTHREADS < 7
12229         status = pthread_attr_setdetachstate(&attr, &detach);
12230         if( status < 0 ) status = errno;
12231 #else
12232         status = pthread_attr_setdetachstate(&attr, detach);
12233 #endif
12234         if( status ) return status;
12235         status = pthread_create( &t, &attr, task, NULL );
12236 #if HAVE_PTHREADS < 7
12237         if( status < 0 ) status = errno;
12238 #endif
12239         if( status ) return status;
12240 #else
12241         /* Draft 4 pthreads */
12242         status = pthread_create( &t, pthread_attr_default, task, NULL );
12243         if( status ) return errno;
12244
12245         /* give thread a chance to complete */
12246         /* it should remain joinable and hence detachable */
12247         sleep( 1 );
12248
12249         status = pthread_detach( &t );
12250         if( status ) return errno;
12251 #endif
12252
12253 #ifdef HAVE_LINUX_THREADS
12254         pthread_kill_other_threads_np();
12255 #endif
12256
12257         return 0;
12258
12259 ; return 0; }
12260 EOF
12261 if { (eval echo configure:12262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12262   rm -rf conftest*
12263   ol_cv_pthread_thread=yes
12264 else
12265   echo "configure: failed program was:" >&5
12266   cat conftest.$ac_ext >&5
12267   rm -rf conftest*
12268   ol_cv_pthread_thread=no
12269 fi
12270 rm -f conftest*
12271 else
12272   cat > conftest.$ac_ext <<EOF
12273 #line 12274 "configure"
12274 #include "confdefs.h"
12275 /* pthread test headers */
12276 #include <pthread.h>
12277 #if HAVE_PTHREADS < 7
12278 #include <errno.h>
12279 #endif
12280 #ifndef NULL
12281 #define NULL (void*)0
12282 #endif
12283
12284 static void *task(p)
12285         void *p;
12286 {
12287         return (void *) (p == NULL);
12288 }
12289
12290
12291 int main(argc, argv)
12292         int argc;
12293         char **argv;
12294 {
12295
12296         /* pthread test function */
12297 #ifndef PTHREAD_CREATE_DETACHED
12298 #define PTHREAD_CREATE_DETACHED 1
12299 #endif
12300         pthread_t t;
12301         int status;
12302         int detach = PTHREAD_CREATE_DETACHED;
12303
12304 #if HAVE_PTHREADS > 4
12305         /* Final pthreads */
12306         pthread_attr_t attr;
12307
12308         status = pthread_attr_init(&attr);
12309         if( status ) return status;
12310
12311 #if HAVE_PTHREADS < 7
12312         status = pthread_attr_setdetachstate(&attr, &detach);
12313         if( status < 0 ) status = errno;
12314 #else
12315         status = pthread_attr_setdetachstate(&attr, detach);
12316 #endif
12317         if( status ) return status;
12318         status = pthread_create( &t, &attr, task, NULL );
12319 #if HAVE_PTHREADS < 7
12320         if( status < 0 ) status = errno;
12321 #endif
12322         if( status ) return status;
12323 #else
12324         /* Draft 4 pthreads */
12325         status = pthread_create( &t, pthread_attr_default, task, NULL );
12326         if( status ) return errno;
12327
12328         /* give thread a chance to complete */
12329         /* it should remain joinable and hence detachable */
12330         sleep( 1 );
12331
12332         status = pthread_detach( &t );
12333         if( status ) return errno;
12334 #endif
12335
12336 #ifdef HAVE_LINUX_THREADS
12337         pthread_kill_other_threads_np();
12338 #endif
12339
12340         return 0;
12341
12342 }
12343
12344 EOF
12345 if { (eval echo configure:12346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12346 then
12347   ol_cv_pthread_thread=yes
12348 else
12349   echo "configure: failed program was:" >&5
12350   cat conftest.$ac_ext >&5
12351   rm -fr conftest*
12352   ol_cv_pthread_thread=no
12353 fi
12354 rm -fr conftest*
12355 fi
12356
12357
12358                 # restore the LIBS
12359                 LIBS="$ol_LIBS"
12360         
12361 fi
12362
12363 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
12364
12365         if test $ol_cv_pthread_thread = yes ; then
12366                 ol_link_pthreads="-thread"
12367                 ol_link_threads=posix
12368         fi
12369 fi
12370
12371
12372                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
12373 if test "$ol_link_threads" = no ; then
12374         # try -lpthread -lmach -lexc -lc_r
12375         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
12376 echo "configure:12377: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
12377 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
12378   echo $ac_n "(cached) $ac_c" 1>&6
12379 else
12380   
12381                 # save the flags
12382                 ol_LIBS="$LIBS"
12383                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
12384
12385                 if test "$cross_compiling" = yes; then
12386   cat > conftest.$ac_ext <<EOF
12387 #line 12388 "configure"
12388 #include "confdefs.h"
12389 /* pthread test headers */
12390 #include <pthread.h>
12391 #if HAVE_PTHREADS < 7
12392 #include <errno.h>
12393 #endif
12394 #ifndef NULL
12395 #define NULL (void*)0
12396 #endif
12397
12398 static void *task(p)
12399         void *p;
12400 {
12401         return (void *) (p == NULL);
12402 }
12403
12404 int main() {
12405
12406         /* pthread test function */
12407 #ifndef PTHREAD_CREATE_DETACHED
12408 #define PTHREAD_CREATE_DETACHED 1
12409 #endif
12410         pthread_t t;
12411         int status;
12412         int detach = PTHREAD_CREATE_DETACHED;
12413
12414 #if HAVE_PTHREADS > 4
12415         /* Final pthreads */
12416         pthread_attr_t attr;
12417
12418         status = pthread_attr_init(&attr);
12419         if( status ) return status;
12420
12421 #if HAVE_PTHREADS < 7
12422         status = pthread_attr_setdetachstate(&attr, &detach);
12423         if( status < 0 ) status = errno;
12424 #else
12425         status = pthread_attr_setdetachstate(&attr, detach);
12426 #endif
12427         if( status ) return status;
12428         status = pthread_create( &t, &attr, task, NULL );
12429 #if HAVE_PTHREADS < 7
12430         if( status < 0 ) status = errno;
12431 #endif
12432         if( status ) return status;
12433 #else
12434         /* Draft 4 pthreads */
12435         status = pthread_create( &t, pthread_attr_default, task, NULL );
12436         if( status ) return errno;
12437
12438         /* give thread a chance to complete */
12439         /* it should remain joinable and hence detachable */
12440         sleep( 1 );
12441
12442         status = pthread_detach( &t );
12443         if( status ) return errno;
12444 #endif
12445
12446 #ifdef HAVE_LINUX_THREADS
12447         pthread_kill_other_threads_np();
12448 #endif
12449
12450         return 0;
12451
12452 ; return 0; }
12453 EOF
12454 if { (eval echo configure:12455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12455   rm -rf conftest*
12456   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
12457 else
12458   echo "configure: failed program was:" >&5
12459   cat conftest.$ac_ext >&5
12460   rm -rf conftest*
12461   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
12462 fi
12463 rm -f conftest*
12464 else
12465   cat > conftest.$ac_ext <<EOF
12466 #line 12467 "configure"
12467 #include "confdefs.h"
12468 /* pthread test headers */
12469 #include <pthread.h>
12470 #if HAVE_PTHREADS < 7
12471 #include <errno.h>
12472 #endif
12473 #ifndef NULL
12474 #define NULL (void*)0
12475 #endif
12476
12477 static void *task(p)
12478         void *p;
12479 {
12480         return (void *) (p == NULL);
12481 }
12482
12483
12484 int main(argc, argv)
12485         int argc;
12486         char **argv;
12487 {
12488
12489         /* pthread test function */
12490 #ifndef PTHREAD_CREATE_DETACHED
12491 #define PTHREAD_CREATE_DETACHED 1
12492 #endif
12493         pthread_t t;
12494         int status;
12495         int detach = PTHREAD_CREATE_DETACHED;
12496
12497 #if HAVE_PTHREADS > 4
12498         /* Final pthreads */
12499         pthread_attr_t attr;
12500
12501         status = pthread_attr_init(&attr);
12502         if( status ) return status;
12503
12504 #if HAVE_PTHREADS < 7
12505         status = pthread_attr_setdetachstate(&attr, &detach);
12506         if( status < 0 ) status = errno;
12507 #else
12508         status = pthread_attr_setdetachstate(&attr, detach);
12509 #endif
12510         if( status ) return status;
12511         status = pthread_create( &t, &attr, task, NULL );
12512 #if HAVE_PTHREADS < 7
12513         if( status < 0 ) status = errno;
12514 #endif
12515         if( status ) return status;
12516 #else
12517         /* Draft 4 pthreads */
12518         status = pthread_create( &t, pthread_attr_default, task, NULL );
12519         if( status ) return errno;
12520
12521         /* give thread a chance to complete */
12522         /* it should remain joinable and hence detachable */
12523         sleep( 1 );
12524
12525         status = pthread_detach( &t );
12526         if( status ) return errno;
12527 #endif
12528
12529 #ifdef HAVE_LINUX_THREADS
12530         pthread_kill_other_threads_np();
12531 #endif
12532
12533         return 0;
12534
12535 }
12536
12537 EOF
12538 if { (eval echo configure:12539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12539 then
12540   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
12541 else
12542   echo "configure: failed program was:" >&5
12543   cat conftest.$ac_ext >&5
12544   rm -fr conftest*
12545   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
12546 fi
12547 rm -fr conftest*
12548 fi
12549
12550
12551                 # restore the LIBS
12552                 LIBS="$ol_LIBS"
12553         
12554 fi
12555
12556 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
12557
12558         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
12559                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
12560                 ol_link_threads=posix
12561         fi
12562 fi
12563
12564                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
12565 if test "$ol_link_threads" = no ; then
12566         # try -lpthread -lmach -lexc
12567         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
12568 echo "configure:12569: checking for pthread link with -lpthread -lmach -lexc" >&5
12569 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
12570   echo $ac_n "(cached) $ac_c" 1>&6
12571 else
12572   
12573                 # save the flags
12574                 ol_LIBS="$LIBS"
12575                 LIBS="-lpthread -lmach -lexc $LIBS"
12576
12577                 if test "$cross_compiling" = yes; then
12578   cat > conftest.$ac_ext <<EOF
12579 #line 12580 "configure"
12580 #include "confdefs.h"
12581 /* pthread test headers */
12582 #include <pthread.h>
12583 #if HAVE_PTHREADS < 7
12584 #include <errno.h>
12585 #endif
12586 #ifndef NULL
12587 #define NULL (void*)0
12588 #endif
12589
12590 static void *task(p)
12591         void *p;
12592 {
12593         return (void *) (p == NULL);
12594 }
12595
12596 int main() {
12597
12598         /* pthread test function */
12599 #ifndef PTHREAD_CREATE_DETACHED
12600 #define PTHREAD_CREATE_DETACHED 1
12601 #endif
12602         pthread_t t;
12603         int status;
12604         int detach = PTHREAD_CREATE_DETACHED;
12605
12606 #if HAVE_PTHREADS > 4
12607         /* Final pthreads */
12608         pthread_attr_t attr;
12609
12610         status = pthread_attr_init(&attr);
12611         if( status ) return status;
12612
12613 #if HAVE_PTHREADS < 7
12614         status = pthread_attr_setdetachstate(&attr, &detach);
12615         if( status < 0 ) status = errno;
12616 #else
12617         status = pthread_attr_setdetachstate(&attr, detach);
12618 #endif
12619         if( status ) return status;
12620         status = pthread_create( &t, &attr, task, NULL );
12621 #if HAVE_PTHREADS < 7
12622         if( status < 0 ) status = errno;
12623 #endif
12624         if( status ) return status;
12625 #else
12626         /* Draft 4 pthreads */
12627         status = pthread_create( &t, pthread_attr_default, task, NULL );
12628         if( status ) return errno;
12629
12630         /* give thread a chance to complete */
12631         /* it should remain joinable and hence detachable */
12632         sleep( 1 );
12633
12634         status = pthread_detach( &t );
12635         if( status ) return errno;
12636 #endif
12637
12638 #ifdef HAVE_LINUX_THREADS
12639         pthread_kill_other_threads_np();
12640 #endif
12641
12642         return 0;
12643
12644 ; return 0; }
12645 EOF
12646 if { (eval echo configure:12647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12647   rm -rf conftest*
12648   ol_cv_pthread_lpthread_lmach_lexc=yes
12649 else
12650   echo "configure: failed program was:" >&5
12651   cat conftest.$ac_ext >&5
12652   rm -rf conftest*
12653   ol_cv_pthread_lpthread_lmach_lexc=no
12654 fi
12655 rm -f conftest*
12656 else
12657   cat > conftest.$ac_ext <<EOF
12658 #line 12659 "configure"
12659 #include "confdefs.h"
12660 /* pthread test headers */
12661 #include <pthread.h>
12662 #if HAVE_PTHREADS < 7
12663 #include <errno.h>
12664 #endif
12665 #ifndef NULL
12666 #define NULL (void*)0
12667 #endif
12668
12669 static void *task(p)
12670         void *p;
12671 {
12672         return (void *) (p == NULL);
12673 }
12674
12675
12676 int main(argc, argv)
12677         int argc;
12678         char **argv;
12679 {
12680
12681         /* pthread test function */
12682 #ifndef PTHREAD_CREATE_DETACHED
12683 #define PTHREAD_CREATE_DETACHED 1
12684 #endif
12685         pthread_t t;
12686         int status;
12687         int detach = PTHREAD_CREATE_DETACHED;
12688
12689 #if HAVE_PTHREADS > 4
12690         /* Final pthreads */
12691         pthread_attr_t attr;
12692
12693         status = pthread_attr_init(&attr);
12694         if( status ) return status;
12695
12696 #if HAVE_PTHREADS < 7
12697         status = pthread_attr_setdetachstate(&attr, &detach);
12698         if( status < 0 ) status = errno;
12699 #else
12700         status = pthread_attr_setdetachstate(&attr, detach);
12701 #endif
12702         if( status ) return status;
12703         status = pthread_create( &t, &attr, task, NULL );
12704 #if HAVE_PTHREADS < 7
12705         if( status < 0 ) status = errno;
12706 #endif
12707         if( status ) return status;
12708 #else
12709         /* Draft 4 pthreads */
12710         status = pthread_create( &t, pthread_attr_default, task, NULL );
12711         if( status ) return errno;
12712
12713         /* give thread a chance to complete */
12714         /* it should remain joinable and hence detachable */
12715         sleep( 1 );
12716
12717         status = pthread_detach( &t );
12718         if( status ) return errno;
12719 #endif
12720
12721 #ifdef HAVE_LINUX_THREADS
12722         pthread_kill_other_threads_np();
12723 #endif
12724
12725         return 0;
12726
12727 }
12728
12729 EOF
12730 if { (eval echo configure:12731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12731 then
12732   ol_cv_pthread_lpthread_lmach_lexc=yes
12733 else
12734   echo "configure: failed program was:" >&5
12735   cat conftest.$ac_ext >&5
12736   rm -fr conftest*
12737   ol_cv_pthread_lpthread_lmach_lexc=no
12738 fi
12739 rm -fr conftest*
12740 fi
12741
12742
12743                 # restore the LIBS
12744                 LIBS="$ol_LIBS"
12745         
12746 fi
12747
12748 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
12749
12750         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
12751                 ol_link_pthreads="-lpthread -lmach -lexc"
12752                 ol_link_threads=posix
12753         fi
12754 fi
12755
12756
12757                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
12758 if test "$ol_link_threads" = no ; then
12759         # try -lpthread -Wl,-woff,85
12760         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
12761 echo "configure:12762: checking for pthread link with -lpthread -Wl,-woff,85" >&5
12762 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
12763   echo $ac_n "(cached) $ac_c" 1>&6
12764 else
12765   
12766                 # save the flags
12767                 ol_LIBS="$LIBS"
12768                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
12769
12770                 if test "$cross_compiling" = yes; then
12771   cat > conftest.$ac_ext <<EOF
12772 #line 12773 "configure"
12773 #include "confdefs.h"
12774 /* pthread test headers */
12775 #include <pthread.h>
12776 #if HAVE_PTHREADS < 7
12777 #include <errno.h>
12778 #endif
12779 #ifndef NULL
12780 #define NULL (void*)0
12781 #endif
12782
12783 static void *task(p)
12784         void *p;
12785 {
12786         return (void *) (p == NULL);
12787 }
12788
12789 int main() {
12790
12791         /* pthread test function */
12792 #ifndef PTHREAD_CREATE_DETACHED
12793 #define PTHREAD_CREATE_DETACHED 1
12794 #endif
12795         pthread_t t;
12796         int status;
12797         int detach = PTHREAD_CREATE_DETACHED;
12798
12799 #if HAVE_PTHREADS > 4
12800         /* Final pthreads */
12801         pthread_attr_t attr;
12802
12803         status = pthread_attr_init(&attr);
12804         if( status ) return status;
12805
12806 #if HAVE_PTHREADS < 7
12807         status = pthread_attr_setdetachstate(&attr, &detach);
12808         if( status < 0 ) status = errno;
12809 #else
12810         status = pthread_attr_setdetachstate(&attr, detach);
12811 #endif
12812         if( status ) return status;
12813         status = pthread_create( &t, &attr, task, NULL );
12814 #if HAVE_PTHREADS < 7
12815         if( status < 0 ) status = errno;
12816 #endif
12817         if( status ) return status;
12818 #else
12819         /* Draft 4 pthreads */
12820         status = pthread_create( &t, pthread_attr_default, task, NULL );
12821         if( status ) return errno;
12822
12823         /* give thread a chance to complete */
12824         /* it should remain joinable and hence detachable */
12825         sleep( 1 );
12826
12827         status = pthread_detach( &t );
12828         if( status ) return errno;
12829 #endif
12830
12831 #ifdef HAVE_LINUX_THREADS
12832         pthread_kill_other_threads_np();
12833 #endif
12834
12835         return 0;
12836
12837 ; return 0; }
12838 EOF
12839 if { (eval echo configure:12840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12840   rm -rf conftest*
12841   ol_cv_pthread_lib_lpthread_woff=yes
12842 else
12843   echo "configure: failed program was:" >&5
12844   cat conftest.$ac_ext >&5
12845   rm -rf conftest*
12846   ol_cv_pthread_lib_lpthread_woff=no
12847 fi
12848 rm -f conftest*
12849 else
12850   cat > conftest.$ac_ext <<EOF
12851 #line 12852 "configure"
12852 #include "confdefs.h"
12853 /* pthread test headers */
12854 #include <pthread.h>
12855 #if HAVE_PTHREADS < 7
12856 #include <errno.h>
12857 #endif
12858 #ifndef NULL
12859 #define NULL (void*)0
12860 #endif
12861
12862 static void *task(p)
12863         void *p;
12864 {
12865         return (void *) (p == NULL);
12866 }
12867
12868
12869 int main(argc, argv)
12870         int argc;
12871         char **argv;
12872 {
12873
12874         /* pthread test function */
12875 #ifndef PTHREAD_CREATE_DETACHED
12876 #define PTHREAD_CREATE_DETACHED 1
12877 #endif
12878         pthread_t t;
12879         int status;
12880         int detach = PTHREAD_CREATE_DETACHED;
12881
12882 #if HAVE_PTHREADS > 4
12883         /* Final pthreads */
12884         pthread_attr_t attr;
12885
12886         status = pthread_attr_init(&attr);
12887         if( status ) return status;
12888
12889 #if HAVE_PTHREADS < 7
12890         status = pthread_attr_setdetachstate(&attr, &detach);
12891         if( status < 0 ) status = errno;
12892 #else
12893         status = pthread_attr_setdetachstate(&attr, detach);
12894 #endif
12895         if( status ) return status;
12896         status = pthread_create( &t, &attr, task, NULL );
12897 #if HAVE_PTHREADS < 7
12898         if( status < 0 ) status = errno;
12899 #endif
12900         if( status ) return status;
12901 #else
12902         /* Draft 4 pthreads */
12903         status = pthread_create( &t, pthread_attr_default, task, NULL );
12904         if( status ) return errno;
12905
12906         /* give thread a chance to complete */
12907         /* it should remain joinable and hence detachable */
12908         sleep( 1 );
12909
12910         status = pthread_detach( &t );
12911         if( status ) return errno;
12912 #endif
12913
12914 #ifdef HAVE_LINUX_THREADS
12915         pthread_kill_other_threads_np();
12916 #endif
12917
12918         return 0;
12919
12920 }
12921
12922 EOF
12923 if { (eval echo configure:12924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12924 then
12925   ol_cv_pthread_lib_lpthread_woff=yes
12926 else
12927   echo "configure: failed program was:" >&5
12928   cat conftest.$ac_ext >&5
12929   rm -fr conftest*
12930   ol_cv_pthread_lib_lpthread_woff=no
12931 fi
12932 rm -fr conftest*
12933 fi
12934
12935
12936                 # restore the LIBS
12937                 LIBS="$ol_LIBS"
12938         
12939 fi
12940
12941 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
12942
12943         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
12944                 ol_link_pthreads="-lpthread -Wl,-woff,85"
12945                 ol_link_threads=posix
12946         fi
12947 fi
12948
12949
12950                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
12951 if test "$ol_link_threads" = no ; then
12952         # try -lpthread
12953         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
12954 echo "configure:12955: checking for pthread link with -lpthread" >&5
12955 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
12956   echo $ac_n "(cached) $ac_c" 1>&6
12957 else
12958   
12959                 # save the flags
12960                 ol_LIBS="$LIBS"
12961                 LIBS="-lpthread $LIBS"
12962
12963                 if test "$cross_compiling" = yes; then
12964   cat > conftest.$ac_ext <<EOF
12965 #line 12966 "configure"
12966 #include "confdefs.h"
12967 /* pthread test headers */
12968 #include <pthread.h>
12969 #if HAVE_PTHREADS < 7
12970 #include <errno.h>
12971 #endif
12972 #ifndef NULL
12973 #define NULL (void*)0
12974 #endif
12975
12976 static void *task(p)
12977         void *p;
12978 {
12979         return (void *) (p == NULL);
12980 }
12981
12982 int main() {
12983
12984         /* pthread test function */
12985 #ifndef PTHREAD_CREATE_DETACHED
12986 #define PTHREAD_CREATE_DETACHED 1
12987 #endif
12988         pthread_t t;
12989         int status;
12990         int detach = PTHREAD_CREATE_DETACHED;
12991
12992 #if HAVE_PTHREADS > 4
12993         /* Final pthreads */
12994         pthread_attr_t attr;
12995
12996         status = pthread_attr_init(&attr);
12997         if( status ) return status;
12998
12999 #if HAVE_PTHREADS < 7
13000         status = pthread_attr_setdetachstate(&attr, &detach);
13001         if( status < 0 ) status = errno;
13002 #else
13003         status = pthread_attr_setdetachstate(&attr, detach);
13004 #endif
13005         if( status ) return status;
13006         status = pthread_create( &t, &attr, task, NULL );
13007 #if HAVE_PTHREADS < 7
13008         if( status < 0 ) status = errno;
13009 #endif
13010         if( status ) return status;
13011 #else
13012         /* Draft 4 pthreads */
13013         status = pthread_create( &t, pthread_attr_default, task, NULL );
13014         if( status ) return errno;
13015
13016         /* give thread a chance to complete */
13017         /* it should remain joinable and hence detachable */
13018         sleep( 1 );
13019
13020         status = pthread_detach( &t );
13021         if( status ) return errno;
13022 #endif
13023
13024 #ifdef HAVE_LINUX_THREADS
13025         pthread_kill_other_threads_np();
13026 #endif
13027
13028         return 0;
13029
13030 ; return 0; }
13031 EOF
13032 if { (eval echo configure:13033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13033   rm -rf conftest*
13034   ol_cv_pthread_lpthread=yes
13035 else
13036   echo "configure: failed program was:" >&5
13037   cat conftest.$ac_ext >&5
13038   rm -rf conftest*
13039   ol_cv_pthread_lpthread=no
13040 fi
13041 rm -f conftest*
13042 else
13043   cat > conftest.$ac_ext <<EOF
13044 #line 13045 "configure"
13045 #include "confdefs.h"
13046 /* pthread test headers */
13047 #include <pthread.h>
13048 #if HAVE_PTHREADS < 7
13049 #include <errno.h>
13050 #endif
13051 #ifndef NULL
13052 #define NULL (void*)0
13053 #endif
13054
13055 static void *task(p)
13056         void *p;
13057 {
13058         return (void *) (p == NULL);
13059 }
13060
13061
13062 int main(argc, argv)
13063         int argc;
13064         char **argv;
13065 {
13066
13067         /* pthread test function */
13068 #ifndef PTHREAD_CREATE_DETACHED
13069 #define PTHREAD_CREATE_DETACHED 1
13070 #endif
13071         pthread_t t;
13072         int status;
13073         int detach = PTHREAD_CREATE_DETACHED;
13074
13075 #if HAVE_PTHREADS > 4
13076         /* Final pthreads */
13077         pthread_attr_t attr;
13078
13079         status = pthread_attr_init(&attr);
13080         if( status ) return status;
13081
13082 #if HAVE_PTHREADS < 7
13083         status = pthread_attr_setdetachstate(&attr, &detach);
13084         if( status < 0 ) status = errno;
13085 #else
13086         status = pthread_attr_setdetachstate(&attr, detach);
13087 #endif
13088         if( status ) return status;
13089         status = pthread_create( &t, &attr, task, NULL );
13090 #if HAVE_PTHREADS < 7
13091         if( status < 0 ) status = errno;
13092 #endif
13093         if( status ) return status;
13094 #else
13095         /* Draft 4 pthreads */
13096         status = pthread_create( &t, pthread_attr_default, task, NULL );
13097         if( status ) return errno;
13098
13099         /* give thread a chance to complete */
13100         /* it should remain joinable and hence detachable */
13101         sleep( 1 );
13102
13103         status = pthread_detach( &t );
13104         if( status ) return errno;
13105 #endif
13106
13107 #ifdef HAVE_LINUX_THREADS
13108         pthread_kill_other_threads_np();
13109 #endif
13110
13111         return 0;
13112
13113 }
13114
13115 EOF
13116 if { (eval echo configure:13117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13117 then
13118   ol_cv_pthread_lpthread=yes
13119 else
13120   echo "configure: failed program was:" >&5
13121   cat conftest.$ac_ext >&5
13122   rm -fr conftest*
13123   ol_cv_pthread_lpthread=no
13124 fi
13125 rm -fr conftest*
13126 fi
13127
13128
13129                 # restore the LIBS
13130                 LIBS="$ol_LIBS"
13131         
13132 fi
13133
13134 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
13135
13136         if test $ol_cv_pthread_lpthread = yes ; then
13137                 ol_link_pthreads="-lpthread"
13138                 ol_link_threads=posix
13139         fi
13140 fi
13141
13142                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
13143 if test "$ol_link_threads" = no ; then
13144         # try -lc_r
13145         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
13146 echo "configure:13147: checking for pthread link with -lc_r" >&5
13147 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
13148   echo $ac_n "(cached) $ac_c" 1>&6
13149 else
13150   
13151                 # save the flags
13152                 ol_LIBS="$LIBS"
13153                 LIBS="-lc_r $LIBS"
13154
13155                 if test "$cross_compiling" = yes; then
13156   cat > conftest.$ac_ext <<EOF
13157 #line 13158 "configure"
13158 #include "confdefs.h"
13159 /* pthread test headers */
13160 #include <pthread.h>
13161 #if HAVE_PTHREADS < 7
13162 #include <errno.h>
13163 #endif
13164 #ifndef NULL
13165 #define NULL (void*)0
13166 #endif
13167
13168 static void *task(p)
13169         void *p;
13170 {
13171         return (void *) (p == NULL);
13172 }
13173
13174 int main() {
13175
13176         /* pthread test function */
13177 #ifndef PTHREAD_CREATE_DETACHED
13178 #define PTHREAD_CREATE_DETACHED 1
13179 #endif
13180         pthread_t t;
13181         int status;
13182         int detach = PTHREAD_CREATE_DETACHED;
13183
13184 #if HAVE_PTHREADS > 4
13185         /* Final pthreads */
13186         pthread_attr_t attr;
13187
13188         status = pthread_attr_init(&attr);
13189         if( status ) return status;
13190
13191 #if HAVE_PTHREADS < 7
13192         status = pthread_attr_setdetachstate(&attr, &detach);
13193         if( status < 0 ) status = errno;
13194 #else
13195         status = pthread_attr_setdetachstate(&attr, detach);
13196 #endif
13197         if( status ) return status;
13198         status = pthread_create( &t, &attr, task, NULL );
13199 #if HAVE_PTHREADS < 7
13200         if( status < 0 ) status = errno;
13201 #endif
13202         if( status ) return status;
13203 #else
13204         /* Draft 4 pthreads */
13205         status = pthread_create( &t, pthread_attr_default, task, NULL );
13206         if( status ) return errno;
13207
13208         /* give thread a chance to complete */
13209         /* it should remain joinable and hence detachable */
13210         sleep( 1 );
13211
13212         status = pthread_detach( &t );
13213         if( status ) return errno;
13214 #endif
13215
13216 #ifdef HAVE_LINUX_THREADS
13217         pthread_kill_other_threads_np();
13218 #endif
13219
13220         return 0;
13221
13222 ; return 0; }
13223 EOF
13224 if { (eval echo configure:13225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13225   rm -rf conftest*
13226   ol_cv_pthread_lc_r=yes
13227 else
13228   echo "configure: failed program was:" >&5
13229   cat conftest.$ac_ext >&5
13230   rm -rf conftest*
13231   ol_cv_pthread_lc_r=no
13232 fi
13233 rm -f conftest*
13234 else
13235   cat > conftest.$ac_ext <<EOF
13236 #line 13237 "configure"
13237 #include "confdefs.h"
13238 /* pthread test headers */
13239 #include <pthread.h>
13240 #if HAVE_PTHREADS < 7
13241 #include <errno.h>
13242 #endif
13243 #ifndef NULL
13244 #define NULL (void*)0
13245 #endif
13246
13247 static void *task(p)
13248         void *p;
13249 {
13250         return (void *) (p == NULL);
13251 }
13252
13253
13254 int main(argc, argv)
13255         int argc;
13256         char **argv;
13257 {
13258
13259         /* pthread test function */
13260 #ifndef PTHREAD_CREATE_DETACHED
13261 #define PTHREAD_CREATE_DETACHED 1
13262 #endif
13263         pthread_t t;
13264         int status;
13265         int detach = PTHREAD_CREATE_DETACHED;
13266
13267 #if HAVE_PTHREADS > 4
13268         /* Final pthreads */
13269         pthread_attr_t attr;
13270
13271         status = pthread_attr_init(&attr);
13272         if( status ) return status;
13273
13274 #if HAVE_PTHREADS < 7
13275         status = pthread_attr_setdetachstate(&attr, &detach);
13276         if( status < 0 ) status = errno;
13277 #else
13278         status = pthread_attr_setdetachstate(&attr, detach);
13279 #endif
13280         if( status ) return status;
13281         status = pthread_create( &t, &attr, task, NULL );
13282 #if HAVE_PTHREADS < 7
13283         if( status < 0 ) status = errno;
13284 #endif
13285         if( status ) return status;
13286 #else
13287         /* Draft 4 pthreads */
13288         status = pthread_create( &t, pthread_attr_default, task, NULL );
13289         if( status ) return errno;
13290
13291         /* give thread a chance to complete */
13292         /* it should remain joinable and hence detachable */
13293         sleep( 1 );
13294
13295         status = pthread_detach( &t );
13296         if( status ) return errno;
13297 #endif
13298
13299 #ifdef HAVE_LINUX_THREADS
13300         pthread_kill_other_threads_np();
13301 #endif
13302
13303         return 0;
13304
13305 }
13306
13307 EOF
13308 if { (eval echo configure:13309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13309 then
13310   ol_cv_pthread_lc_r=yes
13311 else
13312   echo "configure: failed program was:" >&5
13313   cat conftest.$ac_ext >&5
13314   rm -fr conftest*
13315   ol_cv_pthread_lc_r=no
13316 fi
13317 rm -fr conftest*
13318 fi
13319
13320
13321                 # restore the LIBS
13322                 LIBS="$ol_LIBS"
13323         
13324 fi
13325
13326 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
13327
13328         if test $ol_cv_pthread_lc_r = yes ; then
13329                 ol_link_pthreads="-lc_r"
13330                 ol_link_threads=posix
13331         fi
13332 fi
13333
13334
13335                 # Pthread try link: -threads (ol_cv_pthread_threads)
13336 if test "$ol_link_threads" = no ; then
13337         # try -threads
13338         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
13339 echo "configure:13340: checking for pthread link with -threads" >&5
13340 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
13341   echo $ac_n "(cached) $ac_c" 1>&6
13342 else
13343   
13344                 # save the flags
13345                 ol_LIBS="$LIBS"
13346                 LIBS="-threads $LIBS"
13347
13348                 if test "$cross_compiling" = yes; then
13349   cat > conftest.$ac_ext <<EOF
13350 #line 13351 "configure"
13351 #include "confdefs.h"
13352 /* pthread test headers */
13353 #include <pthread.h>
13354 #if HAVE_PTHREADS < 7
13355 #include <errno.h>
13356 #endif
13357 #ifndef NULL
13358 #define NULL (void*)0
13359 #endif
13360
13361 static void *task(p)
13362         void *p;
13363 {
13364         return (void *) (p == NULL);
13365 }
13366
13367 int main() {
13368
13369         /* pthread test function */
13370 #ifndef PTHREAD_CREATE_DETACHED
13371 #define PTHREAD_CREATE_DETACHED 1
13372 #endif
13373         pthread_t t;
13374         int status;
13375         int detach = PTHREAD_CREATE_DETACHED;
13376
13377 #if HAVE_PTHREADS > 4
13378         /* Final pthreads */
13379         pthread_attr_t attr;
13380
13381         status = pthread_attr_init(&attr);
13382         if( status ) return status;
13383
13384 #if HAVE_PTHREADS < 7
13385         status = pthread_attr_setdetachstate(&attr, &detach);
13386         if( status < 0 ) status = errno;
13387 #else
13388         status = pthread_attr_setdetachstate(&attr, detach);
13389 #endif
13390         if( status ) return status;
13391         status = pthread_create( &t, &attr, task, NULL );
13392 #if HAVE_PTHREADS < 7
13393         if( status < 0 ) status = errno;
13394 #endif
13395         if( status ) return status;
13396 #else
13397         /* Draft 4 pthreads */
13398         status = pthread_create( &t, pthread_attr_default, task, NULL );
13399         if( status ) return errno;
13400
13401         /* give thread a chance to complete */
13402         /* it should remain joinable and hence detachable */
13403         sleep( 1 );
13404
13405         status = pthread_detach( &t );
13406         if( status ) return errno;
13407 #endif
13408
13409 #ifdef HAVE_LINUX_THREADS
13410         pthread_kill_other_threads_np();
13411 #endif
13412
13413         return 0;
13414
13415 ; return 0; }
13416 EOF
13417 if { (eval echo configure:13418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13418   rm -rf conftest*
13419   ol_cv_pthread_threads=yes
13420 else
13421   echo "configure: failed program was:" >&5
13422   cat conftest.$ac_ext >&5
13423   rm -rf conftest*
13424   ol_cv_pthread_threads=no
13425 fi
13426 rm -f conftest*
13427 else
13428   cat > conftest.$ac_ext <<EOF
13429 #line 13430 "configure"
13430 #include "confdefs.h"
13431 /* pthread test headers */
13432 #include <pthread.h>
13433 #if HAVE_PTHREADS < 7
13434 #include <errno.h>
13435 #endif
13436 #ifndef NULL
13437 #define NULL (void*)0
13438 #endif
13439
13440 static void *task(p)
13441         void *p;
13442 {
13443         return (void *) (p == NULL);
13444 }
13445
13446
13447 int main(argc, argv)
13448         int argc;
13449         char **argv;
13450 {
13451
13452         /* pthread test function */
13453 #ifndef PTHREAD_CREATE_DETACHED
13454 #define PTHREAD_CREATE_DETACHED 1
13455 #endif
13456         pthread_t t;
13457         int status;
13458         int detach = PTHREAD_CREATE_DETACHED;
13459
13460 #if HAVE_PTHREADS > 4
13461         /* Final pthreads */
13462         pthread_attr_t attr;
13463
13464         status = pthread_attr_init(&attr);
13465         if( status ) return status;
13466
13467 #if HAVE_PTHREADS < 7
13468         status = pthread_attr_setdetachstate(&attr, &detach);
13469         if( status < 0 ) status = errno;
13470 #else
13471         status = pthread_attr_setdetachstate(&attr, detach);
13472 #endif
13473         if( status ) return status;
13474         status = pthread_create( &t, &attr, task, NULL );
13475 #if HAVE_PTHREADS < 7
13476         if( status < 0 ) status = errno;
13477 #endif
13478         if( status ) return status;
13479 #else
13480         /* Draft 4 pthreads */
13481         status = pthread_create( &t, pthread_attr_default, task, NULL );
13482         if( status ) return errno;
13483
13484         /* give thread a chance to complete */
13485         /* it should remain joinable and hence detachable */
13486         sleep( 1 );
13487
13488         status = pthread_detach( &t );
13489         if( status ) return errno;
13490 #endif
13491
13492 #ifdef HAVE_LINUX_THREADS
13493         pthread_kill_other_threads_np();
13494 #endif
13495
13496         return 0;
13497
13498 }
13499
13500 EOF
13501 if { (eval echo configure:13502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13502 then
13503   ol_cv_pthread_threads=yes
13504 else
13505   echo "configure: failed program was:" >&5
13506   cat conftest.$ac_ext >&5
13507   rm -fr conftest*
13508   ol_cv_pthread_threads=no
13509 fi
13510 rm -fr conftest*
13511 fi
13512
13513
13514                 # restore the LIBS
13515                 LIBS="$ol_LIBS"
13516         
13517 fi
13518
13519 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
13520
13521         if test $ol_cv_pthread_threads = yes ; then
13522                 ol_link_pthreads="-threads"
13523                 ol_link_threads=posix
13524         fi
13525 fi
13526
13527
13528                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
13529 if test "$ol_link_threads" = no ; then
13530         # try -lpthreads -lmach -lexc -lc_r
13531         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
13532 echo "configure:13533: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
13533 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
13534   echo $ac_n "(cached) $ac_c" 1>&6
13535 else
13536   
13537                 # save the flags
13538                 ol_LIBS="$LIBS"
13539                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
13540
13541                 if test "$cross_compiling" = yes; then
13542   cat > conftest.$ac_ext <<EOF
13543 #line 13544 "configure"
13544 #include "confdefs.h"
13545 /* pthread test headers */
13546 #include <pthread.h>
13547 #if HAVE_PTHREADS < 7
13548 #include <errno.h>
13549 #endif
13550 #ifndef NULL
13551 #define NULL (void*)0
13552 #endif
13553
13554 static void *task(p)
13555         void *p;
13556 {
13557         return (void *) (p == NULL);
13558 }
13559
13560 int main() {
13561
13562         /* pthread test function */
13563 #ifndef PTHREAD_CREATE_DETACHED
13564 #define PTHREAD_CREATE_DETACHED 1
13565 #endif
13566         pthread_t t;
13567         int status;
13568         int detach = PTHREAD_CREATE_DETACHED;
13569
13570 #if HAVE_PTHREADS > 4
13571         /* Final pthreads */
13572         pthread_attr_t attr;
13573
13574         status = pthread_attr_init(&attr);
13575         if( status ) return status;
13576
13577 #if HAVE_PTHREADS < 7
13578         status = pthread_attr_setdetachstate(&attr, &detach);
13579         if( status < 0 ) status = errno;
13580 #else
13581         status = pthread_attr_setdetachstate(&attr, detach);
13582 #endif
13583         if( status ) return status;
13584         status = pthread_create( &t, &attr, task, NULL );
13585 #if HAVE_PTHREADS < 7
13586         if( status < 0 ) status = errno;
13587 #endif
13588         if( status ) return status;
13589 #else
13590         /* Draft 4 pthreads */
13591         status = pthread_create( &t, pthread_attr_default, task, NULL );
13592         if( status ) return errno;
13593
13594         /* give thread a chance to complete */
13595         /* it should remain joinable and hence detachable */
13596         sleep( 1 );
13597
13598         status = pthread_detach( &t );
13599         if( status ) return errno;
13600 #endif
13601
13602 #ifdef HAVE_LINUX_THREADS
13603         pthread_kill_other_threads_np();
13604 #endif
13605
13606         return 0;
13607
13608 ; return 0; }
13609 EOF
13610 if { (eval echo configure:13611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13611   rm -rf conftest*
13612   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
13613 else
13614   echo "configure: failed program was:" >&5
13615   cat conftest.$ac_ext >&5
13616   rm -rf conftest*
13617   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
13618 fi
13619 rm -f conftest*
13620 else
13621   cat > conftest.$ac_ext <<EOF
13622 #line 13623 "configure"
13623 #include "confdefs.h"
13624 /* pthread test headers */
13625 #include <pthread.h>
13626 #if HAVE_PTHREADS < 7
13627 #include <errno.h>
13628 #endif
13629 #ifndef NULL
13630 #define NULL (void*)0
13631 #endif
13632
13633 static void *task(p)
13634         void *p;
13635 {
13636         return (void *) (p == NULL);
13637 }
13638
13639
13640 int main(argc, argv)
13641         int argc;
13642         char **argv;
13643 {
13644
13645         /* pthread test function */
13646 #ifndef PTHREAD_CREATE_DETACHED
13647 #define PTHREAD_CREATE_DETACHED 1
13648 #endif
13649         pthread_t t;
13650         int status;
13651         int detach = PTHREAD_CREATE_DETACHED;
13652
13653 #if HAVE_PTHREADS > 4
13654         /* Final pthreads */
13655         pthread_attr_t attr;
13656
13657         status = pthread_attr_init(&attr);
13658         if( status ) return status;
13659
13660 #if HAVE_PTHREADS < 7
13661         status = pthread_attr_setdetachstate(&attr, &detach);
13662         if( status < 0 ) status = errno;
13663 #else
13664         status = pthread_attr_setdetachstate(&attr, detach);
13665 #endif
13666         if( status ) return status;
13667         status = pthread_create( &t, &attr, task, NULL );
13668 #if HAVE_PTHREADS < 7
13669         if( status < 0 ) status = errno;
13670 #endif
13671         if( status ) return status;
13672 #else
13673         /* Draft 4 pthreads */
13674         status = pthread_create( &t, pthread_attr_default, task, NULL );
13675         if( status ) return errno;
13676
13677         /* give thread a chance to complete */
13678         /* it should remain joinable and hence detachable */
13679         sleep( 1 );
13680
13681         status = pthread_detach( &t );
13682         if( status ) return errno;
13683 #endif
13684
13685 #ifdef HAVE_LINUX_THREADS
13686         pthread_kill_other_threads_np();
13687 #endif
13688
13689         return 0;
13690
13691 }
13692
13693 EOF
13694 if { (eval echo configure:13695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13695 then
13696   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
13697 else
13698   echo "configure: failed program was:" >&5
13699   cat conftest.$ac_ext >&5
13700   rm -fr conftest*
13701   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
13702 fi
13703 rm -fr conftest*
13704 fi
13705
13706
13707                 # restore the LIBS
13708                 LIBS="$ol_LIBS"
13709         
13710 fi
13711
13712 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
13713
13714         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
13715                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
13716                 ol_link_threads=posix
13717         fi
13718 fi
13719
13720                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
13721 if test "$ol_link_threads" = no ; then
13722         # try -lpthreads -lmach -lexc
13723         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
13724 echo "configure:13725: checking for pthread link with -lpthreads -lmach -lexc" >&5
13725 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
13726   echo $ac_n "(cached) $ac_c" 1>&6
13727 else
13728   
13729                 # save the flags
13730                 ol_LIBS="$LIBS"
13731                 LIBS="-lpthreads -lmach -lexc $LIBS"
13732
13733                 if test "$cross_compiling" = yes; then
13734   cat > conftest.$ac_ext <<EOF
13735 #line 13736 "configure"
13736 #include "confdefs.h"
13737 /* pthread test headers */
13738 #include <pthread.h>
13739 #if HAVE_PTHREADS < 7
13740 #include <errno.h>
13741 #endif
13742 #ifndef NULL
13743 #define NULL (void*)0
13744 #endif
13745
13746 static void *task(p)
13747         void *p;
13748 {
13749         return (void *) (p == NULL);
13750 }
13751
13752 int main() {
13753
13754         /* pthread test function */
13755 #ifndef PTHREAD_CREATE_DETACHED
13756 #define PTHREAD_CREATE_DETACHED 1
13757 #endif
13758         pthread_t t;
13759         int status;
13760         int detach = PTHREAD_CREATE_DETACHED;
13761
13762 #if HAVE_PTHREADS > 4
13763         /* Final pthreads */
13764         pthread_attr_t attr;
13765
13766         status = pthread_attr_init(&attr);
13767         if( status ) return status;
13768
13769 #if HAVE_PTHREADS < 7
13770         status = pthread_attr_setdetachstate(&attr, &detach);
13771         if( status < 0 ) status = errno;
13772 #else
13773         status = pthread_attr_setdetachstate(&attr, detach);
13774 #endif
13775         if( status ) return status;
13776         status = pthread_create( &t, &attr, task, NULL );
13777 #if HAVE_PTHREADS < 7
13778         if( status < 0 ) status = errno;
13779 #endif
13780         if( status ) return status;
13781 #else
13782         /* Draft 4 pthreads */
13783         status = pthread_create( &t, pthread_attr_default, task, NULL );
13784         if( status ) return errno;
13785
13786         /* give thread a chance to complete */
13787         /* it should remain joinable and hence detachable */
13788         sleep( 1 );
13789
13790         status = pthread_detach( &t );
13791         if( status ) return errno;
13792 #endif
13793
13794 #ifdef HAVE_LINUX_THREADS
13795         pthread_kill_other_threads_np();
13796 #endif
13797
13798         return 0;
13799
13800 ; return 0; }
13801 EOF
13802 if { (eval echo configure:13803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13803   rm -rf conftest*
13804   ol_cv_pthread_lpthreads_lmach_lexc=yes
13805 else
13806   echo "configure: failed program was:" >&5
13807   cat conftest.$ac_ext >&5
13808   rm -rf conftest*
13809   ol_cv_pthread_lpthreads_lmach_lexc=no
13810 fi
13811 rm -f conftest*
13812 else
13813   cat > conftest.$ac_ext <<EOF
13814 #line 13815 "configure"
13815 #include "confdefs.h"
13816 /* pthread test headers */
13817 #include <pthread.h>
13818 #if HAVE_PTHREADS < 7
13819 #include <errno.h>
13820 #endif
13821 #ifndef NULL
13822 #define NULL (void*)0
13823 #endif
13824
13825 static void *task(p)
13826         void *p;
13827 {
13828         return (void *) (p == NULL);
13829 }
13830
13831
13832 int main(argc, argv)
13833         int argc;
13834         char **argv;
13835 {
13836
13837         /* pthread test function */
13838 #ifndef PTHREAD_CREATE_DETACHED
13839 #define PTHREAD_CREATE_DETACHED 1
13840 #endif
13841         pthread_t t;
13842         int status;
13843         int detach = PTHREAD_CREATE_DETACHED;
13844
13845 #if HAVE_PTHREADS > 4
13846         /* Final pthreads */
13847         pthread_attr_t attr;
13848
13849         status = pthread_attr_init(&attr);
13850         if( status ) return status;
13851
13852 #if HAVE_PTHREADS < 7
13853         status = pthread_attr_setdetachstate(&attr, &detach);
13854         if( status < 0 ) status = errno;
13855 #else
13856         status = pthread_attr_setdetachstate(&attr, detach);
13857 #endif
13858         if( status ) return status;
13859         status = pthread_create( &t, &attr, task, NULL );
13860 #if HAVE_PTHREADS < 7
13861         if( status < 0 ) status = errno;
13862 #endif
13863         if( status ) return status;
13864 #else
13865         /* Draft 4 pthreads */
13866         status = pthread_create( &t, pthread_attr_default, task, NULL );
13867         if( status ) return errno;
13868
13869         /* give thread a chance to complete */
13870         /* it should remain joinable and hence detachable */
13871         sleep( 1 );
13872
13873         status = pthread_detach( &t );
13874         if( status ) return errno;
13875 #endif
13876
13877 #ifdef HAVE_LINUX_THREADS
13878         pthread_kill_other_threads_np();
13879 #endif
13880
13881         return 0;
13882
13883 }
13884
13885 EOF
13886 if { (eval echo configure:13887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13887 then
13888   ol_cv_pthread_lpthreads_lmach_lexc=yes
13889 else
13890   echo "configure: failed program was:" >&5
13891   cat conftest.$ac_ext >&5
13892   rm -fr conftest*
13893   ol_cv_pthread_lpthreads_lmach_lexc=no
13894 fi
13895 rm -fr conftest*
13896 fi
13897
13898
13899                 # restore the LIBS
13900                 LIBS="$ol_LIBS"
13901         
13902 fi
13903
13904 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
13905
13906         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
13907                 ol_link_pthreads="-lpthreads -lmach -lexc"
13908                 ol_link_threads=posix
13909         fi
13910 fi
13911
13912                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
13913 if test "$ol_link_threads" = no ; then
13914         # try -lpthreads -lexc
13915         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
13916 echo "configure:13917: checking for pthread link with -lpthreads -lexc" >&5
13917 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
13918   echo $ac_n "(cached) $ac_c" 1>&6
13919 else
13920   
13921                 # save the flags
13922                 ol_LIBS="$LIBS"
13923                 LIBS="-lpthreads -lexc $LIBS"
13924
13925                 if test "$cross_compiling" = yes; then
13926   cat > conftest.$ac_ext <<EOF
13927 #line 13928 "configure"
13928 #include "confdefs.h"
13929 /* pthread test headers */
13930 #include <pthread.h>
13931 #if HAVE_PTHREADS < 7
13932 #include <errno.h>
13933 #endif
13934 #ifndef NULL
13935 #define NULL (void*)0
13936 #endif
13937
13938 static void *task(p)
13939         void *p;
13940 {
13941         return (void *) (p == NULL);
13942 }
13943
13944 int main() {
13945
13946         /* pthread test function */
13947 #ifndef PTHREAD_CREATE_DETACHED
13948 #define PTHREAD_CREATE_DETACHED 1
13949 #endif
13950         pthread_t t;
13951         int status;
13952         int detach = PTHREAD_CREATE_DETACHED;
13953
13954 #if HAVE_PTHREADS > 4
13955         /* Final pthreads */
13956         pthread_attr_t attr;
13957
13958         status = pthread_attr_init(&attr);
13959         if( status ) return status;
13960
13961 #if HAVE_PTHREADS < 7
13962         status = pthread_attr_setdetachstate(&attr, &detach);
13963         if( status < 0 ) status = errno;
13964 #else
13965         status = pthread_attr_setdetachstate(&attr, detach);
13966 #endif
13967         if( status ) return status;
13968         status = pthread_create( &t, &attr, task, NULL );
13969 #if HAVE_PTHREADS < 7
13970         if( status < 0 ) status = errno;
13971 #endif
13972         if( status ) return status;
13973 #else
13974         /* Draft 4 pthreads */
13975         status = pthread_create( &t, pthread_attr_default, task, NULL );
13976         if( status ) return errno;
13977
13978         /* give thread a chance to complete */
13979         /* it should remain joinable and hence detachable */
13980         sleep( 1 );
13981
13982         status = pthread_detach( &t );
13983         if( status ) return errno;
13984 #endif
13985
13986 #ifdef HAVE_LINUX_THREADS
13987         pthread_kill_other_threads_np();
13988 #endif
13989
13990         return 0;
13991
13992 ; return 0; }
13993 EOF
13994 if { (eval echo configure:13995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13995   rm -rf conftest*
13996   ol_cv_pthread_lpthreads_lexc=yes
13997 else
13998   echo "configure: failed program was:" >&5
13999   cat conftest.$ac_ext >&5
14000   rm -rf conftest*
14001   ol_cv_pthread_lpthreads_lexc=no
14002 fi
14003 rm -f conftest*
14004 else
14005   cat > conftest.$ac_ext <<EOF
14006 #line 14007 "configure"
14007 #include "confdefs.h"
14008 /* pthread test headers */
14009 #include <pthread.h>
14010 #if HAVE_PTHREADS < 7
14011 #include <errno.h>
14012 #endif
14013 #ifndef NULL
14014 #define NULL (void*)0
14015 #endif
14016
14017 static void *task(p)
14018         void *p;
14019 {
14020         return (void *) (p == NULL);
14021 }
14022
14023
14024 int main(argc, argv)
14025         int argc;
14026         char **argv;
14027 {
14028
14029         /* pthread test function */
14030 #ifndef PTHREAD_CREATE_DETACHED
14031 #define PTHREAD_CREATE_DETACHED 1
14032 #endif
14033         pthread_t t;
14034         int status;
14035         int detach = PTHREAD_CREATE_DETACHED;
14036
14037 #if HAVE_PTHREADS > 4
14038         /* Final pthreads */
14039         pthread_attr_t attr;
14040
14041         status = pthread_attr_init(&attr);
14042         if( status ) return status;
14043
14044 #if HAVE_PTHREADS < 7
14045         status = pthread_attr_setdetachstate(&attr, &detach);
14046         if( status < 0 ) status = errno;
14047 #else
14048         status = pthread_attr_setdetachstate(&attr, detach);
14049 #endif
14050         if( status ) return status;
14051         status = pthread_create( &t, &attr, task, NULL );
14052 #if HAVE_PTHREADS < 7
14053         if( status < 0 ) status = errno;
14054 #endif
14055         if( status ) return status;
14056 #else
14057         /* Draft 4 pthreads */
14058         status = pthread_create( &t, pthread_attr_default, task, NULL );
14059         if( status ) return errno;
14060
14061         /* give thread a chance to complete */
14062         /* it should remain joinable and hence detachable */
14063         sleep( 1 );
14064
14065         status = pthread_detach( &t );
14066         if( status ) return errno;
14067 #endif
14068
14069 #ifdef HAVE_LINUX_THREADS
14070         pthread_kill_other_threads_np();
14071 #endif
14072
14073         return 0;
14074
14075 }
14076
14077 EOF
14078 if { (eval echo configure:14079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14079 then
14080   ol_cv_pthread_lpthreads_lexc=yes
14081 else
14082   echo "configure: failed program was:" >&5
14083   cat conftest.$ac_ext >&5
14084   rm -fr conftest*
14085   ol_cv_pthread_lpthreads_lexc=no
14086 fi
14087 rm -fr conftest*
14088 fi
14089
14090
14091                 # restore the LIBS
14092                 LIBS="$ol_LIBS"
14093         
14094 fi
14095
14096 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
14097
14098         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
14099                 ol_link_pthreads="-lpthreads -lexc"
14100                 ol_link_threads=posix
14101         fi
14102 fi
14103
14104
14105                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
14106 if test "$ol_link_threads" = no ; then
14107         # try -lpthreads
14108         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
14109 echo "configure:14110: checking for pthread link with -lpthreads" >&5
14110 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
14111   echo $ac_n "(cached) $ac_c" 1>&6
14112 else
14113   
14114                 # save the flags
14115                 ol_LIBS="$LIBS"
14116                 LIBS="-lpthreads $LIBS"
14117
14118                 if test "$cross_compiling" = yes; then
14119   cat > conftest.$ac_ext <<EOF
14120 #line 14121 "configure"
14121 #include "confdefs.h"
14122 /* pthread test headers */
14123 #include <pthread.h>
14124 #if HAVE_PTHREADS < 7
14125 #include <errno.h>
14126 #endif
14127 #ifndef NULL
14128 #define NULL (void*)0
14129 #endif
14130
14131 static void *task(p)
14132         void *p;
14133 {
14134         return (void *) (p == NULL);
14135 }
14136
14137 int main() {
14138
14139         /* pthread test function */
14140 #ifndef PTHREAD_CREATE_DETACHED
14141 #define PTHREAD_CREATE_DETACHED 1
14142 #endif
14143         pthread_t t;
14144         int status;
14145         int detach = PTHREAD_CREATE_DETACHED;
14146
14147 #if HAVE_PTHREADS > 4
14148         /* Final pthreads */
14149         pthread_attr_t attr;
14150
14151         status = pthread_attr_init(&attr);
14152         if( status ) return status;
14153
14154 #if HAVE_PTHREADS < 7
14155         status = pthread_attr_setdetachstate(&attr, &detach);
14156         if( status < 0 ) status = errno;
14157 #else
14158         status = pthread_attr_setdetachstate(&attr, detach);
14159 #endif
14160         if( status ) return status;
14161         status = pthread_create( &t, &attr, task, NULL );
14162 #if HAVE_PTHREADS < 7
14163         if( status < 0 ) status = errno;
14164 #endif
14165         if( status ) return status;
14166 #else
14167         /* Draft 4 pthreads */
14168         status = pthread_create( &t, pthread_attr_default, task, NULL );
14169         if( status ) return errno;
14170
14171         /* give thread a chance to complete */
14172         /* it should remain joinable and hence detachable */
14173         sleep( 1 );
14174
14175         status = pthread_detach( &t );
14176         if( status ) return errno;
14177 #endif
14178
14179 #ifdef HAVE_LINUX_THREADS
14180         pthread_kill_other_threads_np();
14181 #endif
14182
14183         return 0;
14184
14185 ; return 0; }
14186 EOF
14187 if { (eval echo configure:14188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14188   rm -rf conftest*
14189   ol_cv_pthread_lib_lpthreads=yes
14190 else
14191   echo "configure: failed program was:" >&5
14192   cat conftest.$ac_ext >&5
14193   rm -rf conftest*
14194   ol_cv_pthread_lib_lpthreads=no
14195 fi
14196 rm -f conftest*
14197 else
14198   cat > conftest.$ac_ext <<EOF
14199 #line 14200 "configure"
14200 #include "confdefs.h"
14201 /* pthread test headers */
14202 #include <pthread.h>
14203 #if HAVE_PTHREADS < 7
14204 #include <errno.h>
14205 #endif
14206 #ifndef NULL
14207 #define NULL (void*)0
14208 #endif
14209
14210 static void *task(p)
14211         void *p;
14212 {
14213         return (void *) (p == NULL);
14214 }
14215
14216
14217 int main(argc, argv)
14218         int argc;
14219         char **argv;
14220 {
14221
14222         /* pthread test function */
14223 #ifndef PTHREAD_CREATE_DETACHED
14224 #define PTHREAD_CREATE_DETACHED 1
14225 #endif
14226         pthread_t t;
14227         int status;
14228         int detach = PTHREAD_CREATE_DETACHED;
14229
14230 #if HAVE_PTHREADS > 4
14231         /* Final pthreads */
14232         pthread_attr_t attr;
14233
14234         status = pthread_attr_init(&attr);
14235         if( status ) return status;
14236
14237 #if HAVE_PTHREADS < 7
14238         status = pthread_attr_setdetachstate(&attr, &detach);
14239         if( status < 0 ) status = errno;
14240 #else
14241         status = pthread_attr_setdetachstate(&attr, detach);
14242 #endif
14243         if( status ) return status;
14244         status = pthread_create( &t, &attr, task, NULL );
14245 #if HAVE_PTHREADS < 7
14246         if( status < 0 ) status = errno;
14247 #endif
14248         if( status ) return status;
14249 #else
14250         /* Draft 4 pthreads */
14251         status = pthread_create( &t, pthread_attr_default, task, NULL );
14252         if( status ) return errno;
14253
14254         /* give thread a chance to complete */
14255         /* it should remain joinable and hence detachable */
14256         sleep( 1 );
14257
14258         status = pthread_detach( &t );
14259         if( status ) return errno;
14260 #endif
14261
14262 #ifdef HAVE_LINUX_THREADS
14263         pthread_kill_other_threads_np();
14264 #endif
14265
14266         return 0;
14267
14268 }
14269
14270 EOF
14271 if { (eval echo configure:14272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14272 then
14273   ol_cv_pthread_lib_lpthreads=yes
14274 else
14275   echo "configure: failed program was:" >&5
14276   cat conftest.$ac_ext >&5
14277   rm -fr conftest*
14278   ol_cv_pthread_lib_lpthreads=no
14279 fi
14280 rm -fr conftest*
14281 fi
14282
14283
14284                 # restore the LIBS
14285                 LIBS="$ol_LIBS"
14286         
14287 fi
14288
14289 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
14290
14291         if test $ol_cv_pthread_lib_lpthreads = yes ; then
14292                 ol_link_pthreads="-lpthreads"
14293                 ol_link_threads=posix
14294         fi
14295 fi
14296
14297
14298                 if test $ol_link_threads != no ; then
14299                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
14300
14301                                                 save_CPPFLAGS="$CPPFLAGS"
14302                         save_LIBS="$LIBS"
14303                         LIBS="$LTHREAD_LIBS $LIBS"
14304
14305                                                                                                 for ac_func in sched_yield pthread_yield thr_yield
14306 do
14307 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14308 echo "configure:14309: checking for $ac_func" >&5
14309 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14310   echo $ac_n "(cached) $ac_c" 1>&6
14311 else
14312   cat > conftest.$ac_ext <<EOF
14313 #line 14314 "configure"
14314 #include "confdefs.h"
14315 /* System header to define __stub macros and hopefully few prototypes,
14316     which can conflict with char $ac_func(); below.  */
14317 #include <assert.h>
14318 /* Override any gcc2 internal prototype to avoid an error.  */
14319 /* We use char because int might match the return type of a gcc2
14320     builtin and then its argument prototype would still apply.  */
14321 char $ac_func();
14322 char (*f)();
14323
14324 int main() {
14325
14326 /* The GNU C library defines this for functions which it implements
14327     to always fail with ENOSYS.  Some functions are actually named
14328     something starting with __ and the normal name is an alias.  */
14329 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14330 choke me
14331 #else
14332 f = $ac_func;
14333 #endif
14334
14335 ; return 0; }
14336 EOF
14337 if { (eval echo configure:14338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14338   rm -rf conftest*
14339   eval "ac_cv_func_$ac_func=yes"
14340 else
14341   echo "configure: failed program was:" >&5
14342   cat conftest.$ac_ext >&5
14343   rm -rf conftest*
14344   eval "ac_cv_func_$ac_func=no"
14345 fi
14346 rm -f conftest*
14347 fi
14348
14349 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14350   echo "$ac_t""yes" 1>&6
14351     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14352   cat >> confdefs.h <<EOF
14353 #define $ac_tr_func 1
14354 EOF
14355  
14356 else
14357   echo "$ac_t""no" 1>&6
14358 fi
14359 done
14360
14361
14362                         if test $ac_cv_func_sched_yield = no -a \
14363                                 $ac_cv_func_pthread_yield = no -a \
14364                                 $ac_cv_func_thr_yield = no ; then
14365                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
14366 echo "configure:14367: checking for sched_yield in -lrt" >&5
14367 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
14368 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14369   echo $ac_n "(cached) $ac_c" 1>&6
14370 else
14371   ac_save_LIBS="$LIBS"
14372 LIBS="-lrt  $LIBS"
14373 cat > conftest.$ac_ext <<EOF
14374 #line 14375 "configure"
14375 #include "confdefs.h"
14376 /* Override any gcc2 internal prototype to avoid an error.  */
14377 /* We use char because int might match the return type of a gcc2
14378     builtin and then its argument prototype would still apply.  */
14379 char sched_yield();
14380
14381 int main() {
14382 sched_yield()
14383 ; return 0; }
14384 EOF
14385 if { (eval echo configure:14386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14386   rm -rf conftest*
14387   eval "ac_cv_lib_$ac_lib_var=yes"
14388 else
14389   echo "configure: failed program was:" >&5
14390   cat conftest.$ac_ext >&5
14391   rm -rf conftest*
14392   eval "ac_cv_lib_$ac_lib_var=no"
14393 fi
14394 rm -f conftest*
14395 LIBS="$ac_save_LIBS"
14396
14397 fi
14398 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14399   echo "$ac_t""yes" 1>&6
14400   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
14401                                         cat >> confdefs.h <<\EOF
14402 #define HAVE_SCHED_YIELD 1
14403 EOF
14404
14405                                         ac_cv_func_sched_yield=yes
14406 else
14407   echo "$ac_t""no" 1>&6
14408 ac_cv_func_sched_yield=no
14409 fi
14410
14411                         fi
14412                         if test $ac_cv_func_sched_yield = no -a \
14413                                 $ac_cv_func_pthread_yield = no -a \
14414                                 "$ac_cv_func_thr_yield" = no ; then
14415                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
14416                         fi
14417
14418                                                 for ac_func in pthread_kill pthread_rwlock_destroy
14419 do
14420 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14421 echo "configure:14422: checking for $ac_func" >&5
14422 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14423   echo $ac_n "(cached) $ac_c" 1>&6
14424 else
14425   cat > conftest.$ac_ext <<EOF
14426 #line 14427 "configure"
14427 #include "confdefs.h"
14428 /* System header to define __stub macros and hopefully few prototypes,
14429     which can conflict with char $ac_func(); below.  */
14430 #include <assert.h>
14431 /* Override any gcc2 internal prototype to avoid an error.  */
14432 /* We use char because int might match the return type of a gcc2
14433     builtin and then its argument prototype would still apply.  */
14434 char $ac_func();
14435 char (*f)();
14436
14437 int main() {
14438
14439 /* The GNU C library defines this for functions which it implements
14440     to always fail with ENOSYS.  Some functions are actually named
14441     something starting with __ and the normal name is an alias.  */
14442 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14443 choke me
14444 #else
14445 f = $ac_func;
14446 #endif
14447
14448 ; return 0; }
14449 EOF
14450 if { (eval echo configure:14451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14451   rm -rf conftest*
14452   eval "ac_cv_func_$ac_func=yes"
14453 else
14454   echo "configure: failed program was:" >&5
14455   cat conftest.$ac_ext >&5
14456   rm -rf conftest*
14457   eval "ac_cv_func_$ac_func=no"
14458 fi
14459 rm -f conftest*
14460 fi
14461
14462 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14463   echo "$ac_t""yes" 1>&6
14464     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14465   cat >> confdefs.h <<EOF
14466 #define $ac_tr_func 1
14467 EOF
14468  
14469 else
14470   echo "$ac_t""no" 1>&6
14471 fi
14472 done
14473
14474
14475                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
14476 echo "configure:14477: checking for pthread_detach with <pthread.h>" >&5
14477 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
14478   echo $ac_n "(cached) $ac_c" 1>&6
14479 else
14480   
14481                                                                 cat > conftest.$ac_ext <<EOF
14482 #line 14483 "configure"
14483 #include "confdefs.h"
14484
14485 #include <pthread.h>
14486 #ifndef NULL
14487 #define NULL (void*)0
14488 #endif
14489
14490 int main() {
14491 pthread_detach(NULL);
14492 ; return 0; }
14493 EOF
14494 if { (eval echo configure:14495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14495   rm -rf conftest*
14496   ol_cv_func_pthread_detach=yes
14497 else
14498   echo "configure: failed program was:" >&5
14499   cat conftest.$ac_ext >&5
14500   rm -rf conftest*
14501   ol_cv_func_pthread_detach=no
14502 fi
14503 rm -f conftest*
14504                         
14505 fi
14506
14507 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
14508
14509                         if test $ol_cv_func_pthread_detach = no ; then
14510                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
14511                         fi
14512
14513                         cat >> confdefs.h <<\EOF
14514 #define HAVE_PTHREAD_DETACH 1
14515 EOF
14516
14517
14518                                                 for ac_func in \
14519                                 pthread_setconcurrency \
14520                                 pthread_getconcurrency \
14521                                 thr_setconcurrency \
14522                                 thr_getconcurrency \
14523                         
14524 do
14525 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14526 echo "configure:14527: checking for $ac_func" >&5
14527 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14528   echo $ac_n "(cached) $ac_c" 1>&6
14529 else
14530   cat > conftest.$ac_ext <<EOF
14531 #line 14532 "configure"
14532 #include "confdefs.h"
14533 /* System header to define __stub macros and hopefully few prototypes,
14534     which can conflict with char $ac_func(); below.  */
14535 #include <assert.h>
14536 /* Override any gcc2 internal prototype to avoid an error.  */
14537 /* We use char because int might match the return type of a gcc2
14538     builtin and then its argument prototype would still apply.  */
14539 char $ac_func();
14540 char (*f)();
14541
14542 int main() {
14543
14544 /* The GNU C library defines this for functions which it implements
14545     to always fail with ENOSYS.  Some functions are actually named
14546     something starting with __ and the normal name is an alias.  */
14547 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14548 choke me
14549 #else
14550 f = $ac_func;
14551 #endif
14552
14553 ; return 0; }
14554 EOF
14555 if { (eval echo configure:14556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14556   rm -rf conftest*
14557   eval "ac_cv_func_$ac_func=yes"
14558 else
14559   echo "configure: failed program was:" >&5
14560   cat conftest.$ac_ext >&5
14561   rm -rf conftest*
14562   eval "ac_cv_func_$ac_func=no"
14563 fi
14564 rm -f conftest*
14565 fi
14566
14567 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14568   echo "$ac_t""yes" 1>&6
14569     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14570   cat >> confdefs.h <<EOF
14571 #define $ac_tr_func 1
14572 EOF
14573  
14574 else
14575   echo "$ac_t""no" 1>&6
14576 fi
14577 done
14578
14579
14580                         
14581         for ac_func in pthread_kill_other_threads_np
14582 do
14583 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14584 echo "configure:14585: checking for $ac_func" >&5
14585 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14586   echo $ac_n "(cached) $ac_c" 1>&6
14587 else
14588   cat > conftest.$ac_ext <<EOF
14589 #line 14590 "configure"
14590 #include "confdefs.h"
14591 /* System header to define __stub macros and hopefully few prototypes,
14592     which can conflict with char $ac_func(); below.  */
14593 #include <assert.h>
14594 /* Override any gcc2 internal prototype to avoid an error.  */
14595 /* We use char because int might match the return type of a gcc2
14596     builtin and then its argument prototype would still apply.  */
14597 char $ac_func();
14598 char (*f)();
14599
14600 int main() {
14601
14602 /* The GNU C library defines this for functions which it implements
14603     to always fail with ENOSYS.  Some functions are actually named
14604     something starting with __ and the normal name is an alias.  */
14605 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14606 choke me
14607 #else
14608 f = $ac_func;
14609 #endif
14610
14611 ; return 0; }
14612 EOF
14613 if { (eval echo configure:14614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14614   rm -rf conftest*
14615   eval "ac_cv_func_$ac_func=yes"
14616 else
14617   echo "configure: failed program was:" >&5
14618   cat conftest.$ac_ext >&5
14619   rm -rf conftest*
14620   eval "ac_cv_func_$ac_func=no"
14621 fi
14622 rm -f conftest*
14623 fi
14624
14625 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14626   echo "$ac_t""yes" 1>&6
14627     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14628   cat >> confdefs.h <<EOF
14629 #define $ac_tr_func 1
14630 EOF
14631  
14632 else
14633   echo "$ac_t""no" 1>&6
14634 fi
14635 done
14636
14637         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
14638 echo "configure:14639: checking for LinuxThreads implementation" >&5
14639 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
14640   echo $ac_n "(cached) $ac_c" 1>&6
14641 else
14642   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
14643 fi
14644
14645 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
14646
14647                         
14648         
14649         
14650         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
14651 echo "configure:14652: checking for LinuxThreads consistency" >&5
14652 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
14653   echo $ac_n "(cached) $ac_c" 1>&6
14654 else
14655   
14656                 if test $ol_cv_header_linux_threads = yes -a \
14657                         $ol_cv_sys_linux_threads = yes; then
14658                         ol_cv_linux_threads=yes
14659                 elif test $ol_cv_header_linux_threads = no -a \
14660                         $ol_cv_sys_linux_threads = no; then
14661                         ol_cv_linux_threads=no
14662                 else
14663                         ol_cv_linux_threads=error
14664                 fi
14665         
14666 fi
14667
14668 echo "$ac_t""$ol_cv_linux_threads" 1>&6
14669
14670
14671                         if test $ol_cv_linux_threads = error; then
14672                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
14673                         fi
14674
14675                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
14676 echo "configure:14677: checking if pthread_create() works" >&5
14677 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
14678   echo $ac_n "(cached) $ac_c" 1>&6
14679 else
14680   
14681                         if test "$cross_compiling" = yes; then
14682                                 ol_cv_pthread_create_works=yes
14683 else
14684   cat > conftest.$ac_ext <<EOF
14685 #line 14686 "configure"
14686 #include "confdefs.h"
14687 /* pthread test headers */
14688 #include <pthread.h>
14689 #if HAVE_PTHREADS < 7
14690 #include <errno.h>
14691 #endif
14692 #ifndef NULL
14693 #define NULL (void*)0
14694 #endif
14695
14696 static void *task(p)
14697         void *p;
14698 {
14699         return (void *) (p == NULL);
14700 }
14701
14702
14703 int main(argc, argv)
14704         int argc;
14705         char **argv;
14706 {
14707
14708         /* pthread test function */
14709 #ifndef PTHREAD_CREATE_DETACHED
14710 #define PTHREAD_CREATE_DETACHED 1
14711 #endif
14712         pthread_t t;
14713         int status;
14714         int detach = PTHREAD_CREATE_DETACHED;
14715
14716 #if HAVE_PTHREADS > 4
14717         /* Final pthreads */
14718         pthread_attr_t attr;
14719
14720         status = pthread_attr_init(&attr);
14721         if( status ) return status;
14722
14723 #if HAVE_PTHREADS < 7
14724         status = pthread_attr_setdetachstate(&attr, &detach);
14725         if( status < 0 ) status = errno;
14726 #else
14727         status = pthread_attr_setdetachstate(&attr, detach);
14728 #endif
14729         if( status ) return status;
14730         status = pthread_create( &t, &attr, task, NULL );
14731 #if HAVE_PTHREADS < 7
14732         if( status < 0 ) status = errno;
14733 #endif
14734         if( status ) return status;
14735 #else
14736         /* Draft 4 pthreads */
14737         status = pthread_create( &t, pthread_attr_default, task, NULL );
14738         if( status ) return errno;
14739
14740         /* give thread a chance to complete */
14741         /* it should remain joinable and hence detachable */
14742         sleep( 1 );
14743
14744         status = pthread_detach( &t );
14745         if( status ) return errno;
14746 #endif
14747
14748 #ifdef HAVE_LINUX_THREADS
14749         pthread_kill_other_threads_np();
14750 #endif
14751
14752         return 0;
14753
14754 }
14755
14756 EOF
14757 if { (eval echo configure:14758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14758 then
14759   ol_cv_pthread_create_works=yes
14760 else
14761   echo "configure: failed program was:" >&5
14762   cat conftest.$ac_ext >&5
14763   rm -fr conftest*
14764   ol_cv_pthread_create_works=no
14765 fi
14766 rm -fr conftest*
14767 fi
14768
14769 fi
14770
14771 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
14772
14773                         if test $ol_cv_pthread_create_works = no ; then
14774                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
14775                         fi
14776
14777                                                 if test $ol_with_yielding_select = auto ; then
14778                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
14779 echo "configure:14780: checking if select yields when using pthreads" >&5
14780 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
14781   echo $ac_n "(cached) $ac_c" 1>&6
14782 else
14783   
14784                                 if test "$cross_compiling" = yes; then
14785   ol_cv_pthread_select_yields=cross
14786 else
14787   cat > conftest.$ac_ext <<EOF
14788 #line 14789 "configure"
14789 #include "confdefs.h"
14790
14791 #include <sys/types.h>
14792 #include <sys/time.h>
14793 #include <unistd.h>
14794 #include <pthread.h>
14795 #ifndef NULL
14796 #define NULL (void*) 0
14797 #endif
14798
14799 static int fildes[2];
14800
14801 static void *task(p)
14802         void *p;
14803 {
14804         int i;
14805         struct timeval tv;
14806
14807         fd_set rfds;
14808
14809         tv.tv_sec=10;
14810         tv.tv_usec=0;
14811
14812         FD_ZERO(&rfds);
14813         FD_SET(fildes[0], &rfds);
14814
14815         /* we're not interested in any fds */
14816         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
14817
14818         if(i < 0) {
14819                 perror("select");
14820                 exit(10);
14821         }
14822
14823         exit(0); /* if we exit here, the select blocked the whole process */
14824 }
14825
14826 int main(argc, argv)
14827         int argc;
14828         char **argv;
14829 {
14830         pthread_t t;
14831
14832         /* create a pipe to select */
14833         if(pipe(&fildes[0])) {
14834                 perror("select");
14835                 exit(1);
14836         }
14837
14838 #ifdef HAVE_PTHREAD_SETCONCURRENCY
14839         (void) pthread_setconcurrency(2);
14840 #else
14841 #ifdef HAVE_THR_SETCONCURRENCY
14842         /* Set Solaris LWP concurrency to 2 */
14843         thr_setconcurrency(2);
14844 #endif
14845 #endif
14846
14847 #if HAVE_PTHREADS < 6
14848         pthread_create(&t, pthread_attr_default, task, NULL);
14849 #else
14850         pthread_create(&t, NULL, task, NULL);
14851 #endif
14852
14853         /* make sure task runs first */
14854 #if HAVE_THR_YIELD
14855         thr_yield();
14856 #elif defined( HAVE_SCHED_YIELD )
14857         sched_yield();
14858 #elif defined( HAVE_PTHREAD_YIELD )
14859         pthread_yield();
14860 #endif
14861
14862         exit(2);
14863 }
14864 EOF
14865 if { (eval echo configure:14866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14866 then
14867   ol_cv_pthread_select_yields=no
14868 else
14869   echo "configure: failed program was:" >&5
14870   cat conftest.$ac_ext >&5
14871   rm -fr conftest*
14872   ol_cv_pthread_select_yields=yes
14873 fi
14874 rm -fr conftest*
14875 fi
14876
14877 fi
14878
14879 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
14880
14881                                 if test $ol_cv_pthread_select_yields = cross ; then
14882                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
14883                                 fi
14884
14885                                 if test $ol_cv_pthread_select_yields = yes ; then
14886                                         ol_with_yielding_select=yes
14887                                 fi
14888                         fi
14889
14890                                                 CPPFLAGS="$save_CPPFLAGS"
14891                         LIBS="$save_LIBS"
14892                 else
14893                         { echo "configure: error: could not locate usable POSIX Threads" 1>&2; exit 1; }
14894                 fi
14895         fi
14896
14897         if test $ol_with_threads = posix ; then
14898                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
14899         fi
14900 fi
14901
14902 if test $ol_with_threads = auto -o $ol_with_threads = yes \
14903         -o $ol_with_threads = mach ; then
14904
14905                 for ac_hdr in mach/cthreads.h cthreads.h
14906 do
14907 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14908 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14909 echo "configure:14910: checking for $ac_hdr" >&5
14910 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14911   echo $ac_n "(cached) $ac_c" 1>&6
14912 else
14913   cat > conftest.$ac_ext <<EOF
14914 #line 14915 "configure"
14915 #include "confdefs.h"
14916 #include <$ac_hdr>
14917 EOF
14918 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14919 { (eval echo configure:14920: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14920 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14921 if test -z "$ac_err"; then
14922   rm -rf conftest*
14923   eval "ac_cv_header_$ac_safe=yes"
14924 else
14925   echo "$ac_err" >&5
14926   echo "configure: failed program was:" >&5
14927   cat conftest.$ac_ext >&5
14928   rm -rf conftest*
14929   eval "ac_cv_header_$ac_safe=no"
14930 fi
14931 rm -f conftest*
14932 fi
14933 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14934   echo "$ac_t""yes" 1>&6
14935     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14936   cat >> confdefs.h <<EOF
14937 #define $ac_tr_hdr 1
14938 EOF
14939  
14940 else
14941   echo "$ac_t""no" 1>&6
14942 fi
14943 done
14944
14945         if test $ac_cv_header_mach_cthreads_h = yes ; then
14946                 ol_with_threads=found
14947
14948                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
14949 echo "configure:14950: checking for cthread_fork" >&5
14950 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
14951   echo $ac_n "(cached) $ac_c" 1>&6
14952 else
14953   cat > conftest.$ac_ext <<EOF
14954 #line 14955 "configure"
14955 #include "confdefs.h"
14956 /* System header to define __stub macros and hopefully few prototypes,
14957     which can conflict with char cthread_fork(); below.  */
14958 #include <assert.h>
14959 /* Override any gcc2 internal prototype to avoid an error.  */
14960 /* We use char because int might match the return type of a gcc2
14961     builtin and then its argument prototype would still apply.  */
14962 char cthread_fork();
14963 char (*f)();
14964
14965 int main() {
14966
14967 /* The GNU C library defines this for functions which it implements
14968     to always fail with ENOSYS.  Some functions are actually named
14969     something starting with __ and the normal name is an alias.  */
14970 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
14971 choke me
14972 #else
14973 f = cthread_fork;
14974 #endif
14975
14976 ; return 0; }
14977 EOF
14978 if { (eval echo configure:14979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14979   rm -rf conftest*
14980   eval "ac_cv_func_cthread_fork=yes"
14981 else
14982   echo "configure: failed program was:" >&5
14983   cat conftest.$ac_ext >&5
14984   rm -rf conftest*
14985   eval "ac_cv_func_cthread_fork=no"
14986 fi
14987 rm -f conftest*
14988 fi
14989
14990 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
14991   echo "$ac_t""yes" 1>&6
14992   ol_link_threads=yes
14993 else
14994   echo "$ac_t""no" 1>&6
14995 fi
14996
14997
14998                 if test $ol_link_threads = no ; then
14999                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
15000 echo "configure:15001: checking for cthread_fork with -all_load" >&5
15001 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
15002   echo $ac_n "(cached) $ac_c" 1>&6
15003 else
15004   
15005                                                                 save_LIBS="$LIBS"
15006                                 LIBS="-all_load $LIBS"
15007                                 cat > conftest.$ac_ext <<EOF
15008 #line 15009 "configure"
15009 #include "confdefs.h"
15010 #include <mach/cthreads.h>
15011 int main() {
15012
15013                                         cthread_fork((void *)0, (void *)0);
15014                                         
15015 ; return 0; }
15016 EOF
15017 if { (eval echo configure:15018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15018   rm -rf conftest*
15019   ol_cv_cthread_all_load=yes
15020 else
15021   echo "configure: failed program was:" >&5
15022   cat conftest.$ac_ext >&5
15023   rm -rf conftest*
15024   ol_cv_cthread_all_load=no
15025 fi
15026 rm -f conftest*
15027                                                                 LIBS="$save_LIBS"
15028                         
15029 fi
15030
15031 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
15032
15033                         if test $ol_cv_cthread_all_load = yes ; then
15034                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
15035                                 ol_link_threads=mach
15036                                 ol_with_threads=found
15037                         fi
15038                 fi
15039
15040         elif test $ac_cv_header_cthreads_h = yes ; then
15041                                 
15042                 ol_with_threads=found
15043  
15044                                 save_LIBS="$LIBS"
15045                 LIBS="$LIBS -lthreads"
15046                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
15047 echo "configure:15048: checking for cthread_fork" >&5
15048 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
15049   echo $ac_n "(cached) $ac_c" 1>&6
15050 else
15051   cat > conftest.$ac_ext <<EOF
15052 #line 15053 "configure"
15053 #include "confdefs.h"
15054 /* System header to define __stub macros and hopefully few prototypes,
15055     which can conflict with char cthread_fork(); below.  */
15056 #include <assert.h>
15057 /* Override any gcc2 internal prototype to avoid an error.  */
15058 /* We use char because int might match the return type of a gcc2
15059     builtin and then its argument prototype would still apply.  */
15060 char cthread_fork();
15061 char (*f)();
15062
15063 int main() {
15064
15065 /* The GNU C library defines this for functions which it implements
15066     to always fail with ENOSYS.  Some functions are actually named
15067     something starting with __ and the normal name is an alias.  */
15068 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
15069 choke me
15070 #else
15071 f = cthread_fork;
15072 #endif
15073
15074 ; return 0; }
15075 EOF
15076 if { (eval echo configure:15077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15077   rm -rf conftest*
15078   eval "ac_cv_func_cthread_fork=yes"
15079 else
15080   echo "configure: failed program was:" >&5
15081   cat conftest.$ac_ext >&5
15082   rm -rf conftest*
15083   eval "ac_cv_func_cthread_fork=no"
15084 fi
15085 rm -f conftest*
15086 fi
15087
15088 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
15089   echo "$ac_t""yes" 1>&6
15090   ol_link_threads=yes
15091 else
15092   echo "$ac_t""no" 1>&6
15093 fi
15094
15095                 LIBS="$save_LIBS"
15096
15097                 if test $ol_link_threads = yes ; then
15098                         LTHREAD_LIBS="-lthreads"
15099                         ol_link_threads=mach
15100                         ol_with_threads=found
15101                 else
15102                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
15103                 fi
15104
15105         elif test $ol_with_threads = mach ; then
15106                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
15107         fi
15108
15109         if test $ol_link_threads = mach ; then
15110                 cat >> confdefs.h <<\EOF
15111 #define HAVE_MACH_CTHREADS 1
15112 EOF
15113
15114         elif test $ol_with_threads = found ; then
15115                 { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
15116         fi
15117 fi
15118
15119 if test $ol_with_threads = auto -o $ol_with_threads = yes \
15120         -o $ol_with_threads = pth ; then
15121
15122         for ac_hdr in pth.h
15123 do
15124 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15125 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15126 echo "configure:15127: checking for $ac_hdr" >&5
15127 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15128   echo $ac_n "(cached) $ac_c" 1>&6
15129 else
15130   cat > conftest.$ac_ext <<EOF
15131 #line 15132 "configure"
15132 #include "confdefs.h"
15133 #include <$ac_hdr>
15134 EOF
15135 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15136 { (eval echo configure:15137: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15137 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15138 if test -z "$ac_err"; then
15139   rm -rf conftest*
15140   eval "ac_cv_header_$ac_safe=yes"
15141 else
15142   echo "$ac_err" >&5
15143   echo "configure: failed program was:" >&5
15144   cat conftest.$ac_ext >&5
15145   rm -rf conftest*
15146   eval "ac_cv_header_$ac_safe=no"
15147 fi
15148 rm -f conftest*
15149 fi
15150 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15151   echo "$ac_t""yes" 1>&6
15152     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15153   cat >> confdefs.h <<EOF
15154 #define $ac_tr_hdr 1
15155 EOF
15156  
15157 else
15158   echo "$ac_t""no" 1>&6
15159 fi
15160 done
15161
15162
15163         if test $ac_cv_header_pth_h = yes ; then
15164                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
15165 echo "configure:15166: checking for pth_version in -lpth" >&5
15166 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
15167 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15168   echo $ac_n "(cached) $ac_c" 1>&6
15169 else
15170   ac_save_LIBS="$LIBS"
15171 LIBS="-lpth  $LIBS"
15172 cat > conftest.$ac_ext <<EOF
15173 #line 15174 "configure"
15174 #include "confdefs.h"
15175 /* Override any gcc2 internal prototype to avoid an error.  */
15176 /* We use char because int might match the return type of a gcc2
15177     builtin and then its argument prototype would still apply.  */
15178 char pth_version();
15179
15180 int main() {
15181 pth_version()
15182 ; return 0; }
15183 EOF
15184 if { (eval echo configure:15185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15185   rm -rf conftest*
15186   eval "ac_cv_lib_$ac_lib_var=yes"
15187 else
15188   echo "configure: failed program was:" >&5
15189   cat conftest.$ac_ext >&5
15190   rm -rf conftest*
15191   eval "ac_cv_lib_$ac_lib_var=no"
15192 fi
15193 rm -f conftest*
15194 LIBS="$ac_save_LIBS"
15195
15196 fi
15197 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15198   echo "$ac_t""yes" 1>&6
15199   have_pth=yes
15200 else
15201   echo "$ac_t""no" 1>&6
15202 have_pth=no
15203 fi
15204
15205
15206                 if test $have_pth = yes ; then
15207                         cat >> confdefs.h <<\EOF
15208 #define HAVE_GNU_PTH 1
15209 EOF
15210
15211                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
15212                         ol_link_threads=pth
15213                         ol_with_threads=found
15214
15215                         if test $ol_with_yielding_select = auto ; then
15216                                 ol_with_yielding_select=yes
15217                         fi
15218                 fi
15219         fi
15220 fi
15221
15222 if test $ol_with_threads = auto -o $ol_with_threads = yes \
15223         -o $ol_with_threads = lwp ; then
15224
15225                 for ac_hdr in thread.h synch.h
15226 do
15227 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15228 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15229 echo "configure:15230: checking for $ac_hdr" >&5
15230 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15231   echo $ac_n "(cached) $ac_c" 1>&6
15232 else
15233   cat > conftest.$ac_ext <<EOF
15234 #line 15235 "configure"
15235 #include "confdefs.h"
15236 #include <$ac_hdr>
15237 EOF
15238 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15239 { (eval echo configure:15240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15240 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15241 if test -z "$ac_err"; then
15242   rm -rf conftest*
15243   eval "ac_cv_header_$ac_safe=yes"
15244 else
15245   echo "$ac_err" >&5
15246   echo "configure: failed program was:" >&5
15247   cat conftest.$ac_ext >&5
15248   rm -rf conftest*
15249   eval "ac_cv_header_$ac_safe=no"
15250 fi
15251 rm -f conftest*
15252 fi
15253 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15254   echo "$ac_t""yes" 1>&6
15255     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15256   cat >> confdefs.h <<EOF
15257 #define $ac_tr_hdr 1
15258 EOF
15259  
15260 else
15261   echo "$ac_t""no" 1>&6
15262 fi
15263 done
15264
15265         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
15266                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
15267 echo "configure:15268: checking for thr_create in -lthread" >&5
15268 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
15269 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15270   echo $ac_n "(cached) $ac_c" 1>&6
15271 else
15272   ac_save_LIBS="$LIBS"
15273 LIBS="-lthread  $LIBS"
15274 cat > conftest.$ac_ext <<EOF
15275 #line 15276 "configure"
15276 #include "confdefs.h"
15277 /* Override any gcc2 internal prototype to avoid an error.  */
15278 /* We use char because int might match the return type of a gcc2
15279     builtin and then its argument prototype would still apply.  */
15280 char thr_create();
15281
15282 int main() {
15283 thr_create()
15284 ; return 0; }
15285 EOF
15286 if { (eval echo configure:15287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15287   rm -rf conftest*
15288   eval "ac_cv_lib_$ac_lib_var=yes"
15289 else
15290   echo "configure: failed program was:" >&5
15291   cat conftest.$ac_ext >&5
15292   rm -rf conftest*
15293   eval "ac_cv_lib_$ac_lib_var=no"
15294 fi
15295 rm -f conftest*
15296 LIBS="$ac_save_LIBS"
15297
15298 fi
15299 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15300   echo "$ac_t""yes" 1>&6
15301   have_thr=yes
15302 else
15303   echo "$ac_t""no" 1>&6
15304 have_thr=no
15305 fi
15306
15307
15308                 if test $have_thr = yes ; then
15309                         cat >> confdefs.h <<\EOF
15310 #define HAVE_THR 1
15311 EOF
15312
15313                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
15314                         ol_link_threads=thr
15315
15316                         if test $ol_with_yielding_select = auto ; then
15317                                 ol_with_yielding_select=yes
15318                         fi
15319
15320                                                 for ac_func in \
15321                                 thr_setconcurrency \
15322                                 thr_getconcurrency \
15323                         
15324 do
15325 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15326 echo "configure:15327: checking for $ac_func" >&5
15327 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15328   echo $ac_n "(cached) $ac_c" 1>&6
15329 else
15330   cat > conftest.$ac_ext <<EOF
15331 #line 15332 "configure"
15332 #include "confdefs.h"
15333 /* System header to define __stub macros and hopefully few prototypes,
15334     which can conflict with char $ac_func(); below.  */
15335 #include <assert.h>
15336 /* Override any gcc2 internal prototype to avoid an error.  */
15337 /* We use char because int might match the return type of a gcc2
15338     builtin and then its argument prototype would still apply.  */
15339 char $ac_func();
15340 char (*f)();
15341
15342 int main() {
15343
15344 /* The GNU C library defines this for functions which it implements
15345     to always fail with ENOSYS.  Some functions are actually named
15346     something starting with __ and the normal name is an alias.  */
15347 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15348 choke me
15349 #else
15350 f = $ac_func;
15351 #endif
15352
15353 ; return 0; }
15354 EOF
15355 if { (eval echo configure:15356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15356   rm -rf conftest*
15357   eval "ac_cv_func_$ac_func=yes"
15358 else
15359   echo "configure: failed program was:" >&5
15360   cat conftest.$ac_ext >&5
15361   rm -rf conftest*
15362   eval "ac_cv_func_$ac_func=no"
15363 fi
15364 rm -f conftest*
15365 fi
15366
15367 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15368   echo "$ac_t""yes" 1>&6
15369     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15370   cat >> confdefs.h <<EOF
15371 #define $ac_tr_func 1
15372 EOF
15373  
15374 else
15375   echo "$ac_t""no" 1>&6
15376 fi
15377 done
15378
15379                 fi
15380         fi
15381
15382                 for ac_hdr in lwp/lwp.h
15383 do
15384 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15385 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15386 echo "configure:15387: checking for $ac_hdr" >&5
15387 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15388   echo $ac_n "(cached) $ac_c" 1>&6
15389 else
15390   cat > conftest.$ac_ext <<EOF
15391 #line 15392 "configure"
15392 #include "confdefs.h"
15393 #include <$ac_hdr>
15394 EOF
15395 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15396 { (eval echo configure:15397: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15397 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15398 if test -z "$ac_err"; then
15399   rm -rf conftest*
15400   eval "ac_cv_header_$ac_safe=yes"
15401 else
15402   echo "$ac_err" >&5
15403   echo "configure: failed program was:" >&5
15404   cat conftest.$ac_ext >&5
15405   rm -rf conftest*
15406   eval "ac_cv_header_$ac_safe=no"
15407 fi
15408 rm -f conftest*
15409 fi
15410 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15411   echo "$ac_t""yes" 1>&6
15412     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15413   cat >> confdefs.h <<EOF
15414 #define $ac_tr_hdr 1
15415 EOF
15416  
15417 else
15418   echo "$ac_t""no" 1>&6
15419 fi
15420 done
15421
15422         if test $ac_cv_header_lwp_lwp_h = yes ; then
15423                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
15424 echo "configure:15425: checking for lwp_create in -llwp" >&5
15425 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
15426 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15427   echo $ac_n "(cached) $ac_c" 1>&6
15428 else
15429   ac_save_LIBS="$LIBS"
15430 LIBS="-llwp  $LIBS"
15431 cat > conftest.$ac_ext <<EOF
15432 #line 15433 "configure"
15433 #include "confdefs.h"
15434 /* Override any gcc2 internal prototype to avoid an error.  */
15435 /* We use char because int might match the return type of a gcc2
15436     builtin and then its argument prototype would still apply.  */
15437 char lwp_create();
15438
15439 int main() {
15440 lwp_create()
15441 ; return 0; }
15442 EOF
15443 if { (eval echo configure:15444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15444   rm -rf conftest*
15445   eval "ac_cv_lib_$ac_lib_var=yes"
15446 else
15447   echo "configure: failed program was:" >&5
15448   cat conftest.$ac_ext >&5
15449   rm -rf conftest*
15450   eval "ac_cv_lib_$ac_lib_var=no"
15451 fi
15452 rm -f conftest*
15453 LIBS="$ac_save_LIBS"
15454
15455 fi
15456 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15457   echo "$ac_t""yes" 1>&6
15458   have_lwp=yes
15459 else
15460   echo "$ac_t""no" 1>&6
15461 have_lwp=no
15462 fi
15463
15464
15465                 if test $have_lwp = yes ; then
15466                         cat >> confdefs.h <<\EOF
15467 #define HAVE_LWP 1
15468 EOF
15469
15470                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
15471                         ol_link_threads=lwp
15472
15473                         if test $ol_with_yielding_select = auto ; then
15474                                 ol_with_yielding_select=no
15475                         fi
15476                 fi
15477         fi
15478 fi
15479
15480 if test $ol_with_yielding_select = yes ; then
15481         cat >> confdefs.h <<\EOF
15482 #define HAVE_YIELDING_SELECT 1
15483 EOF
15484
15485 fi
15486
15487 if test $ol_with_threads = manual ; then
15488                 ol_link_threads=yes
15489
15490         echo "configure: warning: thread defines and link options must be set manually" 1>&2
15491
15492         for ac_hdr in pthread.h sched.h
15493 do
15494 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15495 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15496 echo "configure:15497: checking for $ac_hdr" >&5
15497 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15498   echo $ac_n "(cached) $ac_c" 1>&6
15499 else
15500   cat > conftest.$ac_ext <<EOF
15501 #line 15502 "configure"
15502 #include "confdefs.h"
15503 #include <$ac_hdr>
15504 EOF
15505 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15506 { (eval echo configure:15507: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15507 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15508 if test -z "$ac_err"; then
15509   rm -rf conftest*
15510   eval "ac_cv_header_$ac_safe=yes"
15511 else
15512   echo "$ac_err" >&5
15513   echo "configure: failed program was:" >&5
15514   cat conftest.$ac_ext >&5
15515   rm -rf conftest*
15516   eval "ac_cv_header_$ac_safe=no"
15517 fi
15518 rm -f conftest*
15519 fi
15520 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15521   echo "$ac_t""yes" 1>&6
15522     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15523   cat >> confdefs.h <<EOF
15524 #define $ac_tr_hdr 1
15525 EOF
15526  
15527 else
15528   echo "$ac_t""no" 1>&6
15529 fi
15530 done
15531
15532         for ac_func in sched_yield pthread_yield
15533 do
15534 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15535 echo "configure:15536: checking for $ac_func" >&5
15536 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15537   echo $ac_n "(cached) $ac_c" 1>&6
15538 else
15539   cat > conftest.$ac_ext <<EOF
15540 #line 15541 "configure"
15541 #include "confdefs.h"
15542 /* System header to define __stub macros and hopefully few prototypes,
15543     which can conflict with char $ac_func(); below.  */
15544 #include <assert.h>
15545 /* Override any gcc2 internal prototype to avoid an error.  */
15546 /* We use char because int might match the return type of a gcc2
15547     builtin and then its argument prototype would still apply.  */
15548 char $ac_func();
15549 char (*f)();
15550
15551 int main() {
15552
15553 /* The GNU C library defines this for functions which it implements
15554     to always fail with ENOSYS.  Some functions are actually named
15555     something starting with __ and the normal name is an alias.  */
15556 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15557 choke me
15558 #else
15559 f = $ac_func;
15560 #endif
15561
15562 ; return 0; }
15563 EOF
15564 if { (eval echo configure:15565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15565   rm -rf conftest*
15566   eval "ac_cv_func_$ac_func=yes"
15567 else
15568   echo "configure: failed program was:" >&5
15569   cat conftest.$ac_ext >&5
15570   rm -rf conftest*
15571   eval "ac_cv_func_$ac_func=no"
15572 fi
15573 rm -f conftest*
15574 fi
15575
15576 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15577   echo "$ac_t""yes" 1>&6
15578     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15579   cat >> confdefs.h <<EOF
15580 #define $ac_tr_func 1
15581 EOF
15582  
15583 else
15584   echo "$ac_t""no" 1>&6
15585 fi
15586 done
15587
15588         
15589         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
15590 echo "configure:15591: checking for LinuxThreads pthread.h" >&5
15591 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
15592   echo $ac_n "(cached) $ac_c" 1>&6
15593 else
15594   cat > conftest.$ac_ext <<EOF
15595 #line 15596 "configure"
15596 #include "confdefs.h"
15597 #include <pthread.h>
15598 EOF
15599 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15600   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
15601   rm -rf conftest*
15602   ol_cv_header_linux_threads=yes
15603 else
15604   rm -rf conftest*
15605   ol_cv_header_linux_threads=no
15606 fi
15607 rm -f conftest*
15608
15609                 
15610 fi
15611
15612 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
15613         if test $ol_cv_header_linux_threads = yes; then
15614                 cat >> confdefs.h <<\EOF
15615 #define HAVE_LINUX_THREADS 1
15616 EOF
15617
15618         fi
15619
15620
15621         for ac_hdr in mach/cthreads.h
15622 do
15623 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15624 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15625 echo "configure:15626: checking for $ac_hdr" >&5
15626 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15627   echo $ac_n "(cached) $ac_c" 1>&6
15628 else
15629   cat > conftest.$ac_ext <<EOF
15630 #line 15631 "configure"
15631 #include "confdefs.h"
15632 #include <$ac_hdr>
15633 EOF
15634 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15635 { (eval echo configure:15636: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15636 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15637 if test -z "$ac_err"; then
15638   rm -rf conftest*
15639   eval "ac_cv_header_$ac_safe=yes"
15640 else
15641   echo "$ac_err" >&5
15642   echo "configure: failed program was:" >&5
15643   cat conftest.$ac_ext >&5
15644   rm -rf conftest*
15645   eval "ac_cv_header_$ac_safe=no"
15646 fi
15647 rm -f conftest*
15648 fi
15649 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15650   echo "$ac_t""yes" 1>&6
15651     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15652   cat >> confdefs.h <<EOF
15653 #define $ac_tr_hdr 1
15654 EOF
15655  
15656 else
15657   echo "$ac_t""no" 1>&6
15658 fi
15659 done
15660
15661         for ac_hdr in lwp/lwp.h
15662 do
15663 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15664 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15665 echo "configure:15666: checking for $ac_hdr" >&5
15666 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15667   echo $ac_n "(cached) $ac_c" 1>&6
15668 else
15669   cat > conftest.$ac_ext <<EOF
15670 #line 15671 "configure"
15671 #include "confdefs.h"
15672 #include <$ac_hdr>
15673 EOF
15674 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15675 { (eval echo configure:15676: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15676 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15677 if test -z "$ac_err"; then
15678   rm -rf conftest*
15679   eval "ac_cv_header_$ac_safe=yes"
15680 else
15681   echo "$ac_err" >&5
15682   echo "configure: failed program was:" >&5
15683   cat conftest.$ac_ext >&5
15684   rm -rf conftest*
15685   eval "ac_cv_header_$ac_safe=no"
15686 fi
15687 rm -f conftest*
15688 fi
15689 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15690   echo "$ac_t""yes" 1>&6
15691     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15692   cat >> confdefs.h <<EOF
15693 #define $ac_tr_hdr 1
15694 EOF
15695  
15696 else
15697   echo "$ac_t""no" 1>&6
15698 fi
15699 done
15700
15701         for ac_hdr in thread.h synch.h
15702 do
15703 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15704 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15705 echo "configure:15706: checking for $ac_hdr" >&5
15706 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15707   echo $ac_n "(cached) $ac_c" 1>&6
15708 else
15709   cat > conftest.$ac_ext <<EOF
15710 #line 15711 "configure"
15711 #include "confdefs.h"
15712 #include <$ac_hdr>
15713 EOF
15714 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15715 { (eval echo configure:15716: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15716 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15717 if test -z "$ac_err"; then
15718   rm -rf conftest*
15719   eval "ac_cv_header_$ac_safe=yes"
15720 else
15721   echo "$ac_err" >&5
15722   echo "configure: failed program was:" >&5
15723   cat conftest.$ac_ext >&5
15724   rm -rf conftest*
15725   eval "ac_cv_header_$ac_safe=no"
15726 fi
15727 rm -f conftest*
15728 fi
15729 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15730   echo "$ac_t""yes" 1>&6
15731     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15732   cat >> confdefs.h <<EOF
15733 #define $ac_tr_hdr 1
15734 EOF
15735  
15736 else
15737   echo "$ac_t""no" 1>&6
15738 fi
15739 done
15740
15741 fi
15742
15743 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
15744                         cat >> confdefs.h <<\EOF
15745 #define REENTRANT 1
15746 EOF
15747
15748         cat >> confdefs.h <<\EOF
15749 #define _REENTRANT 1
15750 EOF
15751
15752         cat >> confdefs.h <<\EOF
15753 #define THREAD_SAFE 1
15754 EOF
15755
15756         cat >> confdefs.h <<\EOF
15757 #define _THREAD_SAFE 1
15758 EOF
15759
15760         cat >> confdefs.h <<\EOF
15761 #define THREADSAFE 1
15762 EOF
15763
15764         cat >> confdefs.h <<\EOF
15765 #define _THREADSAFE 1
15766 EOF
15767
15768         cat >> confdefs.h <<\EOF
15769 #define _SGI_MP_SOURCE 1
15770 EOF
15771
15772
15773                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
15774 echo "configure:15775: checking for thread specific errno" >&5
15775 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
15776   echo $ac_n "(cached) $ac_c" 1>&6
15777 else
15778   
15779                 cat > conftest.$ac_ext <<EOF
15780 #line 15781 "configure"
15781 #include "confdefs.h"
15782 #include <errno.h>
15783 int main() {
15784 errno = 0;
15785 ; return 0; }
15786 EOF
15787 if { (eval echo configure:15788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15788   rm -rf conftest*
15789   ol_cv_errno_thread_specific=yes
15790 else
15791   echo "configure: failed program was:" >&5
15792   cat conftest.$ac_ext >&5
15793   rm -rf conftest*
15794   ol_cv_errno_thread_specific=no
15795 fi
15796 rm -f conftest*
15797         
15798 fi
15799
15800 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
15801
15802                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
15803 echo "configure:15804: checking for thread specific h_errno" >&5
15804 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
15805   echo $ac_n "(cached) $ac_c" 1>&6
15806 else
15807   
15808                 cat > conftest.$ac_ext <<EOF
15809 #line 15810 "configure"
15810 #include "confdefs.h"
15811 #include <netdb.h>
15812 int main() {
15813 h_errno = 0;
15814 ; return 0; }
15815 EOF
15816 if { (eval echo configure:15817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15817   rm -rf conftest*
15818   ol_cv_h_errno_thread_specific=yes
15819 else
15820   echo "configure: failed program was:" >&5
15821   cat conftest.$ac_ext >&5
15822   rm -rf conftest*
15823   ol_cv_h_errno_thread_specific=no
15824 fi
15825 rm -f conftest*
15826         
15827 fi
15828
15829 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
15830
15831         if test $ol_cv_errno_thread_specific != yes \
15832                 -o $ol_cv_h_errno_thread_specific != yes ; then
15833                 LIBS="$LTHREAD_LIBS $LIBS"
15834                 LTHREAD_LIBS=""
15835         fi
15836
15837 fi  
15838
15839 if test $ol_link_threads = no ; then
15840         if test $ol_with_threads = yes ; then
15841                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
15842         fi
15843
15844         if test $ol_with_threads = auto ; then
15845                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
15846                 ol_with_threads=no
15847         fi
15848
15849         cat >> confdefs.h <<\EOF
15850 #define NO_THREADS 1
15851 EOF
15852
15853         LTHREAD_LIBS=""
15854 fi
15855
15856 if test $ol_link_threads != no ; then
15857         cat >> confdefs.h <<\EOF
15858 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
15859 EOF
15860
15861 fi
15862
15863 for ac_func in \
15864         ctime_r                 \
15865         gethostbyname_r gethostbyaddr_r \
15866
15867 do
15868 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15869 echo "configure:15870: checking for $ac_func" >&5
15870 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15871   echo $ac_n "(cached) $ac_c" 1>&6
15872 else
15873   cat > conftest.$ac_ext <<EOF
15874 #line 15875 "configure"
15875 #include "confdefs.h"
15876 /* System header to define __stub macros and hopefully few prototypes,
15877     which can conflict with char $ac_func(); below.  */
15878 #include <assert.h>
15879 /* Override any gcc2 internal prototype to avoid an error.  */
15880 /* We use char because int might match the return type of a gcc2
15881     builtin and then its argument prototype would still apply.  */
15882 char $ac_func();
15883 char (*f)();
15884
15885 int main() {
15886
15887 /* The GNU C library defines this for functions which it implements
15888     to always fail with ENOSYS.  Some functions are actually named
15889     something starting with __ and the normal name is an alias.  */
15890 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15891 choke me
15892 #else
15893 f = $ac_func;
15894 #endif
15895
15896 ; return 0; }
15897 EOF
15898 if { (eval echo configure:15899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15899   rm -rf conftest*
15900   eval "ac_cv_func_$ac_func=yes"
15901 else
15902   echo "configure: failed program was:" >&5
15903   cat conftest.$ac_ext >&5
15904   rm -rf conftest*
15905   eval "ac_cv_func_$ac_func=no"
15906 fi
15907 rm -f conftest*
15908 fi
15909
15910 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15911   echo "$ac_t""yes" 1>&6
15912     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15913   cat >> confdefs.h <<EOF
15914 #define $ac_tr_func 1
15915 EOF
15916  
15917 else
15918   echo "$ac_t""no" 1>&6
15919 fi
15920 done
15921
15922
15923 if test "$ac_cv_func_ctime_r" = no ; then
15924         ol_cv_func_ctime_r_nargs=0
15925 else
15926         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
15927 echo "configure:15928: checking number of arguments of ctime_r" >&5
15928 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
15929   echo $ac_n "(cached) $ac_c" 1>&6
15930 else
15931   cat > conftest.$ac_ext <<EOF
15932 #line 15933 "configure"
15933 #include "confdefs.h"
15934 #include <time.h>
15935 int main() {
15936 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
15937 ; return 0; }
15938 EOF
15939 if { (eval echo configure:15940: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15940   rm -rf conftest*
15941   ol_cv_func_ctime_r_nargs3=yes
15942 else
15943   echo "configure: failed program was:" >&5
15944   cat conftest.$ac_ext >&5
15945   rm -rf conftest*
15946   ol_cv_func_ctime_r_nargs3=no
15947 fi
15948 rm -f conftest*
15949
15950         cat > conftest.$ac_ext <<EOF
15951 #line 15952 "configure"
15952 #include "confdefs.h"
15953 #include <time.h>
15954 int main() {
15955 time_t ti; char *buffer; ctime_r(&ti,buffer);
15956 ; return 0; }
15957 EOF
15958 if { (eval echo configure:15959: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15959   rm -rf conftest*
15960   ol_cv_func_ctime_r_nargs2=yes
15961 else
15962   echo "configure: failed program was:" >&5
15963   cat conftest.$ac_ext >&5
15964   rm -rf conftest*
15965   ol_cv_func_ctime_r_nargs2=no
15966 fi
15967 rm -f conftest*
15968
15969         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
15970                 $ol_cv_func_ctime_r_nargs2 = no ; then
15971
15972                 ol_cv_func_ctime_r_nargs=3
15973
15974         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
15975                 $ol_cv_func_ctime_r_nargs2 = yes ; then
15976
15977                 ol_cv_func_ctime_r_nargs=2
15978
15979         else
15980                 ol_cv_func_ctime_r_nargs=0
15981         fi
15982   
15983 fi
15984
15985 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
15986
15987   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
15988         cat >> confdefs.h <<EOF
15989 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
15990 EOF
15991
15992   fi
15993
15994 fi
15995
15996 if test "$ac_cv_func_gethostbyname_r" = yes ; then
15997         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
15998 echo "configure:15999: checking number of arguments of gethostbyname_r" >&5
15999 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
16000   echo $ac_n "(cached) $ac_c" 1>&6
16001 else
16002   cat > conftest.$ac_ext <<EOF
16003 #line 16004 "configure"
16004 #include "confdefs.h"
16005 #include <sys/types.h>
16006 #include <sys/socket.h>
16007 #include <netinet/in.h>
16008 #include <netdb.h>
16009 #define BUFSIZE (sizeof(struct hostent)+10)
16010 int main() {
16011 struct hostent hent; char buffer[BUFSIZE];
16012                 int bufsize=BUFSIZE;int h_errno;
16013                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
16014                         buffer, bufsize, &h_errno);
16015 ; return 0; }
16016 EOF
16017 if { (eval echo configure:16018: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16018   rm -rf conftest*
16019   ol_cv_func_gethostbyname_r_nargs5=yes
16020 else
16021   echo "configure: failed program was:" >&5
16022   cat conftest.$ac_ext >&5
16023   rm -rf conftest*
16024   ol_cv_func_gethostbyname_r_nargs5=no
16025 fi
16026 rm -f conftest*
16027
16028         cat > conftest.$ac_ext <<EOF
16029 #line 16030 "configure"
16030 #include "confdefs.h"
16031 #include <sys/types.h>
16032 #include <sys/socket.h>
16033 #include <netinet/in.h>
16034 #include <netdb.h>
16035 #define BUFSIZE (sizeof(struct hostent)+10)
16036 int main() {
16037 struct hostent hent;struct hostent *rhent;
16038                 char buffer[BUFSIZE];
16039                 int bufsize=BUFSIZE;int h_errno;
16040                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
16041                         &rhent, &h_errno);
16042 ; return 0; }
16043 EOF
16044 if { (eval echo configure:16045: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16045   rm -rf conftest*
16046   ol_cv_func_gethostbyname_r_nargs6=yes
16047 else
16048   echo "configure: failed program was:" >&5
16049   cat conftest.$ac_ext >&5
16050   rm -rf conftest*
16051   ol_cv_func_gethostbyname_r_nargs6=no
16052 fi
16053 rm -f conftest*
16054
16055         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
16056                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
16057
16058                 ol_cv_func_gethostbyname_r_nargs=5
16059
16060         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
16061                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
16062
16063                 ol_cv_func_gethostbyname_r_nargs=6
16064
16065         else
16066                 ol_cv_func_gethostbyname_r_nargs=0
16067         fi
16068   
16069 fi
16070
16071 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
16072   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
16073         cat >> confdefs.h <<EOF
16074 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
16075 EOF
16076
16077   fi
16078
16079 else
16080         ol_cv_func_gethostbyname_r_nargs=0
16081 fi
16082  
16083 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
16084         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
16085 echo "configure:16086: checking number of arguments of gethostbyaddr_r" >&5
16086 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
16087   echo $ac_n "(cached) $ac_c" 1>&6
16088 else
16089   cat > conftest.$ac_ext <<EOF
16090 #line 16091 "configure"
16091 #include "confdefs.h"
16092 #include <sys/types.h>
16093 #include <sys/socket.h>
16094 #include <netinet/in.h>
16095 #include <netdb.h>
16096 #define BUFSIZE (sizeof(struct hostent)+10)
16097 int main() {
16098 struct hostent hent; char buffer[BUFSIZE]; 
16099             struct in_addr add;
16100             size_t alen=sizeof(struct in_addr);
16101             int bufsize=BUFSIZE;int h_errno;
16102                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
16103                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
16104 ; return 0; }
16105 EOF
16106 if { (eval echo configure:16107: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16107   rm -rf conftest*
16108   ol_cv_func_gethostbyaddr_r_nargs7=yes
16109 else
16110   echo "configure: failed program was:" >&5
16111   cat conftest.$ac_ext >&5
16112   rm -rf conftest*
16113   ol_cv_func_gethostbyaddr_r_nargs7=no
16114 fi
16115 rm -f conftest*
16116
16117         cat > conftest.$ac_ext <<EOF
16118 #line 16119 "configure"
16119 #include "confdefs.h"
16120 #include <sys/types.h>
16121 #include <sys/socket.h>
16122 #include <netinet/in.h>
16123 #include <netdb.h>
16124 #define BUFSIZE (sizeof(struct hostent)+10)
16125 int main() {
16126 struct hostent hent;
16127                 struct hostent *rhent; char buffer[BUFSIZE]; 
16128                 struct in_addr add;
16129                 size_t alen=sizeof(struct in_addr);
16130                 int bufsize=BUFSIZE;int h_errno;
16131                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
16132                         alen, AF_INET, &hent, buffer, bufsize, 
16133                         &rhent, &h_errno);
16134 ; return 0; }
16135 EOF
16136 if { (eval echo configure:16137: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16137   rm -rf conftest*
16138   ol_cv_func_gethostbyaddr_r_nargs8=yes
16139 else
16140   echo "configure: failed program was:" >&5
16141   cat conftest.$ac_ext >&5
16142   rm -rf conftest*
16143   ol_cv_func_gethostbyaddr_r_nargs8=no
16144 fi
16145 rm -f conftest*
16146
16147         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
16148                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
16149
16150                 ol_cv_func_gethostbyaddr_r_nargs=7
16151
16152         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
16153                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
16154
16155                 ol_cv_func_gethostbyaddr_r_nargs=8
16156
16157         else
16158                 ol_cv_func_gethostbyaddr_r_nargs=0
16159         fi
16160   
16161 fi
16162
16163 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
16164   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
16165     cat >> confdefs.h <<EOF
16166 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
16167 EOF
16168
16169   fi
16170
16171 else
16172         ol_cv_func_gethostbyaddr_r_nargs=0
16173 fi
16174
16175 ol_link_ldbm=no 
16176
16177 if test $ol_with_ldbm_api = auto \
16178         -o $ol_with_ldbm_api = berkeley \
16179         -o $ol_with_ldbm_api = bcompat ; then
16180
16181         if test $ol_with_ldbm_api = bcompat; then \
16182                 for ac_hdr in db_185.h db.h
16183 do
16184 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16185 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16186 echo "configure:16187: checking for $ac_hdr" >&5
16187 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16188   echo $ac_n "(cached) $ac_c" 1>&6
16189 else
16190   cat > conftest.$ac_ext <<EOF
16191 #line 16192 "configure"
16192 #include "confdefs.h"
16193 #include <$ac_hdr>
16194 EOF
16195 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16196 { (eval echo configure:16197: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16197 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16198 if test -z "$ac_err"; then
16199   rm -rf conftest*
16200   eval "ac_cv_header_$ac_safe=yes"
16201 else
16202   echo "$ac_err" >&5
16203   echo "configure: failed program was:" >&5
16204   cat conftest.$ac_ext >&5
16205   rm -rf conftest*
16206   eval "ac_cv_header_$ac_safe=no"
16207 fi
16208 rm -f conftest*
16209 fi
16210 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16211   echo "$ac_t""yes" 1>&6
16212     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16213   cat >> confdefs.h <<EOF
16214 #define $ac_tr_hdr 1
16215 EOF
16216  
16217 else
16218   echo "$ac_t""no" 1>&6
16219 fi
16220 done
16221
16222 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
16223         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
16224 echo "configure:16225: checking if Berkeley DB header compatibility" >&5
16225 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
16226   echo $ac_n "(cached) $ac_c" 1>&6
16227 else
16228   
16229                 cat > conftest.$ac_ext <<EOF
16230 #line 16231 "configure"
16231 #include "confdefs.h"
16232
16233 #if HAVE_DB_185_H
16234 #       include <db_185.h>
16235 #else
16236 #       include <db.h>
16237 #endif
16238
16239  /* this check could be improved */
16240 #ifndef DB_VERSION_MAJOR
16241 #       define DB_VERSION_MAJOR 1
16242 #endif
16243
16244 #if DB_VERSION_MAJOR == 1 
16245         __db_version_1
16246 #endif
16247
16248 EOF
16249 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16250   egrep "__db_version_1" >/dev/null 2>&1; then
16251   rm -rf conftest*
16252   ol_cv_header_db1=yes
16253 else
16254   rm -rf conftest*
16255   ol_cv_header_db1=no
16256 fi
16257 rm -f conftest*
16258
16259 fi
16260
16261 echo "$ac_t""$ol_cv_header_db1" 1>&6
16262
16263         if test $ol_cv_header_db1 = yes ; then
16264                 ol_cv_lib_db=no
16265 if test $ol_cv_lib_db = no ; then
16266         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
16267 echo "configure:16268: checking for Berkeley DB link (default)" >&5
16268 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
16269   echo $ac_n "(cached) $ac_c" 1>&6
16270 else
16271   
16272         ol_DB_LIB=
16273         ol_LIBS=$LIBS
16274         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16275
16276         cat > conftest.$ac_ext <<EOF
16277 #line 16278 "configure"
16278 #include "confdefs.h"
16279
16280 #ifdef HAVE_DB_185_H
16281 # include <db_185.h>
16282 #else
16283 # include <db.h>
16284 #endif
16285
16286 #ifndef DB_VERSION_MAJOR
16287 # define DB_VERSION_MAJOR 1
16288 #endif
16289
16290 #ifndef NULL
16291 #define NULL ((void*)0)
16292 #endif
16293
16294 int main() {
16295
16296 #if DB_VERSION_MAJOR > 1
16297         {
16298                 char *version;
16299                 int major, minor, patch;
16300
16301                 version = db_version( &major, &minor, &patch );
16302
16303                 if( major != DB_VERSION_MAJOR ||
16304                         minor < DB_VERSION_MINOR )
16305                 {
16306                         printf("Berkeley DB version mismatch\n"
16307                                 "\theader: %s\n\tlibrary: %s\n",
16308                                 DB_VERSION_STRING, version);
16309                         return 1;
16310                 }
16311         }
16312 #endif
16313
16314 #if DB_VERSION_MAJOR > 2
16315         db_env_create( NULL, 0 );
16316 #elif DB_VERSION_MAJOR > 1
16317         db_appexit( NULL );
16318 #else
16319         (void) dbopen( NULL, 0, 0, 0, NULL);
16320 #endif
16321
16322 ; return 0; }
16323 EOF
16324 if { (eval echo configure:16325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16325   rm -rf conftest*
16326   ol_cv_db_none=yes
16327 else
16328   echo "configure: failed program was:" >&5
16329   cat conftest.$ac_ext >&5
16330   rm -rf conftest*
16331   ol_cv_db_none=no
16332 fi
16333 rm -f conftest*
16334
16335         LIBS="$ol_LIBS"
16336
16337 fi
16338
16339 echo "$ac_t""$ol_cv_db_none" 1>&6
16340
16341         if test $ol_cv_db_none = yes ; then
16342                 ol_cv_lib_db=yes
16343         fi
16344 fi
16345
16346 if test $ol_cv_lib_db = no ; then
16347         echo $ac_n "checking for Berkeley DB link (-ldb43)""... $ac_c" 1>&6
16348 echo "configure:16349: checking for Berkeley DB link (-ldb43)" >&5
16349 if eval "test \"\${ol_cv_db_db43+set}\" = set"; then
16350   echo $ac_n "(cached) $ac_c" 1>&6
16351 else
16352   
16353         ol_DB_LIB=-ldb43
16354         ol_LIBS=$LIBS
16355         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16356
16357         cat > conftest.$ac_ext <<EOF
16358 #line 16359 "configure"
16359 #include "confdefs.h"
16360
16361 #ifdef HAVE_DB_185_H
16362 # include <db_185.h>
16363 #else
16364 # include <db.h>
16365 #endif
16366
16367 #ifndef DB_VERSION_MAJOR
16368 # define DB_VERSION_MAJOR 1
16369 #endif
16370
16371 #ifndef NULL
16372 #define NULL ((void*)0)
16373 #endif
16374
16375 int main() {
16376
16377 #if DB_VERSION_MAJOR > 1
16378         {
16379                 char *version;
16380                 int major, minor, patch;
16381
16382                 version = db_version( &major, &minor, &patch );
16383
16384                 if( major != DB_VERSION_MAJOR ||
16385                         minor < DB_VERSION_MINOR )
16386                 {
16387                         printf("Berkeley DB version mismatch\n"
16388                                 "\theader: %s\n\tlibrary: %s\n",
16389                                 DB_VERSION_STRING, version);
16390                         return 1;
16391                 }
16392         }
16393 #endif
16394
16395 #if DB_VERSION_MAJOR > 2
16396         db_env_create( NULL, 0 );
16397 #elif DB_VERSION_MAJOR > 1
16398         db_appexit( NULL );
16399 #else
16400         (void) dbopen( NULL, 0, 0, 0, NULL);
16401 #endif
16402
16403 ; return 0; }
16404 EOF
16405 if { (eval echo configure:16406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16406   rm -rf conftest*
16407   ol_cv_db_db43=yes
16408 else
16409   echo "configure: failed program was:" >&5
16410   cat conftest.$ac_ext >&5
16411   rm -rf conftest*
16412   ol_cv_db_db43=no
16413 fi
16414 rm -f conftest*
16415
16416         LIBS="$ol_LIBS"
16417
16418 fi
16419
16420 echo "$ac_t""$ol_cv_db_db43" 1>&6
16421
16422         if test $ol_cv_db_db43 = yes ; then
16423                 ol_cv_lib_db=-ldb43
16424         fi
16425 fi
16426
16427 if test $ol_cv_lib_db = no ; then
16428         echo $ac_n "checking for Berkeley DB link (-ldb-43)""... $ac_c" 1>&6
16429 echo "configure:16430: checking for Berkeley DB link (-ldb-43)" >&5
16430 if eval "test \"\${ol_cv_db_db_43+set}\" = set"; then
16431   echo $ac_n "(cached) $ac_c" 1>&6
16432 else
16433   
16434         ol_DB_LIB=-ldb-43
16435         ol_LIBS=$LIBS
16436         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16437
16438         cat > conftest.$ac_ext <<EOF
16439 #line 16440 "configure"
16440 #include "confdefs.h"
16441
16442 #ifdef HAVE_DB_185_H
16443 # include <db_185.h>
16444 #else
16445 # include <db.h>
16446 #endif
16447
16448 #ifndef DB_VERSION_MAJOR
16449 # define DB_VERSION_MAJOR 1
16450 #endif
16451
16452 #ifndef NULL
16453 #define NULL ((void*)0)
16454 #endif
16455
16456 int main() {
16457
16458 #if DB_VERSION_MAJOR > 1
16459         {
16460                 char *version;
16461                 int major, minor, patch;
16462
16463                 version = db_version( &major, &minor, &patch );
16464
16465                 if( major != DB_VERSION_MAJOR ||
16466                         minor < DB_VERSION_MINOR )
16467                 {
16468                         printf("Berkeley DB version mismatch\n"
16469                                 "\theader: %s\n\tlibrary: %s\n",
16470                                 DB_VERSION_STRING, version);
16471                         return 1;
16472                 }
16473         }
16474 #endif
16475
16476 #if DB_VERSION_MAJOR > 2
16477         db_env_create( NULL, 0 );
16478 #elif DB_VERSION_MAJOR > 1
16479         db_appexit( NULL );
16480 #else
16481         (void) dbopen( NULL, 0, 0, 0, NULL);
16482 #endif
16483
16484 ; return 0; }
16485 EOF
16486 if { (eval echo configure:16487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16487   rm -rf conftest*
16488   ol_cv_db_db_43=yes
16489 else
16490   echo "configure: failed program was:" >&5
16491   cat conftest.$ac_ext >&5
16492   rm -rf conftest*
16493   ol_cv_db_db_43=no
16494 fi
16495 rm -f conftest*
16496
16497         LIBS="$ol_LIBS"
16498
16499 fi
16500
16501 echo "$ac_t""$ol_cv_db_db_43" 1>&6
16502
16503         if test $ol_cv_db_db_43 = yes ; then
16504                 ol_cv_lib_db=-ldb-43
16505         fi
16506 fi
16507
16508 if test $ol_cv_lib_db = no ; then
16509         echo $ac_n "checking for Berkeley DB link (-ldb-4.3)""... $ac_c" 1>&6
16510 echo "configure:16511: checking for Berkeley DB link (-ldb-4.3)" >&5
16511 if eval "test \"\${ol_cv_db_db_4_dot_3+set}\" = set"; then
16512   echo $ac_n "(cached) $ac_c" 1>&6
16513 else
16514   
16515         ol_DB_LIB=-ldb-4.3
16516         ol_LIBS=$LIBS
16517         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16518
16519         cat > conftest.$ac_ext <<EOF
16520 #line 16521 "configure"
16521 #include "confdefs.h"
16522
16523 #ifdef HAVE_DB_185_H
16524 # include <db_185.h>
16525 #else
16526 # include <db.h>
16527 #endif
16528
16529 #ifndef DB_VERSION_MAJOR
16530 # define DB_VERSION_MAJOR 1
16531 #endif
16532
16533 #ifndef NULL
16534 #define NULL ((void*)0)
16535 #endif
16536
16537 int main() {
16538
16539 #if DB_VERSION_MAJOR > 1
16540         {
16541                 char *version;
16542                 int major, minor, patch;
16543
16544                 version = db_version( &major, &minor, &patch );
16545
16546                 if( major != DB_VERSION_MAJOR ||
16547                         minor < DB_VERSION_MINOR )
16548                 {
16549                         printf("Berkeley DB version mismatch\n"
16550                                 "\theader: %s\n\tlibrary: %s\n",
16551                                 DB_VERSION_STRING, version);
16552                         return 1;
16553                 }
16554         }
16555 #endif
16556
16557 #if DB_VERSION_MAJOR > 2
16558         db_env_create( NULL, 0 );
16559 #elif DB_VERSION_MAJOR > 1
16560         db_appexit( NULL );
16561 #else
16562         (void) dbopen( NULL, 0, 0, 0, NULL);
16563 #endif
16564
16565 ; return 0; }
16566 EOF
16567 if { (eval echo configure:16568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16568   rm -rf conftest*
16569   ol_cv_db_db_4_dot_3=yes
16570 else
16571   echo "configure: failed program was:" >&5
16572   cat conftest.$ac_ext >&5
16573   rm -rf conftest*
16574   ol_cv_db_db_4_dot_3=no
16575 fi
16576 rm -f conftest*
16577
16578         LIBS="$ol_LIBS"
16579
16580 fi
16581
16582 echo "$ac_t""$ol_cv_db_db_4_dot_3" 1>&6
16583
16584         if test $ol_cv_db_db_4_dot_3 = yes ; then
16585                 ol_cv_lib_db=-ldb-4.3
16586         fi
16587 fi
16588
16589 if test $ol_cv_lib_db = no ; then
16590         echo $ac_n "checking for Berkeley DB link (-ldb-4-3)""... $ac_c" 1>&6
16591 echo "configure:16592: checking for Berkeley DB link (-ldb-4-3)" >&5
16592 if eval "test \"\${ol_cv_db_db_4_3+set}\" = set"; then
16593   echo $ac_n "(cached) $ac_c" 1>&6
16594 else
16595   
16596         ol_DB_LIB=-ldb-4-3
16597         ol_LIBS=$LIBS
16598         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16599
16600         cat > conftest.$ac_ext <<EOF
16601 #line 16602 "configure"
16602 #include "confdefs.h"
16603
16604 #ifdef HAVE_DB_185_H
16605 # include <db_185.h>
16606 #else
16607 # include <db.h>
16608 #endif
16609
16610 #ifndef DB_VERSION_MAJOR
16611 # define DB_VERSION_MAJOR 1
16612 #endif
16613
16614 #ifndef NULL
16615 #define NULL ((void*)0)
16616 #endif
16617
16618 int main() {
16619
16620 #if DB_VERSION_MAJOR > 1
16621         {
16622                 char *version;
16623                 int major, minor, patch;
16624
16625                 version = db_version( &major, &minor, &patch );
16626
16627                 if( major != DB_VERSION_MAJOR ||
16628                         minor < DB_VERSION_MINOR )
16629                 {
16630                         printf("Berkeley DB version mismatch\n"
16631                                 "\theader: %s\n\tlibrary: %s\n",
16632                                 DB_VERSION_STRING, version);
16633                         return 1;
16634                 }
16635         }
16636 #endif
16637
16638 #if DB_VERSION_MAJOR > 2
16639         db_env_create( NULL, 0 );
16640 #elif DB_VERSION_MAJOR > 1
16641         db_appexit( NULL );
16642 #else
16643         (void) dbopen( NULL, 0, 0, 0, NULL);
16644 #endif
16645
16646 ; return 0; }
16647 EOF
16648 if { (eval echo configure:16649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16649   rm -rf conftest*
16650   ol_cv_db_db_4_3=yes
16651 else
16652   echo "configure: failed program was:" >&5
16653   cat conftest.$ac_ext >&5
16654   rm -rf conftest*
16655   ol_cv_db_db_4_3=no
16656 fi
16657 rm -f conftest*
16658
16659         LIBS="$ol_LIBS"
16660
16661 fi
16662
16663 echo "$ac_t""$ol_cv_db_db_4_3" 1>&6
16664
16665         if test $ol_cv_db_db_4_3 = yes ; then
16666                 ol_cv_lib_db=-ldb-4-3
16667         fi
16668 fi
16669
16670 if test $ol_cv_lib_db = no ; then
16671         echo $ac_n "checking for Berkeley DB link (-ldb42)""... $ac_c" 1>&6
16672 echo "configure:16673: checking for Berkeley DB link (-ldb42)" >&5
16673 if eval "test \"\${ol_cv_db_db42+set}\" = set"; then
16674   echo $ac_n "(cached) $ac_c" 1>&6
16675 else
16676   
16677         ol_DB_LIB=-ldb42
16678         ol_LIBS=$LIBS
16679         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16680
16681         cat > conftest.$ac_ext <<EOF
16682 #line 16683 "configure"
16683 #include "confdefs.h"
16684
16685 #ifdef HAVE_DB_185_H
16686 # include <db_185.h>
16687 #else
16688 # include <db.h>
16689 #endif
16690
16691 #ifndef DB_VERSION_MAJOR
16692 # define DB_VERSION_MAJOR 1
16693 #endif
16694
16695 #ifndef NULL
16696 #define NULL ((void*)0)
16697 #endif
16698
16699 int main() {
16700
16701 #if DB_VERSION_MAJOR > 1
16702         {
16703                 char *version;
16704                 int major, minor, patch;
16705
16706                 version = db_version( &major, &minor, &patch );
16707
16708                 if( major != DB_VERSION_MAJOR ||
16709                         minor < DB_VERSION_MINOR )
16710                 {
16711                         printf("Berkeley DB version mismatch\n"
16712                                 "\theader: %s\n\tlibrary: %s\n",
16713                                 DB_VERSION_STRING, version);
16714                         return 1;
16715                 }
16716         }
16717 #endif
16718
16719 #if DB_VERSION_MAJOR > 2
16720         db_env_create( NULL, 0 );
16721 #elif DB_VERSION_MAJOR > 1
16722         db_appexit( NULL );
16723 #else
16724         (void) dbopen( NULL, 0, 0, 0, NULL);
16725 #endif
16726
16727 ; return 0; }
16728 EOF
16729 if { (eval echo configure:16730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16730   rm -rf conftest*
16731   ol_cv_db_db42=yes
16732 else
16733   echo "configure: failed program was:" >&5
16734   cat conftest.$ac_ext >&5
16735   rm -rf conftest*
16736   ol_cv_db_db42=no
16737 fi
16738 rm -f conftest*
16739
16740         LIBS="$ol_LIBS"
16741
16742 fi
16743
16744 echo "$ac_t""$ol_cv_db_db42" 1>&6
16745
16746         if test $ol_cv_db_db42 = yes ; then
16747                 ol_cv_lib_db=-ldb42
16748         fi
16749 fi
16750
16751 if test $ol_cv_lib_db = no ; then
16752         echo $ac_n "checking for Berkeley DB link (-ldb-42)""... $ac_c" 1>&6
16753 echo "configure:16754: checking for Berkeley DB link (-ldb-42)" >&5
16754 if eval "test \"\${ol_cv_db_db_42+set}\" = set"; then
16755   echo $ac_n "(cached) $ac_c" 1>&6
16756 else
16757   
16758         ol_DB_LIB=-ldb-42
16759         ol_LIBS=$LIBS
16760         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16761
16762         cat > conftest.$ac_ext <<EOF
16763 #line 16764 "configure"
16764 #include "confdefs.h"
16765
16766 #ifdef HAVE_DB_185_H
16767 # include <db_185.h>
16768 #else
16769 # include <db.h>
16770 #endif
16771
16772 #ifndef DB_VERSION_MAJOR
16773 # define DB_VERSION_MAJOR 1
16774 #endif
16775
16776 #ifndef NULL
16777 #define NULL ((void*)0)
16778 #endif
16779
16780 int main() {
16781
16782 #if DB_VERSION_MAJOR > 1
16783         {
16784                 char *version;
16785                 int major, minor, patch;
16786
16787                 version = db_version( &major, &minor, &patch );
16788
16789                 if( major != DB_VERSION_MAJOR ||
16790                         minor < DB_VERSION_MINOR )
16791                 {
16792                         printf("Berkeley DB version mismatch\n"
16793                                 "\theader: %s\n\tlibrary: %s\n",
16794                                 DB_VERSION_STRING, version);
16795                         return 1;
16796                 }
16797         }
16798 #endif
16799
16800 #if DB_VERSION_MAJOR > 2
16801         db_env_create( NULL, 0 );
16802 #elif DB_VERSION_MAJOR > 1
16803         db_appexit( NULL );
16804 #else
16805         (void) dbopen( NULL, 0, 0, 0, NULL);
16806 #endif
16807
16808 ; return 0; }
16809 EOF
16810 if { (eval echo configure:16811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16811   rm -rf conftest*
16812   ol_cv_db_db_42=yes
16813 else
16814   echo "configure: failed program was:" >&5
16815   cat conftest.$ac_ext >&5
16816   rm -rf conftest*
16817   ol_cv_db_db_42=no
16818 fi
16819 rm -f conftest*
16820
16821         LIBS="$ol_LIBS"
16822
16823 fi
16824
16825 echo "$ac_t""$ol_cv_db_db_42" 1>&6
16826
16827         if test $ol_cv_db_db_42 = yes ; then
16828                 ol_cv_lib_db=-ldb-42
16829         fi
16830 fi
16831
16832 if test $ol_cv_lib_db = no ; then
16833         echo $ac_n "checking for Berkeley DB link (-ldb-4.2)""... $ac_c" 1>&6
16834 echo "configure:16835: checking for Berkeley DB link (-ldb-4.2)" >&5
16835 if eval "test \"\${ol_cv_db_db_4_dot_2+set}\" = set"; then
16836   echo $ac_n "(cached) $ac_c" 1>&6
16837 else
16838   
16839         ol_DB_LIB=-ldb-4.2
16840         ol_LIBS=$LIBS
16841         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16842
16843         cat > conftest.$ac_ext <<EOF
16844 #line 16845 "configure"
16845 #include "confdefs.h"
16846
16847 #ifdef HAVE_DB_185_H
16848 # include <db_185.h>
16849 #else
16850 # include <db.h>
16851 #endif
16852
16853 #ifndef DB_VERSION_MAJOR
16854 # define DB_VERSION_MAJOR 1
16855 #endif
16856
16857 #ifndef NULL
16858 #define NULL ((void*)0)
16859 #endif
16860
16861 int main() {
16862
16863 #if DB_VERSION_MAJOR > 1
16864         {
16865                 char *version;
16866                 int major, minor, patch;
16867
16868                 version = db_version( &major, &minor, &patch );
16869
16870                 if( major != DB_VERSION_MAJOR ||
16871                         minor < DB_VERSION_MINOR )
16872                 {
16873                         printf("Berkeley DB version mismatch\n"
16874                                 "\theader: %s\n\tlibrary: %s\n",
16875                                 DB_VERSION_STRING, version);
16876                         return 1;
16877                 }
16878         }
16879 #endif
16880
16881 #if DB_VERSION_MAJOR > 2
16882         db_env_create( NULL, 0 );
16883 #elif DB_VERSION_MAJOR > 1
16884         db_appexit( NULL );
16885 #else
16886         (void) dbopen( NULL, 0, 0, 0, NULL);
16887 #endif
16888
16889 ; return 0; }
16890 EOF
16891 if { (eval echo configure:16892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16892   rm -rf conftest*
16893   ol_cv_db_db_4_dot_2=yes
16894 else
16895   echo "configure: failed program was:" >&5
16896   cat conftest.$ac_ext >&5
16897   rm -rf conftest*
16898   ol_cv_db_db_4_dot_2=no
16899 fi
16900 rm -f conftest*
16901
16902         LIBS="$ol_LIBS"
16903
16904 fi
16905
16906 echo "$ac_t""$ol_cv_db_db_4_dot_2" 1>&6
16907
16908         if test $ol_cv_db_db_4_dot_2 = yes ; then
16909                 ol_cv_lib_db=-ldb-4.2
16910         fi
16911 fi
16912
16913 if test $ol_cv_lib_db = no ; then
16914         echo $ac_n "checking for Berkeley DB link (-ldb-4-2)""... $ac_c" 1>&6
16915 echo "configure:16916: checking for Berkeley DB link (-ldb-4-2)" >&5
16916 if eval "test \"\${ol_cv_db_db_4_2+set}\" = set"; then
16917   echo $ac_n "(cached) $ac_c" 1>&6
16918 else
16919   
16920         ol_DB_LIB=-ldb-4-2
16921         ol_LIBS=$LIBS
16922         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16923
16924         cat > conftest.$ac_ext <<EOF
16925 #line 16926 "configure"
16926 #include "confdefs.h"
16927
16928 #ifdef HAVE_DB_185_H
16929 # include <db_185.h>
16930 #else
16931 # include <db.h>
16932 #endif
16933
16934 #ifndef DB_VERSION_MAJOR
16935 # define DB_VERSION_MAJOR 1
16936 #endif
16937
16938 #ifndef NULL
16939 #define NULL ((void*)0)
16940 #endif
16941
16942 int main() {
16943
16944 #if DB_VERSION_MAJOR > 1
16945         {
16946                 char *version;
16947                 int major, minor, patch;
16948
16949                 version = db_version( &major, &minor, &patch );
16950
16951                 if( major != DB_VERSION_MAJOR ||
16952                         minor < DB_VERSION_MINOR )
16953                 {
16954                         printf("Berkeley DB version mismatch\n"
16955                                 "\theader: %s\n\tlibrary: %s\n",
16956                                 DB_VERSION_STRING, version);
16957                         return 1;
16958                 }
16959         }
16960 #endif
16961
16962 #if DB_VERSION_MAJOR > 2
16963         db_env_create( NULL, 0 );
16964 #elif DB_VERSION_MAJOR > 1
16965         db_appexit( NULL );
16966 #else
16967         (void) dbopen( NULL, 0, 0, 0, NULL);
16968 #endif
16969
16970 ; return 0; }
16971 EOF
16972 if { (eval echo configure:16973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16973   rm -rf conftest*
16974   ol_cv_db_db_4_2=yes
16975 else
16976   echo "configure: failed program was:" >&5
16977   cat conftest.$ac_ext >&5
16978   rm -rf conftest*
16979   ol_cv_db_db_4_2=no
16980 fi
16981 rm -f conftest*
16982
16983         LIBS="$ol_LIBS"
16984
16985 fi
16986
16987 echo "$ac_t""$ol_cv_db_db_4_2" 1>&6
16988
16989         if test $ol_cv_db_db_4_2 = yes ; then
16990                 ol_cv_lib_db=-ldb-4-2
16991         fi
16992 fi
16993
16994 if test $ol_cv_lib_db = no ; then
16995         echo $ac_n "checking for Berkeley DB link (-ldb-4)""... $ac_c" 1>&6
16996 echo "configure:16997: checking for Berkeley DB link (-ldb-4)" >&5
16997 if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then
16998   echo $ac_n "(cached) $ac_c" 1>&6
16999 else
17000   
17001         ol_DB_LIB=-ldb-4
17002         ol_LIBS=$LIBS
17003         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17004
17005         cat > conftest.$ac_ext <<EOF
17006 #line 17007 "configure"
17007 #include "confdefs.h"
17008
17009 #ifdef HAVE_DB_185_H
17010 # include <db_185.h>
17011 #else
17012 # include <db.h>
17013 #endif
17014
17015 #ifndef DB_VERSION_MAJOR
17016 # define DB_VERSION_MAJOR 1
17017 #endif
17018
17019 #ifndef NULL
17020 #define NULL ((void*)0)
17021 #endif
17022
17023 int main() {
17024
17025 #if DB_VERSION_MAJOR > 1
17026         {
17027                 char *version;
17028                 int major, minor, patch;
17029
17030                 version = db_version( &major, &minor, &patch );
17031
17032                 if( major != DB_VERSION_MAJOR ||
17033                         minor < DB_VERSION_MINOR )
17034                 {
17035                         printf("Berkeley DB version mismatch\n"
17036                                 "\theader: %s\n\tlibrary: %s\n",
17037                                 DB_VERSION_STRING, version);
17038                         return 1;
17039                 }
17040         }
17041 #endif
17042
17043 #if DB_VERSION_MAJOR > 2
17044         db_env_create( NULL, 0 );
17045 #elif DB_VERSION_MAJOR > 1
17046         db_appexit( NULL );
17047 #else
17048         (void) dbopen( NULL, 0, 0, 0, NULL);
17049 #endif
17050
17051 ; return 0; }
17052 EOF
17053 if { (eval echo configure:17054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17054   rm -rf conftest*
17055   ol_cv_db_db_4=yes
17056 else
17057   echo "configure: failed program was:" >&5
17058   cat conftest.$ac_ext >&5
17059   rm -rf conftest*
17060   ol_cv_db_db_4=no
17061 fi
17062 rm -f conftest*
17063
17064         LIBS="$ol_LIBS"
17065
17066 fi
17067
17068 echo "$ac_t""$ol_cv_db_db_4" 1>&6
17069
17070         if test $ol_cv_db_db_4 = yes ; then
17071                 ol_cv_lib_db=-ldb-4
17072         fi
17073 fi
17074
17075 if test $ol_cv_lib_db = no ; then
17076         echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
17077 echo "configure:17078: checking for Berkeley DB link (-ldb4)" >&5
17078 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
17079   echo $ac_n "(cached) $ac_c" 1>&6
17080 else
17081   
17082         ol_DB_LIB=-ldb4
17083         ol_LIBS=$LIBS
17084         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17085
17086         cat > conftest.$ac_ext <<EOF
17087 #line 17088 "configure"
17088 #include "confdefs.h"
17089
17090 #ifdef HAVE_DB_185_H
17091 # include <db_185.h>
17092 #else
17093 # include <db.h>
17094 #endif
17095
17096 #ifndef DB_VERSION_MAJOR
17097 # define DB_VERSION_MAJOR 1
17098 #endif
17099
17100 #ifndef NULL
17101 #define NULL ((void*)0)
17102 #endif
17103
17104 int main() {
17105
17106 #if DB_VERSION_MAJOR > 1
17107         {
17108                 char *version;
17109                 int major, minor, patch;
17110
17111                 version = db_version( &major, &minor, &patch );
17112
17113                 if( major != DB_VERSION_MAJOR ||
17114                         minor < DB_VERSION_MINOR )
17115                 {
17116                         printf("Berkeley DB version mismatch\n"
17117                                 "\theader: %s\n\tlibrary: %s\n",
17118                                 DB_VERSION_STRING, version);
17119                         return 1;
17120                 }
17121         }
17122 #endif
17123
17124 #if DB_VERSION_MAJOR > 2
17125         db_env_create( NULL, 0 );
17126 #elif DB_VERSION_MAJOR > 1
17127         db_appexit( NULL );
17128 #else
17129         (void) dbopen( NULL, 0, 0, 0, NULL);
17130 #endif
17131
17132 ; return 0; }
17133 EOF
17134 if { (eval echo configure:17135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17135   rm -rf conftest*
17136   ol_cv_db_db4=yes
17137 else
17138   echo "configure: failed program was:" >&5
17139   cat conftest.$ac_ext >&5
17140   rm -rf conftest*
17141   ol_cv_db_db4=no
17142 fi
17143 rm -f conftest*
17144
17145         LIBS="$ol_LIBS"
17146
17147 fi
17148
17149 echo "$ac_t""$ol_cv_db_db4" 1>&6
17150
17151         if test $ol_cv_db_db4 = yes ; then
17152                 ol_cv_lib_db=-ldb4
17153         fi
17154 fi
17155
17156 if test $ol_cv_lib_db = no ; then
17157         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
17158 echo "configure:17159: checking for Berkeley DB link (-ldb)" >&5
17159 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
17160   echo $ac_n "(cached) $ac_c" 1>&6
17161 else
17162   
17163         ol_DB_LIB=-ldb
17164         ol_LIBS=$LIBS
17165         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17166
17167         cat > conftest.$ac_ext <<EOF
17168 #line 17169 "configure"
17169 #include "confdefs.h"
17170
17171 #ifdef HAVE_DB_185_H
17172 # include <db_185.h>
17173 #else
17174 # include <db.h>
17175 #endif
17176
17177 #ifndef DB_VERSION_MAJOR
17178 # define DB_VERSION_MAJOR 1
17179 #endif
17180
17181 #ifndef NULL
17182 #define NULL ((void*)0)
17183 #endif
17184
17185 int main() {
17186
17187 #if DB_VERSION_MAJOR > 1
17188         {
17189                 char *version;
17190                 int major, minor, patch;
17191
17192                 version = db_version( &major, &minor, &patch );
17193
17194                 if( major != DB_VERSION_MAJOR ||
17195                         minor < DB_VERSION_MINOR )
17196                 {
17197                         printf("Berkeley DB version mismatch\n"
17198                                 "\theader: %s\n\tlibrary: %s\n",
17199                                 DB_VERSION_STRING, version);
17200                         return 1;
17201                 }
17202         }
17203 #endif
17204
17205 #if DB_VERSION_MAJOR > 2
17206         db_env_create( NULL, 0 );
17207 #elif DB_VERSION_MAJOR > 1
17208         db_appexit( NULL );
17209 #else
17210         (void) dbopen( NULL, 0, 0, 0, NULL);
17211 #endif
17212
17213 ; return 0; }
17214 EOF
17215 if { (eval echo configure:17216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17216   rm -rf conftest*
17217   ol_cv_db_db=yes
17218 else
17219   echo "configure: failed program was:" >&5
17220   cat conftest.$ac_ext >&5
17221   rm -rf conftest*
17222   ol_cv_db_db=no
17223 fi
17224 rm -f conftest*
17225
17226         LIBS="$ol_LIBS"
17227
17228 fi
17229
17230 echo "$ac_t""$ol_cv_db_db" 1>&6
17231
17232         if test $ol_cv_db_db = yes ; then
17233                 ol_cv_lib_db=-ldb
17234         fi
17235 fi
17236
17237 if test $ol_cv_lib_db = no ; then
17238         echo $ac_n "checking for Berkeley DB link (-ldb41)""... $ac_c" 1>&6
17239 echo "configure:17240: checking for Berkeley DB link (-ldb41)" >&5
17240 if eval "test \"\${ol_cv_db_db41+set}\" = set"; then
17241   echo $ac_n "(cached) $ac_c" 1>&6
17242 else
17243   
17244         ol_DB_LIB=-ldb41
17245         ol_LIBS=$LIBS
17246         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17247
17248         cat > conftest.$ac_ext <<EOF
17249 #line 17250 "configure"
17250 #include "confdefs.h"
17251
17252 #ifdef HAVE_DB_185_H
17253 # include <db_185.h>
17254 #else
17255 # include <db.h>
17256 #endif
17257
17258 #ifndef DB_VERSION_MAJOR
17259 # define DB_VERSION_MAJOR 1
17260 #endif
17261
17262 #ifndef NULL
17263 #define NULL ((void*)0)
17264 #endif
17265
17266 int main() {
17267
17268 #if DB_VERSION_MAJOR > 1
17269         {
17270                 char *version;
17271                 int major, minor, patch;
17272
17273                 version = db_version( &major, &minor, &patch );
17274
17275                 if( major != DB_VERSION_MAJOR ||
17276                         minor < DB_VERSION_MINOR )
17277                 {
17278                         printf("Berkeley DB version mismatch\n"
17279                                 "\theader: %s\n\tlibrary: %s\n",
17280                                 DB_VERSION_STRING, version);
17281                         return 1;
17282                 }
17283         }
17284 #endif
17285
17286 #if DB_VERSION_MAJOR > 2
17287         db_env_create( NULL, 0 );
17288 #elif DB_VERSION_MAJOR > 1
17289         db_appexit( NULL );
17290 #else
17291         (void) dbopen( NULL, 0, 0, 0, NULL);
17292 #endif
17293
17294 ; return 0; }
17295 EOF
17296 if { (eval echo configure:17297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17297   rm -rf conftest*
17298   ol_cv_db_db41=yes
17299 else
17300   echo "configure: failed program was:" >&5
17301   cat conftest.$ac_ext >&5
17302   rm -rf conftest*
17303   ol_cv_db_db41=no
17304 fi
17305 rm -f conftest*
17306
17307         LIBS="$ol_LIBS"
17308
17309 fi
17310
17311 echo "$ac_t""$ol_cv_db_db41" 1>&6
17312
17313         if test $ol_cv_db_db41 = yes ; then
17314                 ol_cv_lib_db=-ldb41
17315         fi
17316 fi
17317
17318 if test $ol_cv_lib_db = no ; then
17319         echo $ac_n "checking for Berkeley DB link (-ldb-41)""... $ac_c" 1>&6
17320 echo "configure:17321: checking for Berkeley DB link (-ldb-41)" >&5
17321 if eval "test \"\${ol_cv_db_db_41+set}\" = set"; then
17322   echo $ac_n "(cached) $ac_c" 1>&6
17323 else
17324   
17325         ol_DB_LIB=-ldb-41
17326         ol_LIBS=$LIBS
17327         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17328
17329         cat > conftest.$ac_ext <<EOF
17330 #line 17331 "configure"
17331 #include "confdefs.h"
17332
17333 #ifdef HAVE_DB_185_H
17334 # include <db_185.h>
17335 #else
17336 # include <db.h>
17337 #endif
17338
17339 #ifndef DB_VERSION_MAJOR
17340 # define DB_VERSION_MAJOR 1
17341 #endif
17342
17343 #ifndef NULL
17344 #define NULL ((void*)0)
17345 #endif
17346
17347 int main() {
17348
17349 #if DB_VERSION_MAJOR > 1
17350         {
17351                 char *version;
17352                 int major, minor, patch;
17353
17354                 version = db_version( &major, &minor, &patch );
17355
17356                 if( major != DB_VERSION_MAJOR ||
17357                         minor < DB_VERSION_MINOR )
17358                 {
17359                         printf("Berkeley DB version mismatch\n"
17360                                 "\theader: %s\n\tlibrary: %s\n",
17361                                 DB_VERSION_STRING, version);
17362                         return 1;
17363                 }
17364         }
17365 #endif
17366
17367 #if DB_VERSION_MAJOR > 2
17368         db_env_create( NULL, 0 );
17369 #elif DB_VERSION_MAJOR > 1
17370         db_appexit( NULL );
17371 #else
17372         (void) dbopen( NULL, 0, 0, 0, NULL);
17373 #endif
17374
17375 ; return 0; }
17376 EOF
17377 if { (eval echo configure:17378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17378   rm -rf conftest*
17379   ol_cv_db_db_41=yes
17380 else
17381   echo "configure: failed program was:" >&5
17382   cat conftest.$ac_ext >&5
17383   rm -rf conftest*
17384   ol_cv_db_db_41=no
17385 fi
17386 rm -f conftest*
17387
17388         LIBS="$ol_LIBS"
17389
17390 fi
17391
17392 echo "$ac_t""$ol_cv_db_db_41" 1>&6
17393
17394         if test $ol_cv_db_db_41 = yes ; then
17395                 ol_cv_lib_db=-ldb-41
17396         fi
17397 fi
17398
17399 if test $ol_cv_lib_db = no ; then
17400         echo $ac_n "checking for Berkeley DB link (-ldb-4.1)""... $ac_c" 1>&6
17401 echo "configure:17402: checking for Berkeley DB link (-ldb-4.1)" >&5
17402 if eval "test \"\${ol_cv_db_db_4_dot_1+set}\" = set"; then
17403   echo $ac_n "(cached) $ac_c" 1>&6
17404 else
17405   
17406         ol_DB_LIB=-ldb-4.1
17407         ol_LIBS=$LIBS
17408         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17409
17410         cat > conftest.$ac_ext <<EOF
17411 #line 17412 "configure"
17412 #include "confdefs.h"
17413
17414 #ifdef HAVE_DB_185_H
17415 # include <db_185.h>
17416 #else
17417 # include <db.h>
17418 #endif
17419
17420 #ifndef DB_VERSION_MAJOR
17421 # define DB_VERSION_MAJOR 1
17422 #endif
17423
17424 #ifndef NULL
17425 #define NULL ((void*)0)
17426 #endif
17427
17428 int main() {
17429
17430 #if DB_VERSION_MAJOR > 1
17431         {
17432                 char *version;
17433                 int major, minor, patch;
17434
17435                 version = db_version( &major, &minor, &patch );
17436
17437                 if( major != DB_VERSION_MAJOR ||
17438                         minor < DB_VERSION_MINOR )
17439                 {
17440                         printf("Berkeley DB version mismatch\n"
17441                                 "\theader: %s\n\tlibrary: %s\n",
17442                                 DB_VERSION_STRING, version);
17443                         return 1;
17444                 }
17445         }
17446 #endif
17447
17448 #if DB_VERSION_MAJOR > 2
17449         db_env_create( NULL, 0 );
17450 #elif DB_VERSION_MAJOR > 1
17451         db_appexit( NULL );
17452 #else
17453         (void) dbopen( NULL, 0, 0, 0, NULL);
17454 #endif
17455
17456 ; return 0; }
17457 EOF
17458 if { (eval echo configure:17459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17459   rm -rf conftest*
17460   ol_cv_db_db_4_dot_1=yes
17461 else
17462   echo "configure: failed program was:" >&5
17463   cat conftest.$ac_ext >&5
17464   rm -rf conftest*
17465   ol_cv_db_db_4_dot_1=no
17466 fi
17467 rm -f conftest*
17468
17469         LIBS="$ol_LIBS"
17470
17471 fi
17472
17473 echo "$ac_t""$ol_cv_db_db_4_dot_1" 1>&6
17474
17475         if test $ol_cv_db_db_4_dot_1 = yes ; then
17476                 ol_cv_lib_db=-ldb-4.1
17477         fi
17478 fi
17479
17480 if test $ol_cv_lib_db = no ; then
17481         echo $ac_n "checking for Berkeley DB link (-ldb-4-1)""... $ac_c" 1>&6
17482 echo "configure:17483: checking for Berkeley DB link (-ldb-4-1)" >&5
17483 if eval "test \"\${ol_cv_db_db_4_1+set}\" = set"; then
17484   echo $ac_n "(cached) $ac_c" 1>&6
17485 else
17486   
17487         ol_DB_LIB=-ldb-4-1
17488         ol_LIBS=$LIBS
17489         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17490
17491         cat > conftest.$ac_ext <<EOF
17492 #line 17493 "configure"
17493 #include "confdefs.h"
17494
17495 #ifdef HAVE_DB_185_H
17496 # include <db_185.h>
17497 #else
17498 # include <db.h>
17499 #endif
17500
17501 #ifndef DB_VERSION_MAJOR
17502 # define DB_VERSION_MAJOR 1
17503 #endif
17504
17505 #ifndef NULL
17506 #define NULL ((void*)0)
17507 #endif
17508
17509 int main() {
17510
17511 #if DB_VERSION_MAJOR > 1
17512         {
17513                 char *version;
17514                 int major, minor, patch;
17515
17516                 version = db_version( &major, &minor, &patch );
17517
17518                 if( major != DB_VERSION_MAJOR ||
17519                         minor < DB_VERSION_MINOR )
17520                 {
17521                         printf("Berkeley DB version mismatch\n"
17522                                 "\theader: %s\n\tlibrary: %s\n",
17523                                 DB_VERSION_STRING, version);
17524                         return 1;
17525                 }
17526         }
17527 #endif
17528
17529 #if DB_VERSION_MAJOR > 2
17530         db_env_create( NULL, 0 );
17531 #elif DB_VERSION_MAJOR > 1
17532         db_appexit( NULL );
17533 #else
17534         (void) dbopen( NULL, 0, 0, 0, NULL);
17535 #endif
17536
17537 ; return 0; }
17538 EOF
17539 if { (eval echo configure:17540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17540   rm -rf conftest*
17541   ol_cv_db_db_4_1=yes
17542 else
17543   echo "configure: failed program was:" >&5
17544   cat conftest.$ac_ext >&5
17545   rm -rf conftest*
17546   ol_cv_db_db_4_1=no
17547 fi
17548 rm -f conftest*
17549
17550         LIBS="$ol_LIBS"
17551
17552 fi
17553
17554 echo "$ac_t""$ol_cv_db_db_4_1" 1>&6
17555
17556         if test $ol_cv_db_db_4_1 = yes ; then
17557                 ol_cv_lib_db=-ldb-4-1
17558         fi
17559 fi
17560
17561 if test $ol_cv_lib_db = no ; then
17562         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
17563 echo "configure:17564: checking for Berkeley DB link (-ldb3)" >&5
17564 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
17565   echo $ac_n "(cached) $ac_c" 1>&6
17566 else
17567   
17568         ol_DB_LIB=-ldb3
17569         ol_LIBS=$LIBS
17570         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17571
17572         cat > conftest.$ac_ext <<EOF
17573 #line 17574 "configure"
17574 #include "confdefs.h"
17575
17576 #ifdef HAVE_DB_185_H
17577 # include <db_185.h>
17578 #else
17579 # include <db.h>
17580 #endif
17581
17582 #ifndef DB_VERSION_MAJOR
17583 # define DB_VERSION_MAJOR 1
17584 #endif
17585
17586 #ifndef NULL
17587 #define NULL ((void*)0)
17588 #endif
17589
17590 int main() {
17591
17592 #if DB_VERSION_MAJOR > 1
17593         {
17594                 char *version;
17595                 int major, minor, patch;
17596
17597                 version = db_version( &major, &minor, &patch );
17598
17599                 if( major != DB_VERSION_MAJOR ||
17600                         minor < DB_VERSION_MINOR )
17601                 {
17602                         printf("Berkeley DB version mismatch\n"
17603                                 "\theader: %s\n\tlibrary: %s\n",
17604                                 DB_VERSION_STRING, version);
17605                         return 1;
17606                 }
17607         }
17608 #endif
17609
17610 #if DB_VERSION_MAJOR > 2
17611         db_env_create( NULL, 0 );
17612 #elif DB_VERSION_MAJOR > 1
17613         db_appexit( NULL );
17614 #else
17615         (void) dbopen( NULL, 0, 0, 0, NULL);
17616 #endif
17617
17618 ; return 0; }
17619 EOF
17620 if { (eval echo configure:17621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17621   rm -rf conftest*
17622   ol_cv_db_db3=yes
17623 else
17624   echo "configure: failed program was:" >&5
17625   cat conftest.$ac_ext >&5
17626   rm -rf conftest*
17627   ol_cv_db_db3=no
17628 fi
17629 rm -f conftest*
17630
17631         LIBS="$ol_LIBS"
17632
17633 fi
17634
17635 echo "$ac_t""$ol_cv_db_db3" 1>&6
17636
17637         if test $ol_cv_db_db3 = yes ; then
17638                 ol_cv_lib_db=-ldb3
17639         fi
17640 fi
17641
17642 if test $ol_cv_lib_db = no ; then
17643         echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6
17644 echo "configure:17645: checking for Berkeley DB link (-ldb-3)" >&5
17645 if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then
17646   echo $ac_n "(cached) $ac_c" 1>&6
17647 else
17648   
17649         ol_DB_LIB=-ldb-3
17650         ol_LIBS=$LIBS
17651         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17652
17653         cat > conftest.$ac_ext <<EOF
17654 #line 17655 "configure"
17655 #include "confdefs.h"
17656
17657 #ifdef HAVE_DB_185_H
17658 # include <db_185.h>
17659 #else
17660 # include <db.h>
17661 #endif
17662
17663 #ifndef DB_VERSION_MAJOR
17664 # define DB_VERSION_MAJOR 1
17665 #endif
17666
17667 #ifndef NULL
17668 #define NULL ((void*)0)
17669 #endif
17670
17671 int main() {
17672
17673 #if DB_VERSION_MAJOR > 1
17674         {
17675                 char *version;
17676                 int major, minor, patch;
17677
17678                 version = db_version( &major, &minor, &patch );
17679
17680                 if( major != DB_VERSION_MAJOR ||
17681                         minor < DB_VERSION_MINOR )
17682                 {
17683                         printf("Berkeley DB version mismatch\n"
17684                                 "\theader: %s\n\tlibrary: %s\n",
17685                                 DB_VERSION_STRING, version);
17686                         return 1;
17687                 }
17688         }
17689 #endif
17690
17691 #if DB_VERSION_MAJOR > 2
17692         db_env_create( NULL, 0 );
17693 #elif DB_VERSION_MAJOR > 1
17694         db_appexit( NULL );
17695 #else
17696         (void) dbopen( NULL, 0, 0, 0, NULL);
17697 #endif
17698
17699 ; return 0; }
17700 EOF
17701 if { (eval echo configure:17702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17702   rm -rf conftest*
17703   ol_cv_db_db_3=yes
17704 else
17705   echo "configure: failed program was:" >&5
17706   cat conftest.$ac_ext >&5
17707   rm -rf conftest*
17708   ol_cv_db_db_3=no
17709 fi
17710 rm -f conftest*
17711
17712         LIBS="$ol_LIBS"
17713
17714 fi
17715
17716 echo "$ac_t""$ol_cv_db_db_3" 1>&6
17717
17718         if test $ol_cv_db_db_3 = yes ; then
17719                 ol_cv_lib_db=-ldb-3
17720         fi
17721 fi
17722
17723 if test $ol_cv_lib_db = no ; then
17724         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
17725 echo "configure:17726: checking for Berkeley DB link (-ldb2)" >&5
17726 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
17727   echo $ac_n "(cached) $ac_c" 1>&6
17728 else
17729   
17730         ol_DB_LIB=-ldb2
17731         ol_LIBS=$LIBS
17732         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17733
17734         cat > conftest.$ac_ext <<EOF
17735 #line 17736 "configure"
17736 #include "confdefs.h"
17737
17738 #ifdef HAVE_DB_185_H
17739 # include <db_185.h>
17740 #else
17741 # include <db.h>
17742 #endif
17743
17744 #ifndef DB_VERSION_MAJOR
17745 # define DB_VERSION_MAJOR 1
17746 #endif
17747
17748 #ifndef NULL
17749 #define NULL ((void*)0)
17750 #endif
17751
17752 int main() {
17753
17754 #if DB_VERSION_MAJOR > 1
17755         {
17756                 char *version;
17757                 int major, minor, patch;
17758
17759                 version = db_version( &major, &minor, &patch );
17760
17761                 if( major != DB_VERSION_MAJOR ||
17762                         minor < DB_VERSION_MINOR )
17763                 {
17764                         printf("Berkeley DB version mismatch\n"
17765                                 "\theader: %s\n\tlibrary: %s\n",
17766                                 DB_VERSION_STRING, version);
17767                         return 1;
17768                 }
17769         }
17770 #endif
17771
17772 #if DB_VERSION_MAJOR > 2
17773         db_env_create( NULL, 0 );
17774 #elif DB_VERSION_MAJOR > 1
17775         db_appexit( NULL );
17776 #else
17777         (void) dbopen( NULL, 0, 0, 0, NULL);
17778 #endif
17779
17780 ; return 0; }
17781 EOF
17782 if { (eval echo configure:17783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17783   rm -rf conftest*
17784   ol_cv_db_db2=yes
17785 else
17786   echo "configure: failed program was:" >&5
17787   cat conftest.$ac_ext >&5
17788   rm -rf conftest*
17789   ol_cv_db_db2=no
17790 fi
17791 rm -f conftest*
17792
17793         LIBS="$ol_LIBS"
17794
17795 fi
17796
17797 echo "$ac_t""$ol_cv_db_db2" 1>&6
17798
17799         if test $ol_cv_db_db2 = yes ; then
17800                 ol_cv_lib_db=-ldb2
17801         fi
17802 fi
17803
17804 if test $ol_cv_lib_db = no ; then
17805         echo $ac_n "checking for Berkeley DB link (-ldb-2)""... $ac_c" 1>&6
17806 echo "configure:17807: checking for Berkeley DB link (-ldb-2)" >&5
17807 if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then
17808   echo $ac_n "(cached) $ac_c" 1>&6
17809 else
17810   
17811         ol_DB_LIB=-ldb-2
17812         ol_LIBS=$LIBS
17813         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17814
17815         cat > conftest.$ac_ext <<EOF
17816 #line 17817 "configure"
17817 #include "confdefs.h"
17818
17819 #ifdef HAVE_DB_185_H
17820 # include <db_185.h>
17821 #else
17822 # include <db.h>
17823 #endif
17824
17825 #ifndef DB_VERSION_MAJOR
17826 # define DB_VERSION_MAJOR 1
17827 #endif
17828
17829 #ifndef NULL
17830 #define NULL ((void*)0)
17831 #endif
17832
17833 int main() {
17834
17835 #if DB_VERSION_MAJOR > 1
17836         {
17837                 char *version;
17838                 int major, minor, patch;
17839
17840                 version = db_version( &major, &minor, &patch );
17841
17842                 if( major != DB_VERSION_MAJOR ||
17843                         minor < DB_VERSION_MINOR )
17844                 {
17845                         printf("Berkeley DB version mismatch\n"
17846                                 "\theader: %s\n\tlibrary: %s\n",
17847                                 DB_VERSION_STRING, version);
17848                         return 1;
17849                 }
17850         }
17851 #endif
17852
17853 #if DB_VERSION_MAJOR > 2
17854         db_env_create( NULL, 0 );
17855 #elif DB_VERSION_MAJOR > 1
17856         db_appexit( NULL );
17857 #else
17858         (void) dbopen( NULL, 0, 0, 0, NULL);
17859 #endif
17860
17861 ; return 0; }
17862 EOF
17863 if { (eval echo configure:17864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17864   rm -rf conftest*
17865   ol_cv_db_db_2=yes
17866 else
17867   echo "configure: failed program was:" >&5
17868   cat conftest.$ac_ext >&5
17869   rm -rf conftest*
17870   ol_cv_db_db_2=no
17871 fi
17872 rm -f conftest*
17873
17874         LIBS="$ol_LIBS"
17875
17876 fi
17877
17878 echo "$ac_t""$ol_cv_db_db_2" 1>&6
17879
17880         if test $ol_cv_db_db_2 = yes ; then
17881                 ol_cv_lib_db=-ldb-2
17882         fi
17883 fi
17884
17885 if test $ol_cv_lib_db = no ; then
17886         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
17887 echo "configure:17888: checking for Berkeley DB link (-ldb1)" >&5
17888 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
17889   echo $ac_n "(cached) $ac_c" 1>&6
17890 else
17891   
17892         ol_DB_LIB=-ldb1
17893         ol_LIBS=$LIBS
17894         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17895
17896         cat > conftest.$ac_ext <<EOF
17897 #line 17898 "configure"
17898 #include "confdefs.h"
17899
17900 #ifdef HAVE_DB_185_H
17901 # include <db_185.h>
17902 #else
17903 # include <db.h>
17904 #endif
17905
17906 #ifndef DB_VERSION_MAJOR
17907 # define DB_VERSION_MAJOR 1
17908 #endif
17909
17910 #ifndef NULL
17911 #define NULL ((void*)0)
17912 #endif
17913
17914 int main() {
17915
17916 #if DB_VERSION_MAJOR > 1
17917         {
17918                 char *version;
17919                 int major, minor, patch;
17920
17921                 version = db_version( &major, &minor, &patch );
17922
17923                 if( major != DB_VERSION_MAJOR ||
17924                         minor < DB_VERSION_MINOR )
17925                 {
17926                         printf("Berkeley DB version mismatch\n"
17927                                 "\theader: %s\n\tlibrary: %s\n",
17928                                 DB_VERSION_STRING, version);
17929                         return 1;
17930                 }
17931         }
17932 #endif
17933
17934 #if DB_VERSION_MAJOR > 2
17935         db_env_create( NULL, 0 );
17936 #elif DB_VERSION_MAJOR > 1
17937         db_appexit( NULL );
17938 #else
17939         (void) dbopen( NULL, 0, 0, 0, NULL);
17940 #endif
17941
17942 ; return 0; }
17943 EOF
17944 if { (eval echo configure:17945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17945   rm -rf conftest*
17946   ol_cv_db_db1=yes
17947 else
17948   echo "configure: failed program was:" >&5
17949   cat conftest.$ac_ext >&5
17950   rm -rf conftest*
17951   ol_cv_db_db1=no
17952 fi
17953 rm -f conftest*
17954
17955         LIBS="$ol_LIBS"
17956
17957 fi
17958
17959 echo "$ac_t""$ol_cv_db_db1" 1>&6
17960
17961         if test $ol_cv_db_db1 = yes ; then
17962                 ol_cv_lib_db=-ldb1
17963         fi
17964 fi
17965
17966 if test $ol_cv_lib_db = no ; then
17967         echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6
17968 echo "configure:17969: checking for Berkeley DB link (-ldb-1)" >&5
17969 if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then
17970   echo $ac_n "(cached) $ac_c" 1>&6
17971 else
17972   
17973         ol_DB_LIB=-ldb-1
17974         ol_LIBS=$LIBS
17975         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17976
17977         cat > conftest.$ac_ext <<EOF
17978 #line 17979 "configure"
17979 #include "confdefs.h"
17980
17981 #ifdef HAVE_DB_185_H
17982 # include <db_185.h>
17983 #else
17984 # include <db.h>
17985 #endif
17986
17987 #ifndef DB_VERSION_MAJOR
17988 # define DB_VERSION_MAJOR 1
17989 #endif
17990
17991 #ifndef NULL
17992 #define NULL ((void*)0)
17993 #endif
17994
17995 int main() {
17996
17997 #if DB_VERSION_MAJOR > 1
17998         {
17999                 char *version;
18000                 int major, minor, patch;
18001
18002                 version = db_version( &major, &minor, &patch );
18003
18004                 if( major != DB_VERSION_MAJOR ||
18005                         minor < DB_VERSION_MINOR )
18006                 {
18007                         printf("Berkeley DB version mismatch\n"
18008                                 "\theader: %s\n\tlibrary: %s\n",
18009                                 DB_VERSION_STRING, version);
18010                         return 1;
18011                 }
18012         }
18013 #endif
18014
18015 #if DB_VERSION_MAJOR > 2
18016         db_env_create( NULL, 0 );
18017 #elif DB_VERSION_MAJOR > 1
18018         db_appexit( NULL );
18019 #else
18020         (void) dbopen( NULL, 0, 0, 0, NULL);
18021 #endif
18022
18023 ; return 0; }
18024 EOF
18025 if { (eval echo configure:18026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18026   rm -rf conftest*
18027   ol_cv_db_db_1=yes
18028 else
18029   echo "configure: failed program was:" >&5
18030   cat conftest.$ac_ext >&5
18031   rm -rf conftest*
18032   ol_cv_db_db_1=no
18033 fi
18034 rm -f conftest*
18035
18036         LIBS="$ol_LIBS"
18037
18038 fi
18039
18040 echo "$ac_t""$ol_cv_db_db_1" 1>&6
18041
18042         if test $ol_cv_db_db_1 = yes ; then
18043                 ol_cv_lib_db=-ldb-1
18044         fi
18045 fi
18046
18047
18048                 if test "$ol_cv_lib_db" != no ; then
18049                         ol_cv_berkeley_db=yes
18050                 fi
18051         fi
18052 fi
18053
18054         else
18055                 ol_cv_berkeley_db=no
18056 for ac_hdr in db.h
18057 do
18058 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
18059 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
18060 echo "configure:18061: checking for $ac_hdr" >&5
18061 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
18062   echo $ac_n "(cached) $ac_c" 1>&6
18063 else
18064   cat > conftest.$ac_ext <<EOF
18065 #line 18066 "configure"
18066 #include "confdefs.h"
18067 #include <$ac_hdr>
18068 EOF
18069 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
18070 { (eval echo configure:18071: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
18071 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
18072 if test -z "$ac_err"; then
18073   rm -rf conftest*
18074   eval "ac_cv_header_$ac_safe=yes"
18075 else
18076   echo "$ac_err" >&5
18077   echo "configure: failed program was:" >&5
18078   cat conftest.$ac_ext >&5
18079   rm -rf conftest*
18080   eval "ac_cv_header_$ac_safe=no"
18081 fi
18082 rm -f conftest*
18083 fi
18084 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
18085   echo "$ac_t""yes" 1>&6
18086     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
18087   cat >> confdefs.h <<EOF
18088 #define $ac_tr_hdr 1
18089 EOF
18090  
18091 else
18092   echo "$ac_t""no" 1>&6
18093 fi
18094 done
18095
18096 if test $ac_cv_header_db_h = yes; then
18097         ol_cv_lib_db=no
18098 if test $ol_cv_lib_db = no ; then
18099         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
18100 echo "configure:18101: checking for Berkeley DB link (default)" >&5
18101 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
18102   echo $ac_n "(cached) $ac_c" 1>&6
18103 else
18104   
18105         ol_DB_LIB=
18106         ol_LIBS=$LIBS
18107         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18108
18109         cat > conftest.$ac_ext <<EOF
18110 #line 18111 "configure"
18111 #include "confdefs.h"
18112
18113 #ifdef HAVE_DB_185_H
18114 # include <db_185.h>
18115 #else
18116 # include <db.h>
18117 #endif
18118
18119 #ifndef DB_VERSION_MAJOR
18120 # define DB_VERSION_MAJOR 1
18121 #endif
18122
18123 #ifndef NULL
18124 #define NULL ((void*)0)
18125 #endif
18126
18127 int main() {
18128
18129 #if DB_VERSION_MAJOR > 1
18130         {
18131                 char *version;
18132                 int major, minor, patch;
18133
18134                 version = db_version( &major, &minor, &patch );
18135
18136                 if( major != DB_VERSION_MAJOR ||
18137                         minor < DB_VERSION_MINOR )
18138                 {
18139                         printf("Berkeley DB version mismatch\n"
18140                                 "\theader: %s\n\tlibrary: %s\n",
18141                                 DB_VERSION_STRING, version);
18142                         return 1;
18143                 }
18144         }
18145 #endif
18146
18147 #if DB_VERSION_MAJOR > 2
18148         db_env_create( NULL, 0 );
18149 #elif DB_VERSION_MAJOR > 1
18150         db_appexit( NULL );
18151 #else
18152         (void) dbopen( NULL, 0, 0, 0, NULL);
18153 #endif
18154
18155 ; return 0; }
18156 EOF
18157 if { (eval echo configure:18158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18158   rm -rf conftest*
18159   ol_cv_db_none=yes
18160 else
18161   echo "configure: failed program was:" >&5
18162   cat conftest.$ac_ext >&5
18163   rm -rf conftest*
18164   ol_cv_db_none=no
18165 fi
18166 rm -f conftest*
18167
18168         LIBS="$ol_LIBS"
18169
18170 fi
18171
18172 echo "$ac_t""$ol_cv_db_none" 1>&6
18173
18174         if test $ol_cv_db_none = yes ; then
18175                 ol_cv_lib_db=yes
18176         fi
18177 fi
18178
18179 if test $ol_cv_lib_db = no ; then
18180         echo $ac_n "checking for Berkeley DB link (-ldb43)""... $ac_c" 1>&6
18181 echo "configure:18182: checking for Berkeley DB link (-ldb43)" >&5
18182 if eval "test \"\${ol_cv_db_db43+set}\" = set"; then
18183   echo $ac_n "(cached) $ac_c" 1>&6
18184 else
18185   
18186         ol_DB_LIB=-ldb43
18187         ol_LIBS=$LIBS
18188         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18189
18190         cat > conftest.$ac_ext <<EOF
18191 #line 18192 "configure"
18192 #include "confdefs.h"
18193
18194 #ifdef HAVE_DB_185_H
18195 # include <db_185.h>
18196 #else
18197 # include <db.h>
18198 #endif
18199
18200 #ifndef DB_VERSION_MAJOR
18201 # define DB_VERSION_MAJOR 1
18202 #endif
18203
18204 #ifndef NULL
18205 #define NULL ((void*)0)
18206 #endif
18207
18208 int main() {
18209
18210 #if DB_VERSION_MAJOR > 1
18211         {
18212                 char *version;
18213                 int major, minor, patch;
18214
18215                 version = db_version( &major, &minor, &patch );
18216
18217                 if( major != DB_VERSION_MAJOR ||
18218                         minor < DB_VERSION_MINOR )
18219                 {
18220                         printf("Berkeley DB version mismatch\n"
18221                                 "\theader: %s\n\tlibrary: %s\n",
18222                                 DB_VERSION_STRING, version);
18223                         return 1;
18224                 }
18225         }
18226 #endif
18227
18228 #if DB_VERSION_MAJOR > 2
18229         db_env_create( NULL, 0 );
18230 #elif DB_VERSION_MAJOR > 1
18231         db_appexit( NULL );
18232 #else
18233         (void) dbopen( NULL, 0, 0, 0, NULL);
18234 #endif
18235
18236 ; return 0; }
18237 EOF
18238 if { (eval echo configure:18239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18239   rm -rf conftest*
18240   ol_cv_db_db43=yes
18241 else
18242   echo "configure: failed program was:" >&5
18243   cat conftest.$ac_ext >&5
18244   rm -rf conftest*
18245   ol_cv_db_db43=no
18246 fi
18247 rm -f conftest*
18248
18249         LIBS="$ol_LIBS"
18250
18251 fi
18252
18253 echo "$ac_t""$ol_cv_db_db43" 1>&6
18254
18255         if test $ol_cv_db_db43 = yes ; then
18256                 ol_cv_lib_db=-ldb43
18257         fi
18258 fi
18259
18260 if test $ol_cv_lib_db = no ; then
18261         echo $ac_n "checking for Berkeley DB link (-ldb-43)""... $ac_c" 1>&6
18262 echo "configure:18263: checking for Berkeley DB link (-ldb-43)" >&5
18263 if eval "test \"\${ol_cv_db_db_43+set}\" = set"; then
18264   echo $ac_n "(cached) $ac_c" 1>&6
18265 else
18266   
18267         ol_DB_LIB=-ldb-43
18268         ol_LIBS=$LIBS
18269         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18270
18271         cat > conftest.$ac_ext <<EOF
18272 #line 18273 "configure"
18273 #include "confdefs.h"
18274
18275 #ifdef HAVE_DB_185_H
18276 # include <db_185.h>
18277 #else
18278 # include <db.h>
18279 #endif
18280
18281 #ifndef DB_VERSION_MAJOR
18282 # define DB_VERSION_MAJOR 1
18283 #endif
18284
18285 #ifndef NULL
18286 #define NULL ((void*)0)
18287 #endif
18288
18289 int main() {
18290
18291 #if DB_VERSION_MAJOR > 1
18292         {
18293                 char *version;
18294                 int major, minor, patch;
18295
18296                 version = db_version( &major, &minor, &patch );
18297
18298                 if( major != DB_VERSION_MAJOR ||
18299                         minor < DB_VERSION_MINOR )
18300                 {
18301                         printf("Berkeley DB version mismatch\n"
18302                                 "\theader: %s\n\tlibrary: %s\n",
18303                                 DB_VERSION_STRING, version);
18304                         return 1;
18305                 }
18306         }
18307 #endif
18308
18309 #if DB_VERSION_MAJOR > 2
18310         db_env_create( NULL, 0 );
18311 #elif DB_VERSION_MAJOR > 1
18312         db_appexit( NULL );
18313 #else
18314         (void) dbopen( NULL, 0, 0, 0, NULL);
18315 #endif
18316
18317 ; return 0; }
18318 EOF
18319 if { (eval echo configure:18320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18320   rm -rf conftest*
18321   ol_cv_db_db_43=yes
18322 else
18323   echo "configure: failed program was:" >&5
18324   cat conftest.$ac_ext >&5
18325   rm -rf conftest*
18326   ol_cv_db_db_43=no
18327 fi
18328 rm -f conftest*
18329
18330         LIBS="$ol_LIBS"
18331
18332 fi
18333
18334 echo "$ac_t""$ol_cv_db_db_43" 1>&6
18335
18336         if test $ol_cv_db_db_43 = yes ; then
18337                 ol_cv_lib_db=-ldb-43
18338         fi
18339 fi
18340
18341 if test $ol_cv_lib_db = no ; then
18342         echo $ac_n "checking for Berkeley DB link (-ldb-4.3)""... $ac_c" 1>&6
18343 echo "configure:18344: checking for Berkeley DB link (-ldb-4.3)" >&5
18344 if eval "test \"\${ol_cv_db_db_4_dot_3+set}\" = set"; then
18345   echo $ac_n "(cached) $ac_c" 1>&6
18346 else
18347   
18348         ol_DB_LIB=-ldb-4.3
18349         ol_LIBS=$LIBS
18350         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18351
18352         cat > conftest.$ac_ext <<EOF
18353 #line 18354 "configure"
18354 #include "confdefs.h"
18355
18356 #ifdef HAVE_DB_185_H
18357 # include <db_185.h>
18358 #else
18359 # include <db.h>
18360 #endif
18361
18362 #ifndef DB_VERSION_MAJOR
18363 # define DB_VERSION_MAJOR 1
18364 #endif
18365
18366 #ifndef NULL
18367 #define NULL ((void*)0)
18368 #endif
18369
18370 int main() {
18371
18372 #if DB_VERSION_MAJOR > 1
18373         {
18374                 char *version;
18375                 int major, minor, patch;
18376
18377                 version = db_version( &major, &minor, &patch );
18378
18379                 if( major != DB_VERSION_MAJOR ||
18380                         minor < DB_VERSION_MINOR )
18381                 {
18382                         printf("Berkeley DB version mismatch\n"
18383                                 "\theader: %s\n\tlibrary: %s\n",
18384                                 DB_VERSION_STRING, version);
18385                         return 1;
18386                 }
18387         }
18388 #endif
18389
18390 #if DB_VERSION_MAJOR > 2
18391         db_env_create( NULL, 0 );
18392 #elif DB_VERSION_MAJOR > 1
18393         db_appexit( NULL );
18394 #else
18395         (void) dbopen( NULL, 0, 0, 0, NULL);
18396 #endif
18397
18398 ; return 0; }
18399 EOF
18400 if { (eval echo configure:18401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18401   rm -rf conftest*
18402   ol_cv_db_db_4_dot_3=yes
18403 else
18404   echo "configure: failed program was:" >&5
18405   cat conftest.$ac_ext >&5
18406   rm -rf conftest*
18407   ol_cv_db_db_4_dot_3=no
18408 fi
18409 rm -f conftest*
18410
18411         LIBS="$ol_LIBS"
18412
18413 fi
18414
18415 echo "$ac_t""$ol_cv_db_db_4_dot_3" 1>&6
18416
18417         if test $ol_cv_db_db_4_dot_3 = yes ; then
18418                 ol_cv_lib_db=-ldb-4.3
18419         fi
18420 fi
18421
18422 if test $ol_cv_lib_db = no ; then
18423         echo $ac_n "checking for Berkeley DB link (-ldb-4-3)""... $ac_c" 1>&6
18424 echo "configure:18425: checking for Berkeley DB link (-ldb-4-3)" >&5
18425 if eval "test \"\${ol_cv_db_db_4_3+set}\" = set"; then
18426   echo $ac_n "(cached) $ac_c" 1>&6
18427 else
18428   
18429         ol_DB_LIB=-ldb-4-3
18430         ol_LIBS=$LIBS
18431         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18432
18433         cat > conftest.$ac_ext <<EOF
18434 #line 18435 "configure"
18435 #include "confdefs.h"
18436
18437 #ifdef HAVE_DB_185_H
18438 # include <db_185.h>
18439 #else
18440 # include <db.h>
18441 #endif
18442
18443 #ifndef DB_VERSION_MAJOR
18444 # define DB_VERSION_MAJOR 1
18445 #endif
18446
18447 #ifndef NULL
18448 #define NULL ((void*)0)
18449 #endif
18450
18451 int main() {
18452
18453 #if DB_VERSION_MAJOR > 1
18454         {
18455                 char *version;
18456                 int major, minor, patch;
18457
18458                 version = db_version( &major, &minor, &patch );
18459
18460                 if( major != DB_VERSION_MAJOR ||
18461                         minor < DB_VERSION_MINOR )
18462                 {
18463                         printf("Berkeley DB version mismatch\n"
18464                                 "\theader: %s\n\tlibrary: %s\n",
18465                                 DB_VERSION_STRING, version);
18466                         return 1;
18467                 }
18468         }
18469 #endif
18470
18471 #if DB_VERSION_MAJOR > 2
18472         db_env_create( NULL, 0 );
18473 #elif DB_VERSION_MAJOR > 1
18474         db_appexit( NULL );
18475 #else
18476         (void) dbopen( NULL, 0, 0, 0, NULL);
18477 #endif
18478
18479 ; return 0; }
18480 EOF
18481 if { (eval echo configure:18482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18482   rm -rf conftest*
18483   ol_cv_db_db_4_3=yes
18484 else
18485   echo "configure: failed program was:" >&5
18486   cat conftest.$ac_ext >&5
18487   rm -rf conftest*
18488   ol_cv_db_db_4_3=no
18489 fi
18490 rm -f conftest*
18491
18492         LIBS="$ol_LIBS"
18493
18494 fi
18495
18496 echo "$ac_t""$ol_cv_db_db_4_3" 1>&6
18497
18498         if test $ol_cv_db_db_4_3 = yes ; then
18499                 ol_cv_lib_db=-ldb-4-3
18500         fi
18501 fi
18502
18503 if test $ol_cv_lib_db = no ; then
18504         echo $ac_n "checking for Berkeley DB link (-ldb42)""... $ac_c" 1>&6
18505 echo "configure:18506: checking for Berkeley DB link (-ldb42)" >&5
18506 if eval "test \"\${ol_cv_db_db42+set}\" = set"; then
18507   echo $ac_n "(cached) $ac_c" 1>&6
18508 else
18509   
18510         ol_DB_LIB=-ldb42
18511         ol_LIBS=$LIBS
18512         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18513
18514         cat > conftest.$ac_ext <<EOF
18515 #line 18516 "configure"
18516 #include "confdefs.h"
18517
18518 #ifdef HAVE_DB_185_H
18519 # include <db_185.h>
18520 #else
18521 # include <db.h>
18522 #endif
18523
18524 #ifndef DB_VERSION_MAJOR
18525 # define DB_VERSION_MAJOR 1
18526 #endif
18527
18528 #ifndef NULL
18529 #define NULL ((void*)0)
18530 #endif
18531
18532 int main() {
18533
18534 #if DB_VERSION_MAJOR > 1
18535         {
18536                 char *version;
18537                 int major, minor, patch;
18538
18539                 version = db_version( &major, &minor, &patch );
18540
18541                 if( major != DB_VERSION_MAJOR ||
18542                         minor < DB_VERSION_MINOR )
18543                 {
18544                         printf("Berkeley DB version mismatch\n"
18545                                 "\theader: %s\n\tlibrary: %s\n",
18546                                 DB_VERSION_STRING, version);
18547                         return 1;
18548                 }
18549         }
18550 #endif
18551
18552 #if DB_VERSION_MAJOR > 2
18553         db_env_create( NULL, 0 );
18554 #elif DB_VERSION_MAJOR > 1
18555         db_appexit( NULL );
18556 #else
18557         (void) dbopen( NULL, 0, 0, 0, NULL);
18558 #endif
18559
18560 ; return 0; }
18561 EOF
18562 if { (eval echo configure:18563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18563   rm -rf conftest*
18564   ol_cv_db_db42=yes
18565 else
18566   echo "configure: failed program was:" >&5
18567   cat conftest.$ac_ext >&5
18568   rm -rf conftest*
18569   ol_cv_db_db42=no
18570 fi
18571 rm -f conftest*
18572
18573         LIBS="$ol_LIBS"
18574
18575 fi
18576
18577 echo "$ac_t""$ol_cv_db_db42" 1>&6
18578
18579         if test $ol_cv_db_db42 = yes ; then
18580                 ol_cv_lib_db=-ldb42
18581         fi
18582 fi
18583
18584 if test $ol_cv_lib_db = no ; then
18585         echo $ac_n "checking for Berkeley DB link (-ldb-42)""... $ac_c" 1>&6
18586 echo "configure:18587: checking for Berkeley DB link (-ldb-42)" >&5
18587 if eval "test \"\${ol_cv_db_db_42+set}\" = set"; then
18588   echo $ac_n "(cached) $ac_c" 1>&6
18589 else
18590   
18591         ol_DB_LIB=-ldb-42
18592         ol_LIBS=$LIBS
18593         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18594
18595         cat > conftest.$ac_ext <<EOF
18596 #line 18597 "configure"
18597 #include "confdefs.h"
18598
18599 #ifdef HAVE_DB_185_H
18600 # include <db_185.h>
18601 #else
18602 # include <db.h>
18603 #endif
18604
18605 #ifndef DB_VERSION_MAJOR
18606 # define DB_VERSION_MAJOR 1
18607 #endif
18608
18609 #ifndef NULL
18610 #define NULL ((void*)0)
18611 #endif
18612
18613 int main() {
18614
18615 #if DB_VERSION_MAJOR > 1
18616         {
18617                 char *version;
18618                 int major, minor, patch;
18619
18620                 version = db_version( &major, &minor, &patch );
18621
18622                 if( major != DB_VERSION_MAJOR ||
18623                         minor < DB_VERSION_MINOR )
18624                 {
18625                         printf("Berkeley DB version mismatch\n"
18626                                 "\theader: %s\n\tlibrary: %s\n",
18627                                 DB_VERSION_STRING, version);
18628                         return 1;
18629                 }
18630         }
18631 #endif
18632
18633 #if DB_VERSION_MAJOR > 2
18634         db_env_create( NULL, 0 );
18635 #elif DB_VERSION_MAJOR > 1
18636         db_appexit( NULL );
18637 #else
18638         (void) dbopen( NULL, 0, 0, 0, NULL);
18639 #endif
18640
18641 ; return 0; }
18642 EOF
18643 if { (eval echo configure:18644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18644   rm -rf conftest*
18645   ol_cv_db_db_42=yes
18646 else
18647   echo "configure: failed program was:" >&5
18648   cat conftest.$ac_ext >&5
18649   rm -rf conftest*
18650   ol_cv_db_db_42=no
18651 fi
18652 rm -f conftest*
18653
18654         LIBS="$ol_LIBS"
18655
18656 fi
18657
18658 echo "$ac_t""$ol_cv_db_db_42" 1>&6
18659
18660         if test $ol_cv_db_db_42 = yes ; then
18661                 ol_cv_lib_db=-ldb-42
18662         fi
18663 fi
18664
18665 if test $ol_cv_lib_db = no ; then
18666         echo $ac_n "checking for Berkeley DB link (-ldb-4.2)""... $ac_c" 1>&6
18667 echo "configure:18668: checking for Berkeley DB link (-ldb-4.2)" >&5
18668 if eval "test \"\${ol_cv_db_db_4_dot_2+set}\" = set"; then
18669   echo $ac_n "(cached) $ac_c" 1>&6
18670 else
18671   
18672         ol_DB_LIB=-ldb-4.2
18673         ol_LIBS=$LIBS
18674         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18675
18676         cat > conftest.$ac_ext <<EOF
18677 #line 18678 "configure"
18678 #include "confdefs.h"
18679
18680 #ifdef HAVE_DB_185_H
18681 # include <db_185.h>
18682 #else
18683 # include <db.h>
18684 #endif
18685
18686 #ifndef DB_VERSION_MAJOR
18687 # define DB_VERSION_MAJOR 1
18688 #endif
18689
18690 #ifndef NULL
18691 #define NULL ((void*)0)
18692 #endif
18693
18694 int main() {
18695
18696 #if DB_VERSION_MAJOR > 1
18697         {
18698                 char *version;
18699                 int major, minor, patch;
18700
18701                 version = db_version( &major, &minor, &patch );
18702
18703                 if( major != DB_VERSION_MAJOR ||
18704                         minor < DB_VERSION_MINOR )
18705                 {
18706                         printf("Berkeley DB version mismatch\n"
18707                                 "\theader: %s\n\tlibrary: %s\n",
18708                                 DB_VERSION_STRING, version);
18709                         return 1;
18710                 }
18711         }
18712 #endif
18713
18714 #if DB_VERSION_MAJOR > 2
18715         db_env_create( NULL, 0 );
18716 #elif DB_VERSION_MAJOR > 1
18717         db_appexit( NULL );
18718 #else
18719         (void) dbopen( NULL, 0, 0, 0, NULL);
18720 #endif
18721
18722 ; return 0; }
18723 EOF
18724 if { (eval echo configure:18725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18725   rm -rf conftest*
18726   ol_cv_db_db_4_dot_2=yes
18727 else
18728   echo "configure: failed program was:" >&5
18729   cat conftest.$ac_ext >&5
18730   rm -rf conftest*
18731   ol_cv_db_db_4_dot_2=no
18732 fi
18733 rm -f conftest*
18734
18735         LIBS="$ol_LIBS"
18736
18737 fi
18738
18739 echo "$ac_t""$ol_cv_db_db_4_dot_2" 1>&6
18740
18741         if test $ol_cv_db_db_4_dot_2 = yes ; then
18742                 ol_cv_lib_db=-ldb-4.2
18743         fi
18744 fi
18745
18746 if test $ol_cv_lib_db = no ; then
18747         echo $ac_n "checking for Berkeley DB link (-ldb-4-2)""... $ac_c" 1>&6
18748 echo "configure:18749: checking for Berkeley DB link (-ldb-4-2)" >&5
18749 if eval "test \"\${ol_cv_db_db_4_2+set}\" = set"; then
18750   echo $ac_n "(cached) $ac_c" 1>&6
18751 else
18752   
18753         ol_DB_LIB=-ldb-4-2
18754         ol_LIBS=$LIBS
18755         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18756
18757         cat > conftest.$ac_ext <<EOF
18758 #line 18759 "configure"
18759 #include "confdefs.h"
18760
18761 #ifdef HAVE_DB_185_H
18762 # include <db_185.h>
18763 #else
18764 # include <db.h>
18765 #endif
18766
18767 #ifndef DB_VERSION_MAJOR
18768 # define DB_VERSION_MAJOR 1
18769 #endif
18770
18771 #ifndef NULL
18772 #define NULL ((void*)0)
18773 #endif
18774
18775 int main() {
18776
18777 #if DB_VERSION_MAJOR > 1
18778         {
18779                 char *version;
18780                 int major, minor, patch;
18781
18782                 version = db_version( &major, &minor, &patch );
18783
18784                 if( major != DB_VERSION_MAJOR ||
18785                         minor < DB_VERSION_MINOR )
18786                 {
18787                         printf("Berkeley DB version mismatch\n"
18788                                 "\theader: %s\n\tlibrary: %s\n",
18789                                 DB_VERSION_STRING, version);
18790                         return 1;
18791                 }
18792         }
18793 #endif
18794
18795 #if DB_VERSION_MAJOR > 2
18796         db_env_create( NULL, 0 );
18797 #elif DB_VERSION_MAJOR > 1
18798         db_appexit( NULL );
18799 #else
18800         (void) dbopen( NULL, 0, 0, 0, NULL);
18801 #endif
18802
18803 ; return 0; }
18804 EOF
18805 if { (eval echo configure:18806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18806   rm -rf conftest*
18807   ol_cv_db_db_4_2=yes
18808 else
18809   echo "configure: failed program was:" >&5
18810   cat conftest.$ac_ext >&5
18811   rm -rf conftest*
18812   ol_cv_db_db_4_2=no
18813 fi
18814 rm -f conftest*
18815
18816         LIBS="$ol_LIBS"
18817
18818 fi
18819
18820 echo "$ac_t""$ol_cv_db_db_4_2" 1>&6
18821
18822         if test $ol_cv_db_db_4_2 = yes ; then
18823                 ol_cv_lib_db=-ldb-4-2
18824         fi
18825 fi
18826
18827 if test $ol_cv_lib_db = no ; then
18828         echo $ac_n "checking for Berkeley DB link (-ldb-4)""... $ac_c" 1>&6
18829 echo "configure:18830: checking for Berkeley DB link (-ldb-4)" >&5
18830 if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then
18831   echo $ac_n "(cached) $ac_c" 1>&6
18832 else
18833   
18834         ol_DB_LIB=-ldb-4
18835         ol_LIBS=$LIBS
18836         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18837
18838         cat > conftest.$ac_ext <<EOF
18839 #line 18840 "configure"
18840 #include "confdefs.h"
18841
18842 #ifdef HAVE_DB_185_H
18843 # include <db_185.h>
18844 #else
18845 # include <db.h>
18846 #endif
18847
18848 #ifndef DB_VERSION_MAJOR
18849 # define DB_VERSION_MAJOR 1
18850 #endif
18851
18852 #ifndef NULL
18853 #define NULL ((void*)0)
18854 #endif
18855
18856 int main() {
18857
18858 #if DB_VERSION_MAJOR > 1
18859         {
18860                 char *version;
18861                 int major, minor, patch;
18862
18863                 version = db_version( &major, &minor, &patch );
18864
18865                 if( major != DB_VERSION_MAJOR ||
18866                         minor < DB_VERSION_MINOR )
18867                 {
18868                         printf("Berkeley DB version mismatch\n"
18869                                 "\theader: %s\n\tlibrary: %s\n",
18870                                 DB_VERSION_STRING, version);
18871                         return 1;
18872                 }
18873         }
18874 #endif
18875
18876 #if DB_VERSION_MAJOR > 2
18877         db_env_create( NULL, 0 );
18878 #elif DB_VERSION_MAJOR > 1
18879         db_appexit( NULL );
18880 #else
18881         (void) dbopen( NULL, 0, 0, 0, NULL);
18882 #endif
18883
18884 ; return 0; }
18885 EOF
18886 if { (eval echo configure:18887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18887   rm -rf conftest*
18888   ol_cv_db_db_4=yes
18889 else
18890   echo "configure: failed program was:" >&5
18891   cat conftest.$ac_ext >&5
18892   rm -rf conftest*
18893   ol_cv_db_db_4=no
18894 fi
18895 rm -f conftest*
18896
18897         LIBS="$ol_LIBS"
18898
18899 fi
18900
18901 echo "$ac_t""$ol_cv_db_db_4" 1>&6
18902
18903         if test $ol_cv_db_db_4 = yes ; then
18904                 ol_cv_lib_db=-ldb-4
18905         fi
18906 fi
18907
18908 if test $ol_cv_lib_db = no ; then
18909         echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
18910 echo "configure:18911: checking for Berkeley DB link (-ldb4)" >&5
18911 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
18912   echo $ac_n "(cached) $ac_c" 1>&6
18913 else
18914   
18915         ol_DB_LIB=-ldb4
18916         ol_LIBS=$LIBS
18917         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18918
18919         cat > conftest.$ac_ext <<EOF
18920 #line 18921 "configure"
18921 #include "confdefs.h"
18922
18923 #ifdef HAVE_DB_185_H
18924 # include <db_185.h>
18925 #else
18926 # include <db.h>
18927 #endif
18928
18929 #ifndef DB_VERSION_MAJOR
18930 # define DB_VERSION_MAJOR 1
18931 #endif
18932
18933 #ifndef NULL
18934 #define NULL ((void*)0)
18935 #endif
18936
18937 int main() {
18938
18939 #if DB_VERSION_MAJOR > 1
18940         {
18941                 char *version;
18942                 int major, minor, patch;
18943
18944                 version = db_version( &major, &minor, &patch );
18945
18946                 if( major != DB_VERSION_MAJOR ||
18947                         minor < DB_VERSION_MINOR )
18948                 {
18949                         printf("Berkeley DB version mismatch\n"
18950                                 "\theader: %s\n\tlibrary: %s\n",
18951                                 DB_VERSION_STRING, version);
18952                         return 1;
18953                 }
18954         }
18955 #endif
18956
18957 #if DB_VERSION_MAJOR > 2
18958         db_env_create( NULL, 0 );
18959 #elif DB_VERSION_MAJOR > 1
18960         db_appexit( NULL );
18961 #else
18962         (void) dbopen( NULL, 0, 0, 0, NULL);
18963 #endif
18964
18965 ; return 0; }
18966 EOF
18967 if { (eval echo configure:18968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18968   rm -rf conftest*
18969   ol_cv_db_db4=yes
18970 else
18971   echo "configure: failed program was:" >&5
18972   cat conftest.$ac_ext >&5
18973   rm -rf conftest*
18974   ol_cv_db_db4=no
18975 fi
18976 rm -f conftest*
18977
18978         LIBS="$ol_LIBS"
18979
18980 fi
18981
18982 echo "$ac_t""$ol_cv_db_db4" 1>&6
18983
18984         if test $ol_cv_db_db4 = yes ; then
18985                 ol_cv_lib_db=-ldb4
18986         fi
18987 fi
18988
18989 if test $ol_cv_lib_db = no ; then
18990         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
18991 echo "configure:18992: checking for Berkeley DB link (-ldb)" >&5
18992 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
18993   echo $ac_n "(cached) $ac_c" 1>&6
18994 else
18995   
18996         ol_DB_LIB=-ldb
18997         ol_LIBS=$LIBS
18998         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18999
19000         cat > conftest.$ac_ext <<EOF
19001 #line 19002 "configure"
19002 #include "confdefs.h"
19003
19004 #ifdef HAVE_DB_185_H
19005 # include <db_185.h>
19006 #else
19007 # include <db.h>
19008 #endif
19009
19010 #ifndef DB_VERSION_MAJOR
19011 # define DB_VERSION_MAJOR 1
19012 #endif
19013
19014 #ifndef NULL
19015 #define NULL ((void*)0)
19016 #endif
19017
19018 int main() {
19019
19020 #if DB_VERSION_MAJOR > 1
19021         {
19022                 char *version;
19023                 int major, minor, patch;
19024
19025                 version = db_version( &major, &minor, &patch );
19026
19027                 if( major != DB_VERSION_MAJOR ||
19028                         minor < DB_VERSION_MINOR )
19029                 {
19030                         printf("Berkeley DB version mismatch\n"
19031                                 "\theader: %s\n\tlibrary: %s\n",
19032                                 DB_VERSION_STRING, version);
19033                         return 1;
19034                 }
19035         }
19036 #endif
19037
19038 #if DB_VERSION_MAJOR > 2
19039         db_env_create( NULL, 0 );
19040 #elif DB_VERSION_MAJOR > 1
19041         db_appexit( NULL );
19042 #else
19043         (void) dbopen( NULL, 0, 0, 0, NULL);
19044 #endif
19045
19046 ; return 0; }
19047 EOF
19048 if { (eval echo configure:19049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19049   rm -rf conftest*
19050   ol_cv_db_db=yes
19051 else
19052   echo "configure: failed program was:" >&5
19053   cat conftest.$ac_ext >&5
19054   rm -rf conftest*
19055   ol_cv_db_db=no
19056 fi
19057 rm -f conftest*
19058
19059         LIBS="$ol_LIBS"
19060
19061 fi
19062
19063 echo "$ac_t""$ol_cv_db_db" 1>&6
19064
19065         if test $ol_cv_db_db = yes ; then
19066                 ol_cv_lib_db=-ldb
19067         fi
19068 fi
19069
19070 if test $ol_cv_lib_db = no ; then
19071         echo $ac_n "checking for Berkeley DB link (-ldb41)""... $ac_c" 1>&6
19072 echo "configure:19073: checking for Berkeley DB link (-ldb41)" >&5
19073 if eval "test \"\${ol_cv_db_db41+set}\" = set"; then
19074   echo $ac_n "(cached) $ac_c" 1>&6
19075 else
19076   
19077         ol_DB_LIB=-ldb41
19078         ol_LIBS=$LIBS
19079         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
19080
19081         cat > conftest.$ac_ext <<EOF
19082 #line 19083 "configure"
19083 #include "confdefs.h"
19084
19085 #ifdef HAVE_DB_185_H
19086 # include <db_185.h>
19087 #else
19088 # include <db.h>
19089 #endif
19090
19091 #ifndef DB_VERSION_MAJOR
19092 # define DB_VERSION_MAJOR 1
19093 #endif
19094
19095 #ifndef NULL
19096 #define NULL ((void*)0)
19097 #endif
19098
19099 int main() {
19100
19101 #if DB_VERSION_MAJOR > 1
19102         {
19103                 char *version;
19104                 int major, minor, patch;
19105
19106                 version = db_version( &major, &minor, &patch );
19107
19108                 if( major != DB_VERSION_MAJOR ||
19109                         minor < DB_VERSION_MINOR )
19110                 {
19111                         printf("Berkeley DB version mismatch\n"
19112                                 "\theader: %s\n\tlibrary: %s\n",
19113                                 DB_VERSION_STRING, version);
19114                         return 1;
19115                 }
19116         }
19117 #endif
19118
19119 #if DB_VERSION_MAJOR > 2
19120         db_env_create( NULL, 0 );
19121 #elif DB_VERSION_MAJOR > 1
19122         db_appexit( NULL );
19123 #else
19124         (void) dbopen( NULL, 0, 0, 0, NULL);
19125 #endif
19126
19127 ; return 0; }
19128 EOF
19129 if { (eval echo configure:19130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19130   rm -rf conftest*
19131   ol_cv_db_db41=yes
19132 else
19133   echo "configure: failed program was:" >&5
19134   cat conftest.$ac_ext >&5
19135   rm -rf conftest*
19136   ol_cv_db_db41=no
19137 fi
19138 rm -f conftest*
19139
19140         LIBS="$ol_LIBS"
19141
19142 fi
19143
19144 echo "$ac_t""$ol_cv_db_db41" 1>&6
19145
19146         if test $ol_cv_db_db41 = yes ; then
19147                 ol_cv_lib_db=-ldb41
19148         fi
19149 fi
19150
19151 if test $ol_cv_lib_db = no ; then
19152         echo $ac_n "checking for Berkeley DB link (-ldb-41)""... $ac_c" 1>&6
19153 echo "configure:19154: checking for Berkeley DB link (-ldb-41)" >&5
19154 if eval "test \"\${ol_cv_db_db_41+set}\" = set"; then
19155   echo $ac_n "(cached) $ac_c" 1>&6
19156 else
19157   
19158         ol_DB_LIB=-ldb-41
19159         ol_LIBS=$LIBS
19160         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
19161
19162         cat > conftest.$ac_ext <<EOF
19163 #line 19164 "configure"
19164 #include "confdefs.h"
19165
19166 #ifdef HAVE_DB_185_H
19167 # include <db_185.h>
19168 #else
19169 # include <db.h>
19170 #endif
19171
19172 #ifndef DB_VERSION_MAJOR
19173 # define DB_VERSION_MAJOR 1
19174 #endif
19175
19176 #ifndef NULL
19177 #define NULL ((void*)0)
19178 #endif
19179
19180 int main() {
19181
19182 #if DB_VERSION_MAJOR > 1
19183         {
19184                 char *version;
19185                 int major, minor, patch;
19186
19187                 version = db_version( &major, &minor, &patch );
19188
19189                 if( major != DB_VERSION_MAJOR ||
19190                         minor < DB_VERSION_MINOR )
19191                 {
19192                         printf("Berkeley DB version mismatch\n"
19193                                 "\theader: %s\n\tlibrary: %s\n",
19194                                 DB_VERSION_STRING, version);
19195                         return 1;
19196                 }
19197         }
19198 #endif
19199
19200 #if DB_VERSION_MAJOR > 2
19201         db_env_create( NULL, 0 );
19202 #elif DB_VERSION_MAJOR > 1
19203         db_appexit( NULL );
19204 #else
19205         (void) dbopen( NULL, 0, 0, 0, NULL);
19206 #endif
19207
19208 ; return 0; }
19209 EOF
19210 if { (eval echo configure:19211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19211   rm -rf conftest*
19212   ol_cv_db_db_41=yes
19213 else
19214   echo "configure: failed program was:" >&5
19215   cat conftest.$ac_ext >&5
19216   rm -rf conftest*
19217   ol_cv_db_db_41=no
19218 fi
19219 rm -f conftest*
19220
19221         LIBS="$ol_LIBS"
19222
19223 fi
19224
19225 echo "$ac_t""$ol_cv_db_db_41" 1>&6
19226
19227         if test $ol_cv_db_db_41 = yes ; then
19228                 ol_cv_lib_db=-ldb-41
19229         fi
19230 fi
19231
19232 if test $ol_cv_lib_db = no ; then
19233         echo $ac_n "checking for Berkeley DB link (-ldb-4.1)""... $ac_c" 1>&6
19234 echo "configure:19235: checking for Berkeley DB link (-ldb-4.1)" >&5
19235 if eval "test \"\${ol_cv_db_db_4_dot_1+set}\" = set"; then
19236   echo $ac_n "(cached) $ac_c" 1>&6
19237 else
19238   
19239         ol_DB_LIB=-ldb-4.1
19240         ol_LIBS=$LIBS
19241         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
19242
19243         cat > conftest.$ac_ext <<EOF
19244 #line 19245 "configure"
19245 #include "confdefs.h"
19246
19247 #ifdef HAVE_DB_185_H
19248 # include <db_185.h>
19249 #else
19250 # include <db.h>
19251 #endif
19252
19253 #ifndef DB_VERSION_MAJOR
19254 # define DB_VERSION_MAJOR 1
19255 #endif
19256
19257 #ifndef NULL
19258 #define NULL ((void*)0)
19259 #endif
19260
19261 int main() {
19262
19263 #if DB_VERSION_MAJOR > 1
19264         {
19265                 char *version;
19266                 int major, minor, patch;
19267
19268                 version = db_version( &major, &minor, &patch );
19269
19270                 if( major != DB_VERSION_MAJOR ||
19271                         minor < DB_VERSION_MINOR )
19272                 {
19273                         printf("Berkeley DB version mismatch\n"
19274                                 "\theader: %s\n\tlibrary: %s\n",
19275                                 DB_VERSION_STRING, version);
19276                         return 1;
19277                 }
19278         }
19279 #endif
19280
19281 #if DB_VERSION_MAJOR > 2
19282         db_env_create( NULL, 0 );
19283 #elif DB_VERSION_MAJOR > 1
19284         db_appexit( NULL );
19285 #else
19286         (void) dbopen( NULL, 0, 0, 0, NULL);
19287 #endif
19288
19289 ; return 0; }
19290 EOF
19291 if { (eval echo configure:19292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19292   rm -rf conftest*
19293   ol_cv_db_db_4_dot_1=yes
19294 else
19295   echo "configure: failed program was:" >&5
19296   cat conftest.$ac_ext >&5
19297   rm -rf conftest*
19298   ol_cv_db_db_4_dot_1=no
19299 fi
19300 rm -f conftest*
19301
19302         LIBS="$ol_LIBS"
19303
19304 fi
19305
19306 echo "$ac_t""$ol_cv_db_db_4_dot_1" 1>&6
19307
19308         if test $ol_cv_db_db_4_dot_1 = yes ; then
19309                 ol_cv_lib_db=-ldb-4.1
19310         fi
19311 fi
19312
19313 if test $ol_cv_lib_db = no ; then
19314         echo $ac_n "checking for Berkeley DB link (-ldb-4-1)""... $ac_c" 1>&6
19315 echo "configure:19316: checking for Berkeley DB link (-ldb-4-1)" >&5
19316 if eval "test \"\${ol_cv_db_db_4_1+set}\" = set"; then
19317   echo $ac_n "(cached) $ac_c" 1>&6
19318 else
19319   
19320         ol_DB_LIB=-ldb-4-1
19321         ol_LIBS=$LIBS
19322         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
19323
19324         cat > conftest.$ac_ext <<EOF
19325 #line 19326 "configure"
19326 #include "confdefs.h"
19327
19328 #ifdef HAVE_DB_185_H
19329 # include <db_185.h>
19330 #else
19331 # include <db.h>
19332 #endif
19333
19334 #ifndef DB_VERSION_MAJOR
19335 # define DB_VERSION_MAJOR 1
19336 #endif
19337
19338 #ifndef NULL
19339 #define NULL ((void*)0)
19340 #endif
19341
19342 int main() {
19343
19344 #if DB_VERSION_MAJOR > 1
19345         {
19346                 char *version;
19347                 int major, minor, patch;
19348
19349                 version = db_version( &major, &minor, &patch );
19350
19351                 if( major != DB_VERSION_MAJOR ||
19352                         minor < DB_VERSION_MINOR )
19353                 {
19354                         printf("Berkeley DB version mismatch\n"
19355                                 "\theader: %s\n\tlibrary: %s\n",
19356                                 DB_VERSION_STRING, version);
19357                         return 1;
19358                 }
19359         }
19360 #endif
19361
19362 #if DB_VERSION_MAJOR > 2
19363         db_env_create( NULL, 0 );
19364 #elif DB_VERSION_MAJOR > 1
19365         db_appexit( NULL );
19366 #else
19367         (void) dbopen( NULL, 0, 0, 0, NULL);
19368 #endif
19369
19370 ; return 0; }
19371 EOF
19372 if { (eval echo configure:19373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19373   rm -rf conftest*
19374   ol_cv_db_db_4_1=yes
19375 else
19376   echo "configure: failed program was:" >&5
19377   cat conftest.$ac_ext >&5
19378   rm -rf conftest*
19379   ol_cv_db_db_4_1=no
19380 fi
19381 rm -f conftest*
19382
19383         LIBS="$ol_LIBS"
19384
19385 fi
19386
19387 echo "$ac_t""$ol_cv_db_db_4_1" 1>&6
19388
19389         if test $ol_cv_db_db_4_1 = yes ; then
19390                 ol_cv_lib_db=-ldb-4-1
19391         fi
19392 fi
19393
19394 if test $ol_cv_lib_db = no ; then
19395         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
19396 echo "configure:19397: checking for Berkeley DB link (-ldb3)" >&5
19397 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
19398   echo $ac_n "(cached) $ac_c" 1>&6
19399 else
19400   
19401         ol_DB_LIB=-ldb3
19402         ol_LIBS=$LIBS
19403         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
19404
19405         cat > conftest.$ac_ext <<EOF
19406 #line 19407 "configure"
19407 #include "confdefs.h"
19408
19409 #ifdef HAVE_DB_185_H
19410 # include <db_185.h>
19411 #else
19412 # include <db.h>
19413 #endif
19414
19415 #ifndef DB_VERSION_MAJOR
19416 # define DB_VERSION_MAJOR 1
19417 #endif
19418
19419 #ifndef NULL
19420 #define NULL ((void*)0)
19421 #endif
19422
19423 int main() {
19424
19425 #if DB_VERSION_MAJOR > 1
19426         {
19427                 char *version;
19428                 int major, minor, patch;
19429
19430                 version = db_version( &major, &minor, &patch );
19431
19432                 if( major != DB_VERSION_MAJOR ||
19433                         minor < DB_VERSION_MINOR )
19434                 {
19435                         printf("Berkeley DB version mismatch\n"
19436                                 "\theader: %s\n\tlibrary: %s\n",
19437                                 DB_VERSION_STRING, version);
19438                         return 1;
19439                 }
19440         }
19441 #endif
19442
19443 #if DB_VERSION_MAJOR > 2
19444         db_env_create( NULL, 0 );
19445 #elif DB_VERSION_MAJOR > 1
19446         db_appexit( NULL );
19447 #else
19448         (void) dbopen( NULL, 0, 0, 0, NULL);
19449 #endif
19450
19451 ; return 0; }
19452 EOF
19453 if { (eval echo configure:19454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19454   rm -rf conftest*
19455   ol_cv_db_db3=yes
19456 else
19457   echo "configure: failed program was:" >&5
19458   cat conftest.$ac_ext >&5
19459   rm -rf conftest*
19460   ol_cv_db_db3=no
19461 fi
19462 rm -f conftest*
19463
19464         LIBS="$ol_LIBS"
19465
19466 fi
19467
19468 echo "$ac_t""$ol_cv_db_db3" 1>&6
19469
19470         if test $ol_cv_db_db3 = yes ; then
19471                 ol_cv_lib_db=-ldb3
19472         fi
19473 fi
19474
19475 if test $ol_cv_lib_db = no ; then
19476         echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6
19477 echo "configure:19478: checking for Berkeley DB link (-ldb-3)" >&5
19478 if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then
19479   echo $ac_n "(cached) $ac_c" 1>&6
19480 else
19481   
19482         ol_DB_LIB=-ldb-3
19483         ol_LIBS=$LIBS
19484         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
19485
19486         cat > conftest.$ac_ext <<EOF
19487 #line 19488 "configure"
19488 #include "confdefs.h"
19489
19490 #ifdef HAVE_DB_185_H
19491 # include <db_185.h>
19492 #else
19493 # include <db.h>
19494 #endif
19495
19496 #ifndef DB_VERSION_MAJOR
19497 # define DB_VERSION_MAJOR 1
19498 #endif
19499
19500 #ifndef NULL
19501 #define NULL ((void*)0)
19502 #endif
19503
19504 int main() {
19505
19506 #if DB_VERSION_MAJOR > 1
19507         {
19508                 char *version;
19509                 int major, minor, patch;
19510
19511                 version = db_version( &major, &minor, &patch );
19512
19513                 if( major != DB_VERSION_MAJOR ||
19514                         minor < DB_VERSION_MINOR )
19515                 {
19516                         printf("Berkeley DB version mismatch\n"
19517                                 "\theader: %s\n\tlibrary: %s\n",
19518                                 DB_VERSION_STRING, version);
19519                         return 1;
19520                 }
19521         }
19522 #endif
19523
19524 #if DB_VERSION_MAJOR > 2
19525         db_env_create( NULL, 0 );
19526 #elif DB_VERSION_MAJOR > 1
19527         db_appexit( NULL );
19528 #else
19529         (void) dbopen( NULL, 0, 0, 0, NULL);
19530 #endif
19531
19532 ; return 0; }
19533 EOF
19534 if { (eval echo configure:19535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19535   rm -rf conftest*
19536   ol_cv_db_db_3=yes
19537 else
19538   echo "configure: failed program was:" >&5
19539   cat conftest.$ac_ext >&5
19540   rm -rf conftest*
19541   ol_cv_db_db_3=no
19542 fi
19543 rm -f conftest*
19544
19545         LIBS="$ol_LIBS"
19546
19547 fi
19548
19549 echo "$ac_t""$ol_cv_db_db_3" 1>&6
19550
19551         if test $ol_cv_db_db_3 = yes ; then
19552                 ol_cv_lib_db=-ldb-3
19553         fi
19554 fi
19555
19556 if test $ol_cv_lib_db = no ; then
19557         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
19558 echo "configure:19559: checking for Berkeley DB link (-ldb2)" >&5
19559 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
19560   echo $ac_n "(cached) $ac_c" 1>&6
19561 else
19562   
19563         ol_DB_LIB=-ldb2
19564         ol_LIBS=$LIBS
19565         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
19566
19567         cat > conftest.$ac_ext <<EOF
19568 #line 19569 "configure"
19569 #include "confdefs.h"
19570
19571 #ifdef HAVE_DB_185_H
19572 # include <db_185.h>
19573 #else
19574 # include <db.h>
19575 #endif
19576
19577 #ifndef DB_VERSION_MAJOR
19578 # define DB_VERSION_MAJOR 1
19579 #endif
19580
19581 #ifndef NULL
19582 #define NULL ((void*)0)
19583 #endif
19584
19585 int main() {
19586
19587 #if DB_VERSION_MAJOR > 1
19588         {
19589                 char *version;
19590                 int major, minor, patch;
19591
19592                 version = db_version( &major, &minor, &patch );
19593
19594                 if( major != DB_VERSION_MAJOR ||
19595                         minor < DB_VERSION_MINOR )
19596                 {
19597                         printf("Berkeley DB version mismatch\n"
19598                                 "\theader: %s\n\tlibrary: %s\n",
19599                                 DB_VERSION_STRING, version);
19600                         return 1;
19601                 }
19602         }
19603 #endif
19604
19605 #if DB_VERSION_MAJOR > 2
19606         db_env_create( NULL, 0 );
19607 #elif DB_VERSION_MAJOR > 1
19608         db_appexit( NULL );
19609 #else
19610         (void) dbopen( NULL, 0, 0, 0, NULL);
19611 #endif
19612
19613 ; return 0; }
19614 EOF
19615 if { (eval echo configure:19616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19616   rm -rf conftest*
19617   ol_cv_db_db2=yes
19618 else
19619   echo "configure: failed program was:" >&5
19620   cat conftest.$ac_ext >&5
19621   rm -rf conftest*
19622   ol_cv_db_db2=no
19623 fi
19624 rm -f conftest*
19625
19626         LIBS="$ol_LIBS"
19627
19628 fi
19629
19630 echo "$ac_t""$ol_cv_db_db2" 1>&6
19631
19632         if test $ol_cv_db_db2 = yes ; then
19633                 ol_cv_lib_db=-ldb2
19634         fi
19635 fi
19636
19637 if test $ol_cv_lib_db = no ; then
19638         echo $ac_n "checking for Berkeley DB link (-ldb-2)""... $ac_c" 1>&6
19639 echo "configure:19640: checking for Berkeley DB link (-ldb-2)" >&5
19640 if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then
19641   echo $ac_n "(cached) $ac_c" 1>&6
19642 else
19643   
19644         ol_DB_LIB=-ldb-2
19645         ol_LIBS=$LIBS
19646         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
19647
19648         cat > conftest.$ac_ext <<EOF
19649 #line 19650 "configure"
19650 #include "confdefs.h"
19651
19652 #ifdef HAVE_DB_185_H
19653 # include <db_185.h>
19654 #else
19655 # include <db.h>
19656 #endif
19657
19658 #ifndef DB_VERSION_MAJOR
19659 # define DB_VERSION_MAJOR 1
19660 #endif
19661
19662 #ifndef NULL
19663 #define NULL ((void*)0)
19664 #endif
19665
19666 int main() {
19667
19668 #if DB_VERSION_MAJOR > 1
19669         {
19670                 char *version;
19671                 int major, minor, patch;
19672
19673                 version = db_version( &major, &minor, &patch );
19674
19675                 if( major != DB_VERSION_MAJOR ||
19676                         minor < DB_VERSION_MINOR )
19677                 {
19678                         printf("Berkeley DB version mismatch\n"
19679                                 "\theader: %s\n\tlibrary: %s\n",
19680                                 DB_VERSION_STRING, version);
19681                         return 1;
19682                 }
19683         }
19684 #endif
19685
19686 #if DB_VERSION_MAJOR > 2
19687         db_env_create( NULL, 0 );
19688 #elif DB_VERSION_MAJOR > 1
19689         db_appexit( NULL );
19690 #else
19691         (void) dbopen( NULL, 0, 0, 0, NULL);
19692 #endif
19693
19694 ; return 0; }
19695 EOF
19696 if { (eval echo configure:19697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19697   rm -rf conftest*
19698   ol_cv_db_db_2=yes
19699 else
19700   echo "configure: failed program was:" >&5
19701   cat conftest.$ac_ext >&5
19702   rm -rf conftest*
19703   ol_cv_db_db_2=no
19704 fi
19705 rm -f conftest*
19706
19707         LIBS="$ol_LIBS"
19708
19709 fi
19710
19711 echo "$ac_t""$ol_cv_db_db_2" 1>&6
19712
19713         if test $ol_cv_db_db_2 = yes ; then
19714                 ol_cv_lib_db=-ldb-2
19715         fi
19716 fi
19717
19718 if test $ol_cv_lib_db = no ; then
19719         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
19720 echo "configure:19721: checking for Berkeley DB link (-ldb1)" >&5
19721 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
19722   echo $ac_n "(cached) $ac_c" 1>&6
19723 else
19724   
19725         ol_DB_LIB=-ldb1
19726         ol_LIBS=$LIBS
19727         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
19728
19729         cat > conftest.$ac_ext <<EOF
19730 #line 19731 "configure"
19731 #include "confdefs.h"
19732
19733 #ifdef HAVE_DB_185_H
19734 # include <db_185.h>
19735 #else
19736 # include <db.h>
19737 #endif
19738
19739 #ifndef DB_VERSION_MAJOR
19740 # define DB_VERSION_MAJOR 1
19741 #endif
19742
19743 #ifndef NULL
19744 #define NULL ((void*)0)
19745 #endif
19746
19747 int main() {
19748
19749 #if DB_VERSION_MAJOR > 1
19750         {
19751                 char *version;
19752                 int major, minor, patch;
19753
19754                 version = db_version( &major, &minor, &patch );
19755
19756                 if( major != DB_VERSION_MAJOR ||
19757                         minor < DB_VERSION_MINOR )
19758                 {
19759                         printf("Berkeley DB version mismatch\n"
19760                                 "\theader: %s\n\tlibrary: %s\n",
19761                                 DB_VERSION_STRING, version);
19762                         return 1;
19763                 }
19764         }
19765 #endif
19766
19767 #if DB_VERSION_MAJOR > 2
19768         db_env_create( NULL, 0 );
19769 #elif DB_VERSION_MAJOR > 1
19770         db_appexit( NULL );
19771 #else
19772         (void) dbopen( NULL, 0, 0, 0, NULL);
19773 #endif
19774
19775 ; return 0; }
19776 EOF
19777 if { (eval echo configure:19778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19778   rm -rf conftest*
19779   ol_cv_db_db1=yes
19780 else
19781   echo "configure: failed program was:" >&5
19782   cat conftest.$ac_ext >&5
19783   rm -rf conftest*
19784   ol_cv_db_db1=no
19785 fi
19786 rm -f conftest*
19787
19788         LIBS="$ol_LIBS"
19789
19790 fi
19791
19792 echo "$ac_t""$ol_cv_db_db1" 1>&6
19793
19794         if test $ol_cv_db_db1 = yes ; then
19795                 ol_cv_lib_db=-ldb1
19796         fi
19797 fi
19798
19799 if test $ol_cv_lib_db = no ; then
19800         echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6
19801 echo "configure:19802: checking for Berkeley DB link (-ldb-1)" >&5
19802 if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then
19803   echo $ac_n "(cached) $ac_c" 1>&6
19804 else
19805   
19806         ol_DB_LIB=-ldb-1
19807         ol_LIBS=$LIBS
19808         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
19809
19810         cat > conftest.$ac_ext <<EOF
19811 #line 19812 "configure"
19812 #include "confdefs.h"
19813
19814 #ifdef HAVE_DB_185_H
19815 # include <db_185.h>
19816 #else
19817 # include <db.h>
19818 #endif
19819
19820 #ifndef DB_VERSION_MAJOR
19821 # define DB_VERSION_MAJOR 1
19822 #endif
19823
19824 #ifndef NULL
19825 #define NULL ((void*)0)
19826 #endif
19827
19828 int main() {
19829
19830 #if DB_VERSION_MAJOR > 1
19831         {
19832                 char *version;
19833                 int major, minor, patch;
19834
19835                 version = db_version( &major, &minor, &patch );
19836
19837                 if( major != DB_VERSION_MAJOR ||
19838                         minor < DB_VERSION_MINOR )
19839                 {
19840                         printf("Berkeley DB version mismatch\n"
19841                                 "\theader: %s\n\tlibrary: %s\n",
19842                                 DB_VERSION_STRING, version);
19843                         return 1;
19844                 }
19845         }
19846 #endif
19847
19848 #if DB_VERSION_MAJOR > 2
19849         db_env_create( NULL, 0 );
19850 #elif DB_VERSION_MAJOR > 1
19851         db_appexit( NULL );
19852 #else
19853         (void) dbopen( NULL, 0, 0, 0, NULL);
19854 #endif
19855
19856 ; return 0; }
19857 EOF
19858 if { (eval echo configure:19859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19859   rm -rf conftest*
19860   ol_cv_db_db_1=yes
19861 else
19862   echo "configure: failed program was:" >&5
19863   cat conftest.$ac_ext >&5
19864   rm -rf conftest*
19865   ol_cv_db_db_1=no
19866 fi
19867 rm -f conftest*
19868
19869         LIBS="$ol_LIBS"
19870
19871 fi
19872
19873 echo "$ac_t""$ol_cv_db_db_1" 1>&6
19874
19875         if test $ol_cv_db_db_1 = yes ; then
19876                 ol_cv_lib_db=-ldb-1
19877         fi
19878 fi
19879
19880
19881         if test "$ol_cv_lib_db" != no ; then
19882                 ol_cv_berkeley_db=yes
19883                 echo $ac_n "checking for Berkeley DB version match""... $ac_c" 1>&6
19884 echo "configure:19885: checking for Berkeley DB version match" >&5
19885 if eval "test \"\${ol_cv_berkeley_db_version+set}\" = set"; then
19886   echo $ac_n "(cached) $ac_c" 1>&6
19887 else
19888   
19889         ol_LIBS="$LIBS"
19890         LIBS="$LTHREAD_LIBS $LIBS"
19891         if test $ol_cv_lib_db != yes ; then
19892                 LIBS="$ol_cv_lib_db $LIBS"
19893         fi
19894
19895         if test "$cross_compiling" = yes; then
19896   ol_cv_berkeley_db_version=cross
19897 else
19898   cat > conftest.$ac_ext <<EOF
19899 #line 19900 "configure"
19900 #include "confdefs.h"
19901
19902 #ifdef HAVE_DB_185_H
19903         choke me;
19904 #else
19905 #include <db.h>
19906 #endif
19907 #ifndef DB_VERSION_MAJOR
19908 # define DB_VERSION_MAJOR 1
19909 #endif
19910 #ifndef NULL
19911 #define NULL ((void *)0)
19912 #endif
19913 main()
19914 {
19915 #if DB_VERSION_MAJOR > 1
19916         char *version;
19917         int major, minor, patch;
19918
19919         version = db_version( &major, &minor, &patch );
19920
19921         if( major != DB_VERSION_MAJOR || minor < DB_VERSION_MINOR ) {
19922                 printf("Berkeley DB version mismatch\n"
19923                         "\theader: %s\n\tlibrary: %s\n",
19924                         DB_VERSION_STRING, version);
19925                 return 1;
19926         }
19927 #endif
19928
19929         return 0;
19930 }
19931 EOF
19932 if { (eval echo configure:19933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
19933 then
19934   ol_cv_berkeley_db_version=yes
19935 else
19936   echo "configure: failed program was:" >&5
19937   cat conftest.$ac_ext >&5
19938   rm -fr conftest*
19939   ol_cv_berkeley_db_version=no
19940 fi
19941 rm -fr conftest*
19942 fi
19943
19944
19945         LIBS="$ol_LIBS"
19946
19947 fi
19948
19949 echo "$ac_t""$ol_cv_berkeley_db_version" 1>&6
19950
19951         if test $ol_cv_berkeley_db_version = no ; then
19952                 { echo "configure: error: Berkeley DB version mismatch" 1>&2; exit 1; }
19953         fi
19954
19955                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
19956 echo "configure:19957: checking for Berkeley DB thread support" >&5
19957 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
19958   echo $ac_n "(cached) $ac_c" 1>&6
19959 else
19960   
19961         ol_LIBS="$LIBS"
19962         LIBS="$LTHREAD_LIBS $LIBS"
19963         if test $ol_cv_lib_db != yes ; then
19964                 LIBS="$ol_cv_lib_db $LIBS"
19965         fi
19966
19967         if test "$cross_compiling" = yes; then
19968   ol_cv_berkeley_db_thread=cross
19969 else
19970   cat > conftest.$ac_ext <<EOF
19971 #line 19972 "configure"
19972 #include "confdefs.h"
19973
19974 #ifdef HAVE_DB_185_H
19975         choke me;
19976 #else
19977 #include <db.h>
19978 #endif
19979 #ifndef NULL
19980 #define NULL ((void *)0)
19981 #endif
19982 main()
19983 {
19984         int rc;
19985         u_int32_t flags = DB_CREATE |
19986 #ifdef DB_PRIVATE
19987                 DB_PRIVATE |
19988 #endif
19989                 DB_THREAD;
19990
19991 #if DB_VERSION_MAJOR > 2
19992         DB_ENV *env = NULL;
19993
19994         rc = db_env_create( &env, 0 );
19995
19996         flags |= DB_INIT_MPOOL;
19997 #ifdef DB_MPOOL_PRIVATE
19998         flags |= DB_MPOOL_PRIVATE;
19999 #endif
20000
20001         if( rc ) {
20002                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
20003                 return rc;
20004         }
20005
20006 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
20007         rc = env->open( env, NULL, flags, 0 );
20008 #else
20009         rc = env->open( env, NULL, NULL, flags, 0 );
20010 #endif
20011
20012         if ( rc == 0 ) {
20013                 rc = env->close( env, 0 );
20014         }
20015
20016         if( rc ) {
20017                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
20018                 return rc;
20019         }
20020
20021 #else
20022         DB_ENV env;
20023         memset( &env, '\0', sizeof(env) );
20024
20025         rc = db_appinit( NULL, NULL, &env, flags );
20026
20027         if( rc == 0 ) {
20028                 db_appexit( &env );
20029         }
20030
20031         unlink("__db_mpool.share");
20032         unlink("__db_lock.share");
20033 #endif
20034
20035         return rc;
20036 }
20037 EOF
20038 if { (eval echo configure:20039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
20039 then
20040   ol_cv_berkeley_db_thread=yes
20041 else
20042   echo "configure: failed program was:" >&5
20043   cat conftest.$ac_ext >&5
20044   rm -fr conftest*
20045   ol_cv_berkeley_db_thread=no
20046 fi
20047 rm -fr conftest*
20048 fi
20049
20050
20051         LIBS="$ol_LIBS"
20052
20053 fi
20054
20055 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
20056
20057         if test $ol_cv_berkeley_db_thread != no ; then
20058                 cat >> confdefs.h <<\EOF
20059 #define HAVE_BERKELEY_DB_THREAD 1
20060 EOF
20061
20062         fi
20063
20064         fi
20065 fi
20066
20067         fi
20068
20069         if test $ol_cv_berkeley_db != no ; then
20070                 cat >> confdefs.h <<\EOF
20071 #define HAVE_BERKELEY_DB 1
20072 EOF
20073
20074
20075                 ol_link_ldbm=berkeley
20076                 ol_with_ldbm_api=berkeley
20077
20078                 if test $ol_with_ldbm_type = hash ; then
20079                         cat >> confdefs.h <<\EOF
20080 #define LDBM_USE_DBHASH 1
20081 EOF
20082
20083                 else
20084                         cat >> confdefs.h <<\EOF
20085 #define LDBM_USE_DBBTREE 1
20086 EOF
20087
20088                 fi
20089
20090                                                 if test $ol_cv_lib_db != yes ; then
20091                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
20092                 fi
20093         fi
20094 fi
20095
20096 if test $ol_enable_bdb != no -o $ol_enable_hdb != no; then
20097         if test $ol_link_ldbm != berkeley ; then
20098                 { echo "configure: error: BDB/HDB: BerkeleyDB not available" 1>&2; exit 1; }
20099         else
20100                 echo $ac_n "checking Berkeley DB version for BDB backend""... $ac_c" 1>&6
20101 echo "configure:20102: checking Berkeley DB version for BDB backend" >&5
20102 if eval "test \"\${ol_cv_bdb_compat+set}\" = set"; then
20103   echo $ac_n "(cached) $ac_c" 1>&6
20104 else
20105   
20106         cat > conftest.$ac_ext <<EOF
20107 #line 20108 "configure"
20108 #include "confdefs.h"
20109
20110 #include <db.h>
20111
20112  /* this check could be improved */
20113 #ifndef DB_VERSION_MAJOR
20114 #       define DB_VERSION_MAJOR 1
20115 #endif
20116 #ifndef DB_VERSION_MINOR
20117 #       define DB_VERSION_MINOR 0
20118 #endif
20119
20120 /* require 4.2 or later */
20121 #if (DB_VERSION_MAJOR >= 4) && (DB_VERSION_MINOR >= 2)
20122         __db_version_compat
20123 #endif
20124         
20125 EOF
20126 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20127   egrep "__db_version_compat" >/dev/null 2>&1; then
20128   rm -rf conftest*
20129   ol_cv_bdb_compat=yes
20130 else
20131   rm -rf conftest*
20132   ol_cv_bdb_compat=no
20133 fi
20134 rm -f conftest*
20135
20136 fi
20137
20138 echo "$ac_t""$ol_cv_bdb_compat" 1>&6
20139
20140
20141                 if test $ol_cv_bdb_compat != yes ; then
20142                         { echo "configure: error: BDB/HDB: BerkeleyDB version incompatible" 1>&2; exit 1; }
20143                 fi
20144         fi
20145 fi
20146
20147 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
20148         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
20149         ol_with_ldbm_api=none
20150 fi
20151
20152 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
20153         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
20154 echo "configure:20155: checking for MDBM library" >&5
20155 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
20156   echo $ac_n "(cached) $ac_c" 1>&6
20157 else
20158         ol_LIBS="$LIBS"
20159         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
20160 echo "configure:20161: checking for mdbm_set_chain" >&5
20161 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
20162   echo $ac_n "(cached) $ac_c" 1>&6
20163 else
20164   cat > conftest.$ac_ext <<EOF
20165 #line 20166 "configure"
20166 #include "confdefs.h"
20167 /* System header to define __stub macros and hopefully few prototypes,
20168     which can conflict with char mdbm_set_chain(); below.  */
20169 #include <assert.h>
20170 /* Override any gcc2 internal prototype to avoid an error.  */
20171 /* We use char because int might match the return type of a gcc2
20172     builtin and then its argument prototype would still apply.  */
20173 char mdbm_set_chain();
20174 char (*f)();
20175
20176 int main() {
20177
20178 /* The GNU C library defines this for functions which it implements
20179     to always fail with ENOSYS.  Some functions are actually named
20180     something starting with __ and the normal name is an alias.  */
20181 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
20182 choke me
20183 #else
20184 f = mdbm_set_chain;
20185 #endif
20186
20187 ; return 0; }
20188 EOF
20189 if { (eval echo configure:20190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20190   rm -rf conftest*
20191   eval "ac_cv_func_mdbm_set_chain=yes"
20192 else
20193   echo "configure: failed program was:" >&5
20194   cat conftest.$ac_ext >&5
20195   rm -rf conftest*
20196   eval "ac_cv_func_mdbm_set_chain=no"
20197 fi
20198 rm -f conftest*
20199 fi
20200
20201 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
20202   echo "$ac_t""yes" 1>&6
20203   ol_cv_lib_mdbm=yes
20204 else
20205   echo "$ac_t""no" 1>&6
20206
20207                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
20208 echo "configure:20209: checking for mdbm_set_chain in -lmdbm" >&5
20209 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
20210 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20211   echo $ac_n "(cached) $ac_c" 1>&6
20212 else
20213   ac_save_LIBS="$LIBS"
20214 LIBS="-lmdbm  $LIBS"
20215 cat > conftest.$ac_ext <<EOF
20216 #line 20217 "configure"
20217 #include "confdefs.h"
20218 /* Override any gcc2 internal prototype to avoid an error.  */
20219 /* We use char because int might match the return type of a gcc2
20220     builtin and then its argument prototype would still apply.  */
20221 char mdbm_set_chain();
20222
20223 int main() {
20224 mdbm_set_chain()
20225 ; return 0; }
20226 EOF
20227 if { (eval echo configure:20228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20228   rm -rf conftest*
20229   eval "ac_cv_lib_$ac_lib_var=yes"
20230 else
20231   echo "configure: failed program was:" >&5
20232   cat conftest.$ac_ext >&5
20233   rm -rf conftest*
20234   eval "ac_cv_lib_$ac_lib_var=no"
20235 fi
20236 rm -f conftest*
20237 LIBS="$ac_save_LIBS"
20238
20239 fi
20240 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20241   echo "$ac_t""yes" 1>&6
20242   ol_cv_lib_mdbm=-lmdbm
20243 else
20244   echo "$ac_t""no" 1>&6
20245 ol_cv_lib_mdbm=no
20246 fi
20247
20248         
20249 fi
20250
20251         LIBS="$ol_LIBS"
20252
20253 fi
20254
20255 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
20256
20257
20258  for ac_hdr in mdbm.h
20259 do
20260 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20261 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20262 echo "configure:20263: checking for $ac_hdr" >&5
20263 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20264   echo $ac_n "(cached) $ac_c" 1>&6
20265 else
20266   cat > conftest.$ac_ext <<EOF
20267 #line 20268 "configure"
20268 #include "confdefs.h"
20269 #include <$ac_hdr>
20270 EOF
20271 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20272 { (eval echo configure:20273: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20273 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20274 if test -z "$ac_err"; then
20275   rm -rf conftest*
20276   eval "ac_cv_header_$ac_safe=yes"
20277 else
20278   echo "$ac_err" >&5
20279   echo "configure: failed program was:" >&5
20280   cat conftest.$ac_ext >&5
20281   rm -rf conftest*
20282   eval "ac_cv_header_$ac_safe=no"
20283 fi
20284 rm -f conftest*
20285 fi
20286 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20287   echo "$ac_t""yes" 1>&6
20288     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20289   cat >> confdefs.h <<EOF
20290 #define $ac_tr_hdr 1
20291 EOF
20292  
20293 else
20294   echo "$ac_t""no" 1>&6
20295 fi
20296 done
20297
20298  echo $ac_n "checking for db""... $ac_c" 1>&6
20299 echo "configure:20300: checking for db" >&5
20300 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
20301   echo $ac_n "(cached) $ac_c" 1>&6
20302 else
20303   
20304         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
20305                 ol_cv_mdbm=no
20306         else
20307                 ol_cv_mdbm=yes
20308         fi
20309
20310 fi
20311
20312 echo "$ac_t""$ol_cv_mdbm" 1>&6
20313  if test $ol_cv_mdbm = yes ; then
20314         cat >> confdefs.h <<\EOF
20315 #define HAVE_MDBM 1
20316 EOF
20317
20318  fi
20319
20320
20321         if test $ol_cv_mdbm = yes ; then
20322                 ol_link_ldbm=mdbm
20323                 ol_with_ldbm_api=mdbm
20324                 if test $ol_cv_lib_mdbm != yes ; then
20325                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
20326                 fi
20327         fi
20328 fi
20329
20330 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
20331         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
20332 echo "configure:20333: checking for GDBM library" >&5
20333 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
20334   echo $ac_n "(cached) $ac_c" 1>&6
20335 else
20336         ol_LIBS="$LIBS"
20337         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
20338 echo "configure:20339: checking for gdbm_open" >&5
20339 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
20340   echo $ac_n "(cached) $ac_c" 1>&6
20341 else
20342   cat > conftest.$ac_ext <<EOF
20343 #line 20344 "configure"
20344 #include "confdefs.h"
20345 /* System header to define __stub macros and hopefully few prototypes,
20346     which can conflict with char gdbm_open(); below.  */
20347 #include <assert.h>
20348 /* Override any gcc2 internal prototype to avoid an error.  */
20349 /* We use char because int might match the return type of a gcc2
20350     builtin and then its argument prototype would still apply.  */
20351 char gdbm_open();
20352 char (*f)();
20353
20354 int main() {
20355
20356 /* The GNU C library defines this for functions which it implements
20357     to always fail with ENOSYS.  Some functions are actually named
20358     something starting with __ and the normal name is an alias.  */
20359 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
20360 choke me
20361 #else
20362 f = gdbm_open;
20363 #endif
20364
20365 ; return 0; }
20366 EOF
20367 if { (eval echo configure:20368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20368   rm -rf conftest*
20369   eval "ac_cv_func_gdbm_open=yes"
20370 else
20371   echo "configure: failed program was:" >&5
20372   cat conftest.$ac_ext >&5
20373   rm -rf conftest*
20374   eval "ac_cv_func_gdbm_open=no"
20375 fi
20376 rm -f conftest*
20377 fi
20378
20379 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
20380   echo "$ac_t""yes" 1>&6
20381   ol_cv_lib_gdbm=yes
20382 else
20383   echo "$ac_t""no" 1>&6
20384
20385                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
20386 echo "configure:20387: checking for gdbm_open in -lgdbm" >&5
20387 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
20388 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20389   echo $ac_n "(cached) $ac_c" 1>&6
20390 else
20391   ac_save_LIBS="$LIBS"
20392 LIBS="-lgdbm  $LIBS"
20393 cat > conftest.$ac_ext <<EOF
20394 #line 20395 "configure"
20395 #include "confdefs.h"
20396 /* Override any gcc2 internal prototype to avoid an error.  */
20397 /* We use char because int might match the return type of a gcc2
20398     builtin and then its argument prototype would still apply.  */
20399 char gdbm_open();
20400
20401 int main() {
20402 gdbm_open()
20403 ; return 0; }
20404 EOF
20405 if { (eval echo configure:20406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20406   rm -rf conftest*
20407   eval "ac_cv_lib_$ac_lib_var=yes"
20408 else
20409   echo "configure: failed program was:" >&5
20410   cat conftest.$ac_ext >&5
20411   rm -rf conftest*
20412   eval "ac_cv_lib_$ac_lib_var=no"
20413 fi
20414 rm -f conftest*
20415 LIBS="$ac_save_LIBS"
20416
20417 fi
20418 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20419   echo "$ac_t""yes" 1>&6
20420   ol_cv_lib_gdbm=-lgdbm
20421 else
20422   echo "$ac_t""no" 1>&6
20423 ol_cv_lib_gdbm=no
20424 fi
20425
20426         
20427 fi
20428
20429         LIBS="$ol_LIBS"
20430
20431 fi
20432
20433 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
20434
20435
20436  for ac_hdr in gdbm.h
20437 do
20438 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20439 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20440 echo "configure:20441: checking for $ac_hdr" >&5
20441 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20442   echo $ac_n "(cached) $ac_c" 1>&6
20443 else
20444   cat > conftest.$ac_ext <<EOF
20445 #line 20446 "configure"
20446 #include "confdefs.h"
20447 #include <$ac_hdr>
20448 EOF
20449 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20450 { (eval echo configure:20451: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20451 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20452 if test -z "$ac_err"; then
20453   rm -rf conftest*
20454   eval "ac_cv_header_$ac_safe=yes"
20455 else
20456   echo "$ac_err" >&5
20457   echo "configure: failed program was:" >&5
20458   cat conftest.$ac_ext >&5
20459   rm -rf conftest*
20460   eval "ac_cv_header_$ac_safe=no"
20461 fi
20462 rm -f conftest*
20463 fi
20464 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20465   echo "$ac_t""yes" 1>&6
20466     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20467   cat >> confdefs.h <<EOF
20468 #define $ac_tr_hdr 1
20469 EOF
20470  
20471 else
20472   echo "$ac_t""no" 1>&6
20473 fi
20474 done
20475
20476  echo $ac_n "checking for db""... $ac_c" 1>&6
20477 echo "configure:20478: checking for db" >&5
20478 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
20479   echo $ac_n "(cached) $ac_c" 1>&6
20480 else
20481   
20482         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
20483                 ol_cv_gdbm=no
20484         else
20485                 ol_cv_gdbm=yes
20486         fi
20487
20488 fi
20489
20490 echo "$ac_t""$ol_cv_gdbm" 1>&6
20491  if test $ol_cv_gdbm = yes ; then
20492         cat >> confdefs.h <<\EOF
20493 #define HAVE_GDBM 1
20494 EOF
20495
20496  fi
20497
20498
20499         if test $ol_cv_gdbm = yes ; then
20500                 ol_link_ldbm=gdbm
20501                 ol_with_ldbm_api=gdbm
20502
20503                 if test $ol_cv_lib_gdbm != yes ; then
20504                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
20505                 fi
20506         fi
20507 fi
20508
20509 if test $ol_with_ldbm_api = ndbm ; then
20510         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
20511 echo "configure:20512: checking for NDBM library" >&5
20512 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
20513   echo $ac_n "(cached) $ac_c" 1>&6
20514 else
20515         ol_LIBS="$LIBS"
20516         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
20517 echo "configure:20518: checking for dbm_open" >&5
20518 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
20519   echo $ac_n "(cached) $ac_c" 1>&6
20520 else
20521   cat > conftest.$ac_ext <<EOF
20522 #line 20523 "configure"
20523 #include "confdefs.h"
20524 /* System header to define __stub macros and hopefully few prototypes,
20525     which can conflict with char dbm_open(); below.  */
20526 #include <assert.h>
20527 /* Override any gcc2 internal prototype to avoid an error.  */
20528 /* We use char because int might match the return type of a gcc2
20529     builtin and then its argument prototype would still apply.  */
20530 char dbm_open();
20531 char (*f)();
20532
20533 int main() {
20534
20535 /* The GNU C library defines this for functions which it implements
20536     to always fail with ENOSYS.  Some functions are actually named
20537     something starting with __ and the normal name is an alias.  */
20538 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
20539 choke me
20540 #else
20541 f = dbm_open;
20542 #endif
20543
20544 ; return 0; }
20545 EOF
20546 if { (eval echo configure:20547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20547   rm -rf conftest*
20548   eval "ac_cv_func_dbm_open=yes"
20549 else
20550   echo "configure: failed program was:" >&5
20551   cat conftest.$ac_ext >&5
20552   rm -rf conftest*
20553   eval "ac_cv_func_dbm_open=no"
20554 fi
20555 rm -f conftest*
20556 fi
20557
20558 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
20559   echo "$ac_t""yes" 1>&6
20560   ol_cv_lib_ndbm=yes
20561 else
20562   echo "$ac_t""no" 1>&6
20563
20564                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
20565 echo "configure:20566: checking for dbm_open in -lndbm" >&5
20566 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
20567 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20568   echo $ac_n "(cached) $ac_c" 1>&6
20569 else
20570   ac_save_LIBS="$LIBS"
20571 LIBS="-lndbm  $LIBS"
20572 cat > conftest.$ac_ext <<EOF
20573 #line 20574 "configure"
20574 #include "confdefs.h"
20575 /* Override any gcc2 internal prototype to avoid an error.  */
20576 /* We use char because int might match the return type of a gcc2
20577     builtin and then its argument prototype would still apply.  */
20578 char dbm_open();
20579
20580 int main() {
20581 dbm_open()
20582 ; return 0; }
20583 EOF
20584 if { (eval echo configure:20585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20585   rm -rf conftest*
20586   eval "ac_cv_lib_$ac_lib_var=yes"
20587 else
20588   echo "configure: failed program was:" >&5
20589   cat conftest.$ac_ext >&5
20590   rm -rf conftest*
20591   eval "ac_cv_lib_$ac_lib_var=no"
20592 fi
20593 rm -f conftest*
20594 LIBS="$ac_save_LIBS"
20595
20596 fi
20597 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20598   echo "$ac_t""yes" 1>&6
20599   ol_cv_lib_ndbm=-lndbm
20600 else
20601   echo "$ac_t""no" 1>&6
20602
20603                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
20604 echo "configure:20605: checking for dbm_open in -ldbm" >&5
20605 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
20606 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20607   echo $ac_n "(cached) $ac_c" 1>&6
20608 else
20609   ac_save_LIBS="$LIBS"
20610 LIBS="-ldbm  $LIBS"
20611 cat > conftest.$ac_ext <<EOF
20612 #line 20613 "configure"
20613 #include "confdefs.h"
20614 /* Override any gcc2 internal prototype to avoid an error.  */
20615 /* We use char because int might match the return type of a gcc2
20616     builtin and then its argument prototype would still apply.  */
20617 char dbm_open();
20618
20619 int main() {
20620 dbm_open()
20621 ; return 0; }
20622 EOF
20623 if { (eval echo configure:20624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20624   rm -rf conftest*
20625   eval "ac_cv_lib_$ac_lib_var=yes"
20626 else
20627   echo "configure: failed program was:" >&5
20628   cat conftest.$ac_ext >&5
20629   rm -rf conftest*
20630   eval "ac_cv_lib_$ac_lib_var=no"
20631 fi
20632 rm -f conftest*
20633 LIBS="$ac_save_LIBS"
20634
20635 fi
20636 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20637   echo "$ac_t""yes" 1>&6
20638   ol_cv_lib_ndbm=-ldbm
20639 else
20640   echo "$ac_t""no" 1>&6
20641 ol_cv_lib_ndbm=no
20642 fi
20643                 
20644 fi
20645
20646         
20647 fi
20648
20649         LIBS="$ol_LIBS"
20650
20651 fi
20652
20653 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
20654
20655
20656  for ac_hdr in ndbm.h
20657 do
20658 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20659 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20660 echo "configure:20661: checking for $ac_hdr" >&5
20661 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20662   echo $ac_n "(cached) $ac_c" 1>&6
20663 else
20664   cat > conftest.$ac_ext <<EOF
20665 #line 20666 "configure"
20666 #include "confdefs.h"
20667 #include <$ac_hdr>
20668 EOF
20669 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20670 { (eval echo configure:20671: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20671 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20672 if test -z "$ac_err"; then
20673   rm -rf conftest*
20674   eval "ac_cv_header_$ac_safe=yes"
20675 else
20676   echo "$ac_err" >&5
20677   echo "configure: failed program was:" >&5
20678   cat conftest.$ac_ext >&5
20679   rm -rf conftest*
20680   eval "ac_cv_header_$ac_safe=no"
20681 fi
20682 rm -f conftest*
20683 fi
20684 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20685   echo "$ac_t""yes" 1>&6
20686     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20687   cat >> confdefs.h <<EOF
20688 #define $ac_tr_hdr 1
20689 EOF
20690  
20691 else
20692   echo "$ac_t""no" 1>&6
20693 fi
20694 done
20695
20696  echo $ac_n "checking for db""... $ac_c" 1>&6
20697 echo "configure:20698: checking for db" >&5
20698 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
20699   echo $ac_n "(cached) $ac_c" 1>&6
20700 else
20701   
20702         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
20703                 ol_cv_ndbm=no
20704         else
20705                 ol_cv_ndbm=yes
20706         fi
20707
20708 fi
20709
20710 echo "$ac_t""$ol_cv_ndbm" 1>&6
20711  if test $ol_cv_ndbm = yes ; then
20712         cat >> confdefs.h <<\EOF
20713 #define HAVE_NDBM 1
20714 EOF
20715
20716  fi
20717
20718
20719         if test $ol_cv_ndbm = yes ; then
20720                 ol_link_ldbm=ndbm
20721                 ol_with_ldbm_api=ndbm
20722
20723                 if test $ol_cv_lib_ndbm != yes ; then
20724                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
20725                 fi
20726         fi
20727 fi
20728
20729 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
20730         echo "configure: warning: could not find suitable LDBM backend" 1>&2
20731         if test $ol_enable_ldbm = yes ; then
20732                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
20733         fi
20734
20735         echo "configure: warning: disabling LDBM" 1>&2
20736         ol_enable_ldbm=no
20737 fi
20738
20739 if test $ol_enable_bdb = yes -o \
20740         $ol_enable_hdb = yes -o \
20741         $ol_enable_ldbm = yes ; then
20742         SLAPD_LIBS="$SLAPD_LIBS \$(LDBM_LIBS)"
20743 fi
20744
20745
20746 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
20747         BUILD_LIBS_DYNAMIC=shared
20748         cat >> confdefs.h <<\EOF
20749 #define LDAP_LIBS_DYNAMIC 1
20750 EOF
20751
20752         LTSTATIC=""
20753 else
20754         BUILD_LIBS_DYNAMIC=static
20755         LTSTATIC="-static"
20756 fi
20757
20758 if test $ol_enable_wrappers != no ; then
20759         for ac_hdr in tcpd.h
20760 do
20761 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20762 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20763 echo "configure:20764: checking for $ac_hdr" >&5
20764 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20765   echo $ac_n "(cached) $ac_c" 1>&6
20766 else
20767   cat > conftest.$ac_ext <<EOF
20768 #line 20769 "configure"
20769 #include "confdefs.h"
20770 #include <$ac_hdr>
20771 EOF
20772 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20773 { (eval echo configure:20774: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20774 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20775 if test -z "$ac_err"; then
20776   rm -rf conftest*
20777   eval "ac_cv_header_$ac_safe=yes"
20778 else
20779   echo "$ac_err" >&5
20780   echo "configure: failed program was:" >&5
20781   cat conftest.$ac_ext >&5
20782   rm -rf conftest*
20783   eval "ac_cv_header_$ac_safe=no"
20784 fi
20785 rm -f conftest*
20786 fi
20787 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20788   echo "$ac_t""yes" 1>&6
20789     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20790   cat >> confdefs.h <<EOF
20791 #define $ac_tr_hdr 1
20792 EOF
20793  
20794                 echo $ac_n "checking for TCP wrappers library""... $ac_c" 1>&6
20795 echo "configure:20796: checking for TCP wrappers library" >&5
20796                 save_LIBS="$LIBS"
20797                 LIBS="$LIBS -lwrap"
20798                 cat > conftest.$ac_ext <<EOF
20799 #line 20800 "configure"
20800 #include "confdefs.h"
20801
20802 #include <tcpd.h>
20803 int allow_severity = 0;
20804 int deny_severity  = 0;
20805
20806 struct request_info *req;
20807                 
20808 int main() {
20809
20810 hosts_access(req)
20811                 
20812 ; return 0; }
20813 EOF
20814 if { (eval echo configure:20815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20815   rm -rf conftest*
20816   echo "$ac_t""-lwrap" 1>&6
20817                 have_wrappers=yes
20818                 LIBS="$save_LIBS"
20819 else
20820   echo "configure: failed program was:" >&5
20821   cat conftest.$ac_ext >&5
20822   rm -rf conftest*
20823   
20824                                 LIBS="$LIBS -lnsl"
20825                 cat > conftest.$ac_ext <<EOF
20826 #line 20827 "configure"
20827 #include "confdefs.h"
20828
20829 #include <tcpd.h>
20830 int allow_severity = 0;
20831 int deny_severity  = 0;
20832
20833 struct request_info *req;
20834                 
20835 int main() {
20836
20837 hosts_access(req)
20838                 
20839 ; return 0; }
20840 EOF
20841 if { (eval echo configure:20842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20842   rm -rf conftest*
20843   echo "$ac_t""-lwrap -lnsl" 1>&6
20844                 have_wrappers=yes
20845                 LIBS="$save_LIBS -lnsl"
20846 else
20847   echo "configure: failed program was:" >&5
20848   cat conftest.$ac_ext >&5
20849   rm -rf conftest*
20850   
20851                 echo "$ac_t""no" 1>&6
20852                 have_wrappers=no
20853                 LIBS=$save_LIBS
20854 fi
20855 rm -f conftest*
20856 fi
20857 rm -f conftest*
20858 else
20859   echo "$ac_t""no" 1>&6
20860 have_wrappers=no
20861 fi
20862 done
20863
20864
20865         if test $have_wrappers = yes ; then
20866                 cat >> confdefs.h <<\EOF
20867 #define HAVE_TCPD 1
20868 EOF
20869
20870                 WRAP_LIBS="-lwrap"
20871         elif test $ol_enable_wrappers = yes ; then
20872                 { echo "configure: error: could not find TCP wrappers, select apppropriate options or disable" 1>&2; exit 1; }
20873         else
20874                 echo "configure: warning: could not find TCP wrappers, support disabled" 1>&2
20875                 WRAP_LIBS=""
20876         fi
20877 fi
20878
20879 if test $ol_enable_syslog != no ; then
20880         echo $ac_n "checking for openlog""... $ac_c" 1>&6
20881 echo "configure:20882: checking for openlog" >&5
20882 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
20883   echo $ac_n "(cached) $ac_c" 1>&6
20884 else
20885   cat > conftest.$ac_ext <<EOF
20886 #line 20887 "configure"
20887 #include "confdefs.h"
20888 /* System header to define __stub macros and hopefully few prototypes,
20889     which can conflict with char openlog(); below.  */
20890 #include <assert.h>
20891 /* Override any gcc2 internal prototype to avoid an error.  */
20892 /* We use char because int might match the return type of a gcc2
20893     builtin and then its argument prototype would still apply.  */
20894 char openlog();
20895 char (*f)();
20896
20897 int main() {
20898
20899 /* The GNU C library defines this for functions which it implements
20900     to always fail with ENOSYS.  Some functions are actually named
20901     something starting with __ and the normal name is an alias.  */
20902 #if defined (__stub_openlog) || defined (__stub___openlog)
20903 choke me
20904 #else
20905 f = openlog;
20906 #endif
20907
20908 ; return 0; }
20909 EOF
20910 if { (eval echo configure:20911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20911   rm -rf conftest*
20912   eval "ac_cv_func_openlog=yes"
20913 else
20914   echo "configure: failed program was:" >&5
20915   cat conftest.$ac_ext >&5
20916   rm -rf conftest*
20917   eval "ac_cv_func_openlog=no"
20918 fi
20919 rm -f conftest*
20920 fi
20921
20922 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
20923   echo "$ac_t""yes" 1>&6
20924   :
20925 else
20926   echo "$ac_t""no" 1>&6
20927 fi
20928
20929         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
20930                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
20931         fi
20932         ol_enable_syslog=$ac_cv_func_openlog
20933 fi
20934
20935
20936 ol_link_sql=no
20937 if test $ol_enable_sql != no ; then
20938         for ac_hdr in sql.h sqlext.h
20939 do
20940 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20941 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20942 echo "configure:20943: checking for $ac_hdr" >&5
20943 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20944   echo $ac_n "(cached) $ac_c" 1>&6
20945 else
20946   cat > conftest.$ac_ext <<EOF
20947 #line 20948 "configure"
20948 #include "confdefs.h"
20949 #include <$ac_hdr>
20950 EOF
20951 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20952 { (eval echo configure:20953: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20953 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20954 if test -z "$ac_err"; then
20955   rm -rf conftest*
20956   eval "ac_cv_header_$ac_safe=yes"
20957 else
20958   echo "$ac_err" >&5
20959   echo "configure: failed program was:" >&5
20960   cat conftest.$ac_ext >&5
20961   rm -rf conftest*
20962   eval "ac_cv_header_$ac_safe=no"
20963 fi
20964 rm -f conftest*
20965 fi
20966 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20967   echo "$ac_t""yes" 1>&6
20968     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20969   cat >> confdefs.h <<EOF
20970 #define $ac_tr_hdr 1
20971 EOF
20972  
20973 else
20974   echo "$ac_t""no" 1>&6
20975 { echo "configure: error: could not locate SQL headers" 1>&2; exit 1; }
20976         
20977 fi
20978 done
20979
20980
20981         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
20982 echo "configure:20983: checking for SQLDriverConnect in -liodbc" >&5
20983 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
20984 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20985   echo $ac_n "(cached) $ac_c" 1>&6
20986 else
20987   ac_save_LIBS="$LIBS"
20988 LIBS="-liodbc  $LIBS"
20989 cat > conftest.$ac_ext <<EOF
20990 #line 20991 "configure"
20991 #include "confdefs.h"
20992 /* Override any gcc2 internal prototype to avoid an error.  */
20993 /* We use char because int might match the return type of a gcc2
20994     builtin and then its argument prototype would still apply.  */
20995 char SQLDriverConnect();
20996
20997 int main() {
20998 SQLDriverConnect()
20999 ; return 0; }
21000 EOF
21001 if { (eval echo configure:21002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21002   rm -rf conftest*
21003   eval "ac_cv_lib_$ac_lib_var=yes"
21004 else
21005   echo "configure: failed program was:" >&5
21006   cat conftest.$ac_ext >&5
21007   rm -rf conftest*
21008   eval "ac_cv_lib_$ac_lib_var=no"
21009 fi
21010 rm -f conftest*
21011 LIBS="$ac_save_LIBS"
21012
21013 fi
21014 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
21015   echo "$ac_t""yes" 1>&6
21016   have_iodbc=yes
21017 else
21018   echo "$ac_t""no" 1>&6
21019 have_iodbc=no
21020 fi
21021
21022         if test $have_iodbc = yes ; then
21023                 ol_link_sql="-liodbc"
21024         else
21025                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
21026 echo "configure:21027: checking for SQLDriverConnect in -lodbc" >&5
21027 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
21028 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
21029   echo $ac_n "(cached) $ac_c" 1>&6
21030 else
21031   ac_save_LIBS="$LIBS"
21032 LIBS="-lodbc  $LIBS"
21033 cat > conftest.$ac_ext <<EOF
21034 #line 21035 "configure"
21035 #include "confdefs.h"
21036 /* Override any gcc2 internal prototype to avoid an error.  */
21037 /* We use char because int might match the return type of a gcc2
21038     builtin and then its argument prototype would still apply.  */
21039 char SQLDriverConnect();
21040
21041 int main() {
21042 SQLDriverConnect()
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   eval "ac_cv_lib_$ac_lib_var=yes"
21048 else
21049   echo "configure: failed program was:" >&5
21050   cat conftest.$ac_ext >&5
21051   rm -rf conftest*
21052   eval "ac_cv_lib_$ac_lib_var=no"
21053 fi
21054 rm -f conftest*
21055 LIBS="$ac_save_LIBS"
21056
21057 fi
21058 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
21059   echo "$ac_t""yes" 1>&6
21060   have_odbc=yes
21061 else
21062   echo "$ac_t""no" 1>&6
21063 have_odbc=no
21064 fi
21065
21066                 if test $have_odbc = yes ; then
21067                         ol_link_sql="-lodbc"
21068                 fi
21069         fi
21070
21071         if test $ol_link_sql != no ; then
21072                 SLAPD_SQL_LIBS="$ol_link_sql"
21073
21074         elif test $ol_enable_sql != auto ; then
21075                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
21076         fi
21077 fi
21078
21079 ol_link_sasl=no
21080 ol_link_spasswd=no
21081 if test $ol_with_cyrus_sasl != no ; then
21082         for ac_hdr in sasl/sasl.h sasl.h
21083 do
21084 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
21085 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
21086 echo "configure:21087: checking for $ac_hdr" >&5
21087 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
21088   echo $ac_n "(cached) $ac_c" 1>&6
21089 else
21090   cat > conftest.$ac_ext <<EOF
21091 #line 21092 "configure"
21092 #include "confdefs.h"
21093 #include <$ac_hdr>
21094 EOF
21095 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
21096 { (eval echo configure:21097: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
21097 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
21098 if test -z "$ac_err"; then
21099   rm -rf conftest*
21100   eval "ac_cv_header_$ac_safe=yes"
21101 else
21102   echo "$ac_err" >&5
21103   echo "configure: failed program was:" >&5
21104   cat conftest.$ac_ext >&5
21105   rm -rf conftest*
21106   eval "ac_cv_header_$ac_safe=no"
21107 fi
21108 rm -f conftest*
21109 fi
21110 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
21111   echo "$ac_t""yes" 1>&6
21112     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
21113   cat >> confdefs.h <<EOF
21114 #define $ac_tr_hdr 1
21115 EOF
21116  
21117 else
21118   echo "$ac_t""no" 1>&6
21119 fi
21120 done
21121
21122
21123         if test $ac_cv_header_sasl_sasl_h = yes -o $ac_cv_header_sasl_h = yes; then
21124                 echo $ac_n "checking for sasl_client_init in -lsasl2""... $ac_c" 1>&6
21125 echo "configure:21126: checking for sasl_client_init in -lsasl2" >&5
21126 ac_lib_var=`echo sasl2'_'sasl_client_init | sed 'y%./+-:%__p__%'`
21127 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
21128   echo $ac_n "(cached) $ac_c" 1>&6
21129 else
21130   ac_save_LIBS="$LIBS"
21131 LIBS="-lsasl2  $LIBS"
21132 cat > conftest.$ac_ext <<EOF
21133 #line 21134 "configure"
21134 #include "confdefs.h"
21135 /* Override any gcc2 internal prototype to avoid an error.  */
21136 /* We use char because int might match the return type of a gcc2
21137     builtin and then its argument prototype would still apply.  */
21138 char sasl_client_init();
21139
21140 int main() {
21141 sasl_client_init()
21142 ; return 0; }
21143 EOF
21144 if { (eval echo configure:21145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21145   rm -rf conftest*
21146   eval "ac_cv_lib_$ac_lib_var=yes"
21147 else
21148   echo "configure: failed program was:" >&5
21149   cat conftest.$ac_ext >&5
21150   rm -rf conftest*
21151   eval "ac_cv_lib_$ac_lib_var=no"
21152 fi
21153 rm -f conftest*
21154 LIBS="$ac_save_LIBS"
21155
21156 fi
21157 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
21158   echo "$ac_t""yes" 1>&6
21159   ol_link_sasl="-lsasl2"
21160 else
21161   echo "$ac_t""no" 1>&6
21162 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
21163 echo "configure:21164: checking for sasl_client_init in -lsasl" >&5
21164 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
21165 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
21166   echo $ac_n "(cached) $ac_c" 1>&6
21167 else
21168   ac_save_LIBS="$LIBS"
21169 LIBS="-lsasl  $LIBS"
21170 cat > conftest.$ac_ext <<EOF
21171 #line 21172 "configure"
21172 #include "confdefs.h"
21173 /* Override any gcc2 internal prototype to avoid an error.  */
21174 /* We use char because int might match the return type of a gcc2
21175     builtin and then its argument prototype would still apply.  */
21176 char sasl_client_init();
21177
21178 int main() {
21179 sasl_client_init()
21180 ; return 0; }
21181 EOF
21182 if { (eval echo configure:21183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21183   rm -rf conftest*
21184   eval "ac_cv_lib_$ac_lib_var=yes"
21185 else
21186   echo "configure: failed program was:" >&5
21187   cat conftest.$ac_ext >&5
21188   rm -rf conftest*
21189   eval "ac_cv_lib_$ac_lib_var=no"
21190 fi
21191 rm -f conftest*
21192 LIBS="$ac_save_LIBS"
21193
21194 fi
21195 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
21196   echo "$ac_t""yes" 1>&6
21197   ol_link_sasl="-lsasl"
21198 else
21199   echo "$ac_t""no" 1>&6
21200 fi
21201
21202 fi
21203
21204         fi
21205
21206         if test $ol_link_sasl = no ; then
21207                 if test $ol_with_cyrus_sasl != auto ; then
21208                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
21209                 else
21210                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
21211                         echo "configure: warning: SASL authentication not supported!" 1>&2
21212                         if test $ol_link_tls = no ; then
21213                                 echo "configure: warning: Strong authentication not supported!" 1>&2
21214                         fi
21215                 fi
21216         else
21217                 echo $ac_n "checking Cyrus SASL library version""... $ac_c" 1>&6
21218 echo "configure:21219: checking Cyrus SASL library version" >&5
21219 if eval "test \"\${ol_cv_sasl_compat+set}\" = set"; then
21220   echo $ac_n "(cached) $ac_c" 1>&6
21221 else
21222   
21223         cat > conftest.$ac_ext <<EOF
21224 #line 21225 "configure"
21225 #include "confdefs.h"
21226
21227 #ifdef HAVE_SASL_SASL_H
21228 #include <sasl/sasl.h>
21229 #else
21230 #include <sasl.h>
21231 #endif
21232
21233 /* Require 2.1.15+ */
21234 #if SASL_VERSION_MAJOR == 2  && SASL_VERSION_MINOR > 1
21235         char *__sasl_compat = "2.2+ or better okay (we guess)";
21236 #elif SASL_VERSION_MAJOR == 2  && SASL_VERSION_MINOR == 1 \
21237         && SASL_VERSION_STEP >=15
21238         char *__sasl_compat = "2.1.15+ or better okay";
21239 #endif
21240         
21241 EOF
21242 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21243   egrep "__sasl_compat" >/dev/null 2>&1; then
21244   rm -rf conftest*
21245   ol_cv_sasl_compat=yes
21246 else
21247   rm -rf conftest*
21248   ol_cv_sasl_compat=no
21249 fi
21250 rm -f conftest*
21251
21252 fi
21253
21254 echo "$ac_t""$ol_cv_sasl_compat" 1>&6
21255
21256                 if test $ol_cv_sasl_compat = no ; then
21257                         ol_link_sasl=no
21258                         { echo "configure: error: Cyrus SASL library located but is incompatible" 1>&2; exit 1; }
21259                 fi
21260
21261                 cat >> confdefs.h <<\EOF
21262 #define HAVE_CYRUS_SASL 1
21263 EOF
21264
21265                 SASL_LIBS="$ol_link_sasl"
21266                 if test $ol_enable_spasswd != no ; then
21267                         ol_link_spasswd=yes
21268                 fi
21269
21270                 ac_save_LIBS="$LIBS"
21271                 LIBS="$LIBS $ol_link_sasl"
21272                 echo $ac_n "checking for sasl_version""... $ac_c" 1>&6
21273 echo "configure:21274: checking for sasl_version" >&5
21274 if eval "test \"\${ac_cv_func_sasl_version+set}\" = set"; then
21275   echo $ac_n "(cached) $ac_c" 1>&6
21276 else
21277   cat > conftest.$ac_ext <<EOF
21278 #line 21279 "configure"
21279 #include "confdefs.h"
21280 /* System header to define __stub macros and hopefully few prototypes,
21281     which can conflict with char sasl_version(); below.  */
21282 #include <assert.h>
21283 /* Override any gcc2 internal prototype to avoid an error.  */
21284 /* We use char because int might match the return type of a gcc2
21285     builtin and then its argument prototype would still apply.  */
21286 char sasl_version();
21287 char (*f)();
21288
21289 int main() {
21290
21291 /* The GNU C library defines this for functions which it implements
21292     to always fail with ENOSYS.  Some functions are actually named
21293     something starting with __ and the normal name is an alias.  */
21294 #if defined (__stub_sasl_version) || defined (__stub___sasl_version)
21295 choke me
21296 #else
21297 f = sasl_version;
21298 #endif
21299
21300 ; return 0; }
21301 EOF
21302 if { (eval echo configure:21303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21303   rm -rf conftest*
21304   eval "ac_cv_func_sasl_version=yes"
21305 else
21306   echo "configure: failed program was:" >&5
21307   cat conftest.$ac_ext >&5
21308   rm -rf conftest*
21309   eval "ac_cv_func_sasl_version=no"
21310 fi
21311 rm -f conftest*
21312 fi
21313
21314 if eval "test \"`echo '$ac_cv_func_'sasl_version`\" = yes"; then
21315   echo "$ac_t""yes" 1>&6
21316   cat >> confdefs.h <<\EOF
21317 #define HAVE_SASL_VERSION 1
21318 EOF
21319
21320 else
21321   echo "$ac_t""no" 1>&6
21322 fi
21323
21324                 LIBS="$ac_save_LIBS"
21325         fi
21326
21327 else
21328         echo "configure: warning: SASL authentication not supported!" 1>&2
21329         if test $ol_link_tls = no ; then
21330                 echo "configure: warning: Strong authentication not supported!" 1>&2
21331         fi
21332 fi
21333
21334 if test $cross_compiling != yes -a "$ac_cv_mingw32" != yes ; then
21335         dev=no
21336         if test -r /dev/urandom ; then
21337                 dev="/dev/urandom";
21338         elif test -r /idev/urandom ; then
21339                 dev="/idev/urandom";
21340         elif test -r /dev/srandom ; then
21341                 dev="/dev/srandom";
21342         elif test -r /dev/random ; then
21343                 dev="/dev/random";
21344         elif test -r /idev/random ; then
21345                 dev="/idev/random";
21346         fi
21347
21348         if test $dev != no ; then
21349                 cat >> confdefs.h <<EOF
21350 #define URANDOM_DEVICE "$dev"
21351 EOF
21352
21353         fi
21354 fi
21355
21356 ol_link_fetch=no
21357 if test $ol_with_fetch != no ; then
21358         ol_LIBS=$LIBS
21359 LIBS="-lfetch -lcom_err $LIBS"
21360 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
21361 echo "configure:21362: checking fetch(3) library" >&5
21362 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
21363   echo $ac_n "(cached) $ac_c" 1>&6
21364 else
21365   
21366         cat > conftest.$ac_ext <<EOF
21367 #line 21368 "configure"
21368 #include "confdefs.h"
21369
21370 #include <sys/param.h>
21371 #include <stdio.h>
21372 #include <fetch.h>
21373 int main() {
21374 struct url *u = fetchParseURL("file:///"); 
21375 ; return 0; }
21376 EOF
21377 if { (eval echo configure:21378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21378   rm -rf conftest*
21379   ol_cv_lib_fetch=yes
21380 else
21381   echo "configure: failed program was:" >&5
21382   cat conftest.$ac_ext >&5
21383   rm -rf conftest*
21384   ol_cv_lib_fetch=no
21385 fi
21386 rm -f conftest*
21387 fi
21388
21389 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
21390 LIBS=$ol_LIBS
21391 if test $ol_cv_lib_fetch != no ; then
21392         ol_link_fetch="-lfetch -lcom_err"
21393         cat >> confdefs.h <<\EOF
21394 #define HAVE_FETCH 1
21395 EOF
21396
21397 fi
21398
21399
21400         if test $ol_cv_lib_fetch != no ; then
21401                 LUTIL_LIBS="$LUTIL_LIBS $ol_link_fetch"
21402                 ol_link_fetch=freebsd
21403
21404         elif test $ol_with_fetch != auto ; then
21405                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
21406         fi 
21407 fi
21408
21409 if test $ol_enable_crypt != no ; then
21410         save_LIBS="$LIBS"
21411         LIBS="$TLS_LIBS $LIBS"
21412
21413         echo $ac_n "checking for crypt""... $ac_c" 1>&6
21414 echo "configure:21415: checking for crypt" >&5
21415 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
21416   echo $ac_n "(cached) $ac_c" 1>&6
21417 else
21418   cat > conftest.$ac_ext <<EOF
21419 #line 21420 "configure"
21420 #include "confdefs.h"
21421 /* System header to define __stub macros and hopefully few prototypes,
21422     which can conflict with char crypt(); below.  */
21423 #include <assert.h>
21424 /* Override any gcc2 internal prototype to avoid an error.  */
21425 /* We use char because int might match the return type of a gcc2
21426     builtin and then its argument prototype would still apply.  */
21427 char crypt();
21428 char (*f)();
21429
21430 int main() {
21431
21432 /* The GNU C library defines this for functions which it implements
21433     to always fail with ENOSYS.  Some functions are actually named
21434     something starting with __ and the normal name is an alias.  */
21435 #if defined (__stub_crypt) || defined (__stub___crypt)
21436 choke me
21437 #else
21438 f = crypt;
21439 #endif
21440
21441 ; return 0; }
21442 EOF
21443 if { (eval echo configure:21444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21444   rm -rf conftest*
21445   eval "ac_cv_func_crypt=yes"
21446 else
21447   echo "configure: failed program was:" >&5
21448   cat conftest.$ac_ext >&5
21449   rm -rf conftest*
21450   eval "ac_cv_func_crypt=no"
21451 fi
21452 rm -f conftest*
21453 fi
21454
21455 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
21456   echo "$ac_t""yes" 1>&6
21457   have_crypt=yes
21458 else
21459   echo "$ac_t""no" 1>&6
21460
21461                 LIBS="$save_LIBS"
21462                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
21463 echo "configure:21464: checking for crypt in -lcrypt" >&5
21464 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
21465 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
21466   echo $ac_n "(cached) $ac_c" 1>&6
21467 else
21468   ac_save_LIBS="$LIBS"
21469 LIBS="-lcrypt  $LIBS"
21470 cat > conftest.$ac_ext <<EOF
21471 #line 21472 "configure"
21472 #include "confdefs.h"
21473 /* Override any gcc2 internal prototype to avoid an error.  */
21474 /* We use char because int might match the return type of a gcc2
21475     builtin and then its argument prototype would still apply.  */
21476 char crypt();
21477
21478 int main() {
21479 crypt()
21480 ; return 0; }
21481 EOF
21482 if { (eval echo configure:21483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21483   rm -rf conftest*
21484   eval "ac_cv_lib_$ac_lib_var=yes"
21485 else
21486   echo "configure: failed program was:" >&5
21487   cat conftest.$ac_ext >&5
21488   rm -rf conftest*
21489   eval "ac_cv_lib_$ac_lib_var=no"
21490 fi
21491 rm -f conftest*
21492 LIBS="$ac_save_LIBS"
21493
21494 fi
21495 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
21496   echo "$ac_t""yes" 1>&6
21497   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
21498                         have_crypt=yes
21499 else
21500   echo "$ac_t""no" 1>&6
21501 have_crypt=no
21502 fi
21503
21504 fi
21505
21506
21507         LIBS="$save_LIBS"
21508
21509         if test $have_crypt = yes ; then
21510                 cat >> confdefs.h <<\EOF
21511 #define HAVE_CRYPT 1
21512 EOF
21513
21514         else
21515                 echo "configure: warning: could not find crypt" 1>&2
21516                 if test $ol_enable_crypt = yes ; then
21517                         { echo "configure: error: could not find crypt, select appropriate options or disable" 1>&2; exit 1; }
21518                 fi
21519
21520                 echo "configure: warning: disabling crypt support" 1>&2
21521                 ol_enable_crypt=no
21522         fi
21523 fi
21524
21525 if test $ol_enable_proctitle != no ; then
21526         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
21527 echo "configure:21528: checking for setproctitle" >&5
21528 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
21529   echo $ac_n "(cached) $ac_c" 1>&6
21530 else
21531   cat > conftest.$ac_ext <<EOF
21532 #line 21533 "configure"
21533 #include "confdefs.h"
21534 /* System header to define __stub macros and hopefully few prototypes,
21535     which can conflict with char setproctitle(); below.  */
21536 #include <assert.h>
21537 /* Override any gcc2 internal prototype to avoid an error.  */
21538 /* We use char because int might match the return type of a gcc2
21539     builtin and then its argument prototype would still apply.  */
21540 char setproctitle();
21541 char (*f)();
21542
21543 int main() {
21544
21545 /* The GNU C library defines this for functions which it implements
21546     to always fail with ENOSYS.  Some functions are actually named
21547     something starting with __ and the normal name is an alias.  */
21548 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
21549 choke me
21550 #else
21551 f = setproctitle;
21552 #endif
21553
21554 ; return 0; }
21555 EOF
21556 if { (eval echo configure:21557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21557   rm -rf conftest*
21558   eval "ac_cv_func_setproctitle=yes"
21559 else
21560   echo "configure: failed program was:" >&5
21561   cat conftest.$ac_ext >&5
21562   rm -rf conftest*
21563   eval "ac_cv_func_setproctitle=no"
21564 fi
21565 rm -f conftest*
21566 fi
21567
21568 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
21569   echo "$ac_t""yes" 1>&6
21570   have_setproctitle=yes
21571 else
21572   echo "$ac_t""no" 1>&6
21573
21574                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
21575 echo "configure:21576: checking for setproctitle in -lutil" >&5
21576 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
21577 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
21578   echo $ac_n "(cached) $ac_c" 1>&6
21579 else
21580   ac_save_LIBS="$LIBS"
21581 LIBS="-lutil  $LIBS"
21582 cat > conftest.$ac_ext <<EOF
21583 #line 21584 "configure"
21584 #include "confdefs.h"
21585 /* Override any gcc2 internal prototype to avoid an error.  */
21586 /* We use char because int might match the return type of a gcc2
21587     builtin and then its argument prototype would still apply.  */
21588 char setproctitle();
21589
21590 int main() {
21591 setproctitle()
21592 ; return 0; }
21593 EOF
21594 if { (eval echo configure:21595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21595   rm -rf conftest*
21596   eval "ac_cv_lib_$ac_lib_var=yes"
21597 else
21598   echo "configure: failed program was:" >&5
21599   cat conftest.$ac_ext >&5
21600   rm -rf conftest*
21601   eval "ac_cv_lib_$ac_lib_var=no"
21602 fi
21603 rm -f conftest*
21604 LIBS="$ac_save_LIBS"
21605
21606 fi
21607 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
21608   echo "$ac_t""yes" 1>&6
21609   have_setproctitle=yes
21610                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
21611 else
21612   echo "$ac_t""no" 1>&6
21613 have_setproctitle=no
21614                         LIBOBJS="$LIBOBJS setproctitle.o"
21615                         LIBSRCS="$LIBSRCS setproctitle.c"
21616 fi
21617
21618 fi
21619
21620
21621         if test $have_setproctitle = yes ; then
21622                 cat >> confdefs.h <<\EOF
21623 #define HAVE_SETPROCTITLE 1
21624 EOF
21625
21626         fi
21627 fi
21628
21629 if test $ol_enable_slp != no ; then
21630         for ac_hdr in slp.h 
21631 do
21632 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
21633 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
21634 echo "configure:21635: checking for $ac_hdr" >&5
21635 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
21636   echo $ac_n "(cached) $ac_c" 1>&6
21637 else
21638   cat > conftest.$ac_ext <<EOF
21639 #line 21640 "configure"
21640 #include "confdefs.h"
21641 #include <$ac_hdr>
21642 EOF
21643 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
21644 { (eval echo configure:21645: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
21645 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
21646 if test -z "$ac_err"; then
21647   rm -rf conftest*
21648   eval "ac_cv_header_$ac_safe=yes"
21649 else
21650   echo "$ac_err" >&5
21651   echo "configure: failed program was:" >&5
21652   cat conftest.$ac_ext >&5
21653   rm -rf conftest*
21654   eval "ac_cv_header_$ac_safe=no"
21655 fi
21656 rm -f conftest*
21657 fi
21658 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
21659   echo "$ac_t""yes" 1>&6
21660     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
21661   cat >> confdefs.h <<EOF
21662 #define $ac_tr_hdr 1
21663 EOF
21664  
21665 else
21666   echo "$ac_t""no" 1>&6
21667 fi
21668 done
21669
21670
21671         if test $ac_cv_header_slp_h = yes ; then
21672                 echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
21673 echo "configure:21674: checking for SLPOpen in -lslp" >&5
21674 ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-:%__p__%'`
21675 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
21676   echo $ac_n "(cached) $ac_c" 1>&6
21677 else
21678   ac_save_LIBS="$LIBS"
21679 LIBS="-lslp  $LIBS"
21680 cat > conftest.$ac_ext <<EOF
21681 #line 21682 "configure"
21682 #include "confdefs.h"
21683 /* Override any gcc2 internal prototype to avoid an error.  */
21684 /* We use char because int might match the return type of a gcc2
21685     builtin and then its argument prototype would still apply.  */
21686 char SLPOpen();
21687
21688 int main() {
21689 SLPOpen()
21690 ; return 0; }
21691 EOF
21692 if { (eval echo configure:21693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21693   rm -rf conftest*
21694   eval "ac_cv_lib_$ac_lib_var=yes"
21695 else
21696   echo "configure: failed program was:" >&5
21697   cat conftest.$ac_ext >&5
21698   rm -rf conftest*
21699   eval "ac_cv_lib_$ac_lib_var=no"
21700 fi
21701 rm -f conftest*
21702 LIBS="$ac_save_LIBS"
21703
21704 fi
21705 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
21706   echo "$ac_t""yes" 1>&6
21707   have_slp=yes
21708 else
21709   echo "$ac_t""no" 1>&6
21710 have_slp=no
21711 fi
21712
21713                 if test $have_slp = yes ; then
21714                         cat >> confdefs.h <<\EOF
21715 #define HAVE_SLP 1
21716 EOF
21717
21718                         SLAPD_SLP_LIBS=-lslp
21719                 fi
21720
21721         elif test $ol_enable_slp = yes ; then
21722                 { echo "configure: error: SLP not found" 1>&2; exit 1; }
21723         fi
21724 fi
21725
21726
21727 echo $ac_n "checking long long""... $ac_c" 1>&6
21728 echo "configure:21729: checking long long" >&5
21729 if eval "test \"\${ol_cv_type_long_long+set}\" = set"; then
21730   echo $ac_n "(cached) $ac_c" 1>&6
21731 else
21732   
21733         cat > conftest.$ac_ext <<EOF
21734 #line 21735 "configure"
21735 #include "confdefs.h"
21736
21737 int main() {
21738 long long x;
21739 ; return 0; }
21740 EOF
21741 if { (eval echo configure:21742: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21742   rm -rf conftest*
21743   ol_cv_type_long_long=yes
21744 else
21745   echo "configure: failed program was:" >&5
21746   cat conftest.$ac_ext >&5
21747   rm -rf conftest*
21748   ol_cv_type_long_long=no
21749 fi
21750 rm -f conftest*
21751 fi
21752
21753 echo "$ac_t""$ol_cv_type_long_long" 1>&6
21754 if test $ol_cv_type_long_long = yes; then
21755         cat >> confdefs.h <<\EOF
21756 #define HAVE_LONG_LONG 1
21757 EOF
21758
21759 fi
21760
21761 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
21762 echo "configure:21763: checking for ANSI C header files" >&5
21763 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
21764   echo $ac_n "(cached) $ac_c" 1>&6
21765 else
21766   cat > conftest.$ac_ext <<EOF
21767 #line 21768 "configure"
21768 #include "confdefs.h"
21769 #include <stdlib.h>
21770 #include <stdarg.h>
21771 #include <string.h>
21772 #include <float.h>
21773 EOF
21774 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
21775 { (eval echo configure:21776: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
21776 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
21777 if test -z "$ac_err"; then
21778   rm -rf conftest*
21779   ac_cv_header_stdc=yes
21780 else
21781   echo "$ac_err" >&5
21782   echo "configure: failed program was:" >&5
21783   cat conftest.$ac_ext >&5
21784   rm -rf conftest*
21785   ac_cv_header_stdc=no
21786 fi
21787 rm -f conftest*
21788
21789 if test $ac_cv_header_stdc = yes; then
21790   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
21791 cat > conftest.$ac_ext <<EOF
21792 #line 21793 "configure"
21793 #include "confdefs.h"
21794 #include <string.h>
21795 EOF
21796 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21797   egrep "memchr" >/dev/null 2>&1; then
21798   :
21799 else
21800   rm -rf conftest*
21801   ac_cv_header_stdc=no
21802 fi
21803 rm -f conftest*
21804
21805 fi
21806
21807 if test $ac_cv_header_stdc = yes; then
21808   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
21809 cat > conftest.$ac_ext <<EOF
21810 #line 21811 "configure"
21811 #include "confdefs.h"
21812 #include <stdlib.h>
21813 EOF
21814 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21815   egrep "free" >/dev/null 2>&1; then
21816   :
21817 else
21818   rm -rf conftest*
21819   ac_cv_header_stdc=no
21820 fi
21821 rm -f conftest*
21822
21823 fi
21824
21825 if test $ac_cv_header_stdc = yes; then
21826   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
21827 if test "$cross_compiling" = yes; then
21828   :
21829 else
21830   cat > conftest.$ac_ext <<EOF
21831 #line 21832 "configure"
21832 #include "confdefs.h"
21833 #include <ctype.h>
21834 #if ((' ' & 0x0FF) == 0x020)
21835 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
21836 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
21837 #else
21838 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
21839  || ('j' <= (c) && (c) <= 'r') \
21840  || ('s' <= (c) && (c) <= 'z'))
21841 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
21842 #endif
21843 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
21844 int main () { int i; for (i = 0; i < 256; i++)
21845 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
21846 exit (0); }
21847
21848 EOF
21849 if { (eval echo configure:21850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
21850 then
21851   :
21852 else
21853   echo "configure: failed program was:" >&5
21854   cat conftest.$ac_ext >&5
21855   rm -fr conftest*
21856   ac_cv_header_stdc=no
21857 fi
21858 rm -fr conftest*
21859 fi
21860
21861 fi
21862 fi
21863
21864 echo "$ac_t""$ac_cv_header_stdc" 1>&6
21865 if test $ac_cv_header_stdc = yes; then
21866   cat >> confdefs.h <<\EOF
21867 #define STDC_HEADERS 1
21868 EOF
21869
21870 fi
21871
21872 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
21873 echo "configure:21874: checking for mode_t" >&5
21874 if eval "test \"\${ac_cv_type_mode_t+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 #if STDC_HEADERS
21882 #include <stdlib.h>
21883 #include <stddef.h>
21884 #endif
21885
21886 EOF
21887 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21888   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21889   rm -rf conftest*
21890   eval "ac_cv_type_mode_t=yes"
21891 else
21892   rm -rf conftest*
21893   eval "ac_cv_type_mode_t=no"
21894 fi
21895 rm -f conftest*
21896
21897 fi
21898 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
21899   echo "$ac_t""yes" 1>&6
21900 else
21901   echo "$ac_t""no" 1>&6
21902   cat >> confdefs.h <<EOF
21903 #define mode_t int
21904 EOF
21905
21906 fi
21907
21908 echo $ac_n "checking for off_t""... $ac_c" 1>&6
21909 echo "configure:21910: checking for off_t" >&5
21910 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
21911   echo $ac_n "(cached) $ac_c" 1>&6
21912 else
21913   cat > conftest.$ac_ext <<EOF
21914 #line 21915 "configure"
21915 #include "confdefs.h"
21916 #include <sys/types.h>
21917 #if STDC_HEADERS
21918 #include <stdlib.h>
21919 #include <stddef.h>
21920 #endif
21921
21922 EOF
21923 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21924   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21925   rm -rf conftest*
21926   eval "ac_cv_type_off_t=yes"
21927 else
21928   rm -rf conftest*
21929   eval "ac_cv_type_off_t=no"
21930 fi
21931 rm -f conftest*
21932
21933 fi
21934 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
21935   echo "$ac_t""yes" 1>&6
21936 else
21937   echo "$ac_t""no" 1>&6
21938   cat >> confdefs.h <<EOF
21939 #define off_t long
21940 EOF
21941
21942 fi
21943
21944 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
21945 echo "configure:21946: checking for pid_t" >&5
21946 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
21947   echo $ac_n "(cached) $ac_c" 1>&6
21948 else
21949   cat > conftest.$ac_ext <<EOF
21950 #line 21951 "configure"
21951 #include "confdefs.h"
21952 #include <sys/types.h>
21953 #if STDC_HEADERS
21954 #include <stdlib.h>
21955 #include <stddef.h>
21956 #endif
21957
21958 EOF
21959 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21960   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21961   rm -rf conftest*
21962   eval "ac_cv_type_pid_t=yes"
21963 else
21964   rm -rf conftest*
21965   eval "ac_cv_type_pid_t=no"
21966 fi
21967 rm -f conftest*
21968
21969 fi
21970 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
21971   echo "$ac_t""yes" 1>&6
21972 else
21973   echo "$ac_t""no" 1>&6
21974   cat >> confdefs.h <<EOF
21975 #define pid_t int
21976 EOF
21977
21978 fi
21979
21980 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
21981 echo "configure:21982: checking for ptrdiff_t" >&5
21982 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
21983   echo $ac_n "(cached) $ac_c" 1>&6
21984 else
21985   cat > conftest.$ac_ext <<EOF
21986 #line 21987 "configure"
21987 #include "confdefs.h"
21988 #include <stddef.h>
21989 int main() {
21990 ptrdiff_t p
21991 ; return 0; }
21992 EOF
21993 if { (eval echo configure:21994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21994   rm -rf conftest*
21995   am_cv_type_ptrdiff_t=yes
21996 else
21997   echo "configure: failed program was:" >&5
21998   cat conftest.$ac_ext >&5
21999   rm -rf conftest*
22000   am_cv_type_ptrdiff_t=no
22001 fi
22002 rm -f conftest*
22003 fi
22004
22005 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
22006    if test $am_cv_type_ptrdiff_t = yes; then
22007      cat >> confdefs.h <<\EOF
22008 #define HAVE_PTRDIFF_T 1
22009 EOF
22010
22011    fi
22012
22013 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
22014 echo "configure:22015: checking return type of signal handlers" >&5
22015 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
22016   echo $ac_n "(cached) $ac_c" 1>&6
22017 else
22018   cat > conftest.$ac_ext <<EOF
22019 #line 22020 "configure"
22020 #include "confdefs.h"
22021 #include <sys/types.h>
22022 #include <signal.h>
22023 #ifdef signal
22024 #undef signal
22025 #endif
22026 #ifdef __cplusplus
22027 extern "C" void (*signal (int, void (*)(int)))(int);
22028 #else
22029 void (*signal ()) ();
22030 #endif
22031
22032 int main() {
22033 int i;
22034 ; return 0; }
22035 EOF
22036 if { (eval echo configure:22037: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22037   rm -rf conftest*
22038   ac_cv_type_signal=void
22039 else
22040   echo "configure: failed program was:" >&5
22041   cat conftest.$ac_ext >&5
22042   rm -rf conftest*
22043   ac_cv_type_signal=int
22044 fi
22045 rm -f conftest*
22046 fi
22047
22048 echo "$ac_t""$ac_cv_type_signal" 1>&6
22049 cat >> confdefs.h <<EOF
22050 #define RETSIGTYPE $ac_cv_type_signal
22051 EOF
22052
22053
22054 echo $ac_n "checking for size_t""... $ac_c" 1>&6
22055 echo "configure:22056: checking for size_t" >&5
22056 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
22057   echo $ac_n "(cached) $ac_c" 1>&6
22058 else
22059   cat > conftest.$ac_ext <<EOF
22060 #line 22061 "configure"
22061 #include "confdefs.h"
22062 #include <sys/types.h>
22063 #if STDC_HEADERS
22064 #include <stdlib.h>
22065 #include <stddef.h>
22066 #endif
22067
22068 EOF
22069 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
22070   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
22071   rm -rf conftest*
22072   eval "ac_cv_type_size_t=yes"
22073 else
22074   rm -rf conftest*
22075   eval "ac_cv_type_size_t=no"
22076 fi
22077 rm -f conftest*
22078
22079 fi
22080 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
22081   echo "$ac_t""yes" 1>&6
22082 else
22083   echo "$ac_t""no" 1>&6
22084   cat >> confdefs.h <<EOF
22085 #define size_t unsigned
22086 EOF
22087
22088 fi
22089
22090
22091 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
22092 echo "configure:22093: checking for ssize_t" >&5
22093 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
22094   echo $ac_n "(cached) $ac_c" 1>&6
22095 else
22096   cat > conftest.$ac_ext <<EOF
22097 #line 22098 "configure"
22098 #include "confdefs.h"
22099 #include <sys/types.h>
22100 #if STDC_HEADERS
22101 #include <stdlib.h>
22102 #include <stddef.h>
22103 #endif
22104
22105 EOF
22106 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
22107   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
22108   rm -rf conftest*
22109   eval "ac_cv_type_ssize_t=yes"
22110 else
22111   rm -rf conftest*
22112   eval "ac_cv_type_ssize_t=no"
22113 fi
22114 rm -f conftest*
22115
22116 fi
22117 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
22118   echo "$ac_t""yes" 1>&6
22119 else
22120   echo "$ac_t""no" 1>&6
22121   cat >> confdefs.h <<EOF
22122 #define ssize_t signed int
22123 EOF
22124
22125 fi
22126
22127 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
22128 echo "configure:22129: checking for caddr_t" >&5
22129 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
22130   echo $ac_n "(cached) $ac_c" 1>&6
22131 else
22132   cat > conftest.$ac_ext <<EOF
22133 #line 22134 "configure"
22134 #include "confdefs.h"
22135 #include <sys/types.h>
22136 #if STDC_HEADERS
22137 #include <stdlib.h>
22138 #include <stddef.h>
22139 #endif
22140
22141 EOF
22142 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
22143   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
22144   rm -rf conftest*
22145   eval "ac_cv_type_caddr_t=yes"
22146 else
22147   rm -rf conftest*
22148   eval "ac_cv_type_caddr_t=no"
22149 fi
22150 rm -f conftest*
22151
22152 fi
22153 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
22154   echo "$ac_t""yes" 1>&6
22155 else
22156   echo "$ac_t""no" 1>&6
22157   cat >> confdefs.h <<EOF
22158 #define caddr_t char *
22159 EOF
22160
22161 fi
22162
22163
22164 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
22165 echo "configure:22166: checking for socklen_t" >&5
22166 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
22167   echo $ac_n "(cached) $ac_c" 1>&6
22168 else
22169   cat > conftest.$ac_ext <<EOF
22170 #line 22171 "configure"
22171 #include "confdefs.h"
22172
22173 #ifdef HAVE_SYS_TYPES_H
22174 #include <sys/types.h>
22175 #endif
22176 #ifdef HAVE_SYS_SOCKET_H
22177 #include <sys/socket.h>
22178 #endif
22179
22180 int main() {
22181 socklen_t len;
22182 ; return 0; }
22183 EOF
22184 if { (eval echo configure:22185: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22185   rm -rf conftest*
22186   ol_cv_type_socklen_t=yes
22187 else
22188   echo "configure: failed program was:" >&5
22189   cat conftest.$ac_ext >&5
22190   rm -rf conftest*
22191   ol_cv_type_socklen_t=no
22192 fi
22193 rm -f conftest*
22194 fi
22195
22196 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
22197   if test $ol_cv_type_socklen_t = no; then
22198     cat >> confdefs.h <<\EOF
22199 #define socklen_t int
22200 EOF
22201
22202   fi
22203  
22204 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
22205 echo "configure:22206: checking for member st_blksize in aggregate type struct stat" >&5
22206 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
22207   echo $ac_n "(cached) $ac_c" 1>&6
22208 else
22209   cat > conftest.$ac_ext <<EOF
22210 #line 22211 "configure"
22211 #include "confdefs.h"
22212 #include <sys/types.h>
22213 #include <sys/stat.h>
22214 int main() {
22215 struct stat foo; foo.st_blksize;
22216 ; return 0; }
22217 EOF
22218 if { (eval echo configure:22219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22219   rm -rf conftest*
22220   ac_cv_c_struct_member_st_blksize=yes
22221 else
22222   echo "configure: failed program was:" >&5
22223   cat conftest.$ac_ext >&5
22224   rm -rf conftest*
22225   ac_cv_c_struct_member_st_blksize=no
22226 fi
22227 rm -f conftest*
22228 fi
22229
22230 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
22231 st_blksize="$ac_cv_c_struct_member_st_blksize"
22232 if test $ac_cv_c_struct_member_st_blksize = yes; then
22233   cat >> confdefs.h <<\EOF
22234 #define HAVE_ST_BLKSIZE 1
22235 EOF
22236
22237 fi
22238
22239 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
22240 echo "configure:22241: checking whether time.h and sys/time.h may both be included" >&5
22241 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
22242   echo $ac_n "(cached) $ac_c" 1>&6
22243 else
22244   cat > conftest.$ac_ext <<EOF
22245 #line 22246 "configure"
22246 #include "confdefs.h"
22247 #include <sys/types.h>
22248 #include <sys/time.h>
22249 #include <time.h>
22250 int main() {
22251 struct tm *tp;
22252 ; return 0; }
22253 EOF
22254 if { (eval echo configure:22255: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22255   rm -rf conftest*
22256   ac_cv_header_time=yes
22257 else
22258   echo "configure: failed program was:" >&5
22259   cat conftest.$ac_ext >&5
22260   rm -rf conftest*
22261   ac_cv_header_time=no
22262 fi
22263 rm -f conftest*
22264 fi
22265
22266 echo "$ac_t""$ac_cv_header_time" 1>&6
22267 if test $ac_cv_header_time = yes; then
22268   cat >> confdefs.h <<\EOF
22269 #define TIME_WITH_SYS_TIME 1
22270 EOF
22271
22272 fi
22273
22274 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
22275 echo "configure:22276: checking whether struct tm is in sys/time.h or time.h" >&5
22276 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
22277   echo $ac_n "(cached) $ac_c" 1>&6
22278 else
22279   cat > conftest.$ac_ext <<EOF
22280 #line 22281 "configure"
22281 #include "confdefs.h"
22282 #include <sys/types.h>
22283 #include <time.h>
22284 int main() {
22285 struct tm *tp; tp->tm_sec;
22286 ; return 0; }
22287 EOF
22288 if { (eval echo configure:22289: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22289   rm -rf conftest*
22290   ac_cv_struct_tm=time.h
22291 else
22292   echo "configure: failed program was:" >&5
22293   cat conftest.$ac_ext >&5
22294   rm -rf conftest*
22295   ac_cv_struct_tm=sys/time.h
22296 fi
22297 rm -f conftest*
22298 fi
22299
22300 echo "$ac_t""$ac_cv_struct_tm" 1>&6
22301 if test $ac_cv_struct_tm = sys/time.h; then
22302   cat >> confdefs.h <<\EOF
22303 #define TM_IN_SYS_TIME 1
22304 EOF
22305
22306 fi
22307
22308 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
22309 echo "configure:22310: checking for uid_t in sys/types.h" >&5
22310 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
22311   echo $ac_n "(cached) $ac_c" 1>&6
22312 else
22313   cat > conftest.$ac_ext <<EOF
22314 #line 22315 "configure"
22315 #include "confdefs.h"
22316 #include <sys/types.h>
22317 EOF
22318 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
22319   egrep "uid_t" >/dev/null 2>&1; then
22320   rm -rf conftest*
22321   ac_cv_type_uid_t=yes
22322 else
22323   rm -rf conftest*
22324   ac_cv_type_uid_t=no
22325 fi
22326 rm -f conftest*
22327
22328 fi
22329
22330 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
22331 if test $ac_cv_type_uid_t = no; then
22332   cat >> confdefs.h <<\EOF
22333 #define uid_t int
22334 EOF
22335
22336   cat >> confdefs.h <<\EOF
22337 #define gid_t int
22338 EOF
22339
22340 fi
22341
22342 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
22343 echo "configure:22344: checking for sig_atomic_t" >&5
22344 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
22345   echo $ac_n "(cached) $ac_c" 1>&6
22346 else
22347   cat > conftest.$ac_ext <<EOF
22348 #line 22349 "configure"
22349 #include "confdefs.h"
22350 #include <signal.h>
22351 int main() {
22352 sig_atomic_t atomic;
22353 ; return 0; }
22354 EOF
22355 if { (eval echo configure:22356: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22356   rm -rf conftest*
22357   ol_cv_type_sig_atomic_t=yes
22358 else
22359   echo "configure: failed program was:" >&5
22360   cat conftest.$ac_ext >&5
22361   rm -rf conftest*
22362   ol_cv_type_sig_atomic_t=no
22363 fi
22364 rm -f conftest*
22365 fi
22366
22367 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
22368   if test $ol_cv_type_sig_atomic_t = no; then
22369     cat >> confdefs.h <<\EOF
22370 #define sig_atomic_t int
22371 EOF
22372
22373   fi
22374  
22375
22376
22377 # test for pw_gecos in struct passwd
22378 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
22379 echo "configure:22380: checking struct passwd for pw_gecos" >&5
22380 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
22381   echo $ac_n "(cached) $ac_c" 1>&6
22382 else
22383   
22384         cat > conftest.$ac_ext <<EOF
22385 #line 22386 "configure"
22386 #include "confdefs.h"
22387 #include <pwd.h>
22388 int main() {
22389
22390         struct passwd pwd;
22391         pwd.pw_gecos = pwd.pw_name;
22392
22393 ; return 0; }
22394 EOF
22395 if { (eval echo configure:22396: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22396   rm -rf conftest*
22397   ol_cv_struct_passwd_pw_gecos=yes
22398 else
22399   echo "configure: failed program was:" >&5
22400   cat conftest.$ac_ext >&5
22401   rm -rf conftest*
22402   ol_cv_struct_passwd_pw_gecos=no
22403 fi
22404 rm -f conftest*
22405 fi
22406
22407 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
22408 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
22409         cat >> confdefs.h <<\EOF
22410 #define HAVE_PW_GECOS 1
22411 EOF
22412
22413 fi
22414
22415 # test for pw_passwd in struct passwd
22416 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
22417 echo "configure:22418: checking struct passwd for pw_passwd" >&5
22418 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
22419   echo $ac_n "(cached) $ac_c" 1>&6
22420 else
22421   
22422         cat > conftest.$ac_ext <<EOF
22423 #line 22424 "configure"
22424 #include "confdefs.h"
22425 #include <pwd.h>
22426 int main() {
22427
22428         struct passwd pwd;
22429         pwd.pw_passwd = pwd.pw_name;
22430
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   ol_cv_struct_passwd_pw_passwd=yes
22436 else
22437   echo "configure: failed program was:" >&5
22438   cat conftest.$ac_ext >&5
22439   rm -rf conftest*
22440   ol_cv_struct_passwd_pw_passwd=no
22441 fi
22442 rm -f conftest*
22443 fi
22444
22445 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
22446 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
22447         cat >> confdefs.h <<\EOF
22448 #define HAVE_PW_PASSWD 1
22449 EOF
22450
22451 fi
22452
22453
22454 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
22455 echo "configure:22456: checking if toupper() requires islower()" >&5
22456 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
22457   echo $ac_n "(cached) $ac_c" 1>&6
22458 else
22459   
22460         if test "$cross_compiling" = yes; then
22461   ol_cv_c_upper_lower=safe
22462 else
22463   cat > conftest.$ac_ext <<EOF
22464 #line 22465 "configure"
22465 #include "confdefs.h"
22466
22467 #include <ctype.h>
22468 main()
22469 {
22470         if ('C' == toupper('C'))
22471                 exit(0);
22472         else
22473                 exit(1);
22474 }
22475 EOF
22476 if { (eval echo configure:22477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
22477 then
22478   ol_cv_c_upper_lower=no
22479 else
22480   echo "configure: failed program was:" >&5
22481   cat conftest.$ac_ext >&5
22482   rm -fr conftest*
22483   ol_cv_c_upper_lower=yes
22484 fi
22485 rm -fr conftest*
22486 fi
22487
22488 fi
22489
22490 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
22491 if test $ol_cv_c_upper_lower != no ; then
22492         cat >> confdefs.h <<\EOF
22493 #define C_UPPER_LOWER 1
22494 EOF
22495
22496 fi
22497
22498 echo $ac_n "checking for working const""... $ac_c" 1>&6
22499 echo "configure:22500: checking for working const" >&5
22500 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
22501   echo $ac_n "(cached) $ac_c" 1>&6
22502 else
22503   cat > conftest.$ac_ext <<EOF
22504 #line 22505 "configure"
22505 #include "confdefs.h"
22506
22507 int main() {
22508
22509 /* Ultrix mips cc rejects this.  */
22510 typedef int charset[2]; const charset x;
22511 /* SunOS 4.1.1 cc rejects this.  */
22512 char const *const *ccp;
22513 char **p;
22514 /* NEC SVR4.0.2 mips cc rejects this.  */
22515 struct point {int x, y;};
22516 static struct point const zero = {0,0};
22517 /* AIX XL C 1.02.0.0 rejects this.
22518    It does not let you subtract one const X* pointer from another in an arm
22519    of an if-expression whose if-part is not a constant expression */
22520 const char *g = "string";
22521 ccp = &g + (g ? g-g : 0);
22522 /* HPUX 7.0 cc rejects these. */
22523 ++ccp;
22524 p = (char**) ccp;
22525 ccp = (char const *const *) p;
22526 { /* SCO 3.2v4 cc rejects this.  */
22527   char *t;
22528   char const *s = 0 ? (char *) 0 : (char const *) 0;
22529
22530   *t++ = 0;
22531 }
22532 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
22533   int x[] = {25, 17};
22534   const int *foo = &x[0];
22535   ++foo;
22536 }
22537 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
22538   typedef const int *iptr;
22539   iptr p = 0;
22540   ++p;
22541 }
22542 { /* AIX XL C 1.02.0.0 rejects this saying
22543      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
22544   struct s { int j; const int *ap[3]; };
22545   struct s *b; b->j = 5;
22546 }
22547 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
22548   const int foo = 10;
22549 }
22550
22551 ; return 0; }
22552 EOF
22553 if { (eval echo configure:22554: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22554   rm -rf conftest*
22555   ac_cv_c_const=yes
22556 else
22557   echo "configure: failed program was:" >&5
22558   cat conftest.$ac_ext >&5
22559   rm -rf conftest*
22560   ac_cv_c_const=no
22561 fi
22562 rm -f conftest*
22563 fi
22564
22565 echo "$ac_t""$ac_cv_c_const" 1>&6
22566 if test $ac_cv_c_const = no; then
22567   cat >> confdefs.h <<\EOF
22568 #define const 
22569 EOF
22570
22571 fi
22572
22573 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
22574 echo "configure:22575: checking if compiler understands volatile" >&5
22575 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
22576   echo $ac_n "(cached) $ac_c" 1>&6
22577 else
22578   cat > conftest.$ac_ext <<EOF
22579 #line 22580 "configure"
22580 #include "confdefs.h"
22581 int x, y, z;
22582 int main() {
22583 volatile int a; int * volatile b = x ? &y : &z;
22584       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
22585       *b = 0;
22586 ; return 0; }
22587 EOF
22588 if { (eval echo configure:22589: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22589   rm -rf conftest*
22590   ol_cv_c_volatile=yes
22591 else
22592   echo "configure: failed program was:" >&5
22593   cat conftest.$ac_ext >&5
22594   rm -rf conftest*
22595   ol_cv_c_volatile=no
22596 fi
22597 rm -f conftest*
22598 fi
22599
22600 echo "$ac_t""$ol_cv_c_volatile" 1>&6
22601   if test $ol_cv_c_volatile = yes; then
22602     : 
22603   else
22604     cat >> confdefs.h <<\EOF
22605 #define volatile 
22606 EOF
22607
22608   fi
22609  
22610
22611 if test $cross_compiling = yes ; then
22612         echo "configure: warning: Crossing compiling... all bets are off!" 1>&2
22613         cat >> confdefs.h <<\EOF
22614 #define CROSS_COMPILING 1
22615 EOF
22616
22617 else
22618         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
22619 echo "configure:22620: checking whether byte ordering is bigendian" >&5
22620 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
22621   echo $ac_n "(cached) $ac_c" 1>&6
22622 else
22623   ac_cv_c_bigendian=unknown
22624 # See if sys/param.h defines the BYTE_ORDER macro.
22625 cat > conftest.$ac_ext <<EOF
22626 #line 22627 "configure"
22627 #include "confdefs.h"
22628 #include <sys/types.h>
22629 #include <sys/param.h>
22630 int main() {
22631
22632 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
22633  bogus endian macros
22634 #endif
22635 ; return 0; }
22636 EOF
22637 if { (eval echo configure:22638: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22638   rm -rf conftest*
22639   # It does; now see whether it defined to BIG_ENDIAN or not.
22640 cat > conftest.$ac_ext <<EOF
22641 #line 22642 "configure"
22642 #include "confdefs.h"
22643 #include <sys/types.h>
22644 #include <sys/param.h>
22645 int main() {
22646
22647 #if BYTE_ORDER != BIG_ENDIAN
22648  not big endian
22649 #endif
22650 ; return 0; }
22651 EOF
22652 if { (eval echo configure:22653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22653   rm -rf conftest*
22654   ac_cv_c_bigendian=yes
22655 else
22656   echo "configure: failed program was:" >&5
22657   cat conftest.$ac_ext >&5
22658   rm -rf conftest*
22659   ac_cv_c_bigendian=no
22660 fi
22661 rm -f conftest*
22662 else
22663   echo "configure: failed program was:" >&5
22664   cat conftest.$ac_ext >&5
22665 fi
22666 rm -f conftest*
22667 if test $ac_cv_c_bigendian = unknown; then
22668 if test "$cross_compiling" = yes; then
22669     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
22670 else
22671   cat > conftest.$ac_ext <<EOF
22672 #line 22673 "configure"
22673 #include "confdefs.h"
22674 main () {
22675   /* Are we little or big endian?  From Harbison&Steele.  */
22676   union
22677   {
22678     long l;
22679     char c[sizeof (long)];
22680   } u;
22681   u.l = 1;
22682   exit (u.c[sizeof (long) - 1] == 1);
22683 }
22684 EOF
22685 if { (eval echo configure:22686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
22686 then
22687   ac_cv_c_bigendian=no
22688 else
22689   echo "configure: failed program was:" >&5
22690   cat conftest.$ac_ext >&5
22691   rm -fr conftest*
22692   ac_cv_c_bigendian=yes
22693 fi
22694 rm -fr conftest*
22695 fi
22696
22697 fi
22698 fi
22699
22700 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
22701 if test $ac_cv_c_bigendian = yes; then
22702   cat >> confdefs.h <<\EOF
22703 #define WORDS_BIGENDIAN 1
22704 EOF
22705
22706 fi
22707
22708 fi
22709
22710 echo $ac_n "checking size of short""... $ac_c" 1>&6
22711 echo "configure:22712: checking size of short" >&5 
22712 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
22713   echo $ac_n "(cached) $ac_c" 1>&6
22714 else
22715   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
22716   cat > conftest.$ac_ext <<EOF
22717 #line 22718 "configure"
22718 #include "confdefs.h"
22719 #include "confdefs.h" 
22720 #include <stdlib.h>
22721 #include <sys/types.h> 
22722  
22723
22724 int main() {
22725 switch (0) case 0: case (sizeof (short) == $ac_size):;
22726 ; return 0; }
22727 EOF
22728 if { (eval echo configure:22729: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22729   rm -rf conftest*
22730   ac_cv_sizeof_short=$ac_size
22731 else
22732   echo "configure: failed program was:" >&5
22733   cat conftest.$ac_ext >&5
22734 fi
22735 rm -f conftest* 
22736   if test x$ac_cv_sizeof_short != x ; then break; fi 
22737 done 
22738
22739 fi
22740  
22741 if test x$ac_cv_sizeof_short = x ; then 
22742   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
22743 fi 
22744 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
22745 cat >> confdefs.h <<EOF
22746 #define SIZEOF_SHORT $ac_cv_sizeof_short
22747 EOF
22748  
22749  
22750 echo $ac_n "checking size of int""... $ac_c" 1>&6
22751 echo "configure:22752: checking size of int" >&5 
22752 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
22753   echo $ac_n "(cached) $ac_c" 1>&6
22754 else
22755   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
22756   cat > conftest.$ac_ext <<EOF
22757 #line 22758 "configure"
22758 #include "confdefs.h"
22759 #include "confdefs.h" 
22760 #include <stdlib.h>
22761 #include <sys/types.h> 
22762  
22763
22764 int main() {
22765 switch (0) case 0: case (sizeof (int) == $ac_size):;
22766 ; return 0; }
22767 EOF
22768 if { (eval echo configure:22769: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22769   rm -rf conftest*
22770   ac_cv_sizeof_int=$ac_size
22771 else
22772   echo "configure: failed program was:" >&5
22773   cat conftest.$ac_ext >&5
22774 fi
22775 rm -f conftest* 
22776   if test x$ac_cv_sizeof_int != x ; then break; fi 
22777 done 
22778
22779 fi
22780  
22781 if test x$ac_cv_sizeof_int = x ; then 
22782   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
22783 fi 
22784 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
22785 cat >> confdefs.h <<EOF
22786 #define SIZEOF_INT $ac_cv_sizeof_int
22787 EOF
22788  
22789  
22790 echo $ac_n "checking size of long""... $ac_c" 1>&6
22791 echo "configure:22792: checking size of long" >&5 
22792 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
22793   echo $ac_n "(cached) $ac_c" 1>&6
22794 else
22795   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
22796   cat > conftest.$ac_ext <<EOF
22797 #line 22798 "configure"
22798 #include "confdefs.h"
22799 #include "confdefs.h" 
22800 #include <stdlib.h>
22801 #include <sys/types.h> 
22802  
22803
22804 int main() {
22805 switch (0) case 0: case (sizeof (long) == $ac_size):;
22806 ; return 0; }
22807 EOF
22808 if { (eval echo configure:22809: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22809   rm -rf conftest*
22810   ac_cv_sizeof_long=$ac_size
22811 else
22812   echo "configure: failed program was:" >&5
22813   cat conftest.$ac_ext >&5
22814 fi
22815 rm -f conftest* 
22816   if test x$ac_cv_sizeof_long != x ; then break; fi 
22817 done 
22818
22819 fi
22820  
22821 if test x$ac_cv_sizeof_long = x ; then 
22822   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
22823 fi 
22824 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
22825 cat >> confdefs.h <<EOF
22826 #define SIZEOF_LONG $ac_cv_sizeof_long
22827 EOF
22828  
22829
22830 echo $ac_n "checking size of wchar_t""... $ac_c" 1>&6
22831 echo "configure:22832: checking size of wchar_t" >&5 
22832 if eval "test \"\${ac_cv_sizeof_wchar_t+set}\" = set"; then
22833   echo $ac_n "(cached) $ac_c" 1>&6
22834 else
22835   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
22836   cat > conftest.$ac_ext <<EOF
22837 #line 22838 "configure"
22838 #include "confdefs.h"
22839 #include "confdefs.h" 
22840 #include <stdlib.h>
22841 #include <sys/types.h> 
22842  
22843
22844 int main() {
22845 switch (0) case 0: case (sizeof (wchar_t) == $ac_size):;
22846 ; return 0; }
22847 EOF
22848 if { (eval echo configure:22849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22849   rm -rf conftest*
22850   ac_cv_sizeof_wchar_t=$ac_size
22851 else
22852   echo "configure: failed program was:" >&5
22853   cat conftest.$ac_ext >&5
22854 fi
22855 rm -f conftest* 
22856   if test x$ac_cv_sizeof_wchar_t != x ; then break; fi 
22857 done 
22858
22859 fi
22860  
22861 if test x$ac_cv_sizeof_wchar_t = x ; then 
22862   { echo "configure: error: cannot determine a size for wchar_t" 1>&2; exit 1; } 
22863 fi 
22864 echo "$ac_t""$ac_cv_sizeof_wchar_t" 1>&6 
22865 cat >> confdefs.h <<EOF
22866 #define SIZEOF_WCHAR_T $ac_cv_sizeof_wchar_t
22867 EOF
22868  
22869
22870
22871 if test "$ac_cv_sizeof_int" -lt 4 ; then
22872         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
22873
22874         cat >> confdefs.h <<\EOF
22875 #define LBER_INT_T long
22876 EOF
22877
22878 else
22879         cat >> confdefs.h <<\EOF
22880 #define LBER_INT_T int
22881 EOF
22882
22883 fi
22884
22885 cat >> confdefs.h <<\EOF
22886 #define LBER_LEN_T long
22887 EOF
22888
22889 cat >> confdefs.h <<\EOF
22890 #define LBER_SOCKET_T int
22891 EOF
22892
22893 cat >> confdefs.h <<\EOF
22894 #define LBER_TAG_T long
22895 EOF
22896
22897
22898 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
22899 echo "configure:22900: checking for 8-bit clean memcmp" >&5
22900 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
22901   echo $ac_n "(cached) $ac_c" 1>&6
22902 else
22903   if test "$cross_compiling" = yes; then
22904   ac_cv_func_memcmp_clean=no
22905 else
22906   cat > conftest.$ac_ext <<EOF
22907 #line 22908 "configure"
22908 #include "confdefs.h"
22909
22910 main()
22911 {
22912   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
22913   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
22914 }
22915
22916 EOF
22917 if { (eval echo configure:22918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
22918 then
22919   ac_cv_func_memcmp_clean=yes
22920 else
22921   echo "configure: failed program was:" >&5
22922   cat conftest.$ac_ext >&5
22923   rm -fr conftest*
22924   ac_cv_func_memcmp_clean=no
22925 fi
22926 rm -fr conftest*
22927 fi
22928
22929 fi
22930
22931 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
22932 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
22933
22934 echo $ac_n "checking for strftime""... $ac_c" 1>&6
22935 echo "configure:22936: checking for strftime" >&5
22936 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
22937   echo $ac_n "(cached) $ac_c" 1>&6
22938 else
22939   cat > conftest.$ac_ext <<EOF
22940 #line 22941 "configure"
22941 #include "confdefs.h"
22942 /* System header to define __stub macros and hopefully few prototypes,
22943     which can conflict with char strftime(); below.  */
22944 #include <assert.h>
22945 /* Override any gcc2 internal prototype to avoid an error.  */
22946 /* We use char because int might match the return type of a gcc2
22947     builtin and then its argument prototype would still apply.  */
22948 char strftime();
22949 char (*f)();
22950
22951 int main() {
22952
22953 /* The GNU C library defines this for functions which it implements
22954     to always fail with ENOSYS.  Some functions are actually named
22955     something starting with __ and the normal name is an alias.  */
22956 #if defined (__stub_strftime) || defined (__stub___strftime)
22957 choke me
22958 #else
22959 f = strftime;
22960 #endif
22961
22962 ; return 0; }
22963 EOF
22964 if { (eval echo configure:22965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22965   rm -rf conftest*
22966   eval "ac_cv_func_strftime=yes"
22967 else
22968   echo "configure: failed program was:" >&5
22969   cat conftest.$ac_ext >&5
22970   rm -rf conftest*
22971   eval "ac_cv_func_strftime=no"
22972 fi
22973 rm -f conftest*
22974 fi
22975
22976 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
22977   echo "$ac_t""yes" 1>&6
22978   cat >> confdefs.h <<\EOF
22979 #define HAVE_STRFTIME 1
22980 EOF
22981
22982 else
22983   echo "$ac_t""no" 1>&6
22984 # strftime is in -lintl on SCO UNIX.
22985 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
22986 echo "configure:22987: checking for strftime in -lintl" >&5
22987 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
22988 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
22989   echo $ac_n "(cached) $ac_c" 1>&6
22990 else
22991   ac_save_LIBS="$LIBS"
22992 LIBS="-lintl  $LIBS"
22993 cat > conftest.$ac_ext <<EOF
22994 #line 22995 "configure"
22995 #include "confdefs.h"
22996 /* Override any gcc2 internal prototype to avoid an error.  */
22997 /* We use char because int might match the return type of a gcc2
22998     builtin and then its argument prototype would still apply.  */
22999 char strftime();
23000
23001 int main() {
23002 strftime()
23003 ; return 0; }
23004 EOF
23005 if { (eval echo configure:23006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
23006   rm -rf conftest*
23007   eval "ac_cv_lib_$ac_lib_var=yes"
23008 else
23009   echo "configure: failed program was:" >&5
23010   cat conftest.$ac_ext >&5
23011   rm -rf conftest*
23012   eval "ac_cv_lib_$ac_lib_var=no"
23013 fi
23014 rm -f conftest*
23015 LIBS="$ac_save_LIBS"
23016
23017 fi
23018 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
23019   echo "$ac_t""yes" 1>&6
23020   cat >> confdefs.h <<\EOF
23021 #define HAVE_STRFTIME 1
23022 EOF
23023
23024 LIBS="-lintl $LIBS"
23025 else
23026   echo "$ac_t""no" 1>&6
23027 fi
23028
23029 fi
23030
23031
23032 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
23033 echo "configure:23034: checking for inet_aton()" >&5
23034 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
23035   echo $ac_n "(cached) $ac_c" 1>&6
23036 else
23037   cat > conftest.$ac_ext <<EOF
23038 #line 23039 "configure"
23039 #include "confdefs.h"
23040
23041 #ifdef HAVE_SYS_TYPES_H
23042 #       include <sys/types.h>
23043 #endif
23044 #ifdef HAVE_SYS_SOCKET_H
23045 #       include <sys/socket.h>
23046 #       ifdef HAVE_SYS_SELECT_H
23047 #               include <sys/select.h>
23048 #       endif
23049 #       include <netinet/in.h>
23050 #       ifdef HAVE_ARPA_INET_H
23051 #               include <arpa/inet.h>
23052 #       endif
23053 #endif
23054
23055 int main() {
23056 struct in_addr in;
23057 int rc = inet_aton( "255.255.255.255", &in );
23058 ; return 0; }
23059 EOF
23060 if { (eval echo configure:23061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
23061   rm -rf conftest*
23062   ol_cv_func_inet_aton=yes
23063 else
23064   echo "configure: failed program was:" >&5
23065   cat conftest.$ac_ext >&5
23066   rm -rf conftest*
23067   ol_cv_func_inet_aton=no
23068 fi
23069 rm -f conftest*
23070 fi
23071
23072 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
23073   if test $ol_cv_func_inet_aton != no; then
23074     cat >> confdefs.h <<\EOF
23075 #define HAVE_INET_ATON 1
23076 EOF
23077
23078   fi
23079  
23080
23081 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
23082 echo "configure:23083: checking for _spawnlp" >&5
23083 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
23084   echo $ac_n "(cached) $ac_c" 1>&6
23085 else
23086   cat > conftest.$ac_ext <<EOF
23087 #line 23088 "configure"
23088 #include "confdefs.h"
23089 /* System header to define __stub macros and hopefully few prototypes,
23090     which can conflict with char _spawnlp(); below.  */
23091 #include <assert.h>
23092 /* Override any gcc2 internal prototype to avoid an error.  */
23093 /* We use char because int might match the return type of a gcc2
23094     builtin and then its argument prototype would still apply.  */
23095 char _spawnlp();
23096 char (*f)();
23097
23098 int main() {
23099
23100 /* The GNU C library defines this for functions which it implements
23101     to always fail with ENOSYS.  Some functions are actually named
23102     something starting with __ and the normal name is an alias.  */
23103 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
23104 choke me
23105 #else
23106 f = _spawnlp;
23107 #endif
23108
23109 ; return 0; }
23110 EOF
23111 if { (eval echo configure:23112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
23112   rm -rf conftest*
23113   eval "ac_cv_func__spawnlp=yes"
23114 else
23115   echo "configure: failed program was:" >&5
23116   cat conftest.$ac_ext >&5
23117   rm -rf conftest*
23118   eval "ac_cv_func__spawnlp=no"
23119 fi
23120 rm -f conftest*
23121 fi
23122
23123 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
23124   echo "$ac_t""yes" 1>&6
23125   cat >> confdefs.h <<\EOF
23126 #define HAVE_SPAWNLP 1
23127 EOF
23128
23129 else
23130   echo "$ac_t""no" 1>&6
23131 fi
23132
23133
23134 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
23135 echo "configure:23136: checking for _snprintf" >&5
23136 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
23137   echo $ac_n "(cached) $ac_c" 1>&6
23138 else
23139   cat > conftest.$ac_ext <<EOF
23140 #line 23141 "configure"
23141 #include "confdefs.h"
23142 /* System header to define __stub macros and hopefully few prototypes,
23143     which can conflict with char _snprintf(); below.  */
23144 #include <assert.h>
23145 /* Override any gcc2 internal prototype to avoid an error.  */
23146 /* We use char because int might match the return type of a gcc2
23147     builtin and then its argument prototype would still apply.  */
23148 char _snprintf();
23149 char (*f)();
23150
23151 int main() {
23152
23153 /* The GNU C library defines this for functions which it implements
23154     to always fail with ENOSYS.  Some functions are actually named
23155     something starting with __ and the normal name is an alias.  */
23156 #if defined (__stub__snprintf) || defined (__stub____snprintf)
23157 choke me
23158 #else
23159 f = _snprintf;
23160 #endif
23161
23162 ; return 0; }
23163 EOF
23164 if { (eval echo configure:23165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
23165   rm -rf conftest*
23166   eval "ac_cv_func__snprintf=yes"
23167 else
23168   echo "configure: failed program was:" >&5
23169   cat conftest.$ac_ext >&5
23170   rm -rf conftest*
23171   eval "ac_cv_func__snprintf=no"
23172 fi
23173 rm -f conftest*
23174 fi
23175
23176 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
23177   echo "$ac_t""yes" 1>&6
23178   ac_cv_func_snprintf=yes
23179         cat >> confdefs.h <<\EOF
23180 #define snprintf _snprintf
23181 EOF
23182
23183
23184 else
23185   echo "$ac_t""no" 1>&6
23186 fi
23187
23188
23189 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
23190 echo "configure:23191: checking for _vsnprintf" >&5
23191 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
23192   echo $ac_n "(cached) $ac_c" 1>&6
23193 else
23194   cat > conftest.$ac_ext <<EOF
23195 #line 23196 "configure"
23196 #include "confdefs.h"
23197 /* System header to define __stub macros and hopefully few prototypes,
23198     which can conflict with char _vsnprintf(); below.  */
23199 #include <assert.h>
23200 /* Override any gcc2 internal prototype to avoid an error.  */
23201 /* We use char because int might match the return type of a gcc2
23202     builtin and then its argument prototype would still apply.  */
23203 char _vsnprintf();
23204 char (*f)();
23205
23206 int main() {
23207
23208 /* The GNU C library defines this for functions which it implements
23209     to always fail with ENOSYS.  Some functions are actually named
23210     something starting with __ and the normal name is an alias.  */
23211 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
23212 choke me
23213 #else
23214 f = _vsnprintf;
23215 #endif
23216
23217 ; return 0; }
23218 EOF
23219 if { (eval echo configure:23220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
23220   rm -rf conftest*
23221   eval "ac_cv_func__vsnprintf=yes"
23222 else
23223   echo "configure: failed program was:" >&5
23224   cat conftest.$ac_ext >&5
23225   rm -rf conftest*
23226   eval "ac_cv_func__vsnprintf=no"
23227 fi
23228 rm -f conftest*
23229 fi
23230
23231 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
23232   echo "$ac_t""yes" 1>&6
23233   ac_cv_func_vsnprintf=yes
23234         cat >> confdefs.h <<\EOF
23235 #define vsnprintf _vsnprintf
23236 EOF
23237
23238
23239 else
23240   echo "$ac_t""no" 1>&6
23241 fi
23242
23243
23244 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
23245 echo "configure:23246: checking for vprintf" >&5
23246 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
23247   echo $ac_n "(cached) $ac_c" 1>&6
23248 else
23249   cat > conftest.$ac_ext <<EOF
23250 #line 23251 "configure"
23251 #include "confdefs.h"
23252 /* System header to define __stub macros and hopefully few prototypes,
23253     which can conflict with char vprintf(); below.  */
23254 #include <assert.h>
23255 /* Override any gcc2 internal prototype to avoid an error.  */
23256 /* We use char because int might match the return type of a gcc2
23257     builtin and then its argument prototype would still apply.  */
23258 char vprintf();
23259 char (*f)();
23260
23261 int main() {
23262
23263 /* The GNU C library defines this for functions which it implements
23264     to always fail with ENOSYS.  Some functions are actually named
23265     something starting with __ and the normal name is an alias.  */
23266 #if defined (__stub_vprintf) || defined (__stub___vprintf)
23267 choke me
23268 #else
23269 f = vprintf;
23270 #endif
23271
23272 ; return 0; }
23273 EOF
23274 if { (eval echo configure:23275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
23275   rm -rf conftest*
23276   eval "ac_cv_func_vprintf=yes"
23277 else
23278   echo "configure: failed program was:" >&5
23279   cat conftest.$ac_ext >&5
23280   rm -rf conftest*
23281   eval "ac_cv_func_vprintf=no"
23282 fi
23283 rm -f conftest*
23284 fi
23285
23286 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
23287   echo "$ac_t""yes" 1>&6
23288   cat >> confdefs.h <<\EOF
23289 #define HAVE_VPRINTF 1
23290 EOF
23291
23292 else
23293   echo "$ac_t""no" 1>&6
23294 fi
23295
23296 if test "$ac_cv_func_vprintf" != yes; then
23297 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
23298 echo "configure:23299: checking for _doprnt" >&5
23299 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
23300   echo $ac_n "(cached) $ac_c" 1>&6
23301 else
23302   cat > conftest.$ac_ext <<EOF
23303 #line 23304 "configure"
23304 #include "confdefs.h"
23305 /* System header to define __stub macros and hopefully few prototypes,
23306     which can conflict with char _doprnt(); below.  */
23307 #include <assert.h>
23308 /* Override any gcc2 internal prototype to avoid an error.  */
23309 /* We use char because int might match the return type of a gcc2
23310     builtin and then its argument prototype would still apply.  */
23311 char _doprnt();
23312 char (*f)();
23313
23314 int main() {
23315
23316 /* The GNU C library defines this for functions which it implements
23317     to always fail with ENOSYS.  Some functions are actually named
23318     something starting with __ and the normal name is an alias.  */
23319 #if defined (__stub__doprnt) || defined (__stub____doprnt)
23320 choke me
23321 #else
23322 f = _doprnt;
23323 #endif
23324
23325 ; return 0; }
23326 EOF
23327 if { (eval echo configure:23328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
23328   rm -rf conftest*
23329   eval "ac_cv_func__doprnt=yes"
23330 else
23331   echo "configure: failed program was:" >&5
23332   cat conftest.$ac_ext >&5
23333   rm -rf conftest*
23334   eval "ac_cv_func__doprnt=no"
23335 fi
23336 rm -f conftest*
23337 fi
23338
23339 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
23340   echo "$ac_t""yes" 1>&6
23341   cat >> confdefs.h <<\EOF
23342 #define HAVE_DOPRNT 1
23343 EOF
23344
23345 else
23346   echo "$ac_t""no" 1>&6
23347 fi
23348
23349 fi
23350
23351
23352 if test $ac_cv_func_vprintf = yes ; then
23353                 for ac_func in snprintf vsnprintf
23354 do
23355 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
23356 echo "configure:23357: checking for $ac_func" >&5
23357 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
23358   echo $ac_n "(cached) $ac_c" 1>&6
23359 else
23360   cat > conftest.$ac_ext <<EOF
23361 #line 23362 "configure"
23362 #include "confdefs.h"
23363 /* System header to define __stub macros and hopefully few prototypes,
23364     which can conflict with char $ac_func(); below.  */
23365 #include <assert.h>
23366 /* Override any gcc2 internal prototype to avoid an error.  */
23367 /* We use char because int might match the return type of a gcc2
23368     builtin and then its argument prototype would still apply.  */
23369 char $ac_func();
23370 char (*f)();
23371
23372 int main() {
23373
23374 /* The GNU C library defines this for functions which it implements
23375     to always fail with ENOSYS.  Some functions are actually named
23376     something starting with __ and the normal name is an alias.  */
23377 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
23378 choke me
23379 #else
23380 f = $ac_func;
23381 #endif
23382
23383 ; return 0; }
23384 EOF
23385 if { (eval echo configure:23386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
23386   rm -rf conftest*
23387   eval "ac_cv_func_$ac_func=yes"
23388 else
23389   echo "configure: failed program was:" >&5
23390   cat conftest.$ac_ext >&5
23391   rm -rf conftest*
23392   eval "ac_cv_func_$ac_func=no"
23393 fi
23394 rm -f conftest*
23395 fi
23396
23397 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
23398   echo "$ac_t""yes" 1>&6
23399     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
23400   cat >> confdefs.h <<EOF
23401 #define $ac_tr_func 1
23402 EOF
23403  
23404 else
23405   echo "$ac_t""no" 1>&6
23406 fi
23407 done
23408
23409 fi
23410
23411 for ac_func in \
23412         bcopy                   \
23413         closesocket             \
23414         chroot                  \
23415         endgrent                \
23416         endpwent                \
23417         fcntl                   \
23418         flock                   \
23419         fstat                   \
23420         getdtablesize   \
23421         getgrgid                \
23422         gethostname             \
23423         getpass                 \
23424         getpassphrase   \
23425         getpwuid                \
23426         getpwnam                \
23427         getspnam                \
23428         gettimeofday    \
23429         initgroups              \
23430         lockf                   \
23431         memcpy                  \
23432         memmove                 \
23433         mkstemp                 \
23434         mktemp                  \
23435         pipe                    \
23436         read                    \
23437         recv                    \
23438         recvfrom                \
23439         setpwfile               \
23440         setgid                  \
23441         setegid                 \
23442         setsid                  \
23443         setuid                  \
23444         seteuid                 \
23445         sigaction               \
23446         signal                  \
23447         sigset                  \
23448         strdup                  \
23449         strerror                \
23450         strpbrk                 \
23451         strrchr                 \
23452         strsep                  \
23453         strstr                  \
23454         strtol                  \
23455         strtoul                 \
23456         strtoq                  \
23457         strtouq                 \
23458         strtoll                 \
23459         strspn                  \
23460         sysconf                 \
23461         usleep                  \
23462         waitpid                 \
23463         wait4                   \
23464         write                   \
23465         send                    \
23466         sendmsg                 \
23467         sendto                  \
23468
23469 do
23470 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
23471 echo "configure:23472: checking for $ac_func" >&5
23472 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
23473   echo $ac_n "(cached) $ac_c" 1>&6
23474 else
23475   cat > conftest.$ac_ext <<EOF
23476 #line 23477 "configure"
23477 #include "confdefs.h"
23478 /* System header to define __stub macros and hopefully few prototypes,
23479     which can conflict with char $ac_func(); below.  */
23480 #include <assert.h>
23481 /* Override any gcc2 internal prototype to avoid an error.  */
23482 /* We use char because int might match the return type of a gcc2
23483     builtin and then its argument prototype would still apply.  */
23484 char $ac_func();
23485 char (*f)();
23486
23487 int main() {
23488
23489 /* The GNU C library defines this for functions which it implements
23490     to always fail with ENOSYS.  Some functions are actually named
23491     something starting with __ and the normal name is an alias.  */
23492 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
23493 choke me
23494 #else
23495 f = $ac_func;
23496 #endif
23497
23498 ; return 0; }
23499 EOF
23500 if { (eval echo configure:23501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
23501   rm -rf conftest*
23502   eval "ac_cv_func_$ac_func=yes"
23503 else
23504   echo "configure: failed program was:" >&5
23505   cat conftest.$ac_ext >&5
23506   rm -rf conftest*
23507   eval "ac_cv_func_$ac_func=no"
23508 fi
23509 rm -f conftest*
23510 fi
23511
23512 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
23513   echo "$ac_t""yes" 1>&6
23514     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
23515   cat >> confdefs.h <<EOF
23516 #define $ac_tr_func 1
23517 EOF
23518  
23519 else
23520   echo "$ac_t""no" 1>&6
23521 fi
23522 done
23523
23524
23525 for ac_func in getopt getpeereid
23526 do
23527 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
23528 echo "configure:23529: checking for $ac_func" >&5
23529 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
23530   echo $ac_n "(cached) $ac_c" 1>&6
23531 else
23532   cat > conftest.$ac_ext <<EOF
23533 #line 23534 "configure"
23534 #include "confdefs.h"
23535 /* System header to define __stub macros and hopefully few prototypes,
23536     which can conflict with char $ac_func(); below.  */
23537 #include <assert.h>
23538 /* Override any gcc2 internal prototype to avoid an error.  */
23539 /* We use char because int might match the return type of a gcc2
23540     builtin and then its argument prototype would still apply.  */
23541 char $ac_func();
23542 char (*f)();
23543
23544 int main() {
23545
23546 /* The GNU C library defines this for functions which it implements
23547     to always fail with ENOSYS.  Some functions are actually named
23548     something starting with __ and the normal name is an alias.  */
23549 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
23550 choke me
23551 #else
23552 f = $ac_func;
23553 #endif
23554
23555 ; return 0; }
23556 EOF
23557 if { (eval echo configure:23558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
23558   rm -rf conftest*
23559   eval "ac_cv_func_$ac_func=yes"
23560 else
23561   echo "configure: failed program was:" >&5
23562   cat conftest.$ac_ext >&5
23563   rm -rf conftest*
23564   eval "ac_cv_func_$ac_func=no"
23565 fi
23566 rm -f conftest*
23567 fi
23568
23569 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
23570   echo "$ac_t""yes" 1>&6
23571     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
23572   cat >> confdefs.h <<EOF
23573 #define $ac_tr_func 1
23574 EOF
23575  
23576 else
23577   echo "$ac_t""no" 1>&6
23578 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
23579 fi
23580 done
23581
23582
23583
23584 if test "$ac_cv_func_getopt" != yes; then
23585         LIBSRCS="$LIBSRCS getopt.c"
23586 fi
23587 if test "$ac_cv_func_getpeereid" != yes; then
23588         echo $ac_n "checking for msg_accrights in msghdr""... $ac_c" 1>&6
23589 echo "configure:23590: checking for msg_accrights in msghdr" >&5
23590 if eval "test \"\${ol_cv_msghdr_msg_accrights+set}\" = set"; then
23591   echo $ac_n "(cached) $ac_c" 1>&6
23592 else
23593   cat > conftest.$ac_ext <<EOF
23594 #line 23595 "configure"
23595 #include "confdefs.h"
23596 #include <sys/socket.h>
23597 int main() {
23598 struct msghdr m; m.msg_accrightslen=0
23599 ; return 0; }
23600 EOF
23601 if { (eval echo configure:23602: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
23602   rm -rf conftest*
23603   ol_cv_msghdr_msg_accrights=yes
23604 else
23605   echo "configure: failed program was:" >&5
23606   cat conftest.$ac_ext >&5
23607   rm -rf conftest*
23608   ol_cv_msghdr_msg_accrights=no
23609 fi
23610 rm -f conftest*
23611         
23612 fi
23613
23614 echo "$ac_t""$ol_cv_msghdr_msg_accrights" 1>&6
23615   if test $ol_cv_msghdr_msg_accrights = "yes" ; then
23616         cat >> confdefs.h <<\EOF
23617 #define HAVE_MSGHDR_MSG_ACCRIGHTS 1
23618 EOF
23619
23620   fi
23621
23622         LIBSRCS="$LIBSRCS getpeereid.c"
23623 fi
23624 if test "$ac_cv_func_snprintf" != yes -o "$ac_cv_func_vsnprintf" != yes; then
23625         if test "$ac_cv_func_snprintf" != yes; then
23626                 cat >> confdefs.h <<\EOF
23627 #define snprintf ber_pvt_snprintf
23628 EOF
23629
23630         fi
23631         if test "$ac_cv_func_vsnprintf" != yes; then
23632                 cat >> confdefs.h <<\EOF
23633 #define vsnprintf ber_pvt_vsnprintf
23634 EOF
23635
23636         fi
23637 fi
23638
23639 # Check Configuration
23640 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
23641 echo "configure:23642: checking declaration of sys_errlist" >&5
23642 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
23643   echo $ac_n "(cached) $ac_c" 1>&6
23644 else
23645   
23646         cat > conftest.$ac_ext <<EOF
23647 #line 23648 "configure"
23648 #include "confdefs.h"
23649
23650 #include <stdio.h>
23651 #include <sys/types.h>
23652 #include <errno.h>
23653 #ifdef WINNT
23654 #include <stdlib.h>
23655 #endif 
23656 int main() {
23657 char *c = (char *) *sys_errlist
23658 ; return 0; }
23659 EOF
23660 if { (eval echo configure:23661: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
23661   rm -rf conftest*
23662   ol_cv_dcl_sys_errlist=yes
23663         ol_cv_have_sys_errlist=yes
23664 else
23665   echo "configure: failed program was:" >&5
23666   cat conftest.$ac_ext >&5
23667   rm -rf conftest*
23668   ol_cv_dcl_sys_errlist=no
23669 fi
23670 rm -f conftest*
23671 fi
23672
23673 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
23674 #
23675 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
23676 if test $ol_cv_dcl_sys_errlist = no ; then
23677         cat >> confdefs.h <<\EOF
23678 #define DECL_SYS_ERRLIST 1
23679 EOF
23680
23681
23682         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
23683 echo "configure:23684: checking existence of sys_errlist" >&5
23684 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
23685   echo $ac_n "(cached) $ac_c" 1>&6
23686 else
23687   
23688                 cat > conftest.$ac_ext <<EOF
23689 #line 23690 "configure"
23690 #include "confdefs.h"
23691 #include <errno.h>
23692 int main() {
23693 char *c = (char *) *sys_errlist
23694 ; return 0; }
23695 EOF
23696 if { (eval echo configure:23697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
23697   rm -rf conftest*
23698   ol_cv_have_sys_errlist=yes
23699 else
23700   echo "configure: failed program was:" >&5
23701   cat conftest.$ac_ext >&5
23702   rm -rf conftest*
23703   ol_cv_have_sys_errlist=no
23704 fi
23705 rm -f conftest*
23706 fi
23707
23708 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
23709 fi
23710 if test $ol_cv_have_sys_errlist = yes ; then
23711         cat >> confdefs.h <<\EOF
23712 #define HAVE_SYS_ERRLIST 1
23713 EOF
23714
23715 fi
23716
23717
23718
23719 if test "$ol_enable_slapi" != no ; then
23720                         for ac_hdr in ltdl.h
23721 do
23722 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
23723 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
23724 echo "configure:23725: checking for $ac_hdr" >&5
23725 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
23726   echo $ac_n "(cached) $ac_c" 1>&6
23727 else
23728   cat > conftest.$ac_ext <<EOF
23729 #line 23730 "configure"
23730 #include "confdefs.h"
23731 #include <$ac_hdr>
23732 EOF
23733 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
23734 { (eval echo configure:23735: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
23735 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
23736 if test -z "$ac_err"; then
23737   rm -rf conftest*
23738   eval "ac_cv_header_$ac_safe=yes"
23739 else
23740   echo "$ac_err" >&5
23741   echo "configure: failed program was:" >&5
23742   cat conftest.$ac_ext >&5
23743   rm -rf conftest*
23744   eval "ac_cv_header_$ac_safe=no"
23745 fi
23746 rm -f conftest*
23747 fi
23748 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
23749   echo "$ac_t""yes" 1>&6
23750     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
23751   cat >> confdefs.h <<EOF
23752 #define $ac_tr_hdr 1
23753 EOF
23754  
23755 else
23756   echo "$ac_t""no" 1>&6
23757 fi
23758 done
23759
23760
23761         if test $ac_cv_header_ltdl_h != yes ; then
23762                 { echo "configure: error: could not locate <ltdl.h>" 1>&2; exit 1; }
23763         fi
23764         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
23765 echo "configure:23766: checking for lt_dlinit in -lltdl" >&5
23766 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
23767 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
23768   echo $ac_n "(cached) $ac_c" 1>&6
23769 else
23770   ac_save_LIBS="$LIBS"
23771 LIBS="-lltdl  $LIBS"
23772 cat > conftest.$ac_ext <<EOF
23773 #line 23774 "configure"
23774 #include "confdefs.h"
23775 /* Override any gcc2 internal prototype to avoid an error.  */
23776 /* We use char because int might match the return type of a gcc2
23777     builtin and then its argument prototype would still apply.  */
23778 char lt_dlinit();
23779
23780 int main() {
23781 lt_dlinit()
23782 ; return 0; }
23783 EOF
23784 if { (eval echo configure:23785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
23785   rm -rf conftest*
23786   eval "ac_cv_lib_$ac_lib_var=yes"
23787 else
23788   echo "configure: failed program was:" >&5
23789   cat conftest.$ac_ext >&5
23790   rm -rf conftest*
23791   eval "ac_cv_lib_$ac_lib_var=no"
23792 fi
23793 rm -f conftest*
23794 LIBS="$ac_save_LIBS"
23795
23796 fi
23797 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
23798   echo "$ac_t""yes" 1>&6
23799   
23800                 SLAPI_LIBS=-lltdl
23801                 LIBSLAPI=libslapi.a
23802                 LIBSLAPITOOLS=../libslapi.a
23803                 cat >> confdefs.h <<\EOF
23804 #define HAVE_LIBLTDL 1
23805 EOF
23806
23807         
23808 else
23809   echo "$ac_t""no" 1>&6
23810 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
23811 fi
23812
23813
23814         cat >> confdefs.h <<\EOF
23815 #define LDAP_SLAPI 1
23816 EOF
23817
23818 fi
23819
23820 if test "$ol_enable_debug" != no ; then
23821         cat >> confdefs.h <<\EOF
23822 #define LDAP_DEBUG 1
23823 EOF
23824
23825 fi
23826 if test "$ol_enable_syslog" = yes ; then
23827         cat >> confdefs.h <<\EOF
23828 #define LDAP_SYSLOG 1
23829 EOF
23830
23831 fi
23832 if test "$ol_link_kbind" != no ; then
23833         cat >> confdefs.h <<\EOF
23834 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
23835 EOF
23836
23837 fi
23838 if test "$ol_enable_proctitle" != no ; then
23839         cat >> confdefs.h <<\EOF
23840 #define LDAP_PROCTITLE 1
23841 EOF
23842
23843 fi
23844 if test "$ol_enable_referrals" != no ; then
23845         cat >> confdefs.h <<\EOF
23846 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
23847 EOF
23848
23849 fi
23850 if test "$ol_enable_local" != no; then
23851         cat >> confdefs.h <<\EOF
23852 #define LDAP_PF_LOCAL 1
23853 EOF
23854
23855 fi
23856 if test "$ol_link_ipv6" != no; then
23857         cat >> confdefs.h <<\EOF
23858 #define LDAP_PF_INET6 1
23859 EOF
23860
23861 fi
23862 if test "$ol_enable_cleartext" != no ; then
23863         cat >> confdefs.h <<\EOF
23864 #define SLAPD_CLEARTEXT 1
23865 EOF
23866
23867 fi
23868 if test "$ol_enable_crypt" != no ; then
23869         cat >> confdefs.h <<\EOF
23870 #define SLAPD_CRYPT 1
23871 EOF
23872
23873 fi
23874 if test "$ol_link_spasswd" != no ; then
23875         cat >> confdefs.h <<\EOF
23876 #define SLAPD_SPASSWD 1
23877 EOF
23878
23879 fi
23880 if test "$ol_enable_multimaster" != no ; then
23881         cat >> confdefs.h <<\EOF
23882 #define SLAPD_MULTIMASTER 1
23883 EOF
23884
23885 fi
23886 if test "$ol_enable_rlookups" != no ; then
23887         cat >> confdefs.h <<\EOF
23888 #define SLAPD_RLOOKUPS 1
23889 EOF
23890
23891 fi
23892 if test "$ol_enable_aci" != no ; then
23893         cat >> confdefs.h <<\EOF
23894 #define SLAPD_ACI_ENABLED 1
23895 EOF
23896
23897 fi
23898
23899 if test "$ol_link_modules" != no ; then
23900         cat >> confdefs.h <<\EOF
23901 #define SLAPD_MODULES 1
23902 EOF
23903
23904         BUILD_SLAPD=yes
23905         SLAPD_MODULES_LDFLAGS="-dlopen self"
23906 fi
23907
23908 cat >> confdefs.h <<\EOF
23909 #define SLAPD_MOD_STATIC 1
23910 EOF
23911
23912 cat >> confdefs.h <<\EOF
23913 #define SLAPD_MOD_DYNAMIC 2
23914 EOF
23915
23916
23917 if test "$ol_enable_bdb" != no ; then
23918         BUILD_SLAPD=yes
23919         BUILD_BDB=$ol_enable_bdb
23920         if test "$ol_enable_bdb" = mod ; then
23921                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-bdb"
23922                 MFLAG=SLAPD_MOD_DYNAMIC
23923         else
23924                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-bdb"
23925                 MFLAG=SLAPD_MOD_STATIC
23926         fi
23927         cat >> confdefs.h <<EOF
23928 #define SLAPD_BDB $MFLAG
23929 EOF
23930
23931 fi
23932
23933 if test "$ol_enable_dnssrv" != no ; then
23934         BUILD_SLAPD=yes
23935         BUILD_DNSSRV=$ol_enable_dnssrv
23936         if test "$ol_enable_dnssrv" = mod ; then
23937                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-dnssrv"
23938                 MFLAG=SLAPD_MOD_DYNAMIC
23939         else
23940                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-dnssrv"
23941                 MFLAG=SLAPD_MOD_STATIC
23942         fi
23943         cat >> confdefs.h <<EOF
23944 #define SLAPD_DNSSRV $MFLAG
23945 EOF
23946
23947 fi
23948
23949 if test "$ol_enable_hdb" != no ; then
23950         BUILD_SLAPD=yes
23951         BUILD_HDB=$ol_enable_hdb
23952         if test "$ol_enable_hdb" = mod ; then
23953                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-hdb"
23954                 MFLAG=SLAPD_MOD_DYNAMIC
23955         else
23956                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-hdb"
23957                 MFLAG=SLAPD_MOD_STATIC
23958         fi
23959         cat >> confdefs.h <<EOF
23960 #define SLAPD_HDB $MFLAG
23961 EOF
23962
23963 fi
23964
23965 if test "$ol_enable_ldap" != no ; then
23966         BUILD_SLAPD=yes
23967         BUILD_LDAP=$ol_enable_ldap
23968         if test "$ol_enable_ldap" = mod ; then
23969                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldap"
23970                 MFLAG=SLAPD_MOD_DYNAMIC
23971         else
23972                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldap"
23973                 MFLAG=SLAPD_MOD_STATIC
23974         fi
23975         cat >> confdefs.h <<EOF
23976 #define SLAPD_LDAP $MFLAG
23977 EOF
23978
23979 fi
23980
23981 if test "$ol_link_ldbm" != no -a $ol_enable_ldbm != no; then
23982         BUILD_SLAPD=yes
23983         BUILD_LDBM=$ol_enable_ldbm
23984         if test "$ol_enable_ldbm" = mod ; then
23985                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldbm"
23986                 MFLAG=SLAPD_MOD_DYNAMIC
23987         else
23988                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldbm"
23989                 MFLAG=SLAPD_MOD_STATIC
23990         fi
23991         cat >> confdefs.h <<EOF
23992 #define SLAPD_LDBM $MFLAG
23993 EOF
23994
23995 fi
23996
23997 if test "$ol_enable_meta" != no ; then
23998         BUILD_SLAPD=yes
23999         BUILD_META=$ol_enable_meta
24000         BUILD_REWRITE=yes
24001         if test "$ol_enable_meta" = mod ; then
24002                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-meta"
24003                 MFLAG=SLAPD_MOD_DYNAMIC
24004         else
24005                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-meta"
24006                 MFLAG=SLAPD_MOD_STATIC
24007         fi
24008         cat >> confdefs.h <<EOF
24009 #define SLAPD_META $MFLAG
24010 EOF
24011
24012 fi
24013
24014 if test "$ol_enable_monitor" != no ; then
24015         BUILD_SLAPD=yes
24016         BUILD_MONITOR=$ol_enable_monitor
24017         if test "$ol_enable_monitor" = mod ; then
24018                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-monitor"
24019                 MFLAG=SLAPD_MOD_DYNAMIC
24020         else
24021                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-monitor"
24022                 MFLAG=SLAPD_MOD_STATIC
24023         fi
24024         cat >> confdefs.h <<EOF
24025 #define SLAPD_MONITOR $MFLAG
24026 EOF
24027
24028 fi
24029
24030 if test "$ol_enable_null" != no ; then
24031         BUILD_SLAPD=yes
24032         BUILD_NULL=$ol_enable_null
24033         if test "$ol_enable_null" = mod ; then
24034                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-null"
24035                 MFLAG=SLAPD_MOD_DYNAMIC
24036         else
24037                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-null"
24038                 MFLAG=SLAPD_MOD_STATIC
24039         fi
24040         cat >> confdefs.h <<EOF
24041 #define SLAPD_NULL $MFLAG
24042 EOF
24043
24044 fi
24045
24046 if test "$ol_enable_passwd" != no ; then
24047         BUILD_SLAPD=yes
24048         BUILD_PASSWD=$ol_enable_passwd
24049         if test "$ol_enable_passwd" = mod ; then
24050                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-passwd"
24051                 MFLAG=SLAPD_MOD_DYNAMIC
24052         else
24053                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-passwd"
24054                 MFLAG=SLAPD_MOD_STATIC
24055         fi
24056         cat >> confdefs.h <<EOF
24057 #define SLAPD_PASSWD $MFLAG
24058 EOF
24059
24060 fi
24061
24062 if test "$ol_link_perl" != no ; then
24063         BUILD_SLAPD=yes
24064         BUILD_PERL=$ol_enable_perl
24065         if test "$ol_enable_perl" = mod ; then
24066                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-perl"
24067                 MFLAG=SLAPD_MOD_DYNAMIC
24068         else
24069                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-perl"
24070                 MFLAG=SLAPD_MOD_STATIC
24071         fi
24072         cat >> confdefs.h <<EOF
24073 #define SLAPD_PERL $MFLAG
24074 EOF
24075
24076 fi
24077
24078 if test "$ol_enable_shell" != no ; then
24079         if test "$ol_link_thread" != no ; then
24080                 echo "configure: warning: Use of --without-threads is recommended with back-shell" 1>&2
24081         fi
24082         BUILD_SLAPD=yes
24083         BUILD_SHELL=$ol_enable_shell
24084         if test "$ol_enable_shell" = mod ; then
24085                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-shell"
24086                 MFLAG=SLAPD_MOD_DYNAMIC
24087         else
24088                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-shell"
24089                 MFLAG=SLAPD_MOD_STATIC
24090         fi
24091         cat >> confdefs.h <<EOF
24092 #define SLAPD_SHELL $MFLAG
24093 EOF
24094
24095 fi
24096
24097 if test "$ol_link_sql" != no ; then
24098         BUILD_SLAPD=yes
24099         BUILD_SQL=$ol_enable_sql
24100         if test "$ol_enable_sql" = mod; then
24101                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-sql"
24102                 MFLAG=SLAPD_MOD_DYNAMIC
24103         else
24104                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-sql"
24105                 MFLAG=SLAPD_MOD_STATIC
24106         fi
24107         cat >> confdefs.h <<EOF
24108 #define SLAPD_SQL $MFLAG
24109 EOF
24110
24111 fi
24112
24113 if test "$ol_enable_dyngroup" != no ; then
24114         BUILD_DYNGROUP=$ol_enable_dyngroup
24115         if test "$ol_enable_dyngroup" = mod ; then
24116                 MFLAG=SLAPD_MOD_DYNAMIC
24117                 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS dyngroup.la"
24118         else
24119                 MFLAG=SLAPD_MOD_STATIC
24120         fi
24121         cat >> confdefs.h <<EOF
24122 #define SLAPD_OVER_DYNGROUP $MFLAG
24123 EOF
24124
24125 fi
24126
24127 if test "$ol_enable_proxycache" != no ; then
24128         BUILD_PROXYCACHE=$ol_enable_proxycache
24129         if test "$ol_enable_proxycache" = mod ; then
24130                 MFLAG=SLAPD_MOD_DYNAMIC
24131                 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS pcache.la"
24132         else
24133                 MFLAG=SLAPD_MOD_STATIC
24134         fi
24135         cat >> confdefs.h <<EOF
24136 #define SLAPD_OVER_PROXYCACHE $MFLAG
24137 EOF
24138
24139 fi
24140
24141 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
24142         $BUILD_SLAPD = yes ; then
24143         BUILD_SLURPD=yes
24144 fi
24145
24146 if test "$ol_enable_rewrite" != no ; then
24147         cat >> confdefs.h <<\EOF
24148 #define ENABLE_REWRITE 1
24149 EOF
24150
24151         BUILD_REWRITE=yes
24152 fi
24153
24154 if test "$ol_enable_slapi" != no ; then
24155         cat >> confdefs.h <<\EOF
24156 #define ENABLE_SLAPI 1
24157 EOF
24158
24159         BUILD_SLAPI=yes
24160         SLAPD_SLAPI_DEPEND=libslapi.a
24161 fi
24162
24163
24164
24165 if test "$ac_cv_mingw32" = yes ; then
24166         PLAT=NT
24167         SLAPD_MODULES_LDFLAGS=
24168 else
24169         PLAT=UNIX
24170 fi
24171
24172 if test -z "$SLAPD_STATIC_BACKENDS"; then
24173         SLAPD_NO_STATIC='#'
24174 else
24175         SLAPD_NO_STATIC=
24176 fi
24177
24178
24179
24180
24181
24182
24183
24184   
24185   
24186   
24187   
24188   
24189   
24190   
24191   
24192   
24193   
24194   
24195   
24196   
24197   
24198   
24199   
24200
24201
24202
24203
24204
24205
24206
24207
24208
24209
24210
24211
24212
24213
24214
24215
24216
24217
24218
24219
24220
24221
24222
24223
24224
24225
24226
24227
24228
24229
24230
24231
24232
24233
24234
24235
24236
24237
24238 # Check whether --with-xxinstall or --without-xxinstall was given.
24239 if test "${with_xxinstall+set}" = set; then
24240   withval="$with_xxinstall"
24241   :
24242 fi
24243
24244
24245
24246 trap '' 1 2 15
24247
24248 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
24249
24250 test "x$prefix" = xNONE && prefix=$ac_default_prefix
24251 # Let make expand exec_prefix.
24252 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
24253
24254 # Any assignment to VPATH causes Sun make to only execute
24255 # the first set of double-colon rules, so remove it if not needed.
24256 # If there is a colon in the path, we need to keep it.
24257 if test "x$srcdir" = x.; then
24258   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
24259 fi
24260
24261 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
24262
24263 DEFS=-DHAVE_CONFIG_H
24264
24265 # Without the "./", some shells look in PATH for config.status.
24266 : ${CONFIG_STATUS=./config.status}
24267
24268 echo creating $CONFIG_STATUS
24269 rm -f $CONFIG_STATUS
24270 cat > $CONFIG_STATUS <<EOF
24271 #! /bin/sh
24272 # Generated automatically by configure.
24273 # Run this file to recreate the current configuration.
24274 # This directory was configured as follows,
24275 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
24276 #
24277 # $0 $ac_configure_args
24278 #
24279 # Compiler output produced by configure, useful for debugging
24280 # configure, is in ./config.log if it exists.
24281
24282 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
24283 for ac_option
24284 do
24285   case "\$ac_option" in
24286   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
24287     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
24288     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
24289   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
24290     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
24291     exit 0 ;;
24292   -help | --help | --hel | --he | --h)
24293     echo "\$ac_cs_usage"; exit 0 ;;
24294   *) echo "\$ac_cs_usage"; exit 1 ;;
24295   esac
24296 done
24297
24298 ac_given_srcdir=$srcdir
24299 ac_given_INSTALL="$INSTALL"
24300
24301 trap 'rm -fr `echo "\
24302 Makefile:build/top.mk:Makefile.in:build/dir.mk \
24303 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
24304 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
24305 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
24306 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
24307 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
24308 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
24309 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
24310 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
24311 include/Makefile:build/top.mk:include/Makefile.in \
24312 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
24313 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
24314 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
24315 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
24316 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
24317 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
24318 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
24319 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
24320 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
24321 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
24322 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
24323 servers/slapd/back-hdb/Makefile:build/top.mk:servers/slapd/back-hdb/Makefile.in:build/mod.mk \
24324 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
24325 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
24326 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
24327 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
24328 servers/slapd/back-null/Makefile:build/top.mk:servers/slapd/back-null/Makefile.in:build/mod.mk \
24329 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
24330 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
24331 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
24332 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
24333 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
24334 servers/slapd/slapi/Makefile:build/top.mk:servers/slapd/slapi/Makefile.in:build/lib.mk:build/lib-shared.mk  \
24335 servers/slapd/overlays/Makefile:build/top.mk:servers/slapd/overlays/Makefile.in:build/lib.mk \
24336 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
24337 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
24338 tests/run \
24339 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
24340  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
24341 EOF
24342 cat >> $CONFIG_STATUS <<EOF
24343
24344 # Protect against being on the right side of a sed subst in config.status.
24345 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
24346  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
24347 $ac_vpsub
24348 $extrasub
24349 s%@SHELL@%$SHELL%g
24350 s%@CFLAGS@%$CFLAGS%g
24351 s%@CPPFLAGS@%$CPPFLAGS%g
24352 s%@CXXFLAGS@%$CXXFLAGS%g
24353 s%@FFLAGS@%$FFLAGS%g
24354 s%@DEFS@%$DEFS%g
24355 s%@LDFLAGS@%$LDFLAGS%g
24356 s%@LIBS@%$LIBS%g
24357 s%@exec_prefix@%$exec_prefix%g
24358 s%@prefix@%$prefix%g
24359 s%@program_transform_name@%$program_transform_name%g
24360 s%@bindir@%$bindir%g
24361 s%@sbindir@%$sbindir%g
24362 s%@libexecdir@%$libexecdir%g
24363 s%@datadir@%$datadir%g
24364 s%@sysconfdir@%$sysconfdir%g
24365 s%@sharedstatedir@%$sharedstatedir%g
24366 s%@localstatedir@%$localstatedir%g
24367 s%@libdir@%$libdir%g
24368 s%@includedir@%$includedir%g
24369 s%@oldincludedir@%$oldincludedir%g
24370 s%@infodir@%$infodir%g
24371 s%@mandir@%$mandir%g
24372 s%@host@%$host%g
24373 s%@host_alias@%$host_alias%g
24374 s%@host_cpu@%$host_cpu%g
24375 s%@host_vendor@%$host_vendor%g
24376 s%@host_os@%$host_os%g
24377 s%@target@%$target%g
24378 s%@target_alias@%$target_alias%g
24379 s%@target_cpu@%$target_cpu%g
24380 s%@target_vendor@%$target_vendor%g
24381 s%@target_os@%$target_os%g
24382 s%@build@%$build%g
24383 s%@build_alias@%$build_alias%g
24384 s%@build_cpu@%$build_cpu%g
24385 s%@build_vendor@%$build_vendor%g
24386 s%@build_os@%$build_os%g
24387 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
24388 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
24389 s%@INSTALL_DATA@%$INSTALL_DATA%g
24390 s%@PACKAGE@%$PACKAGE%g
24391 s%@VERSION@%$VERSION%g
24392 s%@ACLOCAL@%$ACLOCAL%g
24393 s%@AUTOCONF@%$AUTOCONF%g
24394 s%@AUTOMAKE@%$AUTOMAKE%g
24395 s%@AUTOHEADER@%$AUTOHEADER%g
24396 s%@MAKEINFO@%$MAKEINFO%g
24397 s%@install_sh@%$install_sh%g
24398 s%@AMTAR@%$AMTAR%g
24399 s%@AWK@%$AWK%g
24400 s%@AMTARFLAGS@%$AMTARFLAGS%g
24401 s%@SET_MAKE@%$SET_MAKE%g
24402 s%@OPENLDAP_LIBRELEASE@%$OPENLDAP_LIBRELEASE%g
24403 s%@OPENLDAP_LIBVERSION@%$OPENLDAP_LIBVERSION%g
24404 s%@OPENLDAP_RELEASE_DATE@%$OPENLDAP_RELEASE_DATE%g
24405 s%@top_builddir@%$top_builddir%g
24406 s%@ldap_subdir@%$ldap_subdir%g
24407 s%@CC@%$CC%g
24408 s%@AR@%$AR%g
24409 s%@LN_S@%$LN_S%g
24410 s%@OBJEXT@%$OBJEXT%g
24411 s%@EXEEXT@%$EXEEXT%g
24412 s%@ECHO@%$ECHO%g
24413 s%@RANLIB@%$RANLIB%g
24414 s%@STRIP@%$STRIP%g
24415 s%@DLLTOOL@%$DLLTOOL%g
24416 s%@AS@%$AS%g
24417 s%@OBJDUMP@%$OBJDUMP%g
24418 s%@CPP@%$CPP%g
24419 s%@LIBTOOL@%$LIBTOOL%g
24420 s%@LN_H@%$LN_H%g
24421 s%@PERLBIN@%$PERLBIN%g
24422 s%@OL_MKDEP@%$OL_MKDEP%g
24423 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
24424 s%@LTSTATIC@%$LTSTATIC%g
24425 s%@LIBOBJS@%$LIBOBJS%g
24426 s%@LIBSRCS@%$LIBSRCS%g
24427 s%@PLAT@%$PLAT%g
24428 s%@WITH_TLS@%$WITH_TLS%g
24429 s%@BUILD_LIBS_DYNAMIC@%$BUILD_LIBS_DYNAMIC%g
24430 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
24431 s%@BUILD_SLAPI@%$BUILD_SLAPI%g
24432 s%@SLAPD_SLAPI_DEPEND@%$SLAPD_SLAPI_DEPEND%g
24433 s%@BUILD_BDB@%$BUILD_BDB%g
24434 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
24435 s%@BUILD_HDB@%$BUILD_HDB%g
24436 s%@BUILD_LDAP@%$BUILD_LDAP%g
24437 s%@BUILD_LDBM@%$BUILD_LDBM%g
24438 s%@BUILD_META@%$BUILD_META%g
24439 s%@BUILD_MONITOR@%$BUILD_MONITOR%g
24440 s%@BUILD_NULL@%$BUILD_NULL%g
24441 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
24442 s%@BUILD_PERL@%$BUILD_PERL%g
24443 s%@BUILD_SHELL@%$BUILD_SHELL%g
24444 s%@BUILD_SQL@%$BUILD_SQL%g
24445 s%@BUILD_DYNGROUP@%$BUILD_DYNGROUP%g
24446 s%@BUILD_PROXYCACHE@%$BUILD_PROXYCACHE%g
24447 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
24448 s%@LDAP_LIBS@%$LDAP_LIBS%g
24449 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
24450 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
24451 s%@LDBM_LIBS@%$LDBM_LIBS%g
24452 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
24453 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
24454 s%@WRAP_LIBS@%$WRAP_LIBS%g
24455 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
24456 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
24457 s%@SLAPD_NO_STATIC@%$SLAPD_NO_STATIC%g
24458 s%@SLAPD_STATIC_BACKENDS@%$SLAPD_STATIC_BACKENDS%g
24459 s%@SLAPD_DYNAMIC_BACKENDS@%$SLAPD_DYNAMIC_BACKENDS%g
24460 s%@SLAPD_DYNAMIC_OVERLAYS@%$SLAPD_DYNAMIC_OVERLAYS%g
24461 s%@PERL_CPPFLAGS@%$PERL_CPPFLAGS%g
24462 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
24463 s%@MOD_PERL_LDFLAGS@%$MOD_PERL_LDFLAGS%g
24464 s%@KRB4_LIBS@%$KRB4_LIBS%g
24465 s%@KRB5_LIBS@%$KRB5_LIBS%g
24466 s%@SASL_LIBS@%$SASL_LIBS%g
24467 s%@TLS_LIBS@%$TLS_LIBS%g
24468 s%@MODULES_LIBS@%$MODULES_LIBS%g
24469 s%@SLAPI_LIBS@%$SLAPI_LIBS%g
24470 s%@LIBSLAPI@%$LIBSLAPI%g
24471 s%@LIBSLAPITOOLS@%$LIBSLAPITOOLS%g
24472 s%@AUTH_LIBS@%$AUTH_LIBS%g
24473 s%@SLAPD_SLP_LIBS@%$SLAPD_SLP_LIBS%g
24474 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
24475 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
24476 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
24477
24478 CEOF
24479 EOF
24480
24481 cat >> $CONFIG_STATUS <<\EOF
24482
24483 # Split the substitutions into bite-sized pieces for seds with
24484 # small command number limits, like on Digital OSF/1 and HP-UX.
24485 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
24486 ac_file=1 # Number of current file.
24487 ac_beg=1 # First line for current file.
24488 ac_end=$ac_max_sed_cmds # Line after last line for current file.
24489 ac_more_lines=:
24490 ac_sed_cmds=""
24491 while $ac_more_lines; do
24492   if test $ac_beg -gt 1; then
24493     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
24494   else
24495     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
24496   fi
24497   if test ! -s conftest.s$ac_file; then
24498     ac_more_lines=false
24499     rm -f conftest.s$ac_file
24500   else
24501     if test -z "$ac_sed_cmds"; then
24502       ac_sed_cmds="sed -f conftest.s$ac_file"
24503     else
24504       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
24505     fi
24506     ac_file=`expr $ac_file + 1`
24507     ac_beg=$ac_end
24508     ac_end=`expr $ac_end + $ac_max_sed_cmds`
24509   fi
24510 done
24511 if test -z "$ac_sed_cmds"; then
24512   ac_sed_cmds=cat
24513 fi
24514 EOF
24515
24516 cat >> $CONFIG_STATUS <<EOF
24517
24518 CONFIG_FILES=\${CONFIG_FILES-"\
24519 Makefile:build/top.mk:Makefile.in:build/dir.mk \
24520 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
24521 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
24522 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
24523 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
24524 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
24525 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
24526 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
24527 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
24528 include/Makefile:build/top.mk:include/Makefile.in \
24529 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
24530 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
24531 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
24532 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
24533 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
24534 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
24535 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
24536 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
24537 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
24538 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
24539 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
24540 servers/slapd/back-hdb/Makefile:build/top.mk:servers/slapd/back-hdb/Makefile.in:build/mod.mk \
24541 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
24542 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
24543 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
24544 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
24545 servers/slapd/back-null/Makefile:build/top.mk:servers/slapd/back-null/Makefile.in:build/mod.mk \
24546 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
24547 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
24548 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
24549 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
24550 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
24551 servers/slapd/slapi/Makefile:build/top.mk:servers/slapd/slapi/Makefile.in:build/lib.mk:build/lib-shared.mk  \
24552 servers/slapd/overlays/Makefile:build/top.mk:servers/slapd/overlays/Makefile.in:build/lib.mk \
24553 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
24554 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
24555 tests/run \
24556 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
24557 "}
24558 EOF
24559 cat >> $CONFIG_STATUS <<\EOF
24560 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
24561   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
24562   case "$ac_file" in
24563   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
24564        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
24565   *) ac_file_in="${ac_file}.in" ;;
24566   esac
24567
24568   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
24569
24570   # Remove last slash and all that follows it.  Not all systems have dirname.
24571   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
24572   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
24573     # The file is in a subdirectory.
24574     test ! -d "$ac_dir" && mkdir "$ac_dir"
24575     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
24576     # A "../" for each directory in $ac_dir_suffix.
24577     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
24578   else
24579     ac_dir_suffix= ac_dots=
24580   fi
24581
24582   case "$ac_given_srcdir" in
24583   .)  srcdir=.
24584       if test -z "$ac_dots"; then top_srcdir=.
24585       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
24586   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
24587   *) # Relative path.
24588     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
24589     top_srcdir="$ac_dots$ac_given_srcdir" ;;
24590   esac
24591
24592   case "$ac_given_INSTALL" in
24593   [/$]*) INSTALL="$ac_given_INSTALL" ;;
24594   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
24595   esac
24596
24597   echo creating "$ac_file"
24598   rm -f "$ac_file"
24599   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
24600   case "$ac_file" in
24601   *[Mm]akefile*) ac_comsub="1i\\
24602 # $configure_input" ;;
24603   *) ac_comsub= ;;
24604   esac
24605
24606   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
24607   sed -e "$ac_comsub
24608 s%@configure_input@%$configure_input%g
24609 s%@srcdir@%$srcdir%g
24610 s%@top_srcdir@%$top_srcdir%g
24611 s%@INSTALL@%$INSTALL%g
24612 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
24613 fi; done
24614 rm -f conftest.s*
24615
24616 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
24617 # NAME is the cpp macro being defined and VALUE is the value it is being given.
24618 #
24619 # ac_d sets the value in "#define NAME VALUE" lines.
24620 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
24621 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
24622 ac_dC='\3'
24623 ac_dD='%g'
24624 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
24625 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
24626 ac_uB='\([      ]\)%\1#\2define\3'
24627 ac_uC=' '
24628 ac_uD='\4%g'
24629 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
24630 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
24631 ac_eB='$%\1#\2define\3'
24632 ac_eC=' '
24633 ac_eD='%g'
24634
24635 if test "${CONFIG_HEADERS+set}" != set; then
24636 EOF
24637 cat >> $CONFIG_STATUS <<EOF
24638   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
24639 EOF
24640 cat >> $CONFIG_STATUS <<\EOF
24641 fi
24642 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
24643   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
24644   case "$ac_file" in
24645   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
24646        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
24647   *) ac_file_in="${ac_file}.in" ;;
24648   esac
24649
24650   echo creating $ac_file
24651
24652   rm -f conftest.frag conftest.in conftest.out
24653   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
24654   cat $ac_file_inputs > conftest.in
24655
24656 EOF
24657
24658 # Transform confdefs.h into a sed script conftest.vals that substitutes
24659 # the proper values into config.h.in to produce config.h.  And first:
24660 # Protect against being on the right side of a sed subst in config.status.
24661 # Protect against being in an unquoted here document in config.status.
24662 rm -f conftest.vals
24663 cat > conftest.hdr <<\EOF
24664 s/[\\&%]/\\&/g
24665 s%[\\$`]%\\&%g
24666 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
24667 s%ac_d%ac_u%gp
24668 s%ac_u%ac_e%gp
24669 EOF
24670 sed -n -f conftest.hdr confdefs.h > conftest.vals
24671 rm -f conftest.hdr
24672
24673 # This sed command replaces #undef with comments.  This is necessary, for
24674 # example, in the case of _POSIX_SOURCE, which is predefined and required
24675 # on some systems where configure will not decide to define it.
24676 cat >> conftest.vals <<\EOF
24677 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
24678 EOF
24679
24680 # Break up conftest.vals because some shells have a limit on
24681 # the size of here documents, and old seds have small limits too.
24682
24683 rm -f conftest.tail
24684 while :
24685 do
24686   ac_lines=`grep -c . conftest.vals`
24687   # grep -c gives empty output for an empty file on some AIX systems.
24688   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
24689   # Write a limited-size here document to conftest.frag.
24690   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
24691   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
24692   echo 'CEOF
24693   sed -f conftest.frag conftest.in > conftest.out
24694   rm -f conftest.in
24695   mv conftest.out conftest.in
24696 ' >> $CONFIG_STATUS
24697   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
24698   rm -f conftest.vals
24699   mv conftest.tail conftest.vals
24700 done
24701 rm -f conftest.vals
24702
24703 cat >> $CONFIG_STATUS <<\EOF
24704   rm -f conftest.frag conftest.h
24705   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
24706   cat conftest.in >> conftest.h
24707   rm -f conftest.in
24708   if cmp -s $ac_file conftest.h 2>/dev/null; then
24709     echo "$ac_file is unchanged"
24710     rm -f conftest.h
24711   else
24712     # Remove last slash and all that follows it.  Not all systems have dirname.
24713       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
24714       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
24715       # The file is in a subdirectory.
24716       test ! -d "$ac_dir" && mkdir "$ac_dir"
24717     fi
24718     rm -f $ac_file
24719     mv conftest.h $ac_file
24720   fi
24721 fi; done
24722
24723 EOF
24724 cat >> $CONFIG_STATUS <<EOF
24725
24726 EOF
24727 cat >> $CONFIG_STATUS <<\EOF
24728
24729 chmod +x tests/run
24730 date > stamp-h
24731 echo Please run \"make depend\" to build dependencies
24732
24733 exit 0
24734 EOF
24735 chmod +x $CONFIG_STATUS
24736 rm -fr confdefs* $ac_clean_files
24737 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
24738