]> git.sur5r.net Git - openldap/blob - configure
Memory context fixes
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.473 2003/04/07 20:23:25 kurt Exp  
4
5 # Copyright 1998-2003 The OpenLDAP Foundation.  All Rights Reserved.
6
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted only as authorized by the OpenLDAP
9 # Public License.  A copy of this license is available at
10 # http://www.OpenLDAP.org/license.html or in file LICENSE in the
11 # top-level directory of the distribution.
12
13 echo "Copyright 1998-2003 The OpenLDAP Foundation,  All Rights Reserved."
14 echo "  Restrictions apply, see COPYRIGHT and LICENSE files."
15
16 # Guess values for system-dependent variables and create Makefiles.
17 # Generated automatically using autoconf version 2.13.1 
18 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
19 #
20 # This configure script is free software; the Free Software Foundation
21 # gives unlimited permission to copy, distribute and modify it.
22
23 # Defaults:
24 ac_help=
25 ac_default_prefix=/usr/local
26 # Any additions from configure.in:
27 ac_default_prefix=/usr/local
28 ac_help="$ac_help
29   --with-subdir=DIR       change default subdirectory used for installs"
30 ac_help="$ac_help
31   --enable-debug          enable debugging [yes]"
32 ac_help="$ac_help
33   --enable-dynamic        enable linking built binaries with dynamic libs [no]"
34 ac_help="$ac_help
35   --enable-syslog         enable syslog support [auto]"
36 ac_help="$ac_help
37   --enable-proctitle      enable proctitle support [yes]"
38 ac_help="$ac_help
39   --enable-ipv6           enable IPv6 support [auto]"
40 ac_help="$ac_help
41   --enable-local          enable AF_LOCAL (AF_UNIX) socket support [auto]"
42 ac_help="$ac_help
43   --enable-x-compile      enable cross compiling [no]"
44 ac_help="$ac_help
45   --with-cyrus-sasl       with Cyrus SASL support [auto]"
46 ac_help="$ac_help
47   --with-fetch            with fetch(3) URL support [auto]"
48 ac_help="$ac_help
49   --with-kerberos         with Kerberos support [auto]"
50 ac_help="$ac_help
51   --with-readline         with readline support [auto]"
52 ac_help="$ac_help
53   --with-threads          with threads [auto]"
54 ac_help="$ac_help
55   --with-tls              with TLS/SSL support [auto]"
56 ac_help="$ac_help
57   --with-yielding-select  with implicitly yielding select [auto]"
58 ac_help="$ac_help
59
60 SLAPD (Standalone LDAP Daemon) Options:"
61 ac_help="$ac_help
62   --enable-slapd          enable building slapd [yes]"
63 ac_help="$ac_help
64     --enable-aci          enable per-object ACIs (experimental) [no]"
65 ac_help="$ac_help
66     --enable-cleartext    enable cleartext passwords [yes]"
67 ac_help="$ac_help
68     --enable-crypt        enable crypt(3) passwords [no]"
69 ac_help="$ac_help
70     --enable-kpasswd      enable Kerberos password verification [no]"
71 ac_help="$ac_help
72     --enable-lmpasswd     enable LAN Manager passwords [no]"
73 ac_help="$ac_help
74     --enable-spasswd      enable (Cyrus) SASL password verification [no]"
75 ac_help="$ac_help
76     --enable-modules      enable dynamic module support [no]"
77 ac_help="$ac_help
78     --enable-phonetic     enable phonetic/soundex [no]"
79 ac_help="$ac_help
80     --enable-rewrite      enable DN rewriting in back-ldap and back-meta [no]"
81 ac_help="$ac_help
82     --enable-rlookups     enable reverse lookups of client hostnames [no]"
83 ac_help="$ac_help
84     --enable-slapi        enable installation of slapi library [no]"
85 ac_help="$ac_help
86     --enable-slp          enable SLPv2 support [no]"
87 ac_help="$ac_help
88     --enable-wrappers     enable tcp wrapper support [no]"
89 ac_help="$ac_help
90     --enable-bdb          enable Berkeley DB backend [yes]"
91 ac_help="$ac_help
92     --with-bdb-module     module type static|dynamic [static]"
93 ac_help="$ac_help
94     --enable-dnssrv       enable dnssrv backend [no]"
95 ac_help="$ac_help
96     --with-dnssrv-module  module type static|dynamic [static]"
97 ac_help="$ac_help
98     --enable-ldap         enable ldap backend [no]"
99 ac_help="$ac_help
100     --with-ldap-module    module type static|dynamic [static]"
101 ac_help="$ac_help
102     --enable-ldbm         enable ldbm backend [no]"
103 ac_help="$ac_help
104     --with-ldbm-api       with LDBM API auto|berkeley|bcompat|mdbm|gdbm [auto]"
105 ac_help="$ac_help
106     --with-ldbm-module    module type static|dynamic [static]"
107 ac_help="$ac_help
108     --with-ldbm-type      use LDBM type auto|btree|hash [auto]"
109 ac_help="$ac_help
110     --enable-meta         enable metadirectory backend [no]"
111 ac_help="$ac_help
112     --with-meta-module    module type static|dynamic [static]"
113 ac_help="$ac_help
114     --enable-monitor      enable monitor backend [no]"
115 ac_help="$ac_help
116     --with-monitor-module module type static|dynamic [static]"
117 ac_help="$ac_help
118     --enable-null         enable null backend [no]"
119 ac_help="$ac_help
120     --with-null-module    module type static|dynamic [static]"
121 ac_help="$ac_help
122     --enable-passwd       enable passwd backend [no]"
123 ac_help="$ac_help
124     --with-passwd-module  module type static|dynamic [static]"
125 ac_help="$ac_help
126     --enable-perl         enable perl backend [no]"
127 ac_help="$ac_help
128     --with-perl-module    module type static|dynamic [static]"
129 ac_help="$ac_help
130     --enable-shell        enable shell backend [no]"
131 ac_help="$ac_help
132     --with-shell-module   module type static|dynamic [static]"
133 ac_help="$ac_help
134     --enable-sql          enable sql backend [no]"
135 ac_help="$ac_help
136     --with-sql-module     module type static|dynamic [static]"
137 ac_help="$ac_help
138     --enable-tcl          enable tcl backend [no]"
139 ac_help="$ac_help
140     --with-tcl-module     module type static|dynamic [static]"
141 ac_help="$ac_help
142
143 SLURPD (Replication Daemon) Options:"
144 ac_help="$ac_help
145   --enable-slurpd         enable building slurpd [auto]"
146 ac_help="$ac_help
147
148 Library Generation & Linking Options"
149 ac_help="$ac_help
150   --enable-static[=PKGS]  build static libraries [default=yes]"
151 ac_help="$ac_help
152   --enable-shared[=PKGS]  build shared libraries [default=yes]"
153 ac_help="$ac_help
154   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
155 ac_help="$ac_help
156   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
157
158 # Find the correct PATH separator.  Usually this is `:', but
159 # DJGPP uses `;' like DOS.
160 if test "X${PATH_SEPARATOR+set}" != Xset; then
161   UNAME=${UNAME-`uname 2>/dev/null`}
162   case X$UNAME in
163     *-DOS) lt_cv_sys_path_separator=';' ;;
164     *)     lt_cv_sys_path_separator=':' ;;
165   esac
166   PATH_SEPARATOR=$lt_cv_sys_path_separator
167 fi
168
169
170 # Check that we are running under the correct shell.
171 SHELL=${CONFIG_SHELL-/bin/sh}
172
173 case X$ECHO in
174 X*--fallback-echo)
175   # Remove one level of quotation (which was required for Make).
176   ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
177   ;;
178 esac
179
180 echo=${ECHO-echo}
181 if test "X$1" = X--no-reexec; then
182   # Discard the --no-reexec flag, and continue.
183   shift
184 elif test "X$1" = X--fallback-echo; then
185   # Avoid inline document here, it may be left over
186   :
187 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
188   # Yippee, $echo works!
189   :
190 else
191   # Restart under the correct shell.
192   exec $SHELL "$0" --no-reexec ${1+"$@"}
193 fi
194
195 if test "X$1" = X--fallback-echo; then
196   # used as fallback echo
197   shift
198   cat <<EOF
199
200 EOF
201   exit 0
202 fi
203
204 # The HP-UX ksh and POSIX shell print the target directory to stdout
205 # if CDPATH is set.
206 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
207
208 if test -z "$ECHO"; then
209 if test "X${echo_test_string+set}" != Xset; then
210 # find a string as large as possible, as long as the shell can cope with it
211   for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
212     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
213     if (echo_test_string="`eval $cmd`") 2>/dev/null &&
214        echo_test_string="`eval $cmd`" &&
215        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
216     then
217       break
218     fi
219   done
220 fi
221
222 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
223    echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
224    test "X$echo_testing_string" = "X$echo_test_string"; then
225   :
226 else
227   # The Solaris, AIX, and Digital Unix default echo programs unquote
228   # backslashes.  This makes it impossible to quote backslashes using
229   #   echo "$something" | sed 's/\\/\\\\/g'
230   #
231   # So, first we look for a working echo in the user's PATH.
232
233   IFS="${IFS=   }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
234   for dir in $PATH /usr/ucb; do
235     if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
236        test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
237        echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
238        test "X$echo_testing_string" = "X$echo_test_string"; then
239       echo="$dir/echo"
240       break
241     fi
242   done
243   IFS="$save_ifs"
244
245   if test "X$echo" = Xecho; then
246     # We didn't find a better echo, so look for alternatives.
247     if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
248        echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
249        test "X$echo_testing_string" = "X$echo_test_string"; then
250       # This shell has a builtin print -r that does the trick.
251       echo='print -r'
252     elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
253          test "X$CONFIG_SHELL" != X/bin/ksh; then
254       # If we have ksh, try running configure again with it.
255       ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
256       export ORIGINAL_CONFIG_SHELL
257       CONFIG_SHELL=/bin/ksh
258       export CONFIG_SHELL
259       exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
260     else
261       # Try using printf.
262       echo='printf %s\n'
263       if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
264          echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
265          test "X$echo_testing_string" = "X$echo_test_string"; then
266         # Cool, printf works
267         :
268       elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
269            test "X$echo_testing_string" = 'X\t' &&
270            echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
271            test "X$echo_testing_string" = "X$echo_test_string"; then
272         CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
273         export CONFIG_SHELL
274         SHELL="$CONFIG_SHELL"
275         export SHELL
276         echo="$CONFIG_SHELL $0 --fallback-echo"
277       elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
278            test "X$echo_testing_string" = 'X\t' &&
279            echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
280            test "X$echo_testing_string" = "X$echo_test_string"; then
281         echo="$CONFIG_SHELL $0 --fallback-echo"
282       else
283         # maybe with a smaller string...
284         prev=:
285
286         for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
287           if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
288           then
289             break
290           fi
291           prev="$cmd"
292         done
293
294         if test "$prev" != 'sed 50q "$0"'; then
295           echo_test_string=`eval $prev`
296           export echo_test_string
297           exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
298         else
299           # Oops.  We lost completely, so just stick with echo.
300           echo=echo
301         fi
302       fi
303     fi
304   fi
305 fi
306 fi
307
308 # Copy echo and quote the copy suitably for passing to libtool from
309 # the Makefile, instead of quoting the original, which is used later.
310 ECHO=$echo
311 if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
312    ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
313 fi
314
315
316 ac_help="$ac_help
317   --disable-libtool-lock  avoid locking (might break parallel builds)"
318 ac_help="$ac_help
319   --with-pic              try to use only PIC/non-PIC objects [default=use both]"
320 ac_help="$ac_help
321
322 See INSTALL file for further details."
323
324 # Initialize some variables set by options.
325 # The variables have the same names as the options, with
326 # dashes changed to underlines.
327 build=NONE
328 cache_file=./config.cache
329 exec_prefix=NONE
330 host=NONE
331 no_create=
332 nonopt=NONE
333 no_recursion=
334 prefix=NONE
335 program_prefix=NONE
336 program_suffix=NONE
337 program_transform_name=s,x,x,
338 silent=
339 site=
340 srcdir=
341 target=NONE
342 verbose=
343 x_includes=NONE
344 x_libraries=NONE
345 bindir='${exec_prefix}/bin'
346 sbindir='${exec_prefix}/sbin'
347 libexecdir='${exec_prefix}/libexec'
348 datadir='${prefix}/share'
349 sysconfdir='${prefix}/etc'
350 sharedstatedir='${prefix}/com'
351 localstatedir='${prefix}/var'
352 libdir='${exec_prefix}/lib'
353 includedir='${prefix}/include'
354 oldincludedir='/usr/include'
355 infodir='${prefix}/info'
356 mandir='${prefix}/man'
357
358 # Initialize some other variables.
359 subdirs=
360 MFLAGS= MAKEFLAGS=
361 SHELL=${CONFIG_SHELL-/bin/sh}
362 # Maximum number of lines to put in a shell here document.
363 ac_max_here_lines=12
364
365 ac_prev=
366 for ac_option
367 do
368
369   # If the previous option needs an argument, assign it.
370   if test -n "$ac_prev"; then
371     eval "$ac_prev=\$ac_option"
372     ac_prev=
373     continue
374   fi
375
376   case "$ac_option" in
377   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
378   *) ac_optarg= ;;
379   esac
380
381   # Accept the important Cygnus configure options, so we can diagnose typos.
382
383   case "$ac_option" in
384
385   -bindir | --bindir | --bindi | --bind | --bin | --bi)
386     ac_prev=bindir ;;
387   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
388     bindir="$ac_optarg" ;;
389
390   -build | --build | --buil | --bui | --bu)
391     ac_prev=build ;;
392   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
393     build="$ac_optarg" ;;
394
395   -cache-file | --cache-file | --cache-fil | --cache-fi \
396   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
397     ac_prev=cache_file ;;
398   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
399   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
400     cache_file="$ac_optarg" ;;
401
402   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
403     ac_prev=datadir ;;
404   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
405   | --da=*)
406     datadir="$ac_optarg" ;;
407
408   -disable-* | --disable-*)
409     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
410     # Reject names that are not valid shell variable names.
411     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
412       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
413     fi
414     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
415     eval "enable_${ac_feature}=no" ;;
416
417   -enable-* | --enable-*)
418     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
419     # Reject names that are not valid shell variable names.
420     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
421       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
422     fi
423     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
424     case "$ac_option" in
425       *=*) ;;
426       *) ac_optarg=yes ;;
427     esac
428     eval "enable_${ac_feature}='$ac_optarg'" ;;
429
430   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
431   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
432   | --exec | --exe | --ex)
433     ac_prev=exec_prefix ;;
434   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
435   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
436   | --exec=* | --exe=* | --ex=*)
437     exec_prefix="$ac_optarg" ;;
438
439   -gas | --gas | --ga | --g)
440     # Obsolete; use --with-gas.
441     with_gas=yes ;;
442
443   -help | --help | --hel | --he)
444     # Omit some internal or obsolete options to make the list less imposing.
445     # This message is too long to be a string in the A/UX 3.1 sh.
446     cat << EOF
447 Usage: configure [options] [host]
448 Options: [defaults in brackets after descriptions]
449 Configuration:
450   --cache-file=FILE       cache test results in FILE
451   --help                  print this message
452   --no-create             do not create output files
453   --quiet, --silent       do not print \`checking...' messages
454   --version               print the version of autoconf that created configure
455 Directory and file names:
456   --prefix=PREFIX         install architecture-independent files in PREFIX
457                           [$ac_default_prefix]
458   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
459                           [same as prefix]
460   --bindir=DIR            user executables in DIR [EPREFIX/bin]
461   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
462   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
463   --datadir=DIR           read-only architecture-independent data in DIR
464                           [PREFIX/share]
465   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
466   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
467                           [PREFIX/com]
468   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
469   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
470   --includedir=DIR        C header files in DIR [PREFIX/include]
471   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
472   --infodir=DIR           info documentation in DIR [PREFIX/info]
473   --mandir=DIR            man documentation in DIR [PREFIX/man]
474   --srcdir=DIR            find the sources in DIR [configure dir or ..]
475   --program-prefix=PREFIX prepend PREFIX to installed program names
476   --program-suffix=SUFFIX append SUFFIX to installed program names
477   --program-transform-name=PROGRAM
478                           run sed PROGRAM on installed program names
479 EOF
480     cat << EOF
481 Host type:
482   --build=BUILD           configure for building on BUILD [BUILD=HOST]
483   --host=HOST             configure for HOST [guessed]
484   --target=TARGET         configure for TARGET [TARGET=HOST]
485 Features and packages:
486   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
487   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
488   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
489   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
490   --x-includes=DIR        X include files are in DIR
491   --x-libraries=DIR       X library files are in DIR
492 EOF
493     if test -n "$ac_help"; then
494       echo "--enable and --with options recognized:$ac_help"
495     fi
496     exit 0 ;;
497
498   -host | --host | --hos | --ho)
499     ac_prev=host ;;
500   -host=* | --host=* | --hos=* | --ho=*)
501     host="$ac_optarg" ;;
502
503   -includedir | --includedir | --includedi | --included | --include \
504   | --includ | --inclu | --incl | --inc)
505     ac_prev=includedir ;;
506   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
507   | --includ=* | --inclu=* | --incl=* | --inc=*)
508     includedir="$ac_optarg" ;;
509
510   -infodir | --infodir | --infodi | --infod | --info | --inf)
511     ac_prev=infodir ;;
512   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
513     infodir="$ac_optarg" ;;
514
515   -libdir | --libdir | --libdi | --libd)
516     ac_prev=libdir ;;
517   -libdir=* | --libdir=* | --libdi=* | --libd=*)
518     libdir="$ac_optarg" ;;
519
520   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
521   | --libexe | --libex | --libe)
522     ac_prev=libexecdir ;;
523   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
524   | --libexe=* | --libex=* | --libe=*)
525     libexecdir="$ac_optarg" ;;
526
527   -localstatedir | --localstatedir | --localstatedi | --localstated \
528   | --localstate | --localstat | --localsta | --localst \
529   | --locals | --local | --loca | --loc | --lo)
530     ac_prev=localstatedir ;;
531   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
532   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
533   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
534     localstatedir="$ac_optarg" ;;
535
536   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
537     ac_prev=mandir ;;
538   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
539     mandir="$ac_optarg" ;;
540
541   -nfp | --nfp | --nf)
542     # Obsolete; use --without-fp.
543     with_fp=no ;;
544
545   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
546   | --no-cr | --no-c)
547     no_create=yes ;;
548
549   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
550   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
551     no_recursion=yes ;;
552
553   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
554   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
555   | --oldin | --oldi | --old | --ol | --o)
556     ac_prev=oldincludedir ;;
557   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
558   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
559   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
560     oldincludedir="$ac_optarg" ;;
561
562   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
563     ac_prev=prefix ;;
564   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
565     prefix="$ac_optarg" ;;
566
567   -program-prefix | --program-prefix | --program-prefi | --program-pref \
568   | --program-pre | --program-pr | --program-p)
569     ac_prev=program_prefix ;;
570   -program-prefix=* | --program-prefix=* | --program-prefi=* \
571   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
572     program_prefix="$ac_optarg" ;;
573
574   -program-suffix | --program-suffix | --program-suffi | --program-suff \
575   | --program-suf | --program-su | --program-s)
576     ac_prev=program_suffix ;;
577   -program-suffix=* | --program-suffix=* | --program-suffi=* \
578   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
579     program_suffix="$ac_optarg" ;;
580
581   -program-transform-name | --program-transform-name \
582   | --program-transform-nam | --program-transform-na \
583   | --program-transform-n | --program-transform- \
584   | --program-transform | --program-transfor \
585   | --program-transfo | --program-transf \
586   | --program-trans | --program-tran \
587   | --progr-tra | --program-tr | --program-t)
588     ac_prev=program_transform_name ;;
589   -program-transform-name=* | --program-transform-name=* \
590   | --program-transform-nam=* | --program-transform-na=* \
591   | --program-transform-n=* | --program-transform-=* \
592   | --program-transform=* | --program-transfor=* \
593   | --program-transfo=* | --program-transf=* \
594   | --program-trans=* | --program-tran=* \
595   | --progr-tra=* | --program-tr=* | --program-t=*)
596     program_transform_name="$ac_optarg" ;;
597
598   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
599   | -silent | --silent | --silen | --sile | --sil)
600     silent=yes ;;
601
602   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
603     ac_prev=sbindir ;;
604   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
605   | --sbi=* | --sb=*)
606     sbindir="$ac_optarg" ;;
607
608   -sharedstatedir | --sharedstatedir | --sharedstatedi \
609   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
610   | --sharedst | --shareds | --shared | --share | --shar \
611   | --sha | --sh)
612     ac_prev=sharedstatedir ;;
613   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
614   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
615   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
616   | --sha=* | --sh=*)
617     sharedstatedir="$ac_optarg" ;;
618
619   -site | --site | --sit)
620     ac_prev=site ;;
621   -site=* | --site=* | --sit=*)
622     site="$ac_optarg" ;;
623
624   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
625     ac_prev=srcdir ;;
626   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
627     srcdir="$ac_optarg" ;;
628
629   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
630   | --syscon | --sysco | --sysc | --sys | --sy)
631     ac_prev=sysconfdir ;;
632   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
633   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
634     sysconfdir="$ac_optarg" ;;
635
636   -target | --target | --targe | --targ | --tar | --ta | --t)
637     ac_prev=target ;;
638   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
639     target="$ac_optarg" ;;
640
641   -v | -verbose | --verbose | --verbos | --verbo | --verb)
642     verbose=yes ;;
643
644   -version | --version | --versio | --versi | --vers)
645     echo "configure generated by autoconf version 2.13.1"
646     exit 0 ;;
647
648   -with-* | --with-*)
649     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
650     # Reject names that are not valid shell variable names.
651     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
652       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
653     fi
654     ac_package=`echo $ac_package| sed 's/-/_/g'`
655     case "$ac_option" in
656       *=*) ;;
657       *) ac_optarg=yes ;;
658     esac
659     eval "with_${ac_package}='$ac_optarg'" ;;
660
661   -without-* | --without-*)
662     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
663     # Reject names that are not valid shell variable names.
664     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
665       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
666     fi
667     ac_package=`echo $ac_package| sed 's/-/_/g'`
668     eval "with_${ac_package}=no" ;;
669
670   --x)
671     # Obsolete; use --with-x.
672     with_x=yes ;;
673
674   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
675   | --x-incl | --x-inc | --x-in | --x-i)
676     ac_prev=x_includes ;;
677   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
678   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
679     x_includes="$ac_optarg" ;;
680
681   -x-libraries | --x-libraries | --x-librarie | --x-librari \
682   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
683     ac_prev=x_libraries ;;
684   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
685   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
686     x_libraries="$ac_optarg" ;;
687
688   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
689     ;;
690
691   *)
692     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
693       echo "configure: warning: $ac_option: invalid host type" 1>&2
694     fi
695     if test "x$nonopt" != xNONE; then
696       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
697     fi
698     nonopt="$ac_option"
699     ;;
700
701   esac
702 done
703
704 if test -n "$ac_prev"; then
705   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
706 fi
707
708 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
709
710 # File descriptor usage:
711 # 0 standard input
712 # 1 file creation
713 # 2 errors and warnings
714 # 3 some systems may open it to /dev/tty
715 # 4 used on the Kubota Titan
716 # 6 checking for... messages and results
717 # 5 compiler messages saved in config.log
718 if test "$silent" = yes; then
719   exec 6>/dev/null
720 else
721   exec 6>&1
722 fi
723 exec 5>./config.log
724
725 echo "\
726 This file contains any messages produced by compilers while
727 running configure, to aid debugging if configure makes a mistake.
728 " 1>&5
729
730 # Strip out --no-create and --no-recursion so they do not pile up.
731 # Also quote any args containing shell metacharacters.
732 ac_configure_args=
733 for ac_arg
734 do
735   case "$ac_arg" in
736   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
737   | --no-cr | --no-c) ;;
738   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
739   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
740   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
741   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
742   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
743   esac
744 done
745
746 # NLS nuisances.
747 # Only set these to C if already set.  These must not be set unconditionally
748 # because not all systems understand e.g. LANG=C (notably SCO).
749 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
750 # Non-C LC_CTYPE values break the ctype check.
751 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
752 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
753 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
754 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
755
756 # confdefs.h avoids OS command line length limits that DEFS can exceed.
757 rm -rf conftest* confdefs.h
758 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
759 echo > confdefs.h
760
761 # A filename unique to this package, relative to the directory that
762 # configure is in, which we can look for to find out if srcdir is correct.
763 ac_unique_file=build/version.sh
764
765 # Find the source files, if location was not specified.
766 if test -z "$srcdir"; then
767   ac_srcdir_defaulted=yes
768   # Try the directory containing this script, then its parent.
769   ac_prog=$0
770   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
771   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
772   srcdir=$ac_confdir
773   if test ! -r $srcdir/$ac_unique_file; then
774     srcdir=..
775   fi
776 else
777   ac_srcdir_defaulted=no
778 fi
779 if test ! -r $srcdir/$ac_unique_file; then
780   if test "$ac_srcdir_defaulted" = yes; then
781     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
782   else
783     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
784   fi
785 fi
786 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
787
788 # Prefer explicitly selected file to automatically selected ones.
789 if test -z "$CONFIG_SITE"; then
790   if test "x$prefix" != xNONE; then
791     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
792   else
793     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
794   fi
795 fi
796 for ac_site_file in $CONFIG_SITE; do
797   if test -r "$ac_site_file"; then
798     echo "loading site script $ac_site_file"
799     . "$ac_site_file"
800   fi
801 done
802
803
804 ac_ext=c
805 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
806 ac_cpp='$CPP $CPPFLAGS'
807 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
808 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
809 cross_compiling=$ac_cv_prog_cc_cross
810
811 ac_exeext=
812 ac_objext=o
813 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
814   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
815   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
816     ac_n= ac_c='
817 ' ac_t='        '
818   else
819     ac_n=-n ac_c= ac_t=
820   fi
821 else
822   ac_n= ac_c='\c' ac_t=
823 fi
824
825
826 # set unset (borrowed from autoconf 2.49c)
827 if (OL_FOO=OL_FOO; unset OL_FOO) >/dev/null 2>&1; then
828   ol_unset=unset
829 else
830   ol_unset=false
831 fi
832 # unset CDPATH
833 $ol_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
834
835 ac_aux_dir=
836 for ac_dir in build $srcdir/build; do
837   if test -f $ac_dir/install-sh; then
838     ac_aux_dir=$ac_dir
839     ac_install_sh="$ac_aux_dir/install-sh -c"
840     break
841   elif test -f $ac_dir/install.sh; then
842     ac_aux_dir=$ac_dir
843     ac_install_sh="$ac_aux_dir/install.sh -c"
844     break
845   elif test -f $ac_dir/shtool; then
846     ac_aux_dir=$ac_dir
847     ac_install_sh="$ac_aux_dir/shtool install -c"
848     break
849   fi
850 done
851 if test -z "$ac_aux_dir"; then
852   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
853 fi
854 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
855 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
856 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
857
858 eval `$ac_aux_dir/version.sh`
859 if test -z "$OL_STRING"; then
860         { echo "configure: error: could not determine version" 1>&2; exit 1; }
861 fi
862
863 if test -f "$ac_aux_dir/shtool" -a ! -d $ac_aux_dir/shtool; then
864         ac_cv_shtool="$ac_aux_dir/shtool"
865 else
866         { echo "configure: error: no shtool found in $ac_aux_dir" 1>&2; exit 1; }
867 fi
868
869 SHTOOL="$ac_cv_shtool"
870
871 TB="`$SHTOOL echo -e '%B' 2>/dev/null`"
872 TN="`$SHTOOL echo -e '%b' 2>/dev/null`"
873
874 OPENLDAP_CVS=""
875 if test -d $ac_aux_dir/CVS; then
876         OPENLDAP_CVS="(from CVS sources) "
877 fi
878
879 echo "Configuring ${TB}${OL_STRING}${TN} ${OPENLDAP_CVS}..."
880
881
882 echo $ac_n "checking host system type""... $ac_c" 1>&6
883 echo "configure:884: checking host system type" >&5
884 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
885
886 # Make sure we can run config.sub.
887   if $ac_config_sub sun4 >/dev/null 2>&1; then :
888     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
889   fi
890
891   ac_cv_host_alias=$host
892   case "$ac_cv_host_alias" in
893   NONE)
894     case $nonopt in
895     NONE)
896       if ac_cv_host_alias=`$ac_config_guess`; then :
897       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
898       fi ;;
899     *) ac_cv_host_alias=$nonopt ;;
900     esac ;;
901   esac
902
903   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
904   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
905   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
906   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
907 else
908   echo $ac_n "(cached) $ac_c" 1>&6
909 fi
910
911 echo "$ac_t""$ac_cv_host" 1>&6
912
913 host=$ac_cv_host
914 host_alias=$ac_cv_host_alias
915 host_cpu=$ac_cv_host_cpu
916 host_vendor=$ac_cv_host_vendor
917 host_os=$ac_cv_host_os
918
919
920
921
922
923 echo $ac_n "checking target system type""... $ac_c" 1>&6
924 echo "configure:925: checking target system type" >&5
925 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
926
927 # Make sure we can run config.sub.
928   if $ac_config_sub sun4 >/dev/null 2>&1; then :
929     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
930   fi
931
932   ac_cv_target_alias=$target
933   case "$ac_cv_target_alias" in
934   NONE)
935     case $nonopt in
936     NONE)
937       ac_cv_target_alias=$host_alias ;;
938
939     *) ac_cv_target_alias=$nonopt ;;
940     esac ;;
941   esac
942
943   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
944   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
945   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
946   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
947 else
948   echo $ac_n "(cached) $ac_c" 1>&6
949 fi
950
951 echo "$ac_t""$ac_cv_target" 1>&6
952
953 target=$ac_cv_target
954 target_alias=$ac_cv_target_alias
955 target_cpu=$ac_cv_target_cpu
956 target_vendor=$ac_cv_target_vendor
957 target_os=$ac_cv_target_os
958
959
960
961
962
963 echo $ac_n "checking build system type""... $ac_c" 1>&6
964 echo "configure:965: checking build system type" >&5
965 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
966
967 # Make sure we can run config.sub.
968   if $ac_config_sub sun4 >/dev/null 2>&1; then :
969     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
970   fi
971
972   ac_cv_build_alias=$build
973   case "$ac_cv_build_alias" in
974   NONE)
975     case $nonopt in
976     NONE)
977       ac_cv_build_alias=$host_alias ;;
978
979     *) ac_cv_build_alias=$nonopt ;;
980     esac ;;
981   esac
982
983   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
984   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
985   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
986   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
987 else
988   echo $ac_n "(cached) $ac_c" 1>&6
989 fi
990
991 echo "$ac_t""$ac_cv_build" 1>&6
992
993 build=$ac_cv_build
994 build_alias=$ac_cv_build_alias
995 build_cpu=$ac_cv_build_cpu
996 build_vendor=$ac_cv_build_vendor
997 build_os=$ac_cv_build_os
998
999
1000
1001
1002
1003 # Do some error checking and defaulting for the host and target type.
1004 # The inputs are:
1005 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
1006 #
1007 # The rules are:
1008 # 1. You are not allowed to specify --host, --target, and nonopt at the
1009 #    same time.
1010 # 2. Host defaults to nonopt.
1011 # 3. If nonopt is not specified, then host defaults to the current host,
1012 #    as determined by config.guess.
1013 # 4. Target and build default to nonopt.
1014 # 5. If nonopt is not specified, then target and build default to host.
1015
1016 # The aliases save the names the user supplied, while $host etc.
1017 # will get canonicalized.
1018 case $host---$target---$nonopt in
1019 NONE---*---* | *---NONE---* | *---*---NONE) ;;
1020 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
1021 esac
1022
1023 test "$host_alias" != "$target_alias" &&
1024   test "$program_prefix$program_suffix$program_transform_name" = \
1025     NONENONEs,x,x, &&
1026   program_prefix=${target_alias}-
1027
1028
1029 # Find a good install program.  We prefer a C program (faster),
1030 # so one script is as good as another.  But avoid the broken or
1031 # incompatible versions:
1032 # SysV /etc/install, /usr/sbin/install
1033 # SunOS /usr/etc/install
1034 # IRIX /sbin/install
1035 # AIX /bin/install
1036 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1037 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1038 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1039 # ./install, which can be erroneously created by make from ./install.sh.
1040 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1041 echo "configure:1042: checking for a BSD compatible install" >&5
1042 if test -z "$INSTALL"; then
1043 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
1044   echo $ac_n "(cached) $ac_c" 1>&6
1045 else
1046     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1047   for ac_dir in $PATH; do
1048     # Account for people who put trailing slashes in PATH elements.
1049     case "$ac_dir/" in
1050     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1051     *)
1052       # OSF1 and SCO ODT 3.0 have their own names for install.
1053       # Don't use installbsd from OSF since it installs stuff as root
1054       # by default.
1055       for ac_prog in ginstall scoinst install; do
1056         if test -f $ac_dir/$ac_prog; then
1057           if test $ac_prog = install &&
1058             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1059             # AIX install.  It has an incompatible calling convention.
1060             :
1061           elif test $ac_prog = install &&
1062             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
1063             # program-specific install script used by HP pwplus--don't use.
1064             :
1065           else
1066             ac_cv_path_install="$ac_dir/$ac_prog -c"
1067             break 2
1068           fi
1069         fi
1070       done
1071       ;;
1072     esac
1073   done
1074   IFS="$ac_save_IFS"
1075
1076 fi
1077   if test "${ac_cv_path_install+set}" = set; then
1078     INSTALL="$ac_cv_path_install"
1079   else
1080     # As a last resort, use the slow shell script.  We don't cache a
1081     # path for INSTALL within a source directory, because that will
1082     # break other packages using the cache if that directory is
1083     # removed, or if the path is relative.
1084     INSTALL="$ac_install_sh"
1085   fi
1086 fi
1087 echo "$ac_t""$INSTALL" 1>&6
1088
1089 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1090 # It thinks the first close brace ends the variable substitution.
1091 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1092
1093 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
1094
1095 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1096
1097 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
1098 echo "configure:1099: checking whether build environment is sane" >&5
1099 # Just in case
1100 sleep 1
1101 echo timestamp > conftestfile
1102 # Do `set' in a subshell so we don't clobber the current shell's
1103 # arguments.  Must try -L first in case configure is actually a
1104 # symlink; some systems play weird games with the mod time of symlinks
1105 # (eg FreeBSD returns the mod time of the symlink's containing
1106 # directory).
1107 if (
1108    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1109    if test "$*" = "X"; then
1110       # -L didn't work.
1111       set X `ls -t $srcdir/configure conftestfile`
1112    fi
1113    if test "$*" != "X $srcdir/configure conftestfile" \
1114       && test "$*" != "X conftestfile $srcdir/configure"; then
1115
1116       # If neither matched, then we have a broken ls.  This can happen
1117       # if, for instance, CONFIG_SHELL is bash and it inherits a
1118       # broken ls alias from the environment.  This has actually
1119       # happened.  Such a system could not be considered "sane".
1120       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
1121 alias in your environment" 1>&2; exit 1; }
1122    fi
1123
1124    test "$2" = conftestfile
1125    )
1126 then
1127    # Ok.
1128    :
1129 else
1130    { echo "configure: error: newly created file is older than distributed files!
1131 Check your system clock" 1>&2; exit 1; }
1132 fi
1133 rm -f conftest*
1134 echo "$ac_t""yes" 1>&6
1135 if test "$program_transform_name" = s,x,x,; then
1136   program_transform_name=
1137 else
1138   # Double any \ or $.  echo might interpret backslashes.
1139   cat <<\EOF_SED > conftestsed
1140 s,\\,\\\\,g; s,\$,$$,g
1141 EOF_SED
1142   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
1143   rm -f conftestsed
1144 fi
1145 test "$program_prefix" != NONE &&
1146   program_transform_name="s,^,${program_prefix},;$program_transform_name"
1147 # Use a double $ so make ignores it.
1148 test "$program_suffix" != NONE &&
1149   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
1150
1151 # sed with no file args requires a program.
1152 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
1153
1154 for ac_prog in mawk gawk nawk awk
1155 do
1156 # Extract the first word of "$ac_prog", so it can be a program name with args.
1157 set dummy $ac_prog; ac_word=$2
1158 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1159 echo "configure:1160: checking for $ac_word" >&5
1160 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
1161   echo $ac_n "(cached) $ac_c" 1>&6
1162 else
1163   if test -n "$AWK"; then
1164   ac_cv_prog_AWK="$AWK" # Let the user override the test.
1165 else
1166   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1167   ac_dummy="$PATH"
1168   for ac_dir in $ac_dummy; do
1169     test -z "$ac_dir" && ac_dir=.
1170     if test -f $ac_dir/$ac_word; then
1171       ac_cv_prog_AWK="$ac_prog"
1172       break
1173     fi
1174   done
1175   IFS="$ac_save_ifs"
1176 fi
1177 fi
1178 AWK="$ac_cv_prog_AWK"
1179 if test -n "$AWK"; then
1180   echo "$ac_t""$AWK" 1>&6
1181 else
1182   echo "$ac_t""no" 1>&6
1183 fi
1184
1185 test -n "$AWK" && break
1186 done
1187
1188 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1189 echo "configure:1190: checking whether ${MAKE-make} sets \${MAKE}" >&5
1190 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1191 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1192   echo $ac_n "(cached) $ac_c" 1>&6
1193 else
1194   cat > conftestmake <<\EOF
1195 all:
1196         @echo 'ac_maketemp="${MAKE}"'
1197 EOF
1198 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1199 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1200 if test -n "$ac_maketemp"; then
1201   eval ac_cv_prog_make_${ac_make}_set=yes
1202 else
1203   eval ac_cv_prog_make_${ac_make}_set=no
1204 fi
1205 rm -f conftestmake
1206 fi
1207 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1208   echo "$ac_t""yes" 1>&6
1209   SET_MAKE=
1210 else
1211   echo "$ac_t""no" 1>&6
1212   SET_MAKE="MAKE=${MAKE-make}"
1213 fi
1214
1215
1216
1217 PACKAGE=$OL_PACKAGE
1218
1219 VERSION=$OL_VERSION
1220
1221 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1222   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
1223 fi
1224
1225
1226
1227 missing_dir=`cd $ac_aux_dir && pwd`
1228 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1229 echo "configure:1230: checking for working aclocal" >&5
1230 # Run test in a subshell; some versions of sh will print an error if
1231 # an executable is not found, even if stderr is redirected.
1232 # Redirect stdin to placate older versions of autoconf.  Sigh.
1233 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1234    ACLOCAL=aclocal
1235    echo "$ac_t""found" 1>&6
1236 else
1237    ACLOCAL="$missing_dir/missing aclocal"
1238    echo "$ac_t""missing" 1>&6
1239 fi
1240
1241 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1242 echo "configure:1243: checking for working autoconf" >&5
1243 # Run test in a subshell; some versions of sh will print an error if
1244 # an executable is not found, even if stderr is redirected.
1245 # Redirect stdin to placate older versions of autoconf.  Sigh.
1246 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1247    AUTOCONF=autoconf
1248    echo "$ac_t""found" 1>&6
1249 else
1250    AUTOCONF="$missing_dir/missing autoconf"
1251    echo "$ac_t""missing" 1>&6
1252 fi
1253
1254 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1255 echo "configure:1256: checking for working automake" >&5
1256 # Run test in a subshell; some versions of sh will print an error if
1257 # an executable is not found, even if stderr is redirected.
1258 # Redirect stdin to placate older versions of autoconf.  Sigh.
1259 if (automake --version) < /dev/null > /dev/null 2>&1; then
1260    AUTOMAKE=automake
1261    echo "$ac_t""found" 1>&6
1262 else
1263    AUTOMAKE="$missing_dir/missing automake"
1264    echo "$ac_t""missing" 1>&6
1265 fi
1266
1267 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1268 echo "configure:1269: checking for working autoheader" >&5
1269 # Run test in a subshell; some versions of sh will print an error if
1270 # an executable is not found, even if stderr is redirected.
1271 # Redirect stdin to placate older versions of autoconf.  Sigh.
1272 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1273    AUTOHEADER=autoheader
1274    echo "$ac_t""found" 1>&6
1275 else
1276    AUTOHEADER="$missing_dir/missing autoheader"
1277    echo "$ac_t""missing" 1>&6
1278 fi
1279
1280 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1281 echo "configure:1282: checking for working makeinfo" >&5
1282 # Run test in a subshell; some versions of sh will print an error if
1283 # an executable is not found, even if stderr is redirected.
1284 # Redirect stdin to placate older versions of autoconf.  Sigh.
1285 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1286    MAKEINFO=makeinfo
1287    echo "$ac_t""found" 1>&6
1288 else
1289    MAKEINFO="$missing_dir/missing makeinfo"
1290    echo "$ac_t""missing" 1>&6
1291 fi
1292
1293 install_sh="$missing_dir/install-sh"
1294 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1295
1296 for ac_prog in gnutar gtar tar
1297 do
1298 # Extract the first word of "$ac_prog", so it can be a program name with args.
1299 set dummy $ac_prog; ac_word=$2
1300 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1301 echo "configure:1302: checking for $ac_word" >&5
1302 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1303   echo $ac_n "(cached) $ac_c" 1>&6
1304 else
1305   if test -n "$AMTAR"; then
1306   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1307 else
1308   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1309   ac_dummy="$PATH"
1310   for ac_dir in $ac_dummy; do
1311     test -z "$ac_dir" && ac_dir=.
1312     if test -f $ac_dir/$ac_word; then
1313       ac_cv_prog_AMTAR="$ac_prog"
1314       break
1315     fi
1316   done
1317   IFS="$ac_save_ifs"
1318 fi
1319 fi
1320 AMTAR="$ac_cv_prog_AMTAR"
1321 if test -n "$AMTAR"; then
1322   echo "$ac_t""$AMTAR" 1>&6
1323 else
1324   echo "$ac_t""no" 1>&6
1325 fi
1326
1327 test -n "$AMTAR" && break
1328 done
1329
1330
1331 AMTARFLAGS=
1332 if test -n "$AMTAR"; then
1333   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1334         AMTARFLAGS=o
1335   fi
1336 fi
1337
1338 cat >> confdefs.h <<EOF
1339 #define OPENLDAP_PACKAGE "$PACKAGE"
1340 EOF
1341
1342 cat >> confdefs.h <<EOF
1343 #define OPENLDAP_VERSION "$VERSION"
1344 EOF
1345
1346
1347 cat >> confdefs.h <<EOF
1348 #define LDAP_VENDOR_VERSION $OL_API_INC
1349 EOF
1350
1351 cat >> confdefs.h <<EOF
1352 #define LDAP_VENDOR_VERSION_MAJOR $OL_MAJOR
1353 EOF
1354
1355 cat >> confdefs.h <<EOF
1356 #define LDAP_VENDOR_VERSION_MINOR $OL_MINOR
1357 EOF
1358
1359 cat >> confdefs.h <<EOF
1360 #define LDAP_VENDOR_VERSION_PATCH $OL_PATCH
1361 EOF
1362
1363
1364 OPENLDAP_LIBVERSION=$OL_API_LIB
1365
1366 OPENLDAP_RELEASE_DATE="$OL_RELEASE_DATE"
1367
1368
1369
1370 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1371 echo "configure:1372: checking configure arguments" >&5
1372
1373
1374 top_builddir=`pwd`
1375
1376 ldap_subdir="/openldap"
1377
1378 # Check whether --with-subdir or --without-subdir was given.
1379 if test "${with_subdir+set}" = set; then
1380   withval="$with_subdir"
1381   case "$withval" in
1382         no) ldap_subdir=""
1383                 ;;
1384         yes)
1385                 ;;
1386         /*|\\*)
1387                 ldap_subdir="$withval"
1388                 ;;
1389         *)
1390                 ldap_subdir="/$withval"
1391                 ;;
1392 esac
1393
1394 fi
1395
1396
1397 # OpenLDAP --enable-debug
1398         # Check whether --enable-debug or --disable-debug was given.
1399 if test "${enable_debug+set}" = set; then
1400   enableval="$enable_debug"
1401   
1402         ol_arg=invalid
1403         for ol_val in auto yes no ; do
1404                 if test "$enableval" = "$ol_val" ; then
1405                         ol_arg="$ol_val"
1406                 fi
1407         done
1408         if test "$ol_arg" = "invalid" ; then
1409                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1410         fi
1411         ol_enable_debug="$ol_arg"
1412
1413 else
1414         ol_enable_debug="yes"
1415 fi
1416 # end --enable-debug
1417 # OpenLDAP --enable-dynamic
1418         # Check whether --enable-dynamic or --disable-dynamic was given.
1419 if test "${enable_dynamic+set}" = set; then
1420   enableval="$enable_dynamic"
1421   
1422         ol_arg=invalid
1423         for ol_val in auto yes no ; do
1424                 if test "$enableval" = "$ol_val" ; then
1425                         ol_arg="$ol_val"
1426                 fi
1427         done
1428         if test "$ol_arg" = "invalid" ; then
1429                 { echo "configure: error: bad value $enableval for --enable-dynamic" 1>&2; exit 1; }
1430         fi
1431         ol_enable_dynamic="$ol_arg"
1432
1433 else
1434         ol_enable_dynamic="no"
1435 fi
1436 # end --enable-dynamic
1437 # OpenLDAP --enable-syslog
1438         # Check whether --enable-syslog or --disable-syslog was given.
1439 if test "${enable_syslog+set}" = set; then
1440   enableval="$enable_syslog"
1441   
1442         ol_arg=invalid
1443         for ol_val in auto yes no ; do
1444                 if test "$enableval" = "$ol_val" ; then
1445                         ol_arg="$ol_val"
1446                 fi
1447         done
1448         if test "$ol_arg" = "invalid" ; then
1449                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1450         fi
1451         ol_enable_syslog="$ol_arg"
1452
1453 else
1454         ol_enable_syslog="auto"
1455 fi
1456 # end --enable-syslog
1457 # OpenLDAP --enable-proctitle
1458         # Check whether --enable-proctitle or --disable-proctitle was given.
1459 if test "${enable_proctitle+set}" = set; then
1460   enableval="$enable_proctitle"
1461   
1462         ol_arg=invalid
1463         for ol_val in auto yes no ; do
1464                 if test "$enableval" = "$ol_val" ; then
1465                         ol_arg="$ol_val"
1466                 fi
1467         done
1468         if test "$ol_arg" = "invalid" ; then
1469                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1470         fi
1471         ol_enable_proctitle="$ol_arg"
1472
1473 else
1474         ol_enable_proctitle="yes"
1475 fi
1476 # end --enable-proctitle
1477 ol_enable_referrals=${ol_enable_referrals-no}
1478 ol_enable_kbind=${ol_enable_kbind-no}
1479 # OpenLDAP --enable-ipv6
1480         # Check whether --enable-ipv6 or --disable-ipv6 was given.
1481 if test "${enable_ipv6+set}" = set; then
1482   enableval="$enable_ipv6"
1483   
1484         ol_arg=invalid
1485         for ol_val in auto yes no ; do
1486                 if test "$enableval" = "$ol_val" ; then
1487                         ol_arg="$ol_val"
1488                 fi
1489         done
1490         if test "$ol_arg" = "invalid" ; then
1491                 { echo "configure: error: bad value $enableval for --enable-ipv6" 1>&2; exit 1; }
1492         fi
1493         ol_enable_ipv6="$ol_arg"
1494
1495 else
1496         ol_enable_ipv6="auto"
1497 fi
1498 # end --enable-ipv6
1499 # OpenLDAP --enable-local
1500         # Check whether --enable-local or --disable-local was given.
1501 if test "${enable_local+set}" = set; then
1502   enableval="$enable_local"
1503   
1504         ol_arg=invalid
1505         for ol_val in auto yes no ; do
1506                 if test "$enableval" = "$ol_val" ; then
1507                         ol_arg="$ol_val"
1508                 fi
1509         done
1510         if test "$ol_arg" = "invalid" ; then
1511                 { echo "configure: error: bad value $enableval for --enable-local" 1>&2; exit 1; }
1512         fi
1513         ol_enable_local="$ol_arg"
1514
1515 else
1516         ol_enable_local="auto"
1517 fi
1518 # end --enable-local
1519 # OpenLDAP --enable-x_compile
1520         # Check whether --enable-x_compile or --disable-x_compile was given.
1521 if test "${enable_x_compile+set}" = set; then
1522   enableval="$enable_x_compile"
1523   
1524         ol_arg=invalid
1525         for ol_val in yes no ; do
1526                 if test "$enableval" = "$ol_val" ; then
1527                         ol_arg="$ol_val"
1528                 fi
1529         done
1530         if test "$ol_arg" = "invalid" ; then
1531                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1532         fi
1533         ol_enable_x_compile="$ol_arg"
1534
1535 else
1536         ol_enable_x_compile="no"
1537 fi
1538 # end --enable-x_compile
1539
1540
1541 # OpenLDAP --with-cyrus_sasl
1542         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1543 if test "${with_cyrus_sasl+set}" = set; then
1544   withval="$with_cyrus_sasl"
1545   
1546         ol_arg=invalid
1547         for ol_val in auto yes no  ; do
1548                 if test "$withval" = "$ol_val" ; then
1549                         ol_arg="$ol_val"
1550                 fi
1551         done
1552         if test "$ol_arg" = "invalid" ; then
1553                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1554         fi
1555         ol_with_cyrus_sasl="$ol_arg"
1556
1557 else
1558         ol_with_cyrus_sasl="auto"
1559 fi
1560 # end --with-cyrus_sasl
1561
1562 # OpenLDAP --with-fetch
1563         # Check whether --with-fetch or --without-fetch was given.
1564 if test "${with_fetch+set}" = set; then
1565   withval="$with_fetch"
1566   
1567         ol_arg=invalid
1568         for ol_val in auto yes no  ; do
1569                 if test "$withval" = "$ol_val" ; then
1570                         ol_arg="$ol_val"
1571                 fi
1572         done
1573         if test "$ol_arg" = "invalid" ; then
1574                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1575         fi
1576         ol_with_fetch="$ol_arg"
1577
1578 else
1579         ol_with_fetch="auto"
1580 fi
1581 # end --with-fetch
1582
1583 # OpenLDAP --with-kerberos
1584         # Check whether --with-kerberos or --without-kerberos was given.
1585 if test "${with_kerberos+set}" = set; then
1586   withval="$with_kerberos"
1587   
1588         ol_arg=invalid
1589         for ol_val in auto k5 k5only k425 kth k4 afs yes no ; do
1590                 if test "$withval" = "$ol_val" ; then
1591                         ol_arg="$ol_val"
1592                 fi
1593         done
1594         if test "$ol_arg" = "invalid" ; then
1595                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1596         fi
1597         ol_with_kerberos="$ol_arg"
1598
1599 else
1600         ol_with_kerberos="auto"
1601 fi
1602 # end --with-kerberos
1603
1604 # OpenLDAP --with-readline
1605         # Check whether --with-readline or --without-readline was given.
1606 if test "${with_readline+set}" = set; then
1607   withval="$with_readline"
1608   
1609         ol_arg=invalid
1610         for ol_val in auto yes no  ; do
1611                 if test "$withval" = "$ol_val" ; then
1612                         ol_arg="$ol_val"
1613                 fi
1614         done
1615         if test "$ol_arg" = "invalid" ; then
1616                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1617         fi
1618         ol_with_readline="$ol_arg"
1619
1620 else
1621         ol_with_readline="auto"
1622 fi
1623 # end --with-readline
1624
1625 # OpenLDAP --with-threads
1626         # Check whether --with-threads or --without-threads was given.
1627 if test "${with_threads+set}" = set; then
1628   withval="$with_threads"
1629   
1630         ol_arg=invalid
1631         for ol_val in auto nt posix mach pth lwp yes no manual  ; do
1632                 if test "$withval" = "$ol_val" ; then
1633                         ol_arg="$ol_val"
1634                 fi
1635         done
1636         if test "$ol_arg" = "invalid" ; then
1637                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1638         fi
1639         ol_with_threads="$ol_arg"
1640
1641 else
1642         ol_with_threads="auto"
1643 fi
1644 # end --with-threads
1645
1646 # OpenLDAP --with-tls
1647         # Check whether --with-tls or --without-tls was given.
1648 if test "${with_tls+set}" = set; then
1649   withval="$with_tls"
1650   
1651         ol_arg=invalid
1652         for ol_val in auto ssleay openssl yes no  ; do
1653                 if test "$withval" = "$ol_val" ; then
1654                         ol_arg="$ol_val"
1655                 fi
1656         done
1657         if test "$ol_arg" = "invalid" ; then
1658                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1659         fi
1660         ol_with_tls="$ol_arg"
1661
1662 else
1663         ol_with_tls="auto"
1664 fi
1665 # end --with-tls
1666
1667 # OpenLDAP --with-yielding_select
1668         # Check whether --with-yielding_select or --without-yielding_select was given.
1669 if test "${with_yielding_select+set}" = set; then
1670   withval="$with_yielding_select"
1671   
1672         ol_arg=invalid
1673         for ol_val in auto yes no manual  ; do
1674                 if test "$withval" = "$ol_val" ; then
1675                         ol_arg="$ol_val"
1676                 fi
1677         done
1678         if test "$ol_arg" = "invalid" ; then
1679                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1680         fi
1681         ol_with_yielding_select="$ol_arg"
1682
1683 else
1684         ol_with_yielding_select="auto"
1685 fi
1686 # end --with-yielding_select
1687
1688
1689
1690 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1691 if test "${with_xxslapdoptions+set}" = set; then
1692   withval="$with_xxslapdoptions"
1693   :
1694 fi
1695
1696 # OpenLDAP --enable-slapd
1697         # Check whether --enable-slapd or --disable-slapd was given.
1698 if test "${enable_slapd+set}" = set; then
1699   enableval="$enable_slapd"
1700   
1701         ol_arg=invalid
1702         for ol_val in auto yes no ; do
1703                 if test "$enableval" = "$ol_val" ; then
1704                         ol_arg="$ol_val"
1705                 fi
1706         done
1707         if test "$ol_arg" = "invalid" ; then
1708                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1709         fi
1710         ol_enable_slapd="$ol_arg"
1711
1712 else
1713         ol_enable_slapd="yes"
1714 fi
1715 # end --enable-slapd
1716 # OpenLDAP --enable-aci
1717         # Check whether --enable-aci or --disable-aci was given.
1718 if test "${enable_aci+set}" = set; then
1719   enableval="$enable_aci"
1720   
1721         ol_arg=invalid
1722         for ol_val in auto yes no ; do
1723                 if test "$enableval" = "$ol_val" ; then
1724                         ol_arg="$ol_val"
1725                 fi
1726         done
1727         if test "$ol_arg" = "invalid" ; then
1728                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1729         fi
1730         ol_enable_aci="$ol_arg"
1731
1732 else
1733         ol_enable_aci="no"
1734 fi
1735 # end --enable-aci
1736 # OpenLDAP --enable-cleartext
1737         # Check whether --enable-cleartext or --disable-cleartext was given.
1738 if test "${enable_cleartext+set}" = set; then
1739   enableval="$enable_cleartext"
1740   
1741         ol_arg=invalid
1742         for ol_val in auto yes no ; do
1743                 if test "$enableval" = "$ol_val" ; then
1744                         ol_arg="$ol_val"
1745                 fi
1746         done
1747         if test "$ol_arg" = "invalid" ; then
1748                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1749         fi
1750         ol_enable_cleartext="$ol_arg"
1751
1752 else
1753         ol_enable_cleartext="yes"
1754 fi
1755 # end --enable-cleartext
1756 # OpenLDAP --enable-crypt
1757         # Check whether --enable-crypt or --disable-crypt was given.
1758 if test "${enable_crypt+set}" = set; then
1759   enableval="$enable_crypt"
1760   
1761         ol_arg=invalid
1762         for ol_val in auto yes no ; do
1763                 if test "$enableval" = "$ol_val" ; then
1764                         ol_arg="$ol_val"
1765                 fi
1766         done
1767         if test "$ol_arg" = "invalid" ; then
1768                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1769         fi
1770         ol_enable_crypt="$ol_arg"
1771
1772 else
1773         ol_enable_crypt="no"
1774 fi
1775 # end --enable-crypt
1776 # OpenLDAP --enable-kpasswd
1777         # Check whether --enable-kpasswd or --disable-kpasswd was given.
1778 if test "${enable_kpasswd+set}" = set; then
1779   enableval="$enable_kpasswd"
1780   
1781         ol_arg=invalid
1782         for ol_val in auto yes no ; do
1783                 if test "$enableval" = "$ol_val" ; then
1784                         ol_arg="$ol_val"
1785                 fi
1786         done
1787         if test "$ol_arg" = "invalid" ; then
1788                 { echo "configure: error: bad value $enableval for --enable-kpasswd" 1>&2; exit 1; }
1789         fi
1790         ol_enable_kpasswd="$ol_arg"
1791
1792 else
1793         ol_enable_kpasswd="no"
1794 fi
1795 # end --enable-kpasswd
1796 # OpenLDAP --enable-lmpasswd
1797         # Check whether --enable-lmpasswd or --disable-lmpasswd was given.
1798 if test "${enable_lmpasswd+set}" = set; then
1799   enableval="$enable_lmpasswd"
1800   
1801         ol_arg=invalid
1802         for ol_val in auto yes no ; do
1803                 if test "$enableval" = "$ol_val" ; then
1804                         ol_arg="$ol_val"
1805                 fi
1806         done
1807         if test "$ol_arg" = "invalid" ; then
1808                 { echo "configure: error: bad value $enableval for --enable-lmpasswd" 1>&2; exit 1; }
1809         fi
1810         ol_enable_lmpasswd="$ol_arg"
1811
1812 else
1813         ol_enable_lmpasswd="no"
1814 fi
1815 # end --enable-lmpasswd
1816 # OpenLDAP --enable-spasswd
1817         # Check whether --enable-spasswd or --disable-spasswd was given.
1818 if test "${enable_spasswd+set}" = set; then
1819   enableval="$enable_spasswd"
1820   
1821         ol_arg=invalid
1822         for ol_val in auto yes no ; do
1823                 if test "$enableval" = "$ol_val" ; then
1824                         ol_arg="$ol_val"
1825                 fi
1826         done
1827         if test "$ol_arg" = "invalid" ; then
1828                 { echo "configure: error: bad value $enableval for --enable-spasswd" 1>&2; exit 1; }
1829         fi
1830         ol_enable_spasswd="$ol_arg"
1831
1832 else
1833         ol_enable_spasswd="no"
1834 fi
1835 # end --enable-spasswd
1836 # OpenLDAP --enable-modules
1837         # Check whether --enable-modules or --disable-modules was given.
1838 if test "${enable_modules+set}" = set; then
1839   enableval="$enable_modules"
1840   
1841         ol_arg=invalid
1842         for ol_val in auto yes no ; do
1843                 if test "$enableval" = "$ol_val" ; then
1844                         ol_arg="$ol_val"
1845                 fi
1846         done
1847         if test "$ol_arg" = "invalid" ; then
1848                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1849         fi
1850         ol_enable_modules="$ol_arg"
1851
1852 else
1853         ol_enable_modules="no"
1854 fi
1855 # end --enable-modules
1856 ol_enable_multimaster=${ol_enable_multimaster-no}
1857 # OpenLDAP --enable-phonetic
1858         # Check whether --enable-phonetic or --disable-phonetic was given.
1859 if test "${enable_phonetic+set}" = set; then
1860   enableval="$enable_phonetic"
1861   
1862         ol_arg=invalid
1863         for ol_val in auto yes no ; do
1864                 if test "$enableval" = "$ol_val" ; then
1865                         ol_arg="$ol_val"
1866                 fi
1867         done
1868         if test "$ol_arg" = "invalid" ; then
1869                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1870         fi
1871         ol_enable_phonetic="$ol_arg"
1872
1873 else
1874         ol_enable_phonetic="no"
1875 fi
1876 # end --enable-phonetic
1877 # OpenLDAP --enable-rewrite
1878         # Check whether --enable-rewrite or --disable-rewrite was given.
1879 if test "${enable_rewrite+set}" = set; then
1880   enableval="$enable_rewrite"
1881   
1882         ol_arg=invalid
1883         for ol_val in auto yes no ; do
1884                 if test "$enableval" = "$ol_val" ; then
1885                         ol_arg="$ol_val"
1886                 fi
1887         done
1888         if test "$ol_arg" = "invalid" ; then
1889                 { echo "configure: error: bad value $enableval for --enable-rewrite" 1>&2; exit 1; }
1890         fi
1891         ol_enable_rewrite="$ol_arg"
1892
1893 else
1894         ol_enable_rewrite="no"
1895 fi
1896 # end --enable-rewrite
1897 # OpenLDAP --enable-rlookups
1898         # Check whether --enable-rlookups or --disable-rlookups was given.
1899 if test "${enable_rlookups+set}" = set; then
1900   enableval="$enable_rlookups"
1901   
1902         ol_arg=invalid
1903         for ol_val in auto yes no ; do
1904                 if test "$enableval" = "$ol_val" ; then
1905                         ol_arg="$ol_val"
1906                 fi
1907         done
1908         if test "$ol_arg" = "invalid" ; then
1909                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1910         fi
1911         ol_enable_rlookups="$ol_arg"
1912
1913 else
1914         ol_enable_rlookups="no"
1915 fi
1916 # end --enable-rlookups
1917 # OpenLDAP --enable-slapi
1918         # Check whether --enable-slapi or --disable-slapi was given.
1919 if test "${enable_slapi+set}" = set; then
1920   enableval="$enable_slapi"
1921   
1922         ol_arg=invalid
1923         for ol_val in auto yes no ; do
1924                 if test "$enableval" = "$ol_val" ; then
1925                         ol_arg="$ol_val"
1926                 fi
1927         done
1928         if test "$ol_arg" = "invalid" ; then
1929                 { echo "configure: error: bad value $enableval for --enable-slapi" 1>&2; exit 1; }
1930         fi
1931         ol_enable_slapi="$ol_arg"
1932
1933 else
1934         ol_enable_slapi="no"
1935 fi
1936 # end --enable-slapi
1937 # OpenLDAP --enable-slp
1938         # Check whether --enable-slp or --disable-slp was given.
1939 if test "${enable_slp+set}" = set; then
1940   enableval="$enable_slp"
1941   
1942         ol_arg=invalid
1943         for ol_val in auto yes no ; do
1944                 if test "$enableval" = "$ol_val" ; then
1945                         ol_arg="$ol_val"
1946                 fi
1947         done
1948         if test "$ol_arg" = "invalid" ; then
1949                 { echo "configure: error: bad value $enableval for --enable-slp" 1>&2; exit 1; }
1950         fi
1951         ol_enable_slp="$ol_arg"
1952
1953 else
1954         ol_enable_slp="no"
1955 fi
1956 # end --enable-slp
1957 # OpenLDAP --enable-wrappers
1958         # Check whether --enable-wrappers or --disable-wrappers was given.
1959 if test "${enable_wrappers+set}" = set; then
1960   enableval="$enable_wrappers"
1961   
1962         ol_arg=invalid
1963         for ol_val in auto yes no ; do
1964                 if test "$enableval" = "$ol_val" ; then
1965                         ol_arg="$ol_val"
1966                 fi
1967         done
1968         if test "$ol_arg" = "invalid" ; then
1969                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1970         fi
1971         ol_enable_wrappers="$ol_arg"
1972
1973 else
1974         ol_enable_wrappers="no"
1975 fi
1976 # end --enable-wrappers
1977
1978
1979 # OpenLDAP --enable-bdb
1980         # Check whether --enable-bdb or --disable-bdb was given.
1981 if test "${enable_bdb+set}" = set; then
1982   enableval="$enable_bdb"
1983   
1984         ol_arg=invalid
1985         for ol_val in auto yes no ; do
1986                 if test "$enableval" = "$ol_val" ; then
1987                         ol_arg="$ol_val"
1988                 fi
1989         done
1990         if test "$ol_arg" = "invalid" ; then
1991                 { echo "configure: error: bad value $enableval for --enable-bdb" 1>&2; exit 1; }
1992         fi
1993         ol_enable_bdb="$ol_arg"
1994
1995 else
1996         ol_enable_bdb="yes"
1997 fi
1998 # end --enable-bdb
1999 # OpenLDAP --with-bdb_module
2000         # Check whether --with-bdb_module or --without-bdb_module was given.
2001 if test "${with_bdb_module+set}" = set; then
2002   withval="$with_bdb_module"
2003   
2004         ol_arg=invalid
2005         for ol_val in static dynamic ; do
2006                 if test "$withval" = "$ol_val" ; then
2007                         ol_arg="$ol_val"
2008                 fi
2009         done
2010         if test "$ol_arg" = "invalid" ; then
2011                 { echo "configure: error: bad value $withval for --with-bdb_module" 1>&2; exit 1; }
2012         fi
2013         ol_with_bdb_module="$ol_arg"
2014
2015 else
2016         ol_with_bdb_module="static"
2017 fi
2018 # end --with-bdb_module
2019
2020 # OpenLDAP --enable-dnssrv
2021         # Check whether --enable-dnssrv or --disable-dnssrv was given.
2022 if test "${enable_dnssrv+set}" = set; then
2023   enableval="$enable_dnssrv"
2024   
2025         ol_arg=invalid
2026         for ol_val in auto yes no ; do
2027                 if test "$enableval" = "$ol_val" ; then
2028                         ol_arg="$ol_val"
2029                 fi
2030         done
2031         if test "$ol_arg" = "invalid" ; then
2032                 { echo "configure: error: bad value $enableval for --enable-dnssrv" 1>&2; exit 1; }
2033         fi
2034         ol_enable_dnssrv="$ol_arg"
2035
2036 else
2037         ol_enable_dnssrv="no"
2038 fi
2039 # end --enable-dnssrv
2040 # OpenLDAP --with-dnssrv_module
2041         # Check whether --with-dnssrv_module or --without-dnssrv_module was given.
2042 if test "${with_dnssrv_module+set}" = set; then
2043   withval="$with_dnssrv_module"
2044   
2045         ol_arg=invalid
2046         for ol_val in static dynamic ; do
2047                 if test "$withval" = "$ol_val" ; then
2048                         ol_arg="$ol_val"
2049                 fi
2050         done
2051         if test "$ol_arg" = "invalid" ; then
2052                 { echo "configure: error: bad value $withval for --with-dnssrv_module" 1>&2; exit 1; }
2053         fi
2054         ol_with_dnssrv_module="$ol_arg"
2055
2056 else
2057         ol_with_dnssrv_module="static"
2058 fi
2059 # end --with-dnssrv_module
2060
2061 # OpenLDAP --enable-ldap
2062         # Check whether --enable-ldap or --disable-ldap was given.
2063 if test "${enable_ldap+set}" = set; then
2064   enableval="$enable_ldap"
2065   
2066         ol_arg=invalid
2067         for ol_val in auto yes no ; do
2068                 if test "$enableval" = "$ol_val" ; then
2069                         ol_arg="$ol_val"
2070                 fi
2071         done
2072         if test "$ol_arg" = "invalid" ; then
2073                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
2074         fi
2075         ol_enable_ldap="$ol_arg"
2076
2077 else
2078         ol_enable_ldap="no"
2079 fi
2080 # end --enable-ldap
2081 # OpenLDAP --with-ldap_module
2082         # Check whether --with-ldap_module or --without-ldap_module was given.
2083 if test "${with_ldap_module+set}" = set; then
2084   withval="$with_ldap_module"
2085   
2086         ol_arg=invalid
2087         for ol_val in static dynamic ; do
2088                 if test "$withval" = "$ol_val" ; then
2089                         ol_arg="$ol_val"
2090                 fi
2091         done
2092         if test "$ol_arg" = "invalid" ; then
2093                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
2094         fi
2095         ol_with_ldap_module="$ol_arg"
2096
2097 else
2098         ol_with_ldap_module="static"
2099 fi
2100 # end --with-ldap_module
2101
2102 # OpenLDAP --enable-ldbm
2103         # Check whether --enable-ldbm or --disable-ldbm was given.
2104 if test "${enable_ldbm+set}" = set; then
2105   enableval="$enable_ldbm"
2106   
2107         ol_arg=invalid
2108         for ol_val in auto yes no ; do
2109                 if test "$enableval" = "$ol_val" ; then
2110                         ol_arg="$ol_val"
2111                 fi
2112         done
2113         if test "$ol_arg" = "invalid" ; then
2114                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
2115         fi
2116         ol_enable_ldbm="$ol_arg"
2117
2118 else
2119         ol_enable_ldbm="no"
2120 fi
2121 # end --enable-ldbm
2122 # OpenLDAP --with-ldbm_api
2123         # Check whether --with-ldbm_api or --without-ldbm_api was given.
2124 if test "${with_ldbm_api+set}" = set; then
2125   withval="$with_ldbm_api"
2126   
2127         ol_arg=invalid
2128         for ol_val in auto berkeley bcompat mdbm gdbm ; do
2129                 if test "$withval" = "$ol_val" ; then
2130                         ol_arg="$ol_val"
2131                 fi
2132         done
2133         if test "$ol_arg" = "invalid" ; then
2134                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
2135         fi
2136         ol_with_ldbm_api="$ol_arg"
2137
2138 else
2139         ol_with_ldbm_api="auto"
2140 fi
2141 # end --with-ldbm_api
2142
2143 # OpenLDAP --with-ldbm_module
2144         # Check whether --with-ldbm_module or --without-ldbm_module was given.
2145 if test "${with_ldbm_module+set}" = set; then
2146   withval="$with_ldbm_module"
2147   
2148         ol_arg=invalid
2149         for ol_val in static dynamic ; do
2150                 if test "$withval" = "$ol_val" ; then
2151                         ol_arg="$ol_val"
2152                 fi
2153         done
2154         if test "$ol_arg" = "invalid" ; then
2155                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
2156         fi
2157         ol_with_ldbm_module="$ol_arg"
2158
2159 else
2160         ol_with_ldbm_module="static"
2161 fi
2162 # end --with-ldbm_module
2163
2164 # OpenLDAP --with-ldbm_type
2165         # Check whether --with-ldbm_type or --without-ldbm_type was given.
2166 if test "${with_ldbm_type+set}" = set; then
2167   withval="$with_ldbm_type"
2168   
2169         ol_arg=invalid
2170         for ol_val in auto btree hash ; do
2171                 if test "$withval" = "$ol_val" ; then
2172                         ol_arg="$ol_val"
2173                 fi
2174         done
2175         if test "$ol_arg" = "invalid" ; then
2176                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
2177         fi
2178         ol_with_ldbm_type="$ol_arg"
2179
2180 else
2181         ol_with_ldbm_type="auto"
2182 fi
2183 # end --with-ldbm_type
2184
2185 # OpenLDAP --enable-meta
2186         # Check whether --enable-meta or --disable-meta was given.
2187 if test "${enable_meta+set}" = set; then
2188   enableval="$enable_meta"
2189   
2190         ol_arg=invalid
2191         for ol_val in auto yes no ; do
2192                 if test "$enableval" = "$ol_val" ; then
2193                         ol_arg="$ol_val"
2194                 fi
2195         done
2196         if test "$ol_arg" = "invalid" ; then
2197                 { echo "configure: error: bad value $enableval for --enable-meta" 1>&2; exit 1; }
2198         fi
2199         ol_enable_meta="$ol_arg"
2200
2201 else
2202         ol_enable_meta="no"
2203 fi
2204 # end --enable-meta
2205 # OpenLDAP --with-meta_module
2206         # Check whether --with-meta_module or --without-meta_module was given.
2207 if test "${with_meta_module+set}" = set; then
2208   withval="$with_meta_module"
2209   
2210         ol_arg=invalid
2211         for ol_val in static dynamic ; do
2212                 if test "$withval" = "$ol_val" ; then
2213                         ol_arg="$ol_val"
2214                 fi
2215         done
2216         if test "$ol_arg" = "invalid" ; then
2217                 { echo "configure: error: bad value $withval for --with-meta_module" 1>&2; exit 1; }
2218         fi
2219         ol_with_meta_module="$ol_arg"
2220
2221 else
2222         ol_with_meta_module="static"
2223 fi
2224 # end --with-meta_module
2225
2226 # OpenLDAP --enable-monitor
2227         # Check whether --enable-monitor or --disable-monitor was given.
2228 if test "${enable_monitor+set}" = set; then
2229   enableval="$enable_monitor"
2230   
2231         ol_arg=invalid
2232         for ol_val in auto yes no ; do
2233                 if test "$enableval" = "$ol_val" ; then
2234                         ol_arg="$ol_val"
2235                 fi
2236         done
2237         if test "$ol_arg" = "invalid" ; then
2238                 { echo "configure: error: bad value $enableval for --enable-monitor" 1>&2; exit 1; }
2239         fi
2240         ol_enable_monitor="$ol_arg"
2241
2242 else
2243         ol_enable_monitor="no"
2244 fi
2245 # end --enable-monitor
2246 # OpenLDAP --with-monitor_module
2247         # Check whether --with-monitor_module or --without-monitor_module was given.
2248 if test "${with_monitor_module+set}" = set; then
2249   withval="$with_monitor_module"
2250   
2251         ol_arg=invalid
2252         for ol_val in static dynamic ; do
2253                 if test "$withval" = "$ol_val" ; then
2254                         ol_arg="$ol_val"
2255                 fi
2256         done
2257         if test "$ol_arg" = "invalid" ; then
2258                 { echo "configure: error: bad value $withval for --with-monitor_module" 1>&2; exit 1; }
2259         fi
2260         ol_with_monitor_module="$ol_arg"
2261
2262 else
2263         ol_with_monitor_module="static"
2264 fi
2265 # end --with-monitor_module
2266
2267 # OpenLDAP --enable-null
2268         # Check whether --enable-null or --disable-null was given.
2269 if test "${enable_null+set}" = set; then
2270   enableval="$enable_null"
2271   
2272         ol_arg=invalid
2273         for ol_val in auto yes no ; do
2274                 if test "$enableval" = "$ol_val" ; then
2275                         ol_arg="$ol_val"
2276                 fi
2277         done
2278         if test "$ol_arg" = "invalid" ; then
2279                 { echo "configure: error: bad value $enableval for --enable-null" 1>&2; exit 1; }
2280         fi
2281         ol_enable_null="$ol_arg"
2282
2283 else
2284         ol_enable_null="no"
2285 fi
2286 # end --enable-null
2287 # OpenLDAP --with-null_module
2288         # Check whether --with-null_module or --without-null_module was given.
2289 if test "${with_null_module+set}" = set; then
2290   withval="$with_null_module"
2291   
2292         ol_arg=invalid
2293         for ol_val in static dynamic ; do
2294                 if test "$withval" = "$ol_val" ; then
2295                         ol_arg="$ol_val"
2296                 fi
2297         done
2298         if test "$ol_arg" = "invalid" ; then
2299                 { echo "configure: error: bad value $withval for --with-null_module" 1>&2; exit 1; }
2300         fi
2301         ol_with_null_module="$ol_arg"
2302
2303 else
2304         ol_with_null_module="static"
2305 fi
2306 # end --with-null_module
2307
2308 # OpenLDAP --enable-passwd
2309         # Check whether --enable-passwd or --disable-passwd was given.
2310 if test "${enable_passwd+set}" = set; then
2311   enableval="$enable_passwd"
2312   
2313         ol_arg=invalid
2314         for ol_val in auto yes no ; do
2315                 if test "$enableval" = "$ol_val" ; then
2316                         ol_arg="$ol_val"
2317                 fi
2318         done
2319         if test "$ol_arg" = "invalid" ; then
2320                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
2321         fi
2322         ol_enable_passwd="$ol_arg"
2323
2324 else
2325         ol_enable_passwd="no"
2326 fi
2327 # end --enable-passwd
2328 # OpenLDAP --with-passwd_module
2329         # Check whether --with-passwd_module or --without-passwd_module was given.
2330 if test "${with_passwd_module+set}" = set; then
2331   withval="$with_passwd_module"
2332   
2333         ol_arg=invalid
2334         for ol_val in static dynamic ; do
2335                 if test "$withval" = "$ol_val" ; then
2336                         ol_arg="$ol_val"
2337                 fi
2338         done
2339         if test "$ol_arg" = "invalid" ; then
2340                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
2341         fi
2342         ol_with_passwd_module="$ol_arg"
2343
2344 else
2345         ol_with_passwd_module="static"
2346 fi
2347 # end --with-passwd_module
2348
2349 # OpenLDAP --enable-perl
2350         # Check whether --enable-perl or --disable-perl was given.
2351 if test "${enable_perl+set}" = set; then
2352   enableval="$enable_perl"
2353   
2354         ol_arg=invalid
2355         for ol_val in auto yes no ; do
2356                 if test "$enableval" = "$ol_val" ; then
2357                         ol_arg="$ol_val"
2358                 fi
2359         done
2360         if test "$ol_arg" = "invalid" ; then
2361                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
2362         fi
2363         ol_enable_perl="$ol_arg"
2364
2365 else
2366         ol_enable_perl="no"
2367 fi
2368 # end --enable-perl
2369 # OpenLDAP --with-perl_module
2370         # Check whether --with-perl_module or --without-perl_module was given.
2371 if test "${with_perl_module+set}" = set; then
2372   withval="$with_perl_module"
2373   
2374         ol_arg=invalid
2375         for ol_val in static dynamic ; do
2376                 if test "$withval" = "$ol_val" ; then
2377                         ol_arg="$ol_val"
2378                 fi
2379         done
2380         if test "$ol_arg" = "invalid" ; then
2381                 { echo "configure: error: bad value $withval for --with-perl_module" 1>&2; exit 1; }
2382         fi
2383         ol_with_perl_module="$ol_arg"
2384
2385 else
2386         ol_with_perl_module="static"
2387 fi
2388 # end --with-perl_module
2389
2390 # OpenLDAP --enable-shell
2391         # Check whether --enable-shell or --disable-shell was given.
2392 if test "${enable_shell+set}" = set; then
2393   enableval="$enable_shell"
2394   
2395         ol_arg=invalid
2396         for ol_val in auto yes no ; do
2397                 if test "$enableval" = "$ol_val" ; then
2398                         ol_arg="$ol_val"
2399                 fi
2400         done
2401         if test "$ol_arg" = "invalid" ; then
2402                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
2403         fi
2404         ol_enable_shell="$ol_arg"
2405
2406 else
2407         ol_enable_shell="no"
2408 fi
2409 # end --enable-shell
2410 # OpenLDAP --with-shell_module
2411         # Check whether --with-shell_module or --without-shell_module was given.
2412 if test "${with_shell_module+set}" = set; then
2413   withval="$with_shell_module"
2414   
2415         ol_arg=invalid
2416         for ol_val in static dynamic ; do
2417                 if test "$withval" = "$ol_val" ; then
2418                         ol_arg="$ol_val"
2419                 fi
2420         done
2421         if test "$ol_arg" = "invalid" ; then
2422                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
2423         fi
2424         ol_with_shell_module="$ol_arg"
2425
2426 else
2427         ol_with_shell_module="static"
2428 fi
2429 # end --with-shell_module
2430
2431 # OpenLDAP --enable-sql
2432         # Check whether --enable-sql or --disable-sql was given.
2433 if test "${enable_sql+set}" = set; then
2434   enableval="$enable_sql"
2435   
2436         ol_arg=invalid
2437         for ol_val in auto yes no ; do
2438                 if test "$enableval" = "$ol_val" ; then
2439                         ol_arg="$ol_val"
2440                 fi
2441         done
2442         if test "$ol_arg" = "invalid" ; then
2443                 { echo "configure: error: bad value $enableval for --enable-sql" 1>&2; exit 1; }
2444         fi
2445         ol_enable_sql="$ol_arg"
2446
2447 else
2448         ol_enable_sql="no"
2449 fi
2450 # end --enable-sql
2451 # OpenLDAP --with-sql_module
2452         # Check whether --with-sql_module or --without-sql_module was given.
2453 if test "${with_sql_module+set}" = set; then
2454   withval="$with_sql_module"
2455   
2456         ol_arg=invalid
2457         for ol_val in static dynamic ; do
2458                 if test "$withval" = "$ol_val" ; then
2459                         ol_arg="$ol_val"
2460                 fi
2461         done
2462         if test "$ol_arg" = "invalid" ; then
2463                 { echo "configure: error: bad value $withval for --with-sql_module" 1>&2; exit 1; }
2464         fi
2465         ol_with_sql_module="$ol_arg"
2466
2467 else
2468         ol_with_sql_module="static"
2469 fi
2470 # end --with-sql_module
2471
2472 # OpenLDAP --enable-tcl
2473         # Check whether --enable-tcl or --disable-tcl was given.
2474 if test "${enable_tcl+set}" = set; then
2475   enableval="$enable_tcl"
2476   
2477         ol_arg=invalid
2478         for ol_val in auto yes no ; do
2479                 if test "$enableval" = "$ol_val" ; then
2480                         ol_arg="$ol_val"
2481                 fi
2482         done
2483         if test "$ol_arg" = "invalid" ; then
2484                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
2485         fi
2486         ol_enable_tcl="$ol_arg"
2487
2488 else
2489         ol_enable_tcl="no"
2490 fi
2491 # end --enable-tcl
2492 # OpenLDAP --with-tcl_module
2493         # Check whether --with-tcl_module or --without-tcl_module was given.
2494 if test "${with_tcl_module+set}" = set; then
2495   withval="$with_tcl_module"
2496   
2497         ol_arg=invalid
2498         for ol_val in static dynamic ; do
2499                 if test "$withval" = "$ol_val" ; then
2500                         ol_arg="$ol_val"
2501                 fi
2502         done
2503         if test "$ol_arg" = "invalid" ; then
2504                 { echo "configure: error: bad value $withval for --with-tcl_module" 1>&2; exit 1; }
2505         fi
2506         ol_with_tcl_module="$ol_arg"
2507
2508 else
2509         ol_with_tcl_module="static"
2510 fi
2511 # end --with-tcl_module
2512
2513
2514 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2515 if test "${with_xxslurpdoptions+set}" = set; then
2516   withval="$with_xxslurpdoptions"
2517   :
2518 fi
2519
2520 # OpenLDAP --enable-slurpd
2521         # Check whether --enable-slurpd or --disable-slurpd was given.
2522 if test "${enable_slurpd+set}" = set; then
2523   enableval="$enable_slurpd"
2524   
2525         ol_arg=invalid
2526         for ol_val in auto yes no ; do
2527                 if test "$enableval" = "$ol_val" ; then
2528                         ol_arg="$ol_val"
2529                 fi
2530         done
2531         if test "$ol_arg" = "invalid" ; then
2532                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2533         fi
2534         ol_enable_slurpd="$ol_arg"
2535
2536 else
2537         ol_enable_slurpd="auto"
2538 fi
2539 # end --enable-slurpd
2540
2541 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2542 if test "${with_xxliboptions+set}" = set; then
2543   withval="$with_xxliboptions"
2544   :
2545 fi
2546
2547 # Check whether --enable-static or --disable-static was given.
2548 if test "${enable_static+set}" = set; then
2549   enableval="$enable_static"
2550   p=${PACKAGE-default}
2551 case $enableval in
2552 yes) enable_static=yes ;;
2553 no) enable_static=no ;;
2554 *)
2555   enable_static=no
2556   # Look at the argument we got.  We use all the common list separators.
2557   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2558   for pkg in $enableval; do
2559     if test "X$pkg" = "X$p"; then
2560       enable_static=yes
2561     fi
2562   done
2563   IFS="$ac_save_ifs"
2564   ;;
2565 esac
2566 else
2567   enable_static=yes
2568 fi
2569
2570 # Check whether --enable-shared or --disable-shared was given.
2571 if test "${enable_shared+set}" = set; then
2572   enableval="$enable_shared"
2573   p=${PACKAGE-default}
2574 case $enableval in
2575 yes) enable_shared=yes ;;
2576 no) enable_shared=no ;;
2577 *)
2578   enable_shared=no
2579   # Look at the argument we got.  We use all the common list separators.
2580   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2581   for pkg in $enableval; do
2582     if test "X$pkg" = "X$p"; then
2583       enable_shared=yes
2584     fi
2585   done
2586   IFS="$ac_save_ifs"
2587   ;;
2588 esac
2589 else
2590   enable_shared=yes
2591 fi
2592
2593
2594
2595 # validate options
2596 if test $ol_enable_slapd = no ; then
2597                 if test $ol_enable_slapi = yes ; then
2598                 echo "configure: warning: slapd disabled, ignoring --enable-slapi argument" 1>&2
2599         fi
2600         if test $ol_enable_bdb = yes ; then
2601                 echo "configure: warning: slapd disabled, ignoring --enable-bdb argument" 1>&2
2602         fi
2603         if test $ol_enable_dnssrv = yes ; then
2604                 echo "configure: warning: slapd disabled, ignoring --enable-dnssrv argument" 1>&2
2605         fi
2606         if test $ol_enable_ldap = yes ; then
2607                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2608         fi
2609         if test $ol_enable_ldbm = yes ; then
2610                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2611         fi
2612         if test $ol_enable_meta = yes ; then
2613                 echo "configure: warning: slapd disabled, ignoring --enable-meta argument" 1>&2
2614         fi
2615         if test $ol_enable_monitor = yes ; then
2616                 echo "configure: warning: slapd disabled, ignoring --enable-monitor argument" 1>&2
2617         fi
2618         if test $ol_enable_null = yes ; then
2619                 echo "configure: warning: slapd disabled, ignoring --enable-null argument" 1>&2
2620         fi
2621         if test $ol_enable_passwd = yes ; then
2622                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2623         fi
2624         if test $ol_enable_perl = yes ; then
2625                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
2626         fi
2627         if test $ol_enable_shell = yes ; then
2628                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2629         fi
2630         if test $ol_enable_tcl = yes ; then
2631                 echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
2632         fi
2633         if test $ol_enable_sql = yes ; then
2634                 echo "configure: warning: slapd disabled, ignoring --enable-sql argument" 1>&2
2635         fi
2636         if test $ol_enable_modules = yes ; then
2637                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2638         fi
2639         if test $ol_enable_multimaster = yes ; then
2640                 echo "configure: warning: slapd disabled, ignoring --enable-multimaster argument" 1>&2
2641         fi
2642         if test $ol_enable_wrappers = yes ; then
2643                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2644         fi
2645         if test $ol_enable_phonetic = yes ; then
2646                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2647         fi
2648         if test $ol_enable_rlookups = yes ; then
2649                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2650         fi
2651         if test $ol_enable_aci = yes ; then
2652                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2653         fi
2654         if test $ol_with_ldbm_api != auto ; then
2655                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2656         fi
2657         if test $ol_with_ldbm_type != auto ; then
2658                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2659         fi
2660         if test $ol_with_bdb_module != static ; then
2661                 echo "configure: warning: slapd disabled, ignoring --with-bdb-module argument" 1>&2
2662         fi
2663         if test $ol_with_dnssrv_module != static ; then
2664                 echo "configure: warning: slapd disabled, ignoring --with-dnssrv-module argument" 1>&2
2665         fi
2666         if test $ol_with_ldap_module != static ; then
2667                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2668         fi
2669         if test $ol_with_ldbm_module != static ; then
2670                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2671         fi
2672         if test $ol_with_meta_module != static ; then
2673                 echo "configure: warning: slapd disabled, ignoring --with-meta-module argument" 1>&2
2674         fi
2675         if test $ol_with_monitor_module != static ; then
2676                 echo "configure: warning: slapd disabled, ignoring --with-monitor-module argument" 1>&2
2677         fi
2678         if test $ol_with_null_module != static ; then
2679                 echo "configure: warning: slapd disabled, ignoring --with-null-module argument" 1>&2
2680         fi
2681         if test $ol_with_passwd_module != static ; then
2682                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2683         fi
2684         if test $ol_with_perl_module != static ; then
2685                 echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2
2686         fi
2687         if test $ol_with_shell_module != static ; then
2688                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2689         fi
2690         if test $ol_with_tcl_module != static ; then
2691                 echo "configure: warning: slapd disabled, ignoring --with-tcl-module argument" 1>&2
2692         fi
2693         if test $ol_with_sql_module != static ; then
2694                 echo "configure: warning: slapd disabled, ignoring --with-sql-module argument" 1>&2
2695         fi
2696         if test $ol_enable_slurpd = yes ; then
2697                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2698         fi
2699         if test $ol_enable_rewrite = yes ; then
2700                 echo "configure: warning: slapd disabled, ignoring --enable-rewrite argument" 1>&2
2701         fi
2702
2703         # force settings to no
2704         ol_enable_slapi=no
2705         ol_enable_bdb=no
2706         ol_enable_dnssrv=no
2707         ol_enable_ldap=no
2708         ol_enable_ldbm=no
2709         ol_enable_meta=no
2710         ol_enable_monitor=no
2711         ol_enable_null=no
2712         ol_enable_passwd=no
2713         ol_enable_perl=no
2714         ol_enable_shell=no
2715         ol_enable_tcl=no
2716         ol_enable_sql=no
2717
2718         ol_enable_modules=no
2719         ol_enable_multimaster=no
2720         ol_enable_phonetic=no
2721         ol_enable_rlookups=no
2722         ol_enable_aci=no
2723         ol_enable_wrappers=no
2724         ol_enable_dynamic=no
2725
2726         ol_with_ldbm_api=no
2727         ol_with_ldbm_type=no
2728
2729         ol_with_bdb_module=static
2730         ol_with_dnssrv_module=static
2731         ol_with_ldap_module=static
2732         ol_with_ldbm_module=static
2733         ol_with_meta_module=static
2734         ol_with_monitor_module=static
2735         ol_with_null_module=static
2736         ol_with_passwd_module=static
2737         ol_with_perl_module=static
2738         ol_with_shell_module=static
2739         ol_with_tcl_module=static
2740         ol_with_sql_module=static
2741
2742         ol_enable_slurpd=no
2743
2744         ol_enable_rewrite=no
2745
2746 elif test $ol_enable_ldbm = no ; then
2747         
2748         if test $ol_with_ldbm_api != auto ; then
2749                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2750         fi
2751
2752         if test $ol_with_ldbm_type != auto ; then
2753                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2754         fi
2755
2756         if test $ol_with_ldbm_module != static ; then
2757                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2758         fi
2759
2760         if test $ol_enable_modules != yes -a \
2761                 $ol_enable_bdb = no -a \
2762                 $ol_enable_dnssrv = no -a \
2763                 $ol_enable_ldap = no -a \
2764                 $ol_enable_meta = no -a \
2765                 $ol_enable_monitor = no -a \
2766                 $ol_enable_null = no -a \
2767                 $ol_enable_passwd = no -a \
2768                 $ol_enable_perl = no -a \
2769                 $ol_enable_shell = no -a \
2770                 $ol_enable_sql = no -a \
2771                 $ol_enable_tcl = no ; then
2772
2773                 if test $ol_enable_slapd = yes ; then
2774                         { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2775                 else
2776                         echo "configure: warning: skipping slapd, no backend specified" 1>&2
2777                         ol_enable_slapd=no
2778                 fi
2779         fi
2780
2781         ol_with_ldbm_api=no
2782         ol_with_ldbm_type=no
2783         ol_with_ldbm_module=static
2784
2785         if test $ol_enable_bdb != no ; then
2786                 ol_with_ldbm_api=berkeley
2787         fi
2788
2789 else
2790                 if test $ol_with_ldbm_api = gdbm -a \
2791                 $ol_with_ldbm_type = btree ; then
2792                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2793         fi
2794         if test $ol_with_ldbm_api = mdbm -a \
2795                 $ol_with_ldbm_type = btree ; then
2796                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2797         fi
2798         if test $ol_with_ldbm_api = ndbm -a \
2799                 $ol_with_ldbm_type = btree ; then
2800                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2801         fi
2802
2803         if test $ol_enable_bdb = yes ; then
2804                 if test $ol_with_ldbm_api = auto ; then
2805                         ol_with_ldbm_api=berkeley
2806                 elif test $ol_with_ldbm_api != berkeley ; then
2807                         { echo "configure: error: LDBM API not compatible with BDB" 1>&2; exit 1; }
2808                 fi
2809
2810         elif test $ol_enable_bdb = auto ; then
2811                 if test $ol_with_ldbm_api != berkeley \
2812                         -o $ol_with_ldbm_api != auto ; then
2813                         echo "configure: warning: LDBM API not compatible with BDB, disabling BDB" 1>&2
2814                         ol_enable_bdb=no
2815                 fi
2816         fi
2817 fi
2818
2819 if test $ol_enable_slurpd = yes ; then
2820                 if test $ol_with_threads = no ; then
2821                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2822         fi
2823 fi
2824
2825 if test $ol_enable_lmpasswd = yes ; then
2826         if test $ol_with_tls = no ; then
2827                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
2828         fi
2829 fi
2830
2831 if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
2832         if test $ol_with_kerberos = no ; then
2833                 { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
2834         elif test $ol_with_kerberos = auto ; then
2835                 ol_with_kerberos=yes
2836         fi
2837
2838 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
2839         if test $ol_with_kerberos = auto ; then
2840                 ol_with_kerberos=no
2841         elif test $ol_with_kerberos != no ; then
2842                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2843                 ol_with_kerberos=no
2844         fi
2845 fi
2846
2847 if test $ol_enable_spasswd = yes ; then
2848         if test $ol_with_cyrus_sasl = no ; then
2849                 { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
2850         fi
2851         ol_with_cyrus_sasl=yes
2852 fi
2853
2854 echo "$ac_t""done" 1>&6
2855
2856 LDAP_LIBS=
2857 LDIF_LIBS=
2858 LDBM_LIBS=
2859 LTHREAD_LIBS=
2860 LUTIL_LIBS=
2861
2862 SLAPD_LIBS=
2863 SLURPD_LIBS=
2864
2865 BUILD_SLAPD=no
2866 BUILD_SLURPD=no
2867
2868 BUILD_THREAD=no
2869
2870 BUILD_SLAPI=no
2871 SLAPD_SLAPI_DEPEND=
2872
2873 BUILD_BDB=no
2874 BUILD_DNSSRV=no
2875 BUILD_LDAP=no
2876 BUILD_LDBM=no
2877 BUILD_META=no
2878 BUILD_MONITOR=no
2879 BUILD_NULL=no
2880 BUILD_PASSWD=no
2881 BUILD_PERL=no
2882 BUILD_SHELL=no
2883 BUILD_SQL=no
2884 BUILD_TCL=no
2885
2886 BUILD_BDB_DYNAMIC=static
2887 BUILD_DNSSRV_DYNAMIC=static
2888 BUILD_LDAP_DYNAMIC=static
2889 BUILD_LDBM_DYNAMIC=static
2890 BUILD_META_DYNAMIC=static
2891 BUILD_MONITOR_DYNAMIC=static
2892 BUILD_NULL_DYNAMIC=static
2893 BUILD_PASSWD_DYNAMIC=static
2894 BUILD_PERL_DYNAMIC=static
2895 BUILD_SHELL_DYNAMIC=static
2896 BUILD_TCL_DYNAMIC=static
2897 BUILD_SQL_DYNAMIC=static
2898
2899 SLAPD_MODULES_LDFLAGS=
2900 SLAPD_MODULES_CPPFLAGS=
2901
2902 SLAPD_STATIC_BACKENDS=
2903 SLAPD_DYNAMIC_BACKENDS=
2904
2905 SLAPD_PERL_LDFLAGS=
2906 MOD_PERL_LDFLAGS=
2907 PERL_CPPFLAGS=
2908
2909 SLAPD_SQL_LDFLAGS=
2910 SLAPD_SQL_LIBS=
2911 SLAPD_SQL_INCLUDES=
2912
2913 MOD_TCL_LIB=
2914 KRB4_LIBS=
2915 KRB5_LIBS=
2916 READLINE_LIBS=
2917 SASL_LIBS=
2918 TERMCAP_LIBS=
2919 TLS_LIBS=
2920 MODULES_LIBS=
2921 SLAPI_LIBS=
2922 LIBSLAPI=
2923 LIBSLAPITOOLS=
2924 AUTH_LIBS=
2925
2926 SLAPD_SLP_LIBS=
2927
2928
2929 # Find a good install program.  We prefer a C program (faster),
2930 # so one script is as good as another.  But avoid the broken or
2931 # incompatible versions:
2932 # SysV /etc/install, /usr/sbin/install
2933 # SunOS /usr/etc/install
2934 # IRIX /sbin/install
2935 # AIX /bin/install
2936 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2937 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2938 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2939 # ./install, which can be erroneously created by make from ./install.sh.
2940 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
2941 echo "configure:2942: checking for a BSD compatible install" >&5
2942 if test -z "$INSTALL"; then
2943 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
2944   echo $ac_n "(cached) $ac_c" 1>&6
2945 else
2946     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
2947   for ac_dir in $PATH; do
2948     # Account for people who put trailing slashes in PATH elements.
2949     case "$ac_dir/" in
2950     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
2951     *)
2952       # OSF1 and SCO ODT 3.0 have their own names for install.
2953       # Don't use installbsd from OSF since it installs stuff as root
2954       # by default.
2955       for ac_prog in ginstall scoinst install; do
2956         if test -f $ac_dir/$ac_prog; then
2957           if test $ac_prog = install &&
2958             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
2959             # AIX install.  It has an incompatible calling convention.
2960             :
2961           elif test $ac_prog = install &&
2962             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
2963             # program-specific install script used by HP pwplus--don't use.
2964             :
2965           else
2966             ac_cv_path_install="$ac_dir/$ac_prog -c"
2967             break 2
2968           fi
2969         fi
2970       done
2971       ;;
2972     esac
2973   done
2974   IFS="$ac_save_IFS"
2975
2976 fi
2977   if test "${ac_cv_path_install+set}" = set; then
2978     INSTALL="$ac_cv_path_install"
2979   else
2980     # As a last resort, use the slow shell script.  We don't cache a
2981     # path for INSTALL within a source directory, because that will
2982     # break other packages using the cache if that directory is
2983     # removed, or if the path is relative.
2984     INSTALL="$ac_install_sh"
2985   fi
2986 fi
2987 echo "$ac_t""$INSTALL" 1>&6
2988
2989 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2990 # It thinks the first close brace ends the variable substitution.
2991 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2992
2993 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2994
2995 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2996
2997
2998 cat >> confdefs.h <<\EOF
2999 #define HAVE_MKVERSION 1
3000 EOF
3001
3002
3003
3004
3005 ol_aix_threads=no
3006 case "$target" in
3007 *-*-aix*)       if test -z "$CC" ; then
3008                 case "$ol_with_threads" in
3009                 auto | yes |  posix) ol_aix_threads=yes ;;
3010                 esac
3011         fi
3012 ;;
3013 esac
3014
3015 if test $ol_aix_threads = yes ; then
3016         if test -z "${CC}" ; then
3017                 for ac_prog in cc_r xlc_r cc
3018 do
3019 # Extract the first word of "$ac_prog", so it can be a program name with args.
3020 set dummy $ac_prog; ac_word=$2
3021 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3022 echo "configure:3023: checking for $ac_word" >&5
3023 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3024   echo $ac_n "(cached) $ac_c" 1>&6
3025 else
3026   if test -n "$CC"; then
3027   ac_cv_prog_CC="$CC" # Let the user override the test.
3028 else
3029   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3030   ac_dummy="$PATH"
3031   for ac_dir in $ac_dummy; do
3032     test -z "$ac_dir" && ac_dir=.
3033     if test -f $ac_dir/$ac_word; then
3034       ac_cv_prog_CC="$ac_prog"
3035       break
3036     fi
3037   done
3038   IFS="$ac_save_ifs"
3039 fi
3040 fi
3041 CC="$ac_cv_prog_CC"
3042 if test -n "$CC"; then
3043   echo "$ac_t""$CC" 1>&6
3044 else
3045   echo "$ac_t""no" 1>&6
3046 fi
3047
3048 test -n "$CC" && break
3049 done
3050
3051
3052                 if test "$CC" = cc ; then
3053                                                 if test $ol_with_threads != auto ; then
3054                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
3055                         else
3056                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
3057                         fi
3058                         ol_with_threads=no
3059                 fi
3060         fi
3061
3062         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
3063                 ol_with_threads=posix
3064                 ol_cv_pthread_create=yes
3065         fi
3066 fi
3067
3068 if test -z "${CC}"; then
3069         for ac_prog in cc gcc
3070 do
3071 # Extract the first word of "$ac_prog", so it can be a program name with args.
3072 set dummy $ac_prog; ac_word=$2
3073 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3074 echo "configure:3075: checking for $ac_word" >&5
3075 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3076   echo $ac_n "(cached) $ac_c" 1>&6
3077 else
3078   if test -n "$CC"; then
3079   ac_cv_prog_CC="$CC" # Let the user override the test.
3080 else
3081   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3082   ac_dummy="$PATH"
3083   for ac_dir in $ac_dummy; do
3084     test -z "$ac_dir" && ac_dir=.
3085     if test -f $ac_dir/$ac_word; then
3086       ac_cv_prog_CC="$ac_prog"
3087       break
3088     fi
3089   done
3090   IFS="$ac_save_ifs"
3091 fi
3092 fi
3093 CC="$ac_cv_prog_CC"
3094 if test -n "$CC"; then
3095   echo "$ac_t""$CC" 1>&6
3096 else
3097   echo "$ac_t""no" 1>&6
3098 fi
3099
3100 test -n "$CC" && break
3101 done
3102 test -n "$CC" || CC="missing"
3103
3104
3105         if test "${CC}" = "missing" ; then
3106                 { echo "configure: error: Unable to locate cc(1) or suitable replacement.  Check PATH or set CC." 1>&2; exit 1; }
3107         fi
3108 fi
3109
3110 if test -z "${AR}"; then
3111         for ac_prog in ar gar
3112 do
3113 # Extract the first word of "$ac_prog", so it can be a program name with args.
3114 set dummy $ac_prog; ac_word=$2
3115 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3116 echo "configure:3117: checking for $ac_word" >&5
3117 if eval "test \"\${ac_cv_prog_AR+set}\" = set"; then
3118   echo $ac_n "(cached) $ac_c" 1>&6
3119 else
3120   if test -n "$AR"; then
3121   ac_cv_prog_AR="$AR" # Let the user override the test.
3122 else
3123   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3124   ac_dummy="$PATH"
3125   for ac_dir in $ac_dummy; do
3126     test -z "$ac_dir" && ac_dir=.
3127     if test -f $ac_dir/$ac_word; then
3128       ac_cv_prog_AR="$ac_prog"
3129       break
3130     fi
3131   done
3132   IFS="$ac_save_ifs"
3133 fi
3134 fi
3135 AR="$ac_cv_prog_AR"
3136 if test -n "$AR"; then
3137   echo "$ac_t""$AR" 1>&6
3138 else
3139   echo "$ac_t""no" 1>&6
3140 fi
3141
3142 test -n "$AR" && break
3143 done
3144 test -n "$AR" || AR="missing"
3145
3146
3147         if test "${AR}" = "missing" ; then
3148                 { echo "configure: error: Unable to locate ar(1) or suitable replacement.  Check PATH or set AR." 1>&2; exit 1; }
3149         fi
3150 fi
3151
3152
3153
3154 # Find the correct PATH separator.  Usually this is `:', but
3155 # DJGPP uses `;' like DOS.
3156 if test "X${PATH_SEPARATOR+set}" != Xset; then
3157   UNAME=${UNAME-`uname 2>/dev/null`}
3158   case X$UNAME in
3159     *-DOS) lt_cv_sys_path_separator=';' ;;
3160     *)     lt_cv_sys_path_separator=':' ;;
3161   esac
3162   PATH_SEPARATOR=$lt_cv_sys_path_separator
3163 fi
3164
3165 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3166 echo "configure:3167: checking for Cygwin environment" >&5
3167 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
3168   echo $ac_n "(cached) $ac_c" 1>&6
3169 else
3170   cat > conftest.$ac_ext <<EOF
3171 #line 3172 "configure"
3172 #include "confdefs.h"
3173
3174 int main() {
3175
3176 #ifndef __CYGWIN__
3177 #define __CYGWIN__ __CYGWIN32__
3178 #endif
3179 return __CYGWIN__;
3180 ; return 0; }
3181 EOF
3182 if { (eval echo configure:3183: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3183   rm -rf conftest*
3184   ac_cv_cygwin=yes
3185 else
3186   echo "configure: failed program was:" >&5
3187   cat conftest.$ac_ext >&5
3188   rm -rf conftest*
3189   ac_cv_cygwin=no
3190 fi
3191 rm -f conftest*
3192 fi
3193
3194 echo "$ac_t""$ac_cv_cygwin" 1>&6
3195 CYGWIN=
3196 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3197 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3198 echo "configure:3199: checking for mingw32 environment" >&5
3199 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
3200   echo $ac_n "(cached) $ac_c" 1>&6
3201 else
3202   cat > conftest.$ac_ext <<EOF
3203 #line 3204 "configure"
3204 #include "confdefs.h"
3205
3206 int main() {
3207 return __MINGW32__;
3208 ; return 0; }
3209 EOF
3210 if { (eval echo configure:3211: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3211   rm -rf conftest*
3212   ac_cv_mingw32=yes
3213 else
3214   echo "configure: failed program was:" >&5
3215   cat conftest.$ac_ext >&5
3216   rm -rf conftest*
3217   ac_cv_mingw32=no
3218 fi
3219 rm -f conftest*
3220 fi
3221
3222 echo "$ac_t""$ac_cv_mingw32" 1>&6
3223 MINGW32=
3224 test "$ac_cv_mingw32" = yes && MINGW32=yes
3225 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
3226 echo "configure:3227: checking for EMX OS/2 environment" >&5
3227 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
3228   echo $ac_n "(cached) $ac_c" 1>&6
3229 else
3230   cat > conftest.$ac_ext <<EOF
3231 #line 3232 "configure"
3232 #include "confdefs.h"
3233
3234 int main() {
3235 return __EMX__;
3236 ; return 0; }
3237 EOF
3238 if { (eval echo configure:3239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3239   rm -rf conftest*
3240   ac_cv_emxos2=yes
3241 else
3242   echo "configure: failed program was:" >&5
3243   cat conftest.$ac_ext >&5
3244   rm -rf conftest*
3245   ac_cv_emxos2=no
3246 fi
3247 rm -f conftest*
3248 fi
3249
3250 echo "$ac_t""$ac_cv_emxos2" 1>&6
3251 EMXOS2=
3252 test "$ac_cv_emxos2" = yes && EMXOS2=yes
3253 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3254 echo "configure:3255: checking how to run the C preprocessor" >&5
3255 # On Suns, sometimes $CPP names a directory.
3256 if test -n "$CPP" && test -d "$CPP"; then
3257   CPP=
3258 fi
3259 if test -z "$CPP"; then
3260 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3261   echo $ac_n "(cached) $ac_c" 1>&6
3262 else
3263     # This must be in double quotes, not single quotes, because CPP may get
3264   # substituted into the Makefile and "${CC-cc}" will confuse make.
3265   CPP="${CC-cc} -E"
3266   # On the NeXT, cc -E runs the code through the compiler's parser,
3267   # not just through cpp.
3268   cat > conftest.$ac_ext <<EOF
3269 #line 3270 "configure"
3270 #include "confdefs.h"
3271 #include <assert.h>
3272 Syntax Error
3273 EOF
3274 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3275 { (eval echo configure:3276: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3276 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3277 if test -z "$ac_err"; then
3278   :
3279 else
3280   echo "$ac_err" >&5
3281   echo "configure: failed program was:" >&5
3282   cat conftest.$ac_ext >&5
3283   rm -rf conftest*
3284   CPP="${CC-cc} -E -traditional-cpp"
3285   cat > conftest.$ac_ext <<EOF
3286 #line 3287 "configure"
3287 #include "confdefs.h"
3288 #include <assert.h>
3289 Syntax Error
3290 EOF
3291 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3292 { (eval echo configure:3293: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3293 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3294 if test -z "$ac_err"; then
3295   :
3296 else
3297   echo "$ac_err" >&5
3298   echo "configure: failed program was:" >&5
3299   cat conftest.$ac_ext >&5
3300   rm -rf conftest*
3301   CPP="${CC-cc} -nologo -E"
3302   cat > conftest.$ac_ext <<EOF
3303 #line 3304 "configure"
3304 #include "confdefs.h"
3305 #include <assert.h>
3306 Syntax Error
3307 EOF
3308 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3309 { (eval echo configure:3310: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3310 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3311 if test -z "$ac_err"; then
3312   :
3313 else
3314   echo "$ac_err" >&5
3315   echo "configure: failed program was:" >&5
3316   cat conftest.$ac_ext >&5
3317   rm -rf conftest*
3318   CPP=/lib/cpp
3319 fi
3320 rm -f conftest*
3321 fi
3322 rm -f conftest*
3323 fi
3324 rm -f conftest*
3325   ac_cv_prog_CPP="$CPP"
3326 fi
3327   CPP="$ac_cv_prog_CPP"
3328 else
3329   ac_cv_prog_CPP="$CPP"
3330 fi
3331 echo "$ac_t""$CPP" 1>&6
3332
3333 # Check whether --enable-fast-install or --disable-fast-install was given.
3334 if test "${enable_fast_install+set}" = set; then
3335   enableval="$enable_fast_install"
3336   p=${PACKAGE-default}
3337 case $enableval in
3338 yes) enable_fast_install=yes ;;
3339 no) enable_fast_install=no ;;
3340 *)
3341   enable_fast_install=no
3342   # Look at the argument we got.  We use all the common list separators.
3343   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3344   for pkg in $enableval; do
3345     if test "X$pkg" = "X$p"; then
3346       enable_fast_install=yes
3347     fi
3348   done
3349   IFS="$ac_save_ifs"
3350   ;;
3351 esac
3352 else
3353   enable_fast_install=yes
3354 fi
3355
3356 # Extract the first word of "gcc", so it can be a program name with args.
3357 set dummy gcc; ac_word=$2
3358 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3359 echo "configure:3360: checking for $ac_word" >&5
3360 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3361   echo $ac_n "(cached) $ac_c" 1>&6
3362 else
3363   if test -n "$CC"; then
3364   ac_cv_prog_CC="$CC" # Let the user override the test.
3365 else
3366   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3367   ac_dummy="$PATH"
3368   for ac_dir in $ac_dummy; do
3369     test -z "$ac_dir" && ac_dir=.
3370     if test -f $ac_dir/$ac_word; then
3371       ac_cv_prog_CC="gcc"
3372       break
3373     fi
3374   done
3375   IFS="$ac_save_ifs"
3376 fi
3377 fi
3378 CC="$ac_cv_prog_CC"
3379 if test -n "$CC"; then
3380   echo "$ac_t""$CC" 1>&6
3381 else
3382   echo "$ac_t""no" 1>&6
3383 fi
3384
3385 if test -z "$CC"; then
3386   # Extract the first word of "cc", so it can be a program name with args.
3387 set dummy cc; ac_word=$2
3388 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3389 echo "configure:3390: checking for $ac_word" >&5
3390 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3391   echo $ac_n "(cached) $ac_c" 1>&6
3392 else
3393   if test -n "$CC"; then
3394   ac_cv_prog_CC="$CC" # Let the user override the test.
3395 else
3396   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3397   ac_prog_rejected=no
3398   ac_dummy="$PATH"
3399   for ac_dir in $ac_dummy; do
3400     test -z "$ac_dir" && ac_dir=.
3401     if test -f $ac_dir/$ac_word; then
3402       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
3403         ac_prog_rejected=yes
3404         continue
3405       fi
3406       ac_cv_prog_CC="cc"
3407       break
3408     fi
3409   done
3410   IFS="$ac_save_ifs"
3411 if test $ac_prog_rejected = yes; then
3412   # We found a bogon in the path, so make sure we never use it.
3413   set dummy $ac_cv_prog_CC
3414   shift
3415   if test $# -gt 0; then
3416     # We chose a different compiler from the bogus one.
3417     # However, it has the same basename, so the bogon will be chosen
3418     # first if we set CC to just the basename; use the full file name.
3419     shift
3420     set dummy "$ac_dir/$ac_word" "$@"
3421     shift
3422     ac_cv_prog_CC="$@"
3423   fi
3424 fi
3425 fi
3426 fi
3427 CC="$ac_cv_prog_CC"
3428 if test -n "$CC"; then
3429   echo "$ac_t""$CC" 1>&6
3430 else
3431   echo "$ac_t""no" 1>&6
3432 fi
3433
3434   if test -z "$CC"; then
3435     case "`uname -s`" in
3436     *win32* | *WIN32* | *CYGWIN*)
3437       # Extract the first word of "cl", so it can be a program name with args.
3438 set dummy cl; ac_word=$2
3439 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3440 echo "configure:3441: checking for $ac_word" >&5
3441 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3442   echo $ac_n "(cached) $ac_c" 1>&6
3443 else
3444   if test -n "$CC"; then
3445   ac_cv_prog_CC="$CC" # Let the user override the test.
3446 else
3447   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3448   ac_dummy="$PATH"
3449   for ac_dir in $ac_dummy; do
3450     test -z "$ac_dir" && ac_dir=.
3451     if test -f $ac_dir/$ac_word; then
3452       ac_cv_prog_CC="cl"
3453       break
3454     fi
3455   done
3456   IFS="$ac_save_ifs"
3457 fi
3458 fi
3459 CC="$ac_cv_prog_CC"
3460 if test -n "$CC"; then
3461   echo "$ac_t""$CC" 1>&6
3462 else
3463   echo "$ac_t""no" 1>&6
3464 fi
3465  ;;
3466     esac
3467   fi
3468   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
3469 fi
3470
3471 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
3472 echo "configure:3473: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
3473
3474 ac_ext=c
3475 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3476 ac_cpp='$CPP $CPPFLAGS'
3477 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3478 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3479 cross_compiling=$ac_cv_prog_cc_cross
3480
3481 cat > conftest.$ac_ext << EOF
3482
3483 #line 3484 "configure"
3484 #include "confdefs.h"
3485
3486 main(){return(0);}
3487 EOF
3488 if { (eval echo configure:3489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3489   ac_cv_prog_cc_works=yes
3490   # If we can't run a trivial program, we are probably using a cross compiler.
3491   if (./conftest; exit) 2>/dev/null; then
3492     ac_cv_prog_cc_cross=no
3493   else
3494     ac_cv_prog_cc_cross=yes
3495   fi
3496 else
3497   echo "configure: failed program was:" >&5
3498   cat conftest.$ac_ext >&5
3499   ac_cv_prog_cc_works=no
3500 fi
3501 rm -fr conftest*
3502 ac_ext=c
3503 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3504 ac_cpp='$CPP $CPPFLAGS'
3505 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3506 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3507 cross_compiling=$ac_cv_prog_cc_cross
3508
3509 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
3510 if test $ac_cv_prog_cc_works = no; then
3511   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
3512 fi
3513 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
3514 echo "configure:3515: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
3515 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
3516 cross_compiling=$ac_cv_prog_cc_cross
3517
3518 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
3519 echo "configure:3520: checking whether we are using GNU C" >&5
3520 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
3521   echo $ac_n "(cached) $ac_c" 1>&6
3522 else
3523   cat > conftest.c <<EOF
3524 #ifdef __GNUC__
3525   yes;
3526 #endif
3527 EOF
3528 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3529: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
3529   ac_cv_prog_gcc=yes
3530 else
3531   ac_cv_prog_gcc=no
3532 fi
3533 fi
3534
3535 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
3536
3537 if test $ac_cv_prog_gcc = yes; then
3538   GCC=yes
3539 else
3540   GCC=
3541 fi
3542
3543 ac_test_CFLAGS="${CFLAGS+set}"
3544 ac_save_CFLAGS="$CFLAGS"
3545 CFLAGS=
3546 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
3547 echo "configure:3548: checking whether ${CC-cc} accepts -g" >&5
3548 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
3549   echo $ac_n "(cached) $ac_c" 1>&6
3550 else
3551   echo 'void f(){}' > conftest.c
3552 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
3553   ac_cv_prog_cc_g=yes
3554 else
3555   ac_cv_prog_cc_g=no
3556 fi
3557 rm -f conftest*
3558
3559 fi
3560
3561 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
3562 if test "$ac_test_CFLAGS" = set; then
3563   CFLAGS="$ac_save_CFLAGS"
3564 elif test $ac_cv_prog_cc_g = yes; then
3565   if test "$GCC" = yes; then
3566     CFLAGS="-g -O2"
3567   else
3568     CFLAGS="-g"
3569   fi
3570 else
3571   if test "$GCC" = yes; then
3572     CFLAGS="-O2"
3573   else
3574     CFLAGS=
3575   fi
3576 fi
3577
3578 # Check whether --with-gnu-ld or --without-gnu-ld was given.
3579 if test "${with_gnu_ld+set}" = set; then
3580   withval="$with_gnu_ld"
3581   test "$withval" = no || with_gnu_ld=yes
3582 else
3583   with_gnu_ld=no
3584 fi
3585
3586 ac_prog=ld
3587 if test "$GCC" = yes; then
3588   # Check if gcc -print-prog-name=ld gives a path.
3589   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
3590 echo "configure:3591: checking for ld used by GCC" >&5
3591   case $host in
3592   *-*-mingw*)
3593     # gcc leaves a trailing carriage return which upsets mingw
3594     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3595   *)
3596     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3597   esac
3598   case $ac_prog in
3599     # Accept absolute paths.
3600     [\\/]* | [A-Za-z]:[\\/]*)
3601       re_direlt='/[^/][^/]*/\.\./'
3602       # Canonicalize the path of ld
3603       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3604       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3605         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3606       done
3607       test -z "$LD" && LD="$ac_prog"
3608       ;;
3609   "")
3610     # If it fails, then pretend we aren't using GCC.
3611     ac_prog=ld
3612     ;;
3613   *)
3614     # If it is relative, then search for the first ld in PATH.
3615     with_gnu_ld=unknown
3616     ;;
3617   esac
3618 elif test "$with_gnu_ld" = yes; then
3619   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
3620 echo "configure:3621: checking for GNU ld" >&5
3621 else
3622   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
3623 echo "configure:3624: checking for non-GNU ld" >&5
3624 fi
3625 if eval "test \"\${lt_cv_path_LD+set}\" = set"; then
3626   echo $ac_n "(cached) $ac_c" 1>&6
3627 else
3628   if test -z "$LD"; then
3629   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3630   for ac_dir in $PATH; do
3631     test -z "$ac_dir" && ac_dir=.
3632     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3633       lt_cv_path_LD="$ac_dir/$ac_prog"
3634       # Check to see if the program is GNU ld.  I'd rather use --version,
3635       # but apparently some GNU ld's only accept -v.
3636       # Break only if it was the GNU/non-GNU ld that we prefer.
3637       if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3638         test "$with_gnu_ld" != no && break
3639       else
3640         test "$with_gnu_ld" != yes && break
3641       fi
3642     fi
3643   done
3644   IFS="$ac_save_ifs"
3645 else
3646   lt_cv_path_LD="$LD" # Let the user override the test with a path.
3647 fi
3648 fi
3649
3650 LD="$lt_cv_path_LD"
3651 if test -n "$LD"; then
3652   echo "$ac_t""$LD" 1>&6
3653 else
3654   echo "$ac_t""no" 1>&6
3655 fi
3656 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
3657 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
3658 echo "configure:3659: checking if the linker ($LD) is GNU ld" >&5
3659 if eval "test \"\${lt_cv_prog_gnu_ld+set}\" = set"; then
3660   echo $ac_n "(cached) $ac_c" 1>&6
3661 else
3662   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
3663 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3664   lt_cv_prog_gnu_ld=yes
3665 else
3666   lt_cv_prog_gnu_ld=no
3667 fi
3668 fi
3669
3670 echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
3671 with_gnu_ld=$lt_cv_prog_gnu_ld
3672
3673
3674 echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
3675 echo "configure:3676: checking for $LD option to reload object files" >&5
3676 if eval "test \"\${lt_cv_ld_reload_flag+set}\" = set"; then
3677   echo $ac_n "(cached) $ac_c" 1>&6
3678 else
3679   lt_cv_ld_reload_flag='-r'
3680 fi
3681
3682 echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6
3683 reload_flag=$lt_cv_ld_reload_flag
3684 test -n "$reload_flag" && reload_flag=" $reload_flag"
3685
3686 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
3687 echo "configure:3688: checking for BSD-compatible nm" >&5
3688 if eval "test \"\${lt_cv_path_NM+set}\" = set"; then
3689   echo $ac_n "(cached) $ac_c" 1>&6
3690 else
3691   if test -n "$NM"; then
3692   # Let the user override the test.
3693   lt_cv_path_NM="$NM"
3694 else
3695   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3696   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3697     test -z "$ac_dir" && ac_dir=.
3698     tmp_nm=$ac_dir/${ac_tool_prefix}nm
3699     if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
3700       # Check to see if the nm accepts a BSD-compat flag.
3701       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3702       #   nm: unknown option "B" ignored
3703       # Tru64's nm complains that /dev/null is an invalid object file
3704       if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
3705         lt_cv_path_NM="$tmp_nm -B"
3706         break
3707       elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3708         lt_cv_path_NM="$tmp_nm -p"
3709         break
3710       else
3711         lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3712         continue # so that we can try to find one that supports BSD flags
3713       fi
3714     fi
3715   done
3716   IFS="$ac_save_ifs"
3717   test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
3718 fi
3719 fi
3720
3721 NM="$lt_cv_path_NM"
3722 echo "$ac_t""$NM" 1>&6
3723
3724 echo $ac_n "checking for a sed that does not truncate output""... $ac_c" 1>&6
3725 echo "configure:3726: checking for a sed that does not truncate output" >&5
3726 if eval "test \"\${lt_cv_path_SED+set}\" = set"; then
3727   echo $ac_n "(cached) $ac_c" 1>&6
3728 else
3729   # Loop through the user's path and test for sed and gsed.
3730 # Then use that list of sed's as ones to test for truncation.
3731 as_executable_p="test -f"
3732 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3733 for as_dir in $PATH
3734 do
3735   IFS=$as_save_IFS
3736   test -z "$as_dir" && as_dir=.
3737   for ac_prog in sed gsed; do
3738     for ac_exec_ext in '' $ac_executable_extensions; do
3739       if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
3740         _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
3741       fi
3742     done
3743   done
3744 done
3745
3746   # Create a temporary directory, and hook for its removal unless debugging.
3747 $debug ||
3748 {
3749   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
3750   trap '{ (exit 1); exit 1; }' 1 2 13 15
3751 }
3752
3753 # Create a (secure) tmp directory for tmp files.
3754 : ${TMPDIR=/tmp}
3755 {
3756   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
3757   test -n "$tmp" && test -d "$tmp"
3758 }  ||
3759 {
3760   tmp=$TMPDIR/sed$$-$RANDOM
3761   (umask 077 && mkdir $tmp)
3762 } ||
3763 {
3764    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
3765    { (exit 1); exit 1; }
3766 }
3767   _max=0
3768   _count=0
3769   # Add /usr/xpg4/bin/sed as it is typically found on Solaris
3770   # along with /bin/sed that truncates output.
3771   for _sed in $_sed_list /usr/xpg4/bin/sed; do
3772     test ! -f ${_sed} && break
3773     cat /dev/null > "$tmp/sed.in"
3774     _count=0
3775     echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
3776     # Check for GNU sed and select it if it is found.
3777     if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
3778       lt_cv_path_SED=${_sed}
3779       break
3780     fi
3781     while true; do
3782       cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
3783       mv "$tmp/sed.tmp" "$tmp/sed.in"
3784       cp "$tmp/sed.in" "$tmp/sed.nl"
3785       echo >>"$tmp/sed.nl"
3786       ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
3787       cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
3788       # 40000 chars as input seems more than enough
3789       test $_count -gt 10 && break
3790       _count=`expr $_count + 1`
3791       if test $_count -gt $_max; then
3792         _max=$_count
3793         lt_cv_path_SED=$_sed
3794       fi
3795     done
3796   done
3797   rm -rf "$tmp"
3798
3799 fi
3800
3801 if test "X$SED" != "X"; then
3802   lt_cv_path_SED=$SED
3803 else
3804   SED=$lt_cv_path_SED
3805 fi
3806 echo "$ac_t""$SED" 1>&6
3807
3808 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3809 echo "configure:3810: checking whether ln -s works" >&5
3810 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3811   echo $ac_n "(cached) $ac_c" 1>&6
3812 else
3813   rm -f conftestdata
3814 if ln -s X conftestdata 2>/dev/null
3815 then
3816   rm -f conftestdata
3817   ac_cv_prog_LN_S="ln -s"
3818 else
3819   ac_cv_prog_LN_S=ln
3820 fi
3821 fi
3822 LN_S="$ac_cv_prog_LN_S"
3823 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3824   echo "$ac_t""yes" 1>&6
3825 else
3826   echo "$ac_t""no" 1>&6
3827 fi
3828
3829 echo $ac_n "checking how to recognise dependent libraries""... $ac_c" 1>&6
3830 echo "configure:3831: checking how to recognise dependent libraries" >&5
3831 if eval "test \"\${lt_cv_deplibs_check_method+set}\" = set"; then
3832   echo $ac_n "(cached) $ac_c" 1>&6
3833 else
3834   lt_cv_file_magic_cmd='$MAGIC_CMD'
3835 lt_cv_file_magic_test_file=
3836 lt_cv_deplibs_check_method='unknown'
3837 # Need to set the preceding variable on all platforms that support
3838 # interlibrary dependencies.
3839 # 'none' -- dependencies not supported.
3840 # `unknown' -- same as none, but documents that we really don't know.
3841 # 'pass_all' -- all dependencies passed with no checks.
3842 # 'test_compile' -- check by making test program.
3843 # 'file_magic [[regex]]' -- check by looking for files in library path
3844 # which responds to the $file_magic_cmd with a given egrep regex.
3845 # If you have `file' or equivalent on your system and you're not sure
3846 # whether `pass_all' will *always* work, you probably want this one.
3847
3848 case $host_os in
3849 aix4* | aix5*)
3850   lt_cv_deplibs_check_method=pass_all
3851   ;;
3852
3853 beos*)
3854   lt_cv_deplibs_check_method=pass_all
3855   ;;
3856
3857 bsdi4*)
3858   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
3859   lt_cv_file_magic_cmd='/usr/bin/file -L'
3860   lt_cv_file_magic_test_file=/shlib/libc.so
3861   ;;
3862
3863 cygwin* | mingw* | pw32*)
3864   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3865   lt_cv_file_magic_cmd='$OBJDUMP -f'
3866   ;;
3867
3868 darwin* | rhapsody*)
3869   lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
3870   lt_cv_file_magic_cmd='/usr/bin/file -L'
3871   case "$host_os" in
3872   rhapsody* | darwin1.[012])
3873     lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
3874     ;;
3875   *) # Darwin 1.3 on
3876     lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
3877     ;;
3878   esac
3879   ;;
3880
3881 freebsd*)
3882   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3883     case $host_cpu in
3884     i*86 )
3885       # Not sure whether the presence of OpenBSD here was a mistake.
3886       # Let's accept both of them until this is cleared up.
3887       lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
3888       lt_cv_file_magic_cmd=/usr/bin/file
3889       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3890       ;;
3891     esac
3892   else
3893     lt_cv_deplibs_check_method=pass_all
3894   fi
3895   ;;
3896
3897 gnu*)
3898   lt_cv_deplibs_check_method=pass_all
3899   ;;
3900
3901 hpux10.20*|hpux11*)
3902   lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
3903   lt_cv_file_magic_cmd=/usr/bin/file
3904   lt_cv_file_magic_test_file=/usr/lib/libc.sl
3905   ;;
3906
3907 irix5* | irix6* | nonstopux*)
3908   case $host_os in
3909   irix5* | nonstopux*)
3910     # this will be overridden with pass_all, but let us keep it just in case
3911     lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
3912     ;;
3913   *)
3914     case $LD in
3915     *-32|*"-32 ") libmagic=32-bit;;
3916     *-n32|*"-n32 ") libmagic=N32;;
3917     *-64|*"-64 ") libmagic=64-bit;;
3918     *) libmagic=never-match;;
3919     esac
3920     # this will be overridden with pass_all, but let us keep it just in case
3921     lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
3922     ;;
3923   esac
3924   lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
3925   lt_cv_deplibs_check_method=pass_all
3926   ;;
3927
3928 # This must be Linux ELF.
3929 linux-gnu*)
3930   case $host_cpu in
3931   alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64*)
3932     lt_cv_deplibs_check_method=pass_all ;;
3933   *)
3934     # glibc up to 2.1.1 does not perform some relocations on ARM
3935     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
3936   esac
3937   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
3938   ;;
3939
3940 netbsd*)
3941   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3942     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
3943   else
3944     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
3945   fi
3946   ;;
3947
3948 newos6*)
3949   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
3950   lt_cv_file_magic_cmd=/usr/bin/file
3951   lt_cv_file_magic_test_file=/usr/lib/libnls.so
3952   ;;
3953
3954 openbsd*)
3955   lt_cv_file_magic_cmd=/usr/bin/file
3956   lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3957   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3958     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
3959   else
3960     lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
3961   fi
3962   ;;
3963
3964 osf3* | osf4* | osf5*)
3965   # this will be overridden with pass_all, but let us keep it just in case
3966   lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
3967   lt_cv_file_magic_test_file=/shlib/libc.so
3968   lt_cv_deplibs_check_method=pass_all
3969   ;;
3970
3971 sco3.2v5*)
3972   lt_cv_deplibs_check_method=pass_all
3973   ;;
3974
3975 solaris*)
3976   lt_cv_deplibs_check_method=pass_all
3977   lt_cv_file_magic_test_file=/lib/libc.so
3978   ;;
3979
3980 sysv5uw[78]* | sysv4*uw2*)
3981   lt_cv_deplibs_check_method=pass_all
3982   ;;
3983
3984 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
3985   case $host_vendor in
3986   motorola)
3987     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]'
3988     lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3989     ;;
3990   ncr)
3991     lt_cv_deplibs_check_method=pass_all
3992     ;;
3993   sequent)
3994     lt_cv_file_magic_cmd='/bin/file'
3995     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
3996     ;;
3997   sni)
3998     lt_cv_file_magic_cmd='/bin/file'
3999     lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
4000     lt_cv_file_magic_test_file=/lib/libc.so
4001     ;;
4002   siemens)
4003     lt_cv_deplibs_check_method=pass_all
4004     ;;
4005   esac
4006   ;;
4007 esac
4008
4009 fi
4010
4011 echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6
4012 file_magic_cmd=$lt_cv_file_magic_cmd
4013 deplibs_check_method=$lt_cv_deplibs_check_method
4014
4015 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
4016 echo "configure:4017: checking for object suffix" >&5
4017 if eval "test \"\${ac_cv_objext+set}\" = set"; then
4018   echo $ac_n "(cached) $ac_c" 1>&6
4019 else
4020   rm -f conftest*
4021 echo 'int i = 1;' > conftest.$ac_ext
4022 if { (eval echo configure:4023: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4023   for ac_file in conftest.*; do
4024     case $ac_file in
4025     *.c) ;;
4026     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
4027     esac
4028   done
4029 else
4030   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
4031 fi
4032 rm -f conftest*
4033 fi
4034
4035 echo "$ac_t""$ac_cv_objext" 1>&6
4036 OBJEXT=$ac_cv_objext
4037 ac_objext=$ac_cv_objext
4038
4039
4040
4041
4042 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
4043 echo "configure:4044: checking for executable suffix" >&5
4044 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
4045   echo $ac_n "(cached) $ac_c" 1>&6
4046 else
4047   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
4048   ac_cv_exeext=.exe
4049 else
4050   rm -f conftest*
4051   echo 'int main () { return 0; }' > conftest.$ac_ext
4052   ac_cv_exeext=
4053   if { (eval echo configure:4054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
4054     for file in conftest.*; do
4055       case $file in
4056       *.c | *.C | *.o | *.obj | *.xcoff) ;;
4057       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
4058       esac
4059     done
4060   else
4061     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
4062   fi
4063   rm -f conftest*
4064   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
4065 fi
4066 fi
4067
4068 EXEEXT=""
4069 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
4070 echo "$ac_t""${ac_cv_exeext}" 1>&6
4071 ac_exeext=$EXEEXT
4072
4073 if test $host != $build; then
4074   ac_tool_prefix=${host_alias}-
4075 else
4076   ac_tool_prefix=
4077 fi
4078
4079
4080
4081
4082 # Check for command to grab the raw symbol name followed by C symbol from nm.
4083 echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
4084 echo "configure:4085: checking command to parse $NM output" >&5
4085 if eval "test \"\${lt_cv_sys_global_symbol_pipe+set}\" = set"; then
4086   echo $ac_n "(cached) $ac_c" 1>&6
4087 else
4088   
4089 # These are sane defaults that work on at least a few old systems.
4090 # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4091
4092 # Character class describing NM global symbol codes.
4093 symcode='[BCDEGRST]'
4094
4095 # Regexp to match symbols that can be accessed directly from C.
4096 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
4097
4098 # Transform the above into a raw symbol and a C symbol.
4099 symxfrm='\1 \2\3 \3'
4100
4101 # Transform an extracted symbol line into a proper C declaration
4102 lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
4103
4104 # Transform an extracted symbol line into symbol name and symbol address
4105 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'"
4106
4107 # Define system-specific variables.
4108 case $host_os in
4109 aix*)
4110   symcode='[BCDT]'
4111   ;;
4112 cygwin* | mingw* | pw32*)
4113   symcode='[ABCDGISTW]'
4114   ;;
4115 hpux*) # Its linker distinguishes data from code symbols
4116   lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4117   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'"
4118   ;;
4119 irix* | nonstopux*)
4120   symcode='[BCDEGRST]'
4121   ;;
4122 osf*)
4123   symcode='[BCDEGQRST]'
4124   ;;
4125 solaris* | sysv5*)
4126   symcode='[BDT]'
4127   ;;
4128 sysv4)
4129   symcode='[DFNSTU]'
4130   ;;
4131 esac
4132
4133 # Handle CRLF in mingw tool chain
4134 opt_cr=
4135 case $host_os in
4136 mingw*)
4137   opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4138   ;;
4139 esac
4140
4141 # If we're using GNU nm, then use its standard symbol codes.
4142 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
4143   symcode='[ABCDGISTW]'
4144 fi
4145
4146 # Try without a prefix undercore, then with it.
4147 for ac_symprfx in "" "_"; do
4148
4149   # Write the raw and C identifiers.
4150 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[         ]\($symcode$symcode*\)[         ][      ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
4151
4152   # Check to see that the pipe works correctly.
4153   pipe_works=no
4154   rm -f conftest*
4155   cat > conftest.$ac_ext <<EOF
4156 #ifdef __cplusplus
4157 extern "C" {
4158 #endif
4159 char nm_test_var;
4160 void nm_test_func(){}
4161 #ifdef __cplusplus
4162 }
4163 #endif
4164 int main(){nm_test_var='a';nm_test_func();return(0);}
4165 EOF
4166
4167   if { (eval echo configure:4168: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4168     # Now try to grab the symbols.
4169     nlist=conftest.nm
4170     if { (eval echo configure:4171: \"$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
4171       # Try sorting and uniquifying the output.
4172       if sort "$nlist" | uniq > "$nlist"T; then
4173         mv -f "$nlist"T "$nlist"
4174       else
4175         rm -f "$nlist"T
4176       fi
4177
4178       # Make sure that we snagged all the symbols we need.
4179       if egrep ' nm_test_var$' "$nlist" >/dev/null; then
4180         if egrep ' nm_test_func$' "$nlist" >/dev/null; then
4181           cat <<EOF > conftest.$ac_ext
4182 #ifdef __cplusplus
4183 extern "C" {
4184 #endif
4185
4186 EOF
4187           # Now generate the symbol file.
4188           eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
4189
4190           cat <<EOF >> conftest.$ac_ext
4191 #if defined (__STDC__) && __STDC__
4192 # define lt_ptr void *
4193 #else
4194 # define lt_ptr char *
4195 # define const
4196 #endif
4197
4198 /* The mapping between symbol names and symbols. */
4199 const struct {
4200   const char *name;
4201   lt_ptr address;
4202 }
4203 lt_preloaded_symbols[] =
4204 {
4205 EOF
4206           sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
4207           cat <<\EOF >> conftest.$ac_ext
4208   {0, (lt_ptr) 0}
4209 };
4210
4211 #ifdef __cplusplus
4212 }
4213 #endif
4214 EOF
4215           # Now try linking the two files.
4216           mv conftest.$ac_objext conftstm.$ac_objext
4217           save_LIBS="$LIBS"
4218           save_CFLAGS="$CFLAGS"
4219           LIBS="conftstm.$ac_objext"
4220           CFLAGS="$CFLAGS$no_builtin_flag"
4221           if { (eval echo configure:4222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest$ac_exeext; then
4222             pipe_works=yes
4223           fi
4224           LIBS="$save_LIBS"
4225           CFLAGS="$save_CFLAGS"
4226         else
4227           echo "cannot find nm_test_func in $nlist" >&5
4228         fi
4229       else
4230         echo "cannot find nm_test_var in $nlist" >&5
4231       fi
4232     else
4233       echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
4234     fi
4235   else
4236     echo "$progname: failed program was:" >&5
4237     cat conftest.$ac_ext >&5
4238   fi
4239   rm -f conftest* conftst*
4240
4241   # Do not use the global_symbol_pipe unless it works.
4242   if test "$pipe_works" = yes; then
4243     break
4244   else
4245     lt_cv_sys_global_symbol_pipe=
4246   fi
4247 done
4248
4249 fi
4250
4251 global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
4252 if test -z "$lt_cv_sys_global_symbol_pipe"; then
4253   global_symbol_to_cdecl=
4254   global_symbol_to_c_name_address=
4255 else
4256   global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
4257   global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
4258 fi
4259 if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
4260 then
4261   echo "$ac_t""failed" 1>&6
4262 else
4263   echo "$ac_t""ok" 1>&6
4264 fi
4265
4266 for ac_hdr in dlfcn.h
4267 do
4268 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4269 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4270 echo "configure:4271: checking for $ac_hdr" >&5
4271 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4272   echo $ac_n "(cached) $ac_c" 1>&6
4273 else
4274   cat > conftest.$ac_ext <<EOF
4275 #line 4276 "configure"
4276 #include "confdefs.h"
4277 #include <$ac_hdr>
4278 EOF
4279 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4280 { (eval echo configure:4281: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4281 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4282 if test -z "$ac_err"; then
4283   rm -rf conftest*
4284   eval "ac_cv_header_$ac_safe=yes"
4285 else
4286   echo "$ac_err" >&5
4287   echo "configure: failed program was:" >&5
4288   cat conftest.$ac_ext >&5
4289   rm -rf conftest*
4290   eval "ac_cv_header_$ac_safe=no"
4291 fi
4292 rm -f conftest*
4293 fi
4294 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4295   echo "$ac_t""yes" 1>&6
4296     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4297   cat >> confdefs.h <<EOF
4298 #define $ac_tr_hdr 1
4299 EOF
4300  
4301 else
4302   echo "$ac_t""no" 1>&6
4303 fi
4304 done
4305
4306
4307
4308
4309
4310
4311 # Only perform the check for file, if the check method requires it
4312 case $deplibs_check_method in
4313 file_magic*)
4314   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
4315     echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
4316 echo "configure:4317: checking for ${ac_tool_prefix}file" >&5
4317 if eval "test \"\${lt_cv_path_MAGIC_CMD+set}\" = set"; then
4318   echo $ac_n "(cached) $ac_c" 1>&6
4319 else
4320   case $MAGIC_CMD in
4321   /*)
4322   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4323   ;;
4324   ?:/*)
4325   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
4326   ;;
4327   *)
4328   ac_save_MAGIC_CMD="$MAGIC_CMD"
4329   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4330   ac_dummy="/usr/bin:$PATH"
4331   for ac_dir in $ac_dummy; do
4332     test -z "$ac_dir" && ac_dir=.
4333     if test -f $ac_dir/${ac_tool_prefix}file; then
4334       lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
4335       if test -n "$file_magic_test_file"; then
4336         case $deplibs_check_method in
4337         "file_magic "*)
4338           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
4339           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4340           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4341             egrep "$file_magic_regex" > /dev/null; then
4342             :
4343           else
4344             cat <<EOF 1>&2
4345
4346 *** Warning: the command libtool uses to detect shared libraries,
4347 *** $file_magic_cmd, produces output that libtool cannot recognize.
4348 *** The result is that libtool may fail to recognize shared libraries
4349 *** as such.  This will affect the creation of libtool libraries that
4350 *** depend on shared libraries, but programs linked with such libtool
4351 *** libraries will work regardless of this problem.  Nevertheless, you
4352 *** may want to report the problem to your system manager and/or to
4353 *** bug-libtool@gnu.org
4354
4355 EOF
4356           fi ;;
4357         esac
4358       fi
4359       break
4360     fi
4361   done
4362   IFS="$ac_save_ifs"
4363   MAGIC_CMD="$ac_save_MAGIC_CMD"
4364   ;;
4365 esac
4366 fi
4367
4368 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4369 if test -n "$MAGIC_CMD"; then
4370   echo "$ac_t""$MAGIC_CMD" 1>&6
4371 else
4372   echo "$ac_t""no" 1>&6
4373 fi
4374
4375 if test -z "$lt_cv_path_MAGIC_CMD"; then
4376   if test -n "$ac_tool_prefix"; then
4377     echo $ac_n "checking for file""... $ac_c" 1>&6
4378 echo "configure:4379: checking for file" >&5
4379 if eval "test \"\${lt_cv_path_MAGIC_CMD+set}\" = set"; then
4380   echo $ac_n "(cached) $ac_c" 1>&6
4381 else
4382   case $MAGIC_CMD in
4383   /*)
4384   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4385   ;;
4386   ?:/*)
4387   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
4388   ;;
4389   *)
4390   ac_save_MAGIC_CMD="$MAGIC_CMD"
4391   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4392   ac_dummy="/usr/bin:$PATH"
4393   for ac_dir in $ac_dummy; do
4394     test -z "$ac_dir" && ac_dir=.
4395     if test -f $ac_dir/file; then
4396       lt_cv_path_MAGIC_CMD="$ac_dir/file"
4397       if test -n "$file_magic_test_file"; then
4398         case $deplibs_check_method in
4399         "file_magic "*)
4400           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
4401           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4402           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4403             egrep "$file_magic_regex" > /dev/null; then
4404             :
4405           else
4406             cat <<EOF 1>&2
4407
4408 *** Warning: the command libtool uses to detect shared libraries,
4409 *** $file_magic_cmd, produces output that libtool cannot recognize.
4410 *** The result is that libtool may fail to recognize shared libraries
4411 *** as such.  This will affect the creation of libtool libraries that
4412 *** depend on shared libraries, but programs linked with such libtool
4413 *** libraries will work regardless of this problem.  Nevertheless, you
4414 *** may want to report the problem to your system manager and/or to
4415 *** bug-libtool@gnu.org
4416
4417 EOF
4418           fi ;;
4419         esac
4420       fi
4421       break
4422     fi
4423   done
4424   IFS="$ac_save_ifs"
4425   MAGIC_CMD="$ac_save_MAGIC_CMD"
4426   ;;
4427 esac
4428 fi
4429
4430 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4431 if test -n "$MAGIC_CMD"; then
4432   echo "$ac_t""$MAGIC_CMD" 1>&6
4433 else
4434   echo "$ac_t""no" 1>&6
4435 fi
4436
4437   else
4438     MAGIC_CMD=:
4439   fi
4440 fi
4441
4442   fi
4443   ;;
4444 esac
4445
4446 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
4447 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
4448 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4449 echo "configure:4450: checking for $ac_word" >&5
4450 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
4451   echo $ac_n "(cached) $ac_c" 1>&6
4452 else
4453   if test -n "$RANLIB"; then
4454   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
4455 else
4456   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4457   ac_dummy="$PATH"
4458   for ac_dir in $ac_dummy; do
4459     test -z "$ac_dir" && ac_dir=.
4460     if test -f $ac_dir/$ac_word; then
4461       ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
4462       break
4463     fi
4464   done
4465   IFS="$ac_save_ifs"
4466 fi
4467 fi
4468 RANLIB="$ac_cv_prog_RANLIB"
4469 if test -n "$RANLIB"; then
4470   echo "$ac_t""$RANLIB" 1>&6
4471 else
4472   echo "$ac_t""no" 1>&6
4473 fi
4474
4475
4476 if test -z "$ac_cv_prog_RANLIB"; then
4477 if test -n "$ac_tool_prefix"; then
4478   # Extract the first word of "ranlib", so it can be a program name with args.
4479 set dummy ranlib; ac_word=$2
4480 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4481 echo "configure:4482: checking for $ac_word" >&5
4482 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
4483   echo $ac_n "(cached) $ac_c" 1>&6
4484 else
4485   if test -n "$RANLIB"; then
4486   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
4487 else
4488   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4489   ac_dummy="$PATH"
4490   for ac_dir in $ac_dummy; do
4491     test -z "$ac_dir" && ac_dir=.
4492     if test -f $ac_dir/$ac_word; then
4493       ac_cv_prog_RANLIB="ranlib"
4494       break
4495     fi
4496   done
4497   IFS="$ac_save_ifs"
4498   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
4499 fi
4500 fi
4501 RANLIB="$ac_cv_prog_RANLIB"
4502 if test -n "$RANLIB"; then
4503   echo "$ac_t""$RANLIB" 1>&6
4504 else
4505   echo "$ac_t""no" 1>&6
4506 fi
4507
4508 else
4509   RANLIB=":"
4510 fi
4511 fi
4512
4513 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
4514 set dummy ${ac_tool_prefix}strip; ac_word=$2
4515 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4516 echo "configure:4517: checking for $ac_word" >&5
4517 if eval "test \"\${ac_cv_prog_STRIP+set}\" = set"; then
4518   echo $ac_n "(cached) $ac_c" 1>&6
4519 else
4520   if test -n "$STRIP"; then
4521   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
4522 else
4523   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4524   ac_dummy="$PATH"
4525   for ac_dir in $ac_dummy; do
4526     test -z "$ac_dir" && ac_dir=.
4527     if test -f $ac_dir/$ac_word; then
4528       ac_cv_prog_STRIP="${ac_tool_prefix}strip"
4529       break
4530     fi
4531   done
4532   IFS="$ac_save_ifs"
4533 fi
4534 fi
4535 STRIP="$ac_cv_prog_STRIP"
4536 if test -n "$STRIP"; then
4537   echo "$ac_t""$STRIP" 1>&6
4538 else
4539   echo "$ac_t""no" 1>&6
4540 fi
4541
4542
4543 if test -z "$ac_cv_prog_STRIP"; then
4544 if test -n "$ac_tool_prefix"; then
4545   # Extract the first word of "strip", so it can be a program name with args.
4546 set dummy strip; ac_word=$2
4547 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4548 echo "configure:4549: checking for $ac_word" >&5
4549 if eval "test \"\${ac_cv_prog_STRIP+set}\" = set"; then
4550   echo $ac_n "(cached) $ac_c" 1>&6
4551 else
4552   if test -n "$STRIP"; then
4553   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
4554 else
4555   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4556   ac_dummy="$PATH"
4557   for ac_dir in $ac_dummy; do
4558     test -z "$ac_dir" && ac_dir=.
4559     if test -f $ac_dir/$ac_word; then
4560       ac_cv_prog_STRIP="strip"
4561       break
4562     fi
4563   done
4564   IFS="$ac_save_ifs"
4565   test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
4566 fi
4567 fi
4568 STRIP="$ac_cv_prog_STRIP"
4569 if test -n "$STRIP"; then
4570   echo "$ac_t""$STRIP" 1>&6
4571 else
4572   echo "$ac_t""no" 1>&6
4573 fi
4574
4575 else
4576   STRIP=":"
4577 fi
4578 fi
4579
4580
4581 enable_dlopen=yes
4582 enable_win32_dll=yes
4583
4584 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
4585 if test "${enable_libtool_lock+set}" = set; then
4586   enableval="$enable_libtool_lock"
4587   :
4588 fi
4589
4590 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
4591
4592 # Some flags need to be propagated to the compiler or linker for good
4593 # libtool support.
4594 case $host in
4595 *-*-irix6*)
4596   # Find out which ABI we are using.
4597   echo '#line 4598 "configure"' > conftest.$ac_ext
4598   if { (eval echo configure:4599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4599     case `/usr/bin/file conftest.$ac_objext` in
4600     *32-bit*)
4601       LD="${LD-ld} -32"
4602       ;;
4603     *N32*)
4604       LD="${LD-ld} -n32"
4605       ;;
4606     *64-bit*)
4607       LD="${LD-ld} -64"
4608       ;;
4609     esac
4610   fi
4611   rm -rf conftest*
4612   ;;
4613
4614 *-*-sco3.2v5*)
4615   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
4616   SAVE_CFLAGS="$CFLAGS"
4617   CFLAGS="$CFLAGS -belf"
4618   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
4619 echo "configure:4620: checking whether the C compiler needs -belf" >&5
4620 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
4621   echo $ac_n "(cached) $ac_c" 1>&6
4622 else
4623   
4624      ac_ext=c
4625 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
4626 ac_cpp='$CPP $CPPFLAGS'
4627 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
4628 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
4629 cross_compiling=$ac_cv_prog_cc_cross
4630
4631      cat > conftest.$ac_ext <<EOF
4632 #line 4633 "configure"
4633 #include "confdefs.h"
4634
4635 int main() {
4636
4637 ; return 0; }
4638 EOF
4639 if { (eval echo configure:4640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4640   rm -rf conftest*
4641   lt_cv_cc_needs_belf=yes
4642 else
4643   echo "configure: failed program was:" >&5
4644   cat conftest.$ac_ext >&5
4645   rm -rf conftest*
4646   lt_cv_cc_needs_belf=no
4647 fi
4648 rm -f conftest*
4649      ac_ext=c
4650 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
4651 ac_cpp='$CPP $CPPFLAGS'
4652 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
4653 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
4654 cross_compiling=$ac_cv_prog_cc_cross
4655
4656 fi
4657
4658 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
4659   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
4660     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
4661     CFLAGS="$SAVE_CFLAGS"
4662   fi
4663   ;;
4664
4665 *-*-cygwin* | *-*-mingw* | *-*-pw32*)
4666   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
4667 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
4668 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4669 echo "configure:4670: checking for $ac_word" >&5
4670 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
4671   echo $ac_n "(cached) $ac_c" 1>&6
4672 else
4673   if test -n "$DLLTOOL"; then
4674   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
4675 else
4676   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4677   ac_dummy="$PATH"
4678   for ac_dir in $ac_dummy; do
4679     test -z "$ac_dir" && ac_dir=.
4680     if test -f $ac_dir/$ac_word; then
4681       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
4682       break
4683     fi
4684   done
4685   IFS="$ac_save_ifs"
4686 fi
4687 fi
4688 DLLTOOL="$ac_cv_prog_DLLTOOL"
4689 if test -n "$DLLTOOL"; then
4690   echo "$ac_t""$DLLTOOL" 1>&6
4691 else
4692   echo "$ac_t""no" 1>&6
4693 fi
4694
4695
4696 if test -z "$ac_cv_prog_DLLTOOL"; then
4697 if test -n "$ac_tool_prefix"; then
4698   # Extract the first word of "dlltool", so it can be a program name with args.
4699 set dummy dlltool; ac_word=$2
4700 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4701 echo "configure:4702: checking for $ac_word" >&5
4702 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
4703   echo $ac_n "(cached) $ac_c" 1>&6
4704 else
4705   if test -n "$DLLTOOL"; then
4706   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
4707 else
4708   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4709   ac_dummy="$PATH"
4710   for ac_dir in $ac_dummy; do
4711     test -z "$ac_dir" && ac_dir=.
4712     if test -f $ac_dir/$ac_word; then
4713       ac_cv_prog_DLLTOOL="dlltool"
4714       break
4715     fi
4716   done
4717   IFS="$ac_save_ifs"
4718   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
4719 fi
4720 fi
4721 DLLTOOL="$ac_cv_prog_DLLTOOL"
4722 if test -n "$DLLTOOL"; then
4723   echo "$ac_t""$DLLTOOL" 1>&6
4724 else
4725   echo "$ac_t""no" 1>&6
4726 fi
4727
4728 else
4729   DLLTOOL="false"
4730 fi
4731 fi
4732
4733   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
4734 set dummy ${ac_tool_prefix}as; ac_word=$2
4735 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4736 echo "configure:4737: checking for $ac_word" >&5
4737 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
4738   echo $ac_n "(cached) $ac_c" 1>&6
4739 else
4740   if test -n "$AS"; then
4741   ac_cv_prog_AS="$AS" # Let the user override the test.
4742 else
4743   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4744   ac_dummy="$PATH"
4745   for ac_dir in $ac_dummy; do
4746     test -z "$ac_dir" && ac_dir=.
4747     if test -f $ac_dir/$ac_word; then
4748       ac_cv_prog_AS="${ac_tool_prefix}as"
4749       break
4750     fi
4751   done
4752   IFS="$ac_save_ifs"
4753 fi
4754 fi
4755 AS="$ac_cv_prog_AS"
4756 if test -n "$AS"; then
4757   echo "$ac_t""$AS" 1>&6
4758 else
4759   echo "$ac_t""no" 1>&6
4760 fi
4761
4762
4763 if test -z "$ac_cv_prog_AS"; then
4764 if test -n "$ac_tool_prefix"; then
4765   # Extract the first word of "as", so it can be a program name with args.
4766 set dummy as; ac_word=$2
4767 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4768 echo "configure:4769: checking for $ac_word" >&5
4769 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
4770   echo $ac_n "(cached) $ac_c" 1>&6
4771 else
4772   if test -n "$AS"; then
4773   ac_cv_prog_AS="$AS" # Let the user override the test.
4774 else
4775   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4776   ac_dummy="$PATH"
4777   for ac_dir in $ac_dummy; do
4778     test -z "$ac_dir" && ac_dir=.
4779     if test -f $ac_dir/$ac_word; then
4780       ac_cv_prog_AS="as"
4781       break
4782     fi
4783   done
4784   IFS="$ac_save_ifs"
4785   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
4786 fi
4787 fi
4788 AS="$ac_cv_prog_AS"
4789 if test -n "$AS"; then
4790   echo "$ac_t""$AS" 1>&6
4791 else
4792   echo "$ac_t""no" 1>&6
4793 fi
4794
4795 else
4796   AS="false"
4797 fi
4798 fi
4799
4800   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
4801 set dummy ${ac_tool_prefix}objdump; ac_word=$2
4802 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4803 echo "configure:4804: checking for $ac_word" >&5
4804 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
4805   echo $ac_n "(cached) $ac_c" 1>&6
4806 else
4807   if test -n "$OBJDUMP"; then
4808   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
4809 else
4810   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4811   ac_dummy="$PATH"
4812   for ac_dir in $ac_dummy; do
4813     test -z "$ac_dir" && ac_dir=.
4814     if test -f $ac_dir/$ac_word; then
4815       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
4816       break
4817     fi
4818   done
4819   IFS="$ac_save_ifs"
4820 fi
4821 fi
4822 OBJDUMP="$ac_cv_prog_OBJDUMP"
4823 if test -n "$OBJDUMP"; then
4824   echo "$ac_t""$OBJDUMP" 1>&6
4825 else
4826   echo "$ac_t""no" 1>&6
4827 fi
4828
4829
4830 if test -z "$ac_cv_prog_OBJDUMP"; then
4831 if test -n "$ac_tool_prefix"; then
4832   # Extract the first word of "objdump", so it can be a program name with args.
4833 set dummy objdump; ac_word=$2
4834 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4835 echo "configure:4836: checking for $ac_word" >&5
4836 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
4837   echo $ac_n "(cached) $ac_c" 1>&6
4838 else
4839   if test -n "$OBJDUMP"; then
4840   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
4841 else
4842   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4843   ac_dummy="$PATH"
4844   for ac_dir in $ac_dummy; do
4845     test -z "$ac_dir" && ac_dir=.
4846     if test -f $ac_dir/$ac_word; then
4847       ac_cv_prog_OBJDUMP="objdump"
4848       break
4849     fi
4850   done
4851   IFS="$ac_save_ifs"
4852   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
4853 fi
4854 fi
4855 OBJDUMP="$ac_cv_prog_OBJDUMP"
4856 if test -n "$OBJDUMP"; then
4857   echo "$ac_t""$OBJDUMP" 1>&6
4858 else
4859   echo "$ac_t""no" 1>&6
4860 fi
4861
4862 else
4863   OBJDUMP="false"
4864 fi
4865 fi
4866
4867
4868   # recent cygwin and mingw systems supply a stub DllMain which the user
4869   # can override, but on older systems we have to supply one
4870   echo $ac_n "checking if libtool should supply DllMain function""... $ac_c" 1>&6
4871 echo "configure:4872: checking if libtool should supply DllMain function" >&5
4872 if eval "test \"\${lt_cv_need_dllmain+set}\" = set"; then
4873   echo $ac_n "(cached) $ac_c" 1>&6
4874 else
4875   cat > conftest.$ac_ext <<EOF
4876 #line 4877 "configure"
4877 #include "confdefs.h"
4878
4879 int main() {
4880 extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
4881       DllMain (0, 0, 0);
4882 ; return 0; }
4883 EOF
4884 if { (eval echo configure:4885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4885   rm -rf conftest*
4886   lt_cv_need_dllmain=no
4887 else
4888   echo "configure: failed program was:" >&5
4889   cat conftest.$ac_ext >&5
4890   rm -rf conftest*
4891   lt_cv_need_dllmain=yes
4892 fi
4893 rm -f conftest*
4894 fi
4895
4896 echo "$ac_t""$lt_cv_need_dllmain" 1>&6
4897
4898   case $host/$CC in
4899   *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
4900     # old mingw systems require "-dll" to link a DLL, while more recent ones
4901     # require "-mdll"
4902     SAVE_CFLAGS="$CFLAGS"
4903     CFLAGS="$CFLAGS -mdll"
4904     echo $ac_n "checking how to link DLLs""... $ac_c" 1>&6
4905 echo "configure:4906: checking how to link DLLs" >&5
4906 if eval "test \"\${lt_cv_cc_dll_switch+set}\" = set"; then
4907   echo $ac_n "(cached) $ac_c" 1>&6
4908 else
4909   cat > conftest.$ac_ext <<EOF
4910 #line 4911 "configure"
4911 #include "confdefs.h"
4912
4913 int main() {
4914
4915 ; return 0; }
4916 EOF
4917 if { (eval echo configure:4918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4918   rm -rf conftest*
4919   lt_cv_cc_dll_switch=-mdll
4920 else
4921   echo "configure: failed program was:" >&5
4922   cat conftest.$ac_ext >&5
4923   rm -rf conftest*
4924   lt_cv_cc_dll_switch=-dll
4925 fi
4926 rm -f conftest*
4927 fi
4928
4929 echo "$ac_t""$lt_cv_cc_dll_switch" 1>&6
4930     CFLAGS="$SAVE_CFLAGS" ;;
4931   *-*-cygwin* | *-*-pw32*)
4932     # cygwin systems need to pass --dll to the linker, and not link
4933     # crt.o which will require a WinMain@16 definition.
4934     lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
4935   esac
4936   ;;
4937   
4938 esac
4939
4940 # Sed substitution that helps us do robust quoting.  It backslashifies
4941 # metacharacters that are still active within double-quoted strings.
4942 Xsed='sed -e s/^X//'
4943 sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
4944
4945 # Same as above, but do not quote variable references.
4946 double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
4947
4948 # Sed substitution to delay expansion of an escaped shell variable in a
4949 # double_quote_subst'ed string.
4950 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
4951
4952 # Constants:
4953 rm="rm -f"
4954
4955 # Global variables:
4956 default_ofile=libtool
4957 can_build_shared=yes
4958
4959 # All known linkers require a `.a' archive for static linking (except M$VC,
4960 # which needs '.lib').
4961 libext=a
4962 ltmain="$ac_aux_dir/ltmain.sh"
4963 ofile="$default_ofile"
4964 with_gnu_ld="$lt_cv_prog_gnu_ld"
4965 need_locks="$enable_libtool_lock"
4966
4967 old_CC="$CC"
4968 old_CFLAGS="$CFLAGS"
4969
4970 # Set sane defaults for various variables
4971 test -z "$AR" && AR=ar
4972 test -z "$AR_FLAGS" && AR_FLAGS=cru
4973 test -z "$AS" && AS=as
4974 test -z "$CC" && CC=cc
4975 test -z "$DLLTOOL" && DLLTOOL=dlltool
4976 test -z "$LD" && LD=ld
4977 test -z "$LN_S" && LN_S="ln -s"
4978 test -z "$MAGIC_CMD" && MAGIC_CMD=file
4979 test -z "$NM" && NM=nm
4980 test -z "$OBJDUMP" && OBJDUMP=objdump
4981 test -z "$RANLIB" && RANLIB=:
4982 test -z "$STRIP" && STRIP=:
4983 test -z "$ac_objext" && ac_objext=o
4984
4985 if test x"$host" != x"$build"; then
4986   ac_tool_prefix=${host_alias}-
4987 else
4988   ac_tool_prefix=
4989 fi
4990
4991 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
4992 case $host_os in
4993 linux-gnu*) ;;
4994 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
4995 esac
4996
4997 case $host_os in
4998 aix3*)
4999   # AIX sometimes has problems with the GCC collect2 program.  For some
5000   # reason, if we set the COLLECT_NAMES environment variable, the problems
5001   # vanish in a puff of smoke.
5002   if test "X${COLLECT_NAMES+set}" != Xset; then
5003     COLLECT_NAMES=
5004     export COLLECT_NAMES
5005   fi
5006   ;;
5007 esac
5008
5009 # Determine commands to create old-style static archives.
5010 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
5011 old_postinstall_cmds='chmod 644 $oldlib'
5012 old_postuninstall_cmds=
5013
5014 if test -n "$RANLIB"; then
5015   case $host_os in
5016   openbsd*)
5017     old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
5018     ;;
5019   *)
5020     old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
5021     ;;
5022   esac
5023   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
5024 fi
5025
5026 # Allow CC to be a program name with arguments.
5027 set dummy $CC
5028 compiler="$2"
5029
5030 echo $ac_n "checking for objdir""... $ac_c" 1>&6
5031 echo "configure:5032: checking for objdir" >&5
5032 rm -f .libs 2>/dev/null
5033 mkdir .libs 2>/dev/null
5034 if test -d .libs; then
5035   objdir=.libs
5036 else
5037   # MS-DOS does not allow filenames that begin with a dot.
5038   objdir=_libs
5039 fi
5040 rmdir .libs 2>/dev/null
5041 echo "$ac_t""$objdir" 1>&6
5042
5043
5044 # Check whether --with-pic or --without-pic was given.
5045 if test "${with_pic+set}" = set; then
5046   withval="$with_pic"
5047   pic_mode="$withval"
5048 else
5049   pic_mode=default
5050 fi
5051
5052 test -z "$pic_mode" && pic_mode=default
5053
5054 # We assume here that the value for lt_cv_prog_cc_pic will not be cached
5055 # in isolation, and that seeing it set (from the cache) indicates that
5056 # the associated values are set (in the cache) correctly too.
5057 echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6
5058 echo "configure:5059: checking for $compiler option to produce PIC" >&5
5059 if eval "test \"\${lt_cv_prog_cc_pic+set}\" = set"; then
5060   echo $ac_n "(cached) $ac_c" 1>&6
5061 else
5062    lt_cv_prog_cc_pic=
5063   lt_cv_prog_cc_shlib=
5064   lt_cv_prog_cc_wl=
5065   lt_cv_prog_cc_static=
5066   lt_cv_prog_cc_no_builtin=
5067   lt_cv_prog_cc_can_build_shared=$can_build_shared
5068
5069   if test "$GCC" = yes; then
5070     lt_cv_prog_cc_wl='-Wl,'
5071     lt_cv_prog_cc_static='-static'
5072
5073     case $host_os in
5074     aix*)
5075       # Below there is a dirty hack to force normal static linking with -ldl
5076       # The problem is because libdl dynamically linked with both libc and
5077       # libC (AIX C++ library), which obviously doesn't included in libraries
5078       # list by gcc. This cause undefined symbols with -static flags.
5079       # This hack allows C programs to be linked with "-static -ldl", but
5080       # not sure about C++ programs.
5081       lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
5082       ;;
5083     amigaos*)
5084       # FIXME: we need at least 68020 code to build shared libraries, but
5085       # adding the `-m68020' flag to GCC prevents building anything better,
5086       # like `-m68040'.
5087       lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
5088       ;;
5089     beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5090       # PIC is the default for these OSes.
5091       ;;
5092     darwin* | rhapsody*)
5093       # PIC is the default on this platform
5094       # Common symbols not allowed in MH_DYLIB files
5095       lt_cv_prog_cc_pic='-fno-common'
5096       ;;
5097     cygwin* | mingw* | pw32* | os2*)
5098       # This hack is so that the source file can tell whether it is being
5099       # built for inclusion in a dll (and should export symbols for example).
5100       lt_cv_prog_cc_pic='-DDLL_EXPORT'
5101       ;;
5102     sysv4*MP*)
5103       if test -d /usr/nec; then
5104          lt_cv_prog_cc_pic=-Kconform_pic
5105       fi
5106       ;;
5107     *)
5108       lt_cv_prog_cc_pic='-fPIC'
5109       ;;
5110     esac
5111   else
5112     # PORTME Check for PIC flags for the system compiler.
5113     case $host_os in
5114     aix3* | aix4* | aix5*)
5115       lt_cv_prog_cc_wl='-Wl,'
5116       # All AIX code is PIC.
5117       if test "$host_cpu" = ia64; then
5118         # AIX 5 now supports IA64 processor
5119         lt_cv_prog_cc_static='-Bstatic'
5120       else
5121         lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
5122       fi
5123       ;;
5124
5125     hpux9* | hpux10* | hpux11*)
5126       # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
5127       lt_cv_prog_cc_wl='-Wl,'
5128       lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
5129       lt_cv_prog_cc_pic='+Z'
5130       ;;
5131
5132     irix5* | irix6* | nonstopux*)
5133       lt_cv_prog_cc_wl='-Wl,'
5134       lt_cv_prog_cc_static='-non_shared'
5135       # PIC (with -KPIC) is the default.
5136       ;;
5137
5138     cygwin* | mingw* | pw32* | os2*)
5139       # This hack is so that the source file can tell whether it is being
5140       # built for inclusion in a dll (and should export symbols for example).
5141       lt_cv_prog_cc_pic='-DDLL_EXPORT'
5142       ;;
5143
5144     newsos6)
5145       lt_cv_prog_cc_pic='-KPIC'
5146       lt_cv_prog_cc_static='-Bstatic'
5147       ;;
5148
5149     osf3* | osf4* | osf5*)
5150       # All OSF/1 code is PIC.
5151       lt_cv_prog_cc_wl='-Wl,'
5152       lt_cv_prog_cc_static='-non_shared'
5153       ;;
5154
5155     sco3.2v5*)
5156       lt_cv_prog_cc_pic='-Kpic'
5157       lt_cv_prog_cc_static='-dn'
5158       lt_cv_prog_cc_shlib='-belf'
5159       ;;
5160
5161     solaris*)
5162       lt_cv_prog_cc_pic='-KPIC'
5163       lt_cv_prog_cc_static='-Bstatic'
5164       lt_cv_prog_cc_wl='-Wl,'
5165       ;;
5166
5167     sunos4*)
5168       lt_cv_prog_cc_pic='-PIC'
5169       lt_cv_prog_cc_static='-Bstatic'
5170       lt_cv_prog_cc_wl='-Qoption ld '
5171       ;;
5172
5173     sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5174       lt_cv_prog_cc_pic='-KPIC'
5175       lt_cv_prog_cc_static='-Bstatic'
5176       lt_cv_prog_cc_wl='-Wl,'
5177       ;;
5178
5179     uts4*)
5180       lt_cv_prog_cc_pic='-pic'
5181       lt_cv_prog_cc_static='-Bstatic'
5182       ;;
5183
5184     sysv4*MP*)
5185       if test -d /usr/nec ;then
5186         lt_cv_prog_cc_pic='-Kconform_pic'
5187         lt_cv_prog_cc_static='-Bstatic'
5188       fi
5189       ;;
5190
5191     *)
5192       lt_cv_prog_cc_can_build_shared=no
5193       ;;
5194     esac
5195   fi
5196
5197 fi
5198
5199 if test -z "$lt_cv_prog_cc_pic"; then
5200   echo "$ac_t""none" 1>&6
5201 else
5202   echo "$ac_t""$lt_cv_prog_cc_pic" 1>&6
5203
5204   # Check to make sure the pic_flag actually works.
5205   echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6
5206 echo "configure:5207: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
5207   if eval "test \"\${lt_cv_prog_cc_pic_works+set}\" = set"; then
5208   echo $ac_n "(cached) $ac_c" 1>&6
5209 else
5210       save_CFLAGS="$CFLAGS"
5211     CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
5212     cat > conftest.$ac_ext <<EOF
5213 #line 5214 "configure"
5214 #include "confdefs.h"
5215
5216 int main() {
5217
5218 ; return 0; }
5219 EOF
5220 if { (eval echo configure:5221: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5221   rm -rf conftest*
5222         case $host_os in
5223       hpux9* | hpux10* | hpux11*)
5224         # On HP-UX, both CC and GCC only warn that PIC is supported... then
5225         # they create non-PIC objects.  So, if there were any warnings, we
5226         # assume that PIC is not supported.
5227         if test -s conftest.err; then
5228           lt_cv_prog_cc_pic_works=no
5229         else
5230           lt_cv_prog_cc_pic_works=yes
5231         fi
5232         ;;
5233       *)
5234         lt_cv_prog_cc_pic_works=yes
5235         ;;
5236       esac
5237     
5238 else
5239   echo "configure: failed program was:" >&5
5240   cat conftest.$ac_ext >&5
5241   rm -rf conftest*
5242         lt_cv_prog_cc_pic_works=no
5243     
5244 fi
5245 rm -f conftest*
5246     CFLAGS="$save_CFLAGS"
5247   
5248 fi
5249
5250
5251   if test "X$lt_cv_prog_cc_pic_works" = Xno; then
5252     lt_cv_prog_cc_pic=
5253     lt_cv_prog_cc_can_build_shared=no
5254   else
5255     lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
5256   fi
5257
5258   echo "$ac_t""$lt_cv_prog_cc_pic_works" 1>&6
5259 fi
5260
5261 # Check for any special shared library compilation flags.
5262 if test -n "$lt_cv_prog_cc_shlib"; then
5263   echo "configure: warning: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" 1>&2
5264   if echo "$old_CC $old_CFLAGS " | egrep -e "[  ]$lt_cv_prog_cc_shlib[  ]" >/dev/null; then :
5265   else
5266    echo "configure: warning: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2
5267     lt_cv_prog_cc_can_build_shared=no
5268   fi
5269 fi
5270
5271 echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6
5272 echo "configure:5273: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
5273 if eval "test \"\${lt_cv_prog_cc_static_works+set}\" = set"; then
5274   echo $ac_n "(cached) $ac_c" 1>&6
5275 else
5276     lt_cv_prog_cc_static_works=no
5277   save_LDFLAGS="$LDFLAGS"
5278   LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
5279   cat > conftest.$ac_ext <<EOF
5280 #line 5281 "configure"
5281 #include "confdefs.h"
5282
5283 int main() {
5284
5285 ; return 0; }
5286 EOF
5287 if { (eval echo configure:5288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5288   rm -rf conftest*
5289   lt_cv_prog_cc_static_works=yes
5290 else
5291   echo "configure: failed program was:" >&5
5292   cat conftest.$ac_ext >&5
5293 fi
5294 rm -f conftest*
5295   LDFLAGS="$save_LDFLAGS"
5296
5297 fi
5298
5299
5300 # Belt *and* braces to stop my trousers falling down:
5301 test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
5302 echo "$ac_t""$lt_cv_prog_cc_static_works" 1>&6
5303
5304 pic_flag="$lt_cv_prog_cc_pic"
5305 special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
5306 wl="$lt_cv_prog_cc_wl"
5307 link_static_flag="$lt_cv_prog_cc_static"
5308 no_builtin_flag="$lt_cv_prog_cc_no_builtin"
5309 can_build_shared="$lt_cv_prog_cc_can_build_shared"
5310
5311
5312 # Check to see if options -o and -c are simultaneously supported by compiler
5313 echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6
5314 echo "configure:5315: checking if $compiler supports -c -o file.$ac_objext" >&5
5315 if eval "test \"\${lt_cv_compiler_c_o+set}\" = set"; then
5316   echo $ac_n "(cached) $ac_c" 1>&6
5317 else
5318   
5319 $rm -r conftest 2>/dev/null
5320 mkdir conftest
5321 cd conftest
5322 echo "int some_variable = 0;" > conftest.$ac_ext
5323 mkdir out
5324 # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
5325 # that will create temporary files in the current directory regardless of
5326 # the output directory.  Thus, making CWD read-only will cause this test
5327 # to fail, enabling locking or at least warning the user not to do parallel
5328 # builds.
5329 chmod -w .
5330 save_CFLAGS="$CFLAGS"
5331 CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
5332 compiler_c_o=no
5333 if { (eval echo configure:5334: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
5334   # The compiler can only warn and ignore the option if not recognized
5335   # So say no if there are warnings
5336   if test -s out/conftest.err; then
5337     lt_cv_compiler_c_o=no
5338   else
5339     lt_cv_compiler_c_o=yes
5340   fi
5341 else
5342   # Append any errors to the config.log.
5343   cat out/conftest.err 1>&5
5344   lt_cv_compiler_c_o=no
5345 fi
5346 CFLAGS="$save_CFLAGS"
5347 chmod u+w .
5348 $rm conftest* out/*
5349 rmdir out
5350 cd ..
5351 rmdir conftest
5352 $rm -r conftest 2>/dev/null
5353
5354 fi
5355
5356 compiler_c_o=$lt_cv_compiler_c_o
5357 echo "$ac_t""$compiler_c_o" 1>&6
5358
5359 if test x"$compiler_c_o" = x"yes"; then
5360   # Check to see if we can write to a .lo
5361   echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6
5362 echo "configure:5363: checking if $compiler supports -c -o file.lo" >&5
5363   if eval "test \"\${lt_cv_compiler_o_lo+set}\" = set"; then
5364   echo $ac_n "(cached) $ac_c" 1>&6
5365 else
5366   
5367   lt_cv_compiler_o_lo=no
5368   save_CFLAGS="$CFLAGS"
5369   CFLAGS="$CFLAGS -c -o conftest.lo"
5370   save_objext="$ac_objext"
5371   ac_objext=lo
5372   cat > conftest.$ac_ext <<EOF
5373 #line 5374 "configure"
5374 #include "confdefs.h"
5375
5376 int main() {
5377 int some_variable = 0;
5378 ; return 0; }
5379 EOF
5380 if { (eval echo configure:5381: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5381   rm -rf conftest*
5382       # The compiler can only warn and ignore the option if not recognized
5383     # So say no if there are warnings
5384     if test -s conftest.err; then
5385       lt_cv_compiler_o_lo=no
5386     else
5387       lt_cv_compiler_o_lo=yes
5388     fi
5389   
5390 else
5391   echo "configure: failed program was:" >&5
5392   cat conftest.$ac_ext >&5
5393 fi
5394 rm -f conftest*
5395   ac_objext="$save_objext"
5396   CFLAGS="$save_CFLAGS"
5397   
5398 fi
5399
5400   compiler_o_lo=$lt_cv_compiler_o_lo
5401   echo "$ac_t""$compiler_o_lo" 1>&6
5402 else
5403   compiler_o_lo=no
5404 fi
5405
5406 # Check to see if we can do hard links to lock some files if needed
5407 hard_links="nottested"
5408 if test "$compiler_c_o" = no && test "$need_locks" != no; then
5409   # do not overwrite the value of need_locks provided by the user
5410   echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6
5411 echo "configure:5412: checking if we can lock with hard links" >&5
5412   hard_links=yes
5413   $rm conftest*
5414   ln conftest.a conftest.b 2>/dev/null && hard_links=no
5415   touch conftest.a
5416   ln conftest.a conftest.b 2>&5 || hard_links=no
5417   ln conftest.a conftest.b 2>/dev/null && hard_links=no
5418   echo "$ac_t""$hard_links" 1>&6
5419   if test "$hard_links" = no; then
5420     echo "configure: warning: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" 1>&2
5421     need_locks=warn
5422   fi
5423 else
5424   need_locks=no
5425 fi
5426
5427 if test "$GCC" = yes; then
5428   # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
5429   echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6
5430 echo "configure:5431: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
5431   echo "int some_variable = 0;" > conftest.$ac_ext
5432   save_CFLAGS="$CFLAGS"
5433   CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
5434   compiler_rtti_exceptions=no
5435   cat > conftest.$ac_ext <<EOF
5436 #line 5437 "configure"
5437 #include "confdefs.h"
5438
5439 int main() {
5440 int some_variable = 0;
5441 ; return 0; }
5442 EOF
5443 if { (eval echo configure:5444: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5444   rm -rf conftest*
5445       # The compiler can only warn and ignore the option if not recognized
5446     # So say no if there are warnings
5447     if test -s conftest.err; then
5448       compiler_rtti_exceptions=no
5449     else
5450       compiler_rtti_exceptions=yes
5451     fi
5452   
5453 else
5454   echo "configure: failed program was:" >&5
5455   cat conftest.$ac_ext >&5
5456 fi
5457 rm -f conftest*
5458   CFLAGS="$save_CFLAGS"
5459   echo "$ac_t""$compiler_rtti_exceptions" 1>&6
5460
5461   if test "$compiler_rtti_exceptions" = "yes"; then
5462     no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
5463   else
5464     no_builtin_flag=' -fno-builtin'
5465   fi
5466 fi
5467
5468 # See if the linker supports building shared libraries.
5469 echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6
5470 echo "configure:5471: checking whether the linker ($LD) supports shared libraries" >&5
5471
5472 allow_undefined_flag=
5473 no_undefined_flag=
5474 need_lib_prefix=unknown
5475 need_version=unknown
5476 # when you set need_version to no, make sure it does not cause -set_version
5477 # flags to be left without arguments
5478 archive_cmds=
5479 archive_expsym_cmds=
5480 old_archive_from_new_cmds=
5481 old_archive_from_expsyms_cmds=
5482 export_dynamic_flag_spec=
5483 whole_archive_flag_spec=
5484 thread_safe_flag_spec=
5485 hardcode_into_libs=no
5486 hardcode_libdir_flag_spec=
5487 hardcode_libdir_separator=
5488 hardcode_direct=no
5489 hardcode_minus_L=no
5490 hardcode_shlibpath_var=unsupported
5491 runpath_var=
5492 link_all_deplibs=unknown
5493 always_export_symbols=no
5494 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
5495 # include_expsyms should be a list of space-separated symbols to be *always*
5496 # included in the symbol list
5497 include_expsyms=
5498 # exclude_expsyms can be an egrep regular expression of symbols to exclude
5499 # it will be wrapped by ` (' and `)$', so one must not match beginning or
5500 # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5501 # as well as any symbol that contains `d'.
5502 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
5503 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5504 # platforms (ab)use it in PIC code, but their linkers get confused if
5505 # the symbol is explicitly referenced.  Since portable code cannot
5506 # rely on this symbol name, it's probably fine to never include it in
5507 # preloaded symbol tables.
5508 extract_expsyms_cmds=
5509
5510 case $host_os in
5511 cygwin* | mingw* | pw32*)
5512   # FIXME: the MSVC++ port hasn't been tested in a loooong time
5513   # When not using gcc, we currently assume that we are using
5514   # Microsoft Visual C++.
5515   if test "$GCC" != yes; then
5516     with_gnu_ld=no
5517   fi
5518   ;;
5519 openbsd*)
5520   with_gnu_ld=no
5521   ;;
5522 esac
5523
5524 ld_shlibs=yes
5525 if test "$with_gnu_ld" = yes; then
5526   # If archive_cmds runs LD, not CC, wlarc should be empty
5527   wlarc='${wl}'
5528
5529   # See if GNU ld supports shared libraries.
5530   case $host_os in
5531   aix3* | aix4* | aix5*)
5532     # On AIX, the GNU linker is very broken
5533     # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
5534     ld_shlibs=no
5535     cat <<EOF 1>&2
5536
5537 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
5538 *** to be unable to reliably create shared libraries on AIX.
5539 *** Therefore, libtool is disabling shared libraries support.  If you
5540 *** really care for shared libraries, you may want to modify your PATH
5541 *** so that a non-GNU linker is found, and then restart.
5542
5543 EOF
5544     ;;
5545
5546   amigaos*)
5547     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)'
5548     hardcode_libdir_flag_spec='-L$libdir'
5549     hardcode_minus_L=yes
5550
5551     # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
5552     # that the semantics of dynamic libraries on AmigaOS, at least up
5553     # to version 4, is to share data among multiple programs linked
5554     # with the same dynamic library.  Since this doesn't match the
5555     # behavior of shared libraries on other platforms, we can use
5556     # them.
5557     ld_shlibs=no
5558     ;;
5559
5560   beos*)
5561     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5562       allow_undefined_flag=unsupported
5563       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5564       # support --undefined.  This deserves some investigation.  FIXME
5565       archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5566     else
5567       ld_shlibs=no
5568     fi
5569     ;;
5570
5571   cygwin* | mingw* | pw32*)
5572     # hardcode_libdir_flag_spec is actually meaningless, as there is
5573     # no search path for DLLs.
5574     hardcode_libdir_flag_spec='-L$libdir'
5575     allow_undefined_flag=unsupported
5576     always_export_symbols=yes
5577
5578     extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
5579       sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
5580       test -f $output_objdir/impgen.exe || (cd $output_objdir && \
5581       if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
5582       else $CC -o impgen impgen.c ; fi)~
5583       $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
5584
5585     old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
5586
5587     # cygwin and mingw dlls have different entry points and sets of symbols
5588     # to exclude.
5589     # FIXME: what about values for MSVC?
5590     dll_entry=__cygwin_dll_entry@12
5591     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
5592     case $host_os in
5593     mingw*)
5594       # mingw values
5595       dll_entry=_DllMainCRTStartup@12
5596       dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
5597       ;;
5598     esac
5599
5600     # mingw and cygwin differ, and it's simplest to just exclude the union
5601     # of the two symbol sets.
5602     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
5603
5604     # recent cygwin and mingw systems supply a stub DllMain which the user
5605     # can override, but on older systems we have to supply one (in ltdll.c)
5606     if test "x$lt_cv_need_dllmain" = "xyes"; then
5607       ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
5608       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~
5609         test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
5610     else
5611       ltdll_obj=
5612       ltdll_cmds=
5613     fi
5614
5615     # Extract the symbol export list from an `--export-all' def file,
5616     # then regenerate the def file from the symbol export list, so that
5617     # the compiled dll only exports the symbol export list.
5618     # Be careful not to strip the DATA tag left be newer dlltools.
5619     export_symbols_cmds="$ltdll_cmds"'
5620       $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
5621       sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
5622
5623     # If the export-symbols file already is a .def file (1st line
5624     # is EXPORTS), use it as is.
5625     # If DATA tags from a recent dlltool are present, honour them!
5626     archive_expsym_cmds='if test "x`sed 1q $export_symbols`" = xEXPORTS; then
5627         cp $export_symbols $output_objdir/$soname-def;
5628       else
5629         echo EXPORTS > $output_objdir/$soname-def;
5630         _lt_hint=1;
5631         cat $export_symbols | while read symbol; do
5632          set dummy \$symbol;
5633          case \$# in
5634            2) echo "   \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
5635            4) echo "   \$2 \$3 \$4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
5636            *) echo "     \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
5637          esac;
5638          _lt_hint=`expr 1 + \$_lt_hint`;
5639         done;
5640       fi~
5641       '"$ltdll_cmds"'
5642       $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~
5643       $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~
5644       $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~
5645       $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~
5646       $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
5647     ;;
5648
5649   netbsd*)
5650     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5651       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5652       wlarc=
5653     else
5654       archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5655       archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5656     fi
5657     ;;
5658
5659   solaris* | sysv5*)
5660     if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
5661       ld_shlibs=no
5662       cat <<EOF 1>&2
5663
5664 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
5665 *** create shared libraries on Solaris systems.  Therefore, libtool
5666 *** is disabling shared libraries support.  We urge you to upgrade GNU
5667 *** binutils to release 2.9.1 or newer.  Another option is to modify
5668 *** your PATH or compiler configuration so that the native linker is
5669 *** used, and then restart.
5670
5671 EOF
5672     elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5673       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5674       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5675     else
5676       ld_shlibs=no
5677     fi
5678     ;;
5679
5680   sunos4*)
5681     archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5682     wlarc=
5683     hardcode_direct=yes
5684     hardcode_shlibpath_var=no
5685     ;;
5686
5687   *)
5688     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5689       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5690       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5691     else
5692       ld_shlibs=no
5693     fi
5694     ;;
5695   esac
5696
5697   if test "$ld_shlibs" = yes; then
5698     runpath_var=LD_RUN_PATH
5699     hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
5700     export_dynamic_flag_spec='${wl}--export-dynamic'
5701     case $host_os in
5702     cygwin* | mingw* | pw32*)
5703       # dlltool doesn't understand --whole-archive et. al.
5704       whole_archive_flag_spec=
5705       ;;
5706     *)
5707       # ancient GNU ld didn't support --whole-archive et. al.
5708       if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
5709         whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5710       else
5711         whole_archive_flag_spec=
5712       fi
5713       ;;
5714     esac
5715   fi
5716 else
5717   # PORTME fill in a description of your system's linker (not GNU ld)
5718   case $host_os in
5719   aix3*)
5720     allow_undefined_flag=unsupported
5721     always_export_symbols=yes
5722     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'
5723     # Note: this linker hardcodes the directories in LIBPATH if there
5724     # are no directories specified by -L.
5725     hardcode_minus_L=yes
5726     if test "$GCC" = yes && test -z "$link_static_flag"; then
5727       # Neither direct hardcoding nor static linking is supported with a
5728       # broken collect2.
5729       hardcode_direct=unsupported
5730     fi
5731     ;;
5732
5733   aix4* | aix5*)
5734     if test "$host_cpu" = ia64; then
5735       # On IA64, the linker does run time linking by default, so we don't
5736       # have to do anything special.
5737       aix_use_runtimelinking=no
5738       exp_sym_flag='-Bexport'
5739       no_entry_flag=""
5740     else
5741       aix_use_runtimelinking=no
5742
5743       # Test if we are trying to use run time linking or normal
5744       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5745       # need to do runtime linking.
5746       case $host_os in aix4.[23]|aix4.[23].*|aix5*)
5747         for ld_flag in $LDFLAGS; do
5748           case $ld_flag in
5749           *-brtl*)
5750             aix_use_runtimelinking=yes
5751             break
5752           ;;
5753           esac
5754         done
5755       esac
5756
5757       exp_sym_flag='-bexport'
5758       no_entry_flag='-bnoentry'
5759     fi
5760
5761     # When large executables or shared objects are built, AIX ld can
5762     # have problems creating the table of contents.  If linking a library
5763     # or program results in "error TOC overflow" add -mminimal-toc to
5764     # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5765     # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5766
5767     hardcode_direct=yes
5768     archive_cmds=''
5769     hardcode_libdir_separator=':'
5770     if test "$GCC" = yes; then
5771       case $host_os in aix4.[012]|aix4.[012].*)
5772         collect2name=`${CC} -print-prog-name=collect2`
5773         if test -f "$collect2name" && \
5774           strings "$collect2name" | grep resolve_lib_name >/dev/null
5775         then
5776           # We have reworked collect2
5777           hardcode_direct=yes
5778         else
5779           # We have old collect2
5780           hardcode_direct=unsupported
5781           # It fails to find uninstalled libraries when the uninstalled
5782           # path is not listed in the libpath.  Setting hardcode_minus_L
5783           # to unsupported forces relinking
5784           hardcode_minus_L=yes
5785           hardcode_libdir_flag_spec='-L$libdir'
5786           hardcode_libdir_separator=
5787         fi
5788       esac
5789
5790       shared_flag='-shared'
5791     else
5792       # not using gcc
5793       if test "$host_cpu" = ia64; then
5794         shared_flag='${wl}-G'
5795       else
5796         if test "$aix_use_runtimelinking" = yes; then
5797           shared_flag='${wl}-G'
5798         else
5799           shared_flag='${wl}-bM:SRE'
5800         fi
5801       fi
5802     fi
5803
5804     # It seems that -bexpall can do strange things, so it is better to
5805     # generate a list of symbols to export.
5806     always_export_symbols=yes
5807     if test "$aix_use_runtimelinking" = yes; then
5808       # Warning - without using the other runtime loading flags (-brtl),
5809       # -berok will link without error, but may produce a broken library.
5810       allow_undefined_flag='-berok'
5811       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
5812       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"
5813     else
5814       if test "$host_cpu" = ia64; then
5815         hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
5816         allow_undefined_flag="-z nodefs"
5817         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"
5818       else
5819         hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
5820         # Warning - without using the other run time loading flags,
5821         # -berok will link without error, but may produce a broken library.
5822         allow_undefined_flag='${wl}-berok'
5823         # This is a bit strange, but is similar to how AIX traditionally builds
5824         # it's shared libraries.
5825         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'
5826       fi
5827     fi
5828     ;;
5829
5830   amigaos*)
5831     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)'
5832     hardcode_libdir_flag_spec='-L$libdir'
5833     hardcode_minus_L=yes
5834     # see comment about different semantics on the GNU ld section
5835     ld_shlibs=no
5836     ;;
5837
5838   cygwin* | mingw* | pw32*)
5839     # When not using gcc, we currently assume that we are using
5840     # Microsoft Visual C++.
5841     # hardcode_libdir_flag_spec is actually meaningless, as there is
5842     # no search path for DLLs.
5843     hardcode_libdir_flag_spec=' '
5844     allow_undefined_flag=unsupported
5845     # Tell ltmain to make .lib files, not .a files.
5846     libext=lib
5847     # FIXME: Setting linknames here is a bad hack.
5848     archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
5849     # The linker will automatically build a .lib file if we build a DLL.
5850     old_archive_from_new_cmds='true'
5851     # FIXME: Should let the user specify the lib program.
5852     old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
5853     fix_srcfile_path='`cygpath -w "$srcfile"`'
5854     ;;
5855
5856   darwin* | rhapsody*)
5857     case "$host_os" in
5858     rhapsody* | darwin1.[012])
5859       allow_undefined_flag='-undefined suppress'
5860       ;;
5861     *) # Darwin 1.3 on
5862       allow_undefined_flag='-flat_namespace -undefined suppress'
5863       ;;
5864     esac
5865     # FIXME: Relying on posixy $() will cause problems for
5866     #        cross-compilation, but unfortunately the echo tests do not
5867     #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
5868     #        `"' quotes if we put them in here... so don't!
5869     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)'
5870     # We need to add '_' to the symbols in $export_symbols first
5871     #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
5872     hardcode_direct=yes
5873     hardcode_shlibpath_var=no
5874     whole_archive_flag_spec='-all_load $convenience'
5875     ;;
5876
5877   freebsd1*)
5878     ld_shlibs=no
5879     ;;
5880
5881   # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5882   # support.  Future versions do this automatically, but an explicit c++rt0.o
5883   # does not break anything, and helps significantly (at the cost of a little
5884   # extra space).
5885   freebsd2.2*)
5886     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5887     hardcode_libdir_flag_spec='-R$libdir'
5888     hardcode_direct=yes
5889     hardcode_shlibpath_var=no
5890     ;;
5891
5892   # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5893   freebsd2*)
5894     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5895     hardcode_direct=yes
5896     hardcode_minus_L=yes
5897     hardcode_shlibpath_var=no
5898     ;;
5899
5900   # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5901   freebsd*)
5902     archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
5903     hardcode_libdir_flag_spec='-R$libdir'
5904     hardcode_direct=yes
5905     hardcode_shlibpath_var=no
5906     ;;
5907
5908   hpux9* | hpux10* | hpux11*)
5909     case $host_os in
5910     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' ;;
5911     *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
5912     esac
5913     hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
5914     hardcode_libdir_separator=:
5915     hardcode_direct=yes
5916     hardcode_minus_L=yes # Not in the search PATH, but as the default
5917                          # location of the library.
5918     export_dynamic_flag_spec='${wl}-E'
5919     ;;
5920
5921   irix5* | irix6* | nonstopux*)
5922     if test "$GCC" = yes; then
5923       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'
5924       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5925     else
5926       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'
5927       hardcode_libdir_flag_spec='-rpath $libdir'
5928     fi
5929     hardcode_libdir_separator=:
5930     link_all_deplibs=yes
5931     ;;
5932
5933   netbsd*)
5934     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5935       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5936     else
5937       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5938     fi
5939     hardcode_libdir_flag_spec='-R$libdir'
5940     hardcode_direct=yes
5941     hardcode_shlibpath_var=no
5942     ;;
5943
5944   newsos6)
5945     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5946     hardcode_direct=yes
5947     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5948     hardcode_libdir_separator=:
5949     hardcode_shlibpath_var=no
5950     ;;
5951
5952   openbsd*)
5953     hardcode_direct=yes
5954     hardcode_shlibpath_var=no
5955     if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5956       archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5957       hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
5958       export_dynamic_flag_spec='${wl}-E'
5959     else
5960       case "$host_os" in
5961       openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
5962         archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5963         hardcode_libdir_flag_spec='-R$libdir'
5964         ;;
5965       *)
5966         archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5967         hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
5968         ;;
5969       esac
5970     fi
5971     ;;
5972
5973   os2*)
5974     hardcode_libdir_flag_spec='-L$libdir'
5975     hardcode_minus_L=yes
5976     allow_undefined_flag=unsupported
5977     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'
5978     old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
5979     ;;
5980
5981   osf3*)
5982     if test "$GCC" = yes; then
5983       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
5984       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'
5985     else
5986       allow_undefined_flag=' -expect_unresolved \*'
5987       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'
5988     fi
5989     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5990     hardcode_libdir_separator=:
5991     ;;
5992
5993   osf4* | osf5*)        # as osf3* with the addition of -msym flag
5994     if test "$GCC" = yes; then
5995       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
5996       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'
5997       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5998     else
5999       allow_undefined_flag=' -expect_unresolved \*'
6000       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'
6001       archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
6002       $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'
6003
6004       #Both c and cxx compiler support -rpath directly
6005       hardcode_libdir_flag_spec='-rpath $libdir'
6006     fi
6007     hardcode_libdir_separator=:
6008     ;;
6009
6010   sco3.2v5*)
6011     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6012     hardcode_shlibpath_var=no
6013     runpath_var=LD_RUN_PATH
6014     hardcode_runpath_var=yes
6015     export_dynamic_flag_spec='${wl}-Bexport'
6016     ;;
6017
6018   solaris*)
6019     # gcc --version < 3.0 without binutils cannot create self contained
6020     # shared libraries reliably, requiring libgcc.a to resolve some of
6021     # the object symbols generated in some cases.  Libraries that use
6022     # assert need libgcc.a to resolve __eprintf, for example.  Linking
6023     # a copy of libgcc.a into every shared library to guarantee resolving
6024     # such symbols causes other problems:  According to Tim Van Holder
6025     # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
6026     # (to the application) exception stack for one thing.
6027     no_undefined_flag=' -z defs'
6028     if test "$GCC" = yes; then
6029       case `$CC --version 2>/dev/null` in
6030       [12].*)
6031         cat <<EOF 1>&2
6032
6033 *** Warning: Releases of GCC earlier than version 3.0 cannot reliably
6034 *** create self contained shared libraries on Solaris systems, without
6035 *** introducing a dependency on libgcc.a.  Therefore, libtool is disabling
6036 *** -no-undefined support, which will at least allow you to build shared
6037 *** libraries.  However, you may find that when you link such libraries
6038 *** into an application without using GCC, you have to manually add
6039 *** \`gcc --print-libgcc-file-name\` to the link command.  We urge you to
6040 *** upgrade to a newer version of GCC.  Another option is to rebuild your
6041 *** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
6042
6043 EOF
6044         no_undefined_flag=
6045         ;;
6046       esac
6047     fi
6048     # $CC -shared without GNU ld will not create a library from C++
6049     # object files and a static libstdc++, better avoid it by now
6050     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6051     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6052                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
6053     hardcode_libdir_flag_spec='-R$libdir'
6054     hardcode_shlibpath_var=no
6055     case $host_os in
6056     solaris2.[0-5] | solaris2.[0-5].*) ;;
6057     *) # Supported since Solaris 2.6 (maybe 2.5.1?)
6058       whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
6059     esac
6060     link_all_deplibs=yes
6061     ;;
6062
6063   sunos4*)
6064     if test "x$host_vendor" = xsequent; then
6065       # Use $CC to link under sequent, because it throws in some extra .o
6066       # files that make .init and .fini sections work.
6067       archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
6068     else
6069       archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
6070     fi
6071     hardcode_libdir_flag_spec='-L$libdir'
6072     hardcode_direct=yes
6073     hardcode_minus_L=yes
6074     hardcode_shlibpath_var=no
6075     ;;
6076
6077   sysv4)
6078     case $host_vendor in
6079       sni)
6080         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6081         hardcode_direct=yes # is this really true???
6082         ;;
6083       siemens)
6084         ## LD is ld it makes a PLAMLIB
6085         ## CC just makes a GrossModule.
6086         archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6087         reload_cmds='$CC -r -o $output$reload_objs'
6088         hardcode_direct=no
6089         ;;
6090       motorola)
6091         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6092         hardcode_direct=no #Motorola manual says yes, but my tests say they lie
6093         ;;
6094     esac
6095     runpath_var='LD_RUN_PATH'
6096     hardcode_shlibpath_var=no
6097     ;;
6098
6099   sysv4.3*)
6100     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6101     hardcode_shlibpath_var=no
6102     export_dynamic_flag_spec='-Bexport'
6103     ;;
6104
6105   sysv5*)
6106     no_undefined_flag=' -z text'
6107     # $CC -shared without GNU ld will not create a library from C++
6108     # object files and a static libstdc++, better avoid it by now
6109     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6110     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6111                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
6112     hardcode_libdir_flag_spec=
6113     hardcode_shlibpath_var=no
6114     runpath_var='LD_RUN_PATH'
6115     ;;
6116
6117   uts4*)
6118     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6119     hardcode_libdir_flag_spec='-L$libdir'
6120     hardcode_shlibpath_var=no
6121     ;;
6122
6123   dgux*)
6124     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6125     hardcode_libdir_flag_spec='-L$libdir'
6126     hardcode_shlibpath_var=no
6127     ;;
6128
6129   sysv4*MP*)
6130     if test -d /usr/nec; then
6131       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6132       hardcode_shlibpath_var=no
6133       runpath_var=LD_RUN_PATH
6134       hardcode_runpath_var=yes
6135       ld_shlibs=yes
6136     fi
6137     ;;
6138
6139   sysv4.2uw2*)
6140     archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6141     hardcode_direct=yes
6142     hardcode_minus_L=no
6143     hardcode_shlibpath_var=no
6144     hardcode_runpath_var=yes
6145     runpath_var=LD_RUN_PATH
6146     ;;
6147
6148   sysv5uw7* | unixware7*)
6149     no_undefined_flag='${wl}-z ${wl}text'
6150     if test "$GCC" = yes; then
6151       archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6152     else
6153       archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6154     fi
6155     runpath_var='LD_RUN_PATH'
6156     hardcode_shlibpath_var=no
6157     ;;
6158
6159   *)
6160     ld_shlibs=no
6161     ;;
6162   esac
6163 fi
6164 echo "$ac_t""$ld_shlibs" 1>&6
6165 test "$ld_shlibs" = no && can_build_shared=no
6166
6167 # Check hardcoding attributes.
6168 echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6
6169 echo "configure:6170: checking how to hardcode library paths into programs" >&5
6170 hardcode_action=
6171 if test -n "$hardcode_libdir_flag_spec" || \
6172    test -n "$runpath_var"; then
6173
6174   # We can hardcode non-existant directories.
6175   if test "$hardcode_direct" != no &&
6176      # If the only mechanism to avoid hardcoding is shlibpath_var, we
6177      # have to relink, otherwise we might link with an installed library
6178      # when we should be linking with a yet-to-be-installed one
6179      ## test "$hardcode_shlibpath_var" != no &&
6180      test "$hardcode_minus_L" != no; then
6181     # Linking always hardcodes the temporary library directory.
6182     hardcode_action=relink
6183   else
6184     # We can link without hardcoding, and we can hardcode nonexisting dirs.
6185     hardcode_action=immediate
6186   fi
6187 else
6188   # We cannot hardcode anything, or else we can only hardcode existing
6189   # directories.
6190   hardcode_action=unsupported
6191 fi
6192 echo "$ac_t""$hardcode_action" 1>&6
6193
6194 striplib=
6195 old_striplib=
6196 echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6
6197 echo "configure:6198: checking whether stripping libraries is possible" >&5
6198 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
6199   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
6200   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
6201   echo "$ac_t""yes" 1>&6
6202 else
6203   echo "$ac_t""no" 1>&6
6204 fi
6205
6206 reload_cmds='$LD$reload_flag -o $output$reload_objs'
6207 test -z "$deplibs_check_method" && deplibs_check_method=unknown
6208
6209 # PORTME Fill in your ld.so characteristics
6210 echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6
6211 echo "configure:6212: checking dynamic linker characteristics" >&5
6212 library_names_spec=
6213 libname_spec='lib$name'
6214 soname_spec=
6215 postinstall_cmds=
6216 postuninstall_cmds=
6217 finish_cmds=
6218 finish_eval=
6219 shlibpath_var=
6220 shlibpath_overrides_runpath=unknown
6221 version_type=none
6222 dynamic_linker="$host_os ld.so"
6223 sys_lib_dlsearch_path_spec="/lib /usr/lib"
6224 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
6225
6226 case $host_os in
6227 aix3*)
6228   version_type=linux
6229   library_names_spec='${libname}${release}.so$versuffix $libname.a'
6230   shlibpath_var=LIBPATH
6231
6232   # AIX has no versioning support, so we append a major version to the name.
6233   soname_spec='${libname}${release}.so$major'
6234   ;;
6235
6236 aix4* | aix5*)
6237   version_type=linux
6238   need_lib_prefix=no
6239   need_version=no
6240   hardcode_into_libs=yes
6241   if test "$host_cpu" = ia64; then
6242     # AIX 5 supports IA64
6243     library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
6244     shlibpath_var=LD_LIBRARY_PATH
6245   else
6246     # With GCC up to 2.95.x, collect2 would create an import file
6247     # for dependence libraries.  The import file would start with
6248     # the line `#! .'.  This would cause the generated library to
6249     # depend on `.', always an invalid library.  This was fixed in
6250     # development snapshots of GCC prior to 3.0.
6251     case $host_os in
6252       aix4 | aix4.[01] | aix4.[01].*)
6253         if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
6254              echo ' yes '
6255              echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
6256           :
6257         else
6258           can_build_shared=no
6259         fi
6260         ;;
6261     esac
6262     # AIX (on Power*) has no versioning support, so currently we can
6263     # not hardcode correct soname into executable. Probably we can
6264     # add versioning support to collect2, so additional links can
6265     # be useful in future.
6266     if test "$aix_use_runtimelinking" = yes; then
6267       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
6268       # instead of lib<name>.a to let people know that these are not
6269       # typical AIX shared libraries.
6270       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6271     else
6272       # We preserve .a as extension for shared libraries through AIX4.2
6273       # and later when we are not doing run time linking.
6274       library_names_spec='${libname}${release}.a $libname.a'
6275       soname_spec='${libname}${release}.so$major'
6276     fi
6277     shlibpath_var=LIBPATH
6278   fi
6279   hardcode_into_libs=yes
6280   ;;
6281
6282 amigaos*)
6283   library_names_spec='$libname.ixlibrary $libname.a'
6284   # Create ${libname}_ixlibrary.a entries in /sys/libs.
6285   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'
6286   ;;
6287
6288 beos*)
6289   library_names_spec='${libname}.so'
6290   dynamic_linker="$host_os ld.so"
6291   shlibpath_var=LIBRARY_PATH
6292   ;;
6293
6294 bsdi4*)
6295   version_type=linux
6296   need_version=no
6297   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6298   soname_spec='${libname}${release}.so$major'
6299   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
6300   shlibpath_var=LD_LIBRARY_PATH
6301   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
6302   sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
6303   export_dynamic_flag_spec=-rdynamic
6304   # the default ld.so.conf also contains /usr/contrib/lib and
6305   # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
6306   # libtool to hard-code these into programs
6307   ;;
6308
6309 cygwin* | mingw* | pw32*)
6310   version_type=windows
6311   need_version=no
6312   need_lib_prefix=no
6313   case $GCC,$host_os in
6314   yes,cygwin*)
6315     library_names_spec='$libname.dll.a'
6316     soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
6317     postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
6318       dldir=$destdir/`dirname \$dlpath`~
6319       test -d \$dldir || mkdir -p \$dldir~
6320       $install_prog .libs/$dlname \$dldir/$dlname'
6321     postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
6322       dlpath=$dir/\$dldll~
6323        $rm \$dlpath'
6324     ;;
6325   yes,mingw*)
6326     library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
6327     sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
6328     ;;
6329   yes,pw32*)
6330     library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll'
6331     ;;
6332   *)
6333     library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
6334     ;;
6335   esac
6336   dynamic_linker='Win32 ld.exe'
6337   # FIXME: first we should search . and the directory the executable is in
6338   shlibpath_var=PATH
6339   ;;
6340
6341 darwin* | rhapsody*)
6342   dynamic_linker="$host_os dyld"
6343   version_type=darwin
6344   need_lib_prefix=no
6345   need_version=no
6346   # FIXME: Relying on posixy $() will cause problems for
6347   #        cross-compilation, but unfortunately the echo tests do not
6348   #        yet detect zsh echo's removal of \ escapes.
6349   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)'
6350   soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
6351   shlibpath_overrides_runpath=yes
6352   shlibpath_var=DYLD_LIBRARY_PATH
6353   ;;
6354
6355 freebsd1*)
6356   dynamic_linker=no
6357   ;;
6358
6359 freebsd*)
6360   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
6361   version_type=freebsd-$objformat
6362   case $version_type in
6363     freebsd-elf*)
6364       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
6365       need_version=no
6366       need_lib_prefix=no
6367       ;;
6368     freebsd-*)
6369       library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
6370       need_version=yes
6371       ;;
6372   esac
6373   shlibpath_var=LD_LIBRARY_PATH
6374   case $host_os in
6375   freebsd2*)
6376     shlibpath_overrides_runpath=yes
6377     ;;
6378   *)
6379     shlibpath_overrides_runpath=no
6380     hardcode_into_libs=yes
6381     ;;
6382   esac
6383   ;;
6384
6385 gnu*)
6386   version_type=linux
6387   need_lib_prefix=no
6388   need_version=no
6389   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
6390   soname_spec='${libname}${release}.so$major'
6391   shlibpath_var=LD_LIBRARY_PATH
6392   hardcode_into_libs=yes
6393   ;;
6394
6395 hpux9* | hpux10* | hpux11*)
6396   # Give a soname corresponding to the major version so that dld.sl refuses to
6397   # link against other versions.
6398   dynamic_linker="$host_os dld.sl"
6399   version_type=sunos
6400   need_lib_prefix=no
6401   need_version=no
6402   shlibpath_var=SHLIB_PATH
6403   shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
6404   library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
6405   soname_spec='${libname}${release}.sl$major'
6406   # HP-UX runs *really* slowly unless shared libraries are mode 555.
6407   postinstall_cmds='chmod 555 $lib'
6408   ;;
6409
6410 irix5* | irix6* | nonstopux*)
6411   case $host_os in
6412     nonstopux*) version_type=nonstopux ;;
6413     *)          version_type=irix ;;
6414   esac
6415   need_lib_prefix=no
6416   need_version=no
6417   soname_spec='${libname}${release}.so$major'
6418   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
6419   case $host_os in
6420   irix5* | nonstopux*)
6421     libsuff= shlibsuff=
6422     ;;
6423   *)
6424     case $LD in # libtool.m4 will add one of these switches to LD
6425     *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
6426     *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
6427     *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
6428     *) libsuff= shlibsuff= libmagic=never-match;;
6429     esac
6430     ;;
6431   esac
6432   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
6433   shlibpath_overrides_runpath=no
6434   sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
6435   sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
6436   ;;
6437
6438 # No shared lib support for Linux oldld, aout, or coff.
6439 linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
6440   dynamic_linker=no
6441   ;;
6442
6443 # This must be Linux ELF.
6444 linux-gnu*)
6445   version_type=linux
6446   need_lib_prefix=no
6447   need_version=no
6448   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6449   soname_spec='${libname}${release}.so$major'
6450   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
6451   shlibpath_var=LD_LIBRARY_PATH
6452   shlibpath_overrides_runpath=no
6453   # This implies no fast_install, which is unacceptable.
6454   # Some rework will be needed to allow for fast_install
6455   # before this can be enabled.
6456   hardcode_into_libs=yes
6457
6458   # We used to test for /lib/ld.so.1 and disable shared libraries on
6459   # powerpc, because MkLinux only supported shared libraries with the
6460   # GNU dynamic linker.  Since this was broken with cross compilers,
6461   # most powerpc-linux boxes support dynamic linking these days and
6462   # people can always --disable-shared, the test was removed, and we
6463   # assume the GNU/Linux dynamic linker is in use.
6464   dynamic_linker='GNU/Linux ld.so'
6465   ;;
6466
6467 netbsd*)
6468   version_type=sunos
6469   need_lib_prefix=no
6470   need_version=no
6471   if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6472     library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6473     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6474     dynamic_linker='NetBSD (a.out) ld.so'
6475   else
6476     library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
6477     soname_spec='${libname}${release}.so$major'
6478     dynamic_linker='NetBSD ld.elf_so'
6479   fi
6480   shlibpath_var=LD_LIBRARY_PATH
6481   shlibpath_overrides_runpath=yes
6482   hardcode_into_libs=yes
6483   ;;
6484
6485 newsos6)
6486   version_type=linux
6487   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6488   shlibpath_var=LD_LIBRARY_PATH
6489   shlibpath_overrides_runpath=yes
6490   ;;
6491
6492 openbsd*)
6493   version_type=sunos
6494   need_lib_prefix=no
6495   need_version=no
6496   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6497     case "$host_os" in
6498     openbsd2.[89] | openbsd2.[89].*)
6499       shlibpath_overrides_runpath=no
6500       ;;
6501     *)
6502       shlibpath_overrides_runpath=yes
6503       ;;
6504     esac
6505   else
6506     shlibpath_overrides_runpath=yes
6507   fi
6508   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6509   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6510   shlibpath_var=LD_LIBRARY_PATH
6511   ;;
6512
6513 os2*)
6514   libname_spec='$name'
6515   need_lib_prefix=no
6516   library_names_spec='$libname.dll $libname.a'
6517   dynamic_linker='OS/2 ld.exe'
6518   shlibpath_var=LIBPATH
6519   ;;
6520
6521 osf3* | osf4* | osf5*)
6522   version_type=osf
6523   need_version=no
6524   soname_spec='${libname}${release}.so$major'
6525   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6526   shlibpath_var=LD_LIBRARY_PATH
6527   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
6528   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
6529   hardcode_into_libs=yes
6530   ;;
6531
6532 sco3.2v5*)
6533   version_type=osf
6534   soname_spec='${libname}${release}.so$major'
6535   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6536   shlibpath_var=LD_LIBRARY_PATH
6537   ;;
6538
6539 solaris*)
6540   version_type=linux
6541   need_lib_prefix=no
6542   need_version=no
6543   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6544   soname_spec='${libname}${release}.so$major'
6545   shlibpath_var=LD_LIBRARY_PATH
6546   shlibpath_overrides_runpath=yes
6547   hardcode_into_libs=yes
6548   # ldd complains unless libraries are executable
6549   postinstall_cmds='chmod +x $lib'
6550   ;;
6551
6552 sunos4*)
6553   version_type=sunos
6554   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6555   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
6556   shlibpath_var=LD_LIBRARY_PATH
6557   shlibpath_overrides_runpath=yes
6558   if test "$with_gnu_ld" = yes; then
6559     need_lib_prefix=no
6560   fi
6561   need_version=yes
6562   ;;
6563
6564 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6565   version_type=linux
6566   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6567   soname_spec='${libname}${release}.so$major'
6568   shlibpath_var=LD_LIBRARY_PATH
6569   case $host_vendor in
6570     sni)
6571       shlibpath_overrides_runpath=no
6572       need_lib_prefix=no
6573       export_dynamic_flag_spec='${wl}-Blargedynsym'
6574       runpath_var=LD_RUN_PATH
6575       ;;
6576     siemens)
6577       need_lib_prefix=no
6578       ;;
6579     motorola)
6580       need_lib_prefix=no
6581       need_version=no
6582       shlibpath_overrides_runpath=no
6583       sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
6584       ;;
6585   esac
6586   ;;
6587
6588 uts4*)
6589   version_type=linux
6590   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6591   soname_spec='${libname}${release}.so$major'
6592   shlibpath_var=LD_LIBRARY_PATH
6593   ;;
6594
6595 dgux*)
6596   version_type=linux
6597   need_lib_prefix=no
6598   need_version=no
6599   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6600   soname_spec='${libname}${release}.so$major'
6601   shlibpath_var=LD_LIBRARY_PATH
6602   ;;
6603
6604 sysv4*MP*)
6605   if test -d /usr/nec ;then
6606     version_type=linux
6607     library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
6608     soname_spec='$libname.so.$major'
6609     shlibpath_var=LD_LIBRARY_PATH
6610   fi
6611   ;;
6612
6613 *)
6614   dynamic_linker=no
6615   ;;
6616 esac
6617 echo "$ac_t""$dynamic_linker" 1>&6
6618 test "$dynamic_linker" = no && can_build_shared=no
6619
6620 # Report the final consequences.
6621 echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6
6622 echo "configure:6623: checking if libtool supports shared libraries" >&5
6623 echo "$ac_t""$can_build_shared" 1>&6
6624
6625 echo $ac_n "checking whether to build shared libraries""... $ac_c" 1>&6
6626 echo "configure:6627: checking whether to build shared libraries" >&5
6627 test "$can_build_shared" = "no" && enable_shared=no
6628
6629 # On AIX, shared libraries and static libraries use the same namespace, and
6630 # are all built from PIC.
6631 case "$host_os" in
6632 aix3*)
6633   test "$enable_shared" = yes && enable_static=no
6634   if test -n "$RANLIB"; then
6635     archive_cmds="$archive_cmds~\$RANLIB \$lib"
6636     postinstall_cmds='$RANLIB $lib'
6637   fi
6638   ;;
6639
6640 aix4*)
6641   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6642     test "$enable_shared" = yes && enable_static=no
6643   fi
6644   ;;
6645 esac
6646 echo "$ac_t""$enable_shared" 1>&6
6647
6648 echo $ac_n "checking whether to build static libraries""... $ac_c" 1>&6
6649 echo "configure:6650: checking whether to build static libraries" >&5
6650 # Make sure either enable_shared or enable_static is yes.
6651 test "$enable_shared" = yes || enable_static=yes
6652 echo "$ac_t""$enable_static" 1>&6
6653
6654 if test "$hardcode_action" = relink; then
6655   # Fast installation is not supported
6656   enable_fast_install=no
6657 elif test "$shlibpath_overrides_runpath" = yes ||
6658      test "$enable_shared" = no; then
6659   # Fast installation is not necessary
6660   enable_fast_install=needless
6661 fi
6662
6663 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
6664 if test "$GCC" = yes; then
6665   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
6666 fi
6667
6668 if test "x$enable_dlopen" != xyes; then
6669   enable_dlopen=unknown
6670   enable_dlopen_self=unknown
6671   enable_dlopen_self_static=unknown
6672 else
6673   lt_cv_dlopen=no
6674   lt_cv_dlopen_libs=
6675
6676   case $host_os in
6677   beos*)
6678     lt_cv_dlopen="load_add_on"
6679     lt_cv_dlopen_libs=
6680     lt_cv_dlopen_self=yes
6681     ;;
6682
6683   cygwin* | mingw* | pw32*)
6684     lt_cv_dlopen="LoadLibrary"
6685     lt_cv_dlopen_libs=
6686    ;;
6687
6688   *)
6689     echo $ac_n "checking for shl_load""... $ac_c" 1>&6
6690 echo "configure:6691: checking for shl_load" >&5
6691 if eval "test \"\${ac_cv_func_shl_load+set}\" = set"; then
6692   echo $ac_n "(cached) $ac_c" 1>&6
6693 else
6694   cat > conftest.$ac_ext <<EOF
6695 #line 6696 "configure"
6696 #include "confdefs.h"
6697 /* System header to define __stub macros and hopefully few prototypes,
6698     which can conflict with char shl_load(); below.  */
6699 #include <assert.h>
6700 /* Override any gcc2 internal prototype to avoid an error.  */
6701 /* We use char because int might match the return type of a gcc2
6702     builtin and then its argument prototype would still apply.  */
6703 char shl_load();
6704 char (*f)();
6705
6706 int main() {
6707
6708 /* The GNU C library defines this for functions which it implements
6709     to always fail with ENOSYS.  Some functions are actually named
6710     something starting with __ and the normal name is an alias.  */
6711 #if defined (__stub_shl_load) || defined (__stub___shl_load)
6712 choke me
6713 #else
6714 f = shl_load;
6715 #endif
6716
6717 ; return 0; }
6718 EOF
6719 if { (eval echo configure:6720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6720   rm -rf conftest*
6721   eval "ac_cv_func_shl_load=yes"
6722 else
6723   echo "configure: failed program was:" >&5
6724   cat conftest.$ac_ext >&5
6725   rm -rf conftest*
6726   eval "ac_cv_func_shl_load=no"
6727 fi
6728 rm -f conftest*
6729 fi
6730
6731 if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
6732   echo "$ac_t""yes" 1>&6
6733   lt_cv_dlopen="shl_load"
6734 else
6735   echo "$ac_t""no" 1>&6
6736 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
6737 echo "configure:6738: checking for shl_load in -ldld" >&5
6738 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-:%__p__%'`
6739 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6740   echo $ac_n "(cached) $ac_c" 1>&6
6741 else
6742   ac_save_LIBS="$LIBS"
6743 LIBS="-ldld  $LIBS"
6744 cat > conftest.$ac_ext <<EOF
6745 #line 6746 "configure"
6746 #include "confdefs.h"
6747 /* Override any gcc2 internal prototype to avoid an error.  */
6748 /* We use char because int might match the return type of a gcc2
6749     builtin and then its argument prototype would still apply.  */
6750 char shl_load();
6751
6752 int main() {
6753 shl_load()
6754 ; return 0; }
6755 EOF
6756 if { (eval echo configure:6757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6757   rm -rf conftest*
6758   eval "ac_cv_lib_$ac_lib_var=yes"
6759 else
6760   echo "configure: failed program was:" >&5
6761   cat conftest.$ac_ext >&5
6762   rm -rf conftest*
6763   eval "ac_cv_lib_$ac_lib_var=no"
6764 fi
6765 rm -f conftest*
6766 LIBS="$ac_save_LIBS"
6767
6768 fi
6769 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6770   echo "$ac_t""yes" 1>&6
6771   lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
6772 else
6773   echo "$ac_t""no" 1>&6
6774 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
6775 echo "configure:6776: checking for dlopen" >&5
6776 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
6777   echo $ac_n "(cached) $ac_c" 1>&6
6778 else
6779   cat > conftest.$ac_ext <<EOF
6780 #line 6781 "configure"
6781 #include "confdefs.h"
6782 /* System header to define __stub macros and hopefully few prototypes,
6783     which can conflict with char dlopen(); below.  */
6784 #include <assert.h>
6785 /* Override any gcc2 internal prototype to avoid an error.  */
6786 /* We use char because int might match the return type of a gcc2
6787     builtin and then its argument prototype would still apply.  */
6788 char dlopen();
6789 char (*f)();
6790
6791 int main() {
6792
6793 /* The GNU C library defines this for functions which it implements
6794     to always fail with ENOSYS.  Some functions are actually named
6795     something starting with __ and the normal name is an alias.  */
6796 #if defined (__stub_dlopen) || defined (__stub___dlopen)
6797 choke me
6798 #else
6799 f = dlopen;
6800 #endif
6801
6802 ; return 0; }
6803 EOF
6804 if { (eval echo configure:6805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6805   rm -rf conftest*
6806   eval "ac_cv_func_dlopen=yes"
6807 else
6808   echo "configure: failed program was:" >&5
6809   cat conftest.$ac_ext >&5
6810   rm -rf conftest*
6811   eval "ac_cv_func_dlopen=no"
6812 fi
6813 rm -f conftest*
6814 fi
6815
6816 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
6817   echo "$ac_t""yes" 1>&6
6818   lt_cv_dlopen="dlopen"
6819 else
6820   echo "$ac_t""no" 1>&6
6821 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
6822 echo "configure:6823: checking for dlopen in -ldl" >&5
6823 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
6824 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6825   echo $ac_n "(cached) $ac_c" 1>&6
6826 else
6827   ac_save_LIBS="$LIBS"
6828 LIBS="-ldl  $LIBS"
6829 cat > conftest.$ac_ext <<EOF
6830 #line 6831 "configure"
6831 #include "confdefs.h"
6832 /* Override any gcc2 internal prototype to avoid an error.  */
6833 /* We use char because int might match the return type of a gcc2
6834     builtin and then its argument prototype would still apply.  */
6835 char dlopen();
6836
6837 int main() {
6838 dlopen()
6839 ; return 0; }
6840 EOF
6841 if { (eval echo configure:6842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6842   rm -rf conftest*
6843   eval "ac_cv_lib_$ac_lib_var=yes"
6844 else
6845   echo "configure: failed program was:" >&5
6846   cat conftest.$ac_ext >&5
6847   rm -rf conftest*
6848   eval "ac_cv_lib_$ac_lib_var=no"
6849 fi
6850 rm -f conftest*
6851 LIBS="$ac_save_LIBS"
6852
6853 fi
6854 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6855   echo "$ac_t""yes" 1>&6
6856   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
6857 else
6858   echo "$ac_t""no" 1>&6
6859 echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
6860 echo "configure:6861: checking for dlopen in -lsvld" >&5
6861 ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-:%__p__%'`
6862 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6863   echo $ac_n "(cached) $ac_c" 1>&6
6864 else
6865   ac_save_LIBS="$LIBS"
6866 LIBS="-lsvld  $LIBS"
6867 cat > conftest.$ac_ext <<EOF
6868 #line 6869 "configure"
6869 #include "confdefs.h"
6870 /* Override any gcc2 internal prototype to avoid an error.  */
6871 /* We use char because int might match the return type of a gcc2
6872     builtin and then its argument prototype would still apply.  */
6873 char dlopen();
6874
6875 int main() {
6876 dlopen()
6877 ; return 0; }
6878 EOF
6879 if { (eval echo configure:6880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6880   rm -rf conftest*
6881   eval "ac_cv_lib_$ac_lib_var=yes"
6882 else
6883   echo "configure: failed program was:" >&5
6884   cat conftest.$ac_ext >&5
6885   rm -rf conftest*
6886   eval "ac_cv_lib_$ac_lib_var=no"
6887 fi
6888 rm -f conftest*
6889 LIBS="$ac_save_LIBS"
6890
6891 fi
6892 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6893   echo "$ac_t""yes" 1>&6
6894   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
6895 else
6896   echo "$ac_t""no" 1>&6
6897 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
6898 echo "configure:6899: checking for dld_link in -ldld" >&5
6899 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-:%__p__%'`
6900 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6901   echo $ac_n "(cached) $ac_c" 1>&6
6902 else
6903   ac_save_LIBS="$LIBS"
6904 LIBS="-ldld  $LIBS"
6905 cat > conftest.$ac_ext <<EOF
6906 #line 6907 "configure"
6907 #include "confdefs.h"
6908 /* Override any gcc2 internal prototype to avoid an error.  */
6909 /* We use char because int might match the return type of a gcc2
6910     builtin and then its argument prototype would still apply.  */
6911 char dld_link();
6912
6913 int main() {
6914 dld_link()
6915 ; return 0; }
6916 EOF
6917 if { (eval echo configure:6918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6918   rm -rf conftest*
6919   eval "ac_cv_lib_$ac_lib_var=yes"
6920 else
6921   echo "configure: failed program was:" >&5
6922   cat conftest.$ac_ext >&5
6923   rm -rf conftest*
6924   eval "ac_cv_lib_$ac_lib_var=no"
6925 fi
6926 rm -f conftest*
6927 LIBS="$ac_save_LIBS"
6928
6929 fi
6930 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6931   echo "$ac_t""yes" 1>&6
6932   lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
6933 else
6934   echo "$ac_t""no" 1>&6
6935 fi
6936
6937               
6938 fi
6939
6940             
6941 fi
6942
6943           
6944 fi
6945
6946         
6947 fi
6948
6949       
6950 fi
6951
6952     ;;
6953   esac
6954
6955   if test "x$lt_cv_dlopen" != xno; then
6956     enable_dlopen=yes
6957   else
6958     enable_dlopen=no
6959   fi
6960
6961   case $lt_cv_dlopen in
6962   dlopen)
6963     save_CPPFLAGS="$CPPFLAGS"
6964         test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
6965
6966     save_LDFLAGS="$LDFLAGS"
6967     eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
6968
6969     save_LIBS="$LIBS"
6970     LIBS="$lt_cv_dlopen_libs $LIBS"
6971
6972     echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
6973 echo "configure:6974: checking whether a program can dlopen itself" >&5
6974 if eval "test \"\${lt_cv_dlopen_self+set}\" = set"; then
6975   echo $ac_n "(cached) $ac_c" 1>&6
6976 else
6977           if test "$cross_compiling" = yes; then :
6978   lt_cv_dlopen_self=cross
6979 else
6980     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
6981   lt_status=$lt_dlunknown
6982   cat > conftest.$ac_ext <<EOF
6983 #line 6984 "configure"
6984 #include "confdefs.h"
6985
6986 #if HAVE_DLFCN_H
6987 #include <dlfcn.h>
6988 #endif
6989
6990 #include <stdio.h>
6991
6992 #ifdef RTLD_GLOBAL
6993 #  define LT_DLGLOBAL           RTLD_GLOBAL
6994 #else
6995 #  ifdef DL_GLOBAL
6996 #    define LT_DLGLOBAL         DL_GLOBAL
6997 #  else
6998 #    define LT_DLGLOBAL         0
6999 #  endif
7000 #endif
7001
7002 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
7003    find out it does not work in some platform. */
7004 #ifndef LT_DLLAZY_OR_NOW
7005 #  ifdef RTLD_LAZY
7006 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
7007 #  else
7008 #    ifdef DL_LAZY
7009 #      define LT_DLLAZY_OR_NOW          DL_LAZY
7010 #    else
7011 #      ifdef RTLD_NOW
7012 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
7013 #      else
7014 #        ifdef DL_NOW
7015 #          define LT_DLLAZY_OR_NOW      DL_NOW
7016 #        else
7017 #          define LT_DLLAZY_OR_NOW      0
7018 #        endif
7019 #      endif
7020 #    endif
7021 #  endif
7022 #endif
7023
7024 #ifdef __cplusplus
7025 extern "C" void exit (int);
7026 #endif
7027
7028 void fnord() { int i=42;}
7029 int main ()
7030 {
7031   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
7032   int status = $lt_dlunknown;
7033
7034   if (self)
7035     {
7036       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
7037       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
7038       /* dlclose (self); */
7039     }
7040
7041     exit (status);
7042 }
7043 EOF
7044   if { (eval echo configure:7045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
7045     (./conftest; exit; ) 2>/dev/null
7046     lt_status=$?
7047     case x$lt_status in
7048       x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
7049       x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
7050       x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
7051     esac
7052   else :
7053     # compilation failed
7054     lt_cv_dlopen_self=no
7055   fi
7056 fi
7057 rm -fr conftest*
7058
7059     
7060 fi
7061
7062 echo "$ac_t""$lt_cv_dlopen_self" 1>&6
7063
7064     if test "x$lt_cv_dlopen_self" = xyes; then
7065       LDFLAGS="$LDFLAGS $link_static_flag"
7066       echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
7067 echo "configure:7068: checking whether a statically linked program can dlopen itself" >&5
7068 if eval "test \"\${lt_cv_dlopen_self_static+set}\" = set"; then
7069   echo $ac_n "(cached) $ac_c" 1>&6
7070 else
7071           if test "$cross_compiling" = yes; then :
7072   lt_cv_dlopen_self_static=cross
7073 else
7074     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
7075   lt_status=$lt_dlunknown
7076   cat > conftest.$ac_ext <<EOF
7077 #line 7078 "configure"
7078 #include "confdefs.h"
7079
7080 #if HAVE_DLFCN_H
7081 #include <dlfcn.h>
7082 #endif
7083
7084 #include <stdio.h>
7085
7086 #ifdef RTLD_GLOBAL
7087 #  define LT_DLGLOBAL           RTLD_GLOBAL
7088 #else
7089 #  ifdef DL_GLOBAL
7090 #    define LT_DLGLOBAL         DL_GLOBAL
7091 #  else
7092 #    define LT_DLGLOBAL         0
7093 #  endif
7094 #endif
7095
7096 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
7097    find out it does not work in some platform. */
7098 #ifndef LT_DLLAZY_OR_NOW
7099 #  ifdef RTLD_LAZY
7100 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
7101 #  else
7102 #    ifdef DL_LAZY
7103 #      define LT_DLLAZY_OR_NOW          DL_LAZY
7104 #    else
7105 #      ifdef RTLD_NOW
7106 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
7107 #      else
7108 #        ifdef DL_NOW
7109 #          define LT_DLLAZY_OR_NOW      DL_NOW
7110 #        else
7111 #          define LT_DLLAZY_OR_NOW      0
7112 #        endif
7113 #      endif
7114 #    endif
7115 #  endif
7116 #endif
7117
7118 #ifdef __cplusplus
7119 extern "C" void exit (int);
7120 #endif
7121
7122 void fnord() { int i=42;}
7123 int main ()
7124 {
7125   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
7126   int status = $lt_dlunknown;
7127
7128   if (self)
7129     {
7130       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
7131       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
7132       /* dlclose (self); */
7133     }
7134
7135     exit (status);
7136 }
7137 EOF
7138   if { (eval echo configure:7139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
7139     (./conftest; exit; ) 2>/dev/null
7140     lt_status=$?
7141     case x$lt_status in
7142       x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
7143       x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
7144       x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
7145     esac
7146   else :
7147     # compilation failed
7148     lt_cv_dlopen_self_static=no
7149   fi
7150 fi
7151 rm -fr conftest*
7152
7153       
7154 fi
7155
7156 echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
7157     fi
7158
7159     CPPFLAGS="$save_CPPFLAGS"
7160     LDFLAGS="$save_LDFLAGS"
7161     LIBS="$save_LIBS"
7162     ;;
7163   esac
7164
7165   case $lt_cv_dlopen_self in
7166   yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
7167   *) enable_dlopen_self=unknown ;;
7168   esac
7169
7170   case $lt_cv_dlopen_self_static in
7171   yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
7172   *) enable_dlopen_self_static=unknown ;;
7173   esac
7174 fi
7175
7176
7177 if test "$enable_shared" = yes && test "$GCC" = yes; then
7178   case $archive_cmds in
7179   *'~'*)
7180     # FIXME: we may have to deal with multi-command sequences.
7181     ;;
7182   '$CC '*)
7183     # Test whether the compiler implicitly links with -lc since on some
7184     # systems, -lgcc has to come before -lc. If gcc already passes -lc
7185     # to ld, don't add -lc before -lgcc.
7186     echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6
7187 echo "configure:7188: checking whether -lc should be explicitly linked in" >&5
7188     if eval "test \"\${lt_cv_archive_cmds_need_lc+set}\" = set"; then
7189   echo $ac_n "(cached) $ac_c" 1>&6
7190 else
7191   $rm conftest*
7192     echo 'static int dummy;' > conftest.$ac_ext
7193
7194     if { (eval echo configure:7195: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7195       soname=conftest
7196       lib=conftest
7197       libobjs=conftest.$ac_objext
7198       deplibs=
7199       wl=$lt_cv_prog_cc_wl
7200       compiler_flags=-v
7201       linker_flags=-v
7202       verstring=
7203       output_objdir=.
7204       libname=conftest
7205       save_allow_undefined_flag=$allow_undefined_flag
7206       allow_undefined_flag=
7207       if { (eval echo configure:7208: \"$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; }
7208       then
7209         lt_cv_archive_cmds_need_lc=no
7210       else
7211         lt_cv_archive_cmds_need_lc=yes
7212       fi
7213       allow_undefined_flag=$save_allow_undefined_flag
7214     else
7215       cat conftest.err 1>&5
7216     fi
7217 fi
7218
7219     echo "$ac_t""$lt_cv_archive_cmds_need_lc" 1>&6
7220     ;;
7221   esac
7222 fi
7223 need_lc=${lt_cv_archive_cmds_need_lc-yes}
7224
7225 # The second clause should only fire when bootstrapping the
7226 # libtool distribution, otherwise you forgot to ship ltmain.sh
7227 # with your package, and you will get complaints that there are
7228 # no rules to generate ltmain.sh.
7229 if test -f "$ltmain"; then
7230   :
7231 else
7232   # If there is no Makefile yet, we rely on a make rule to execute
7233   # `config.status --recheck' to rerun these tests and create the
7234   # libtool script then.
7235   test -f Makefile && make "$ltmain"
7236 fi
7237
7238 if test -f "$ltmain"; then
7239   trap "$rm \"${ofile}T\"; exit 1" 1 2 15
7240   $rm -f "${ofile}T"
7241
7242   echo creating $ofile
7243
7244   # Now quote all the things that may contain metacharacters while being
7245   # careful not to overquote the AC_SUBSTed values.  We take copies of the
7246   # variables and quote the copies for generation of the libtool script.
7247   for var in echo old_CC old_CFLAGS SED \
7248     AR AR_FLAGS CC LD LN_S NM SHELL \
7249     reload_flag reload_cmds wl \
7250     pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
7251     thread_safe_flag_spec whole_archive_flag_spec libname_spec \
7252     library_names_spec soname_spec \
7253     RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
7254     old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
7255     postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
7256     old_striplib striplib file_magic_cmd export_symbols_cmds \
7257     deplibs_check_method allow_undefined_flag no_undefined_flag \
7258     finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
7259     global_symbol_to_c_name_address \
7260     hardcode_libdir_flag_spec hardcode_libdir_separator  \
7261     sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
7262     compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
7263
7264     case $var in
7265     reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
7266     old_postinstall_cmds | old_postuninstall_cmds | \
7267     export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
7268     extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
7269     postinstall_cmds | postuninstall_cmds | \
7270     finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
7271       # Double-quote double-evaled strings.
7272       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
7273       ;;
7274     *)
7275       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
7276       ;;
7277     esac
7278   done
7279
7280   cat <<__EOF__ > "${ofile}T"
7281 #! $SHELL
7282
7283 # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
7284 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
7285 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
7286 #
7287 # Copyright (C) 1996-2000 Free Software Foundation, Inc.
7288 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7289 #
7290 # This program is free software; you can redistribute it and/or modify
7291 # it under the terms of the GNU General Public License as published by
7292 # the Free Software Foundation; either version 2 of the License, or
7293 # (at your option) any later version.
7294 #
7295 # This program is distributed in the hope that it will be useful, but
7296 # WITHOUT ANY WARRANTY; without even the implied warranty of
7297 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
7298 # General Public License for more details.
7299 #
7300 # You should have received a copy of the GNU General Public License
7301 # along with this program; if not, write to the Free Software
7302 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
7303 #
7304 # As a special exception to the GNU General Public License, if you
7305 # distribute this file as part of a program that contains a
7306 # configuration script generated by Autoconf, you may include it under
7307 # the same distribution terms that you use for the rest of that program.
7308
7309 # A sed that does not truncate output.
7310 SED=$lt_SED
7311
7312 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
7313 Xsed="${SED} -e s/^X//"
7314
7315 # The HP-UX ksh and POSIX shell print the target directory to stdout
7316 # if CDPATH is set.
7317 if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
7318
7319 # ### BEGIN LIBTOOL CONFIG
7320
7321 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
7322
7323 # Shell to use when invoking shell scripts.
7324 SHELL=$lt_SHELL
7325
7326 # Whether or not to build shared libraries.
7327 build_libtool_libs=$enable_shared
7328
7329 # Whether or not to build static libraries.
7330 build_old_libs=$enable_static
7331
7332 # Whether or not to add -lc for building shared libraries.
7333 build_libtool_need_lc=$need_lc
7334
7335 # Whether or not to optimize for fast installation.
7336 fast_install=$enable_fast_install
7337
7338 # The host system.
7339 host_alias=$host_alias
7340 host=$host
7341
7342 # An echo program that does not interpret backslashes.
7343 echo=$lt_echo
7344
7345 # The archiver.
7346 AR=$lt_AR
7347 AR_FLAGS=$lt_AR_FLAGS
7348
7349 # The default C compiler.
7350 CC=$lt_CC
7351
7352 # Is the compiler the GNU C compiler?
7353 with_gcc=$GCC
7354
7355 # The linker used to build libraries.
7356 LD=$lt_LD
7357
7358 # Whether we need hard or soft links.
7359 LN_S=$lt_LN_S
7360
7361 # A BSD-compatible nm program.
7362 NM=$lt_NM
7363
7364 # A symbol stripping program
7365 STRIP=$STRIP
7366
7367 # Used to examine libraries when file_magic_cmd begins "file"
7368 MAGIC_CMD=$MAGIC_CMD
7369
7370 # Used on cygwin: DLL creation program.
7371 DLLTOOL="$DLLTOOL"
7372
7373 # Used on cygwin: object dumper.
7374 OBJDUMP="$OBJDUMP"
7375
7376 # Used on cygwin: assembler.
7377 AS="$AS"
7378
7379 # The name of the directory that contains temporary libtool files.
7380 objdir=$objdir
7381
7382 # How to create reloadable object files.
7383 reload_flag=$lt_reload_flag
7384 reload_cmds=$lt_reload_cmds
7385
7386 # How to pass a linker flag through the compiler.
7387 wl=$lt_wl
7388
7389 # Object file suffix (normally "o").
7390 objext="$ac_objext"
7391
7392 # Old archive suffix (normally "a").
7393 libext="$libext"
7394
7395 # Executable file suffix (normally "").
7396 exeext="$exeext"
7397
7398 # Additional compiler flags for building library objects.
7399 pic_flag=$lt_pic_flag
7400 pic_mode=$pic_mode
7401
7402 # Does compiler simultaneously support -c and -o options?
7403 compiler_c_o=$lt_compiler_c_o
7404
7405 # Can we write directly to a .lo ?
7406 compiler_o_lo=$lt_compiler_o_lo
7407
7408 # Must we lock files when doing compilation ?
7409 need_locks=$lt_need_locks
7410
7411 # Do we need the lib prefix for modules?
7412 need_lib_prefix=$need_lib_prefix
7413
7414 # Do we need a version for libraries?
7415 need_version=$need_version
7416
7417 # Whether dlopen is supported.
7418 dlopen_support=$enable_dlopen
7419
7420 # Whether dlopen of programs is supported.
7421 dlopen_self=$enable_dlopen_self
7422
7423 # Whether dlopen of statically linked programs is supported.
7424 dlopen_self_static=$enable_dlopen_self_static
7425
7426 # Compiler flag to prevent dynamic linking.
7427 link_static_flag=$lt_link_static_flag
7428
7429 # Compiler flag to turn off builtin functions.
7430 no_builtin_flag=$lt_no_builtin_flag
7431
7432 # Compiler flag to allow reflexive dlopens.
7433 export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
7434
7435 # Compiler flag to generate shared objects directly from archives.
7436 whole_archive_flag_spec=$lt_whole_archive_flag_spec
7437
7438 # Compiler flag to generate thread-safe objects.
7439 thread_safe_flag_spec=$lt_thread_safe_flag_spec
7440
7441 # Library versioning type.
7442 version_type=$version_type
7443
7444 # Format of library name prefix.
7445 libname_spec=$lt_libname_spec
7446
7447 # List of archive names.  First name is the real one, the rest are links.
7448 # The last name is the one that the linker finds with -lNAME.
7449 library_names_spec=$lt_library_names_spec
7450
7451 # The coded name of the library, if different from the real name.
7452 soname_spec=$lt_soname_spec
7453
7454 # Commands used to build and install an old-style archive.
7455 RANLIB=$lt_RANLIB
7456 old_archive_cmds=$lt_old_archive_cmds
7457 old_postinstall_cmds=$lt_old_postinstall_cmds
7458 old_postuninstall_cmds=$lt_old_postuninstall_cmds
7459
7460 # Create an old-style archive from a shared archive.
7461 old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
7462
7463 # Create a temporary old-style archive to link instead of a shared archive.
7464 old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
7465
7466 # Commands used to build and install a shared archive.
7467 archive_cmds=$lt_archive_cmds
7468 archive_expsym_cmds=$lt_archive_expsym_cmds
7469 postinstall_cmds=$lt_postinstall_cmds
7470 postuninstall_cmds=$lt_postuninstall_cmds
7471
7472 # Commands to strip libraries.
7473 old_striplib=$lt_old_striplib
7474 striplib=$lt_striplib
7475
7476 # Method to check whether dependent libraries are shared objects.
7477 deplibs_check_method=$lt_deplibs_check_method
7478
7479 # Command to use when deplibs_check_method == file_magic.
7480 file_magic_cmd=$lt_file_magic_cmd
7481
7482 # Flag that allows shared libraries with undefined symbols to be built.
7483 allow_undefined_flag=$lt_allow_undefined_flag
7484
7485 # Flag that forces no undefined symbols.
7486 no_undefined_flag=$lt_no_undefined_flag
7487
7488 # Commands used to finish a libtool library installation in a directory.
7489 finish_cmds=$lt_finish_cmds
7490
7491 # Same as above, but a single script fragment to be evaled but not shown.
7492 finish_eval=$lt_finish_eval
7493
7494 # Take the output of nm and produce a listing of raw symbols and C names.
7495 global_symbol_pipe=$lt_global_symbol_pipe
7496
7497 # Transform the output of nm in a proper C declaration
7498 global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
7499
7500 # Transform the output of nm in a C name address pair
7501 global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
7502
7503 # This is the shared library runtime path variable.
7504 runpath_var=$runpath_var
7505
7506 # This is the shared library path variable.
7507 shlibpath_var=$shlibpath_var
7508
7509 # Is shlibpath searched before the hard-coded library search path?
7510 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
7511
7512 # How to hardcode a shared library path into an executable.
7513 hardcode_action=$hardcode_action
7514
7515 # Whether we should hardcode library paths into libraries.
7516 hardcode_into_libs=$hardcode_into_libs
7517
7518 # Flag to hardcode \$libdir into a binary during linking.
7519 # This must work even if \$libdir does not exist.
7520 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
7521
7522 # Whether we need a single -rpath flag with a separated argument.
7523 hardcode_libdir_separator=$lt_hardcode_libdir_separator
7524
7525 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
7526 # resulting binary.
7527 hardcode_direct=$hardcode_direct
7528
7529 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7530 # resulting binary.
7531 hardcode_minus_L=$hardcode_minus_L
7532
7533 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7534 # the resulting binary.
7535 hardcode_shlibpath_var=$hardcode_shlibpath_var
7536
7537 # Variables whose values should be saved in libtool wrapper scripts and
7538 # restored at relink time.
7539 variables_saved_for_relink="$variables_saved_for_relink"
7540
7541 # Whether libtool must link a program against all its dependency libraries.
7542 link_all_deplibs=$link_all_deplibs
7543
7544 # Compile-time system search path for libraries
7545 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
7546
7547 # Run-time system search path for libraries
7548 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
7549
7550 # Fix the shell variable \$srcfile for the compiler.
7551 fix_srcfile_path="$fix_srcfile_path"
7552
7553 # Set to yes if exported symbols are required.
7554 always_export_symbols=$always_export_symbols
7555
7556 # The commands to list exported symbols.
7557 export_symbols_cmds=$lt_export_symbols_cmds
7558
7559 # The commands to extract the exported symbol list from a shared archive.
7560 extract_expsyms_cmds=$lt_extract_expsyms_cmds
7561
7562 # Symbols that should not be listed in the preloaded symbols.
7563 exclude_expsyms=$lt_exclude_expsyms
7564
7565 # Symbols that must always be exported.
7566 include_expsyms=$lt_include_expsyms
7567
7568 # ### END LIBTOOL CONFIG
7569
7570 __EOF__
7571
7572   case $host_os in
7573   aix3*)
7574     cat <<\EOF >> "${ofile}T"
7575
7576 # AIX sometimes has problems with the GCC collect2 program.  For some
7577 # reason, if we set the COLLECT_NAMES environment variable, the problems
7578 # vanish in a puff of smoke.
7579 if test "X${COLLECT_NAMES+set}" != Xset; then
7580   COLLECT_NAMES=
7581   export COLLECT_NAMES
7582 fi
7583 EOF
7584     ;;
7585   esac
7586
7587   case $host_os in
7588   cygwin* | mingw* | pw32* | os2*)
7589     cat <<'EOF' >> "${ofile}T"
7590       # This is a source program that is used to create dlls on Windows
7591       # Don't remove nor modify the starting and closing comments
7592 # /* ltdll.c starts here */
7593 # #define WIN32_LEAN_AND_MEAN
7594 # #include <windows.h>
7595 # #undef WIN32_LEAN_AND_MEAN
7596 # #include <stdio.h>
7597 #
7598 # #ifndef __CYGWIN__
7599 # #  ifdef __CYGWIN32__
7600 # #    define __CYGWIN__ __CYGWIN32__
7601 # #  endif
7602 # #endif
7603 #
7604 # #ifdef __cplusplus
7605 # extern "C" {
7606 # #endif
7607 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
7608 # #ifdef __cplusplus
7609 # }
7610 # #endif
7611 #
7612 # #ifdef __CYGWIN__
7613 # #include <cygwin/cygwin_dll.h>
7614 # DECLARE_CYGWIN_DLL( DllMain );
7615 # #endif
7616 # HINSTANCE __hDllInstance_base;
7617 #
7618 # BOOL APIENTRY
7619 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
7620 # {
7621 #   __hDllInstance_base = hInst;
7622 #   return TRUE;
7623 # }
7624 # /* ltdll.c ends here */
7625         # This is a source program that is used to create import libraries
7626         # on Windows for dlls which lack them. Don't remove nor modify the
7627         # starting and closing comments
7628 # /* impgen.c starts here */
7629 # /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
7630 #
7631 #  This file is part of GNU libtool.
7632 #
7633 #  This program is free software; you can redistribute it and/or modify
7634 #  it under the terms of the GNU General Public License as published by
7635 #  the Free Software Foundation; either version 2 of the License, or
7636 #  (at your option) any later version.
7637 #
7638 #  This program is distributed in the hope that it will be useful,
7639 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
7640 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
7641 #  GNU General Public License for more details.
7642 #
7643 #  You should have received a copy of the GNU General Public License
7644 #  along with this program; if not, write to the Free Software
7645 #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
7646 #  */
7647 #
7648 # #include <stdio.h>            /* for printf() */
7649 # #include <unistd.h>           /* for open(), lseek(), read() */
7650 # #include <fcntl.h>            /* for O_RDONLY, O_BINARY */
7651 # #include <string.h>           /* for strdup() */
7652 #
7653 # /* O_BINARY isn't required (or even defined sometimes) under Unix */
7654 # #ifndef O_BINARY
7655 # #define O_BINARY 0
7656 # #endif
7657 #
7658 # static unsigned int
7659 # pe_get16 (fd, offset)
7660 #      int fd;
7661 #      int offset;
7662 # {
7663 #   unsigned char b[2];
7664 #   lseek (fd, offset, SEEK_SET);
7665 #   read (fd, b, 2);
7666 #   return b[0] + (b[1]<<8);
7667 # }
7668 #
7669 # static unsigned int
7670 # pe_get32 (fd, offset)
7671 #     int fd;
7672 #     int offset;
7673 # {
7674 #   unsigned char b[4];
7675 #   lseek (fd, offset, SEEK_SET);
7676 #   read (fd, b, 4);
7677 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
7678 # }
7679 #
7680 # static unsigned int
7681 # pe_as32 (ptr)
7682 #      void *ptr;
7683 # {
7684 #   unsigned char *b = ptr;
7685 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
7686 # }
7687 #
7688 # int
7689 # main (argc, argv)
7690 #     int argc;
7691 #     char *argv[];
7692 # {
7693 #     int dll;
7694 #     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
7695 #     unsigned long export_rva, export_size, nsections, secptr, expptr;
7696 #     unsigned long name_rvas, nexp;
7697 #     unsigned char *expdata, *erva;
7698 #     char *filename, *dll_name;
7699 #
7700 #     filename = argv[1];
7701 #
7702 #     dll = open(filename, O_RDONLY|O_BINARY);
7703 #     if (dll < 1)
7704 #       return 1;
7705 #
7706 #     dll_name = filename;
7707 #
7708 #     for (i=0; filename[i]; i++)
7709 #       if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
7710 #           dll_name = filename + i +1;
7711 #
7712 #     pe_header_offset = pe_get32 (dll, 0x3c);
7713 #     opthdr_ofs = pe_header_offset + 4 + 20;
7714 #     num_entries = pe_get32 (dll, opthdr_ofs + 92);
7715 #
7716 #     if (num_entries < 1) /* no exports */
7717 #       return 1;
7718 #
7719 #     export_rva = pe_get32 (dll, opthdr_ofs + 96);
7720 #     export_size = pe_get32 (dll, opthdr_ofs + 100);
7721 #     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
7722 #     secptr = (pe_header_offset + 4 + 20 +
7723 #             pe_get16 (dll, pe_header_offset + 4 + 16));
7724 #
7725 #     expptr = 0;
7726 #     for (i = 0; i < nsections; i++)
7727 #     {
7728 #       char sname[8];
7729 #       unsigned long secptr1 = secptr + 40 * i;
7730 #       unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
7731 #       unsigned long vsize = pe_get32 (dll, secptr1 + 16);
7732 #       unsigned long fptr = pe_get32 (dll, secptr1 + 20);
7733 #       lseek(dll, secptr1, SEEK_SET);
7734 #       read(dll, sname, 8);
7735 #       if (vaddr <= export_rva && vaddr+vsize > export_rva)
7736 #       {
7737 #           expptr = fptr + (export_rva - vaddr);
7738 #           if (export_rva + export_size > vaddr + vsize)
7739 #               export_size = vsize - (export_rva - vaddr);
7740 #           break;
7741 #       }
7742 #     }
7743 #
7744 #     expdata = (unsigned char*)malloc(export_size);
7745 #     lseek (dll, expptr, SEEK_SET);
7746 #     read (dll, expdata, export_size);
7747 #     erva = expdata - export_rva;
7748 #
7749 #     nexp = pe_as32 (expdata+24);
7750 #     name_rvas = pe_as32 (expdata+32);
7751 #
7752 #     printf ("EXPORTS\n");
7753 #     for (i = 0; i<nexp; i++)
7754 #     {
7755 #       unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
7756 #       printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
7757 #     }
7758 #
7759 #     return 0;
7760 # }
7761 # /* impgen.c ends here */
7762
7763 EOF
7764     ;;
7765   esac
7766
7767   # We use sed instead of cat because bash on DJGPP gets confused if
7768   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
7769   # text mode, it properly converts lines to CR/LF.  This bash problem
7770   # is reportedly fixed, but why not run on old versions too?
7771   sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
7772
7773   mv -f "${ofile}T" "$ofile" || \
7774     (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
7775   chmod +x "$ofile"
7776 fi
7777
7778
7779
7780
7781
7782 # This can be used to rebuild libtool when needed
7783 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
7784
7785 # Always use our own libtool.
7786 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
7787
7788 # Prevent multiple expansion
7789
7790
7791
7792 # test for ln hardlink support
7793 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
7794 echo "configure:7795: checking whether ln works" >&5
7795 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
7796   echo $ac_n "(cached) $ac_c" 1>&6
7797 else
7798   rm -f conftest.src conftest.dst
7799 echo "conftest" > conftest.src
7800 if ln conftest.src conftest.dst 2>/dev/null
7801 then
7802   ol_cv_prog_LN_H="ln"
7803 else
7804   ol_cv_prog_LN_H="cp"
7805 fi
7806 rm -f conftest.src conftest.dst
7807
7808 fi
7809 LN_H="$ol_cv_prog_LN_H"
7810 if test "$ol_cv_prog_LN_H" = "ln"; then
7811         echo "$ac_t""yes" 1>&6
7812 else
7813         echo "$ac_t""no" 1>&6
7814 fi
7815
7816 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
7817 echo "configure:7818: checking whether ln -s works" >&5
7818 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
7819   echo $ac_n "(cached) $ac_c" 1>&6
7820 else
7821   rm -f conftestdata
7822 if ln -s X conftestdata 2>/dev/null
7823 then
7824   rm -f conftestdata
7825   ac_cv_prog_LN_S="ln -s"
7826 else
7827   ac_cv_prog_LN_S=ln
7828 fi
7829 fi
7830 LN_S="$ac_cv_prog_LN_S"
7831 if test "$ac_cv_prog_LN_S" = "ln -s"; then
7832   echo "$ac_t""yes" 1>&6
7833 else
7834   echo "$ac_t""no" 1>&6
7835 fi
7836
7837
7838 ol_link_perl=no
7839 if test $ol_enable_perl != no ; then
7840         # Extract the first word of "perl", so it can be a program name with args.
7841 set dummy perl; ac_word=$2
7842 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7843 echo "configure:7844: checking for $ac_word" >&5
7844 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
7845   echo $ac_n "(cached) $ac_c" 1>&6
7846 else
7847   case "$PERLBIN" in
7848   /*)
7849   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
7850   ;;
7851   ?:/*)
7852   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
7853   ;;
7854   *)
7855   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7856   ac_dummy="$PATH"
7857   for ac_dir in $ac_dummy; do 
7858     test -z "$ac_dir" && ac_dir=.
7859     if test -f $ac_dir/$ac_word; then
7860       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
7861       break
7862     fi
7863   done
7864   IFS="$ac_save_ifs"
7865   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
7866   ;;
7867 esac
7868 fi
7869 PERLBIN="$ac_cv_path_PERLBIN"
7870 if test -n "$PERLBIN"; then
7871   echo "$ac_t""$PERLBIN" 1>&6
7872 else
7873   echo "$ac_t""no" 1>&6
7874 fi
7875
7876
7877         if test "no$PERLBIN" = "no" ; then
7878                 if test $ol_enable_perl = yes ; then
7879                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
7880                 fi
7881
7882         else
7883                 PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
7884                 if test x"$ol_with_perl_module" = "xstatic" ; then
7885                         SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
7886                 else
7887                         MOD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
7888                 fi
7889                                 ol_link_perl=yes
7890         fi
7891 fi
7892
7893 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
7894 echo "configure:7895: checking how to run the C preprocessor" >&5
7895 # On Suns, sometimes $CPP names a directory.
7896 if test -n "$CPP" && test -d "$CPP"; then
7897   CPP=
7898 fi
7899 if test -z "$CPP"; then
7900 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
7901   echo $ac_n "(cached) $ac_c" 1>&6
7902 else
7903     # This must be in double quotes, not single quotes, because CPP may get
7904   # substituted into the Makefile and "${CC-cc}" will confuse make.
7905   CPP="${CC-cc} -E"
7906   # On the NeXT, cc -E runs the code through the compiler's parser,
7907   # not just through cpp.
7908   cat > conftest.$ac_ext <<EOF
7909 #line 7910 "configure"
7910 #include "confdefs.h"
7911 #include <assert.h>
7912 Syntax Error
7913 EOF
7914 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7915 { (eval echo configure:7916: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7916 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7917 if test -z "$ac_err"; then
7918   :
7919 else
7920   echo "$ac_err" >&5
7921   echo "configure: failed program was:" >&5
7922   cat conftest.$ac_ext >&5
7923   rm -rf conftest*
7924   CPP="${CC-cc} -E -traditional-cpp"
7925   cat > conftest.$ac_ext <<EOF
7926 #line 7927 "configure"
7927 #include "confdefs.h"
7928 #include <assert.h>
7929 Syntax Error
7930 EOF
7931 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7932 { (eval echo configure:7933: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7933 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7934 if test -z "$ac_err"; then
7935   :
7936 else
7937   echo "$ac_err" >&5
7938   echo "configure: failed program was:" >&5
7939   cat conftest.$ac_ext >&5
7940   rm -rf conftest*
7941   CPP="${CC-cc} -nologo -E"
7942   cat > conftest.$ac_ext <<EOF
7943 #line 7944 "configure"
7944 #include "confdefs.h"
7945 #include <assert.h>
7946 Syntax Error
7947 EOF
7948 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7949 { (eval echo configure:7950: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7950 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7951 if test -z "$ac_err"; then
7952   :
7953 else
7954   echo "$ac_err" >&5
7955   echo "configure: failed program was:" >&5
7956   cat conftest.$ac_ext >&5
7957   rm -rf conftest*
7958   CPP=/lib/cpp
7959 fi
7960 rm -f conftest*
7961 fi
7962 rm -f conftest*
7963 fi
7964 rm -f conftest*
7965   ac_cv_prog_CPP="$CPP"
7966 fi
7967   CPP="$ac_cv_prog_CPP"
7968 else
7969   ac_cv_prog_CPP="$CPP"
7970 fi
7971 echo "$ac_t""$CPP" 1>&6
7972
7973
7974 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
7975         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
7976
7977 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
7978         echo "configure: warning: programs compiled here do run here..." 1>&2
7979         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
7980
7981 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
7982         echo "configure: warning: programs compiled here do not run here..." 1>&2
7983         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
7984 fi
7985
7986
7987 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
7988 echo "configure:7989: checking for Cygwin environment" >&5
7989 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
7990   echo $ac_n "(cached) $ac_c" 1>&6
7991 else
7992   cat > conftest.$ac_ext <<EOF
7993 #line 7994 "configure"
7994 #include "confdefs.h"
7995
7996 int main() {
7997
7998 #ifndef __CYGWIN__
7999 #define __CYGWIN__ __CYGWIN32__
8000 #endif
8001 return __CYGWIN__;
8002 ; return 0; }
8003 EOF
8004 if { (eval echo configure:8005: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8005   rm -rf conftest*
8006   ac_cv_cygwin=yes
8007 else
8008   echo "configure: failed program was:" >&5
8009   cat conftest.$ac_ext >&5
8010   rm -rf conftest*
8011   ac_cv_cygwin=no
8012 fi
8013 rm -f conftest*
8014 fi
8015
8016 echo "$ac_t""$ac_cv_cygwin" 1>&6
8017 CYGWIN=
8018 test "$ac_cv_cygwin" = yes && CYGWIN=yes
8019 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
8020 echo "configure:8021: checking for mingw32 environment" >&5
8021 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
8022   echo $ac_n "(cached) $ac_c" 1>&6
8023 else
8024   cat > conftest.$ac_ext <<EOF
8025 #line 8026 "configure"
8026 #include "confdefs.h"
8027
8028 int main() {
8029 return __MINGW32__;
8030 ; return 0; }
8031 EOF
8032 if { (eval echo configure:8033: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8033   rm -rf conftest*
8034   ac_cv_mingw32=yes
8035 else
8036   echo "configure: failed program was:" >&5
8037   cat conftest.$ac_ext >&5
8038   rm -rf conftest*
8039   ac_cv_mingw32=no
8040 fi
8041 rm -f conftest*
8042 fi
8043
8044 echo "$ac_t""$ac_cv_mingw32" 1>&6
8045 MINGW32=
8046 test "$ac_cv_mingw32" = yes && MINGW32=yes
8047
8048
8049
8050 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
8051 echo "configure:8052: checking for executable suffix" >&5
8052 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
8053   echo $ac_n "(cached) $ac_c" 1>&6
8054 else
8055   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
8056   ac_cv_exeext=.exe
8057 else
8058   rm -f conftest*
8059   echo 'int main () { return 0; }' > conftest.$ac_ext
8060   ac_cv_exeext=
8061   if { (eval echo configure:8062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
8062     for file in conftest.*; do
8063       case $file in
8064       *.c | *.C | *.o | *.obj | *.xcoff) ;;
8065       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
8066       esac
8067     done
8068   else
8069     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
8070   fi
8071   rm -f conftest*
8072   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
8073 fi
8074 fi
8075
8076 EXEEXT=""
8077 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
8078 echo "$ac_t""${ac_cv_exeext}" 1>&6
8079 ac_exeext=$EXEEXT
8080
8081 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
8082 echo "configure:8083: checking for object suffix" >&5
8083 if eval "test \"\${ac_cv_objext+set}\" = set"; then
8084   echo $ac_n "(cached) $ac_c" 1>&6
8085 else
8086   rm -f conftest*
8087 echo 'int i = 1;' > conftest.$ac_ext
8088 if { (eval echo configure:8089: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8089   for ac_file in conftest.*; do
8090     case $ac_file in
8091     *.c) ;;
8092     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
8093     esac
8094   done
8095 else
8096   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
8097 fi
8098 rm -f conftest*
8099 fi
8100
8101 echo "$ac_t""$ac_cv_objext" 1>&6
8102 OBJEXT=$ac_cv_objext
8103 ac_objext=$ac_cv_objext
8104
8105
8106 cat >> confdefs.h <<EOF
8107 #define EXEEXT "${EXEEXT}"
8108 EOF
8109
8110
8111 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
8112 echo "configure:8113: checking for be_app in -lbe" >&5
8113 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
8114 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8115   echo $ac_n "(cached) $ac_c" 1>&6
8116 else
8117   ac_save_LIBS="$LIBS"
8118 LIBS="-lbe -lroot -lnet $LIBS"
8119 cat > conftest.$ac_ext <<EOF
8120 #line 8121 "configure"
8121 #include "confdefs.h"
8122 /* Override any gcc2 internal prototype to avoid an error.  */
8123 /* We use char because int might match the return type of a gcc2
8124     builtin and then its argument prototype would still apply.  */
8125 char be_app();
8126
8127 int main() {
8128 be_app()
8129 ; return 0; }
8130 EOF
8131 if { (eval echo configure:8132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8132   rm -rf conftest*
8133   eval "ac_cv_lib_$ac_lib_var=yes"
8134 else
8135   echo "configure: failed program was:" >&5
8136   cat conftest.$ac_ext >&5
8137   rm -rf conftest*
8138   eval "ac_cv_lib_$ac_lib_var=no"
8139 fi
8140 rm -f conftest*
8141 LIBS="$ac_save_LIBS"
8142
8143 fi
8144 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8145   echo "$ac_t""yes" 1>&6
8146   LIBS="$LIBS -lbe -lroot -lnet"
8147 else
8148   echo "$ac_t""no" 1>&6
8149 :
8150 fi
8151
8152
8153
8154
8155
8156 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
8157 echo "configure:8158: checking for ${CC-cc} option to accept ANSI C" >&5
8158 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
8159   echo $ac_n "(cached) $ac_c" 1>&6
8160 else
8161   am_cv_prog_cc_stdc=no
8162 ac_save_CC="$CC"
8163 # Don't try gcc -ansi; that turns off useful extensions and
8164 # breaks some systems' header files.
8165 # AIX                   -qlanglvl=ansi
8166 # Ultrix and OSF/1      -std1
8167 # HP-UX 10.20 and later -Ae
8168 # HP-UX older versions  -Aa -D_HPUX_SOURCE
8169 # SVR4                  -Xc -D__EXTENSIONS__
8170 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
8171 do
8172   CC="$ac_save_CC $ac_arg"
8173   cat > conftest.$ac_ext <<EOF
8174 #line 8175 "configure"
8175 #include "confdefs.h"
8176 #include <stdarg.h>
8177 #include <stdio.h>
8178 #include <sys/types.h>
8179 #include <sys/stat.h>
8180 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
8181 struct buf { int x; };
8182 FILE * (*rcsopen) (struct buf *, struct stat *, int);
8183 static char *e (p, i)
8184      char **p;
8185      int i;
8186 {
8187   return p[i];
8188 }
8189 static char *f (char * (*g) (char **, int), char **p, ...)
8190 {
8191   char *s;
8192   va_list v;
8193   va_start (v,p);
8194   s = g (p, va_arg (v,int));
8195   va_end (v);
8196   return s;
8197 }
8198 int test (int i, double x);
8199 struct s1 {int (*f) (int a);};
8200 struct s2 {int (*f) (double a);};
8201 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
8202 int argc;
8203 char **argv;
8204
8205 int main() {
8206
8207 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
8208
8209 ; return 0; }
8210 EOF
8211 if { (eval echo configure:8212: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8212   rm -rf conftest*
8213   am_cv_prog_cc_stdc="$ac_arg"; break
8214 else
8215   echo "configure: failed program was:" >&5
8216   cat conftest.$ac_ext >&5
8217 fi
8218 rm -f conftest*
8219 done
8220 CC="$ac_save_CC"
8221
8222 fi
8223
8224 if test -z "$am_cv_prog_cc_stdc"; then
8225   echo "$ac_t""none needed" 1>&6
8226 else
8227   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
8228 fi
8229 case "x$am_cv_prog_cc_stdc" in
8230   x|xno) ;;
8231   *) CC="$CC $am_cv_prog_cc_stdc" ;;
8232 esac
8233
8234 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
8235         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
8236 fi
8237
8238 # test for make depend flag
8239 OL_MKDEP=
8240 OL_MKDEP_FLAGS=
8241 if test -z "${MKDEP}"; then
8242         OL_MKDEP="${CC-cc}"
8243         if test -z "${MKDEP_FLAGS}"; then
8244                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
8245 echo "configure:8246: checking for ${OL_MKDEP} depend flag" >&5
8246 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
8247   echo $ac_n "(cached) $ac_c" 1>&6
8248 else
8249   
8250                         ol_cv_mkdep=no
8251                         for flag in "-M" "-xM"; do
8252                                 cat > conftest.c <<EOF
8253  noCode;
8254 EOF
8255                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:8256: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
8256                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
8257                                 then
8258                                         if test ! -f conftest."${ac_object}" ; then
8259                                                 ol_cv_mkdep=$flag
8260                                                 OL_MKDEP_FLAGS="$flag"
8261                                                 break
8262                                         fi
8263                                 fi
8264                         done
8265                         rm -f conftest*
8266                 
8267 fi
8268
8269 echo "$ac_t""$ol_cv_mkdep" 1>&6
8270         else
8271                 cc_cv_mkdep=yes
8272                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
8273         fi
8274 else
8275         cc_cv_mkdep=yes
8276         OL_MKDEP="${MKDEP}"
8277         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
8278 fi
8279
8280
8281
8282 if test "${ol_cv_mkdep}" = no ; then
8283         # this will soon become an error
8284         echo "configure: warning: do not know how to generate dependencies" 1>&2
8285 fi
8286
8287 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
8288 echo "configure:8289: checking for afopen in -ls" >&5
8289 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
8290 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8291   echo $ac_n "(cached) $ac_c" 1>&6
8292 else
8293   ac_save_LIBS="$LIBS"
8294 LIBS="-ls  $LIBS"
8295 cat > conftest.$ac_ext <<EOF
8296 #line 8297 "configure"
8297 #include "confdefs.h"
8298 /* Override any gcc2 internal prototype to avoid an error.  */
8299 /* We use char because int might match the return type of a gcc2
8300     builtin and then its argument prototype would still apply.  */
8301 char afopen();
8302
8303 int main() {
8304 afopen()
8305 ; return 0; }
8306 EOF
8307 if { (eval echo configure:8308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8308   rm -rf conftest*
8309   eval "ac_cv_lib_$ac_lib_var=yes"
8310 else
8311   echo "configure: failed program was:" >&5
8312   cat conftest.$ac_ext >&5
8313   rm -rf conftest*
8314   eval "ac_cv_lib_$ac_lib_var=no"
8315 fi
8316 rm -f conftest*
8317 LIBS="$ac_save_LIBS"
8318
8319 fi
8320 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8321   echo "$ac_t""yes" 1>&6
8322   
8323         AUTH_LIBS=-ls
8324         cat >> confdefs.h <<\EOF
8325 #define HAVE_AIX_SECURITY 1
8326 EOF
8327
8328
8329 else
8330   echo "$ac_t""no" 1>&6
8331 fi
8332
8333
8334 case "$target" in
8335 *-ibm-openedition)
8336         ac_cv_func_getopt=no
8337         cat >> confdefs.h <<\EOF
8338 #define BOTH_STRINGS_H 1
8339 EOF
8340
8341         ;;
8342 esac
8343
8344 ol_link_modules=no
8345 if test $ol_enable_modules != no ; then
8346         for ac_hdr in ltdl.h
8347 do
8348 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8349 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8350 echo "configure:8351: checking for $ac_hdr" >&5
8351 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8352   echo $ac_n "(cached) $ac_c" 1>&6
8353 else
8354   cat > conftest.$ac_ext <<EOF
8355 #line 8356 "configure"
8356 #include "confdefs.h"
8357 #include <$ac_hdr>
8358 EOF
8359 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8360 { (eval echo configure:8361: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8361 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8362 if test -z "$ac_err"; then
8363   rm -rf conftest*
8364   eval "ac_cv_header_$ac_safe=yes"
8365 else
8366   echo "$ac_err" >&5
8367   echo "configure: failed program was:" >&5
8368   cat conftest.$ac_ext >&5
8369   rm -rf conftest*
8370   eval "ac_cv_header_$ac_safe=no"
8371 fi
8372 rm -f conftest*
8373 fi
8374 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8375   echo "$ac_t""yes" 1>&6
8376     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8377   cat >> confdefs.h <<EOF
8378 #define $ac_tr_hdr 1
8379 EOF
8380  
8381 else
8382   echo "$ac_t""no" 1>&6
8383 fi
8384 done
8385
8386
8387         if test $ac_cv_header_ltdl_h = no ; then
8388                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
8389         fi
8390
8391         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
8392 echo "configure:8393: checking for lt_dlinit in -lltdl" >&5
8393 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
8394 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8395   echo $ac_n "(cached) $ac_c" 1>&6
8396 else
8397   ac_save_LIBS="$LIBS"
8398 LIBS="-lltdl  $LIBS"
8399 cat > conftest.$ac_ext <<EOF
8400 #line 8401 "configure"
8401 #include "confdefs.h"
8402 /* Override any gcc2 internal prototype to avoid an error.  */
8403 /* We use char because int might match the return type of a gcc2
8404     builtin and then its argument prototype would still apply.  */
8405 char lt_dlinit();
8406
8407 int main() {
8408 lt_dlinit()
8409 ; return 0; }
8410 EOF
8411 if { (eval echo configure:8412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8412   rm -rf conftest*
8413   eval "ac_cv_lib_$ac_lib_var=yes"
8414 else
8415   echo "configure: failed program was:" >&5
8416   cat conftest.$ac_ext >&5
8417   rm -rf conftest*
8418   eval "ac_cv_lib_$ac_lib_var=no"
8419 fi
8420 rm -f conftest*
8421 LIBS="$ac_save_LIBS"
8422
8423 fi
8424 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8425   echo "$ac_t""yes" 1>&6
8426   
8427                 MODULES_LIBS=-lltdl
8428                 cat >> confdefs.h <<\EOF
8429 #define HAVE_LIBLTDL 1
8430 EOF
8431
8432         
8433 else
8434   echo "$ac_t""no" 1>&6
8435 fi
8436
8437
8438         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
8439                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
8440         fi
8441         ol_link_modules=yes
8442 else
8443         ol_with_bdb_module=static
8444         ol_with_dnssrv_module=static
8445         ol_with_ldap_module=static
8446         ol_with_ldbm_module=static
8447         ol_with_meta_module=static
8448         ol_with_monitor_module=static
8449         ol_with_null_module=static
8450         ol_with_passwd_module=static
8451         ol_with_perl_module=static
8452         ol_with_shell_module=static
8453         ol_with_tcl_module=static
8454         ol_with_sql_module=static
8455 fi
8456
8457 # test for EBCDIC
8458 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
8459 echo "configure:8460: checking for EBCDIC" >&5
8460 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
8461   echo $ac_n "(cached) $ac_c" 1>&6
8462 else
8463   
8464         cat > conftest.$ac_ext <<EOF
8465 #line 8466 "configure"
8466 #include "confdefs.h"
8467
8468 #if !('M' == 0xd4)
8469 #include <__ASCII__/generate_error.h>
8470 #endif
8471
8472 EOF
8473 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8474 { (eval echo configure:8475: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8475 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8476 if test -z "$ac_err"; then
8477   rm -rf conftest*
8478   ol_cv_cpp_ebcdic=yes
8479 else
8480   echo "$ac_err" >&5
8481   echo "configure: failed program was:" >&5
8482   cat conftest.$ac_ext >&5
8483   rm -rf conftest*
8484   ol_cv_cpp_ebcdic=no
8485 fi
8486 rm -f conftest*
8487 fi
8488
8489 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
8490 if test $ol_cv_cpp_ebcdic = yes ; then
8491         cat >> confdefs.h <<\EOF
8492 #define HAVE_EBCDIC 1
8493 EOF
8494
8495 fi
8496
8497 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
8498 echo "configure:8499: checking for ANSI C header files" >&5
8499 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
8500   echo $ac_n "(cached) $ac_c" 1>&6
8501 else
8502   cat > conftest.$ac_ext <<EOF
8503 #line 8504 "configure"
8504 #include "confdefs.h"
8505 #include <stdlib.h>
8506 #include <stdarg.h>
8507 #include <string.h>
8508 #include <float.h>
8509 EOF
8510 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8511 { (eval echo configure:8512: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8512 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8513 if test -z "$ac_err"; then
8514   rm -rf conftest*
8515   ol_cv_header_stdc=yes
8516 else
8517   echo "$ac_err" >&5
8518   echo "configure: failed program was:" >&5
8519   cat conftest.$ac_ext >&5
8520   rm -rf conftest*
8521   ol_cv_header_stdc=no
8522 fi
8523 rm -f conftest*
8524
8525 if test $ol_cv_header_stdc = yes; then
8526   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
8527 cat > conftest.$ac_ext <<EOF
8528 #line 8529 "configure"
8529 #include "confdefs.h"
8530 #include <string.h>
8531 EOF
8532 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8533   egrep "memchr" >/dev/null 2>&1; then
8534   :
8535 else
8536   rm -rf conftest*
8537   ol_cv_header_stdc=no
8538 fi
8539 rm -f conftest*
8540
8541 fi
8542
8543 if test $ol_cv_header_stdc = yes; then
8544   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
8545 cat > conftest.$ac_ext <<EOF
8546 #line 8547 "configure"
8547 #include "confdefs.h"
8548 #include <stdlib.h>
8549 EOF
8550 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8551   egrep "free" >/dev/null 2>&1; then
8552   :
8553 else
8554   rm -rf conftest*
8555   ol_cv_header_stdc=no
8556 fi
8557 rm -f conftest*
8558
8559 fi
8560
8561 if test $ol_cv_header_stdc = yes; then
8562   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
8563 if test "$cross_compiling" = yes; then
8564   :
8565 else
8566   cat > conftest.$ac_ext <<EOF
8567 #line 8568 "configure"
8568 #include "confdefs.h"
8569 #include <ctype.h>
8570 #ifndef HAVE_EBCDIC
8571 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
8572 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
8573 #else
8574 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
8575                 || ('j' <= (c) && (c) <= 'r') \
8576                 || ('s' <= (c) && (c) <= 'z'))
8577 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
8578 #endif
8579 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
8580 int main () { int i; for (i = 0; i < 256; i++)
8581 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
8582 exit (0); }
8583
8584 EOF
8585 if { (eval echo configure:8586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8586 then
8587   :
8588 else
8589   echo "configure: failed program was:" >&5
8590   cat conftest.$ac_ext >&5
8591   rm -fr conftest*
8592   ol_cv_header_stdc=no
8593 fi
8594 rm -fr conftest*
8595 fi
8596
8597 fi
8598 fi
8599
8600 echo "$ac_t""$ol_cv_header_stdc" 1>&6
8601 if test $ol_cv_header_stdc = yes; then
8602   cat >> confdefs.h <<\EOF
8603 #define STDC_HEADERS 1
8604 EOF
8605
8606 fi
8607 ac_cv_header_stdc=disable
8608
8609
8610 if test $ol_cv_header_stdc != yes; then
8611         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
8612 fi
8613
8614 ac_header_dirent=no
8615 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
8616 do
8617 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8618 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
8619 echo "configure:8620: checking for $ac_hdr that defines DIR" >&5
8620 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
8621   echo $ac_n "(cached) $ac_c" 1>&6
8622 else
8623   cat > conftest.$ac_ext <<EOF
8624 #line 8625 "configure"
8625 #include "confdefs.h"
8626 #include <sys/types.h>
8627 #include <$ac_hdr>
8628 int main() {
8629 DIR *dirp = 0;
8630 ; return 0; }
8631 EOF
8632 if { (eval echo configure:8633: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8633   rm -rf conftest*
8634   eval "ac_cv_header_dirent_$ac_safe=yes"
8635 else
8636   echo "configure: failed program was:" >&5
8637   cat conftest.$ac_ext >&5
8638   rm -rf conftest*
8639   eval "ac_cv_header_dirent_$ac_safe=no"
8640 fi
8641 rm -f conftest*
8642 fi
8643 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
8644   echo "$ac_t""yes" 1>&6
8645     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8646   cat >> confdefs.h <<EOF
8647 #define $ac_tr_hdr 1
8648 EOF
8649  ac_header_dirent=$ac_hdr; break
8650 else
8651   echo "$ac_t""no" 1>&6
8652 fi
8653 done
8654 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
8655 if test $ac_header_dirent = dirent.h; then
8656 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
8657 echo "configure:8658: checking for opendir in -ldir" >&5
8658 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
8659 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8660   echo $ac_n "(cached) $ac_c" 1>&6
8661 else
8662   ac_save_LIBS="$LIBS"
8663 LIBS="-ldir  $LIBS"
8664 cat > conftest.$ac_ext <<EOF
8665 #line 8666 "configure"
8666 #include "confdefs.h"
8667 /* Override any gcc2 internal prototype to avoid an error.  */
8668 /* We use char because int might match the return type of a gcc2
8669     builtin and then its argument prototype would still apply.  */
8670 char opendir();
8671
8672 int main() {
8673 opendir()
8674 ; return 0; }
8675 EOF
8676 if { (eval echo configure:8677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8677   rm -rf conftest*
8678   eval "ac_cv_lib_$ac_lib_var=yes"
8679 else
8680   echo "configure: failed program was:" >&5
8681   cat conftest.$ac_ext >&5
8682   rm -rf conftest*
8683   eval "ac_cv_lib_$ac_lib_var=no"
8684 fi
8685 rm -f conftest*
8686 LIBS="$ac_save_LIBS"
8687
8688 fi
8689 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8690   echo "$ac_t""yes" 1>&6
8691   LIBS="$LIBS -ldir"
8692 else
8693   echo "$ac_t""no" 1>&6
8694 fi
8695
8696 else
8697 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
8698 echo "configure:8699: checking for opendir in -lx" >&5
8699 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
8700 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8701   echo $ac_n "(cached) $ac_c" 1>&6
8702 else
8703   ac_save_LIBS="$LIBS"
8704 LIBS="-lx  $LIBS"
8705 cat > conftest.$ac_ext <<EOF
8706 #line 8707 "configure"
8707 #include "confdefs.h"
8708 /* Override any gcc2 internal prototype to avoid an error.  */
8709 /* We use char because int might match the return type of a gcc2
8710     builtin and then its argument prototype would still apply.  */
8711 char opendir();
8712
8713 int main() {
8714 opendir()
8715 ; return 0; }
8716 EOF
8717 if { (eval echo configure:8718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8718   rm -rf conftest*
8719   eval "ac_cv_lib_$ac_lib_var=yes"
8720 else
8721   echo "configure: failed program was:" >&5
8722   cat conftest.$ac_ext >&5
8723   rm -rf conftest*
8724   eval "ac_cv_lib_$ac_lib_var=no"
8725 fi
8726 rm -f conftest*
8727 LIBS="$ac_save_LIBS"
8728
8729 fi
8730 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8731   echo "$ac_t""yes" 1>&6
8732   LIBS="$LIBS -lx"
8733 else
8734   echo "$ac_t""no" 1>&6
8735 fi
8736
8737 fi
8738
8739 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
8740 echo "configure:8741: checking for sys/wait.h that is POSIX.1 compatible" >&5
8741 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
8742   echo $ac_n "(cached) $ac_c" 1>&6
8743 else
8744   cat > conftest.$ac_ext <<EOF
8745 #line 8746 "configure"
8746 #include "confdefs.h"
8747 #include <sys/types.h>
8748 #include <sys/wait.h>
8749 #ifndef WEXITSTATUS
8750 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
8751 #endif
8752 #ifndef WIFEXITED
8753 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
8754 #endif
8755 int main() {
8756 int s;
8757 wait (&s);
8758 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
8759 ; return 0; }
8760 EOF
8761 if { (eval echo configure:8762: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8762   rm -rf conftest*
8763   ac_cv_header_sys_wait_h=yes
8764 else
8765   echo "configure: failed program was:" >&5
8766   cat conftest.$ac_ext >&5
8767   rm -rf conftest*
8768   ac_cv_header_sys_wait_h=no
8769 fi
8770 rm -f conftest*
8771 fi
8772
8773 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
8774 if test $ac_cv_header_sys_wait_h = yes; then
8775   cat >> confdefs.h <<\EOF
8776 #define HAVE_SYS_WAIT_H 1
8777 EOF
8778
8779 fi
8780
8781 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
8782 echo "configure:8783: checking POSIX termios" >&5
8783 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
8784   echo $ac_n "(cached) $ac_c" 1>&6
8785 else
8786   cat > conftest.$ac_ext <<EOF
8787 #line 8788 "configure"
8788 #include "confdefs.h"
8789 #include <sys/types.h>
8790 #include <unistd.h>
8791 #include <termios.h>
8792 int main() {
8793 /* SunOS 4.0.3 has termios.h but not the library calls.  */
8794    tcgetattr(0, 0);
8795 ; return 0; }
8796 EOF
8797 if { (eval echo configure:8798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8798   rm -rf conftest*
8799   am_cv_sys_posix_termios=yes
8800 else
8801   echo "configure: failed program was:" >&5
8802   cat conftest.$ac_ext >&5
8803   rm -rf conftest*
8804   am_cv_sys_posix_termios=no
8805 fi
8806 rm -f conftest*
8807 fi
8808
8809 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
8810
8811
8812  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
8813 echo "configure:8814: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
8814 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
8815   echo $ac_n "(cached) $ac_c" 1>&6
8816 else
8817   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
8818
8819   gwinsz_in_termios_h=no
8820   if test $am_cv_sys_posix_termios = yes; then
8821     cat > conftest.$ac_ext <<EOF
8822 #line 8823 "configure"
8823 #include "confdefs.h"
8824 #include <sys/types.h>
8825 #     include <termios.h>
8826 #     ifdef TIOCGWINSZ
8827         yes
8828 #     endif
8829     
8830 EOF
8831 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8832   egrep "yes" >/dev/null 2>&1; then
8833   rm -rf conftest*
8834   gwinsz_in_termios_h=yes
8835 fi
8836 rm -f conftest*
8837
8838   fi
8839
8840   if test $gwinsz_in_termios_h = no; then
8841     cat > conftest.$ac_ext <<EOF
8842 #line 8843 "configure"
8843 #include "confdefs.h"
8844 #include <sys/types.h>
8845 #     include <sys/ioctl.h>
8846 #     ifdef TIOCGWINSZ
8847         yes
8848 #     endif
8849     
8850 EOF
8851 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8852   egrep "yes" >/dev/null 2>&1; then
8853   rm -rf conftest*
8854   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
8855 fi
8856 rm -f conftest*
8857
8858   fi
8859   
8860 fi
8861
8862 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
8863   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
8864     cat >> confdefs.h <<\EOF
8865 #define GWINSZ_IN_SYS_IOCTL 1
8866 EOF
8867
8868   fi
8869
8870 if test $am_cv_sys_posix_termios = yes ; then
8871         cat >> confdefs.h <<\EOF
8872 #define HAVE_POSIX_TERMIOS 1
8873 EOF
8874
8875 fi
8876
8877 for ac_hdr in \
8878         arpa/inet.h             \
8879         arpa/nameser.h  \
8880         assert.h                \
8881         conio.h                 \
8882         crypt.h                 \
8883         direct.h                \
8884         errno.h                 \
8885         fcntl.h                 \
8886         filio.h                 \
8887         getopt.h                \
8888         grp.h                   \
8889         io.h                    \
8890         libutil.h               \
8891         limits.h                \
8892         locale.h                \
8893         netinet/tcp.h   \
8894         malloc.h                \
8895         memory.h                \
8896         psap.h                  \
8897         pwd.h                   \
8898         process.h               \
8899         resolv.h                \
8900         sgtty.h                 \
8901         shadow.h                \
8902         stddef.h                \
8903         string.h                \
8904         strings.h               \
8905         sysexits.h              \
8906         sys/file.h              \
8907         sys/filio.h             \
8908         sys/errno.h             \
8909         sys/ioctl.h             \
8910         sys/param.h             \
8911         sys/resource.h  \
8912         sys/select.h    \
8913         sys/socket.h    \
8914         sys/stat.h              \
8915         sys/syslog.h    \
8916         sys/time.h              \
8917         sys/types.h             \
8918         sys/ucred.h             \
8919         sys/uio.h               \
8920         syslog.h                \
8921         termios.h               \
8922         unistd.h                \
8923         winsock.h               \
8924         winsock2.h              \
8925
8926 do
8927 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8928 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8929 echo "configure:8930: checking for $ac_hdr" >&5
8930 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8931   echo $ac_n "(cached) $ac_c" 1>&6
8932 else
8933   cat > conftest.$ac_ext <<EOF
8934 #line 8935 "configure"
8935 #include "confdefs.h"
8936 #include <$ac_hdr>
8937 EOF
8938 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8939 { (eval echo configure:8940: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8940 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8941 if test -z "$ac_err"; then
8942   rm -rf conftest*
8943   eval "ac_cv_header_$ac_safe=yes"
8944 else
8945   echo "$ac_err" >&5
8946   echo "configure: failed program was:" >&5
8947   cat conftest.$ac_ext >&5
8948   rm -rf conftest*
8949   eval "ac_cv_header_$ac_safe=no"
8950 fi
8951 rm -f conftest*
8952 fi
8953 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8954   echo "$ac_t""yes" 1>&6
8955     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8956   cat >> confdefs.h <<EOF
8957 #define $ac_tr_hdr 1
8958 EOF
8959  
8960 else
8961   echo "$ac_t""no" 1>&6
8962 fi
8963 done
8964
8965
8966
8967
8968 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
8969 echo "configure:8970: checking for dlopen" >&5
8970 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
8971   echo $ac_n "(cached) $ac_c" 1>&6
8972 else
8973   cat > conftest.$ac_ext <<EOF
8974 #line 8975 "configure"
8975 #include "confdefs.h"
8976 /* System header to define __stub macros and hopefully few prototypes,
8977     which can conflict with char dlopen(); below.  */
8978 #include <assert.h>
8979 /* Override any gcc2 internal prototype to avoid an error.  */
8980 /* We use char because int might match the return type of a gcc2
8981     builtin and then its argument prototype would still apply.  */
8982 char dlopen();
8983 char (*f)();
8984
8985 int main() {
8986
8987 /* The GNU C library defines this for functions which it implements
8988     to always fail with ENOSYS.  Some functions are actually named
8989     something starting with __ and the normal name is an alias.  */
8990 #if defined (__stub_dlopen) || defined (__stub___dlopen)
8991 choke me
8992 #else
8993 f = dlopen;
8994 #endif
8995
8996 ; return 0; }
8997 EOF
8998 if { (eval echo configure:8999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8999   rm -rf conftest*
9000   eval "ac_cv_func_dlopen=yes"
9001 else
9002   echo "configure: failed program was:" >&5
9003   cat conftest.$ac_ext >&5
9004   rm -rf conftest*
9005   eval "ac_cv_func_dlopen=no"
9006 fi
9007 rm -f conftest*
9008 fi
9009
9010 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
9011   echo "$ac_t""yes" 1>&6
9012   :
9013 else
9014   echo "$ac_t""no" 1>&6
9015 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
9016 echo "configure:9017: checking for dlopen in -ldl" >&5
9017 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
9018 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9019   echo $ac_n "(cached) $ac_c" 1>&6
9020 else
9021   ac_save_LIBS="$LIBS"
9022 LIBS="-ldl  $LIBS"
9023 cat > conftest.$ac_ext <<EOF
9024 #line 9025 "configure"
9025 #include "confdefs.h"
9026 /* Override any gcc2 internal prototype to avoid an error.  */
9027 /* We use char because int might match the return type of a gcc2
9028     builtin and then its argument prototype would still apply.  */
9029 char dlopen();
9030
9031 int main() {
9032 dlopen()
9033 ; return 0; }
9034 EOF
9035 if { (eval echo configure:9036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9036   rm -rf conftest*
9037   eval "ac_cv_lib_$ac_lib_var=yes"
9038 else
9039   echo "configure: failed program was:" >&5
9040   cat conftest.$ac_ext >&5
9041   rm -rf conftest*
9042   eval "ac_cv_lib_$ac_lib_var=no"
9043 fi
9044 rm -f conftest*
9045 LIBS="$ac_save_LIBS"
9046
9047 fi
9048 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9049   echo "$ac_t""yes" 1>&6
9050     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9051     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9052   cat >> confdefs.h <<EOF
9053 #define $ac_tr_lib 1
9054 EOF
9055
9056   LIBS="-ldl $LIBS"
9057
9058 else
9059   echo "$ac_t""no" 1>&6
9060 fi
9061
9062 fi
9063
9064
9065 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
9066 echo "configure:9067: checking for sigset in -lV3" >&5
9067 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
9068 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9069   echo $ac_n "(cached) $ac_c" 1>&6
9070 else
9071   ac_save_LIBS="$LIBS"
9072 LIBS="-lV3  $LIBS"
9073 cat > conftest.$ac_ext <<EOF
9074 #line 9075 "configure"
9075 #include "confdefs.h"
9076 /* Override any gcc2 internal prototype to avoid an error.  */
9077 /* We use char because int might match the return type of a gcc2
9078     builtin and then its argument prototype would still apply.  */
9079 char sigset();
9080
9081 int main() {
9082 sigset()
9083 ; return 0; }
9084 EOF
9085 if { (eval echo configure:9086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9086   rm -rf conftest*
9087   eval "ac_cv_lib_$ac_lib_var=yes"
9088 else
9089   echo "configure: failed program was:" >&5
9090   cat conftest.$ac_ext >&5
9091   rm -rf conftest*
9092   eval "ac_cv_lib_$ac_lib_var=no"
9093 fi
9094 rm -f conftest*
9095 LIBS="$ac_save_LIBS"
9096
9097 fi
9098 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9099   echo "$ac_t""yes" 1>&6
9100     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9101     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9102   cat >> confdefs.h <<EOF
9103 #define $ac_tr_lib 1
9104 EOF
9105
9106   LIBS="-lV3 $LIBS"
9107
9108 else
9109   echo "$ac_t""no" 1>&6
9110 fi
9111
9112
9113 echo $ac_n "checking for winsock""... $ac_c" 1>&6
9114 echo "configure:9115: checking for winsock" >&5
9115 save_LIBS="$LIBS"
9116 for curlib in ws2_32 wsock32; do
9117         LIBS="$LIBS -l$curlib"
9118         cat > conftest.$ac_ext <<EOF
9119 #line 9120 "configure"
9120 #include "confdefs.h"
9121
9122                         char socket@12();
9123                         char select@20();
9124                         char closesocket@4();
9125                         char gethostname@8();
9126                         
9127 int main() {
9128
9129                         socket@12();
9130                         select@20();
9131                         closesocket@4();
9132                         gethostname@8();
9133                         
9134 ; return 0; }
9135 EOF
9136 if { (eval echo configure:9137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9137   rm -rf conftest*
9138   have_winsock=yes
9139 else
9140   echo "configure: failed program was:" >&5
9141   cat conftest.$ac_ext >&5
9142   rm -rf conftest*
9143   have_winsock=no
9144 fi
9145 rm -f conftest*
9146
9147         if test $have_winsock = yes; then
9148                 cat >> confdefs.h <<\EOF
9149 #define HAVE_WINSOCK 1
9150 EOF
9151
9152                 ac_cv_func_socket=yes
9153                 ac_cv_func_select=yes
9154                 ac_cv_func_closesocket=yes
9155                 ac_cv_func_gethostname=yes
9156                 if test $curlib = ws2_32; then
9157                         have_winsock=winsock2
9158                         cat >> confdefs.h <<\EOF
9159 #define HAVE_WINSOCK2 1
9160 EOF
9161
9162                 fi
9163                 break
9164         fi
9165         LIBS="$save_LIBS"
9166 done
9167 echo "$ac_t""$have_winsock" 1>&6
9168
9169
9170 echo $ac_n "checking for socket""... $ac_c" 1>&6
9171 echo "configure:9172: checking for socket" >&5
9172 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
9173   echo $ac_n "(cached) $ac_c" 1>&6
9174 else
9175   cat > conftest.$ac_ext <<EOF
9176 #line 9177 "configure"
9177 #include "confdefs.h"
9178 /* System header to define __stub macros and hopefully few prototypes,
9179     which can conflict with char socket(); below.  */
9180 #include <assert.h>
9181 /* Override any gcc2 internal prototype to avoid an error.  */
9182 /* We use char because int might match the return type of a gcc2
9183     builtin and then its argument prototype would still apply.  */
9184 char socket();
9185 char (*f)();
9186
9187 int main() {
9188
9189 /* The GNU C library defines this for functions which it implements
9190     to always fail with ENOSYS.  Some functions are actually named
9191     something starting with __ and the normal name is an alias.  */
9192 #if defined (__stub_socket) || defined (__stub___socket)
9193 choke me
9194 #else
9195 f = socket;
9196 #endif
9197
9198 ; return 0; }
9199 EOF
9200 if { (eval echo configure:9201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9201   rm -rf conftest*
9202   eval "ac_cv_func_socket=yes"
9203 else
9204   echo "configure: failed program was:" >&5
9205   cat conftest.$ac_ext >&5
9206   rm -rf conftest*
9207   eval "ac_cv_func_socket=no"
9208 fi
9209 rm -f conftest*
9210 fi
9211
9212 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
9213   echo "$ac_t""yes" 1>&6
9214   :
9215 else
9216   echo "$ac_t""no" 1>&6
9217         
9218         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
9219 echo "configure:9220: checking for main in -lsocket" >&5
9220 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
9221 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9222   echo $ac_n "(cached) $ac_c" 1>&6
9223 else
9224   ac_save_LIBS="$LIBS"
9225 LIBS="-lsocket  $LIBS"
9226 cat > conftest.$ac_ext <<EOF
9227 #line 9228 "configure"
9228 #include "confdefs.h"
9229
9230 int main() {
9231 main()
9232 ; return 0; }
9233 EOF
9234 if { (eval echo configure:9235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9235   rm -rf conftest*
9236   eval "ac_cv_lib_$ac_lib_var=yes"
9237 else
9238   echo "configure: failed program was:" >&5
9239   cat conftest.$ac_ext >&5
9240   rm -rf conftest*
9241   eval "ac_cv_lib_$ac_lib_var=no"
9242 fi
9243 rm -f conftest*
9244 LIBS="$ac_save_LIBS"
9245
9246 fi
9247 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9248   echo "$ac_t""yes" 1>&6
9249     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9250     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9251   cat >> confdefs.h <<EOF
9252 #define $ac_tr_lib 1
9253 EOF
9254
9255   LIBS="-lsocket $LIBS"
9256
9257 else
9258   echo "$ac_t""no" 1>&6
9259 fi
9260
9261         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
9262 echo "configure:9263: checking for main in -lnet" >&5
9263 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
9264 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9265   echo $ac_n "(cached) $ac_c" 1>&6
9266 else
9267   ac_save_LIBS="$LIBS"
9268 LIBS="-lnet  $LIBS"
9269 cat > conftest.$ac_ext <<EOF
9270 #line 9271 "configure"
9271 #include "confdefs.h"
9272
9273 int main() {
9274 main()
9275 ; return 0; }
9276 EOF
9277 if { (eval echo configure:9278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9278   rm -rf conftest*
9279   eval "ac_cv_lib_$ac_lib_var=yes"
9280 else
9281   echo "configure: failed program was:" >&5
9282   cat conftest.$ac_ext >&5
9283   rm -rf conftest*
9284   eval "ac_cv_lib_$ac_lib_var=no"
9285 fi
9286 rm -f conftest*
9287 LIBS="$ac_save_LIBS"
9288
9289 fi
9290 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9291   echo "$ac_t""yes" 1>&6
9292     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9293     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9294   cat >> confdefs.h <<EOF
9295 #define $ac_tr_lib 1
9296 EOF
9297
9298   LIBS="-lnet $LIBS"
9299
9300 else
9301   echo "$ac_t""no" 1>&6
9302 fi
9303
9304         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
9305 echo "configure:9306: checking for main in -lnsl_s" >&5
9306 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
9307 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9308   echo $ac_n "(cached) $ac_c" 1>&6
9309 else
9310   ac_save_LIBS="$LIBS"
9311 LIBS="-lnsl_s  $LIBS"
9312 cat > conftest.$ac_ext <<EOF
9313 #line 9314 "configure"
9314 #include "confdefs.h"
9315
9316 int main() {
9317 main()
9318 ; return 0; }
9319 EOF
9320 if { (eval echo configure:9321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9321   rm -rf conftest*
9322   eval "ac_cv_lib_$ac_lib_var=yes"
9323 else
9324   echo "configure: failed program was:" >&5
9325   cat conftest.$ac_ext >&5
9326   rm -rf conftest*
9327   eval "ac_cv_lib_$ac_lib_var=no"
9328 fi
9329 rm -f conftest*
9330 LIBS="$ac_save_LIBS"
9331
9332 fi
9333 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9334   echo "$ac_t""yes" 1>&6
9335     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9336     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9337   cat >> confdefs.h <<EOF
9338 #define $ac_tr_lib 1
9339 EOF
9340
9341   LIBS="-lnsl_s $LIBS"
9342
9343 else
9344   echo "$ac_t""no" 1>&6
9345 fi
9346
9347         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
9348 echo "configure:9349: checking for main in -lnsl" >&5
9349 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
9350 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9351   echo $ac_n "(cached) $ac_c" 1>&6
9352 else
9353   ac_save_LIBS="$LIBS"
9354 LIBS="-lnsl  $LIBS"
9355 cat > conftest.$ac_ext <<EOF
9356 #line 9357 "configure"
9357 #include "confdefs.h"
9358
9359 int main() {
9360 main()
9361 ; return 0; }
9362 EOF
9363 if { (eval echo configure:9364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9364   rm -rf conftest*
9365   eval "ac_cv_lib_$ac_lib_var=yes"
9366 else
9367   echo "configure: failed program was:" >&5
9368   cat conftest.$ac_ext >&5
9369   rm -rf conftest*
9370   eval "ac_cv_lib_$ac_lib_var=no"
9371 fi
9372 rm -f conftest*
9373 LIBS="$ac_save_LIBS"
9374
9375 fi
9376 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9377   echo "$ac_t""yes" 1>&6
9378     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9379     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9380   cat >> confdefs.h <<EOF
9381 #define $ac_tr_lib 1
9382 EOF
9383
9384   LIBS="-lnsl $LIBS"
9385
9386 else
9387   echo "$ac_t""no" 1>&6
9388 fi
9389
9390         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
9391 echo "configure:9392: checking for socket in -linet" >&5
9392 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
9393 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9394   echo $ac_n "(cached) $ac_c" 1>&6
9395 else
9396   ac_save_LIBS="$LIBS"
9397 LIBS="-linet  $LIBS"
9398 cat > conftest.$ac_ext <<EOF
9399 #line 9400 "configure"
9400 #include "confdefs.h"
9401 /* Override any gcc2 internal prototype to avoid an error.  */
9402 /* We use char because int might match the return type of a gcc2
9403     builtin and then its argument prototype would still apply.  */
9404 char socket();
9405
9406 int main() {
9407 socket()
9408 ; return 0; }
9409 EOF
9410 if { (eval echo configure:9411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9411   rm -rf conftest*
9412   eval "ac_cv_lib_$ac_lib_var=yes"
9413 else
9414   echo "configure: failed program was:" >&5
9415   cat conftest.$ac_ext >&5
9416   rm -rf conftest*
9417   eval "ac_cv_lib_$ac_lib_var=no"
9418 fi
9419 rm -f conftest*
9420 LIBS="$ac_save_LIBS"
9421
9422 fi
9423 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9424   echo "$ac_t""yes" 1>&6
9425     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9426     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9427   cat >> confdefs.h <<EOF
9428 #define $ac_tr_lib 1
9429 EOF
9430
9431   LIBS="-linet $LIBS"
9432
9433 else
9434   echo "$ac_t""no" 1>&6
9435 fi
9436
9437         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
9438 echo "configure:9439: checking for main in -lgen" >&5
9439 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
9440 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9441   echo $ac_n "(cached) $ac_c" 1>&6
9442 else
9443   ac_save_LIBS="$LIBS"
9444 LIBS="-lgen  $LIBS"
9445 cat > conftest.$ac_ext <<EOF
9446 #line 9447 "configure"
9447 #include "confdefs.h"
9448
9449 int main() {
9450 main()
9451 ; return 0; }
9452 EOF
9453 if { (eval echo configure:9454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9454   rm -rf conftest*
9455   eval "ac_cv_lib_$ac_lib_var=yes"
9456 else
9457   echo "configure: failed program was:" >&5
9458   cat conftest.$ac_ext >&5
9459   rm -rf conftest*
9460   eval "ac_cv_lib_$ac_lib_var=no"
9461 fi
9462 rm -f conftest*
9463 LIBS="$ac_save_LIBS"
9464
9465 fi
9466 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9467   echo "$ac_t""yes" 1>&6
9468     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9469     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9470   cat >> confdefs.h <<EOF
9471 #define $ac_tr_lib 1
9472 EOF
9473
9474   LIBS="-lgen $LIBS"
9475
9476 else
9477   echo "$ac_t""no" 1>&6
9478 fi
9479
9480
9481 fi
9482
9483
9484 echo $ac_n "checking for select""... $ac_c" 1>&6
9485 echo "configure:9486: checking for select" >&5
9486 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
9487   echo $ac_n "(cached) $ac_c" 1>&6
9488 else
9489   cat > conftest.$ac_ext <<EOF
9490 #line 9491 "configure"
9491 #include "confdefs.h"
9492 /* System header to define __stub macros and hopefully few prototypes,
9493     which can conflict with char select(); below.  */
9494 #include <assert.h>
9495 /* Override any gcc2 internal prototype to avoid an error.  */
9496 /* We use char because int might match the return type of a gcc2
9497     builtin and then its argument prototype would still apply.  */
9498 char select();
9499 char (*f)();
9500
9501 int main() {
9502
9503 /* The GNU C library defines this for functions which it implements
9504     to always fail with ENOSYS.  Some functions are actually named
9505     something starting with __ and the normal name is an alias.  */
9506 #if defined (__stub_select) || defined (__stub___select)
9507 choke me
9508 #else
9509 f = select;
9510 #endif
9511
9512 ; return 0; }
9513 EOF
9514 if { (eval echo configure:9515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9515   rm -rf conftest*
9516   eval "ac_cv_func_select=yes"
9517 else
9518   echo "configure: failed program was:" >&5
9519   cat conftest.$ac_ext >&5
9520   rm -rf conftest*
9521   eval "ac_cv_func_select=no"
9522 fi
9523 rm -f conftest*
9524 fi
9525
9526 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
9527   echo "$ac_t""yes" 1>&6
9528   :
9529 else
9530   echo "$ac_t""no" 1>&6
9531 { echo "configure: error: select() required." 1>&2; exit 1; }
9532 fi
9533
9534
9535 if test "${ac_cv_header_winsock_h}" != yes; then
9536                                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
9537 echo "configure:9538: checking types of arguments for select()" >&5
9538  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
9539   echo $ac_n "(cached) $ac_c" 1>&6
9540 else
9541    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
9542   echo $ac_n "(cached) $ac_c" 1>&6
9543 else
9544     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
9545   echo $ac_n "(cached) $ac_c" 1>&6
9546 else
9547      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
9548      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
9549       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
9550        cat > conftest.$ac_ext <<EOF
9551 #line 9552 "configure"
9552 #include "confdefs.h"
9553 #ifdef HAVE_SYS_TYPES_H
9554 #include <sys/types.h>
9555 #endif
9556 #ifdef HAVE_SYS_TIME_H
9557 #include <sys/time.h>
9558 #endif
9559 #ifdef HAVE_SYS_SELECT_H
9560 #include <sys/select.h>
9561 #endif
9562 #ifdef HAVE_SYS_SOCKET_H
9563 #include <sys/socket.h>
9564 #endif
9565 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);
9566 int main() {
9567
9568 ; return 0; }
9569 EOF
9570 if { (eval echo configure:9571: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9571   rm -rf conftest*
9572           ac_not_found=no ; break 3
9573 else
9574   echo "configure: failed program was:" >&5
9575   cat conftest.$ac_ext >&5
9576   rm -rf conftest*
9577   ac_not_found=yes
9578 fi
9579 rm -f conftest*
9580       done
9581      done
9582     done
9583    
9584 fi
9585   
9586 fi
9587  
9588 fi
9589  if test "$ac_not_found" = yes; then
9590   ac_cv_func_select_arg1=int 
9591   ac_cv_func_select_arg234='int *' 
9592   ac_cv_func_select_arg5='struct timeval *'
9593  fi
9594  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
9595  cat >> confdefs.h <<EOF
9596 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
9597 EOF
9598
9599  cat >> confdefs.h <<EOF
9600 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
9601 EOF
9602
9603  cat >> confdefs.h <<EOF
9604 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
9605 EOF
9606
9607
9608 fi
9609
9610
9611 for ac_hdr in regex.h 
9612 do
9613 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9614 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9615 echo "configure:9616: checking for $ac_hdr" >&5
9616 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9617   echo $ac_n "(cached) $ac_c" 1>&6
9618 else
9619   cat > conftest.$ac_ext <<EOF
9620 #line 9621 "configure"
9621 #include "confdefs.h"
9622 #include <$ac_hdr>
9623 EOF
9624 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9625 { (eval echo configure:9626: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9626 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9627 if test -z "$ac_err"; then
9628   rm -rf conftest*
9629   eval "ac_cv_header_$ac_safe=yes"
9630 else
9631   echo "$ac_err" >&5
9632   echo "configure: failed program was:" >&5
9633   cat conftest.$ac_ext >&5
9634   rm -rf conftest*
9635   eval "ac_cv_header_$ac_safe=no"
9636 fi
9637 rm -f conftest*
9638 fi
9639 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9640   echo "$ac_t""yes" 1>&6
9641     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9642   cat >> confdefs.h <<EOF
9643 #define $ac_tr_hdr 1
9644 EOF
9645  
9646 else
9647   echo "$ac_t""no" 1>&6
9648 fi
9649 done
9650
9651 if test "$ac_cv_header_regex_h" != yes ; then
9652         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
9653 fi
9654
9655 echo $ac_n "checking for library containing regfree""... $ac_c" 1>&6
9656 echo "configure:9657: checking for library containing regfree" >&5
9657 if eval "test \"\${ac_cv_search_regfree+set}\" = set"; then
9658   echo $ac_n "(cached) $ac_c" 1>&6
9659 else
9660   ac_func_search_save_LIBS="$LIBS"
9661 ac_cv_search_regfree="no"
9662 cat > conftest.$ac_ext <<EOF
9663 #line 9664 "configure"
9664 #include "confdefs.h"
9665 /* Override any gcc2 internal prototype to avoid an error.  */
9666 /* We use char because int might match the return type of a gcc2
9667     builtin and then its argument prototype would still apply.  */
9668 char regfree();
9669
9670 int main() {
9671 regfree()
9672 ; return 0; }
9673 EOF
9674 if { (eval echo configure:9675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9675   rm -rf conftest*
9676   ac_cv_search_regfree="none required"
9677 else
9678   echo "configure: failed program was:" >&5
9679   cat conftest.$ac_ext >&5
9680 fi
9681 rm -f conftest*
9682 test "$ac_cv_search_regfree" = "no" && for ac_lib in regex gnuregex; do
9683 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9684 cat > conftest.$ac_ext <<EOF
9685 #line 9686 "configure"
9686 #include "confdefs.h"
9687 /* Override any gcc2 internal prototype to avoid an error.  */
9688 /* We use char because int might match the return type of a gcc2
9689     builtin and then its argument prototype would still apply.  */
9690 char regfree();
9691
9692 int main() {
9693 regfree()
9694 ; return 0; }
9695 EOF
9696 if { (eval echo configure:9697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9697   rm -rf conftest*
9698   ac_cv_search_regfree="-l$ac_lib"
9699 break
9700 else
9701   echo "configure: failed program was:" >&5
9702   cat conftest.$ac_ext >&5
9703 fi
9704 rm -f conftest*
9705 done
9706 LIBS="$ac_func_search_save_LIBS"
9707 fi
9708
9709 echo "$ac_t""$ac_cv_search_regfree" 1>&6
9710 if test "$ac_cv_search_regfree" != "no"; then
9711   test "$ac_cv_search_regfree" = "none required" || LIBS="$ac_cv_search_regfree $LIBS"
9712   :
9713 else :
9714   { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
9715 fi
9716
9717
9718 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
9719 echo "configure:9720: checking for compatible POSIX regex" >&5
9720 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
9721   echo $ac_n "(cached) $ac_c" 1>&6
9722 else
9723   
9724         if test "$cross_compiling" = yes; then
9725   ol_cv_c_posix_regex=cross
9726 else
9727   cat > conftest.$ac_ext <<EOF
9728 #line 9729 "configure"
9729 #include "confdefs.h"
9730
9731 #include <sys/types.h>
9732 #include <regex.h>
9733 static char *pattern, *string;
9734 main()
9735 {
9736         int rc;
9737         regex_t re;
9738
9739         pattern = "^A";
9740
9741         if(regcomp(&re, pattern, 0)) {
9742                 return -1;
9743         }
9744         
9745         string = "ALL MATCH";
9746         
9747         rc = regexec(&re, string, 0, (void*)0, 0);
9748
9749         regfree(&re);
9750
9751         return rc;
9752 }
9753 EOF
9754 if { (eval echo configure:9755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9755 then
9756   ol_cv_c_posix_regex=yes
9757 else
9758   echo "configure: failed program was:" >&5
9759   cat conftest.$ac_ext >&5
9760   rm -fr conftest*
9761   ol_cv_c_posix_regex=no
9762 fi
9763 rm -fr conftest*
9764 fi
9765
9766 fi
9767
9768 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
9769
9770 if test "$ol_cv_c_posix_regex" = no ; then
9771         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
9772 fi
9773
9774
9775 have_uuid=no
9776 for ac_hdr in sys/uuid.h
9777 do
9778 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9779 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9780 echo "configure:9781: checking for $ac_hdr" >&5
9781 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9782   echo $ac_n "(cached) $ac_c" 1>&6
9783 else
9784   cat > conftest.$ac_ext <<EOF
9785 #line 9786 "configure"
9786 #include "confdefs.h"
9787 #include <$ac_hdr>
9788 EOF
9789 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9790 { (eval echo configure:9791: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9791 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9792 if test -z "$ac_err"; then
9793   rm -rf conftest*
9794   eval "ac_cv_header_$ac_safe=yes"
9795 else
9796   echo "$ac_err" >&5
9797   echo "configure: failed program was:" >&5
9798   cat conftest.$ac_ext >&5
9799   rm -rf conftest*
9800   eval "ac_cv_header_$ac_safe=no"
9801 fi
9802 rm -f conftest*
9803 fi
9804 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9805   echo "$ac_t""yes" 1>&6
9806     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9807   cat >> confdefs.h <<EOF
9808 #define $ac_tr_hdr 1
9809 EOF
9810  
9811 else
9812   echo "$ac_t""no" 1>&6
9813 fi
9814 done
9815
9816 if test $ac_cv_header_sys_uuid_h = yes ; then
9817         save_LIBS="$LIBS"
9818         
9819 echo $ac_n "checking for library containing uuid_to_str""... $ac_c" 1>&6
9820 echo "configure:9821: checking for library containing uuid_to_str" >&5
9821 if eval "test \"\${ac_cv_search_uuid_to_str+set}\" = set"; then
9822   echo $ac_n "(cached) $ac_c" 1>&6
9823 else
9824   ac_func_search_save_LIBS="$LIBS"
9825 ac_cv_search_uuid_to_str="no"
9826 cat > conftest.$ac_ext <<EOF
9827 #line 9828 "configure"
9828 #include "confdefs.h"
9829 /* Override any gcc2 internal prototype to avoid an error.  */
9830 /* We use char because int might match the return type of a gcc2
9831     builtin and then its argument prototype would still apply.  */
9832 char uuid_to_str();
9833
9834 int main() {
9835 uuid_to_str()
9836 ; return 0; }
9837 EOF
9838 if { (eval echo configure:9839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9839   rm -rf conftest*
9840   ac_cv_search_uuid_to_str="none required"
9841 else
9842   echo "configure: failed program was:" >&5
9843   cat conftest.$ac_ext >&5
9844 fi
9845 rm -f conftest*
9846 test "$ac_cv_search_uuid_to_str" = "no" && for ac_lib in uuid; do
9847 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9848 cat > conftest.$ac_ext <<EOF
9849 #line 9850 "configure"
9850 #include "confdefs.h"
9851 /* Override any gcc2 internal prototype to avoid an error.  */
9852 /* We use char because int might match the return type of a gcc2
9853     builtin and then its argument prototype would still apply.  */
9854 char uuid_to_str();
9855
9856 int main() {
9857 uuid_to_str()
9858 ; return 0; }
9859 EOF
9860 if { (eval echo configure:9861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9861   rm -rf conftest*
9862   ac_cv_search_uuid_to_str="-l$ac_lib"
9863 break
9864 else
9865   echo "configure: failed program was:" >&5
9866   cat conftest.$ac_ext >&5
9867 fi
9868 rm -f conftest*
9869 done
9870 LIBS="$ac_func_search_save_LIBS"
9871 fi
9872
9873 echo "$ac_t""$ac_cv_search_uuid_to_str" 1>&6
9874 if test "$ac_cv_search_uuid_to_str" != "no"; then
9875   test "$ac_cv_search_uuid_to_str" = "none required" || LIBS="$ac_cv_search_uuid_to_str $LIBS"
9876   have_uuid=yes
9877 else :
9878   :
9879 fi
9880         LIBS="$save_LIBS"
9881
9882         if test have_uuid = yes ; then
9883                 cat >> confdefs.h <<\EOF
9884 #define HAVE_UUID_TO_STR 1
9885 EOF
9886
9887
9888                 test "$ac_cv_search_uuid_to_str" = "none required" || \
9889                         SLAPD_LIBS="$SLAPD_LIBS $ac_cv_search_uuid_to_str"
9890         fi
9891 fi
9892
9893 if test $have_uuid = no ; then
9894         echo $ac_n "checking to see if -lrpcrt4 is needed for win32 UUID support""... $ac_c" 1>&6
9895 echo "configure:9896: checking to see if -lrpcrt4 is needed for win32 UUID support" >&5
9896         save_LIBS="$LIBS"
9897         LIBS="$LIBS -lrpcrt4"
9898         cat > conftest.$ac_ext <<EOF
9899 #line 9900 "configure"
9900 #include "confdefs.h"
9901
9902                 char UuidCreate@4();
9903                 char UuidToStringA@8();
9904                 
9905 int main() {
9906
9907                 UuidCreate@4();
9908                 UuidToStringA@8();
9909                 
9910 ; return 0; }
9911 EOF
9912 if { (eval echo configure:9913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9913   rm -rf conftest*
9914   need_rpcrt=yes
9915 else
9916   echo "configure: failed program was:" >&5
9917   cat conftest.$ac_ext >&5
9918   rm -rf conftest*
9919   need_rpcrt=no
9920 fi
9921 rm -f conftest*
9922         if test $need_rpcrt = yes; then
9923                 SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
9924         fi
9925         LIBS="$save_LIBS"
9926         echo "$ac_t""$need_rpcrt" 1>&6
9927 fi
9928
9929 ol_link_dnssrv=no
9930 echo $ac_n "checking for res_query""... $ac_c" 1>&6
9931 echo "configure:9932: checking for res_query" >&5
9932 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
9933   echo $ac_n "(cached) $ac_c" 1>&6
9934 else
9935   cat > conftest.$ac_ext <<EOF
9936 #line 9937 "configure"
9937 #include "confdefs.h"
9938 /* System header to define __stub macros and hopefully few prototypes,
9939     which can conflict with char res_query(); below.  */
9940 #include <assert.h>
9941 /* Override any gcc2 internal prototype to avoid an error.  */
9942 /* We use char because int might match the return type of a gcc2
9943     builtin and then its argument prototype would still apply.  */
9944 char res_query();
9945 char (*f)();
9946
9947 int main() {
9948
9949 /* The GNU C library defines this for functions which it implements
9950     to always fail with ENOSYS.  Some functions are actually named
9951     something starting with __ and the normal name is an alias.  */
9952 #if defined (__stub_res_query) || defined (__stub___res_query)
9953 choke me
9954 #else
9955 f = res_query;
9956 #endif
9957
9958 ; return 0; }
9959 EOF
9960 if { (eval echo configure:9961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9961   rm -rf conftest*
9962   eval "ac_cv_func_res_query=yes"
9963 else
9964   echo "configure: failed program was:" >&5
9965   cat conftest.$ac_ext >&5
9966   rm -rf conftest*
9967   eval "ac_cv_func_res_query=no"
9968 fi
9969 rm -f conftest*
9970 fi
9971
9972 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
9973   echo "$ac_t""yes" 1>&6
9974   :
9975 else
9976   echo "$ac_t""no" 1>&6
9977 fi
9978
9979 if test $ac_cv_func_res_query = no ; then 
9980         echo $ac_n "checking for __res_query""... $ac_c" 1>&6
9981 echo "configure:9982: checking for __res_query" >&5
9982 if eval "test \"\${ac_cv_func___res_query+set}\" = set"; then
9983   echo $ac_n "(cached) $ac_c" 1>&6
9984 else
9985   cat > conftest.$ac_ext <<EOF
9986 #line 9987 "configure"
9987 #include "confdefs.h"
9988 /* System header to define __stub macros and hopefully few prototypes,
9989     which can conflict with char __res_query(); below.  */
9990 #include <assert.h>
9991 /* Override any gcc2 internal prototype to avoid an error.  */
9992 /* We use char because int might match the return type of a gcc2
9993     builtin and then its argument prototype would still apply.  */
9994 char __res_query();
9995 char (*f)();
9996
9997 int main() {
9998
9999 /* The GNU C library defines this for functions which it implements
10000     to always fail with ENOSYS.  Some functions are actually named
10001     something starting with __ and the normal name is an alias.  */
10002 #if defined (__stub___res_query) || defined (__stub_____res_query)
10003 choke me
10004 #else
10005 f = __res_query;
10006 #endif
10007
10008 ; return 0; }
10009 EOF
10010 if { (eval echo configure:10011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10011   rm -rf conftest*
10012   eval "ac_cv_func___res_query=yes"
10013 else
10014   echo "configure: failed program was:" >&5
10015   cat conftest.$ac_ext >&5
10016   rm -rf conftest*
10017   eval "ac_cv_func___res_query=no"
10018 fi
10019 rm -f conftest*
10020 fi
10021
10022 if eval "test \"`echo '$ac_cv_func_'__res_query`\" = yes"; then
10023   echo "$ac_t""yes" 1>&6
10024   :
10025 else
10026   echo "$ac_t""no" 1>&6
10027 fi
10028
10029         ac_cv_func_res_query=$ac_cv_func___res_query
10030 fi
10031
10032 if test $ac_cv_func_res_query = no ; then 
10033         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
10034 echo "configure:10035: checking for res_query in -lbind" >&5
10035 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
10036 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10037   echo $ac_n "(cached) $ac_c" 1>&6
10038 else
10039   ac_save_LIBS="$LIBS"
10040 LIBS="-lbind  $LIBS"
10041 cat > conftest.$ac_ext <<EOF
10042 #line 10043 "configure"
10043 #include "confdefs.h"
10044 /* Override any gcc2 internal prototype to avoid an error.  */
10045 /* We use char because int might match the return type of a gcc2
10046     builtin and then its argument prototype would still apply.  */
10047 char res_query();
10048
10049 int main() {
10050 res_query()
10051 ; return 0; }
10052 EOF
10053 if { (eval echo configure:10054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10054   rm -rf conftest*
10055   eval "ac_cv_lib_$ac_lib_var=yes"
10056 else
10057   echo "configure: failed program was:" >&5
10058   cat conftest.$ac_ext >&5
10059   rm -rf conftest*
10060   eval "ac_cv_lib_$ac_lib_var=no"
10061 fi
10062 rm -f conftest*
10063 LIBS="$ac_save_LIBS"
10064
10065 fi
10066 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10067   echo "$ac_t""yes" 1>&6
10068     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10069     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10070   cat >> confdefs.h <<EOF
10071 #define $ac_tr_lib 1
10072 EOF
10073
10074   LIBS="-lbind $LIBS"
10075
10076 else
10077   echo "$ac_t""no" 1>&6
10078 fi
10079
10080         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
10081 fi
10082
10083 if test $ac_cv_func_res_query = no ; then 
10084         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
10085 echo "configure:10086: checking for __res_query in -lbind" >&5
10086 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
10087 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10088   echo $ac_n "(cached) $ac_c" 1>&6
10089 else
10090   ac_save_LIBS="$LIBS"
10091 LIBS="-lbind  $LIBS"
10092 cat > conftest.$ac_ext <<EOF
10093 #line 10094 "configure"
10094 #include "confdefs.h"
10095 /* Override any gcc2 internal prototype to avoid an error.  */
10096 /* We use char because int might match the return type of a gcc2
10097     builtin and then its argument prototype would still apply.  */
10098 char __res_query();
10099
10100 int main() {
10101 __res_query()
10102 ; return 0; }
10103 EOF
10104 if { (eval echo configure:10105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10105   rm -rf conftest*
10106   eval "ac_cv_lib_$ac_lib_var=yes"
10107 else
10108   echo "configure: failed program was:" >&5
10109   cat conftest.$ac_ext >&5
10110   rm -rf conftest*
10111   eval "ac_cv_lib_$ac_lib_var=no"
10112 fi
10113 rm -f conftest*
10114 LIBS="$ac_save_LIBS"
10115
10116 fi
10117 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10118   echo "$ac_t""yes" 1>&6
10119     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10120     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10121   cat >> confdefs.h <<EOF
10122 #define $ac_tr_lib 1
10123 EOF
10124
10125   LIBS="-lbind $LIBS"
10126
10127 else
10128   echo "$ac_t""no" 1>&6
10129 fi
10130
10131         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
10132 fi
10133
10134 if test $ac_cv_func_res_query = no ; then 
10135         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
10136 echo "configure:10137: checking for res_query in -lresolv" >&5
10137 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
10138 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10139   echo $ac_n "(cached) $ac_c" 1>&6
10140 else
10141   ac_save_LIBS="$LIBS"
10142 LIBS="-lresolv  $LIBS"
10143 cat > conftest.$ac_ext <<EOF
10144 #line 10145 "configure"
10145 #include "confdefs.h"
10146 /* Override any gcc2 internal prototype to avoid an error.  */
10147 /* We use char because int might match the return type of a gcc2
10148     builtin and then its argument prototype would still apply.  */
10149 char res_query();
10150
10151 int main() {
10152 res_query()
10153 ; return 0; }
10154 EOF
10155 if { (eval echo configure:10156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10156   rm -rf conftest*
10157   eval "ac_cv_lib_$ac_lib_var=yes"
10158 else
10159   echo "configure: failed program was:" >&5
10160   cat conftest.$ac_ext >&5
10161   rm -rf conftest*
10162   eval "ac_cv_lib_$ac_lib_var=no"
10163 fi
10164 rm -f conftest*
10165 LIBS="$ac_save_LIBS"
10166
10167 fi
10168 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10169   echo "$ac_t""yes" 1>&6
10170     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10171     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10172   cat >> confdefs.h <<EOF
10173 #define $ac_tr_lib 1
10174 EOF
10175
10176   LIBS="-lresolv $LIBS"
10177
10178 else
10179   echo "$ac_t""no" 1>&6
10180 fi
10181
10182         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
10183 fi
10184
10185 if test $ac_cv_func_res_query = no ; then 
10186         echo $ac_n "checking for __res_query in -lresolv""... $ac_c" 1>&6
10187 echo "configure:10188: checking for __res_query in -lresolv" >&5
10188 ac_lib_var=`echo resolv'_'__res_query | sed 'y%./+-:%__p__%'`
10189 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10190   echo $ac_n "(cached) $ac_c" 1>&6
10191 else
10192   ac_save_LIBS="$LIBS"
10193 LIBS="-lresolv  $LIBS"
10194 cat > conftest.$ac_ext <<EOF
10195 #line 10196 "configure"
10196 #include "confdefs.h"
10197 /* Override any gcc2 internal prototype to avoid an error.  */
10198 /* We use char because int might match the return type of a gcc2
10199     builtin and then its argument prototype would still apply.  */
10200 char __res_query();
10201
10202 int main() {
10203 __res_query()
10204 ; return 0; }
10205 EOF
10206 if { (eval echo configure:10207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10207   rm -rf conftest*
10208   eval "ac_cv_lib_$ac_lib_var=yes"
10209 else
10210   echo "configure: failed program was:" >&5
10211   cat conftest.$ac_ext >&5
10212   rm -rf conftest*
10213   eval "ac_cv_lib_$ac_lib_var=no"
10214 fi
10215 rm -f conftest*
10216 LIBS="$ac_save_LIBS"
10217
10218 fi
10219 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10220   echo "$ac_t""yes" 1>&6
10221     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10222     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10223   cat >> confdefs.h <<EOF
10224 #define $ac_tr_lib 1
10225 EOF
10226
10227   LIBS="-lresolv $LIBS"
10228
10229 else
10230   echo "$ac_t""no" 1>&6
10231 fi
10232
10233         ac_cv_func_res_query=$ac_cv_lib_resolv___res_query
10234 fi
10235
10236 if test "$ac_cv_func_res_query" = yes ; then
10237         cat >> confdefs.h <<\EOF
10238 #define HAVE_RES_QUERY 1
10239 EOF
10240
10241
10242         if test $ol_enable_dnssrv != no ; then
10243                 ol_link_dnssrv=yes
10244         fi
10245 fi
10246
10247 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
10248         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
10249 fi
10250
10251 for ac_func in getaddrinfo getnameinfo gai_strerror inet_ntop 
10252 do
10253 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10254 echo "configure:10255: checking for $ac_func" >&5
10255 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10256   echo $ac_n "(cached) $ac_c" 1>&6
10257 else
10258   cat > conftest.$ac_ext <<EOF
10259 #line 10260 "configure"
10260 #include "confdefs.h"
10261 /* System header to define __stub macros and hopefully few prototypes,
10262     which can conflict with char $ac_func(); below.  */
10263 #include <assert.h>
10264 /* Override any gcc2 internal prototype to avoid an error.  */
10265 /* We use char because int might match the return type of a gcc2
10266     builtin and then its argument prototype would still apply.  */
10267 char $ac_func();
10268 char (*f)();
10269
10270 int main() {
10271
10272 /* The GNU C library defines this for functions which it implements
10273     to always fail with ENOSYS.  Some functions are actually named
10274     something starting with __ and the normal name is an alias.  */
10275 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10276 choke me
10277 #else
10278 f = $ac_func;
10279 #endif
10280
10281 ; return 0; }
10282 EOF
10283 if { (eval echo configure:10284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10284   rm -rf conftest*
10285   eval "ac_cv_func_$ac_func=yes"
10286 else
10287   echo "configure: failed program was:" >&5
10288   cat conftest.$ac_ext >&5
10289   rm -rf conftest*
10290   eval "ac_cv_func_$ac_func=no"
10291 fi
10292 rm -f conftest*
10293 fi
10294
10295 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10296   echo "$ac_t""yes" 1>&6
10297     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10298   cat >> confdefs.h <<EOF
10299 #define $ac_tr_func 1
10300 EOF
10301  
10302 else
10303   echo "$ac_t""no" 1>&6
10304 fi
10305 done
10306
10307
10308 ol_link_ipv6=no
10309 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
10310         if test $ol_enable_ipv6 = yes ; then
10311                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
10312         fi
10313 elif test $ol_enable_ipv6 != no ; then
10314         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
10315 echo "configure:10316: checking INET6_ADDRSTRLEN" >&5
10316 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
10317   echo $ac_n "(cached) $ac_c" 1>&6
10318 else
10319   
10320                 cat > conftest.$ac_ext <<EOF
10321 #line 10322 "configure"
10322 #include "confdefs.h"
10323
10324 #                       include <netinet/in.h>
10325 #                       ifdef INET6_ADDRSTRLEN
10326                                 __has_inet6_addrstrlen__;
10327 #                       endif
10328                 
10329 EOF
10330 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10331   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
10332   rm -rf conftest*
10333   ol_cv_inet6_addrstrlen=yes
10334 else
10335   rm -rf conftest*
10336   ol_cv_inet6_addrstrlen=no
10337 fi
10338 rm -f conftest*
10339
10340 fi
10341
10342 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
10343
10344
10345         echo $ac_n "checking struct sockaddr_storage""... $ac_c" 1>&6
10346 echo "configure:10347: checking struct sockaddr_storage" >&5
10347 if eval "test \"\${ol_cv_struct_sockaddr_storage+set}\" = set"; then
10348   echo $ac_n "(cached) $ac_c" 1>&6
10349 else
10350   
10351                 cat > conftest.$ac_ext <<EOF
10352 #line 10353 "configure"
10353 #include "confdefs.h"
10354
10355 #include <sys/types.h>
10356 #include <sys/socket.h>
10357
10358 int main() {
10359
10360                         struct sockaddr_storage ss;
10361
10362 ; return 0; }
10363 EOF
10364 if { (eval echo configure:10365: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10365   rm -rf conftest*
10366   ol_cv_struct_sockaddr_storage=yes
10367 else
10368   echo "configure: failed program was:" >&5
10369   cat conftest.$ac_ext >&5
10370   rm -rf conftest*
10371   ol_cv_struct_sockaddr_storage=no
10372 fi
10373 rm -f conftest*
10374 fi
10375
10376 echo "$ac_t""$ol_cv_struct_sockaddr_storage" 1>&6
10377
10378         if test $ol_cv_inet6_addrstrlen = yes \
10379                 -a $ol_cv_struct_sockaddr_storage = yes ; then
10380                 ol_link_ipv6=yes
10381         elif test $ol_enable_ipv6 = yes \
10382                         -a $ol_cv_inet6_addrstrlen = no ; then
10383                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
10384         elif test $ol_enable_ipv6 = yes \
10385                         -a $ol_cv_struct_sockaddr_storage = no ; then
10386                 { echo "configure: error: IPv6 support requires struct sockaddr_storage" 1>&2; exit 1; }
10387         fi
10388 fi
10389
10390 if test $ol_enable_local != no ; then
10391         for ac_hdr in sys/un.h 
10392 do
10393 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10394 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10395 echo "configure:10396: checking for $ac_hdr" >&5
10396 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10397   echo $ac_n "(cached) $ac_c" 1>&6
10398 else
10399   cat > conftest.$ac_ext <<EOF
10400 #line 10401 "configure"
10401 #include "confdefs.h"
10402 #include <$ac_hdr>
10403 EOF
10404 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10405 { (eval echo configure:10406: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10406 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10407 if test -z "$ac_err"; then
10408   rm -rf conftest*
10409   eval "ac_cv_header_$ac_safe=yes"
10410 else
10411   echo "$ac_err" >&5
10412   echo "configure: failed program was:" >&5
10413   cat conftest.$ac_ext >&5
10414   rm -rf conftest*
10415   eval "ac_cv_header_$ac_safe=no"
10416 fi
10417 rm -f conftest*
10418 fi
10419 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10420   echo "$ac_t""yes" 1>&6
10421     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10422   cat >> confdefs.h <<EOF
10423 #define $ac_tr_hdr 1
10424 EOF
10425  
10426 else
10427   echo "$ac_t""no" 1>&6
10428 fi
10429 done
10430
10431
10432         if test $ol_enable_local = auto ; then
10433                 ol_enable_local=$ac_cv_header_sys_un_h
10434         elif test $ac_cv_header_sys_un_h = no ; then
10435                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
10436         fi
10437 fi
10438
10439 ol_link_kbind=no
10440 ol_link_kpasswd=no
10441 ol_link_krb5=no
10442 ol_link_krb4=no
10443
10444 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
10445         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
10446         -o $ol_with_kerberos = k425 ; then
10447
10448         for ac_hdr in krb5.h
10449 do
10450 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10451 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10452 echo "configure:10453: checking for $ac_hdr" >&5
10453 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10454   echo $ac_n "(cached) $ac_c" 1>&6
10455 else
10456   cat > conftest.$ac_ext <<EOF
10457 #line 10458 "configure"
10458 #include "confdefs.h"
10459 #include <$ac_hdr>
10460 EOF
10461 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10462 { (eval echo configure:10463: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10463 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10464 if test -z "$ac_err"; then
10465   rm -rf conftest*
10466   eval "ac_cv_header_$ac_safe=yes"
10467 else
10468   echo "$ac_err" >&5
10469   echo "configure: failed program was:" >&5
10470   cat conftest.$ac_ext >&5
10471   rm -rf conftest*
10472   eval "ac_cv_header_$ac_safe=no"
10473 fi
10474 rm -f conftest*
10475 fi
10476 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10477   echo "$ac_t""yes" 1>&6
10478     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10479   cat >> confdefs.h <<EOF
10480 #define $ac_tr_hdr 1
10481 EOF
10482  
10483 else
10484   echo "$ac_t""no" 1>&6
10485 fi
10486 done
10487
10488
10489         if test $ac_cv_header_krb5_h = yes ; then
10490                                 for ac_hdr in heim_err.h
10491 do
10492 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10493 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10494 echo "configure:10495: checking for $ac_hdr" >&5
10495 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10496   echo $ac_n "(cached) $ac_c" 1>&6
10497 else
10498   cat > conftest.$ac_ext <<EOF
10499 #line 10500 "configure"
10500 #include "confdefs.h"
10501 #include <$ac_hdr>
10502 EOF
10503 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10504 { (eval echo configure:10505: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10505 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10506 if test -z "$ac_err"; then
10507   rm -rf conftest*
10508   eval "ac_cv_header_$ac_safe=yes"
10509 else
10510   echo "$ac_err" >&5
10511   echo "configure: failed program was:" >&5
10512   cat conftest.$ac_ext >&5
10513   rm -rf conftest*
10514   eval "ac_cv_header_$ac_safe=no"
10515 fi
10516 rm -f conftest*
10517 fi
10518 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10519   echo "$ac_t""yes" 1>&6
10520     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10521   cat >> confdefs.h <<EOF
10522 #define $ac_tr_hdr 1
10523 EOF
10524  
10525 else
10526   echo "$ac_t""no" 1>&6
10527 fi
10528 done
10529
10530                 if test $ac_cv_header_heim_err_h = yes ; then
10531                         krb5_impl=heimdal
10532                 else
10533                         krb5_impl=mit
10534                 fi
10535
10536                 if test $krb5_impl = mit; then
10537                         echo $ac_n "checking for main in -lk5crypto""... $ac_c" 1>&6
10538 echo "configure:10539: checking for main in -lk5crypto" >&5
10539 ac_lib_var=`echo k5crypto'_'main | sed 'y%./+-:%__p__%'`
10540 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10541   echo $ac_n "(cached) $ac_c" 1>&6
10542 else
10543   ac_save_LIBS="$LIBS"
10544 LIBS="-lk5crypto  $LIBS"
10545 cat > conftest.$ac_ext <<EOF
10546 #line 10547 "configure"
10547 #include "confdefs.h"
10548
10549 int main() {
10550 main()
10551 ; return 0; }
10552 EOF
10553 if { (eval echo configure:10554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10554   rm -rf conftest*
10555   eval "ac_cv_lib_$ac_lib_var=yes"
10556 else
10557   echo "configure: failed program was:" >&5
10558   cat conftest.$ac_ext >&5
10559   rm -rf conftest*
10560   eval "ac_cv_lib_$ac_lib_var=no"
10561 fi
10562 rm -f conftest*
10563 LIBS="$ac_save_LIBS"
10564
10565 fi
10566 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10567   echo "$ac_t""yes" 1>&6
10568   krb5crypto=k5crypto
10569 else
10570   echo "$ac_t""no" 1>&6
10571 krb5crypto=crypto
10572 fi
10573
10574
10575                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
10576 echo "configure:10577: checking for main in -lkrb5" >&5
10577 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
10578 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10579   echo $ac_n "(cached) $ac_c" 1>&6
10580 else
10581   ac_save_LIBS="$LIBS"
10582 LIBS="-lkrb5 -l$krb5crypto -lcom_err $LIBS"
10583 cat > conftest.$ac_ext <<EOF
10584 #line 10585 "configure"
10585 #include "confdefs.h"
10586
10587 int main() {
10588 main()
10589 ; return 0; }
10590 EOF
10591 if { (eval echo configure:10592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10592   rm -rf conftest*
10593   eval "ac_cv_lib_$ac_lib_var=yes"
10594 else
10595   echo "configure: failed program was:" >&5
10596   cat conftest.$ac_ext >&5
10597   rm -rf conftest*
10598   eval "ac_cv_lib_$ac_lib_var=no"
10599 fi
10600 rm -f conftest*
10601 LIBS="$ac_save_LIBS"
10602
10603 fi
10604 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10605   echo "$ac_t""yes" 1>&6
10606   have_krb5=yes
10607                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lcom_err"
10608 else
10609   echo "$ac_t""no" 1>&6
10610 have_krb5=no
10611 fi
10612
10613
10614                 elif test $krb5_impl = heimdal; then
10615                         echo $ac_n "checking for main in -ldes""... $ac_c" 1>&6
10616 echo "configure:10617: checking for main in -ldes" >&5
10617 ac_lib_var=`echo des'_'main | sed 'y%./+-:%__p__%'`
10618 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10619   echo $ac_n "(cached) $ac_c" 1>&6
10620 else
10621   ac_save_LIBS="$LIBS"
10622 LIBS="-ldes  $LIBS"
10623 cat > conftest.$ac_ext <<EOF
10624 #line 10625 "configure"
10625 #include "confdefs.h"
10626
10627 int main() {
10628 main()
10629 ; return 0; }
10630 EOF
10631 if { (eval echo configure:10632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10632   rm -rf conftest*
10633   eval "ac_cv_lib_$ac_lib_var=yes"
10634 else
10635   echo "configure: failed program was:" >&5
10636   cat conftest.$ac_ext >&5
10637   rm -rf conftest*
10638   eval "ac_cv_lib_$ac_lib_var=no"
10639 fi
10640 rm -f conftest*
10641 LIBS="$ac_save_LIBS"
10642
10643 fi
10644 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10645   echo "$ac_t""yes" 1>&6
10646   krb5crypto=des
10647 else
10648   echo "$ac_t""no" 1>&6
10649 krb5crypto=crypto
10650 fi
10651
10652
10653                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
10654 echo "configure:10655: checking for main in -lkrb5" >&5
10655 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
10656 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10657   echo $ac_n "(cached) $ac_c" 1>&6
10658 else
10659   ac_save_LIBS="$LIBS"
10660 LIBS="-lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err $LIBS"
10661 cat > conftest.$ac_ext <<EOF
10662 #line 10663 "configure"
10663 #include "confdefs.h"
10664
10665 int main() {
10666 main()
10667 ; return 0; }
10668 EOF
10669 if { (eval echo configure:10670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10670   rm -rf conftest*
10671   eval "ac_cv_lib_$ac_lib_var=yes"
10672 else
10673   echo "configure: failed program was:" >&5
10674   cat conftest.$ac_ext >&5
10675   rm -rf conftest*
10676   eval "ac_cv_lib_$ac_lib_var=no"
10677 fi
10678 rm -f conftest*
10679 LIBS="$ac_save_LIBS"
10680
10681 fi
10682 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10683   echo "$ac_t""yes" 1>&6
10684   have_krb5=yes
10685                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err"
10686 else
10687   echo "$ac_t""no" 1>&6
10688 have_krb5=no
10689 fi
10690
10691
10692                         cat >> confdefs.h <<\EOF
10693 #define HAVE_HEIMDAL_KERBEROS 1
10694 EOF
10695
10696
10697                 else
10698                         have_krb5=no
10699                         echo "configure: warning: Unrecognized Kerberos5 Implementation" 1>&2
10700                 fi
10701
10702                 if test $have_krb5 = yes ; then
10703                         ol_link_krb5=yes
10704
10705                         cat >> confdefs.h <<\EOF
10706 #define HAVE_KRB5 1
10707 EOF
10708
10709
10710                         if test $ol_enable_kpasswd != no ; then
10711                                 ol_link_kpasswd=yes;
10712                         fi
10713
10714                         if test $ol_with_kerberos = k5only ; then
10715                                 ol_with_kerberos=found
10716                         fi
10717
10718                 elif test $ol_with_kerberos != auto ; then
10719                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
10720                 fi
10721
10722         fi
10723 fi
10724
10725 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
10726         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
10727
10728         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
10729 do
10730 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10731 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10732 echo "configure:10733: checking for $ac_hdr" >&5
10733 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10734   echo $ac_n "(cached) $ac_c" 1>&6
10735 else
10736   cat > conftest.$ac_ext <<EOF
10737 #line 10738 "configure"
10738 #include "confdefs.h"
10739 #include <$ac_hdr>
10740 EOF
10741 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10742 { (eval echo configure:10743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10743 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10744 if test -z "$ac_err"; then
10745   rm -rf conftest*
10746   eval "ac_cv_header_$ac_safe=yes"
10747 else
10748   echo "$ac_err" >&5
10749   echo "configure: failed program was:" >&5
10750   cat conftest.$ac_ext >&5
10751   rm -rf conftest*
10752   eval "ac_cv_header_$ac_safe=no"
10753 fi
10754 rm -f conftest*
10755 fi
10756 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10757   echo "$ac_t""yes" 1>&6
10758     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10759   cat >> confdefs.h <<EOF
10760 #define $ac_tr_hdr 1
10761 EOF
10762  
10763 else
10764   echo "$ac_t""no" 1>&6
10765 fi
10766 done
10767
10768
10769         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
10770                 if test $krb5_impl = mit; then
10771                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
10772 echo "configure:10773: checking for main in -lkrb4" >&5
10773 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
10774 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10775   echo $ac_n "(cached) $ac_c" 1>&6
10776 else
10777   ac_save_LIBS="$LIBS"
10778 LIBS="-lkrb4 -ldes425 -lkrb5 -l$krb5crypto -lcom_err $LIBS"
10779 cat > conftest.$ac_ext <<EOF
10780 #line 10781 "configure"
10781 #include "confdefs.h"
10782
10783 int main() {
10784 main()
10785 ; return 0; }
10786 EOF
10787 if { (eval echo configure:10788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10788   rm -rf conftest*
10789   eval "ac_cv_lib_$ac_lib_var=yes"
10790 else
10791   echo "configure: failed program was:" >&5
10792   cat conftest.$ac_ext >&5
10793   rm -rf conftest*
10794   eval "ac_cv_lib_$ac_lib_var=no"
10795 fi
10796 rm -f conftest*
10797 LIBS="$ac_save_LIBS"
10798
10799 fi
10800 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10801   echo "$ac_t""yes" 1>&6
10802   have_k425=yes
10803                                 KRB4_LIBS="-lkrb4 -ldes425"
10804 else
10805   echo "$ac_t""no" 1>&6
10806 have_k425=no
10807 fi
10808
10809
10810                 elif test $krb5_impl = heimdal; then
10811                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
10812 echo "configure:10813: checking for main in -lkrb4" >&5
10813 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
10814 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10815   echo $ac_n "(cached) $ac_c" 1>&6
10816 else
10817   ac_save_LIBS="$LIBS"
10818 LIBS="-lkrb4 -lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err $LIBS"
10819 cat > conftest.$ac_ext <<EOF
10820 #line 10821 "configure"
10821 #include "confdefs.h"
10822
10823 int main() {
10824 main()
10825 ; return 0; }
10826 EOF
10827 if { (eval echo configure:10828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10828   rm -rf conftest*
10829   eval "ac_cv_lib_$ac_lib_var=yes"
10830 else
10831   echo "configure: failed program was:" >&5
10832   cat conftest.$ac_ext >&5
10833   rm -rf conftest*
10834   eval "ac_cv_lib_$ac_lib_var=no"
10835 fi
10836 rm -f conftest*
10837 LIBS="$ac_save_LIBS"
10838
10839 fi
10840 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10841   echo "$ac_t""yes" 1>&6
10842   have_k425=yes
10843                                 KRB4_LIBS="-lkrb4"
10844 else
10845   echo "$ac_t""no" 1>&6
10846 have_k425=no
10847 fi
10848
10849
10850                 else
10851                         have_425=no
10852                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
10853                 fi
10854
10855                 if test $have_k425 = yes ; then
10856                         ol_with_kerberos=found
10857                         ol_link_krb4=yes
10858
10859                         cat >> confdefs.h <<\EOF
10860 #define HAVE_KRB425 1
10861 EOF
10862
10863                         cat >> confdefs.h <<\EOF
10864 #define HAVE_KRB4 1
10865 EOF
10866
10867
10868                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
10869 echo "configure:10870: checking for des_debug in Kerberos libraries" >&5
10870 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
10871   echo $ac_n "(cached) $ac_c" 1>&6
10872 else
10873   
10874                                                                 save_LIBS="$LIBS"
10875                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
10876                                 cat > conftest.$ac_ext <<EOF
10877 #line 10878 "configure"
10878 #include "confdefs.h"
10879
10880 #include <kerberosIV/krb.h>
10881 #include <kerberosIV/des.h>
10882 extern int des_debug;
10883
10884 int main() {
10885
10886 des_debug = 1;
10887
10888 ; return 0; }
10889 EOF
10890 if { (eval echo configure:10891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10891   rm -rf conftest*
10892   ol_cv_var_des_debug=yes
10893 else
10894   echo "configure: failed program was:" >&5
10895   cat conftest.$ac_ext >&5
10896   rm -rf conftest*
10897   ol_cv_var_des_debug=no
10898 fi
10899 rm -f conftest*
10900                                                                 LIBS="$save_LIBS"
10901                         
10902 fi
10903
10904 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
10905
10906                         if test $ol_cv_var_des_debug = yes ; then
10907                                 cat >> confdefs.h <<\EOF
10908 #define HAVE_DES_DEBUG 1
10909 EOF
10910
10911                         fi
10912
10913                         LIBS="$save_LIBS"
10914                 fi
10915         fi
10916 fi
10917
10918 if test $ol_link_krb5 = yes ; then
10919         ol_with_kerberos=found
10920 fi
10921
10922 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
10923         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
10924
10925         for ac_hdr in krb.h des.h krb-archaeology.h 
10926 do
10927 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10928 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10929 echo "configure:10930: checking for $ac_hdr" >&5
10930 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10931   echo $ac_n "(cached) $ac_c" 1>&6
10932 else
10933   cat > conftest.$ac_ext <<EOF
10934 #line 10935 "configure"
10935 #include "confdefs.h"
10936 #include <$ac_hdr>
10937 EOF
10938 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10939 { (eval echo configure:10940: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10940 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10941 if test -z "$ac_err"; then
10942   rm -rf conftest*
10943   eval "ac_cv_header_$ac_safe=yes"
10944 else
10945   echo "$ac_err" >&5
10946   echo "configure: failed program was:" >&5
10947   cat conftest.$ac_ext >&5
10948   rm -rf conftest*
10949   eval "ac_cv_header_$ac_safe=no"
10950 fi
10951 rm -f conftest*
10952 fi
10953 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10954   echo "$ac_t""yes" 1>&6
10955     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10956   cat >> confdefs.h <<EOF
10957 #define $ac_tr_hdr 1
10958 EOF
10959  
10960 else
10961   echo "$ac_t""no" 1>&6
10962 fi
10963 done
10964
10965
10966         if test $ac_cv_header_krb_h = yes ; then
10967                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
10968 echo "configure:10969: checking for main in -lkrb" >&5
10969 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
10970 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10971   echo $ac_n "(cached) $ac_c" 1>&6
10972 else
10973   ac_save_LIBS="$LIBS"
10974 LIBS="-lkrb -ldes $LIBS"
10975 cat > conftest.$ac_ext <<EOF
10976 #line 10977 "configure"
10977 #include "confdefs.h"
10978
10979 int main() {
10980 main()
10981 ; return 0; }
10982 EOF
10983 if { (eval echo configure:10984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10984   rm -rf conftest*
10985   eval "ac_cv_lib_$ac_lib_var=yes"
10986 else
10987   echo "configure: failed program was:" >&5
10988   cat conftest.$ac_ext >&5
10989   rm -rf conftest*
10990   eval "ac_cv_lib_$ac_lib_var=no"
10991 fi
10992 rm -f conftest*
10993 LIBS="$ac_save_LIBS"
10994
10995 fi
10996 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10997   echo "$ac_t""yes" 1>&6
10998   have_k4=yes
10999 else
11000   echo "$ac_t""no" 1>&6
11001 have_k4=no
11002 fi
11003
11004
11005                 if test $have_k4 = yes ; then
11006                         ol_with_kerberos=found
11007                         ol_link_krb4=yes
11008
11009                         cat >> confdefs.h <<\EOF
11010 #define HAVE_KRB4 1
11011 EOF
11012
11013
11014                         KRB4_LIBS="-lkrb -ldes"
11015
11016                         if test $ac_cv_header_krb_archaeology_h = yes ; then
11017                                 cat >> confdefs.h <<\EOF
11018 #define HAVE_KTH_KERBEROS 1
11019 EOF
11020
11021                         fi
11022                 fi
11023         fi
11024 fi
11025
11026 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
11027         ol_link_kpasswd=yes
11028 fi
11029
11030 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
11031         ol_link_kbind=yes
11032
11033 elif test $ol_enable_kbind = yes ; then
11034         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
11035 fi
11036
11037 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
11038         cat >> confdefs.h <<\EOF
11039 #define HAVE_KERBEROS 1
11040 EOF
11041
11042
11043 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
11044         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
11045 fi
11046
11047 ol_link_tls=no
11048 if test $ol_with_tls != no ; then
11049         for ac_hdr in openssl/ssl.h ssl.h
11050 do
11051 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11052 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11053 echo "configure:11054: checking for $ac_hdr" >&5
11054 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11055   echo $ac_n "(cached) $ac_c" 1>&6
11056 else
11057   cat > conftest.$ac_ext <<EOF
11058 #line 11059 "configure"
11059 #include "confdefs.h"
11060 #include <$ac_hdr>
11061 EOF
11062 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11063 { (eval echo configure:11064: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11064 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11065 if test -z "$ac_err"; then
11066   rm -rf conftest*
11067   eval "ac_cv_header_$ac_safe=yes"
11068 else
11069   echo "$ac_err" >&5
11070   echo "configure: failed program was:" >&5
11071   cat conftest.$ac_ext >&5
11072   rm -rf conftest*
11073   eval "ac_cv_header_$ac_safe=no"
11074 fi
11075 rm -f conftest*
11076 fi
11077 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11078   echo "$ac_t""yes" 1>&6
11079     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11080   cat >> confdefs.h <<EOF
11081 #define $ac_tr_hdr 1
11082 EOF
11083  
11084 else
11085   echo "$ac_t""no" 1>&6
11086 fi
11087 done
11088
11089         
11090         if test $ac_cv_header_openssl_ssl_h = yes \
11091                 -o $ac_cv_header_ssl_h = yes ; then
11092                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
11093 echo "configure:11094: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
11094 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
11095 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11096   echo $ac_n "(cached) $ac_c" 1>&6
11097 else
11098   ac_save_LIBS="$LIBS"
11099 LIBS="-lssl -lcrypto $LIBS"
11100 cat > conftest.$ac_ext <<EOF
11101 #line 11102 "configure"
11102 #include "confdefs.h"
11103 /* Override any gcc2 internal prototype to avoid an error.  */
11104 /* We use char because int might match the return type of a gcc2
11105     builtin and then its argument prototype would still apply.  */
11106 char SSLeay_add_ssl_algorithms();
11107
11108 int main() {
11109 SSLeay_add_ssl_algorithms()
11110 ; return 0; }
11111 EOF
11112 if { (eval echo configure:11113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11113   rm -rf conftest*
11114   eval "ac_cv_lib_$ac_lib_var=yes"
11115 else
11116   echo "configure: failed program was:" >&5
11117   cat conftest.$ac_ext >&5
11118   rm -rf conftest*
11119   eval "ac_cv_lib_$ac_lib_var=no"
11120 fi
11121 rm -f conftest*
11122 LIBS="$ac_save_LIBS"
11123
11124 fi
11125 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11126   echo "$ac_t""yes" 1>&6
11127   have_ssleay=yes
11128                         need_rsaref=no
11129 else
11130   echo "$ac_t""no" 1>&6
11131 have_ssleay=no
11132 fi
11133
11134                         
11135                 if test $have_ssleay = no ; then
11136                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
11137 echo "configure:11138: checking for SSL_library_init in -lssl" >&5
11138 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
11139 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11140   echo $ac_n "(cached) $ac_c" 1>&6
11141 else
11142   ac_save_LIBS="$LIBS"
11143 LIBS="-lssl -lcrypto $LIBS"
11144 cat > conftest.$ac_ext <<EOF
11145 #line 11146 "configure"
11146 #include "confdefs.h"
11147 /* Override any gcc2 internal prototype to avoid an error.  */
11148 /* We use char because int might match the return type of a gcc2
11149     builtin and then its argument prototype would still apply.  */
11150 char SSL_library_init();
11151
11152 int main() {
11153 SSL_library_init()
11154 ; return 0; }
11155 EOF
11156 if { (eval echo configure:11157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11157   rm -rf conftest*
11158   eval "ac_cv_lib_$ac_lib_var=yes"
11159 else
11160   echo "configure: failed program was:" >&5
11161   cat conftest.$ac_ext >&5
11162   rm -rf conftest*
11163   eval "ac_cv_lib_$ac_lib_var=no"
11164 fi
11165 rm -f conftest*
11166 LIBS="$ac_save_LIBS"
11167
11168 fi
11169 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11170   echo "$ac_t""yes" 1>&6
11171   have_ssleay=yes
11172                                 need_rsaref=no
11173 else
11174   echo "$ac_t""no" 1>&6
11175 have_ssleay=no
11176 fi
11177
11178                 fi
11179
11180                 if test $have_ssleay = no ; then
11181                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
11182 echo "configure:11183: checking for ssl3_accept in -lssl" >&5
11183 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
11184 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11185   echo $ac_n "(cached) $ac_c" 1>&6
11186 else
11187   ac_save_LIBS="$LIBS"
11188 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
11189 cat > conftest.$ac_ext <<EOF
11190 #line 11191 "configure"
11191 #include "confdefs.h"
11192 /* Override any gcc2 internal prototype to avoid an error.  */
11193 /* We use char because int might match the return type of a gcc2
11194     builtin and then its argument prototype would still apply.  */
11195 char ssl3_accept();
11196
11197 int main() {
11198 ssl3_accept()
11199 ; return 0; }
11200 EOF
11201 if { (eval echo configure:11202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11202   rm -rf conftest*
11203   eval "ac_cv_lib_$ac_lib_var=yes"
11204 else
11205   echo "configure: failed program was:" >&5
11206   cat conftest.$ac_ext >&5
11207   rm -rf conftest*
11208   eval "ac_cv_lib_$ac_lib_var=no"
11209 fi
11210 rm -f conftest*
11211 LIBS="$ac_save_LIBS"
11212
11213 fi
11214 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11215   echo "$ac_t""yes" 1>&6
11216   have_ssleay=yes
11217                                 need_rsaref=yes
11218 else
11219   echo "$ac_t""no" 1>&6
11220 have_ssleay=no
11221 fi
11222
11223                 fi
11224
11225                 if test $have_ssleay = yes ; then
11226                         ol_with_tls=found
11227                         ol_link_tls=yes
11228
11229                         cat >> confdefs.h <<\EOF
11230 #define HAVE_SSLEAY 1
11231 EOF
11232
11233
11234                         if test $need_rsaref = yes; then
11235                                 cat >> confdefs.h <<\EOF
11236 #define HAVE_RSAREF 1
11237 EOF
11238
11239
11240                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
11241                         else
11242                                 TLS_LIBS="-lssl -lcrypto"
11243                         fi
11244                 fi
11245         fi
11246
11247 else
11248         echo "configure: warning: TLS data protection not supported!" 1>&2
11249 fi
11250
11251 if test $ol_link_tls = yes ; then
11252         cat >> confdefs.h <<\EOF
11253 #define HAVE_TLS 1
11254 EOF
11255
11256
11257 elif test $ol_with_tls = auto ; then
11258         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
11259         echo "configure: warning: TLS data protection not supported!" 1>&2
11260
11261 elif test $ol_with_tls != no ; then
11262         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
11263 fi
11264
11265 if test $ol_enable_lmpasswd != no; then
11266         if test $ol_link_tls != yes ; then
11267                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
11268         fi
11269
11270         cat >> confdefs.h <<\EOF
11271 #define SLAPD_LMHASH 1
11272 EOF
11273
11274 fi
11275
11276 ol_link_threads=no
11277
11278 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11279         -o $ol_with_threads = nt ; then
11280
11281         
11282         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
11283 echo "configure:11284: checking for _beginthread" >&5
11284 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
11285   echo $ac_n "(cached) $ac_c" 1>&6
11286 else
11287   cat > conftest.$ac_ext <<EOF
11288 #line 11289 "configure"
11289 #include "confdefs.h"
11290 /* System header to define __stub macros and hopefully few prototypes,
11291     which can conflict with char _beginthread(); below.  */
11292 #include <assert.h>
11293 /* Override any gcc2 internal prototype to avoid an error.  */
11294 /* We use char because int might match the return type of a gcc2
11295     builtin and then its argument prototype would still apply.  */
11296 char _beginthread();
11297 char (*f)();
11298
11299 int main() {
11300
11301 /* The GNU C library defines this for functions which it implements
11302     to always fail with ENOSYS.  Some functions are actually named
11303     something starting with __ and the normal name is an alias.  */
11304 #if defined (__stub__beginthread) || defined (__stub____beginthread)
11305 choke me
11306 #else
11307 f = _beginthread;
11308 #endif
11309
11310 ; return 0; }
11311 EOF
11312 if { (eval echo configure:11313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11313   rm -rf conftest*
11314   eval "ac_cv_func__beginthread=yes"
11315 else
11316   echo "configure: failed program was:" >&5
11317   cat conftest.$ac_ext >&5
11318   rm -rf conftest*
11319   eval "ac_cv_func__beginthread=no"
11320 fi
11321 rm -f conftest*
11322 fi
11323
11324 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
11325   echo "$ac_t""yes" 1>&6
11326   :
11327 else
11328   echo "$ac_t""no" 1>&6
11329 fi
11330
11331
11332         if test $ac_cv_func__beginthread = yes ; then
11333                 cat >> confdefs.h <<\EOF
11334 #define HAVE_NT_THREADS 1
11335 EOF
11336
11337                 ol_cv_nt_threads=yes
11338         fi
11339
11340
11341         if test "$ol_cv_nt_threads" = yes ; then
11342                 ol_link_threads=nt
11343                 ol_with_threads=found
11344                 ol_with_yielding_select=yes
11345
11346                 cat >> confdefs.h <<\EOF
11347 #define HAVE_NT_SERVICE_MANAGER 1
11348 EOF
11349
11350                 cat >> confdefs.h <<\EOF
11351 #define HAVE_NT_EVENT_LOG 1
11352 EOF
11353
11354         fi
11355
11356         if test $ol_with_threads = nt ; then
11357                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
11358         fi
11359 fi
11360
11361 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11362         -o $ol_with_threads = posix ; then
11363
11364         for ac_hdr in pthread.h
11365 do
11366 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11367 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11368 echo "configure:11369: checking for $ac_hdr" >&5
11369 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11370   echo $ac_n "(cached) $ac_c" 1>&6
11371 else
11372   cat > conftest.$ac_ext <<EOF
11373 #line 11374 "configure"
11374 #include "confdefs.h"
11375 #include <$ac_hdr>
11376 EOF
11377 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11378 { (eval echo configure:11379: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11379 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11380 if test -z "$ac_err"; then
11381   rm -rf conftest*
11382   eval "ac_cv_header_$ac_safe=yes"
11383 else
11384   echo "$ac_err" >&5
11385   echo "configure: failed program was:" >&5
11386   cat conftest.$ac_ext >&5
11387   rm -rf conftest*
11388   eval "ac_cv_header_$ac_safe=no"
11389 fi
11390 rm -f conftest*
11391 fi
11392 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11393   echo "$ac_t""yes" 1>&6
11394     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11395   cat >> confdefs.h <<EOF
11396 #define $ac_tr_hdr 1
11397 EOF
11398  
11399 else
11400   echo "$ac_t""no" 1>&6
11401 fi
11402 done
11403
11404
11405         if test $ac_cv_header_pthread_h = yes ; then
11406                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
11407 echo "configure:11408: checking POSIX thread version" >&5
11408 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
11409   echo $ac_n "(cached) $ac_c" 1>&6
11410 else
11411   
11412         cat > conftest.$ac_ext <<EOF
11413 #line 11414 "configure"
11414 #include "confdefs.h"
11415
11416 #               include <pthread.h>
11417         
11418 int main() {
11419
11420                 int i = PTHREAD_CREATE_JOINABLE;
11421         
11422 ; return 0; }
11423 EOF
11424 if { (eval echo configure:11425: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11425   rm -rf conftest*
11426   
11427         cat > conftest.$ac_ext <<EOF
11428 #line 11429 "configure"
11429 #include "confdefs.h"
11430 #include <pthread.h>
11431 EOF
11432 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11433   egrep "pthread_detach" >/dev/null 2>&1; then
11434   rm -rf conftest*
11435   ol_cv_pthread_version=10
11436 else
11437   rm -rf conftest*
11438   ol_cv_pthread_version=8
11439 fi
11440 rm -f conftest*
11441
11442 else
11443   echo "configure: failed program was:" >&5
11444   cat conftest.$ac_ext >&5
11445   rm -rf conftest*
11446   
11447         cat > conftest.$ac_ext <<EOF
11448 #line 11449 "configure"
11449 #include "confdefs.h"
11450
11451 #               include <pthread.h>
11452 #               ifdef PTHREAD_CREATE_UNDETACHED
11453                 draft7
11454 #               endif
11455         
11456 EOF
11457 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11458   egrep "draft7" >/dev/null 2>&1; then
11459   rm -rf conftest*
11460   ol_cv_pthread_version=7
11461 else
11462   rm -rf conftest*
11463   
11464         cat > conftest.$ac_ext <<EOF
11465 #line 11466 "configure"
11466 #include "confdefs.h"
11467 #include <pthread.h>
11468 EOF
11469 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11470   egrep "pthread_attr_init" >/dev/null 2>&1; then
11471   rm -rf conftest*
11472   ol_cv_pthread_version=6
11473 else
11474   rm -rf conftest*
11475   
11476         cat > conftest.$ac_ext <<EOF
11477 #line 11478 "configure"
11478 #include "confdefs.h"
11479
11480 #               include <pthread.h>
11481 #ifdef          PTHREAD_MUTEX_INITIALIZER
11482                 draft5
11483 #endif
11484         
11485 EOF
11486 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11487   egrep "draft5" >/dev/null 2>&1; then
11488   rm -rf conftest*
11489   ol_cv_pthread_version=5
11490 else
11491   rm -rf conftest*
11492   ol_cv_pthread_version=4
11493 fi
11494 rm -f conftest*
11495  
11496 fi
11497 rm -f conftest*
11498  
11499 fi
11500 rm -f conftest*
11501  
11502 fi
11503 rm -f conftest*
11504
11505 fi
11506
11507 echo "$ac_t""$ol_cv_pthread_version" 1>&6
11508
11509
11510                 if test $ol_cv_pthread_version != 0 ; then
11511                         cat >> confdefs.h <<EOF
11512 #define HAVE_PTHREADS $ol_cv_pthread_version
11513 EOF
11514
11515                 else
11516                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
11517                 fi
11518
11519                 # consider threads found
11520                 ol_with_threads=found
11521
11522                 
11523         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
11524 echo "configure:11525: checking for LinuxThreads pthread.h" >&5
11525 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
11526   echo $ac_n "(cached) $ac_c" 1>&6
11527 else
11528   cat > conftest.$ac_ext <<EOF
11529 #line 11530 "configure"
11530 #include "confdefs.h"
11531 #include <pthread.h>
11532 EOF
11533 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11534   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
11535   rm -rf conftest*
11536   ol_cv_header_linux_threads=yes
11537 else
11538   rm -rf conftest*
11539   ol_cv_header_linux_threads=no
11540 fi
11541 rm -f conftest*
11542
11543                 
11544 fi
11545
11546 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
11547         if test $ol_cv_header_linux_threads = yes; then
11548                 cat >> confdefs.h <<\EOF
11549 #define HAVE_LINUX_THREADS 1
11550 EOF
11551
11552         fi
11553
11554                 
11555         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
11556 echo "configure:11557: checking for GNU Pth pthread.h" >&5
11557 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
11558   echo $ac_n "(cached) $ac_c" 1>&6
11559 else
11560   cat > conftest.$ac_ext <<EOF
11561 #line 11562 "configure"
11562 #include "confdefs.h"
11563 #include <pthread.h>
11564 #ifdef _POSIX_THREAD_IS_GNU_PTH
11565         __gnu_pth__;
11566 #endif
11567
11568 EOF
11569 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11570   egrep "__gnu_pth__" >/dev/null 2>&1; then
11571   rm -rf conftest*
11572   ol_cv_header_gnu_pth_pthread_h=yes
11573 else
11574   rm -rf conftest*
11575   ol_cv_header_gnu_pth_pthread_h=no
11576 fi
11577 rm -f conftest*
11578
11579                 
11580 fi
11581
11582 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
11583
11584
11585                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
11586                         for ac_hdr in sched.h
11587 do
11588 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11589 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11590 echo "configure:11591: checking for $ac_hdr" >&5
11591 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11592   echo $ac_n "(cached) $ac_c" 1>&6
11593 else
11594   cat > conftest.$ac_ext <<EOF
11595 #line 11596 "configure"
11596 #include "confdefs.h"
11597 #include <$ac_hdr>
11598 EOF
11599 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11600 { (eval echo configure:11601: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11601 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11602 if test -z "$ac_err"; then
11603   rm -rf conftest*
11604   eval "ac_cv_header_$ac_safe=yes"
11605 else
11606   echo "$ac_err" >&5
11607   echo "configure: failed program was:" >&5
11608   cat conftest.$ac_ext >&5
11609   rm -rf conftest*
11610   eval "ac_cv_header_$ac_safe=no"
11611 fi
11612 rm -f conftest*
11613 fi
11614 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11615   echo "$ac_t""yes" 1>&6
11616     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11617   cat >> confdefs.h <<EOF
11618 #define $ac_tr_hdr 1
11619 EOF
11620  
11621 else
11622   echo "$ac_t""no" 1>&6
11623 fi
11624 done
11625
11626                 fi
11627
11628                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
11629                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
11630 echo "configure:11631: checking for pthread_create in default libraries" >&5
11631 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
11632   echo $ac_n "(cached) $ac_c" 1>&6
11633 else
11634   
11635                 if test "$cross_compiling" = yes; then
11636   cat > conftest.$ac_ext <<EOF
11637 #line 11638 "configure"
11638 #include "confdefs.h"
11639 /* pthread test headers */
11640 #include <pthread.h>
11641 #if HAVE_PTHREADS < 7
11642 #include <errno.h>
11643 #endif
11644 #ifndef NULL
11645 #define NULL (void*)0
11646 #endif
11647
11648 static void *task(p)
11649         void *p;
11650 {
11651         return (void *) (p == NULL);
11652 }
11653
11654 int main() {
11655
11656         /* pthread test function */
11657 #ifndef PTHREAD_CREATE_DETACHED
11658 #define PTHREAD_CREATE_DETACHED 1
11659 #endif
11660         pthread_t t;
11661         int status;
11662         int detach = PTHREAD_CREATE_DETACHED;
11663
11664 #if HAVE_PTHREADS > 4
11665         /* Final pthreads */
11666         pthread_attr_t attr;
11667
11668         status = pthread_attr_init(&attr);
11669         if( status ) return status;
11670
11671 #if HAVE_PTHREADS < 7
11672         status = pthread_attr_setdetachstate(&attr, &detach);
11673         if( status < 0 ) status = errno;
11674 #else
11675         status = pthread_attr_setdetachstate(&attr, detach);
11676 #endif
11677         if( status ) return status;
11678         status = pthread_create( &t, &attr, task, NULL );
11679 #if HAVE_PTHREADS < 7
11680         if( status < 0 ) status = errno;
11681 #endif
11682         if( status ) return status;
11683 #else
11684         /* Draft 4 pthreads */
11685         status = pthread_create( &t, pthread_attr_default, task, NULL );
11686         if( status ) return errno;
11687
11688         /* give thread a chance to complete */
11689         /* it should remain joinable and hence detachable */
11690         sleep( 1 );
11691
11692         status = pthread_detach( &t );
11693         if( status ) return errno;
11694 #endif
11695
11696 #ifdef HAVE_LINUX_THREADS
11697         pthread_kill_other_threads_np();
11698 #endif
11699
11700         return 0;
11701
11702 ; return 0; }
11703 EOF
11704 if { (eval echo configure:11705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11705   rm -rf conftest*
11706   ol_cv_pthread_create=yes
11707 else
11708   echo "configure: failed program was:" >&5
11709   cat conftest.$ac_ext >&5
11710   rm -rf conftest*
11711   ol_cv_pthread_create=no
11712 fi
11713 rm -f conftest*
11714 else
11715   cat > conftest.$ac_ext <<EOF
11716 #line 11717 "configure"
11717 #include "confdefs.h"
11718 /* pthread test headers */
11719 #include <pthread.h>
11720 #if HAVE_PTHREADS < 7
11721 #include <errno.h>
11722 #endif
11723 #ifndef NULL
11724 #define NULL (void*)0
11725 #endif
11726
11727 static void *task(p)
11728         void *p;
11729 {
11730         return (void *) (p == NULL);
11731 }
11732
11733
11734 int main(argc, argv)
11735         int argc;
11736         char **argv;
11737 {
11738
11739         /* pthread test function */
11740 #ifndef PTHREAD_CREATE_DETACHED
11741 #define PTHREAD_CREATE_DETACHED 1
11742 #endif
11743         pthread_t t;
11744         int status;
11745         int detach = PTHREAD_CREATE_DETACHED;
11746
11747 #if HAVE_PTHREADS > 4
11748         /* Final pthreads */
11749         pthread_attr_t attr;
11750
11751         status = pthread_attr_init(&attr);
11752         if( status ) return status;
11753
11754 #if HAVE_PTHREADS < 7
11755         status = pthread_attr_setdetachstate(&attr, &detach);
11756         if( status < 0 ) status = errno;
11757 #else
11758         status = pthread_attr_setdetachstate(&attr, detach);
11759 #endif
11760         if( status ) return status;
11761         status = pthread_create( &t, &attr, task, NULL );
11762 #if HAVE_PTHREADS < 7
11763         if( status < 0 ) status = errno;
11764 #endif
11765         if( status ) return status;
11766 #else
11767         /* Draft 4 pthreads */
11768         status = pthread_create( &t, pthread_attr_default, task, NULL );
11769         if( status ) return errno;
11770
11771         /* give thread a chance to complete */
11772         /* it should remain joinable and hence detachable */
11773         sleep( 1 );
11774
11775         status = pthread_detach( &t );
11776         if( status ) return errno;
11777 #endif
11778
11779 #ifdef HAVE_LINUX_THREADS
11780         pthread_kill_other_threads_np();
11781 #endif
11782
11783         return 0;
11784
11785 }
11786
11787 EOF
11788 if { (eval echo configure:11789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11789 then
11790   ol_cv_pthread_create=yes
11791 else
11792   echo "configure: failed program was:" >&5
11793   cat conftest.$ac_ext >&5
11794   rm -fr conftest*
11795   ol_cv_pthread_create=no
11796 fi
11797 rm -fr conftest*
11798 fi
11799
11800 fi
11801
11802 echo "$ac_t""$ol_cv_pthread_create" 1>&6
11803
11804                 if test $ol_cv_pthread_create != no ; then
11805                         ol_link_threads=posix
11806                         ol_link_pthreads=""
11807                 fi
11808                 
11809                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
11810 if test "$ol_link_threads" = no ; then
11811         # try -kthread
11812         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
11813 echo "configure:11814: checking for pthread link with -kthread" >&5
11814 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
11815   echo $ac_n "(cached) $ac_c" 1>&6
11816 else
11817   
11818                 # save the flags
11819                 ol_LIBS="$LIBS"
11820                 LIBS="-kthread $LIBS"
11821
11822                 if test "$cross_compiling" = yes; then
11823   cat > conftest.$ac_ext <<EOF
11824 #line 11825 "configure"
11825 #include "confdefs.h"
11826 /* pthread test headers */
11827 #include <pthread.h>
11828 #if HAVE_PTHREADS < 7
11829 #include <errno.h>
11830 #endif
11831 #ifndef NULL
11832 #define NULL (void*)0
11833 #endif
11834
11835 static void *task(p)
11836         void *p;
11837 {
11838         return (void *) (p == NULL);
11839 }
11840
11841 int main() {
11842
11843         /* pthread test function */
11844 #ifndef PTHREAD_CREATE_DETACHED
11845 #define PTHREAD_CREATE_DETACHED 1
11846 #endif
11847         pthread_t t;
11848         int status;
11849         int detach = PTHREAD_CREATE_DETACHED;
11850
11851 #if HAVE_PTHREADS > 4
11852         /* Final pthreads */
11853         pthread_attr_t attr;
11854
11855         status = pthread_attr_init(&attr);
11856         if( status ) return status;
11857
11858 #if HAVE_PTHREADS < 7
11859         status = pthread_attr_setdetachstate(&attr, &detach);
11860         if( status < 0 ) status = errno;
11861 #else
11862         status = pthread_attr_setdetachstate(&attr, detach);
11863 #endif
11864         if( status ) return status;
11865         status = pthread_create( &t, &attr, task, NULL );
11866 #if HAVE_PTHREADS < 7
11867         if( status < 0 ) status = errno;
11868 #endif
11869         if( status ) return status;
11870 #else
11871         /* Draft 4 pthreads */
11872         status = pthread_create( &t, pthread_attr_default, task, NULL );
11873         if( status ) return errno;
11874
11875         /* give thread a chance to complete */
11876         /* it should remain joinable and hence detachable */
11877         sleep( 1 );
11878
11879         status = pthread_detach( &t );
11880         if( status ) return errno;
11881 #endif
11882
11883 #ifdef HAVE_LINUX_THREADS
11884         pthread_kill_other_threads_np();
11885 #endif
11886
11887         return 0;
11888
11889 ; return 0; }
11890 EOF
11891 if { (eval echo configure:11892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11892   rm -rf conftest*
11893   ol_cv_pthread_kthread=yes
11894 else
11895   echo "configure: failed program was:" >&5
11896   cat conftest.$ac_ext >&5
11897   rm -rf conftest*
11898   ol_cv_pthread_kthread=no
11899 fi
11900 rm -f conftest*
11901 else
11902   cat > conftest.$ac_ext <<EOF
11903 #line 11904 "configure"
11904 #include "confdefs.h"
11905 /* pthread test headers */
11906 #include <pthread.h>
11907 #if HAVE_PTHREADS < 7
11908 #include <errno.h>
11909 #endif
11910 #ifndef NULL
11911 #define NULL (void*)0
11912 #endif
11913
11914 static void *task(p)
11915         void *p;
11916 {
11917         return (void *) (p == NULL);
11918 }
11919
11920
11921 int main(argc, argv)
11922         int argc;
11923         char **argv;
11924 {
11925
11926         /* pthread test function */
11927 #ifndef PTHREAD_CREATE_DETACHED
11928 #define PTHREAD_CREATE_DETACHED 1
11929 #endif
11930         pthread_t t;
11931         int status;
11932         int detach = PTHREAD_CREATE_DETACHED;
11933
11934 #if HAVE_PTHREADS > 4
11935         /* Final pthreads */
11936         pthread_attr_t attr;
11937
11938         status = pthread_attr_init(&attr);
11939         if( status ) return status;
11940
11941 #if HAVE_PTHREADS < 7
11942         status = pthread_attr_setdetachstate(&attr, &detach);
11943         if( status < 0 ) status = errno;
11944 #else
11945         status = pthread_attr_setdetachstate(&attr, detach);
11946 #endif
11947         if( status ) return status;
11948         status = pthread_create( &t, &attr, task, NULL );
11949 #if HAVE_PTHREADS < 7
11950         if( status < 0 ) status = errno;
11951 #endif
11952         if( status ) return status;
11953 #else
11954         /* Draft 4 pthreads */
11955         status = pthread_create( &t, pthread_attr_default, task, NULL );
11956         if( status ) return errno;
11957
11958         /* give thread a chance to complete */
11959         /* it should remain joinable and hence detachable */
11960         sleep( 1 );
11961
11962         status = pthread_detach( &t );
11963         if( status ) return errno;
11964 #endif
11965
11966 #ifdef HAVE_LINUX_THREADS
11967         pthread_kill_other_threads_np();
11968 #endif
11969
11970         return 0;
11971
11972 }
11973
11974 EOF
11975 if { (eval echo configure:11976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11976 then
11977   ol_cv_pthread_kthread=yes
11978 else
11979   echo "configure: failed program was:" >&5
11980   cat conftest.$ac_ext >&5
11981   rm -fr conftest*
11982   ol_cv_pthread_kthread=no
11983 fi
11984 rm -fr conftest*
11985 fi
11986
11987
11988                 # restore the LIBS
11989                 LIBS="$ol_LIBS"
11990         
11991 fi
11992
11993 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
11994
11995         if test $ol_cv_pthread_kthread = yes ; then
11996                 ol_link_pthreads="-kthread"
11997                 ol_link_threads=posix
11998         fi
11999 fi
12000
12001                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
12002 if test "$ol_link_threads" = no ; then
12003         # try -pthread
12004         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
12005 echo "configure:12006: checking for pthread link with -pthread" >&5
12006 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
12007   echo $ac_n "(cached) $ac_c" 1>&6
12008 else
12009   
12010                 # save the flags
12011                 ol_LIBS="$LIBS"
12012                 LIBS="-pthread $LIBS"
12013
12014                 if test "$cross_compiling" = yes; then
12015   cat > conftest.$ac_ext <<EOF
12016 #line 12017 "configure"
12017 #include "confdefs.h"
12018 /* pthread test headers */
12019 #include <pthread.h>
12020 #if HAVE_PTHREADS < 7
12021 #include <errno.h>
12022 #endif
12023 #ifndef NULL
12024 #define NULL (void*)0
12025 #endif
12026
12027 static void *task(p)
12028         void *p;
12029 {
12030         return (void *) (p == NULL);
12031 }
12032
12033 int main() {
12034
12035         /* pthread test function */
12036 #ifndef PTHREAD_CREATE_DETACHED
12037 #define PTHREAD_CREATE_DETACHED 1
12038 #endif
12039         pthread_t t;
12040         int status;
12041         int detach = PTHREAD_CREATE_DETACHED;
12042
12043 #if HAVE_PTHREADS > 4
12044         /* Final pthreads */
12045         pthread_attr_t attr;
12046
12047         status = pthread_attr_init(&attr);
12048         if( status ) return status;
12049
12050 #if HAVE_PTHREADS < 7
12051         status = pthread_attr_setdetachstate(&attr, &detach);
12052         if( status < 0 ) status = errno;
12053 #else
12054         status = pthread_attr_setdetachstate(&attr, detach);
12055 #endif
12056         if( status ) return status;
12057         status = pthread_create( &t, &attr, task, NULL );
12058 #if HAVE_PTHREADS < 7
12059         if( status < 0 ) status = errno;
12060 #endif
12061         if( status ) return status;
12062 #else
12063         /* Draft 4 pthreads */
12064         status = pthread_create( &t, pthread_attr_default, task, NULL );
12065         if( status ) return errno;
12066
12067         /* give thread a chance to complete */
12068         /* it should remain joinable and hence detachable */
12069         sleep( 1 );
12070
12071         status = pthread_detach( &t );
12072         if( status ) return errno;
12073 #endif
12074
12075 #ifdef HAVE_LINUX_THREADS
12076         pthread_kill_other_threads_np();
12077 #endif
12078
12079         return 0;
12080
12081 ; return 0; }
12082 EOF
12083 if { (eval echo configure:12084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12084   rm -rf conftest*
12085   ol_cv_pthread_pthread=yes
12086 else
12087   echo "configure: failed program was:" >&5
12088   cat conftest.$ac_ext >&5
12089   rm -rf conftest*
12090   ol_cv_pthread_pthread=no
12091 fi
12092 rm -f conftest*
12093 else
12094   cat > conftest.$ac_ext <<EOF
12095 #line 12096 "configure"
12096 #include "confdefs.h"
12097 /* pthread test headers */
12098 #include <pthread.h>
12099 #if HAVE_PTHREADS < 7
12100 #include <errno.h>
12101 #endif
12102 #ifndef NULL
12103 #define NULL (void*)0
12104 #endif
12105
12106 static void *task(p)
12107         void *p;
12108 {
12109         return (void *) (p == NULL);
12110 }
12111
12112
12113 int main(argc, argv)
12114         int argc;
12115         char **argv;
12116 {
12117
12118         /* pthread test function */
12119 #ifndef PTHREAD_CREATE_DETACHED
12120 #define PTHREAD_CREATE_DETACHED 1
12121 #endif
12122         pthread_t t;
12123         int status;
12124         int detach = PTHREAD_CREATE_DETACHED;
12125
12126 #if HAVE_PTHREADS > 4
12127         /* Final pthreads */
12128         pthread_attr_t attr;
12129
12130         status = pthread_attr_init(&attr);
12131         if( status ) return status;
12132
12133 #if HAVE_PTHREADS < 7
12134         status = pthread_attr_setdetachstate(&attr, &detach);
12135         if( status < 0 ) status = errno;
12136 #else
12137         status = pthread_attr_setdetachstate(&attr, detach);
12138 #endif
12139         if( status ) return status;
12140         status = pthread_create( &t, &attr, task, NULL );
12141 #if HAVE_PTHREADS < 7
12142         if( status < 0 ) status = errno;
12143 #endif
12144         if( status ) return status;
12145 #else
12146         /* Draft 4 pthreads */
12147         status = pthread_create( &t, pthread_attr_default, task, NULL );
12148         if( status ) return errno;
12149
12150         /* give thread a chance to complete */
12151         /* it should remain joinable and hence detachable */
12152         sleep( 1 );
12153
12154         status = pthread_detach( &t );
12155         if( status ) return errno;
12156 #endif
12157
12158 #ifdef HAVE_LINUX_THREADS
12159         pthread_kill_other_threads_np();
12160 #endif
12161
12162         return 0;
12163
12164 }
12165
12166 EOF
12167 if { (eval echo configure:12168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12168 then
12169   ol_cv_pthread_pthread=yes
12170 else
12171   echo "configure: failed program was:" >&5
12172   cat conftest.$ac_ext >&5
12173   rm -fr conftest*
12174   ol_cv_pthread_pthread=no
12175 fi
12176 rm -fr conftest*
12177 fi
12178
12179
12180                 # restore the LIBS
12181                 LIBS="$ol_LIBS"
12182         
12183 fi
12184
12185 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
12186
12187         if test $ol_cv_pthread_pthread = yes ; then
12188                 ol_link_pthreads="-pthread"
12189                 ol_link_threads=posix
12190         fi
12191 fi
12192
12193                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
12194 if test "$ol_link_threads" = no ; then
12195         # try -pthreads
12196         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
12197 echo "configure:12198: checking for pthread link with -pthreads" >&5
12198 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
12199   echo $ac_n "(cached) $ac_c" 1>&6
12200 else
12201   
12202                 # save the flags
12203                 ol_LIBS="$LIBS"
12204                 LIBS="-pthreads $LIBS"
12205
12206                 if test "$cross_compiling" = yes; then
12207   cat > conftest.$ac_ext <<EOF
12208 #line 12209 "configure"
12209 #include "confdefs.h"
12210 /* pthread test headers */
12211 #include <pthread.h>
12212 #if HAVE_PTHREADS < 7
12213 #include <errno.h>
12214 #endif
12215 #ifndef NULL
12216 #define NULL (void*)0
12217 #endif
12218
12219 static void *task(p)
12220         void *p;
12221 {
12222         return (void *) (p == NULL);
12223 }
12224
12225 int main() {
12226
12227         /* pthread test function */
12228 #ifndef PTHREAD_CREATE_DETACHED
12229 #define PTHREAD_CREATE_DETACHED 1
12230 #endif
12231         pthread_t t;
12232         int status;
12233         int detach = PTHREAD_CREATE_DETACHED;
12234
12235 #if HAVE_PTHREADS > 4
12236         /* Final pthreads */
12237         pthread_attr_t attr;
12238
12239         status = pthread_attr_init(&attr);
12240         if( status ) return status;
12241
12242 #if HAVE_PTHREADS < 7
12243         status = pthread_attr_setdetachstate(&attr, &detach);
12244         if( status < 0 ) status = errno;
12245 #else
12246         status = pthread_attr_setdetachstate(&attr, detach);
12247 #endif
12248         if( status ) return status;
12249         status = pthread_create( &t, &attr, task, NULL );
12250 #if HAVE_PTHREADS < 7
12251         if( status < 0 ) status = errno;
12252 #endif
12253         if( status ) return status;
12254 #else
12255         /* Draft 4 pthreads */
12256         status = pthread_create( &t, pthread_attr_default, task, NULL );
12257         if( status ) return errno;
12258
12259         /* give thread a chance to complete */
12260         /* it should remain joinable and hence detachable */
12261         sleep( 1 );
12262
12263         status = pthread_detach( &t );
12264         if( status ) return errno;
12265 #endif
12266
12267 #ifdef HAVE_LINUX_THREADS
12268         pthread_kill_other_threads_np();
12269 #endif
12270
12271         return 0;
12272
12273 ; return 0; }
12274 EOF
12275 if { (eval echo configure:12276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12276   rm -rf conftest*
12277   ol_cv_pthread_pthreads=yes
12278 else
12279   echo "configure: failed program was:" >&5
12280   cat conftest.$ac_ext >&5
12281   rm -rf conftest*
12282   ol_cv_pthread_pthreads=no
12283 fi
12284 rm -f conftest*
12285 else
12286   cat > conftest.$ac_ext <<EOF
12287 #line 12288 "configure"
12288 #include "confdefs.h"
12289 /* pthread test headers */
12290 #include <pthread.h>
12291 #if HAVE_PTHREADS < 7
12292 #include <errno.h>
12293 #endif
12294 #ifndef NULL
12295 #define NULL (void*)0
12296 #endif
12297
12298 static void *task(p)
12299         void *p;
12300 {
12301         return (void *) (p == NULL);
12302 }
12303
12304
12305 int main(argc, argv)
12306         int argc;
12307         char **argv;
12308 {
12309
12310         /* pthread test function */
12311 #ifndef PTHREAD_CREATE_DETACHED
12312 #define PTHREAD_CREATE_DETACHED 1
12313 #endif
12314         pthread_t t;
12315         int status;
12316         int detach = PTHREAD_CREATE_DETACHED;
12317
12318 #if HAVE_PTHREADS > 4
12319         /* Final pthreads */
12320         pthread_attr_t attr;
12321
12322         status = pthread_attr_init(&attr);
12323         if( status ) return status;
12324
12325 #if HAVE_PTHREADS < 7
12326         status = pthread_attr_setdetachstate(&attr, &detach);
12327         if( status < 0 ) status = errno;
12328 #else
12329         status = pthread_attr_setdetachstate(&attr, detach);
12330 #endif
12331         if( status ) return status;
12332         status = pthread_create( &t, &attr, task, NULL );
12333 #if HAVE_PTHREADS < 7
12334         if( status < 0 ) status = errno;
12335 #endif
12336         if( status ) return status;
12337 #else
12338         /* Draft 4 pthreads */
12339         status = pthread_create( &t, pthread_attr_default, task, NULL );
12340         if( status ) return errno;
12341
12342         /* give thread a chance to complete */
12343         /* it should remain joinable and hence detachable */
12344         sleep( 1 );
12345
12346         status = pthread_detach( &t );
12347         if( status ) return errno;
12348 #endif
12349
12350 #ifdef HAVE_LINUX_THREADS
12351         pthread_kill_other_threads_np();
12352 #endif
12353
12354         return 0;
12355
12356 }
12357
12358 EOF
12359 if { (eval echo configure:12360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12360 then
12361   ol_cv_pthread_pthreads=yes
12362 else
12363   echo "configure: failed program was:" >&5
12364   cat conftest.$ac_ext >&5
12365   rm -fr conftest*
12366   ol_cv_pthread_pthreads=no
12367 fi
12368 rm -fr conftest*
12369 fi
12370
12371
12372                 # restore the LIBS
12373                 LIBS="$ol_LIBS"
12374         
12375 fi
12376
12377 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
12378
12379         if test $ol_cv_pthread_pthreads = yes ; then
12380                 ol_link_pthreads="-pthreads"
12381                 ol_link_threads=posix
12382         fi
12383 fi
12384
12385                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
12386 if test "$ol_link_threads" = no ; then
12387         # try -mthreads
12388         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
12389 echo "configure:12390: checking for pthread link with -mthreads" >&5
12390 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
12391   echo $ac_n "(cached) $ac_c" 1>&6
12392 else
12393   
12394                 # save the flags
12395                 ol_LIBS="$LIBS"
12396                 LIBS="-mthreads $LIBS"
12397
12398                 if test "$cross_compiling" = yes; then
12399   cat > conftest.$ac_ext <<EOF
12400 #line 12401 "configure"
12401 #include "confdefs.h"
12402 /* pthread test headers */
12403 #include <pthread.h>
12404 #if HAVE_PTHREADS < 7
12405 #include <errno.h>
12406 #endif
12407 #ifndef NULL
12408 #define NULL (void*)0
12409 #endif
12410
12411 static void *task(p)
12412         void *p;
12413 {
12414         return (void *) (p == NULL);
12415 }
12416
12417 int main() {
12418
12419         /* pthread test function */
12420 #ifndef PTHREAD_CREATE_DETACHED
12421 #define PTHREAD_CREATE_DETACHED 1
12422 #endif
12423         pthread_t t;
12424         int status;
12425         int detach = PTHREAD_CREATE_DETACHED;
12426
12427 #if HAVE_PTHREADS > 4
12428         /* Final pthreads */
12429         pthread_attr_t attr;
12430
12431         status = pthread_attr_init(&attr);
12432         if( status ) return status;
12433
12434 #if HAVE_PTHREADS < 7
12435         status = pthread_attr_setdetachstate(&attr, &detach);
12436         if( status < 0 ) status = errno;
12437 #else
12438         status = pthread_attr_setdetachstate(&attr, detach);
12439 #endif
12440         if( status ) return status;
12441         status = pthread_create( &t, &attr, task, NULL );
12442 #if HAVE_PTHREADS < 7
12443         if( status < 0 ) status = errno;
12444 #endif
12445         if( status ) return status;
12446 #else
12447         /* Draft 4 pthreads */
12448         status = pthread_create( &t, pthread_attr_default, task, NULL );
12449         if( status ) return errno;
12450
12451         /* give thread a chance to complete */
12452         /* it should remain joinable and hence detachable */
12453         sleep( 1 );
12454
12455         status = pthread_detach( &t );
12456         if( status ) return errno;
12457 #endif
12458
12459 #ifdef HAVE_LINUX_THREADS
12460         pthread_kill_other_threads_np();
12461 #endif
12462
12463         return 0;
12464
12465 ; return 0; }
12466 EOF
12467 if { (eval echo configure:12468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12468   rm -rf conftest*
12469   ol_cv_pthread_mthreads=yes
12470 else
12471   echo "configure: failed program was:" >&5
12472   cat conftest.$ac_ext >&5
12473   rm -rf conftest*
12474   ol_cv_pthread_mthreads=no
12475 fi
12476 rm -f conftest*
12477 else
12478   cat > conftest.$ac_ext <<EOF
12479 #line 12480 "configure"
12480 #include "confdefs.h"
12481 /* pthread test headers */
12482 #include <pthread.h>
12483 #if HAVE_PTHREADS < 7
12484 #include <errno.h>
12485 #endif
12486 #ifndef NULL
12487 #define NULL (void*)0
12488 #endif
12489
12490 static void *task(p)
12491         void *p;
12492 {
12493         return (void *) (p == NULL);
12494 }
12495
12496
12497 int main(argc, argv)
12498         int argc;
12499         char **argv;
12500 {
12501
12502         /* pthread test function */
12503 #ifndef PTHREAD_CREATE_DETACHED
12504 #define PTHREAD_CREATE_DETACHED 1
12505 #endif
12506         pthread_t t;
12507         int status;
12508         int detach = PTHREAD_CREATE_DETACHED;
12509
12510 #if HAVE_PTHREADS > 4
12511         /* Final pthreads */
12512         pthread_attr_t attr;
12513
12514         status = pthread_attr_init(&attr);
12515         if( status ) return status;
12516
12517 #if HAVE_PTHREADS < 7
12518         status = pthread_attr_setdetachstate(&attr, &detach);
12519         if( status < 0 ) status = errno;
12520 #else
12521         status = pthread_attr_setdetachstate(&attr, detach);
12522 #endif
12523         if( status ) return status;
12524         status = pthread_create( &t, &attr, task, NULL );
12525 #if HAVE_PTHREADS < 7
12526         if( status < 0 ) status = errno;
12527 #endif
12528         if( status ) return status;
12529 #else
12530         /* Draft 4 pthreads */
12531         status = pthread_create( &t, pthread_attr_default, task, NULL );
12532         if( status ) return errno;
12533
12534         /* give thread a chance to complete */
12535         /* it should remain joinable and hence detachable */
12536         sleep( 1 );
12537
12538         status = pthread_detach( &t );
12539         if( status ) return errno;
12540 #endif
12541
12542 #ifdef HAVE_LINUX_THREADS
12543         pthread_kill_other_threads_np();
12544 #endif
12545
12546         return 0;
12547
12548 }
12549
12550 EOF
12551 if { (eval echo configure:12552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12552 then
12553   ol_cv_pthread_mthreads=yes
12554 else
12555   echo "configure: failed program was:" >&5
12556   cat conftest.$ac_ext >&5
12557   rm -fr conftest*
12558   ol_cv_pthread_mthreads=no
12559 fi
12560 rm -fr conftest*
12561 fi
12562
12563
12564                 # restore the LIBS
12565                 LIBS="$ol_LIBS"
12566         
12567 fi
12568
12569 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
12570
12571         if test $ol_cv_pthread_mthreads = yes ; then
12572                 ol_link_pthreads="-mthreads"
12573                 ol_link_threads=posix
12574         fi
12575 fi
12576
12577                 # Pthread try link: -thread (ol_cv_pthread_thread)
12578 if test "$ol_link_threads" = no ; then
12579         # try -thread
12580         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
12581 echo "configure:12582: checking for pthread link with -thread" >&5
12582 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
12583   echo $ac_n "(cached) $ac_c" 1>&6
12584 else
12585   
12586                 # save the flags
12587                 ol_LIBS="$LIBS"
12588                 LIBS="-thread $LIBS"
12589
12590                 if test "$cross_compiling" = yes; then
12591   cat > conftest.$ac_ext <<EOF
12592 #line 12593 "configure"
12593 #include "confdefs.h"
12594 /* pthread test headers */
12595 #include <pthread.h>
12596 #if HAVE_PTHREADS < 7
12597 #include <errno.h>
12598 #endif
12599 #ifndef NULL
12600 #define NULL (void*)0
12601 #endif
12602
12603 static void *task(p)
12604         void *p;
12605 {
12606         return (void *) (p == NULL);
12607 }
12608
12609 int main() {
12610
12611         /* pthread test function */
12612 #ifndef PTHREAD_CREATE_DETACHED
12613 #define PTHREAD_CREATE_DETACHED 1
12614 #endif
12615         pthread_t t;
12616         int status;
12617         int detach = PTHREAD_CREATE_DETACHED;
12618
12619 #if HAVE_PTHREADS > 4
12620         /* Final pthreads */
12621         pthread_attr_t attr;
12622
12623         status = pthread_attr_init(&attr);
12624         if( status ) return status;
12625
12626 #if HAVE_PTHREADS < 7
12627         status = pthread_attr_setdetachstate(&attr, &detach);
12628         if( status < 0 ) status = errno;
12629 #else
12630         status = pthread_attr_setdetachstate(&attr, detach);
12631 #endif
12632         if( status ) return status;
12633         status = pthread_create( &t, &attr, task, NULL );
12634 #if HAVE_PTHREADS < 7
12635         if( status < 0 ) status = errno;
12636 #endif
12637         if( status ) return status;
12638 #else
12639         /* Draft 4 pthreads */
12640         status = pthread_create( &t, pthread_attr_default, task, NULL );
12641         if( status ) return errno;
12642
12643         /* give thread a chance to complete */
12644         /* it should remain joinable and hence detachable */
12645         sleep( 1 );
12646
12647         status = pthread_detach( &t );
12648         if( status ) return errno;
12649 #endif
12650
12651 #ifdef HAVE_LINUX_THREADS
12652         pthread_kill_other_threads_np();
12653 #endif
12654
12655         return 0;
12656
12657 ; return 0; }
12658 EOF
12659 if { (eval echo configure:12660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12660   rm -rf conftest*
12661   ol_cv_pthread_thread=yes
12662 else
12663   echo "configure: failed program was:" >&5
12664   cat conftest.$ac_ext >&5
12665   rm -rf conftest*
12666   ol_cv_pthread_thread=no
12667 fi
12668 rm -f conftest*
12669 else
12670   cat > conftest.$ac_ext <<EOF
12671 #line 12672 "configure"
12672 #include "confdefs.h"
12673 /* pthread test headers */
12674 #include <pthread.h>
12675 #if HAVE_PTHREADS < 7
12676 #include <errno.h>
12677 #endif
12678 #ifndef NULL
12679 #define NULL (void*)0
12680 #endif
12681
12682 static void *task(p)
12683         void *p;
12684 {
12685         return (void *) (p == NULL);
12686 }
12687
12688
12689 int main(argc, argv)
12690         int argc;
12691         char **argv;
12692 {
12693
12694         /* pthread test function */
12695 #ifndef PTHREAD_CREATE_DETACHED
12696 #define PTHREAD_CREATE_DETACHED 1
12697 #endif
12698         pthread_t t;
12699         int status;
12700         int detach = PTHREAD_CREATE_DETACHED;
12701
12702 #if HAVE_PTHREADS > 4
12703         /* Final pthreads */
12704         pthread_attr_t attr;
12705
12706         status = pthread_attr_init(&attr);
12707         if( status ) return status;
12708
12709 #if HAVE_PTHREADS < 7
12710         status = pthread_attr_setdetachstate(&attr, &detach);
12711         if( status < 0 ) status = errno;
12712 #else
12713         status = pthread_attr_setdetachstate(&attr, detach);
12714 #endif
12715         if( status ) return status;
12716         status = pthread_create( &t, &attr, task, NULL );
12717 #if HAVE_PTHREADS < 7
12718         if( status < 0 ) status = errno;
12719 #endif
12720         if( status ) return status;
12721 #else
12722         /* Draft 4 pthreads */
12723         status = pthread_create( &t, pthread_attr_default, task, NULL );
12724         if( status ) return errno;
12725
12726         /* give thread a chance to complete */
12727         /* it should remain joinable and hence detachable */
12728         sleep( 1 );
12729
12730         status = pthread_detach( &t );
12731         if( status ) return errno;
12732 #endif
12733
12734 #ifdef HAVE_LINUX_THREADS
12735         pthread_kill_other_threads_np();
12736 #endif
12737
12738         return 0;
12739
12740 }
12741
12742 EOF
12743 if { (eval echo configure:12744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12744 then
12745   ol_cv_pthread_thread=yes
12746 else
12747   echo "configure: failed program was:" >&5
12748   cat conftest.$ac_ext >&5
12749   rm -fr conftest*
12750   ol_cv_pthread_thread=no
12751 fi
12752 rm -fr conftest*
12753 fi
12754
12755
12756                 # restore the LIBS
12757                 LIBS="$ol_LIBS"
12758         
12759 fi
12760
12761 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
12762
12763         if test $ol_cv_pthread_thread = yes ; then
12764                 ol_link_pthreads="-thread"
12765                 ol_link_threads=posix
12766         fi
12767 fi
12768
12769
12770                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
12771 if test "$ol_link_threads" = no ; then
12772         # try -lpthread -lmach -lexc -lc_r
12773         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
12774 echo "configure:12775: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
12775 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
12776   echo $ac_n "(cached) $ac_c" 1>&6
12777 else
12778   
12779                 # save the flags
12780                 ol_LIBS="$LIBS"
12781                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
12782
12783                 if test "$cross_compiling" = yes; then
12784   cat > conftest.$ac_ext <<EOF
12785 #line 12786 "configure"
12786 #include "confdefs.h"
12787 /* pthread test headers */
12788 #include <pthread.h>
12789 #if HAVE_PTHREADS < 7
12790 #include <errno.h>
12791 #endif
12792 #ifndef NULL
12793 #define NULL (void*)0
12794 #endif
12795
12796 static void *task(p)
12797         void *p;
12798 {
12799         return (void *) (p == NULL);
12800 }
12801
12802 int main() {
12803
12804         /* pthread test function */
12805 #ifndef PTHREAD_CREATE_DETACHED
12806 #define PTHREAD_CREATE_DETACHED 1
12807 #endif
12808         pthread_t t;
12809         int status;
12810         int detach = PTHREAD_CREATE_DETACHED;
12811
12812 #if HAVE_PTHREADS > 4
12813         /* Final pthreads */
12814         pthread_attr_t attr;
12815
12816         status = pthread_attr_init(&attr);
12817         if( status ) return status;
12818
12819 #if HAVE_PTHREADS < 7
12820         status = pthread_attr_setdetachstate(&attr, &detach);
12821         if( status < 0 ) status = errno;
12822 #else
12823         status = pthread_attr_setdetachstate(&attr, detach);
12824 #endif
12825         if( status ) return status;
12826         status = pthread_create( &t, &attr, task, NULL );
12827 #if HAVE_PTHREADS < 7
12828         if( status < 0 ) status = errno;
12829 #endif
12830         if( status ) return status;
12831 #else
12832         /* Draft 4 pthreads */
12833         status = pthread_create( &t, pthread_attr_default, task, NULL );
12834         if( status ) return errno;
12835
12836         /* give thread a chance to complete */
12837         /* it should remain joinable and hence detachable */
12838         sleep( 1 );
12839
12840         status = pthread_detach( &t );
12841         if( status ) return errno;
12842 #endif
12843
12844 #ifdef HAVE_LINUX_THREADS
12845         pthread_kill_other_threads_np();
12846 #endif
12847
12848         return 0;
12849
12850 ; return 0; }
12851 EOF
12852 if { (eval echo configure:12853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12853   rm -rf conftest*
12854   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
12855 else
12856   echo "configure: failed program was:" >&5
12857   cat conftest.$ac_ext >&5
12858   rm -rf conftest*
12859   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
12860 fi
12861 rm -f conftest*
12862 else
12863   cat > conftest.$ac_ext <<EOF
12864 #line 12865 "configure"
12865 #include "confdefs.h"
12866 /* pthread test headers */
12867 #include <pthread.h>
12868 #if HAVE_PTHREADS < 7
12869 #include <errno.h>
12870 #endif
12871 #ifndef NULL
12872 #define NULL (void*)0
12873 #endif
12874
12875 static void *task(p)
12876         void *p;
12877 {
12878         return (void *) (p == NULL);
12879 }
12880
12881
12882 int main(argc, argv)
12883         int argc;
12884         char **argv;
12885 {
12886
12887         /* pthread test function */
12888 #ifndef PTHREAD_CREATE_DETACHED
12889 #define PTHREAD_CREATE_DETACHED 1
12890 #endif
12891         pthread_t t;
12892         int status;
12893         int detach = PTHREAD_CREATE_DETACHED;
12894
12895 #if HAVE_PTHREADS > 4
12896         /* Final pthreads */
12897         pthread_attr_t attr;
12898
12899         status = pthread_attr_init(&attr);
12900         if( status ) return status;
12901
12902 #if HAVE_PTHREADS < 7
12903         status = pthread_attr_setdetachstate(&attr, &detach);
12904         if( status < 0 ) status = errno;
12905 #else
12906         status = pthread_attr_setdetachstate(&attr, detach);
12907 #endif
12908         if( status ) return status;
12909         status = pthread_create( &t, &attr, task, NULL );
12910 #if HAVE_PTHREADS < 7
12911         if( status < 0 ) status = errno;
12912 #endif
12913         if( status ) return status;
12914 #else
12915         /* Draft 4 pthreads */
12916         status = pthread_create( &t, pthread_attr_default, task, NULL );
12917         if( status ) return errno;
12918
12919         /* give thread a chance to complete */
12920         /* it should remain joinable and hence detachable */
12921         sleep( 1 );
12922
12923         status = pthread_detach( &t );
12924         if( status ) return errno;
12925 #endif
12926
12927 #ifdef HAVE_LINUX_THREADS
12928         pthread_kill_other_threads_np();
12929 #endif
12930
12931         return 0;
12932
12933 }
12934
12935 EOF
12936 if { (eval echo configure:12937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12937 then
12938   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
12939 else
12940   echo "configure: failed program was:" >&5
12941   cat conftest.$ac_ext >&5
12942   rm -fr conftest*
12943   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
12944 fi
12945 rm -fr conftest*
12946 fi
12947
12948
12949                 # restore the LIBS
12950                 LIBS="$ol_LIBS"
12951         
12952 fi
12953
12954 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
12955
12956         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
12957                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
12958                 ol_link_threads=posix
12959         fi
12960 fi
12961
12962                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
12963 if test "$ol_link_threads" = no ; then
12964         # try -lpthread -lmach -lexc
12965         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
12966 echo "configure:12967: checking for pthread link with -lpthread -lmach -lexc" >&5
12967 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
12968   echo $ac_n "(cached) $ac_c" 1>&6
12969 else
12970   
12971                 # save the flags
12972                 ol_LIBS="$LIBS"
12973                 LIBS="-lpthread -lmach -lexc $LIBS"
12974
12975                 if test "$cross_compiling" = yes; then
12976   cat > conftest.$ac_ext <<EOF
12977 #line 12978 "configure"
12978 #include "confdefs.h"
12979 /* pthread test headers */
12980 #include <pthread.h>
12981 #if HAVE_PTHREADS < 7
12982 #include <errno.h>
12983 #endif
12984 #ifndef NULL
12985 #define NULL (void*)0
12986 #endif
12987
12988 static void *task(p)
12989         void *p;
12990 {
12991         return (void *) (p == NULL);
12992 }
12993
12994 int main() {
12995
12996         /* pthread test function */
12997 #ifndef PTHREAD_CREATE_DETACHED
12998 #define PTHREAD_CREATE_DETACHED 1
12999 #endif
13000         pthread_t t;
13001         int status;
13002         int detach = PTHREAD_CREATE_DETACHED;
13003
13004 #if HAVE_PTHREADS > 4
13005         /* Final pthreads */
13006         pthread_attr_t attr;
13007
13008         status = pthread_attr_init(&attr);
13009         if( status ) return status;
13010
13011 #if HAVE_PTHREADS < 7
13012         status = pthread_attr_setdetachstate(&attr, &detach);
13013         if( status < 0 ) status = errno;
13014 #else
13015         status = pthread_attr_setdetachstate(&attr, detach);
13016 #endif
13017         if( status ) return status;
13018         status = pthread_create( &t, &attr, task, NULL );
13019 #if HAVE_PTHREADS < 7
13020         if( status < 0 ) status = errno;
13021 #endif
13022         if( status ) return status;
13023 #else
13024         /* Draft 4 pthreads */
13025         status = pthread_create( &t, pthread_attr_default, task, NULL );
13026         if( status ) return errno;
13027
13028         /* give thread a chance to complete */
13029         /* it should remain joinable and hence detachable */
13030         sleep( 1 );
13031
13032         status = pthread_detach( &t );
13033         if( status ) return errno;
13034 #endif
13035
13036 #ifdef HAVE_LINUX_THREADS
13037         pthread_kill_other_threads_np();
13038 #endif
13039
13040         return 0;
13041
13042 ; return 0; }
13043 EOF
13044 if { (eval echo configure:13045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13045   rm -rf conftest*
13046   ol_cv_pthread_lpthread_lmach_lexc=yes
13047 else
13048   echo "configure: failed program was:" >&5
13049   cat conftest.$ac_ext >&5
13050   rm -rf conftest*
13051   ol_cv_pthread_lpthread_lmach_lexc=no
13052 fi
13053 rm -f conftest*
13054 else
13055   cat > conftest.$ac_ext <<EOF
13056 #line 13057 "configure"
13057 #include "confdefs.h"
13058 /* pthread test headers */
13059 #include <pthread.h>
13060 #if HAVE_PTHREADS < 7
13061 #include <errno.h>
13062 #endif
13063 #ifndef NULL
13064 #define NULL (void*)0
13065 #endif
13066
13067 static void *task(p)
13068         void *p;
13069 {
13070         return (void *) (p == NULL);
13071 }
13072
13073
13074 int main(argc, argv)
13075         int argc;
13076         char **argv;
13077 {
13078
13079         /* pthread test function */
13080 #ifndef PTHREAD_CREATE_DETACHED
13081 #define PTHREAD_CREATE_DETACHED 1
13082 #endif
13083         pthread_t t;
13084         int status;
13085         int detach = PTHREAD_CREATE_DETACHED;
13086
13087 #if HAVE_PTHREADS > 4
13088         /* Final pthreads */
13089         pthread_attr_t attr;
13090
13091         status = pthread_attr_init(&attr);
13092         if( status ) return status;
13093
13094 #if HAVE_PTHREADS < 7
13095         status = pthread_attr_setdetachstate(&attr, &detach);
13096         if( status < 0 ) status = errno;
13097 #else
13098         status = pthread_attr_setdetachstate(&attr, detach);
13099 #endif
13100         if( status ) return status;
13101         status = pthread_create( &t, &attr, task, NULL );
13102 #if HAVE_PTHREADS < 7
13103         if( status < 0 ) status = errno;
13104 #endif
13105         if( status ) return status;
13106 #else
13107         /* Draft 4 pthreads */
13108         status = pthread_create( &t, pthread_attr_default, task, NULL );
13109         if( status ) return errno;
13110
13111         /* give thread a chance to complete */
13112         /* it should remain joinable and hence detachable */
13113         sleep( 1 );
13114
13115         status = pthread_detach( &t );
13116         if( status ) return errno;
13117 #endif
13118
13119 #ifdef HAVE_LINUX_THREADS
13120         pthread_kill_other_threads_np();
13121 #endif
13122
13123         return 0;
13124
13125 }
13126
13127 EOF
13128 if { (eval echo configure:13129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13129 then
13130   ol_cv_pthread_lpthread_lmach_lexc=yes
13131 else
13132   echo "configure: failed program was:" >&5
13133   cat conftest.$ac_ext >&5
13134   rm -fr conftest*
13135   ol_cv_pthread_lpthread_lmach_lexc=no
13136 fi
13137 rm -fr conftest*
13138 fi
13139
13140
13141                 # restore the LIBS
13142                 LIBS="$ol_LIBS"
13143         
13144 fi
13145
13146 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
13147
13148         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
13149                 ol_link_pthreads="-lpthread -lmach -lexc"
13150                 ol_link_threads=posix
13151         fi
13152 fi
13153
13154
13155                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
13156 if test "$ol_link_threads" = no ; then
13157         # try -lpthread -Wl,-woff,85
13158         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
13159 echo "configure:13160: checking for pthread link with -lpthread -Wl,-woff,85" >&5
13160 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
13161   echo $ac_n "(cached) $ac_c" 1>&6
13162 else
13163   
13164                 # save the flags
13165                 ol_LIBS="$LIBS"
13166                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
13167
13168                 if test "$cross_compiling" = yes; then
13169   cat > conftest.$ac_ext <<EOF
13170 #line 13171 "configure"
13171 #include "confdefs.h"
13172 /* pthread test headers */
13173 #include <pthread.h>
13174 #if HAVE_PTHREADS < 7
13175 #include <errno.h>
13176 #endif
13177 #ifndef NULL
13178 #define NULL (void*)0
13179 #endif
13180
13181 static void *task(p)
13182         void *p;
13183 {
13184         return (void *) (p == NULL);
13185 }
13186
13187 int main() {
13188
13189         /* pthread test function */
13190 #ifndef PTHREAD_CREATE_DETACHED
13191 #define PTHREAD_CREATE_DETACHED 1
13192 #endif
13193         pthread_t t;
13194         int status;
13195         int detach = PTHREAD_CREATE_DETACHED;
13196
13197 #if HAVE_PTHREADS > 4
13198         /* Final pthreads */
13199         pthread_attr_t attr;
13200
13201         status = pthread_attr_init(&attr);
13202         if( status ) return status;
13203
13204 #if HAVE_PTHREADS < 7
13205         status = pthread_attr_setdetachstate(&attr, &detach);
13206         if( status < 0 ) status = errno;
13207 #else
13208         status = pthread_attr_setdetachstate(&attr, detach);
13209 #endif
13210         if( status ) return status;
13211         status = pthread_create( &t, &attr, task, NULL );
13212 #if HAVE_PTHREADS < 7
13213         if( status < 0 ) status = errno;
13214 #endif
13215         if( status ) return status;
13216 #else
13217         /* Draft 4 pthreads */
13218         status = pthread_create( &t, pthread_attr_default, task, NULL );
13219         if( status ) return errno;
13220
13221         /* give thread a chance to complete */
13222         /* it should remain joinable and hence detachable */
13223         sleep( 1 );
13224
13225         status = pthread_detach( &t );
13226         if( status ) return errno;
13227 #endif
13228
13229 #ifdef HAVE_LINUX_THREADS
13230         pthread_kill_other_threads_np();
13231 #endif
13232
13233         return 0;
13234
13235 ; return 0; }
13236 EOF
13237 if { (eval echo configure:13238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13238   rm -rf conftest*
13239   ol_cv_pthread_lib_lpthread_woff=yes
13240 else
13241   echo "configure: failed program was:" >&5
13242   cat conftest.$ac_ext >&5
13243   rm -rf conftest*
13244   ol_cv_pthread_lib_lpthread_woff=no
13245 fi
13246 rm -f conftest*
13247 else
13248   cat > conftest.$ac_ext <<EOF
13249 #line 13250 "configure"
13250 #include "confdefs.h"
13251 /* pthread test headers */
13252 #include <pthread.h>
13253 #if HAVE_PTHREADS < 7
13254 #include <errno.h>
13255 #endif
13256 #ifndef NULL
13257 #define NULL (void*)0
13258 #endif
13259
13260 static void *task(p)
13261         void *p;
13262 {
13263         return (void *) (p == NULL);
13264 }
13265
13266
13267 int main(argc, argv)
13268         int argc;
13269         char **argv;
13270 {
13271
13272         /* pthread test function */
13273 #ifndef PTHREAD_CREATE_DETACHED
13274 #define PTHREAD_CREATE_DETACHED 1
13275 #endif
13276         pthread_t t;
13277         int status;
13278         int detach = PTHREAD_CREATE_DETACHED;
13279
13280 #if HAVE_PTHREADS > 4
13281         /* Final pthreads */
13282         pthread_attr_t attr;
13283
13284         status = pthread_attr_init(&attr);
13285         if( status ) return status;
13286
13287 #if HAVE_PTHREADS < 7
13288         status = pthread_attr_setdetachstate(&attr, &detach);
13289         if( status < 0 ) status = errno;
13290 #else
13291         status = pthread_attr_setdetachstate(&attr, detach);
13292 #endif
13293         if( status ) return status;
13294         status = pthread_create( &t, &attr, task, NULL );
13295 #if HAVE_PTHREADS < 7
13296         if( status < 0 ) status = errno;
13297 #endif
13298         if( status ) return status;
13299 #else
13300         /* Draft 4 pthreads */
13301         status = pthread_create( &t, pthread_attr_default, task, NULL );
13302         if( status ) return errno;
13303
13304         /* give thread a chance to complete */
13305         /* it should remain joinable and hence detachable */
13306         sleep( 1 );
13307
13308         status = pthread_detach( &t );
13309         if( status ) return errno;
13310 #endif
13311
13312 #ifdef HAVE_LINUX_THREADS
13313         pthread_kill_other_threads_np();
13314 #endif
13315
13316         return 0;
13317
13318 }
13319
13320 EOF
13321 if { (eval echo configure:13322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13322 then
13323   ol_cv_pthread_lib_lpthread_woff=yes
13324 else
13325   echo "configure: failed program was:" >&5
13326   cat conftest.$ac_ext >&5
13327   rm -fr conftest*
13328   ol_cv_pthread_lib_lpthread_woff=no
13329 fi
13330 rm -fr conftest*
13331 fi
13332
13333
13334                 # restore the LIBS
13335                 LIBS="$ol_LIBS"
13336         
13337 fi
13338
13339 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
13340
13341         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
13342                 ol_link_pthreads="-lpthread -Wl,-woff,85"
13343                 ol_link_threads=posix
13344         fi
13345 fi
13346
13347
13348                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
13349 if test "$ol_link_threads" = no ; then
13350         # try -lpthread
13351         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
13352 echo "configure:13353: checking for pthread link with -lpthread" >&5
13353 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
13354   echo $ac_n "(cached) $ac_c" 1>&6
13355 else
13356   
13357                 # save the flags
13358                 ol_LIBS="$LIBS"
13359                 LIBS="-lpthread $LIBS"
13360
13361                 if test "$cross_compiling" = yes; then
13362   cat > conftest.$ac_ext <<EOF
13363 #line 13364 "configure"
13364 #include "confdefs.h"
13365 /* pthread test headers */
13366 #include <pthread.h>
13367 #if HAVE_PTHREADS < 7
13368 #include <errno.h>
13369 #endif
13370 #ifndef NULL
13371 #define NULL (void*)0
13372 #endif
13373
13374 static void *task(p)
13375         void *p;
13376 {
13377         return (void *) (p == NULL);
13378 }
13379
13380 int main() {
13381
13382         /* pthread test function */
13383 #ifndef PTHREAD_CREATE_DETACHED
13384 #define PTHREAD_CREATE_DETACHED 1
13385 #endif
13386         pthread_t t;
13387         int status;
13388         int detach = PTHREAD_CREATE_DETACHED;
13389
13390 #if HAVE_PTHREADS > 4
13391         /* Final pthreads */
13392         pthread_attr_t attr;
13393
13394         status = pthread_attr_init(&attr);
13395         if( status ) return status;
13396
13397 #if HAVE_PTHREADS < 7
13398         status = pthread_attr_setdetachstate(&attr, &detach);
13399         if( status < 0 ) status = errno;
13400 #else
13401         status = pthread_attr_setdetachstate(&attr, detach);
13402 #endif
13403         if( status ) return status;
13404         status = pthread_create( &t, &attr, task, NULL );
13405 #if HAVE_PTHREADS < 7
13406         if( status < 0 ) status = errno;
13407 #endif
13408         if( status ) return status;
13409 #else
13410         /* Draft 4 pthreads */
13411         status = pthread_create( &t, pthread_attr_default, task, NULL );
13412         if( status ) return errno;
13413
13414         /* give thread a chance to complete */
13415         /* it should remain joinable and hence detachable */
13416         sleep( 1 );
13417
13418         status = pthread_detach( &t );
13419         if( status ) return errno;
13420 #endif
13421
13422 #ifdef HAVE_LINUX_THREADS
13423         pthread_kill_other_threads_np();
13424 #endif
13425
13426         return 0;
13427
13428 ; return 0; }
13429 EOF
13430 if { (eval echo configure:13431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13431   rm -rf conftest*
13432   ol_cv_pthread_lpthread=yes
13433 else
13434   echo "configure: failed program was:" >&5
13435   cat conftest.$ac_ext >&5
13436   rm -rf conftest*
13437   ol_cv_pthread_lpthread=no
13438 fi
13439 rm -f conftest*
13440 else
13441   cat > conftest.$ac_ext <<EOF
13442 #line 13443 "configure"
13443 #include "confdefs.h"
13444 /* pthread test headers */
13445 #include <pthread.h>
13446 #if HAVE_PTHREADS < 7
13447 #include <errno.h>
13448 #endif
13449 #ifndef NULL
13450 #define NULL (void*)0
13451 #endif
13452
13453 static void *task(p)
13454         void *p;
13455 {
13456         return (void *) (p == NULL);
13457 }
13458
13459
13460 int main(argc, argv)
13461         int argc;
13462         char **argv;
13463 {
13464
13465         /* pthread test function */
13466 #ifndef PTHREAD_CREATE_DETACHED
13467 #define PTHREAD_CREATE_DETACHED 1
13468 #endif
13469         pthread_t t;
13470         int status;
13471         int detach = PTHREAD_CREATE_DETACHED;
13472
13473 #if HAVE_PTHREADS > 4
13474         /* Final pthreads */
13475         pthread_attr_t attr;
13476
13477         status = pthread_attr_init(&attr);
13478         if( status ) return status;
13479
13480 #if HAVE_PTHREADS < 7
13481         status = pthread_attr_setdetachstate(&attr, &detach);
13482         if( status < 0 ) status = errno;
13483 #else
13484         status = pthread_attr_setdetachstate(&attr, detach);
13485 #endif
13486         if( status ) return status;
13487         status = pthread_create( &t, &attr, task, NULL );
13488 #if HAVE_PTHREADS < 7
13489         if( status < 0 ) status = errno;
13490 #endif
13491         if( status ) return status;
13492 #else
13493         /* Draft 4 pthreads */
13494         status = pthread_create( &t, pthread_attr_default, task, NULL );
13495         if( status ) return errno;
13496
13497         /* give thread a chance to complete */
13498         /* it should remain joinable and hence detachable */
13499         sleep( 1 );
13500
13501         status = pthread_detach( &t );
13502         if( status ) return errno;
13503 #endif
13504
13505 #ifdef HAVE_LINUX_THREADS
13506         pthread_kill_other_threads_np();
13507 #endif
13508
13509         return 0;
13510
13511 }
13512
13513 EOF
13514 if { (eval echo configure:13515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13515 then
13516   ol_cv_pthread_lpthread=yes
13517 else
13518   echo "configure: failed program was:" >&5
13519   cat conftest.$ac_ext >&5
13520   rm -fr conftest*
13521   ol_cv_pthread_lpthread=no
13522 fi
13523 rm -fr conftest*
13524 fi
13525
13526
13527                 # restore the LIBS
13528                 LIBS="$ol_LIBS"
13529         
13530 fi
13531
13532 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
13533
13534         if test $ol_cv_pthread_lpthread = yes ; then
13535                 ol_link_pthreads="-lpthread"
13536                 ol_link_threads=posix
13537         fi
13538 fi
13539
13540                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
13541 if test "$ol_link_threads" = no ; then
13542         # try -lc_r
13543         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
13544 echo "configure:13545: checking for pthread link with -lc_r" >&5
13545 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
13546   echo $ac_n "(cached) $ac_c" 1>&6
13547 else
13548   
13549                 # save the flags
13550                 ol_LIBS="$LIBS"
13551                 LIBS="-lc_r $LIBS"
13552
13553                 if test "$cross_compiling" = yes; then
13554   cat > conftest.$ac_ext <<EOF
13555 #line 13556 "configure"
13556 #include "confdefs.h"
13557 /* pthread test headers */
13558 #include <pthread.h>
13559 #if HAVE_PTHREADS < 7
13560 #include <errno.h>
13561 #endif
13562 #ifndef NULL
13563 #define NULL (void*)0
13564 #endif
13565
13566 static void *task(p)
13567         void *p;
13568 {
13569         return (void *) (p == NULL);
13570 }
13571
13572 int main() {
13573
13574         /* pthread test function */
13575 #ifndef PTHREAD_CREATE_DETACHED
13576 #define PTHREAD_CREATE_DETACHED 1
13577 #endif
13578         pthread_t t;
13579         int status;
13580         int detach = PTHREAD_CREATE_DETACHED;
13581
13582 #if HAVE_PTHREADS > 4
13583         /* Final pthreads */
13584         pthread_attr_t attr;
13585
13586         status = pthread_attr_init(&attr);
13587         if( status ) return status;
13588
13589 #if HAVE_PTHREADS < 7
13590         status = pthread_attr_setdetachstate(&attr, &detach);
13591         if( status < 0 ) status = errno;
13592 #else
13593         status = pthread_attr_setdetachstate(&attr, detach);
13594 #endif
13595         if( status ) return status;
13596         status = pthread_create( &t, &attr, task, NULL );
13597 #if HAVE_PTHREADS < 7
13598         if( status < 0 ) status = errno;
13599 #endif
13600         if( status ) return status;
13601 #else
13602         /* Draft 4 pthreads */
13603         status = pthread_create( &t, pthread_attr_default, task, NULL );
13604         if( status ) return errno;
13605
13606         /* give thread a chance to complete */
13607         /* it should remain joinable and hence detachable */
13608         sleep( 1 );
13609
13610         status = pthread_detach( &t );
13611         if( status ) return errno;
13612 #endif
13613
13614 #ifdef HAVE_LINUX_THREADS
13615         pthread_kill_other_threads_np();
13616 #endif
13617
13618         return 0;
13619
13620 ; return 0; }
13621 EOF
13622 if { (eval echo configure:13623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13623   rm -rf conftest*
13624   ol_cv_pthread_lc_r=yes
13625 else
13626   echo "configure: failed program was:" >&5
13627   cat conftest.$ac_ext >&5
13628   rm -rf conftest*
13629   ol_cv_pthread_lc_r=no
13630 fi
13631 rm -f conftest*
13632 else
13633   cat > conftest.$ac_ext <<EOF
13634 #line 13635 "configure"
13635 #include "confdefs.h"
13636 /* pthread test headers */
13637 #include <pthread.h>
13638 #if HAVE_PTHREADS < 7
13639 #include <errno.h>
13640 #endif
13641 #ifndef NULL
13642 #define NULL (void*)0
13643 #endif
13644
13645 static void *task(p)
13646         void *p;
13647 {
13648         return (void *) (p == NULL);
13649 }
13650
13651
13652 int main(argc, argv)
13653         int argc;
13654         char **argv;
13655 {
13656
13657         /* pthread test function */
13658 #ifndef PTHREAD_CREATE_DETACHED
13659 #define PTHREAD_CREATE_DETACHED 1
13660 #endif
13661         pthread_t t;
13662         int status;
13663         int detach = PTHREAD_CREATE_DETACHED;
13664
13665 #if HAVE_PTHREADS > 4
13666         /* Final pthreads */
13667         pthread_attr_t attr;
13668
13669         status = pthread_attr_init(&attr);
13670         if( status ) return status;
13671
13672 #if HAVE_PTHREADS < 7
13673         status = pthread_attr_setdetachstate(&attr, &detach);
13674         if( status < 0 ) status = errno;
13675 #else
13676         status = pthread_attr_setdetachstate(&attr, detach);
13677 #endif
13678         if( status ) return status;
13679         status = pthread_create( &t, &attr, task, NULL );
13680 #if HAVE_PTHREADS < 7
13681         if( status < 0 ) status = errno;
13682 #endif
13683         if( status ) return status;
13684 #else
13685         /* Draft 4 pthreads */
13686         status = pthread_create( &t, pthread_attr_default, task, NULL );
13687         if( status ) return errno;
13688
13689         /* give thread a chance to complete */
13690         /* it should remain joinable and hence detachable */
13691         sleep( 1 );
13692
13693         status = pthread_detach( &t );
13694         if( status ) return errno;
13695 #endif
13696
13697 #ifdef HAVE_LINUX_THREADS
13698         pthread_kill_other_threads_np();
13699 #endif
13700
13701         return 0;
13702
13703 }
13704
13705 EOF
13706 if { (eval echo configure:13707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13707 then
13708   ol_cv_pthread_lc_r=yes
13709 else
13710   echo "configure: failed program was:" >&5
13711   cat conftest.$ac_ext >&5
13712   rm -fr conftest*
13713   ol_cv_pthread_lc_r=no
13714 fi
13715 rm -fr conftest*
13716 fi
13717
13718
13719                 # restore the LIBS
13720                 LIBS="$ol_LIBS"
13721         
13722 fi
13723
13724 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
13725
13726         if test $ol_cv_pthread_lc_r = yes ; then
13727                 ol_link_pthreads="-lc_r"
13728                 ol_link_threads=posix
13729         fi
13730 fi
13731
13732
13733                 # Pthread try link: -threads (ol_cv_pthread_threads)
13734 if test "$ol_link_threads" = no ; then
13735         # try -threads
13736         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
13737 echo "configure:13738: checking for pthread link with -threads" >&5
13738 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
13739   echo $ac_n "(cached) $ac_c" 1>&6
13740 else
13741   
13742                 # save the flags
13743                 ol_LIBS="$LIBS"
13744                 LIBS="-threads $LIBS"
13745
13746                 if test "$cross_compiling" = yes; then
13747   cat > conftest.$ac_ext <<EOF
13748 #line 13749 "configure"
13749 #include "confdefs.h"
13750 /* pthread test headers */
13751 #include <pthread.h>
13752 #if HAVE_PTHREADS < 7
13753 #include <errno.h>
13754 #endif
13755 #ifndef NULL
13756 #define NULL (void*)0
13757 #endif
13758
13759 static void *task(p)
13760         void *p;
13761 {
13762         return (void *) (p == NULL);
13763 }
13764
13765 int main() {
13766
13767         /* pthread test function */
13768 #ifndef PTHREAD_CREATE_DETACHED
13769 #define PTHREAD_CREATE_DETACHED 1
13770 #endif
13771         pthread_t t;
13772         int status;
13773         int detach = PTHREAD_CREATE_DETACHED;
13774
13775 #if HAVE_PTHREADS > 4
13776         /* Final pthreads */
13777         pthread_attr_t attr;
13778
13779         status = pthread_attr_init(&attr);
13780         if( status ) return status;
13781
13782 #if HAVE_PTHREADS < 7
13783         status = pthread_attr_setdetachstate(&attr, &detach);
13784         if( status < 0 ) status = errno;
13785 #else
13786         status = pthread_attr_setdetachstate(&attr, detach);
13787 #endif
13788         if( status ) return status;
13789         status = pthread_create( &t, &attr, task, NULL );
13790 #if HAVE_PTHREADS < 7
13791         if( status < 0 ) status = errno;
13792 #endif
13793         if( status ) return status;
13794 #else
13795         /* Draft 4 pthreads */
13796         status = pthread_create( &t, pthread_attr_default, task, NULL );
13797         if( status ) return errno;
13798
13799         /* give thread a chance to complete */
13800         /* it should remain joinable and hence detachable */
13801         sleep( 1 );
13802
13803         status = pthread_detach( &t );
13804         if( status ) return errno;
13805 #endif
13806
13807 #ifdef HAVE_LINUX_THREADS
13808         pthread_kill_other_threads_np();
13809 #endif
13810
13811         return 0;
13812
13813 ; return 0; }
13814 EOF
13815 if { (eval echo configure:13816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13816   rm -rf conftest*
13817   ol_cv_pthread_threads=yes
13818 else
13819   echo "configure: failed program was:" >&5
13820   cat conftest.$ac_ext >&5
13821   rm -rf conftest*
13822   ol_cv_pthread_threads=no
13823 fi
13824 rm -f conftest*
13825 else
13826   cat > conftest.$ac_ext <<EOF
13827 #line 13828 "configure"
13828 #include "confdefs.h"
13829 /* pthread test headers */
13830 #include <pthread.h>
13831 #if HAVE_PTHREADS < 7
13832 #include <errno.h>
13833 #endif
13834 #ifndef NULL
13835 #define NULL (void*)0
13836 #endif
13837
13838 static void *task(p)
13839         void *p;
13840 {
13841         return (void *) (p == NULL);
13842 }
13843
13844
13845 int main(argc, argv)
13846         int argc;
13847         char **argv;
13848 {
13849
13850         /* pthread test function */
13851 #ifndef PTHREAD_CREATE_DETACHED
13852 #define PTHREAD_CREATE_DETACHED 1
13853 #endif
13854         pthread_t t;
13855         int status;
13856         int detach = PTHREAD_CREATE_DETACHED;
13857
13858 #if HAVE_PTHREADS > 4
13859         /* Final pthreads */
13860         pthread_attr_t attr;
13861
13862         status = pthread_attr_init(&attr);
13863         if( status ) return status;
13864
13865 #if HAVE_PTHREADS < 7
13866         status = pthread_attr_setdetachstate(&attr, &detach);
13867         if( status < 0 ) status = errno;
13868 #else
13869         status = pthread_attr_setdetachstate(&attr, detach);
13870 #endif
13871         if( status ) return status;
13872         status = pthread_create( &t, &attr, task, NULL );
13873 #if HAVE_PTHREADS < 7
13874         if( status < 0 ) status = errno;
13875 #endif
13876         if( status ) return status;
13877 #else
13878         /* Draft 4 pthreads */
13879         status = pthread_create( &t, pthread_attr_default, task, NULL );
13880         if( status ) return errno;
13881
13882         /* give thread a chance to complete */
13883         /* it should remain joinable and hence detachable */
13884         sleep( 1 );
13885
13886         status = pthread_detach( &t );
13887         if( status ) return errno;
13888 #endif
13889
13890 #ifdef HAVE_LINUX_THREADS
13891         pthread_kill_other_threads_np();
13892 #endif
13893
13894         return 0;
13895
13896 }
13897
13898 EOF
13899 if { (eval echo configure:13900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13900 then
13901   ol_cv_pthread_threads=yes
13902 else
13903   echo "configure: failed program was:" >&5
13904   cat conftest.$ac_ext >&5
13905   rm -fr conftest*
13906   ol_cv_pthread_threads=no
13907 fi
13908 rm -fr conftest*
13909 fi
13910
13911
13912                 # restore the LIBS
13913                 LIBS="$ol_LIBS"
13914         
13915 fi
13916
13917 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
13918
13919         if test $ol_cv_pthread_threads = yes ; then
13920                 ol_link_pthreads="-threads"
13921                 ol_link_threads=posix
13922         fi
13923 fi
13924
13925
13926                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
13927 if test "$ol_link_threads" = no ; then
13928         # try -lpthreads -lmach -lexc -lc_r
13929         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
13930 echo "configure:13931: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
13931 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
13932   echo $ac_n "(cached) $ac_c" 1>&6
13933 else
13934   
13935                 # save the flags
13936                 ol_LIBS="$LIBS"
13937                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
13938
13939                 if test "$cross_compiling" = yes; then
13940   cat > conftest.$ac_ext <<EOF
13941 #line 13942 "configure"
13942 #include "confdefs.h"
13943 /* pthread test headers */
13944 #include <pthread.h>
13945 #if HAVE_PTHREADS < 7
13946 #include <errno.h>
13947 #endif
13948 #ifndef NULL
13949 #define NULL (void*)0
13950 #endif
13951
13952 static void *task(p)
13953         void *p;
13954 {
13955         return (void *) (p == NULL);
13956 }
13957
13958 int main() {
13959
13960         /* pthread test function */
13961 #ifndef PTHREAD_CREATE_DETACHED
13962 #define PTHREAD_CREATE_DETACHED 1
13963 #endif
13964         pthread_t t;
13965         int status;
13966         int detach = PTHREAD_CREATE_DETACHED;
13967
13968 #if HAVE_PTHREADS > 4
13969         /* Final pthreads */
13970         pthread_attr_t attr;
13971
13972         status = pthread_attr_init(&attr);
13973         if( status ) return status;
13974
13975 #if HAVE_PTHREADS < 7
13976         status = pthread_attr_setdetachstate(&attr, &detach);
13977         if( status < 0 ) status = errno;
13978 #else
13979         status = pthread_attr_setdetachstate(&attr, detach);
13980 #endif
13981         if( status ) return status;
13982         status = pthread_create( &t, &attr, task, NULL );
13983 #if HAVE_PTHREADS < 7
13984         if( status < 0 ) status = errno;
13985 #endif
13986         if( status ) return status;
13987 #else
13988         /* Draft 4 pthreads */
13989         status = pthread_create( &t, pthread_attr_default, task, NULL );
13990         if( status ) return errno;
13991
13992         /* give thread a chance to complete */
13993         /* it should remain joinable and hence detachable */
13994         sleep( 1 );
13995
13996         status = pthread_detach( &t );
13997         if( status ) return errno;
13998 #endif
13999
14000 #ifdef HAVE_LINUX_THREADS
14001         pthread_kill_other_threads_np();
14002 #endif
14003
14004         return 0;
14005
14006 ; return 0; }
14007 EOF
14008 if { (eval echo configure:14009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14009   rm -rf conftest*
14010   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
14011 else
14012   echo "configure: failed program was:" >&5
14013   cat conftest.$ac_ext >&5
14014   rm -rf conftest*
14015   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
14016 fi
14017 rm -f conftest*
14018 else
14019   cat > conftest.$ac_ext <<EOF
14020 #line 14021 "configure"
14021 #include "confdefs.h"
14022 /* pthread test headers */
14023 #include <pthread.h>
14024 #if HAVE_PTHREADS < 7
14025 #include <errno.h>
14026 #endif
14027 #ifndef NULL
14028 #define NULL (void*)0
14029 #endif
14030
14031 static void *task(p)
14032         void *p;
14033 {
14034         return (void *) (p == NULL);
14035 }
14036
14037
14038 int main(argc, argv)
14039         int argc;
14040         char **argv;
14041 {
14042
14043         /* pthread test function */
14044 #ifndef PTHREAD_CREATE_DETACHED
14045 #define PTHREAD_CREATE_DETACHED 1
14046 #endif
14047         pthread_t t;
14048         int status;
14049         int detach = PTHREAD_CREATE_DETACHED;
14050
14051 #if HAVE_PTHREADS > 4
14052         /* Final pthreads */
14053         pthread_attr_t attr;
14054
14055         status = pthread_attr_init(&attr);
14056         if( status ) return status;
14057
14058 #if HAVE_PTHREADS < 7
14059         status = pthread_attr_setdetachstate(&attr, &detach);
14060         if( status < 0 ) status = errno;
14061 #else
14062         status = pthread_attr_setdetachstate(&attr, detach);
14063 #endif
14064         if( status ) return status;
14065         status = pthread_create( &t, &attr, task, NULL );
14066 #if HAVE_PTHREADS < 7
14067         if( status < 0 ) status = errno;
14068 #endif
14069         if( status ) return status;
14070 #else
14071         /* Draft 4 pthreads */
14072         status = pthread_create( &t, pthread_attr_default, task, NULL );
14073         if( status ) return errno;
14074
14075         /* give thread a chance to complete */
14076         /* it should remain joinable and hence detachable */
14077         sleep( 1 );
14078
14079         status = pthread_detach( &t );
14080         if( status ) return errno;
14081 #endif
14082
14083 #ifdef HAVE_LINUX_THREADS
14084         pthread_kill_other_threads_np();
14085 #endif
14086
14087         return 0;
14088
14089 }
14090
14091 EOF
14092 if { (eval echo configure:14093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14093 then
14094   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
14095 else
14096   echo "configure: failed program was:" >&5
14097   cat conftest.$ac_ext >&5
14098   rm -fr conftest*
14099   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
14100 fi
14101 rm -fr conftest*
14102 fi
14103
14104
14105                 # restore the LIBS
14106                 LIBS="$ol_LIBS"
14107         
14108 fi
14109
14110 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
14111
14112         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
14113                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
14114                 ol_link_threads=posix
14115         fi
14116 fi
14117
14118                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
14119 if test "$ol_link_threads" = no ; then
14120         # try -lpthreads -lmach -lexc
14121         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
14122 echo "configure:14123: checking for pthread link with -lpthreads -lmach -lexc" >&5
14123 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
14124   echo $ac_n "(cached) $ac_c" 1>&6
14125 else
14126   
14127                 # save the flags
14128                 ol_LIBS="$LIBS"
14129                 LIBS="-lpthreads -lmach -lexc $LIBS"
14130
14131                 if test "$cross_compiling" = yes; then
14132   cat > conftest.$ac_ext <<EOF
14133 #line 14134 "configure"
14134 #include "confdefs.h"
14135 /* pthread test headers */
14136 #include <pthread.h>
14137 #if HAVE_PTHREADS < 7
14138 #include <errno.h>
14139 #endif
14140 #ifndef NULL
14141 #define NULL (void*)0
14142 #endif
14143
14144 static void *task(p)
14145         void *p;
14146 {
14147         return (void *) (p == NULL);
14148 }
14149
14150 int main() {
14151
14152         /* pthread test function */
14153 #ifndef PTHREAD_CREATE_DETACHED
14154 #define PTHREAD_CREATE_DETACHED 1
14155 #endif
14156         pthread_t t;
14157         int status;
14158         int detach = PTHREAD_CREATE_DETACHED;
14159
14160 #if HAVE_PTHREADS > 4
14161         /* Final pthreads */
14162         pthread_attr_t attr;
14163
14164         status = pthread_attr_init(&attr);
14165         if( status ) return status;
14166
14167 #if HAVE_PTHREADS < 7
14168         status = pthread_attr_setdetachstate(&attr, &detach);
14169         if( status < 0 ) status = errno;
14170 #else
14171         status = pthread_attr_setdetachstate(&attr, detach);
14172 #endif
14173         if( status ) return status;
14174         status = pthread_create( &t, &attr, task, NULL );
14175 #if HAVE_PTHREADS < 7
14176         if( status < 0 ) status = errno;
14177 #endif
14178         if( status ) return status;
14179 #else
14180         /* Draft 4 pthreads */
14181         status = pthread_create( &t, pthread_attr_default, task, NULL );
14182         if( status ) return errno;
14183
14184         /* give thread a chance to complete */
14185         /* it should remain joinable and hence detachable */
14186         sleep( 1 );
14187
14188         status = pthread_detach( &t );
14189         if( status ) return errno;
14190 #endif
14191
14192 #ifdef HAVE_LINUX_THREADS
14193         pthread_kill_other_threads_np();
14194 #endif
14195
14196         return 0;
14197
14198 ; return 0; }
14199 EOF
14200 if { (eval echo configure:14201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14201   rm -rf conftest*
14202   ol_cv_pthread_lpthreads_lmach_lexc=yes
14203 else
14204   echo "configure: failed program was:" >&5
14205   cat conftest.$ac_ext >&5
14206   rm -rf conftest*
14207   ol_cv_pthread_lpthreads_lmach_lexc=no
14208 fi
14209 rm -f conftest*
14210 else
14211   cat > conftest.$ac_ext <<EOF
14212 #line 14213 "configure"
14213 #include "confdefs.h"
14214 /* pthread test headers */
14215 #include <pthread.h>
14216 #if HAVE_PTHREADS < 7
14217 #include <errno.h>
14218 #endif
14219 #ifndef NULL
14220 #define NULL (void*)0
14221 #endif
14222
14223 static void *task(p)
14224         void *p;
14225 {
14226         return (void *) (p == NULL);
14227 }
14228
14229
14230 int main(argc, argv)
14231         int argc;
14232         char **argv;
14233 {
14234
14235         /* pthread test function */
14236 #ifndef PTHREAD_CREATE_DETACHED
14237 #define PTHREAD_CREATE_DETACHED 1
14238 #endif
14239         pthread_t t;
14240         int status;
14241         int detach = PTHREAD_CREATE_DETACHED;
14242
14243 #if HAVE_PTHREADS > 4
14244         /* Final pthreads */
14245         pthread_attr_t attr;
14246
14247         status = pthread_attr_init(&attr);
14248         if( status ) return status;
14249
14250 #if HAVE_PTHREADS < 7
14251         status = pthread_attr_setdetachstate(&attr, &detach);
14252         if( status < 0 ) status = errno;
14253 #else
14254         status = pthread_attr_setdetachstate(&attr, detach);
14255 #endif
14256         if( status ) return status;
14257         status = pthread_create( &t, &attr, task, NULL );
14258 #if HAVE_PTHREADS < 7
14259         if( status < 0 ) status = errno;
14260 #endif
14261         if( status ) return status;
14262 #else
14263         /* Draft 4 pthreads */
14264         status = pthread_create( &t, pthread_attr_default, task, NULL );
14265         if( status ) return errno;
14266
14267         /* give thread a chance to complete */
14268         /* it should remain joinable and hence detachable */
14269         sleep( 1 );
14270
14271         status = pthread_detach( &t );
14272         if( status ) return errno;
14273 #endif
14274
14275 #ifdef HAVE_LINUX_THREADS
14276         pthread_kill_other_threads_np();
14277 #endif
14278
14279         return 0;
14280
14281 }
14282
14283 EOF
14284 if { (eval echo configure:14285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14285 then
14286   ol_cv_pthread_lpthreads_lmach_lexc=yes
14287 else
14288   echo "configure: failed program was:" >&5
14289   cat conftest.$ac_ext >&5
14290   rm -fr conftest*
14291   ol_cv_pthread_lpthreads_lmach_lexc=no
14292 fi
14293 rm -fr conftest*
14294 fi
14295
14296
14297                 # restore the LIBS
14298                 LIBS="$ol_LIBS"
14299         
14300 fi
14301
14302 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
14303
14304         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
14305                 ol_link_pthreads="-lpthreads -lmach -lexc"
14306                 ol_link_threads=posix
14307         fi
14308 fi
14309
14310                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
14311 if test "$ol_link_threads" = no ; then
14312         # try -lpthreads -lexc
14313         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
14314 echo "configure:14315: checking for pthread link with -lpthreads -lexc" >&5
14315 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
14316   echo $ac_n "(cached) $ac_c" 1>&6
14317 else
14318   
14319                 # save the flags
14320                 ol_LIBS="$LIBS"
14321                 LIBS="-lpthreads -lexc $LIBS"
14322
14323                 if test "$cross_compiling" = yes; then
14324   cat > conftest.$ac_ext <<EOF
14325 #line 14326 "configure"
14326 #include "confdefs.h"
14327 /* pthread test headers */
14328 #include <pthread.h>
14329 #if HAVE_PTHREADS < 7
14330 #include <errno.h>
14331 #endif
14332 #ifndef NULL
14333 #define NULL (void*)0
14334 #endif
14335
14336 static void *task(p)
14337         void *p;
14338 {
14339         return (void *) (p == NULL);
14340 }
14341
14342 int main() {
14343
14344         /* pthread test function */
14345 #ifndef PTHREAD_CREATE_DETACHED
14346 #define PTHREAD_CREATE_DETACHED 1
14347 #endif
14348         pthread_t t;
14349         int status;
14350         int detach = PTHREAD_CREATE_DETACHED;
14351
14352 #if HAVE_PTHREADS > 4
14353         /* Final pthreads */
14354         pthread_attr_t attr;
14355
14356         status = pthread_attr_init(&attr);
14357         if( status ) return status;
14358
14359 #if HAVE_PTHREADS < 7
14360         status = pthread_attr_setdetachstate(&attr, &detach);
14361         if( status < 0 ) status = errno;
14362 #else
14363         status = pthread_attr_setdetachstate(&attr, detach);
14364 #endif
14365         if( status ) return status;
14366         status = pthread_create( &t, &attr, task, NULL );
14367 #if HAVE_PTHREADS < 7
14368         if( status < 0 ) status = errno;
14369 #endif
14370         if( status ) return status;
14371 #else
14372         /* Draft 4 pthreads */
14373         status = pthread_create( &t, pthread_attr_default, task, NULL );
14374         if( status ) return errno;
14375
14376         /* give thread a chance to complete */
14377         /* it should remain joinable and hence detachable */
14378         sleep( 1 );
14379
14380         status = pthread_detach( &t );
14381         if( status ) return errno;
14382 #endif
14383
14384 #ifdef HAVE_LINUX_THREADS
14385         pthread_kill_other_threads_np();
14386 #endif
14387
14388         return 0;
14389
14390 ; return 0; }
14391 EOF
14392 if { (eval echo configure:14393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14393   rm -rf conftest*
14394   ol_cv_pthread_lpthreads_lexc=yes
14395 else
14396   echo "configure: failed program was:" >&5
14397   cat conftest.$ac_ext >&5
14398   rm -rf conftest*
14399   ol_cv_pthread_lpthreads_lexc=no
14400 fi
14401 rm -f conftest*
14402 else
14403   cat > conftest.$ac_ext <<EOF
14404 #line 14405 "configure"
14405 #include "confdefs.h"
14406 /* pthread test headers */
14407 #include <pthread.h>
14408 #if HAVE_PTHREADS < 7
14409 #include <errno.h>
14410 #endif
14411 #ifndef NULL
14412 #define NULL (void*)0
14413 #endif
14414
14415 static void *task(p)
14416         void *p;
14417 {
14418         return (void *) (p == NULL);
14419 }
14420
14421
14422 int main(argc, argv)
14423         int argc;
14424         char **argv;
14425 {
14426
14427         /* pthread test function */
14428 #ifndef PTHREAD_CREATE_DETACHED
14429 #define PTHREAD_CREATE_DETACHED 1
14430 #endif
14431         pthread_t t;
14432         int status;
14433         int detach = PTHREAD_CREATE_DETACHED;
14434
14435 #if HAVE_PTHREADS > 4
14436         /* Final pthreads */
14437         pthread_attr_t attr;
14438
14439         status = pthread_attr_init(&attr);
14440         if( status ) return status;
14441
14442 #if HAVE_PTHREADS < 7
14443         status = pthread_attr_setdetachstate(&attr, &detach);
14444         if( status < 0 ) status = errno;
14445 #else
14446         status = pthread_attr_setdetachstate(&attr, detach);
14447 #endif
14448         if( status ) return status;
14449         status = pthread_create( &t, &attr, task, NULL );
14450 #if HAVE_PTHREADS < 7
14451         if( status < 0 ) status = errno;
14452 #endif
14453         if( status ) return status;
14454 #else
14455         /* Draft 4 pthreads */
14456         status = pthread_create( &t, pthread_attr_default, task, NULL );
14457         if( status ) return errno;
14458
14459         /* give thread a chance to complete */
14460         /* it should remain joinable and hence detachable */
14461         sleep( 1 );
14462
14463         status = pthread_detach( &t );
14464         if( status ) return errno;
14465 #endif
14466
14467 #ifdef HAVE_LINUX_THREADS
14468         pthread_kill_other_threads_np();
14469 #endif
14470
14471         return 0;
14472
14473 }
14474
14475 EOF
14476 if { (eval echo configure:14477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14477 then
14478   ol_cv_pthread_lpthreads_lexc=yes
14479 else
14480   echo "configure: failed program was:" >&5
14481   cat conftest.$ac_ext >&5
14482   rm -fr conftest*
14483   ol_cv_pthread_lpthreads_lexc=no
14484 fi
14485 rm -fr conftest*
14486 fi
14487
14488
14489                 # restore the LIBS
14490                 LIBS="$ol_LIBS"
14491         
14492 fi
14493
14494 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
14495
14496         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
14497                 ol_link_pthreads="-lpthreads -lexc"
14498                 ol_link_threads=posix
14499         fi
14500 fi
14501
14502
14503                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
14504 if test "$ol_link_threads" = no ; then
14505         # try -lpthreads
14506         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
14507 echo "configure:14508: checking for pthread link with -lpthreads" >&5
14508 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
14509   echo $ac_n "(cached) $ac_c" 1>&6
14510 else
14511   
14512                 # save the flags
14513                 ol_LIBS="$LIBS"
14514                 LIBS="-lpthreads $LIBS"
14515
14516                 if test "$cross_compiling" = yes; then
14517   cat > conftest.$ac_ext <<EOF
14518 #line 14519 "configure"
14519 #include "confdefs.h"
14520 /* pthread test headers */
14521 #include <pthread.h>
14522 #if HAVE_PTHREADS < 7
14523 #include <errno.h>
14524 #endif
14525 #ifndef NULL
14526 #define NULL (void*)0
14527 #endif
14528
14529 static void *task(p)
14530         void *p;
14531 {
14532         return (void *) (p == NULL);
14533 }
14534
14535 int main() {
14536
14537         /* pthread test function */
14538 #ifndef PTHREAD_CREATE_DETACHED
14539 #define PTHREAD_CREATE_DETACHED 1
14540 #endif
14541         pthread_t t;
14542         int status;
14543         int detach = PTHREAD_CREATE_DETACHED;
14544
14545 #if HAVE_PTHREADS > 4
14546         /* Final pthreads */
14547         pthread_attr_t attr;
14548
14549         status = pthread_attr_init(&attr);
14550         if( status ) return status;
14551
14552 #if HAVE_PTHREADS < 7
14553         status = pthread_attr_setdetachstate(&attr, &detach);
14554         if( status < 0 ) status = errno;
14555 #else
14556         status = pthread_attr_setdetachstate(&attr, detach);
14557 #endif
14558         if( status ) return status;
14559         status = pthread_create( &t, &attr, task, NULL );
14560 #if HAVE_PTHREADS < 7
14561         if( status < 0 ) status = errno;
14562 #endif
14563         if( status ) return status;
14564 #else
14565         /* Draft 4 pthreads */
14566         status = pthread_create( &t, pthread_attr_default, task, NULL );
14567         if( status ) return errno;
14568
14569         /* give thread a chance to complete */
14570         /* it should remain joinable and hence detachable */
14571         sleep( 1 );
14572
14573         status = pthread_detach( &t );
14574         if( status ) return errno;
14575 #endif
14576
14577 #ifdef HAVE_LINUX_THREADS
14578         pthread_kill_other_threads_np();
14579 #endif
14580
14581         return 0;
14582
14583 ; return 0; }
14584 EOF
14585 if { (eval echo configure:14586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14586   rm -rf conftest*
14587   ol_cv_pthread_lib_lpthreads=yes
14588 else
14589   echo "configure: failed program was:" >&5
14590   cat conftest.$ac_ext >&5
14591   rm -rf conftest*
14592   ol_cv_pthread_lib_lpthreads=no
14593 fi
14594 rm -f conftest*
14595 else
14596   cat > conftest.$ac_ext <<EOF
14597 #line 14598 "configure"
14598 #include "confdefs.h"
14599 /* pthread test headers */
14600 #include <pthread.h>
14601 #if HAVE_PTHREADS < 7
14602 #include <errno.h>
14603 #endif
14604 #ifndef NULL
14605 #define NULL (void*)0
14606 #endif
14607
14608 static void *task(p)
14609         void *p;
14610 {
14611         return (void *) (p == NULL);
14612 }
14613
14614
14615 int main(argc, argv)
14616         int argc;
14617         char **argv;
14618 {
14619
14620         /* pthread test function */
14621 #ifndef PTHREAD_CREATE_DETACHED
14622 #define PTHREAD_CREATE_DETACHED 1
14623 #endif
14624         pthread_t t;
14625         int status;
14626         int detach = PTHREAD_CREATE_DETACHED;
14627
14628 #if HAVE_PTHREADS > 4
14629         /* Final pthreads */
14630         pthread_attr_t attr;
14631
14632         status = pthread_attr_init(&attr);
14633         if( status ) return status;
14634
14635 #if HAVE_PTHREADS < 7
14636         status = pthread_attr_setdetachstate(&attr, &detach);
14637         if( status < 0 ) status = errno;
14638 #else
14639         status = pthread_attr_setdetachstate(&attr, detach);
14640 #endif
14641         if( status ) return status;
14642         status = pthread_create( &t, &attr, task, NULL );
14643 #if HAVE_PTHREADS < 7
14644         if( status < 0 ) status = errno;
14645 #endif
14646         if( status ) return status;
14647 #else
14648         /* Draft 4 pthreads */
14649         status = pthread_create( &t, pthread_attr_default, task, NULL );
14650         if( status ) return errno;
14651
14652         /* give thread a chance to complete */
14653         /* it should remain joinable and hence detachable */
14654         sleep( 1 );
14655
14656         status = pthread_detach( &t );
14657         if( status ) return errno;
14658 #endif
14659
14660 #ifdef HAVE_LINUX_THREADS
14661         pthread_kill_other_threads_np();
14662 #endif
14663
14664         return 0;
14665
14666 }
14667
14668 EOF
14669 if { (eval echo configure:14670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14670 then
14671   ol_cv_pthread_lib_lpthreads=yes
14672 else
14673   echo "configure: failed program was:" >&5
14674   cat conftest.$ac_ext >&5
14675   rm -fr conftest*
14676   ol_cv_pthread_lib_lpthreads=no
14677 fi
14678 rm -fr conftest*
14679 fi
14680
14681
14682                 # restore the LIBS
14683                 LIBS="$ol_LIBS"
14684         
14685 fi
14686
14687 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
14688
14689         if test $ol_cv_pthread_lib_lpthreads = yes ; then
14690                 ol_link_pthreads="-lpthreads"
14691                 ol_link_threads=posix
14692         fi
14693 fi
14694
14695
14696                 if test $ol_link_threads != no ; then
14697                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
14698
14699                                                 save_CPPFLAGS="$CPPFLAGS"
14700                         save_LIBS="$LIBS"
14701                         LIBS="$LTHREAD_LIBS $LIBS"
14702
14703                                                                                                 for ac_func in sched_yield pthread_yield thr_yield
14704 do
14705 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14706 echo "configure:14707: checking for $ac_func" >&5
14707 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14708   echo $ac_n "(cached) $ac_c" 1>&6
14709 else
14710   cat > conftest.$ac_ext <<EOF
14711 #line 14712 "configure"
14712 #include "confdefs.h"
14713 /* System header to define __stub macros and hopefully few prototypes,
14714     which can conflict with char $ac_func(); below.  */
14715 #include <assert.h>
14716 /* Override any gcc2 internal prototype to avoid an error.  */
14717 /* We use char because int might match the return type of a gcc2
14718     builtin and then its argument prototype would still apply.  */
14719 char $ac_func();
14720 char (*f)();
14721
14722 int main() {
14723
14724 /* The GNU C library defines this for functions which it implements
14725     to always fail with ENOSYS.  Some functions are actually named
14726     something starting with __ and the normal name is an alias.  */
14727 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14728 choke me
14729 #else
14730 f = $ac_func;
14731 #endif
14732
14733 ; return 0; }
14734 EOF
14735 if { (eval echo configure:14736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14736   rm -rf conftest*
14737   eval "ac_cv_func_$ac_func=yes"
14738 else
14739   echo "configure: failed program was:" >&5
14740   cat conftest.$ac_ext >&5
14741   rm -rf conftest*
14742   eval "ac_cv_func_$ac_func=no"
14743 fi
14744 rm -f conftest*
14745 fi
14746
14747 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14748   echo "$ac_t""yes" 1>&6
14749     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14750   cat >> confdefs.h <<EOF
14751 #define $ac_tr_func 1
14752 EOF
14753  
14754 else
14755   echo "$ac_t""no" 1>&6
14756 fi
14757 done
14758
14759
14760                         if test $ac_cv_func_sched_yield = no -a \
14761                                 $ac_cv_func_pthread_yield = no -a \
14762                                 $ac_cv_func_thr_yield = no ; then
14763                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
14764 echo "configure:14765: checking for sched_yield in -lrt" >&5
14765 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
14766 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14767   echo $ac_n "(cached) $ac_c" 1>&6
14768 else
14769   ac_save_LIBS="$LIBS"
14770 LIBS="-lrt  $LIBS"
14771 cat > conftest.$ac_ext <<EOF
14772 #line 14773 "configure"
14773 #include "confdefs.h"
14774 /* Override any gcc2 internal prototype to avoid an error.  */
14775 /* We use char because int might match the return type of a gcc2
14776     builtin and then its argument prototype would still apply.  */
14777 char sched_yield();
14778
14779 int main() {
14780 sched_yield()
14781 ; return 0; }
14782 EOF
14783 if { (eval echo configure:14784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14784   rm -rf conftest*
14785   eval "ac_cv_lib_$ac_lib_var=yes"
14786 else
14787   echo "configure: failed program was:" >&5
14788   cat conftest.$ac_ext >&5
14789   rm -rf conftest*
14790   eval "ac_cv_lib_$ac_lib_var=no"
14791 fi
14792 rm -f conftest*
14793 LIBS="$ac_save_LIBS"
14794
14795 fi
14796 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14797   echo "$ac_t""yes" 1>&6
14798   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
14799                                         cat >> confdefs.h <<\EOF
14800 #define HAVE_SCHED_YIELD 1
14801 EOF
14802
14803                                         ac_cv_func_sched_yield=yes
14804 else
14805   echo "$ac_t""no" 1>&6
14806 ac_cv_func_sched_yield=no
14807 fi
14808
14809                         fi
14810                         if test $ac_cv_func_sched_yield = no -a \
14811                                 $ac_cv_func_pthread_yield = no -a \
14812                                 "$ac_cv_func_thr_yield" = no ; then
14813                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
14814                         fi
14815
14816                                                 for ac_func in pthread_kill pthread_rwlock_destroy
14817 do
14818 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14819 echo "configure:14820: checking for $ac_func" >&5
14820 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14821   echo $ac_n "(cached) $ac_c" 1>&6
14822 else
14823   cat > conftest.$ac_ext <<EOF
14824 #line 14825 "configure"
14825 #include "confdefs.h"
14826 /* System header to define __stub macros and hopefully few prototypes,
14827     which can conflict with char $ac_func(); below.  */
14828 #include <assert.h>
14829 /* Override any gcc2 internal prototype to avoid an error.  */
14830 /* We use char because int might match the return type of a gcc2
14831     builtin and then its argument prototype would still apply.  */
14832 char $ac_func();
14833 char (*f)();
14834
14835 int main() {
14836
14837 /* The GNU C library defines this for functions which it implements
14838     to always fail with ENOSYS.  Some functions are actually named
14839     something starting with __ and the normal name is an alias.  */
14840 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14841 choke me
14842 #else
14843 f = $ac_func;
14844 #endif
14845
14846 ; return 0; }
14847 EOF
14848 if { (eval echo configure:14849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14849   rm -rf conftest*
14850   eval "ac_cv_func_$ac_func=yes"
14851 else
14852   echo "configure: failed program was:" >&5
14853   cat conftest.$ac_ext >&5
14854   rm -rf conftest*
14855   eval "ac_cv_func_$ac_func=no"
14856 fi
14857 rm -f conftest*
14858 fi
14859
14860 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14861   echo "$ac_t""yes" 1>&6
14862     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14863   cat >> confdefs.h <<EOF
14864 #define $ac_tr_func 1
14865 EOF
14866  
14867 else
14868   echo "$ac_t""no" 1>&6
14869 fi
14870 done
14871
14872
14873                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
14874 echo "configure:14875: checking for pthread_detach with <pthread.h>" >&5
14875 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
14876   echo $ac_n "(cached) $ac_c" 1>&6
14877 else
14878   
14879                                                                 cat > conftest.$ac_ext <<EOF
14880 #line 14881 "configure"
14881 #include "confdefs.h"
14882
14883 #include <pthread.h>
14884 #ifndef NULL
14885 #define NULL (void*)0
14886 #endif
14887
14888 int main() {
14889 pthread_detach(NULL);
14890 ; return 0; }
14891 EOF
14892 if { (eval echo configure:14893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14893   rm -rf conftest*
14894   ol_cv_func_pthread_detach=yes
14895 else
14896   echo "configure: failed program was:" >&5
14897   cat conftest.$ac_ext >&5
14898   rm -rf conftest*
14899   ol_cv_func_pthread_detach=no
14900 fi
14901 rm -f conftest*
14902                         
14903 fi
14904
14905 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
14906
14907                         if test $ol_cv_func_pthread_detach = no ; then
14908                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
14909                         fi
14910
14911                         cat >> confdefs.h <<\EOF
14912 #define HAVE_PTHREAD_DETACH 1
14913 EOF
14914
14915
14916                                                 for ac_func in \
14917                                 pthread_setconcurrency \
14918                                 pthread_getconcurrency \
14919                                 thr_setconcurrency \
14920                                 thr_getconcurrency \
14921                         
14922 do
14923 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14924 echo "configure:14925: checking for $ac_func" >&5
14925 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14926   echo $ac_n "(cached) $ac_c" 1>&6
14927 else
14928   cat > conftest.$ac_ext <<EOF
14929 #line 14930 "configure"
14930 #include "confdefs.h"
14931 /* System header to define __stub macros and hopefully few prototypes,
14932     which can conflict with char $ac_func(); below.  */
14933 #include <assert.h>
14934 /* Override any gcc2 internal prototype to avoid an error.  */
14935 /* We use char because int might match the return type of a gcc2
14936     builtin and then its argument prototype would still apply.  */
14937 char $ac_func();
14938 char (*f)();
14939
14940 int main() {
14941
14942 /* The GNU C library defines this for functions which it implements
14943     to always fail with ENOSYS.  Some functions are actually named
14944     something starting with __ and the normal name is an alias.  */
14945 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14946 choke me
14947 #else
14948 f = $ac_func;
14949 #endif
14950
14951 ; return 0; }
14952 EOF
14953 if { (eval echo configure:14954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14954   rm -rf conftest*
14955   eval "ac_cv_func_$ac_func=yes"
14956 else
14957   echo "configure: failed program was:" >&5
14958   cat conftest.$ac_ext >&5
14959   rm -rf conftest*
14960   eval "ac_cv_func_$ac_func=no"
14961 fi
14962 rm -f conftest*
14963 fi
14964
14965 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14966   echo "$ac_t""yes" 1>&6
14967     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14968   cat >> confdefs.h <<EOF
14969 #define $ac_tr_func 1
14970 EOF
14971  
14972 else
14973   echo "$ac_t""no" 1>&6
14974 fi
14975 done
14976
14977
14978                         
14979         for ac_func in pthread_kill_other_threads_np
14980 do
14981 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14982 echo "configure:14983: checking for $ac_func" >&5
14983 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14984   echo $ac_n "(cached) $ac_c" 1>&6
14985 else
14986   cat > conftest.$ac_ext <<EOF
14987 #line 14988 "configure"
14988 #include "confdefs.h"
14989 /* System header to define __stub macros and hopefully few prototypes,
14990     which can conflict with char $ac_func(); below.  */
14991 #include <assert.h>
14992 /* Override any gcc2 internal prototype to avoid an error.  */
14993 /* We use char because int might match the return type of a gcc2
14994     builtin and then its argument prototype would still apply.  */
14995 char $ac_func();
14996 char (*f)();
14997
14998 int main() {
14999
15000 /* The GNU C library defines this for functions which it implements
15001     to always fail with ENOSYS.  Some functions are actually named
15002     something starting with __ and the normal name is an alias.  */
15003 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15004 choke me
15005 #else
15006 f = $ac_func;
15007 #endif
15008
15009 ; return 0; }
15010 EOF
15011 if { (eval echo configure:15012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15012   rm -rf conftest*
15013   eval "ac_cv_func_$ac_func=yes"
15014 else
15015   echo "configure: failed program was:" >&5
15016   cat conftest.$ac_ext >&5
15017   rm -rf conftest*
15018   eval "ac_cv_func_$ac_func=no"
15019 fi
15020 rm -f conftest*
15021 fi
15022
15023 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15024   echo "$ac_t""yes" 1>&6
15025     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15026   cat >> confdefs.h <<EOF
15027 #define $ac_tr_func 1
15028 EOF
15029  
15030 else
15031   echo "$ac_t""no" 1>&6
15032 fi
15033 done
15034
15035         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
15036 echo "configure:15037: checking for LinuxThreads implementation" >&5
15037 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
15038   echo $ac_n "(cached) $ac_c" 1>&6
15039 else
15040   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
15041 fi
15042
15043 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
15044
15045                         
15046         
15047         
15048         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
15049 echo "configure:15050: checking for LinuxThreads consistency" >&5
15050 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
15051   echo $ac_n "(cached) $ac_c" 1>&6
15052 else
15053   
15054                 if test $ol_cv_header_linux_threads = yes -a \
15055                         $ol_cv_sys_linux_threads = yes; then
15056                         ol_cv_linux_threads=yes
15057                 elif test $ol_cv_header_linux_threads = no -a \
15058                         $ol_cv_sys_linux_threads = no; then
15059                         ol_cv_linux_threads=no
15060                 else
15061                         ol_cv_linux_threads=error
15062                 fi
15063         
15064 fi
15065
15066 echo "$ac_t""$ol_cv_linux_threads" 1>&6
15067
15068
15069                         if test $ol_cv_linux_threads = error; then
15070                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
15071                         fi
15072
15073                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
15074 echo "configure:15075: checking if pthread_create() works" >&5
15075 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
15076   echo $ac_n "(cached) $ac_c" 1>&6
15077 else
15078   
15079                         if test "$cross_compiling" = yes; then
15080                                 ol_cv_pthread_create_works=yes
15081 else
15082   cat > conftest.$ac_ext <<EOF
15083 #line 15084 "configure"
15084 #include "confdefs.h"
15085 /* pthread test headers */
15086 #include <pthread.h>
15087 #if HAVE_PTHREADS < 7
15088 #include <errno.h>
15089 #endif
15090 #ifndef NULL
15091 #define NULL (void*)0
15092 #endif
15093
15094 static void *task(p)
15095         void *p;
15096 {
15097         return (void *) (p == NULL);
15098 }
15099
15100
15101 int main(argc, argv)
15102         int argc;
15103         char **argv;
15104 {
15105
15106         /* pthread test function */
15107 #ifndef PTHREAD_CREATE_DETACHED
15108 #define PTHREAD_CREATE_DETACHED 1
15109 #endif
15110         pthread_t t;
15111         int status;
15112         int detach = PTHREAD_CREATE_DETACHED;
15113
15114 #if HAVE_PTHREADS > 4
15115         /* Final pthreads */
15116         pthread_attr_t attr;
15117
15118         status = pthread_attr_init(&attr);
15119         if( status ) return status;
15120
15121 #if HAVE_PTHREADS < 7
15122         status = pthread_attr_setdetachstate(&attr, &detach);
15123         if( status < 0 ) status = errno;
15124 #else
15125         status = pthread_attr_setdetachstate(&attr, detach);
15126 #endif
15127         if( status ) return status;
15128         status = pthread_create( &t, &attr, task, NULL );
15129 #if HAVE_PTHREADS < 7
15130         if( status < 0 ) status = errno;
15131 #endif
15132         if( status ) return status;
15133 #else
15134         /* Draft 4 pthreads */
15135         status = pthread_create( &t, pthread_attr_default, task, NULL );
15136         if( status ) return errno;
15137
15138         /* give thread a chance to complete */
15139         /* it should remain joinable and hence detachable */
15140         sleep( 1 );
15141
15142         status = pthread_detach( &t );
15143         if( status ) return errno;
15144 #endif
15145
15146 #ifdef HAVE_LINUX_THREADS
15147         pthread_kill_other_threads_np();
15148 #endif
15149
15150         return 0;
15151
15152 }
15153
15154 EOF
15155 if { (eval echo configure:15156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15156 then
15157   ol_cv_pthread_create_works=yes
15158 else
15159   echo "configure: failed program was:" >&5
15160   cat conftest.$ac_ext >&5
15161   rm -fr conftest*
15162   ol_cv_pthread_create_works=no
15163 fi
15164 rm -fr conftest*
15165 fi
15166
15167 fi
15168
15169 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
15170
15171                         if test $ol_cv_pthread_create_works = no ; then
15172                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
15173                         fi
15174
15175                                                 if test $ol_with_yielding_select = auto ; then
15176                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
15177 echo "configure:15178: checking if select yields when using pthreads" >&5
15178 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
15179   echo $ac_n "(cached) $ac_c" 1>&6
15180 else
15181   
15182                                 if test "$cross_compiling" = yes; then
15183   ol_cv_pthread_select_yields=cross
15184 else
15185   cat > conftest.$ac_ext <<EOF
15186 #line 15187 "configure"
15187 #include "confdefs.h"
15188
15189 #include <sys/types.h>
15190 #include <sys/time.h>
15191 #include <unistd.h>
15192 #include <pthread.h>
15193 #ifndef NULL
15194 #define NULL (void*) 0
15195 #endif
15196
15197 static int fildes[2];
15198
15199 static void *task(p)
15200         void *p;
15201 {
15202         int i;
15203         struct timeval tv;
15204
15205         fd_set rfds;
15206
15207         tv.tv_sec=10;
15208         tv.tv_usec=0;
15209
15210         FD_ZERO(&rfds);
15211         FD_SET(fildes[0], &rfds);
15212
15213         /* we're not interested in any fds */
15214         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
15215
15216         if(i < 0) {
15217                 perror("select");
15218                 exit(10);
15219         }
15220
15221         exit(0); /* if we exit here, the select blocked the whole process */
15222 }
15223
15224 int main(argc, argv)
15225         int argc;
15226         char **argv;
15227 {
15228         pthread_t t;
15229
15230         /* create a pipe to select */
15231         if(pipe(&fildes[0])) {
15232                 perror("select");
15233                 exit(1);
15234         }
15235
15236 #ifdef HAVE_PTHREAD_SETCONCURRENCY
15237         (void) pthread_setconcurrency(2);
15238 #else
15239 #ifdef HAVE_THR_SETCONCURRENCY
15240         /* Set Solaris LWP concurrency to 2 */
15241         thr_setconcurrency(2);
15242 #endif
15243 #endif
15244
15245 #if HAVE_PTHREADS < 6
15246         pthread_create(&t, pthread_attr_default, task, NULL);
15247 #else
15248         pthread_create(&t, NULL, task, NULL);
15249 #endif
15250
15251         /* make sure task runs first */
15252 #if HAVE_THR_YIELD
15253         thr_yield();
15254 #elif defined( HAVE_SCHED_YIELD )
15255         sched_yield();
15256 #elif defined( HAVE_PTHREAD_YIELD )
15257         pthread_yield();
15258 #endif
15259
15260         exit(2);
15261 }
15262 EOF
15263 if { (eval echo configure:15264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15264 then
15265   ol_cv_pthread_select_yields=no
15266 else
15267   echo "configure: failed program was:" >&5
15268   cat conftest.$ac_ext >&5
15269   rm -fr conftest*
15270   ol_cv_pthread_select_yields=yes
15271 fi
15272 rm -fr conftest*
15273 fi
15274
15275 fi
15276
15277 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
15278
15279                                 if test $ol_cv_pthread_select_yields = cross ; then
15280                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
15281                                 fi
15282
15283                                 if test $ol_cv_pthread_select_yields = yes ; then
15284                                         ol_with_yielding_select=yes
15285                                 fi
15286                         fi
15287
15288                                                 CPPFLAGS="$save_CPPFLAGS"
15289                         LIBS="$save_LIBS"
15290                 else
15291                         { echo "configure: error: could not locate usable POSIX Threads" 1>&2; exit 1; }
15292                 fi
15293         fi
15294
15295         if test $ol_with_threads = posix ; then
15296                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
15297         fi
15298 fi
15299
15300 if test $ol_with_threads = auto -o $ol_with_threads = yes \
15301         -o $ol_with_threads = mach ; then
15302
15303                 for ac_hdr in mach/cthreads.h cthreads.h
15304 do
15305 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15306 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15307 echo "configure:15308: checking for $ac_hdr" >&5
15308 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15309   echo $ac_n "(cached) $ac_c" 1>&6
15310 else
15311   cat > conftest.$ac_ext <<EOF
15312 #line 15313 "configure"
15313 #include "confdefs.h"
15314 #include <$ac_hdr>
15315 EOF
15316 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15317 { (eval echo configure:15318: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15318 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15319 if test -z "$ac_err"; then
15320   rm -rf conftest*
15321   eval "ac_cv_header_$ac_safe=yes"
15322 else
15323   echo "$ac_err" >&5
15324   echo "configure: failed program was:" >&5
15325   cat conftest.$ac_ext >&5
15326   rm -rf conftest*
15327   eval "ac_cv_header_$ac_safe=no"
15328 fi
15329 rm -f conftest*
15330 fi
15331 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15332   echo "$ac_t""yes" 1>&6
15333     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15334   cat >> confdefs.h <<EOF
15335 #define $ac_tr_hdr 1
15336 EOF
15337  
15338 else
15339   echo "$ac_t""no" 1>&6
15340 fi
15341 done
15342
15343         if test $ac_cv_header_mach_cthreads_h = yes ; then
15344                 ol_with_threads=found
15345
15346                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
15347 echo "configure:15348: checking for cthread_fork" >&5
15348 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
15349   echo $ac_n "(cached) $ac_c" 1>&6
15350 else
15351   cat > conftest.$ac_ext <<EOF
15352 #line 15353 "configure"
15353 #include "confdefs.h"
15354 /* System header to define __stub macros and hopefully few prototypes,
15355     which can conflict with char cthread_fork(); below.  */
15356 #include <assert.h>
15357 /* Override any gcc2 internal prototype to avoid an error.  */
15358 /* We use char because int might match the return type of a gcc2
15359     builtin and then its argument prototype would still apply.  */
15360 char cthread_fork();
15361 char (*f)();
15362
15363 int main() {
15364
15365 /* The GNU C library defines this for functions which it implements
15366     to always fail with ENOSYS.  Some functions are actually named
15367     something starting with __ and the normal name is an alias.  */
15368 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
15369 choke me
15370 #else
15371 f = cthread_fork;
15372 #endif
15373
15374 ; return 0; }
15375 EOF
15376 if { (eval echo configure:15377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15377   rm -rf conftest*
15378   eval "ac_cv_func_cthread_fork=yes"
15379 else
15380   echo "configure: failed program was:" >&5
15381   cat conftest.$ac_ext >&5
15382   rm -rf conftest*
15383   eval "ac_cv_func_cthread_fork=no"
15384 fi
15385 rm -f conftest*
15386 fi
15387
15388 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
15389   echo "$ac_t""yes" 1>&6
15390   ol_link_threads=yes
15391 else
15392   echo "$ac_t""no" 1>&6
15393 fi
15394
15395
15396                 if test $ol_link_threads = no ; then
15397                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
15398 echo "configure:15399: checking for cthread_fork with -all_load" >&5
15399 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
15400   echo $ac_n "(cached) $ac_c" 1>&6
15401 else
15402   
15403                                                                 save_LIBS="$LIBS"
15404                                 LIBS="-all_load $LIBS"
15405                                 cat > conftest.$ac_ext <<EOF
15406 #line 15407 "configure"
15407 #include "confdefs.h"
15408 #include <mach/cthreads.h>
15409 int main() {
15410
15411                                         cthread_fork((void *)0, (void *)0);
15412                                         
15413 ; return 0; }
15414 EOF
15415 if { (eval echo configure:15416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15416   rm -rf conftest*
15417   ol_cv_cthread_all_load=yes
15418 else
15419   echo "configure: failed program was:" >&5
15420   cat conftest.$ac_ext >&5
15421   rm -rf conftest*
15422   ol_cv_cthread_all_load=no
15423 fi
15424 rm -f conftest*
15425                                                                 LIBS="$save_LIBS"
15426                         
15427 fi
15428
15429 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
15430
15431                         if test $ol_cv_cthread_all_load = yes ; then
15432                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
15433                                 ol_link_threads=mach
15434                                 ol_with_threads=found
15435                         fi
15436                 fi
15437
15438         elif test $ac_cv_header_cthreads_h = yes ; then
15439                                 
15440                 ol_with_threads=found
15441  
15442                                 save_LIBS="$LIBS"
15443                 LIBS="$LIBS -lthreads"
15444                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
15445 echo "configure:15446: checking for cthread_fork" >&5
15446 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
15447   echo $ac_n "(cached) $ac_c" 1>&6
15448 else
15449   cat > conftest.$ac_ext <<EOF
15450 #line 15451 "configure"
15451 #include "confdefs.h"
15452 /* System header to define __stub macros and hopefully few prototypes,
15453     which can conflict with char cthread_fork(); below.  */
15454 #include <assert.h>
15455 /* Override any gcc2 internal prototype to avoid an error.  */
15456 /* We use char because int might match the return type of a gcc2
15457     builtin and then its argument prototype would still apply.  */
15458 char cthread_fork();
15459 char (*f)();
15460
15461 int main() {
15462
15463 /* The GNU C library defines this for functions which it implements
15464     to always fail with ENOSYS.  Some functions are actually named
15465     something starting with __ and the normal name is an alias.  */
15466 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
15467 choke me
15468 #else
15469 f = cthread_fork;
15470 #endif
15471
15472 ; return 0; }
15473 EOF
15474 if { (eval echo configure:15475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15475   rm -rf conftest*
15476   eval "ac_cv_func_cthread_fork=yes"
15477 else
15478   echo "configure: failed program was:" >&5
15479   cat conftest.$ac_ext >&5
15480   rm -rf conftest*
15481   eval "ac_cv_func_cthread_fork=no"
15482 fi
15483 rm -f conftest*
15484 fi
15485
15486 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
15487   echo "$ac_t""yes" 1>&6
15488   ol_link_threads=yes
15489 else
15490   echo "$ac_t""no" 1>&6
15491 fi
15492
15493                 LIBS="$save_LIBS"
15494
15495                 if test $ol_link_threads = yes ; then
15496                         LTHREAD_LIBS="-lthreads"
15497                         ol_link_threads=mach
15498                         ol_with_threads=found
15499                 else
15500                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
15501                 fi
15502
15503         elif test $ol_with_threads = mach ; then
15504                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
15505         fi
15506
15507         if test $ol_link_threads = mach ; then
15508                 cat >> confdefs.h <<\EOF
15509 #define HAVE_MACH_CTHREADS 1
15510 EOF
15511
15512         elif test $ol_with_threads = found ; then
15513                 { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
15514         fi
15515 fi
15516
15517 if test $ol_with_threads = auto -o $ol_with_threads = yes \
15518         -o $ol_with_threads = pth ; then
15519
15520         for ac_hdr in pth.h
15521 do
15522 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15523 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15524 echo "configure:15525: checking for $ac_hdr" >&5
15525 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15526   echo $ac_n "(cached) $ac_c" 1>&6
15527 else
15528   cat > conftest.$ac_ext <<EOF
15529 #line 15530 "configure"
15530 #include "confdefs.h"
15531 #include <$ac_hdr>
15532 EOF
15533 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15534 { (eval echo configure:15535: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15535 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15536 if test -z "$ac_err"; then
15537   rm -rf conftest*
15538   eval "ac_cv_header_$ac_safe=yes"
15539 else
15540   echo "$ac_err" >&5
15541   echo "configure: failed program was:" >&5
15542   cat conftest.$ac_ext >&5
15543   rm -rf conftest*
15544   eval "ac_cv_header_$ac_safe=no"
15545 fi
15546 rm -f conftest*
15547 fi
15548 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15549   echo "$ac_t""yes" 1>&6
15550     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15551   cat >> confdefs.h <<EOF
15552 #define $ac_tr_hdr 1
15553 EOF
15554  
15555 else
15556   echo "$ac_t""no" 1>&6
15557 fi
15558 done
15559
15560
15561         if test $ac_cv_header_pth_h = yes ; then
15562                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
15563 echo "configure:15564: checking for pth_version in -lpth" >&5
15564 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
15565 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15566   echo $ac_n "(cached) $ac_c" 1>&6
15567 else
15568   ac_save_LIBS="$LIBS"
15569 LIBS="-lpth  $LIBS"
15570 cat > conftest.$ac_ext <<EOF
15571 #line 15572 "configure"
15572 #include "confdefs.h"
15573 /* Override any gcc2 internal prototype to avoid an error.  */
15574 /* We use char because int might match the return type of a gcc2
15575     builtin and then its argument prototype would still apply.  */
15576 char pth_version();
15577
15578 int main() {
15579 pth_version()
15580 ; return 0; }
15581 EOF
15582 if { (eval echo configure:15583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15583   rm -rf conftest*
15584   eval "ac_cv_lib_$ac_lib_var=yes"
15585 else
15586   echo "configure: failed program was:" >&5
15587   cat conftest.$ac_ext >&5
15588   rm -rf conftest*
15589   eval "ac_cv_lib_$ac_lib_var=no"
15590 fi
15591 rm -f conftest*
15592 LIBS="$ac_save_LIBS"
15593
15594 fi
15595 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15596   echo "$ac_t""yes" 1>&6
15597   have_pth=yes
15598 else
15599   echo "$ac_t""no" 1>&6
15600 have_pth=no
15601 fi
15602
15603
15604                 if test $have_pth = yes ; then
15605                         cat >> confdefs.h <<\EOF
15606 #define HAVE_GNU_PTH 1
15607 EOF
15608
15609                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
15610                         ol_link_threads=pth
15611                         ol_with_threads=found
15612
15613                         if test $ol_with_yielding_select = auto ; then
15614                                 ol_with_yielding_select=yes
15615                         fi
15616                 fi
15617         fi
15618 fi
15619
15620 if test $ol_with_threads = auto -o $ol_with_threads = yes \
15621         -o $ol_with_threads = lwp ; then
15622
15623                 for ac_hdr in thread.h synch.h
15624 do
15625 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15626 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15627 echo "configure:15628: checking for $ac_hdr" >&5
15628 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15629   echo $ac_n "(cached) $ac_c" 1>&6
15630 else
15631   cat > conftest.$ac_ext <<EOF
15632 #line 15633 "configure"
15633 #include "confdefs.h"
15634 #include <$ac_hdr>
15635 EOF
15636 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15637 { (eval echo configure:15638: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15638 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15639 if test -z "$ac_err"; then
15640   rm -rf conftest*
15641   eval "ac_cv_header_$ac_safe=yes"
15642 else
15643   echo "$ac_err" >&5
15644   echo "configure: failed program was:" >&5
15645   cat conftest.$ac_ext >&5
15646   rm -rf conftest*
15647   eval "ac_cv_header_$ac_safe=no"
15648 fi
15649 rm -f conftest*
15650 fi
15651 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15652   echo "$ac_t""yes" 1>&6
15653     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15654   cat >> confdefs.h <<EOF
15655 #define $ac_tr_hdr 1
15656 EOF
15657  
15658 else
15659   echo "$ac_t""no" 1>&6
15660 fi
15661 done
15662
15663         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
15664                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
15665 echo "configure:15666: checking for thr_create in -lthread" >&5
15666 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
15667 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15668   echo $ac_n "(cached) $ac_c" 1>&6
15669 else
15670   ac_save_LIBS="$LIBS"
15671 LIBS="-lthread  $LIBS"
15672 cat > conftest.$ac_ext <<EOF
15673 #line 15674 "configure"
15674 #include "confdefs.h"
15675 /* Override any gcc2 internal prototype to avoid an error.  */
15676 /* We use char because int might match the return type of a gcc2
15677     builtin and then its argument prototype would still apply.  */
15678 char thr_create();
15679
15680 int main() {
15681 thr_create()
15682 ; return 0; }
15683 EOF
15684 if { (eval echo configure:15685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15685   rm -rf conftest*
15686   eval "ac_cv_lib_$ac_lib_var=yes"
15687 else
15688   echo "configure: failed program was:" >&5
15689   cat conftest.$ac_ext >&5
15690   rm -rf conftest*
15691   eval "ac_cv_lib_$ac_lib_var=no"
15692 fi
15693 rm -f conftest*
15694 LIBS="$ac_save_LIBS"
15695
15696 fi
15697 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15698   echo "$ac_t""yes" 1>&6
15699   have_thr=yes
15700 else
15701   echo "$ac_t""no" 1>&6
15702 have_thr=no
15703 fi
15704
15705
15706                 if test $have_thr = yes ; then
15707                         cat >> confdefs.h <<\EOF
15708 #define HAVE_THR 1
15709 EOF
15710
15711                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
15712                         ol_link_threads=thr
15713
15714                         if test $ol_with_yielding_select = auto ; then
15715                                 ol_with_yielding_select=yes
15716                         fi
15717
15718                                                 for ac_func in \
15719                                 thr_setconcurrency \
15720                                 thr_getconcurrency \
15721                         
15722 do
15723 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15724 echo "configure:15725: checking for $ac_func" >&5
15725 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15726   echo $ac_n "(cached) $ac_c" 1>&6
15727 else
15728   cat > conftest.$ac_ext <<EOF
15729 #line 15730 "configure"
15730 #include "confdefs.h"
15731 /* System header to define __stub macros and hopefully few prototypes,
15732     which can conflict with char $ac_func(); below.  */
15733 #include <assert.h>
15734 /* Override any gcc2 internal prototype to avoid an error.  */
15735 /* We use char because int might match the return type of a gcc2
15736     builtin and then its argument prototype would still apply.  */
15737 char $ac_func();
15738 char (*f)();
15739
15740 int main() {
15741
15742 /* The GNU C library defines this for functions which it implements
15743     to always fail with ENOSYS.  Some functions are actually named
15744     something starting with __ and the normal name is an alias.  */
15745 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15746 choke me
15747 #else
15748 f = $ac_func;
15749 #endif
15750
15751 ; return 0; }
15752 EOF
15753 if { (eval echo configure:15754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15754   rm -rf conftest*
15755   eval "ac_cv_func_$ac_func=yes"
15756 else
15757   echo "configure: failed program was:" >&5
15758   cat conftest.$ac_ext >&5
15759   rm -rf conftest*
15760   eval "ac_cv_func_$ac_func=no"
15761 fi
15762 rm -f conftest*
15763 fi
15764
15765 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15766   echo "$ac_t""yes" 1>&6
15767     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15768   cat >> confdefs.h <<EOF
15769 #define $ac_tr_func 1
15770 EOF
15771  
15772 else
15773   echo "$ac_t""no" 1>&6
15774 fi
15775 done
15776
15777                 fi
15778         fi
15779
15780                 for ac_hdr in lwp/lwp.h
15781 do
15782 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15783 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15784 echo "configure:15785: checking for $ac_hdr" >&5
15785 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15786   echo $ac_n "(cached) $ac_c" 1>&6
15787 else
15788   cat > conftest.$ac_ext <<EOF
15789 #line 15790 "configure"
15790 #include "confdefs.h"
15791 #include <$ac_hdr>
15792 EOF
15793 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15794 { (eval echo configure:15795: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15795 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15796 if test -z "$ac_err"; then
15797   rm -rf conftest*
15798   eval "ac_cv_header_$ac_safe=yes"
15799 else
15800   echo "$ac_err" >&5
15801   echo "configure: failed program was:" >&5
15802   cat conftest.$ac_ext >&5
15803   rm -rf conftest*
15804   eval "ac_cv_header_$ac_safe=no"
15805 fi
15806 rm -f conftest*
15807 fi
15808 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15809   echo "$ac_t""yes" 1>&6
15810     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15811   cat >> confdefs.h <<EOF
15812 #define $ac_tr_hdr 1
15813 EOF
15814  
15815 else
15816   echo "$ac_t""no" 1>&6
15817 fi
15818 done
15819
15820         if test $ac_cv_header_lwp_lwp_h = yes ; then
15821                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
15822 echo "configure:15823: checking for lwp_create in -llwp" >&5
15823 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
15824 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15825   echo $ac_n "(cached) $ac_c" 1>&6
15826 else
15827   ac_save_LIBS="$LIBS"
15828 LIBS="-llwp  $LIBS"
15829 cat > conftest.$ac_ext <<EOF
15830 #line 15831 "configure"
15831 #include "confdefs.h"
15832 /* Override any gcc2 internal prototype to avoid an error.  */
15833 /* We use char because int might match the return type of a gcc2
15834     builtin and then its argument prototype would still apply.  */
15835 char lwp_create();
15836
15837 int main() {
15838 lwp_create()
15839 ; return 0; }
15840 EOF
15841 if { (eval echo configure:15842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15842   rm -rf conftest*
15843   eval "ac_cv_lib_$ac_lib_var=yes"
15844 else
15845   echo "configure: failed program was:" >&5
15846   cat conftest.$ac_ext >&5
15847   rm -rf conftest*
15848   eval "ac_cv_lib_$ac_lib_var=no"
15849 fi
15850 rm -f conftest*
15851 LIBS="$ac_save_LIBS"
15852
15853 fi
15854 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15855   echo "$ac_t""yes" 1>&6
15856   have_lwp=yes
15857 else
15858   echo "$ac_t""no" 1>&6
15859 have_lwp=no
15860 fi
15861
15862
15863                 if test $have_lwp = yes ; then
15864                         cat >> confdefs.h <<\EOF
15865 #define HAVE_LWP 1
15866 EOF
15867
15868                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
15869                         ol_link_threads=lwp
15870
15871                         if test $ol_with_yielding_select = auto ; then
15872                                 ol_with_yielding_select=no
15873                         fi
15874                 fi
15875         fi
15876 fi
15877
15878 if test $ol_with_yielding_select = yes ; then
15879         cat >> confdefs.h <<\EOF
15880 #define HAVE_YIELDING_SELECT 1
15881 EOF
15882
15883 fi
15884
15885 if test $ol_with_threads = manual ; then
15886                 ol_link_threads=yes
15887
15888         echo "configure: warning: thread defines and link options must be set manually" 1>&2
15889
15890         for ac_hdr in pthread.h sched.h
15891 do
15892 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15893 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15894 echo "configure:15895: checking for $ac_hdr" >&5
15895 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15896   echo $ac_n "(cached) $ac_c" 1>&6
15897 else
15898   cat > conftest.$ac_ext <<EOF
15899 #line 15900 "configure"
15900 #include "confdefs.h"
15901 #include <$ac_hdr>
15902 EOF
15903 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15904 { (eval echo configure:15905: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15905 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15906 if test -z "$ac_err"; then
15907   rm -rf conftest*
15908   eval "ac_cv_header_$ac_safe=yes"
15909 else
15910   echo "$ac_err" >&5
15911   echo "configure: failed program was:" >&5
15912   cat conftest.$ac_ext >&5
15913   rm -rf conftest*
15914   eval "ac_cv_header_$ac_safe=no"
15915 fi
15916 rm -f conftest*
15917 fi
15918 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15919   echo "$ac_t""yes" 1>&6
15920     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15921   cat >> confdefs.h <<EOF
15922 #define $ac_tr_hdr 1
15923 EOF
15924  
15925 else
15926   echo "$ac_t""no" 1>&6
15927 fi
15928 done
15929
15930         for ac_func in sched_yield pthread_yield
15931 do
15932 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15933 echo "configure:15934: checking for $ac_func" >&5
15934 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15935   echo $ac_n "(cached) $ac_c" 1>&6
15936 else
15937   cat > conftest.$ac_ext <<EOF
15938 #line 15939 "configure"
15939 #include "confdefs.h"
15940 /* System header to define __stub macros and hopefully few prototypes,
15941     which can conflict with char $ac_func(); below.  */
15942 #include <assert.h>
15943 /* Override any gcc2 internal prototype to avoid an error.  */
15944 /* We use char because int might match the return type of a gcc2
15945     builtin and then its argument prototype would still apply.  */
15946 char $ac_func();
15947 char (*f)();
15948
15949 int main() {
15950
15951 /* The GNU C library defines this for functions which it implements
15952     to always fail with ENOSYS.  Some functions are actually named
15953     something starting with __ and the normal name is an alias.  */
15954 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15955 choke me
15956 #else
15957 f = $ac_func;
15958 #endif
15959
15960 ; return 0; }
15961 EOF
15962 if { (eval echo configure:15963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15963   rm -rf conftest*
15964   eval "ac_cv_func_$ac_func=yes"
15965 else
15966   echo "configure: failed program was:" >&5
15967   cat conftest.$ac_ext >&5
15968   rm -rf conftest*
15969   eval "ac_cv_func_$ac_func=no"
15970 fi
15971 rm -f conftest*
15972 fi
15973
15974 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15975   echo "$ac_t""yes" 1>&6
15976     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15977   cat >> confdefs.h <<EOF
15978 #define $ac_tr_func 1
15979 EOF
15980  
15981 else
15982   echo "$ac_t""no" 1>&6
15983 fi
15984 done
15985
15986         
15987         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
15988 echo "configure:15989: checking for LinuxThreads pthread.h" >&5
15989 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
15990   echo $ac_n "(cached) $ac_c" 1>&6
15991 else
15992   cat > conftest.$ac_ext <<EOF
15993 #line 15994 "configure"
15994 #include "confdefs.h"
15995 #include <pthread.h>
15996 EOF
15997 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15998   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
15999   rm -rf conftest*
16000   ol_cv_header_linux_threads=yes
16001 else
16002   rm -rf conftest*
16003   ol_cv_header_linux_threads=no
16004 fi
16005 rm -f conftest*
16006
16007                 
16008 fi
16009
16010 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
16011         if test $ol_cv_header_linux_threads = yes; then
16012                 cat >> confdefs.h <<\EOF
16013 #define HAVE_LINUX_THREADS 1
16014 EOF
16015
16016         fi
16017
16018
16019         for ac_hdr in mach/cthreads.h
16020 do
16021 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16022 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16023 echo "configure:16024: checking for $ac_hdr" >&5
16024 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16025   echo $ac_n "(cached) $ac_c" 1>&6
16026 else
16027   cat > conftest.$ac_ext <<EOF
16028 #line 16029 "configure"
16029 #include "confdefs.h"
16030 #include <$ac_hdr>
16031 EOF
16032 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16033 { (eval echo configure:16034: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16034 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16035 if test -z "$ac_err"; then
16036   rm -rf conftest*
16037   eval "ac_cv_header_$ac_safe=yes"
16038 else
16039   echo "$ac_err" >&5
16040   echo "configure: failed program was:" >&5
16041   cat conftest.$ac_ext >&5
16042   rm -rf conftest*
16043   eval "ac_cv_header_$ac_safe=no"
16044 fi
16045 rm -f conftest*
16046 fi
16047 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16048   echo "$ac_t""yes" 1>&6
16049     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16050   cat >> confdefs.h <<EOF
16051 #define $ac_tr_hdr 1
16052 EOF
16053  
16054 else
16055   echo "$ac_t""no" 1>&6
16056 fi
16057 done
16058
16059         for ac_hdr in lwp/lwp.h
16060 do
16061 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16062 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16063 echo "configure:16064: checking for $ac_hdr" >&5
16064 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16065   echo $ac_n "(cached) $ac_c" 1>&6
16066 else
16067   cat > conftest.$ac_ext <<EOF
16068 #line 16069 "configure"
16069 #include "confdefs.h"
16070 #include <$ac_hdr>
16071 EOF
16072 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16073 { (eval echo configure:16074: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16074 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16075 if test -z "$ac_err"; then
16076   rm -rf conftest*
16077   eval "ac_cv_header_$ac_safe=yes"
16078 else
16079   echo "$ac_err" >&5
16080   echo "configure: failed program was:" >&5
16081   cat conftest.$ac_ext >&5
16082   rm -rf conftest*
16083   eval "ac_cv_header_$ac_safe=no"
16084 fi
16085 rm -f conftest*
16086 fi
16087 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16088   echo "$ac_t""yes" 1>&6
16089     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16090   cat >> confdefs.h <<EOF
16091 #define $ac_tr_hdr 1
16092 EOF
16093  
16094 else
16095   echo "$ac_t""no" 1>&6
16096 fi
16097 done
16098
16099         for ac_hdr in thread.h synch.h
16100 do
16101 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16102 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16103 echo "configure:16104: checking for $ac_hdr" >&5
16104 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16105   echo $ac_n "(cached) $ac_c" 1>&6
16106 else
16107   cat > conftest.$ac_ext <<EOF
16108 #line 16109 "configure"
16109 #include "confdefs.h"
16110 #include <$ac_hdr>
16111 EOF
16112 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16113 { (eval echo configure:16114: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16114 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16115 if test -z "$ac_err"; then
16116   rm -rf conftest*
16117   eval "ac_cv_header_$ac_safe=yes"
16118 else
16119   echo "$ac_err" >&5
16120   echo "configure: failed program was:" >&5
16121   cat conftest.$ac_ext >&5
16122   rm -rf conftest*
16123   eval "ac_cv_header_$ac_safe=no"
16124 fi
16125 rm -f conftest*
16126 fi
16127 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16128   echo "$ac_t""yes" 1>&6
16129     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16130   cat >> confdefs.h <<EOF
16131 #define $ac_tr_hdr 1
16132 EOF
16133  
16134 else
16135   echo "$ac_t""no" 1>&6
16136 fi
16137 done
16138
16139 fi
16140
16141 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
16142                         cat >> confdefs.h <<\EOF
16143 #define REENTRANT 1
16144 EOF
16145
16146         cat >> confdefs.h <<\EOF
16147 #define _REENTRANT 1
16148 EOF
16149
16150         cat >> confdefs.h <<\EOF
16151 #define THREAD_SAFE 1
16152 EOF
16153
16154         cat >> confdefs.h <<\EOF
16155 #define _THREAD_SAFE 1
16156 EOF
16157
16158         cat >> confdefs.h <<\EOF
16159 #define THREADSAFE 1
16160 EOF
16161
16162         cat >> confdefs.h <<\EOF
16163 #define _THREADSAFE 1
16164 EOF
16165
16166         cat >> confdefs.h <<\EOF
16167 #define _SGI_MP_SOURCE 1
16168 EOF
16169
16170
16171                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
16172 echo "configure:16173: checking for thread specific errno" >&5
16173 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
16174   echo $ac_n "(cached) $ac_c" 1>&6
16175 else
16176   
16177                 cat > conftest.$ac_ext <<EOF
16178 #line 16179 "configure"
16179 #include "confdefs.h"
16180 #include <errno.h>
16181 int main() {
16182 errno = 0;
16183 ; return 0; }
16184 EOF
16185 if { (eval echo configure:16186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16186   rm -rf conftest*
16187   ol_cv_errno_thread_specific=yes
16188 else
16189   echo "configure: failed program was:" >&5
16190   cat conftest.$ac_ext >&5
16191   rm -rf conftest*
16192   ol_cv_errno_thread_specific=no
16193 fi
16194 rm -f conftest*
16195         
16196 fi
16197
16198 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
16199
16200                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
16201 echo "configure:16202: checking for thread specific h_errno" >&5
16202 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
16203   echo $ac_n "(cached) $ac_c" 1>&6
16204 else
16205   
16206                 cat > conftest.$ac_ext <<EOF
16207 #line 16208 "configure"
16208 #include "confdefs.h"
16209 #include <netdb.h>
16210 int main() {
16211 h_errno = 0;
16212 ; return 0; }
16213 EOF
16214 if { (eval echo configure:16215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16215   rm -rf conftest*
16216   ol_cv_h_errno_thread_specific=yes
16217 else
16218   echo "configure: failed program was:" >&5
16219   cat conftest.$ac_ext >&5
16220   rm -rf conftest*
16221   ol_cv_h_errno_thread_specific=no
16222 fi
16223 rm -f conftest*
16224         
16225 fi
16226
16227 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
16228
16229         if test $ol_cv_errno_thread_specific != yes \
16230                 -o $ol_cv_h_errno_thread_specific != yes ; then
16231                 LIBS="$LTHREAD_LIBS $LIBS"
16232                 LTHREAD_LIBS=""
16233         fi
16234
16235 fi  
16236
16237 if test $ol_link_threads = no ; then
16238         if test $ol_with_threads = yes ; then
16239                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
16240         fi
16241
16242         if test $ol_with_threads = auto ; then
16243                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
16244                 ol_with_threads=no
16245         fi
16246
16247         cat >> confdefs.h <<\EOF
16248 #define NO_THREADS 1
16249 EOF
16250
16251         LTHREAD_LIBS=""
16252 fi
16253
16254 if test $ol_link_threads != no ; then
16255         cat >> confdefs.h <<\EOF
16256 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
16257 EOF
16258
16259 fi
16260
16261 for ac_func in \
16262         ctime_r                 \
16263         gethostbyname_r gethostbyaddr_r \
16264
16265 do
16266 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16267 echo "configure:16268: checking for $ac_func" >&5
16268 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16269   echo $ac_n "(cached) $ac_c" 1>&6
16270 else
16271   cat > conftest.$ac_ext <<EOF
16272 #line 16273 "configure"
16273 #include "confdefs.h"
16274 /* System header to define __stub macros and hopefully few prototypes,
16275     which can conflict with char $ac_func(); below.  */
16276 #include <assert.h>
16277 /* Override any gcc2 internal prototype to avoid an error.  */
16278 /* We use char because int might match the return type of a gcc2
16279     builtin and then its argument prototype would still apply.  */
16280 char $ac_func();
16281 char (*f)();
16282
16283 int main() {
16284
16285 /* The GNU C library defines this for functions which it implements
16286     to always fail with ENOSYS.  Some functions are actually named
16287     something starting with __ and the normal name is an alias.  */
16288 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16289 choke me
16290 #else
16291 f = $ac_func;
16292 #endif
16293
16294 ; return 0; }
16295 EOF
16296 if { (eval echo configure:16297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16297   rm -rf conftest*
16298   eval "ac_cv_func_$ac_func=yes"
16299 else
16300   echo "configure: failed program was:" >&5
16301   cat conftest.$ac_ext >&5
16302   rm -rf conftest*
16303   eval "ac_cv_func_$ac_func=no"
16304 fi
16305 rm -f conftest*
16306 fi
16307
16308 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16309   echo "$ac_t""yes" 1>&6
16310     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16311   cat >> confdefs.h <<EOF
16312 #define $ac_tr_func 1
16313 EOF
16314  
16315 else
16316   echo "$ac_t""no" 1>&6
16317 fi
16318 done
16319
16320
16321 if test "$ac_cv_func_ctime_r" = no ; then
16322         ol_cv_func_ctime_r_nargs=0
16323 else
16324         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
16325 echo "configure:16326: checking number of arguments of ctime_r" >&5
16326 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
16327   echo $ac_n "(cached) $ac_c" 1>&6
16328 else
16329   cat > conftest.$ac_ext <<EOF
16330 #line 16331 "configure"
16331 #include "confdefs.h"
16332 #include <time.h>
16333 int main() {
16334 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
16335 ; return 0; }
16336 EOF
16337 if { (eval echo configure:16338: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16338   rm -rf conftest*
16339   ol_cv_func_ctime_r_nargs3=yes
16340 else
16341   echo "configure: failed program was:" >&5
16342   cat conftest.$ac_ext >&5
16343   rm -rf conftest*
16344   ol_cv_func_ctime_r_nargs3=no
16345 fi
16346 rm -f conftest*
16347
16348         cat > conftest.$ac_ext <<EOF
16349 #line 16350 "configure"
16350 #include "confdefs.h"
16351 #include <time.h>
16352 int main() {
16353 time_t ti; char *buffer; ctime_r(&ti,buffer);
16354 ; return 0; }
16355 EOF
16356 if { (eval echo configure:16357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16357   rm -rf conftest*
16358   ol_cv_func_ctime_r_nargs2=yes
16359 else
16360   echo "configure: failed program was:" >&5
16361   cat conftest.$ac_ext >&5
16362   rm -rf conftest*
16363   ol_cv_func_ctime_r_nargs2=no
16364 fi
16365 rm -f conftest*
16366
16367         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
16368                 $ol_cv_func_ctime_r_nargs2 = no ; then
16369
16370                 ol_cv_func_ctime_r_nargs=3
16371
16372         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
16373                 $ol_cv_func_ctime_r_nargs2 = yes ; then
16374
16375                 ol_cv_func_ctime_r_nargs=2
16376
16377         else
16378                 ol_cv_func_ctime_r_nargs=0
16379         fi
16380   
16381 fi
16382
16383 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
16384
16385   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
16386         cat >> confdefs.h <<EOF
16387 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
16388 EOF
16389
16390   fi
16391
16392 fi
16393
16394 if test "$ac_cv_func_gethostbyname_r" = yes ; then
16395         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
16396 echo "configure:16397: checking number of arguments of gethostbyname_r" >&5
16397 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
16398   echo $ac_n "(cached) $ac_c" 1>&6
16399 else
16400   cat > conftest.$ac_ext <<EOF
16401 #line 16402 "configure"
16402 #include "confdefs.h"
16403 #include <sys/types.h>
16404 #include <sys/socket.h>
16405 #include <netinet/in.h>
16406 #include <netdb.h>
16407 #define BUFSIZE (sizeof(struct hostent)+10)
16408 int main() {
16409 struct hostent hent; char buffer[BUFSIZE];
16410                 int bufsize=BUFSIZE;int h_errno;
16411                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
16412                         buffer, bufsize, &h_errno);
16413 ; return 0; }
16414 EOF
16415 if { (eval echo configure:16416: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16416   rm -rf conftest*
16417   ol_cv_func_gethostbyname_r_nargs5=yes
16418 else
16419   echo "configure: failed program was:" >&5
16420   cat conftest.$ac_ext >&5
16421   rm -rf conftest*
16422   ol_cv_func_gethostbyname_r_nargs5=no
16423 fi
16424 rm -f conftest*
16425
16426         cat > conftest.$ac_ext <<EOF
16427 #line 16428 "configure"
16428 #include "confdefs.h"
16429 #include <sys/types.h>
16430 #include <sys/socket.h>
16431 #include <netinet/in.h>
16432 #include <netdb.h>
16433 #define BUFSIZE (sizeof(struct hostent)+10)
16434 int main() {
16435 struct hostent hent;struct hostent *rhent;
16436                 char buffer[BUFSIZE];
16437                 int bufsize=BUFSIZE;int h_errno;
16438                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
16439                         &rhent, &h_errno);
16440 ; return 0; }
16441 EOF
16442 if { (eval echo configure:16443: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16443   rm -rf conftest*
16444   ol_cv_func_gethostbyname_r_nargs6=yes
16445 else
16446   echo "configure: failed program was:" >&5
16447   cat conftest.$ac_ext >&5
16448   rm -rf conftest*
16449   ol_cv_func_gethostbyname_r_nargs6=no
16450 fi
16451 rm -f conftest*
16452
16453         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
16454                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
16455
16456                 ol_cv_func_gethostbyname_r_nargs=5
16457
16458         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
16459                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
16460
16461                 ol_cv_func_gethostbyname_r_nargs=6
16462
16463         else
16464                 ol_cv_func_gethostbyname_r_nargs=0
16465         fi
16466   
16467 fi
16468
16469 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
16470   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
16471         cat >> confdefs.h <<EOF
16472 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
16473 EOF
16474
16475   fi
16476
16477 else
16478         ol_cv_func_gethostbyname_r_nargs=0
16479 fi
16480  
16481 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
16482         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
16483 echo "configure:16484: checking number of arguments of gethostbyaddr_r" >&5
16484 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
16485   echo $ac_n "(cached) $ac_c" 1>&6
16486 else
16487   cat > conftest.$ac_ext <<EOF
16488 #line 16489 "configure"
16489 #include "confdefs.h"
16490 #include <sys/types.h>
16491 #include <sys/socket.h>
16492 #include <netinet/in.h>
16493 #include <netdb.h>
16494 #define BUFSIZE (sizeof(struct hostent)+10)
16495 int main() {
16496 struct hostent hent; char buffer[BUFSIZE]; 
16497             struct in_addr add;
16498             size_t alen=sizeof(struct in_addr);
16499             int bufsize=BUFSIZE;int h_errno;
16500                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
16501                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
16502 ; return 0; }
16503 EOF
16504 if { (eval echo configure:16505: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16505   rm -rf conftest*
16506   ol_cv_func_gethostbyaddr_r_nargs7=yes
16507 else
16508   echo "configure: failed program was:" >&5
16509   cat conftest.$ac_ext >&5
16510   rm -rf conftest*
16511   ol_cv_func_gethostbyaddr_r_nargs7=no
16512 fi
16513 rm -f conftest*
16514
16515         cat > conftest.$ac_ext <<EOF
16516 #line 16517 "configure"
16517 #include "confdefs.h"
16518 #include <sys/types.h>
16519 #include <sys/socket.h>
16520 #include <netinet/in.h>
16521 #include <netdb.h>
16522 #define BUFSIZE (sizeof(struct hostent)+10)
16523 int main() {
16524 struct hostent hent;
16525                 struct hostent *rhent; char buffer[BUFSIZE]; 
16526                 struct in_addr add;
16527                 size_t alen=sizeof(struct in_addr);
16528                 int bufsize=BUFSIZE;int h_errno;
16529                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
16530                         alen, AF_INET, &hent, buffer, bufsize, 
16531                         &rhent, &h_errno);
16532 ; return 0; }
16533 EOF
16534 if { (eval echo configure:16535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16535   rm -rf conftest*
16536   ol_cv_func_gethostbyaddr_r_nargs8=yes
16537 else
16538   echo "configure: failed program was:" >&5
16539   cat conftest.$ac_ext >&5
16540   rm -rf conftest*
16541   ol_cv_func_gethostbyaddr_r_nargs8=no
16542 fi
16543 rm -f conftest*
16544
16545         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
16546                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
16547
16548                 ol_cv_func_gethostbyaddr_r_nargs=7
16549
16550         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
16551                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
16552
16553                 ol_cv_func_gethostbyaddr_r_nargs=8
16554
16555         else
16556                 ol_cv_func_gethostbyaddr_r_nargs=0
16557         fi
16558   
16559 fi
16560
16561 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
16562   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
16563     cat >> confdefs.h <<EOF
16564 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
16565 EOF
16566
16567   fi
16568
16569 else
16570         ol_cv_func_gethostbyaddr_r_nargs=0
16571 fi
16572
16573 ol_link_ldbm=no 
16574
16575 if test $ol_with_ldbm_api = auto \
16576         -o $ol_with_ldbm_api = berkeley \
16577         -o $ol_with_ldbm_api = bcompat ; then
16578
16579         if test $ol_with_ldbm_api = bcompat; then \
16580                 for ac_hdr in db_185.h db.h
16581 do
16582 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16583 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16584 echo "configure:16585: checking for $ac_hdr" >&5
16585 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16586   echo $ac_n "(cached) $ac_c" 1>&6
16587 else
16588   cat > conftest.$ac_ext <<EOF
16589 #line 16590 "configure"
16590 #include "confdefs.h"
16591 #include <$ac_hdr>
16592 EOF
16593 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16594 { (eval echo configure:16595: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16595 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16596 if test -z "$ac_err"; then
16597   rm -rf conftest*
16598   eval "ac_cv_header_$ac_safe=yes"
16599 else
16600   echo "$ac_err" >&5
16601   echo "configure: failed program was:" >&5
16602   cat conftest.$ac_ext >&5
16603   rm -rf conftest*
16604   eval "ac_cv_header_$ac_safe=no"
16605 fi
16606 rm -f conftest*
16607 fi
16608 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16609   echo "$ac_t""yes" 1>&6
16610     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16611   cat >> confdefs.h <<EOF
16612 #define $ac_tr_hdr 1
16613 EOF
16614  
16615 else
16616   echo "$ac_t""no" 1>&6
16617 fi
16618 done
16619
16620 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
16621         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
16622 echo "configure:16623: checking if Berkeley DB header compatibility" >&5
16623 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
16624   echo $ac_n "(cached) $ac_c" 1>&6
16625 else
16626   
16627                 cat > conftest.$ac_ext <<EOF
16628 #line 16629 "configure"
16629 #include "confdefs.h"
16630
16631 #if HAVE_DB_185_H
16632 #       include <db_185.h>
16633 #else
16634 #       include <db.h>
16635 #endif
16636
16637  /* this check could be improved */
16638 #ifndef DB_VERSION_MAJOR
16639 #       define DB_VERSION_MAJOR 1
16640 #endif
16641
16642 #if DB_VERSION_MAJOR == 1 
16643         __db_version_1
16644 #endif
16645
16646 EOF
16647 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16648   egrep "__db_version_1" >/dev/null 2>&1; then
16649   rm -rf conftest*
16650   ol_cv_header_db1=yes
16651 else
16652   rm -rf conftest*
16653   ol_cv_header_db1=no
16654 fi
16655 rm -f conftest*
16656
16657 fi
16658
16659 echo "$ac_t""$ol_cv_header_db1" 1>&6
16660
16661         if test $ol_cv_header_db1 = yes ; then
16662                 ol_cv_lib_db=no
16663 if test $ol_cv_lib_db = no ; then
16664         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
16665 echo "configure:16666: checking for Berkeley DB link (default)" >&5
16666 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
16667   echo $ac_n "(cached) $ac_c" 1>&6
16668 else
16669   
16670         ol_DB_LIB=
16671         ol_LIBS=$LIBS
16672         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16673
16674         cat > conftest.$ac_ext <<EOF
16675 #line 16676 "configure"
16676 #include "confdefs.h"
16677
16678 #ifdef HAVE_DB_185_H
16679 # include <db_185.h>
16680 #else
16681 # include <db.h>
16682 #endif
16683
16684 #ifndef DB_VERSION_MAJOR
16685 # define DB_VERSION_MAJOR 1
16686 #endif
16687
16688 #ifndef NULL
16689 #define NULL ((void*)0)
16690 #endif
16691
16692 int main() {
16693
16694 #if DB_VERSION_MAJOR > 1
16695         {
16696                 char *version;
16697                 int major, minor, patch;
16698
16699                 version = db_version( &major, &minor, &patch );
16700
16701                 if( major != DB_VERSION_MAJOR ||
16702                         minor < DB_VERSION_MINOR )
16703                 {
16704                         printf("Berkeley DB version mismatch\n"
16705                                 "\texpected: %s\n\tgot: %s\n",
16706                                 DB_VERSION_STRING, version);
16707                         return 1;
16708                 }
16709         }
16710 #endif
16711
16712 #if DB_VERSION_MAJOR > 2
16713         db_env_create( NULL, 0 );
16714 #elif DB_VERSION_MAJOR > 1
16715         db_appexit( NULL );
16716 #else
16717         (void) dbopen( NULL, 0, 0, 0, NULL);
16718 #endif
16719
16720 ; return 0; }
16721 EOF
16722 if { (eval echo configure:16723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16723   rm -rf conftest*
16724   ol_cv_db_none=yes
16725 else
16726   echo "configure: failed program was:" >&5
16727   cat conftest.$ac_ext >&5
16728   rm -rf conftest*
16729   ol_cv_db_none=no
16730 fi
16731 rm -f conftest*
16732
16733         LIBS="$ol_LIBS"
16734
16735 fi
16736
16737 echo "$ac_t""$ol_cv_db_none" 1>&6
16738
16739         if test $ol_cv_db_none = yes ; then
16740                 ol_cv_lib_db=yes
16741         fi
16742 fi
16743
16744 if test $ol_cv_lib_db = no ; then
16745         echo $ac_n "checking for Berkeley DB link (-ldb41)""... $ac_c" 1>&6
16746 echo "configure:16747: checking for Berkeley DB link (-ldb41)" >&5
16747 if eval "test \"\${ol_cv_db_db41+set}\" = set"; then
16748   echo $ac_n "(cached) $ac_c" 1>&6
16749 else
16750   
16751         ol_DB_LIB=-ldb41
16752         ol_LIBS=$LIBS
16753         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16754
16755         cat > conftest.$ac_ext <<EOF
16756 #line 16757 "configure"
16757 #include "confdefs.h"
16758
16759 #ifdef HAVE_DB_185_H
16760 # include <db_185.h>
16761 #else
16762 # include <db.h>
16763 #endif
16764
16765 #ifndef DB_VERSION_MAJOR
16766 # define DB_VERSION_MAJOR 1
16767 #endif
16768
16769 #ifndef NULL
16770 #define NULL ((void*)0)
16771 #endif
16772
16773 int main() {
16774
16775 #if DB_VERSION_MAJOR > 1
16776         {
16777                 char *version;
16778                 int major, minor, patch;
16779
16780                 version = db_version( &major, &minor, &patch );
16781
16782                 if( major != DB_VERSION_MAJOR ||
16783                         minor < DB_VERSION_MINOR )
16784                 {
16785                         printf("Berkeley DB version mismatch\n"
16786                                 "\texpected: %s\n\tgot: %s\n",
16787                                 DB_VERSION_STRING, version);
16788                         return 1;
16789                 }
16790         }
16791 #endif
16792
16793 #if DB_VERSION_MAJOR > 2
16794         db_env_create( NULL, 0 );
16795 #elif DB_VERSION_MAJOR > 1
16796         db_appexit( NULL );
16797 #else
16798         (void) dbopen( NULL, 0, 0, 0, NULL);
16799 #endif
16800
16801 ; return 0; }
16802 EOF
16803 if { (eval echo configure:16804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16804   rm -rf conftest*
16805   ol_cv_db_db41=yes
16806 else
16807   echo "configure: failed program was:" >&5
16808   cat conftest.$ac_ext >&5
16809   rm -rf conftest*
16810   ol_cv_db_db41=no
16811 fi
16812 rm -f conftest*
16813
16814         LIBS="$ol_LIBS"
16815
16816 fi
16817
16818 echo "$ac_t""$ol_cv_db_db41" 1>&6
16819
16820         if test $ol_cv_db_db41 = yes ; then
16821                 ol_cv_lib_db=-ldb41
16822         fi
16823 fi
16824
16825 if test $ol_cv_lib_db = no ; then
16826         echo $ac_n "checking for Berkeley DB link (-ldb-41)""... $ac_c" 1>&6
16827 echo "configure:16828: checking for Berkeley DB link (-ldb-41)" >&5
16828 if eval "test \"\${ol_cv_db_db_41+set}\" = set"; then
16829   echo $ac_n "(cached) $ac_c" 1>&6
16830 else
16831   
16832         ol_DB_LIB=-ldb-41
16833         ol_LIBS=$LIBS
16834         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16835
16836         cat > conftest.$ac_ext <<EOF
16837 #line 16838 "configure"
16838 #include "confdefs.h"
16839
16840 #ifdef HAVE_DB_185_H
16841 # include <db_185.h>
16842 #else
16843 # include <db.h>
16844 #endif
16845
16846 #ifndef DB_VERSION_MAJOR
16847 # define DB_VERSION_MAJOR 1
16848 #endif
16849
16850 #ifndef NULL
16851 #define NULL ((void*)0)
16852 #endif
16853
16854 int main() {
16855
16856 #if DB_VERSION_MAJOR > 1
16857         {
16858                 char *version;
16859                 int major, minor, patch;
16860
16861                 version = db_version( &major, &minor, &patch );
16862
16863                 if( major != DB_VERSION_MAJOR ||
16864                         minor < DB_VERSION_MINOR )
16865                 {
16866                         printf("Berkeley DB version mismatch\n"
16867                                 "\texpected: %s\n\tgot: %s\n",
16868                                 DB_VERSION_STRING, version);
16869                         return 1;
16870                 }
16871         }
16872 #endif
16873
16874 #if DB_VERSION_MAJOR > 2
16875         db_env_create( NULL, 0 );
16876 #elif DB_VERSION_MAJOR > 1
16877         db_appexit( NULL );
16878 #else
16879         (void) dbopen( NULL, 0, 0, 0, NULL);
16880 #endif
16881
16882 ; return 0; }
16883 EOF
16884 if { (eval echo configure:16885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16885   rm -rf conftest*
16886   ol_cv_db_db_41=yes
16887 else
16888   echo "configure: failed program was:" >&5
16889   cat conftest.$ac_ext >&5
16890   rm -rf conftest*
16891   ol_cv_db_db_41=no
16892 fi
16893 rm -f conftest*
16894
16895         LIBS="$ol_LIBS"
16896
16897 fi
16898
16899 echo "$ac_t""$ol_cv_db_db_41" 1>&6
16900
16901         if test $ol_cv_db_db_41 = yes ; then
16902                 ol_cv_lib_db=-ldb-41
16903         fi
16904 fi
16905
16906 if test $ol_cv_lib_db = no ; then
16907         echo $ac_n "checking for Berkeley DB link (-ldb-4.1)""... $ac_c" 1>&6
16908 echo "configure:16909: checking for Berkeley DB link (-ldb-4.1)" >&5
16909 if eval "test \"\${ol_cv_db_db_4_dot_1+set}\" = set"; then
16910   echo $ac_n "(cached) $ac_c" 1>&6
16911 else
16912   
16913         ol_DB_LIB=-ldb-4.1
16914         ol_LIBS=$LIBS
16915         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16916
16917         cat > conftest.$ac_ext <<EOF
16918 #line 16919 "configure"
16919 #include "confdefs.h"
16920
16921 #ifdef HAVE_DB_185_H
16922 # include <db_185.h>
16923 #else
16924 # include <db.h>
16925 #endif
16926
16927 #ifndef DB_VERSION_MAJOR
16928 # define DB_VERSION_MAJOR 1
16929 #endif
16930
16931 #ifndef NULL
16932 #define NULL ((void*)0)
16933 #endif
16934
16935 int main() {
16936
16937 #if DB_VERSION_MAJOR > 1
16938         {
16939                 char *version;
16940                 int major, minor, patch;
16941
16942                 version = db_version( &major, &minor, &patch );
16943
16944                 if( major != DB_VERSION_MAJOR ||
16945                         minor < DB_VERSION_MINOR )
16946                 {
16947                         printf("Berkeley DB version mismatch\n"
16948                                 "\texpected: %s\n\tgot: %s\n",
16949                                 DB_VERSION_STRING, version);
16950                         return 1;
16951                 }
16952         }
16953 #endif
16954
16955 #if DB_VERSION_MAJOR > 2
16956         db_env_create( NULL, 0 );
16957 #elif DB_VERSION_MAJOR > 1
16958         db_appexit( NULL );
16959 #else
16960         (void) dbopen( NULL, 0, 0, 0, NULL);
16961 #endif
16962
16963 ; return 0; }
16964 EOF
16965 if { (eval echo configure:16966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16966   rm -rf conftest*
16967   ol_cv_db_db_4_dot_1=yes
16968 else
16969   echo "configure: failed program was:" >&5
16970   cat conftest.$ac_ext >&5
16971   rm -rf conftest*
16972   ol_cv_db_db_4_dot_1=no
16973 fi
16974 rm -f conftest*
16975
16976         LIBS="$ol_LIBS"
16977
16978 fi
16979
16980 echo "$ac_t""$ol_cv_db_db_4_dot_1" 1>&6
16981
16982         if test $ol_cv_db_db_4_dot_1 = yes ; then
16983                 ol_cv_lib_db=-ldb-4.1
16984         fi
16985 fi
16986
16987 if test $ol_cv_lib_db = no ; then
16988         echo $ac_n "checking for Berkeley DB link (-ldb-4-1)""... $ac_c" 1>&6
16989 echo "configure:16990: checking for Berkeley DB link (-ldb-4-1)" >&5
16990 if eval "test \"\${ol_cv_db_db_4_1+set}\" = set"; then
16991   echo $ac_n "(cached) $ac_c" 1>&6
16992 else
16993   
16994         ol_DB_LIB=-ldb-4-1
16995         ol_LIBS=$LIBS
16996         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16997
16998         cat > conftest.$ac_ext <<EOF
16999 #line 17000 "configure"
17000 #include "confdefs.h"
17001
17002 #ifdef HAVE_DB_185_H
17003 # include <db_185.h>
17004 #else
17005 # include <db.h>
17006 #endif
17007
17008 #ifndef DB_VERSION_MAJOR
17009 # define DB_VERSION_MAJOR 1
17010 #endif
17011
17012 #ifndef NULL
17013 #define NULL ((void*)0)
17014 #endif
17015
17016 int main() {
17017
17018 #if DB_VERSION_MAJOR > 1
17019         {
17020                 char *version;
17021                 int major, minor, patch;
17022
17023                 version = db_version( &major, &minor, &patch );
17024
17025                 if( major != DB_VERSION_MAJOR ||
17026                         minor < DB_VERSION_MINOR )
17027                 {
17028                         printf("Berkeley DB version mismatch\n"
17029                                 "\texpected: %s\n\tgot: %s\n",
17030                                 DB_VERSION_STRING, version);
17031                         return 1;
17032                 }
17033         }
17034 #endif
17035
17036 #if DB_VERSION_MAJOR > 2
17037         db_env_create( NULL, 0 );
17038 #elif DB_VERSION_MAJOR > 1
17039         db_appexit( NULL );
17040 #else
17041         (void) dbopen( NULL, 0, 0, 0, NULL);
17042 #endif
17043
17044 ; return 0; }
17045 EOF
17046 if { (eval echo configure:17047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17047   rm -rf conftest*
17048   ol_cv_db_db_4_1=yes
17049 else
17050   echo "configure: failed program was:" >&5
17051   cat conftest.$ac_ext >&5
17052   rm -rf conftest*
17053   ol_cv_db_db_4_1=no
17054 fi
17055 rm -f conftest*
17056
17057         LIBS="$ol_LIBS"
17058
17059 fi
17060
17061 echo "$ac_t""$ol_cv_db_db_4_1" 1>&6
17062
17063         if test $ol_cv_db_db_4_1 = yes ; then
17064                 ol_cv_lib_db=-ldb-4-1
17065         fi
17066 fi
17067
17068 if test $ol_cv_lib_db = no ; then
17069         echo $ac_n "checking for Berkeley DB link (-ldb-4)""... $ac_c" 1>&6
17070 echo "configure:17071: checking for Berkeley DB link (-ldb-4)" >&5
17071 if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then
17072   echo $ac_n "(cached) $ac_c" 1>&6
17073 else
17074   
17075         ol_DB_LIB=-ldb-4
17076         ol_LIBS=$LIBS
17077         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17078
17079         cat > conftest.$ac_ext <<EOF
17080 #line 17081 "configure"
17081 #include "confdefs.h"
17082
17083 #ifdef HAVE_DB_185_H
17084 # include <db_185.h>
17085 #else
17086 # include <db.h>
17087 #endif
17088
17089 #ifndef DB_VERSION_MAJOR
17090 # define DB_VERSION_MAJOR 1
17091 #endif
17092
17093 #ifndef NULL
17094 #define NULL ((void*)0)
17095 #endif
17096
17097 int main() {
17098
17099 #if DB_VERSION_MAJOR > 1
17100         {
17101                 char *version;
17102                 int major, minor, patch;
17103
17104                 version = db_version( &major, &minor, &patch );
17105
17106                 if( major != DB_VERSION_MAJOR ||
17107                         minor < DB_VERSION_MINOR )
17108                 {
17109                         printf("Berkeley DB version mismatch\n"
17110                                 "\texpected: %s\n\tgot: %s\n",
17111                                 DB_VERSION_STRING, version);
17112                         return 1;
17113                 }
17114         }
17115 #endif
17116
17117 #if DB_VERSION_MAJOR > 2
17118         db_env_create( NULL, 0 );
17119 #elif DB_VERSION_MAJOR > 1
17120         db_appexit( NULL );
17121 #else
17122         (void) dbopen( NULL, 0, 0, 0, NULL);
17123 #endif
17124
17125 ; return 0; }
17126 EOF
17127 if { (eval echo configure:17128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17128   rm -rf conftest*
17129   ol_cv_db_db_4=yes
17130 else
17131   echo "configure: failed program was:" >&5
17132   cat conftest.$ac_ext >&5
17133   rm -rf conftest*
17134   ol_cv_db_db_4=no
17135 fi
17136 rm -f conftest*
17137
17138         LIBS="$ol_LIBS"
17139
17140 fi
17141
17142 echo "$ac_t""$ol_cv_db_db_4" 1>&6
17143
17144         if test $ol_cv_db_db_4 = yes ; then
17145                 ol_cv_lib_db=-ldb-4
17146         fi
17147 fi
17148
17149 if test $ol_cv_lib_db = no ; then
17150         echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
17151 echo "configure:17152: checking for Berkeley DB link (-ldb4)" >&5
17152 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
17153   echo $ac_n "(cached) $ac_c" 1>&6
17154 else
17155   
17156         ol_DB_LIB=-ldb4
17157         ol_LIBS=$LIBS
17158         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17159
17160         cat > conftest.$ac_ext <<EOF
17161 #line 17162 "configure"
17162 #include "confdefs.h"
17163
17164 #ifdef HAVE_DB_185_H
17165 # include <db_185.h>
17166 #else
17167 # include <db.h>
17168 #endif
17169
17170 #ifndef DB_VERSION_MAJOR
17171 # define DB_VERSION_MAJOR 1
17172 #endif
17173
17174 #ifndef NULL
17175 #define NULL ((void*)0)
17176 #endif
17177
17178 int main() {
17179
17180 #if DB_VERSION_MAJOR > 1
17181         {
17182                 char *version;
17183                 int major, minor, patch;
17184
17185                 version = db_version( &major, &minor, &patch );
17186
17187                 if( major != DB_VERSION_MAJOR ||
17188                         minor < DB_VERSION_MINOR )
17189                 {
17190                         printf("Berkeley DB version mismatch\n"
17191                                 "\texpected: %s\n\tgot: %s\n",
17192                                 DB_VERSION_STRING, version);
17193                         return 1;
17194                 }
17195         }
17196 #endif
17197
17198 #if DB_VERSION_MAJOR > 2
17199         db_env_create( NULL, 0 );
17200 #elif DB_VERSION_MAJOR > 1
17201         db_appexit( NULL );
17202 #else
17203         (void) dbopen( NULL, 0, 0, 0, NULL);
17204 #endif
17205
17206 ; return 0; }
17207 EOF
17208 if { (eval echo configure:17209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17209   rm -rf conftest*
17210   ol_cv_db_db4=yes
17211 else
17212   echo "configure: failed program was:" >&5
17213   cat conftest.$ac_ext >&5
17214   rm -rf conftest*
17215   ol_cv_db_db4=no
17216 fi
17217 rm -f conftest*
17218
17219         LIBS="$ol_LIBS"
17220
17221 fi
17222
17223 echo "$ac_t""$ol_cv_db_db4" 1>&6
17224
17225         if test $ol_cv_db_db4 = yes ; then
17226                 ol_cv_lib_db=-ldb4
17227         fi
17228 fi
17229
17230 if test $ol_cv_lib_db = no ; then
17231         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
17232 echo "configure:17233: checking for Berkeley DB link (-ldb)" >&5
17233 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
17234   echo $ac_n "(cached) $ac_c" 1>&6
17235 else
17236   
17237         ol_DB_LIB=-ldb
17238         ol_LIBS=$LIBS
17239         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17240
17241         cat > conftest.$ac_ext <<EOF
17242 #line 17243 "configure"
17243 #include "confdefs.h"
17244
17245 #ifdef HAVE_DB_185_H
17246 # include <db_185.h>
17247 #else
17248 # include <db.h>
17249 #endif
17250
17251 #ifndef DB_VERSION_MAJOR
17252 # define DB_VERSION_MAJOR 1
17253 #endif
17254
17255 #ifndef NULL
17256 #define NULL ((void*)0)
17257 #endif
17258
17259 int main() {
17260
17261 #if DB_VERSION_MAJOR > 1
17262         {
17263                 char *version;
17264                 int major, minor, patch;
17265
17266                 version = db_version( &major, &minor, &patch );
17267
17268                 if( major != DB_VERSION_MAJOR ||
17269                         minor < DB_VERSION_MINOR )
17270                 {
17271                         printf("Berkeley DB version mismatch\n"
17272                                 "\texpected: %s\n\tgot: %s\n",
17273                                 DB_VERSION_STRING, version);
17274                         return 1;
17275                 }
17276         }
17277 #endif
17278
17279 #if DB_VERSION_MAJOR > 2
17280         db_env_create( NULL, 0 );
17281 #elif DB_VERSION_MAJOR > 1
17282         db_appexit( NULL );
17283 #else
17284         (void) dbopen( NULL, 0, 0, 0, NULL);
17285 #endif
17286
17287 ; return 0; }
17288 EOF
17289 if { (eval echo configure:17290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17290   rm -rf conftest*
17291   ol_cv_db_db=yes
17292 else
17293   echo "configure: failed program was:" >&5
17294   cat conftest.$ac_ext >&5
17295   rm -rf conftest*
17296   ol_cv_db_db=no
17297 fi
17298 rm -f conftest*
17299
17300         LIBS="$ol_LIBS"
17301
17302 fi
17303
17304 echo "$ac_t""$ol_cv_db_db" 1>&6
17305
17306         if test $ol_cv_db_db = yes ; then
17307                 ol_cv_lib_db=-ldb
17308         fi
17309 fi
17310
17311 if test $ol_cv_lib_db = no ; then
17312         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
17313 echo "configure:17314: checking for Berkeley DB link (-ldb3)" >&5
17314 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
17315   echo $ac_n "(cached) $ac_c" 1>&6
17316 else
17317   
17318         ol_DB_LIB=-ldb3
17319         ol_LIBS=$LIBS
17320         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17321
17322         cat > conftest.$ac_ext <<EOF
17323 #line 17324 "configure"
17324 #include "confdefs.h"
17325
17326 #ifdef HAVE_DB_185_H
17327 # include <db_185.h>
17328 #else
17329 # include <db.h>
17330 #endif
17331
17332 #ifndef DB_VERSION_MAJOR
17333 # define DB_VERSION_MAJOR 1
17334 #endif
17335
17336 #ifndef NULL
17337 #define NULL ((void*)0)
17338 #endif
17339
17340 int main() {
17341
17342 #if DB_VERSION_MAJOR > 1
17343         {
17344                 char *version;
17345                 int major, minor, patch;
17346
17347                 version = db_version( &major, &minor, &patch );
17348
17349                 if( major != DB_VERSION_MAJOR ||
17350                         minor < DB_VERSION_MINOR )
17351                 {
17352                         printf("Berkeley DB version mismatch\n"
17353                                 "\texpected: %s\n\tgot: %s\n",
17354                                 DB_VERSION_STRING, version);
17355                         return 1;
17356                 }
17357         }
17358 #endif
17359
17360 #if DB_VERSION_MAJOR > 2
17361         db_env_create( NULL, 0 );
17362 #elif DB_VERSION_MAJOR > 1
17363         db_appexit( NULL );
17364 #else
17365         (void) dbopen( NULL, 0, 0, 0, NULL);
17366 #endif
17367
17368 ; return 0; }
17369 EOF
17370 if { (eval echo configure:17371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17371   rm -rf conftest*
17372   ol_cv_db_db3=yes
17373 else
17374   echo "configure: failed program was:" >&5
17375   cat conftest.$ac_ext >&5
17376   rm -rf conftest*
17377   ol_cv_db_db3=no
17378 fi
17379 rm -f conftest*
17380
17381         LIBS="$ol_LIBS"
17382
17383 fi
17384
17385 echo "$ac_t""$ol_cv_db_db3" 1>&6
17386
17387         if test $ol_cv_db_db3 = yes ; then
17388                 ol_cv_lib_db=-ldb3
17389         fi
17390 fi
17391
17392 if test $ol_cv_lib_db = no ; then
17393         echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6
17394 echo "configure:17395: checking for Berkeley DB link (-ldb-3)" >&5
17395 if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then
17396   echo $ac_n "(cached) $ac_c" 1>&6
17397 else
17398   
17399         ol_DB_LIB=-ldb-3
17400         ol_LIBS=$LIBS
17401         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17402
17403         cat > conftest.$ac_ext <<EOF
17404 #line 17405 "configure"
17405 #include "confdefs.h"
17406
17407 #ifdef HAVE_DB_185_H
17408 # include <db_185.h>
17409 #else
17410 # include <db.h>
17411 #endif
17412
17413 #ifndef DB_VERSION_MAJOR
17414 # define DB_VERSION_MAJOR 1
17415 #endif
17416
17417 #ifndef NULL
17418 #define NULL ((void*)0)
17419 #endif
17420
17421 int main() {
17422
17423 #if DB_VERSION_MAJOR > 1
17424         {
17425                 char *version;
17426                 int major, minor, patch;
17427
17428                 version = db_version( &major, &minor, &patch );
17429
17430                 if( major != DB_VERSION_MAJOR ||
17431                         minor < DB_VERSION_MINOR )
17432                 {
17433                         printf("Berkeley DB version mismatch\n"
17434                                 "\texpected: %s\n\tgot: %s\n",
17435                                 DB_VERSION_STRING, version);
17436                         return 1;
17437                 }
17438         }
17439 #endif
17440
17441 #if DB_VERSION_MAJOR > 2
17442         db_env_create( NULL, 0 );
17443 #elif DB_VERSION_MAJOR > 1
17444         db_appexit( NULL );
17445 #else
17446         (void) dbopen( NULL, 0, 0, 0, NULL);
17447 #endif
17448
17449 ; return 0; }
17450 EOF
17451 if { (eval echo configure:17452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17452   rm -rf conftest*
17453   ol_cv_db_db_3=yes
17454 else
17455   echo "configure: failed program was:" >&5
17456   cat conftest.$ac_ext >&5
17457   rm -rf conftest*
17458   ol_cv_db_db_3=no
17459 fi
17460 rm -f conftest*
17461
17462         LIBS="$ol_LIBS"
17463
17464 fi
17465
17466 echo "$ac_t""$ol_cv_db_db_3" 1>&6
17467
17468         if test $ol_cv_db_db_3 = yes ; then
17469                 ol_cv_lib_db=-ldb-3
17470         fi
17471 fi
17472
17473 if test $ol_cv_lib_db = no ; then
17474         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
17475 echo "configure:17476: checking for Berkeley DB link (-ldb2)" >&5
17476 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
17477   echo $ac_n "(cached) $ac_c" 1>&6
17478 else
17479   
17480         ol_DB_LIB=-ldb2
17481         ol_LIBS=$LIBS
17482         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17483
17484         cat > conftest.$ac_ext <<EOF
17485 #line 17486 "configure"
17486 #include "confdefs.h"
17487
17488 #ifdef HAVE_DB_185_H
17489 # include <db_185.h>
17490 #else
17491 # include <db.h>
17492 #endif
17493
17494 #ifndef DB_VERSION_MAJOR
17495 # define DB_VERSION_MAJOR 1
17496 #endif
17497
17498 #ifndef NULL
17499 #define NULL ((void*)0)
17500 #endif
17501
17502 int main() {
17503
17504 #if DB_VERSION_MAJOR > 1
17505         {
17506                 char *version;
17507                 int major, minor, patch;
17508
17509                 version = db_version( &major, &minor, &patch );
17510
17511                 if( major != DB_VERSION_MAJOR ||
17512                         minor < DB_VERSION_MINOR )
17513                 {
17514                         printf("Berkeley DB version mismatch\n"
17515                                 "\texpected: %s\n\tgot: %s\n",
17516                                 DB_VERSION_STRING, version);
17517                         return 1;
17518                 }
17519         }
17520 #endif
17521
17522 #if DB_VERSION_MAJOR > 2
17523         db_env_create( NULL, 0 );
17524 #elif DB_VERSION_MAJOR > 1
17525         db_appexit( NULL );
17526 #else
17527         (void) dbopen( NULL, 0, 0, 0, NULL);
17528 #endif
17529
17530 ; return 0; }
17531 EOF
17532 if { (eval echo configure:17533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17533   rm -rf conftest*
17534   ol_cv_db_db2=yes
17535 else
17536   echo "configure: failed program was:" >&5
17537   cat conftest.$ac_ext >&5
17538   rm -rf conftest*
17539   ol_cv_db_db2=no
17540 fi
17541 rm -f conftest*
17542
17543         LIBS="$ol_LIBS"
17544
17545 fi
17546
17547 echo "$ac_t""$ol_cv_db_db2" 1>&6
17548
17549         if test $ol_cv_db_db2 = yes ; then
17550                 ol_cv_lib_db=-ldb2
17551         fi
17552 fi
17553
17554 if test $ol_cv_lib_db = no ; then
17555         echo $ac_n "checking for Berkeley DB link (-ldb-2)""... $ac_c" 1>&6
17556 echo "configure:17557: checking for Berkeley DB link (-ldb-2)" >&5
17557 if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then
17558   echo $ac_n "(cached) $ac_c" 1>&6
17559 else
17560   
17561         ol_DB_LIB=-ldb-2
17562         ol_LIBS=$LIBS
17563         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17564
17565         cat > conftest.$ac_ext <<EOF
17566 #line 17567 "configure"
17567 #include "confdefs.h"
17568
17569 #ifdef HAVE_DB_185_H
17570 # include <db_185.h>
17571 #else
17572 # include <db.h>
17573 #endif
17574
17575 #ifndef DB_VERSION_MAJOR
17576 # define DB_VERSION_MAJOR 1
17577 #endif
17578
17579 #ifndef NULL
17580 #define NULL ((void*)0)
17581 #endif
17582
17583 int main() {
17584
17585 #if DB_VERSION_MAJOR > 1
17586         {
17587                 char *version;
17588                 int major, minor, patch;
17589
17590                 version = db_version( &major, &minor, &patch );
17591
17592                 if( major != DB_VERSION_MAJOR ||
17593                         minor < DB_VERSION_MINOR )
17594                 {
17595                         printf("Berkeley DB version mismatch\n"
17596                                 "\texpected: %s\n\tgot: %s\n",
17597                                 DB_VERSION_STRING, version);
17598                         return 1;
17599                 }
17600         }
17601 #endif
17602
17603 #if DB_VERSION_MAJOR > 2
17604         db_env_create( NULL, 0 );
17605 #elif DB_VERSION_MAJOR > 1
17606         db_appexit( NULL );
17607 #else
17608         (void) dbopen( NULL, 0, 0, 0, NULL);
17609 #endif
17610
17611 ; return 0; }
17612 EOF
17613 if { (eval echo configure:17614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17614   rm -rf conftest*
17615   ol_cv_db_db_2=yes
17616 else
17617   echo "configure: failed program was:" >&5
17618   cat conftest.$ac_ext >&5
17619   rm -rf conftest*
17620   ol_cv_db_db_2=no
17621 fi
17622 rm -f conftest*
17623
17624         LIBS="$ol_LIBS"
17625
17626 fi
17627
17628 echo "$ac_t""$ol_cv_db_db_2" 1>&6
17629
17630         if test $ol_cv_db_db_2 = yes ; then
17631                 ol_cv_lib_db=-ldb-2
17632         fi
17633 fi
17634
17635 if test $ol_cv_lib_db = no ; then
17636         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
17637 echo "configure:17638: checking for Berkeley DB link (-ldb1)" >&5
17638 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
17639   echo $ac_n "(cached) $ac_c" 1>&6
17640 else
17641   
17642         ol_DB_LIB=-ldb1
17643         ol_LIBS=$LIBS
17644         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17645
17646         cat > conftest.$ac_ext <<EOF
17647 #line 17648 "configure"
17648 #include "confdefs.h"
17649
17650 #ifdef HAVE_DB_185_H
17651 # include <db_185.h>
17652 #else
17653 # include <db.h>
17654 #endif
17655
17656 #ifndef DB_VERSION_MAJOR
17657 # define DB_VERSION_MAJOR 1
17658 #endif
17659
17660 #ifndef NULL
17661 #define NULL ((void*)0)
17662 #endif
17663
17664 int main() {
17665
17666 #if DB_VERSION_MAJOR > 1
17667         {
17668                 char *version;
17669                 int major, minor, patch;
17670
17671                 version = db_version( &major, &minor, &patch );
17672
17673                 if( major != DB_VERSION_MAJOR ||
17674                         minor < DB_VERSION_MINOR )
17675                 {
17676                         printf("Berkeley DB version mismatch\n"
17677                                 "\texpected: %s\n\tgot: %s\n",
17678                                 DB_VERSION_STRING, version);
17679                         return 1;
17680                 }
17681         }
17682 #endif
17683
17684 #if DB_VERSION_MAJOR > 2
17685         db_env_create( NULL, 0 );
17686 #elif DB_VERSION_MAJOR > 1
17687         db_appexit( NULL );
17688 #else
17689         (void) dbopen( NULL, 0, 0, 0, NULL);
17690 #endif
17691
17692 ; return 0; }
17693 EOF
17694 if { (eval echo configure:17695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17695   rm -rf conftest*
17696   ol_cv_db_db1=yes
17697 else
17698   echo "configure: failed program was:" >&5
17699   cat conftest.$ac_ext >&5
17700   rm -rf conftest*
17701   ol_cv_db_db1=no
17702 fi
17703 rm -f conftest*
17704
17705         LIBS="$ol_LIBS"
17706
17707 fi
17708
17709 echo "$ac_t""$ol_cv_db_db1" 1>&6
17710
17711         if test $ol_cv_db_db1 = yes ; then
17712                 ol_cv_lib_db=-ldb1
17713         fi
17714 fi
17715
17716 if test $ol_cv_lib_db = no ; then
17717         echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6
17718 echo "configure:17719: checking for Berkeley DB link (-ldb-1)" >&5
17719 if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then
17720   echo $ac_n "(cached) $ac_c" 1>&6
17721 else
17722   
17723         ol_DB_LIB=-ldb-1
17724         ol_LIBS=$LIBS
17725         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17726
17727         cat > conftest.$ac_ext <<EOF
17728 #line 17729 "configure"
17729 #include "confdefs.h"
17730
17731 #ifdef HAVE_DB_185_H
17732 # include <db_185.h>
17733 #else
17734 # include <db.h>
17735 #endif
17736
17737 #ifndef DB_VERSION_MAJOR
17738 # define DB_VERSION_MAJOR 1
17739 #endif
17740
17741 #ifndef NULL
17742 #define NULL ((void*)0)
17743 #endif
17744
17745 int main() {
17746
17747 #if DB_VERSION_MAJOR > 1
17748         {
17749                 char *version;
17750                 int major, minor, patch;
17751
17752                 version = db_version( &major, &minor, &patch );
17753
17754                 if( major != DB_VERSION_MAJOR ||
17755                         minor < DB_VERSION_MINOR )
17756                 {
17757                         printf("Berkeley DB version mismatch\n"
17758                                 "\texpected: %s\n\tgot: %s\n",
17759                                 DB_VERSION_STRING, version);
17760                         return 1;
17761                 }
17762         }
17763 #endif
17764
17765 #if DB_VERSION_MAJOR > 2
17766         db_env_create( NULL, 0 );
17767 #elif DB_VERSION_MAJOR > 1
17768         db_appexit( NULL );
17769 #else
17770         (void) dbopen( NULL, 0, 0, 0, NULL);
17771 #endif
17772
17773 ; return 0; }
17774 EOF
17775 if { (eval echo configure:17776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17776   rm -rf conftest*
17777   ol_cv_db_db_1=yes
17778 else
17779   echo "configure: failed program was:" >&5
17780   cat conftest.$ac_ext >&5
17781   rm -rf conftest*
17782   ol_cv_db_db_1=no
17783 fi
17784 rm -f conftest*
17785
17786         LIBS="$ol_LIBS"
17787
17788 fi
17789
17790 echo "$ac_t""$ol_cv_db_db_1" 1>&6
17791
17792         if test $ol_cv_db_db_1 = yes ; then
17793                 ol_cv_lib_db=-ldb-1
17794         fi
17795 fi
17796
17797
17798                 if test "$ol_cv_lib_db" != no ; then
17799                         ol_cv_berkeley_db=yes
17800                 fi
17801         fi
17802 fi
17803
17804         else
17805                 ol_cv_berkeley_db=no
17806 for ac_hdr in db.h
17807 do
17808 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
17809 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
17810 echo "configure:17811: checking for $ac_hdr" >&5
17811 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
17812   echo $ac_n "(cached) $ac_c" 1>&6
17813 else
17814   cat > conftest.$ac_ext <<EOF
17815 #line 17816 "configure"
17816 #include "confdefs.h"
17817 #include <$ac_hdr>
17818 EOF
17819 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
17820 { (eval echo configure:17821: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
17821 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
17822 if test -z "$ac_err"; then
17823   rm -rf conftest*
17824   eval "ac_cv_header_$ac_safe=yes"
17825 else
17826   echo "$ac_err" >&5
17827   echo "configure: failed program was:" >&5
17828   cat conftest.$ac_ext >&5
17829   rm -rf conftest*
17830   eval "ac_cv_header_$ac_safe=no"
17831 fi
17832 rm -f conftest*
17833 fi
17834 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
17835   echo "$ac_t""yes" 1>&6
17836     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
17837   cat >> confdefs.h <<EOF
17838 #define $ac_tr_hdr 1
17839 EOF
17840  
17841 else
17842   echo "$ac_t""no" 1>&6
17843 fi
17844 done
17845
17846 if test $ac_cv_header_db_h = yes; then
17847         ol_cv_lib_db=no
17848 if test $ol_cv_lib_db = no ; then
17849         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
17850 echo "configure:17851: checking for Berkeley DB link (default)" >&5
17851 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
17852   echo $ac_n "(cached) $ac_c" 1>&6
17853 else
17854   
17855         ol_DB_LIB=
17856         ol_LIBS=$LIBS
17857         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17858
17859         cat > conftest.$ac_ext <<EOF
17860 #line 17861 "configure"
17861 #include "confdefs.h"
17862
17863 #ifdef HAVE_DB_185_H
17864 # include <db_185.h>
17865 #else
17866 # include <db.h>
17867 #endif
17868
17869 #ifndef DB_VERSION_MAJOR
17870 # define DB_VERSION_MAJOR 1
17871 #endif
17872
17873 #ifndef NULL
17874 #define NULL ((void*)0)
17875 #endif
17876
17877 int main() {
17878
17879 #if DB_VERSION_MAJOR > 1
17880         {
17881                 char *version;
17882                 int major, minor, patch;
17883
17884                 version = db_version( &major, &minor, &patch );
17885
17886                 if( major != DB_VERSION_MAJOR ||
17887                         minor < DB_VERSION_MINOR )
17888                 {
17889                         printf("Berkeley DB version mismatch\n"
17890                                 "\texpected: %s\n\tgot: %s\n",
17891                                 DB_VERSION_STRING, version);
17892                         return 1;
17893                 }
17894         }
17895 #endif
17896
17897 #if DB_VERSION_MAJOR > 2
17898         db_env_create( NULL, 0 );
17899 #elif DB_VERSION_MAJOR > 1
17900         db_appexit( NULL );
17901 #else
17902         (void) dbopen( NULL, 0, 0, 0, NULL);
17903 #endif
17904
17905 ; return 0; }
17906 EOF
17907 if { (eval echo configure:17908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17908   rm -rf conftest*
17909   ol_cv_db_none=yes
17910 else
17911   echo "configure: failed program was:" >&5
17912   cat conftest.$ac_ext >&5
17913   rm -rf conftest*
17914   ol_cv_db_none=no
17915 fi
17916 rm -f conftest*
17917
17918         LIBS="$ol_LIBS"
17919
17920 fi
17921
17922 echo "$ac_t""$ol_cv_db_none" 1>&6
17923
17924         if test $ol_cv_db_none = yes ; then
17925                 ol_cv_lib_db=yes
17926         fi
17927 fi
17928
17929 if test $ol_cv_lib_db = no ; then
17930         echo $ac_n "checking for Berkeley DB link (-ldb41)""... $ac_c" 1>&6
17931 echo "configure:17932: checking for Berkeley DB link (-ldb41)" >&5
17932 if eval "test \"\${ol_cv_db_db41+set}\" = set"; then
17933   echo $ac_n "(cached) $ac_c" 1>&6
17934 else
17935   
17936         ol_DB_LIB=-ldb41
17937         ol_LIBS=$LIBS
17938         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17939
17940         cat > conftest.$ac_ext <<EOF
17941 #line 17942 "configure"
17942 #include "confdefs.h"
17943
17944 #ifdef HAVE_DB_185_H
17945 # include <db_185.h>
17946 #else
17947 # include <db.h>
17948 #endif
17949
17950 #ifndef DB_VERSION_MAJOR
17951 # define DB_VERSION_MAJOR 1
17952 #endif
17953
17954 #ifndef NULL
17955 #define NULL ((void*)0)
17956 #endif
17957
17958 int main() {
17959
17960 #if DB_VERSION_MAJOR > 1
17961         {
17962                 char *version;
17963                 int major, minor, patch;
17964
17965                 version = db_version( &major, &minor, &patch );
17966
17967                 if( major != DB_VERSION_MAJOR ||
17968                         minor < DB_VERSION_MINOR )
17969                 {
17970                         printf("Berkeley DB version mismatch\n"
17971                                 "\texpected: %s\n\tgot: %s\n",
17972                                 DB_VERSION_STRING, version);
17973                         return 1;
17974                 }
17975         }
17976 #endif
17977
17978 #if DB_VERSION_MAJOR > 2
17979         db_env_create( NULL, 0 );
17980 #elif DB_VERSION_MAJOR > 1
17981         db_appexit( NULL );
17982 #else
17983         (void) dbopen( NULL, 0, 0, 0, NULL);
17984 #endif
17985
17986 ; return 0; }
17987 EOF
17988 if { (eval echo configure:17989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17989   rm -rf conftest*
17990   ol_cv_db_db41=yes
17991 else
17992   echo "configure: failed program was:" >&5
17993   cat conftest.$ac_ext >&5
17994   rm -rf conftest*
17995   ol_cv_db_db41=no
17996 fi
17997 rm -f conftest*
17998
17999         LIBS="$ol_LIBS"
18000
18001 fi
18002
18003 echo "$ac_t""$ol_cv_db_db41" 1>&6
18004
18005         if test $ol_cv_db_db41 = yes ; then
18006                 ol_cv_lib_db=-ldb41
18007         fi
18008 fi
18009
18010 if test $ol_cv_lib_db = no ; then
18011         echo $ac_n "checking for Berkeley DB link (-ldb-41)""... $ac_c" 1>&6
18012 echo "configure:18013: checking for Berkeley DB link (-ldb-41)" >&5
18013 if eval "test \"\${ol_cv_db_db_41+set}\" = set"; then
18014   echo $ac_n "(cached) $ac_c" 1>&6
18015 else
18016   
18017         ol_DB_LIB=-ldb-41
18018         ol_LIBS=$LIBS
18019         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18020
18021         cat > conftest.$ac_ext <<EOF
18022 #line 18023 "configure"
18023 #include "confdefs.h"
18024
18025 #ifdef HAVE_DB_185_H
18026 # include <db_185.h>
18027 #else
18028 # include <db.h>
18029 #endif
18030
18031 #ifndef DB_VERSION_MAJOR
18032 # define DB_VERSION_MAJOR 1
18033 #endif
18034
18035 #ifndef NULL
18036 #define NULL ((void*)0)
18037 #endif
18038
18039 int main() {
18040
18041 #if DB_VERSION_MAJOR > 1
18042         {
18043                 char *version;
18044                 int major, minor, patch;
18045
18046                 version = db_version( &major, &minor, &patch );
18047
18048                 if( major != DB_VERSION_MAJOR ||
18049                         minor < DB_VERSION_MINOR )
18050                 {
18051                         printf("Berkeley DB version mismatch\n"
18052                                 "\texpected: %s\n\tgot: %s\n",
18053                                 DB_VERSION_STRING, version);
18054                         return 1;
18055                 }
18056         }
18057 #endif
18058
18059 #if DB_VERSION_MAJOR > 2
18060         db_env_create( NULL, 0 );
18061 #elif DB_VERSION_MAJOR > 1
18062         db_appexit( NULL );
18063 #else
18064         (void) dbopen( NULL, 0, 0, 0, NULL);
18065 #endif
18066
18067 ; return 0; }
18068 EOF
18069 if { (eval echo configure:18070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18070   rm -rf conftest*
18071   ol_cv_db_db_41=yes
18072 else
18073   echo "configure: failed program was:" >&5
18074   cat conftest.$ac_ext >&5
18075   rm -rf conftest*
18076   ol_cv_db_db_41=no
18077 fi
18078 rm -f conftest*
18079
18080         LIBS="$ol_LIBS"
18081
18082 fi
18083
18084 echo "$ac_t""$ol_cv_db_db_41" 1>&6
18085
18086         if test $ol_cv_db_db_41 = yes ; then
18087                 ol_cv_lib_db=-ldb-41
18088         fi
18089 fi
18090
18091 if test $ol_cv_lib_db = no ; then
18092         echo $ac_n "checking for Berkeley DB link (-ldb-4.1)""... $ac_c" 1>&6
18093 echo "configure:18094: checking for Berkeley DB link (-ldb-4.1)" >&5
18094 if eval "test \"\${ol_cv_db_db_4_dot_1+set}\" = set"; then
18095   echo $ac_n "(cached) $ac_c" 1>&6
18096 else
18097   
18098         ol_DB_LIB=-ldb-4.1
18099         ol_LIBS=$LIBS
18100         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18101
18102         cat > conftest.$ac_ext <<EOF
18103 #line 18104 "configure"
18104 #include "confdefs.h"
18105
18106 #ifdef HAVE_DB_185_H
18107 # include <db_185.h>
18108 #else
18109 # include <db.h>
18110 #endif
18111
18112 #ifndef DB_VERSION_MAJOR
18113 # define DB_VERSION_MAJOR 1
18114 #endif
18115
18116 #ifndef NULL
18117 #define NULL ((void*)0)
18118 #endif
18119
18120 int main() {
18121
18122 #if DB_VERSION_MAJOR > 1
18123         {
18124                 char *version;
18125                 int major, minor, patch;
18126
18127                 version = db_version( &major, &minor, &patch );
18128
18129                 if( major != DB_VERSION_MAJOR ||
18130                         minor < DB_VERSION_MINOR )
18131                 {
18132                         printf("Berkeley DB version mismatch\n"
18133                                 "\texpected: %s\n\tgot: %s\n",
18134                                 DB_VERSION_STRING, version);
18135                         return 1;
18136                 }
18137         }
18138 #endif
18139
18140 #if DB_VERSION_MAJOR > 2
18141         db_env_create( NULL, 0 );
18142 #elif DB_VERSION_MAJOR > 1
18143         db_appexit( NULL );
18144 #else
18145         (void) dbopen( NULL, 0, 0, 0, NULL);
18146 #endif
18147
18148 ; return 0; }
18149 EOF
18150 if { (eval echo configure:18151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18151   rm -rf conftest*
18152   ol_cv_db_db_4_dot_1=yes
18153 else
18154   echo "configure: failed program was:" >&5
18155   cat conftest.$ac_ext >&5
18156   rm -rf conftest*
18157   ol_cv_db_db_4_dot_1=no
18158 fi
18159 rm -f conftest*
18160
18161         LIBS="$ol_LIBS"
18162
18163 fi
18164
18165 echo "$ac_t""$ol_cv_db_db_4_dot_1" 1>&6
18166
18167         if test $ol_cv_db_db_4_dot_1 = yes ; then
18168                 ol_cv_lib_db=-ldb-4.1
18169         fi
18170 fi
18171
18172 if test $ol_cv_lib_db = no ; then
18173         echo $ac_n "checking for Berkeley DB link (-ldb-4-1)""... $ac_c" 1>&6
18174 echo "configure:18175: checking for Berkeley DB link (-ldb-4-1)" >&5
18175 if eval "test \"\${ol_cv_db_db_4_1+set}\" = set"; then
18176   echo $ac_n "(cached) $ac_c" 1>&6
18177 else
18178   
18179         ol_DB_LIB=-ldb-4-1
18180         ol_LIBS=$LIBS
18181         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18182
18183         cat > conftest.$ac_ext <<EOF
18184 #line 18185 "configure"
18185 #include "confdefs.h"
18186
18187 #ifdef HAVE_DB_185_H
18188 # include <db_185.h>
18189 #else
18190 # include <db.h>
18191 #endif
18192
18193 #ifndef DB_VERSION_MAJOR
18194 # define DB_VERSION_MAJOR 1
18195 #endif
18196
18197 #ifndef NULL
18198 #define NULL ((void*)0)
18199 #endif
18200
18201 int main() {
18202
18203 #if DB_VERSION_MAJOR > 1
18204         {
18205                 char *version;
18206                 int major, minor, patch;
18207
18208                 version = db_version( &major, &minor, &patch );
18209
18210                 if( major != DB_VERSION_MAJOR ||
18211                         minor < DB_VERSION_MINOR )
18212                 {
18213                         printf("Berkeley DB version mismatch\n"
18214                                 "\texpected: %s\n\tgot: %s\n",
18215                                 DB_VERSION_STRING, version);
18216                         return 1;
18217                 }
18218         }
18219 #endif
18220
18221 #if DB_VERSION_MAJOR > 2
18222         db_env_create( NULL, 0 );
18223 #elif DB_VERSION_MAJOR > 1
18224         db_appexit( NULL );
18225 #else
18226         (void) dbopen( NULL, 0, 0, 0, NULL);
18227 #endif
18228
18229 ; return 0; }
18230 EOF
18231 if { (eval echo configure:18232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18232   rm -rf conftest*
18233   ol_cv_db_db_4_1=yes
18234 else
18235   echo "configure: failed program was:" >&5
18236   cat conftest.$ac_ext >&5
18237   rm -rf conftest*
18238   ol_cv_db_db_4_1=no
18239 fi
18240 rm -f conftest*
18241
18242         LIBS="$ol_LIBS"
18243
18244 fi
18245
18246 echo "$ac_t""$ol_cv_db_db_4_1" 1>&6
18247
18248         if test $ol_cv_db_db_4_1 = yes ; then
18249                 ol_cv_lib_db=-ldb-4-1
18250         fi
18251 fi
18252
18253 if test $ol_cv_lib_db = no ; then
18254         echo $ac_n "checking for Berkeley DB link (-ldb-4)""... $ac_c" 1>&6
18255 echo "configure:18256: checking for Berkeley DB link (-ldb-4)" >&5
18256 if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then
18257   echo $ac_n "(cached) $ac_c" 1>&6
18258 else
18259   
18260         ol_DB_LIB=-ldb-4
18261         ol_LIBS=$LIBS
18262         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18263
18264         cat > conftest.$ac_ext <<EOF
18265 #line 18266 "configure"
18266 #include "confdefs.h"
18267
18268 #ifdef HAVE_DB_185_H
18269 # include <db_185.h>
18270 #else
18271 # include <db.h>
18272 #endif
18273
18274 #ifndef DB_VERSION_MAJOR
18275 # define DB_VERSION_MAJOR 1
18276 #endif
18277
18278 #ifndef NULL
18279 #define NULL ((void*)0)
18280 #endif
18281
18282 int main() {
18283
18284 #if DB_VERSION_MAJOR > 1
18285         {
18286                 char *version;
18287                 int major, minor, patch;
18288
18289                 version = db_version( &major, &minor, &patch );
18290
18291                 if( major != DB_VERSION_MAJOR ||
18292                         minor < DB_VERSION_MINOR )
18293                 {
18294                         printf("Berkeley DB version mismatch\n"
18295                                 "\texpected: %s\n\tgot: %s\n",
18296                                 DB_VERSION_STRING, version);
18297                         return 1;
18298                 }
18299         }
18300 #endif
18301
18302 #if DB_VERSION_MAJOR > 2
18303         db_env_create( NULL, 0 );
18304 #elif DB_VERSION_MAJOR > 1
18305         db_appexit( NULL );
18306 #else
18307         (void) dbopen( NULL, 0, 0, 0, NULL);
18308 #endif
18309
18310 ; return 0; }
18311 EOF
18312 if { (eval echo configure:18313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18313   rm -rf conftest*
18314   ol_cv_db_db_4=yes
18315 else
18316   echo "configure: failed program was:" >&5
18317   cat conftest.$ac_ext >&5
18318   rm -rf conftest*
18319   ol_cv_db_db_4=no
18320 fi
18321 rm -f conftest*
18322
18323         LIBS="$ol_LIBS"
18324
18325 fi
18326
18327 echo "$ac_t""$ol_cv_db_db_4" 1>&6
18328
18329         if test $ol_cv_db_db_4 = yes ; then
18330                 ol_cv_lib_db=-ldb-4
18331         fi
18332 fi
18333
18334 if test $ol_cv_lib_db = no ; then
18335         echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
18336 echo "configure:18337: checking for Berkeley DB link (-ldb4)" >&5
18337 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
18338   echo $ac_n "(cached) $ac_c" 1>&6
18339 else
18340   
18341         ol_DB_LIB=-ldb4
18342         ol_LIBS=$LIBS
18343         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18344
18345         cat > conftest.$ac_ext <<EOF
18346 #line 18347 "configure"
18347 #include "confdefs.h"
18348
18349 #ifdef HAVE_DB_185_H
18350 # include <db_185.h>
18351 #else
18352 # include <db.h>
18353 #endif
18354
18355 #ifndef DB_VERSION_MAJOR
18356 # define DB_VERSION_MAJOR 1
18357 #endif
18358
18359 #ifndef NULL
18360 #define NULL ((void*)0)
18361 #endif
18362
18363 int main() {
18364
18365 #if DB_VERSION_MAJOR > 1
18366         {
18367                 char *version;
18368                 int major, minor, patch;
18369
18370                 version = db_version( &major, &minor, &patch );
18371
18372                 if( major != DB_VERSION_MAJOR ||
18373                         minor < DB_VERSION_MINOR )
18374                 {
18375                         printf("Berkeley DB version mismatch\n"
18376                                 "\texpected: %s\n\tgot: %s\n",
18377                                 DB_VERSION_STRING, version);
18378                         return 1;
18379                 }
18380         }
18381 #endif
18382
18383 #if DB_VERSION_MAJOR > 2
18384         db_env_create( NULL, 0 );
18385 #elif DB_VERSION_MAJOR > 1
18386         db_appexit( NULL );
18387 #else
18388         (void) dbopen( NULL, 0, 0, 0, NULL);
18389 #endif
18390
18391 ; return 0; }
18392 EOF
18393 if { (eval echo configure:18394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18394   rm -rf conftest*
18395   ol_cv_db_db4=yes
18396 else
18397   echo "configure: failed program was:" >&5
18398   cat conftest.$ac_ext >&5
18399   rm -rf conftest*
18400   ol_cv_db_db4=no
18401 fi
18402 rm -f conftest*
18403
18404         LIBS="$ol_LIBS"
18405
18406 fi
18407
18408 echo "$ac_t""$ol_cv_db_db4" 1>&6
18409
18410         if test $ol_cv_db_db4 = yes ; then
18411                 ol_cv_lib_db=-ldb4
18412         fi
18413 fi
18414
18415 if test $ol_cv_lib_db = no ; then
18416         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
18417 echo "configure:18418: checking for Berkeley DB link (-ldb)" >&5
18418 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
18419   echo $ac_n "(cached) $ac_c" 1>&6
18420 else
18421   
18422         ol_DB_LIB=-ldb
18423         ol_LIBS=$LIBS
18424         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18425
18426         cat > conftest.$ac_ext <<EOF
18427 #line 18428 "configure"
18428 #include "confdefs.h"
18429
18430 #ifdef HAVE_DB_185_H
18431 # include <db_185.h>
18432 #else
18433 # include <db.h>
18434 #endif
18435
18436 #ifndef DB_VERSION_MAJOR
18437 # define DB_VERSION_MAJOR 1
18438 #endif
18439
18440 #ifndef NULL
18441 #define NULL ((void*)0)
18442 #endif
18443
18444 int main() {
18445
18446 #if DB_VERSION_MAJOR > 1
18447         {
18448                 char *version;
18449                 int major, minor, patch;
18450
18451                 version = db_version( &major, &minor, &patch );
18452
18453                 if( major != DB_VERSION_MAJOR ||
18454                         minor < DB_VERSION_MINOR )
18455                 {
18456                         printf("Berkeley DB version mismatch\n"
18457                                 "\texpected: %s\n\tgot: %s\n",
18458                                 DB_VERSION_STRING, version);
18459                         return 1;
18460                 }
18461         }
18462 #endif
18463
18464 #if DB_VERSION_MAJOR > 2
18465         db_env_create( NULL, 0 );
18466 #elif DB_VERSION_MAJOR > 1
18467         db_appexit( NULL );
18468 #else
18469         (void) dbopen( NULL, 0, 0, 0, NULL);
18470 #endif
18471
18472 ; return 0; }
18473 EOF
18474 if { (eval echo configure:18475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18475   rm -rf conftest*
18476   ol_cv_db_db=yes
18477 else
18478   echo "configure: failed program was:" >&5
18479   cat conftest.$ac_ext >&5
18480   rm -rf conftest*
18481   ol_cv_db_db=no
18482 fi
18483 rm -f conftest*
18484
18485         LIBS="$ol_LIBS"
18486
18487 fi
18488
18489 echo "$ac_t""$ol_cv_db_db" 1>&6
18490
18491         if test $ol_cv_db_db = yes ; then
18492                 ol_cv_lib_db=-ldb
18493         fi
18494 fi
18495
18496 if test $ol_cv_lib_db = no ; then
18497         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
18498 echo "configure:18499: checking for Berkeley DB link (-ldb3)" >&5
18499 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
18500   echo $ac_n "(cached) $ac_c" 1>&6
18501 else
18502   
18503         ol_DB_LIB=-ldb3
18504         ol_LIBS=$LIBS
18505         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18506
18507         cat > conftest.$ac_ext <<EOF
18508 #line 18509 "configure"
18509 #include "confdefs.h"
18510
18511 #ifdef HAVE_DB_185_H
18512 # include <db_185.h>
18513 #else
18514 # include <db.h>
18515 #endif
18516
18517 #ifndef DB_VERSION_MAJOR
18518 # define DB_VERSION_MAJOR 1
18519 #endif
18520
18521 #ifndef NULL
18522 #define NULL ((void*)0)
18523 #endif
18524
18525 int main() {
18526
18527 #if DB_VERSION_MAJOR > 1
18528         {
18529                 char *version;
18530                 int major, minor, patch;
18531
18532                 version = db_version( &major, &minor, &patch );
18533
18534                 if( major != DB_VERSION_MAJOR ||
18535                         minor < DB_VERSION_MINOR )
18536                 {
18537                         printf("Berkeley DB version mismatch\n"
18538                                 "\texpected: %s\n\tgot: %s\n",
18539                                 DB_VERSION_STRING, version);
18540                         return 1;
18541                 }
18542         }
18543 #endif
18544
18545 #if DB_VERSION_MAJOR > 2
18546         db_env_create( NULL, 0 );
18547 #elif DB_VERSION_MAJOR > 1
18548         db_appexit( NULL );
18549 #else
18550         (void) dbopen( NULL, 0, 0, 0, NULL);
18551 #endif
18552
18553 ; return 0; }
18554 EOF
18555 if { (eval echo configure:18556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18556   rm -rf conftest*
18557   ol_cv_db_db3=yes
18558 else
18559   echo "configure: failed program was:" >&5
18560   cat conftest.$ac_ext >&5
18561   rm -rf conftest*
18562   ol_cv_db_db3=no
18563 fi
18564 rm -f conftest*
18565
18566         LIBS="$ol_LIBS"
18567
18568 fi
18569
18570 echo "$ac_t""$ol_cv_db_db3" 1>&6
18571
18572         if test $ol_cv_db_db3 = yes ; then
18573                 ol_cv_lib_db=-ldb3
18574         fi
18575 fi
18576
18577 if test $ol_cv_lib_db = no ; then
18578         echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6
18579 echo "configure:18580: checking for Berkeley DB link (-ldb-3)" >&5
18580 if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then
18581   echo $ac_n "(cached) $ac_c" 1>&6
18582 else
18583   
18584         ol_DB_LIB=-ldb-3
18585         ol_LIBS=$LIBS
18586         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18587
18588         cat > conftest.$ac_ext <<EOF
18589 #line 18590 "configure"
18590 #include "confdefs.h"
18591
18592 #ifdef HAVE_DB_185_H
18593 # include <db_185.h>
18594 #else
18595 # include <db.h>
18596 #endif
18597
18598 #ifndef DB_VERSION_MAJOR
18599 # define DB_VERSION_MAJOR 1
18600 #endif
18601
18602 #ifndef NULL
18603 #define NULL ((void*)0)
18604 #endif
18605
18606 int main() {
18607
18608 #if DB_VERSION_MAJOR > 1
18609         {
18610                 char *version;
18611                 int major, minor, patch;
18612
18613                 version = db_version( &major, &minor, &patch );
18614
18615                 if( major != DB_VERSION_MAJOR ||
18616                         minor < DB_VERSION_MINOR )
18617                 {
18618                         printf("Berkeley DB version mismatch\n"
18619                                 "\texpected: %s\n\tgot: %s\n",
18620                                 DB_VERSION_STRING, version);
18621                         return 1;
18622                 }
18623         }
18624 #endif
18625
18626 #if DB_VERSION_MAJOR > 2
18627         db_env_create( NULL, 0 );
18628 #elif DB_VERSION_MAJOR > 1
18629         db_appexit( NULL );
18630 #else
18631         (void) dbopen( NULL, 0, 0, 0, NULL);
18632 #endif
18633
18634 ; return 0; }
18635 EOF
18636 if { (eval echo configure:18637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18637   rm -rf conftest*
18638   ol_cv_db_db_3=yes
18639 else
18640   echo "configure: failed program was:" >&5
18641   cat conftest.$ac_ext >&5
18642   rm -rf conftest*
18643   ol_cv_db_db_3=no
18644 fi
18645 rm -f conftest*
18646
18647         LIBS="$ol_LIBS"
18648
18649 fi
18650
18651 echo "$ac_t""$ol_cv_db_db_3" 1>&6
18652
18653         if test $ol_cv_db_db_3 = yes ; then
18654                 ol_cv_lib_db=-ldb-3
18655         fi
18656 fi
18657
18658 if test $ol_cv_lib_db = no ; then
18659         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
18660 echo "configure:18661: checking for Berkeley DB link (-ldb2)" >&5
18661 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
18662   echo $ac_n "(cached) $ac_c" 1>&6
18663 else
18664   
18665         ol_DB_LIB=-ldb2
18666         ol_LIBS=$LIBS
18667         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18668
18669         cat > conftest.$ac_ext <<EOF
18670 #line 18671 "configure"
18671 #include "confdefs.h"
18672
18673 #ifdef HAVE_DB_185_H
18674 # include <db_185.h>
18675 #else
18676 # include <db.h>
18677 #endif
18678
18679 #ifndef DB_VERSION_MAJOR
18680 # define DB_VERSION_MAJOR 1
18681 #endif
18682
18683 #ifndef NULL
18684 #define NULL ((void*)0)
18685 #endif
18686
18687 int main() {
18688
18689 #if DB_VERSION_MAJOR > 1
18690         {
18691                 char *version;
18692                 int major, minor, patch;
18693
18694                 version = db_version( &major, &minor, &patch );
18695
18696                 if( major != DB_VERSION_MAJOR ||
18697                         minor < DB_VERSION_MINOR )
18698                 {
18699                         printf("Berkeley DB version mismatch\n"
18700                                 "\texpected: %s\n\tgot: %s\n",
18701                                 DB_VERSION_STRING, version);
18702                         return 1;
18703                 }
18704         }
18705 #endif
18706
18707 #if DB_VERSION_MAJOR > 2
18708         db_env_create( NULL, 0 );
18709 #elif DB_VERSION_MAJOR > 1
18710         db_appexit( NULL );
18711 #else
18712         (void) dbopen( NULL, 0, 0, 0, NULL);
18713 #endif
18714
18715 ; return 0; }
18716 EOF
18717 if { (eval echo configure:18718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18718   rm -rf conftest*
18719   ol_cv_db_db2=yes
18720 else
18721   echo "configure: failed program was:" >&5
18722   cat conftest.$ac_ext >&5
18723   rm -rf conftest*
18724   ol_cv_db_db2=no
18725 fi
18726 rm -f conftest*
18727
18728         LIBS="$ol_LIBS"
18729
18730 fi
18731
18732 echo "$ac_t""$ol_cv_db_db2" 1>&6
18733
18734         if test $ol_cv_db_db2 = yes ; then
18735                 ol_cv_lib_db=-ldb2
18736         fi
18737 fi
18738
18739 if test $ol_cv_lib_db = no ; then
18740         echo $ac_n "checking for Berkeley DB link (-ldb-2)""... $ac_c" 1>&6
18741 echo "configure:18742: checking for Berkeley DB link (-ldb-2)" >&5
18742 if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then
18743   echo $ac_n "(cached) $ac_c" 1>&6
18744 else
18745   
18746         ol_DB_LIB=-ldb-2
18747         ol_LIBS=$LIBS
18748         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18749
18750         cat > conftest.$ac_ext <<EOF
18751 #line 18752 "configure"
18752 #include "confdefs.h"
18753
18754 #ifdef HAVE_DB_185_H
18755 # include <db_185.h>
18756 #else
18757 # include <db.h>
18758 #endif
18759
18760 #ifndef DB_VERSION_MAJOR
18761 # define DB_VERSION_MAJOR 1
18762 #endif
18763
18764 #ifndef NULL
18765 #define NULL ((void*)0)
18766 #endif
18767
18768 int main() {
18769
18770 #if DB_VERSION_MAJOR > 1
18771         {
18772                 char *version;
18773                 int major, minor, patch;
18774
18775                 version = db_version( &major, &minor, &patch );
18776
18777                 if( major != DB_VERSION_MAJOR ||
18778                         minor < DB_VERSION_MINOR )
18779                 {
18780                         printf("Berkeley DB version mismatch\n"
18781                                 "\texpected: %s\n\tgot: %s\n",
18782                                 DB_VERSION_STRING, version);
18783                         return 1;
18784                 }
18785         }
18786 #endif
18787
18788 #if DB_VERSION_MAJOR > 2
18789         db_env_create( NULL, 0 );
18790 #elif DB_VERSION_MAJOR > 1
18791         db_appexit( NULL );
18792 #else
18793         (void) dbopen( NULL, 0, 0, 0, NULL);
18794 #endif
18795
18796 ; return 0; }
18797 EOF
18798 if { (eval echo configure:18799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18799   rm -rf conftest*
18800   ol_cv_db_db_2=yes
18801 else
18802   echo "configure: failed program was:" >&5
18803   cat conftest.$ac_ext >&5
18804   rm -rf conftest*
18805   ol_cv_db_db_2=no
18806 fi
18807 rm -f conftest*
18808
18809         LIBS="$ol_LIBS"
18810
18811 fi
18812
18813 echo "$ac_t""$ol_cv_db_db_2" 1>&6
18814
18815         if test $ol_cv_db_db_2 = yes ; then
18816                 ol_cv_lib_db=-ldb-2
18817         fi
18818 fi
18819
18820 if test $ol_cv_lib_db = no ; then
18821         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
18822 echo "configure:18823: checking for Berkeley DB link (-ldb1)" >&5
18823 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
18824   echo $ac_n "(cached) $ac_c" 1>&6
18825 else
18826   
18827         ol_DB_LIB=-ldb1
18828         ol_LIBS=$LIBS
18829         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18830
18831         cat > conftest.$ac_ext <<EOF
18832 #line 18833 "configure"
18833 #include "confdefs.h"
18834
18835 #ifdef HAVE_DB_185_H
18836 # include <db_185.h>
18837 #else
18838 # include <db.h>
18839 #endif
18840
18841 #ifndef DB_VERSION_MAJOR
18842 # define DB_VERSION_MAJOR 1
18843 #endif
18844
18845 #ifndef NULL
18846 #define NULL ((void*)0)
18847 #endif
18848
18849 int main() {
18850
18851 #if DB_VERSION_MAJOR > 1
18852         {
18853                 char *version;
18854                 int major, minor, patch;
18855
18856                 version = db_version( &major, &minor, &patch );
18857
18858                 if( major != DB_VERSION_MAJOR ||
18859                         minor < DB_VERSION_MINOR )
18860                 {
18861                         printf("Berkeley DB version mismatch\n"
18862                                 "\texpected: %s\n\tgot: %s\n",
18863                                 DB_VERSION_STRING, version);
18864                         return 1;
18865                 }
18866         }
18867 #endif
18868
18869 #if DB_VERSION_MAJOR > 2
18870         db_env_create( NULL, 0 );
18871 #elif DB_VERSION_MAJOR > 1
18872         db_appexit( NULL );
18873 #else
18874         (void) dbopen( NULL, 0, 0, 0, NULL);
18875 #endif
18876
18877 ; return 0; }
18878 EOF
18879 if { (eval echo configure:18880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18880   rm -rf conftest*
18881   ol_cv_db_db1=yes
18882 else
18883   echo "configure: failed program was:" >&5
18884   cat conftest.$ac_ext >&5
18885   rm -rf conftest*
18886   ol_cv_db_db1=no
18887 fi
18888 rm -f conftest*
18889
18890         LIBS="$ol_LIBS"
18891
18892 fi
18893
18894 echo "$ac_t""$ol_cv_db_db1" 1>&6
18895
18896         if test $ol_cv_db_db1 = yes ; then
18897                 ol_cv_lib_db=-ldb1
18898         fi
18899 fi
18900
18901 if test $ol_cv_lib_db = no ; then
18902         echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6
18903 echo "configure:18904: checking for Berkeley DB link (-ldb-1)" >&5
18904 if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then
18905   echo $ac_n "(cached) $ac_c" 1>&6
18906 else
18907   
18908         ol_DB_LIB=-ldb-1
18909         ol_LIBS=$LIBS
18910         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18911
18912         cat > conftest.$ac_ext <<EOF
18913 #line 18914 "configure"
18914 #include "confdefs.h"
18915
18916 #ifdef HAVE_DB_185_H
18917 # include <db_185.h>
18918 #else
18919 # include <db.h>
18920 #endif
18921
18922 #ifndef DB_VERSION_MAJOR
18923 # define DB_VERSION_MAJOR 1
18924 #endif
18925
18926 #ifndef NULL
18927 #define NULL ((void*)0)
18928 #endif
18929
18930 int main() {
18931
18932 #if DB_VERSION_MAJOR > 1
18933         {
18934                 char *version;
18935                 int major, minor, patch;
18936
18937                 version = db_version( &major, &minor, &patch );
18938
18939                 if( major != DB_VERSION_MAJOR ||
18940                         minor < DB_VERSION_MINOR )
18941                 {
18942                         printf("Berkeley DB version mismatch\n"
18943                                 "\texpected: %s\n\tgot: %s\n",
18944                                 DB_VERSION_STRING, version);
18945                         return 1;
18946                 }
18947         }
18948 #endif
18949
18950 #if DB_VERSION_MAJOR > 2
18951         db_env_create( NULL, 0 );
18952 #elif DB_VERSION_MAJOR > 1
18953         db_appexit( NULL );
18954 #else
18955         (void) dbopen( NULL, 0, 0, 0, NULL);
18956 #endif
18957
18958 ; return 0; }
18959 EOF
18960 if { (eval echo configure:18961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18961   rm -rf conftest*
18962   ol_cv_db_db_1=yes
18963 else
18964   echo "configure: failed program was:" >&5
18965   cat conftest.$ac_ext >&5
18966   rm -rf conftest*
18967   ol_cv_db_db_1=no
18968 fi
18969 rm -f conftest*
18970
18971         LIBS="$ol_LIBS"
18972
18973 fi
18974
18975 echo "$ac_t""$ol_cv_db_db_1" 1>&6
18976
18977         if test $ol_cv_db_db_1 = yes ; then
18978                 ol_cv_lib_db=-ldb-1
18979         fi
18980 fi
18981
18982
18983         if test "$ol_cv_lib_db" != no ; then
18984                 ol_cv_berkeley_db=yes
18985                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
18986 echo "configure:18987: checking for Berkeley DB thread support" >&5
18987 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
18988   echo $ac_n "(cached) $ac_c" 1>&6
18989 else
18990   
18991         ol_LIBS="$LIBS"
18992         LIBS="$LTHREAD_LIBS $LIBS"
18993         if test $ol_cv_lib_db != yes ; then
18994                 LIBS="$ol_cv_lib_db $LIBS"
18995         fi
18996
18997         if test "$cross_compiling" = yes; then
18998   ol_cv_berkeley_db_thread=cross
18999 else
19000   cat > conftest.$ac_ext <<EOF
19001 #line 19002 "configure"
19002 #include "confdefs.h"
19003
19004 #ifdef HAVE_DB_185_H
19005         choke me;
19006 #else
19007 #include <db.h>
19008 #endif
19009 #ifndef NULL
19010 #define NULL ((void *)0)
19011 #endif
19012 main()
19013 {
19014         int rc;
19015         u_int32_t flags = DB_CREATE |
19016 #ifdef DB_PRIVATE
19017                 DB_PRIVATE |
19018 #endif
19019                 DB_THREAD;
19020
19021 #if DB_VERSION_MAJOR > 2
19022         DB_ENV *env = NULL;
19023
19024         rc = db_env_create( &env, 0 );
19025
19026         flags |= DB_INIT_MPOOL;
19027 #ifdef DB_MPOOL_PRIVATE
19028         flags |= DB_MPOOL_PRIVATE;
19029 #endif
19030
19031         if( rc ) {
19032                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
19033                 return rc;
19034         }
19035
19036 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
19037         rc = env->open( env, NULL, flags, 0 );
19038 #else
19039         rc = env->open( env, NULL, NULL, flags, 0 );
19040 #endif
19041
19042         if ( rc == 0 ) {
19043                 rc = env->close( env, 0 );
19044         }
19045
19046         if( rc ) {
19047                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
19048                 return rc;
19049         }
19050
19051 #else
19052         DB_ENV env;
19053         memset( &env, '\0', sizeof(env) );
19054
19055         rc = db_appinit( NULL, NULL, &env, flags );
19056
19057         if( rc == 0 ) {
19058                 db_appexit( &env );
19059         }
19060
19061         unlink("__db_mpool.share");
19062         unlink("__db_lock.share");
19063 #endif
19064
19065         return rc;
19066 }
19067 EOF
19068 if { (eval echo configure:19069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
19069 then
19070   ol_cv_berkeley_db_thread=yes
19071 else
19072   echo "configure: failed program was:" >&5
19073   cat conftest.$ac_ext >&5
19074   rm -fr conftest*
19075   ol_cv_berkeley_db_thread=no
19076 fi
19077 rm -fr conftest*
19078 fi
19079
19080
19081         LIBS="$ol_LIBS"
19082
19083 fi
19084
19085 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
19086
19087         if test $ol_cv_berkeley_db_thread != no ; then
19088                 cat >> confdefs.h <<\EOF
19089 #define HAVE_BERKELEY_DB_THREAD 1
19090 EOF
19091
19092         fi
19093
19094         fi
19095 fi
19096
19097         fi
19098
19099         if test $ol_cv_berkeley_db != no ; then
19100                 cat >> confdefs.h <<\EOF
19101 #define HAVE_BERKELEY_DB 1
19102 EOF
19103
19104
19105                 ol_link_ldbm=berkeley
19106                 ol_with_ldbm_api=berkeley
19107
19108                 if test $ol_with_ldbm_type = hash ; then
19109                         cat >> confdefs.h <<\EOF
19110 #define LDBM_USE_DBHASH 1
19111 EOF
19112
19113                 else
19114                         cat >> confdefs.h <<\EOF
19115 #define LDBM_USE_DBBTREE 1
19116 EOF
19117
19118                 fi
19119
19120                                                 if test $ol_cv_lib_db != yes ; then
19121                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
19122                 fi
19123         fi
19124 fi
19125
19126 if test $ol_enable_bdb = yes -a $ol_link_ldbm != berkeley ; then
19127         { echo "configure: error: BDB: BerkeleyDB not available" 1>&2; exit 1; }
19128 elif test $ol_enable_bdb != no -a $ol_link_ldbm = berkeley ; then
19129         echo $ac_n "checking Berkeley DB version for BDB backend""... $ac_c" 1>&6
19130 echo "configure:19131: checking Berkeley DB version for BDB backend" >&5
19131 if eval "test \"\${ol_cv_bdb_compat+set}\" = set"; then
19132   echo $ac_n "(cached) $ac_c" 1>&6
19133 else
19134   
19135         cat > conftest.$ac_ext <<EOF
19136 #line 19137 "configure"
19137 #include "confdefs.h"
19138
19139 #include <db.h>
19140
19141  /* this check could be improved */
19142 #ifndef DB_VERSION_MAJOR
19143 #       define DB_VERSION_MAJOR 1
19144 #endif
19145 #ifndef DB_VERSION_MINOR
19146 #       define DB_VERSION_MINOR 0
19147 #endif
19148
19149 /* require 4.1 or later */
19150 #if (DB_VERSION_MAJOR >= 4) && (DB_VERSION_MINOR >= 1)
19151         __db_version_compat
19152 #endif
19153         
19154 EOF
19155 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
19156   egrep "__db_version_compat" >/dev/null 2>&1; then
19157   rm -rf conftest*
19158   ol_cv_bdb_compat=yes
19159 else
19160   rm -rf conftest*
19161   ol_cv_bdb_compat=no
19162 fi
19163 rm -f conftest*
19164
19165 fi
19166
19167 echo "$ac_t""$ol_cv_bdb_compat" 1>&6
19168
19169
19170         if test $ol_cv_bdb_compat = yes ; then
19171                 ol_enable_bdb=yes
19172         elif test $ol_enable_bdb = yes ; then
19173                 { echo "configure: error: BDB: BerkeleyDB version incompatible" 1>&2; exit 1; }
19174         else
19175                 ol_enable_bdb=no
19176         fi
19177 fi
19178
19179 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
19180         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
19181         ol_with_ldbm_api=none
19182 fi
19183
19184 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
19185         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
19186 echo "configure:19187: checking for MDBM library" >&5
19187 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
19188   echo $ac_n "(cached) $ac_c" 1>&6
19189 else
19190         ol_LIBS="$LIBS"
19191         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
19192 echo "configure:19193: checking for mdbm_set_chain" >&5
19193 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
19194   echo $ac_n "(cached) $ac_c" 1>&6
19195 else
19196   cat > conftest.$ac_ext <<EOF
19197 #line 19198 "configure"
19198 #include "confdefs.h"
19199 /* System header to define __stub macros and hopefully few prototypes,
19200     which can conflict with char mdbm_set_chain(); below.  */
19201 #include <assert.h>
19202 /* Override any gcc2 internal prototype to avoid an error.  */
19203 /* We use char because int might match the return type of a gcc2
19204     builtin and then its argument prototype would still apply.  */
19205 char mdbm_set_chain();
19206 char (*f)();
19207
19208 int main() {
19209
19210 /* The GNU C library defines this for functions which it implements
19211     to always fail with ENOSYS.  Some functions are actually named
19212     something starting with __ and the normal name is an alias.  */
19213 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
19214 choke me
19215 #else
19216 f = mdbm_set_chain;
19217 #endif
19218
19219 ; return 0; }
19220 EOF
19221 if { (eval echo configure:19222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19222   rm -rf conftest*
19223   eval "ac_cv_func_mdbm_set_chain=yes"
19224 else
19225   echo "configure: failed program was:" >&5
19226   cat conftest.$ac_ext >&5
19227   rm -rf conftest*
19228   eval "ac_cv_func_mdbm_set_chain=no"
19229 fi
19230 rm -f conftest*
19231 fi
19232
19233 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
19234   echo "$ac_t""yes" 1>&6
19235   ol_cv_lib_mdbm=yes
19236 else
19237   echo "$ac_t""no" 1>&6
19238
19239                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
19240 echo "configure:19241: checking for mdbm_set_chain in -lmdbm" >&5
19241 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
19242 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19243   echo $ac_n "(cached) $ac_c" 1>&6
19244 else
19245   ac_save_LIBS="$LIBS"
19246 LIBS="-lmdbm  $LIBS"
19247 cat > conftest.$ac_ext <<EOF
19248 #line 19249 "configure"
19249 #include "confdefs.h"
19250 /* Override any gcc2 internal prototype to avoid an error.  */
19251 /* We use char because int might match the return type of a gcc2
19252     builtin and then its argument prototype would still apply.  */
19253 char mdbm_set_chain();
19254
19255 int main() {
19256 mdbm_set_chain()
19257 ; return 0; }
19258 EOF
19259 if { (eval echo configure:19260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19260   rm -rf conftest*
19261   eval "ac_cv_lib_$ac_lib_var=yes"
19262 else
19263   echo "configure: failed program was:" >&5
19264   cat conftest.$ac_ext >&5
19265   rm -rf conftest*
19266   eval "ac_cv_lib_$ac_lib_var=no"
19267 fi
19268 rm -f conftest*
19269 LIBS="$ac_save_LIBS"
19270
19271 fi
19272 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19273   echo "$ac_t""yes" 1>&6
19274   ol_cv_lib_mdbm=-lmdbm
19275 else
19276   echo "$ac_t""no" 1>&6
19277 ol_cv_lib_mdbm=no
19278 fi
19279
19280         
19281 fi
19282
19283         LIBS="$ol_LIBS"
19284
19285 fi
19286
19287 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
19288
19289
19290  for ac_hdr in mdbm.h
19291 do
19292 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19293 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19294 echo "configure:19295: checking for $ac_hdr" >&5
19295 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19296   echo $ac_n "(cached) $ac_c" 1>&6
19297 else
19298   cat > conftest.$ac_ext <<EOF
19299 #line 19300 "configure"
19300 #include "confdefs.h"
19301 #include <$ac_hdr>
19302 EOF
19303 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19304 { (eval echo configure:19305: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19305 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19306 if test -z "$ac_err"; then
19307   rm -rf conftest*
19308   eval "ac_cv_header_$ac_safe=yes"
19309 else
19310   echo "$ac_err" >&5
19311   echo "configure: failed program was:" >&5
19312   cat conftest.$ac_ext >&5
19313   rm -rf conftest*
19314   eval "ac_cv_header_$ac_safe=no"
19315 fi
19316 rm -f conftest*
19317 fi
19318 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19319   echo "$ac_t""yes" 1>&6
19320     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19321   cat >> confdefs.h <<EOF
19322 #define $ac_tr_hdr 1
19323 EOF
19324  
19325 else
19326   echo "$ac_t""no" 1>&6
19327 fi
19328 done
19329
19330  echo $ac_n "checking for db""... $ac_c" 1>&6
19331 echo "configure:19332: checking for db" >&5
19332 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
19333   echo $ac_n "(cached) $ac_c" 1>&6
19334 else
19335   
19336         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
19337                 ol_cv_mdbm=no
19338         else
19339                 ol_cv_mdbm=yes
19340         fi
19341
19342 fi
19343
19344 echo "$ac_t""$ol_cv_mdbm" 1>&6
19345  if test $ol_cv_mdbm = yes ; then
19346         cat >> confdefs.h <<\EOF
19347 #define HAVE_MDBM 1
19348 EOF
19349
19350  fi
19351
19352
19353         if test $ol_cv_mdbm = yes ; then
19354                 ol_link_ldbm=mdbm
19355                 ol_with_ldbm_api=mdbm
19356                 if test $ol_cv_lib_mdbm != yes ; then
19357                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
19358                 fi
19359         fi
19360 fi
19361
19362 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
19363         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
19364 echo "configure:19365: checking for GDBM library" >&5
19365 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
19366   echo $ac_n "(cached) $ac_c" 1>&6
19367 else
19368         ol_LIBS="$LIBS"
19369         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
19370 echo "configure:19371: checking for gdbm_open" >&5
19371 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
19372   echo $ac_n "(cached) $ac_c" 1>&6
19373 else
19374   cat > conftest.$ac_ext <<EOF
19375 #line 19376 "configure"
19376 #include "confdefs.h"
19377 /* System header to define __stub macros and hopefully few prototypes,
19378     which can conflict with char gdbm_open(); below.  */
19379 #include <assert.h>
19380 /* Override any gcc2 internal prototype to avoid an error.  */
19381 /* We use char because int might match the return type of a gcc2
19382     builtin and then its argument prototype would still apply.  */
19383 char gdbm_open();
19384 char (*f)();
19385
19386 int main() {
19387
19388 /* The GNU C library defines this for functions which it implements
19389     to always fail with ENOSYS.  Some functions are actually named
19390     something starting with __ and the normal name is an alias.  */
19391 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
19392 choke me
19393 #else
19394 f = gdbm_open;
19395 #endif
19396
19397 ; return 0; }
19398 EOF
19399 if { (eval echo configure:19400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19400   rm -rf conftest*
19401   eval "ac_cv_func_gdbm_open=yes"
19402 else
19403   echo "configure: failed program was:" >&5
19404   cat conftest.$ac_ext >&5
19405   rm -rf conftest*
19406   eval "ac_cv_func_gdbm_open=no"
19407 fi
19408 rm -f conftest*
19409 fi
19410
19411 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
19412   echo "$ac_t""yes" 1>&6
19413   ol_cv_lib_gdbm=yes
19414 else
19415   echo "$ac_t""no" 1>&6
19416
19417                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
19418 echo "configure:19419: checking for gdbm_open in -lgdbm" >&5
19419 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
19420 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19421   echo $ac_n "(cached) $ac_c" 1>&6
19422 else
19423   ac_save_LIBS="$LIBS"
19424 LIBS="-lgdbm  $LIBS"
19425 cat > conftest.$ac_ext <<EOF
19426 #line 19427 "configure"
19427 #include "confdefs.h"
19428 /* Override any gcc2 internal prototype to avoid an error.  */
19429 /* We use char because int might match the return type of a gcc2
19430     builtin and then its argument prototype would still apply.  */
19431 char gdbm_open();
19432
19433 int main() {
19434 gdbm_open()
19435 ; return 0; }
19436 EOF
19437 if { (eval echo configure:19438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19438   rm -rf conftest*
19439   eval "ac_cv_lib_$ac_lib_var=yes"
19440 else
19441   echo "configure: failed program was:" >&5
19442   cat conftest.$ac_ext >&5
19443   rm -rf conftest*
19444   eval "ac_cv_lib_$ac_lib_var=no"
19445 fi
19446 rm -f conftest*
19447 LIBS="$ac_save_LIBS"
19448
19449 fi
19450 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19451   echo "$ac_t""yes" 1>&6
19452   ol_cv_lib_gdbm=-lgdbm
19453 else
19454   echo "$ac_t""no" 1>&6
19455 ol_cv_lib_gdbm=no
19456 fi
19457
19458         
19459 fi
19460
19461         LIBS="$ol_LIBS"
19462
19463 fi
19464
19465 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
19466
19467
19468  for ac_hdr in gdbm.h
19469 do
19470 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19471 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19472 echo "configure:19473: checking for $ac_hdr" >&5
19473 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19474   echo $ac_n "(cached) $ac_c" 1>&6
19475 else
19476   cat > conftest.$ac_ext <<EOF
19477 #line 19478 "configure"
19478 #include "confdefs.h"
19479 #include <$ac_hdr>
19480 EOF
19481 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19482 { (eval echo configure:19483: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19483 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19484 if test -z "$ac_err"; then
19485   rm -rf conftest*
19486   eval "ac_cv_header_$ac_safe=yes"
19487 else
19488   echo "$ac_err" >&5
19489   echo "configure: failed program was:" >&5
19490   cat conftest.$ac_ext >&5
19491   rm -rf conftest*
19492   eval "ac_cv_header_$ac_safe=no"
19493 fi
19494 rm -f conftest*
19495 fi
19496 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19497   echo "$ac_t""yes" 1>&6
19498     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19499   cat >> confdefs.h <<EOF
19500 #define $ac_tr_hdr 1
19501 EOF
19502  
19503 else
19504   echo "$ac_t""no" 1>&6
19505 fi
19506 done
19507
19508  echo $ac_n "checking for db""... $ac_c" 1>&6
19509 echo "configure:19510: checking for db" >&5
19510 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
19511   echo $ac_n "(cached) $ac_c" 1>&6
19512 else
19513   
19514         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
19515                 ol_cv_gdbm=no
19516         else
19517                 ol_cv_gdbm=yes
19518         fi
19519
19520 fi
19521
19522 echo "$ac_t""$ol_cv_gdbm" 1>&6
19523  if test $ol_cv_gdbm = yes ; then
19524         cat >> confdefs.h <<\EOF
19525 #define HAVE_GDBM 1
19526 EOF
19527
19528  fi
19529
19530
19531         if test $ol_cv_gdbm = yes ; then
19532                 ol_link_ldbm=gdbm
19533                 ol_with_ldbm_api=gdbm
19534
19535                 if test $ol_cv_lib_gdbm != yes ; then
19536                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
19537                 fi
19538         fi
19539 fi
19540
19541 if test $ol_with_ldbm_api = ndbm ; then
19542         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
19543 echo "configure:19544: checking for NDBM library" >&5
19544 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
19545   echo $ac_n "(cached) $ac_c" 1>&6
19546 else
19547         ol_LIBS="$LIBS"
19548         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
19549 echo "configure:19550: checking for dbm_open" >&5
19550 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
19551   echo $ac_n "(cached) $ac_c" 1>&6
19552 else
19553   cat > conftest.$ac_ext <<EOF
19554 #line 19555 "configure"
19555 #include "confdefs.h"
19556 /* System header to define __stub macros and hopefully few prototypes,
19557     which can conflict with char dbm_open(); below.  */
19558 #include <assert.h>
19559 /* Override any gcc2 internal prototype to avoid an error.  */
19560 /* We use char because int might match the return type of a gcc2
19561     builtin and then its argument prototype would still apply.  */
19562 char dbm_open();
19563 char (*f)();
19564
19565 int main() {
19566
19567 /* The GNU C library defines this for functions which it implements
19568     to always fail with ENOSYS.  Some functions are actually named
19569     something starting with __ and the normal name is an alias.  */
19570 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
19571 choke me
19572 #else
19573 f = dbm_open;
19574 #endif
19575
19576 ; return 0; }
19577 EOF
19578 if { (eval echo configure:19579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19579   rm -rf conftest*
19580   eval "ac_cv_func_dbm_open=yes"
19581 else
19582   echo "configure: failed program was:" >&5
19583   cat conftest.$ac_ext >&5
19584   rm -rf conftest*
19585   eval "ac_cv_func_dbm_open=no"
19586 fi
19587 rm -f conftest*
19588 fi
19589
19590 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
19591   echo "$ac_t""yes" 1>&6
19592   ol_cv_lib_ndbm=yes
19593 else
19594   echo "$ac_t""no" 1>&6
19595
19596                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
19597 echo "configure:19598: checking for dbm_open in -lndbm" >&5
19598 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
19599 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19600   echo $ac_n "(cached) $ac_c" 1>&6
19601 else
19602   ac_save_LIBS="$LIBS"
19603 LIBS="-lndbm  $LIBS"
19604 cat > conftest.$ac_ext <<EOF
19605 #line 19606 "configure"
19606 #include "confdefs.h"
19607 /* Override any gcc2 internal prototype to avoid an error.  */
19608 /* We use char because int might match the return type of a gcc2
19609     builtin and then its argument prototype would still apply.  */
19610 char dbm_open();
19611
19612 int main() {
19613 dbm_open()
19614 ; return 0; }
19615 EOF
19616 if { (eval echo configure:19617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19617   rm -rf conftest*
19618   eval "ac_cv_lib_$ac_lib_var=yes"
19619 else
19620   echo "configure: failed program was:" >&5
19621   cat conftest.$ac_ext >&5
19622   rm -rf conftest*
19623   eval "ac_cv_lib_$ac_lib_var=no"
19624 fi
19625 rm -f conftest*
19626 LIBS="$ac_save_LIBS"
19627
19628 fi
19629 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19630   echo "$ac_t""yes" 1>&6
19631   ol_cv_lib_ndbm=-lndbm
19632 else
19633   echo "$ac_t""no" 1>&6
19634
19635                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
19636 echo "configure:19637: checking for dbm_open in -ldbm" >&5
19637 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
19638 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19639   echo $ac_n "(cached) $ac_c" 1>&6
19640 else
19641   ac_save_LIBS="$LIBS"
19642 LIBS="-ldbm  $LIBS"
19643 cat > conftest.$ac_ext <<EOF
19644 #line 19645 "configure"
19645 #include "confdefs.h"
19646 /* Override any gcc2 internal prototype to avoid an error.  */
19647 /* We use char because int might match the return type of a gcc2
19648     builtin and then its argument prototype would still apply.  */
19649 char dbm_open();
19650
19651 int main() {
19652 dbm_open()
19653 ; return 0; }
19654 EOF
19655 if { (eval echo configure:19656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19656   rm -rf conftest*
19657   eval "ac_cv_lib_$ac_lib_var=yes"
19658 else
19659   echo "configure: failed program was:" >&5
19660   cat conftest.$ac_ext >&5
19661   rm -rf conftest*
19662   eval "ac_cv_lib_$ac_lib_var=no"
19663 fi
19664 rm -f conftest*
19665 LIBS="$ac_save_LIBS"
19666
19667 fi
19668 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19669   echo "$ac_t""yes" 1>&6
19670   ol_cv_lib_ndbm=-ldbm
19671 else
19672   echo "$ac_t""no" 1>&6
19673 ol_cv_lib_ndbm=no
19674 fi
19675                 
19676 fi
19677
19678         
19679 fi
19680
19681         LIBS="$ol_LIBS"
19682
19683 fi
19684
19685 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
19686
19687
19688  for ac_hdr in ndbm.h
19689 do
19690 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19691 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19692 echo "configure:19693: checking for $ac_hdr" >&5
19693 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19694   echo $ac_n "(cached) $ac_c" 1>&6
19695 else
19696   cat > conftest.$ac_ext <<EOF
19697 #line 19698 "configure"
19698 #include "confdefs.h"
19699 #include <$ac_hdr>
19700 EOF
19701 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19702 { (eval echo configure:19703: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19703 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19704 if test -z "$ac_err"; then
19705   rm -rf conftest*
19706   eval "ac_cv_header_$ac_safe=yes"
19707 else
19708   echo "$ac_err" >&5
19709   echo "configure: failed program was:" >&5
19710   cat conftest.$ac_ext >&5
19711   rm -rf conftest*
19712   eval "ac_cv_header_$ac_safe=no"
19713 fi
19714 rm -f conftest*
19715 fi
19716 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19717   echo "$ac_t""yes" 1>&6
19718     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19719   cat >> confdefs.h <<EOF
19720 #define $ac_tr_hdr 1
19721 EOF
19722  
19723 else
19724   echo "$ac_t""no" 1>&6
19725 fi
19726 done
19727
19728  echo $ac_n "checking for db""... $ac_c" 1>&6
19729 echo "configure:19730: checking for db" >&5
19730 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
19731   echo $ac_n "(cached) $ac_c" 1>&6
19732 else
19733   
19734         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
19735                 ol_cv_ndbm=no
19736         else
19737                 ol_cv_ndbm=yes
19738         fi
19739
19740 fi
19741
19742 echo "$ac_t""$ol_cv_ndbm" 1>&6
19743  if test $ol_cv_ndbm = yes ; then
19744         cat >> confdefs.h <<\EOF
19745 #define HAVE_NDBM 1
19746 EOF
19747
19748  fi
19749
19750
19751         if test $ol_cv_ndbm = yes ; then
19752                 ol_link_ldbm=ndbm
19753                 ol_with_ldbm_api=ndbm
19754
19755                 if test $ol_cv_lib_ndbm != yes ; then
19756                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
19757                 fi
19758         fi
19759 fi
19760
19761 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
19762         echo "configure: warning: could not find suitable LDBM backend" 1>&2
19763         if test $ol_enable_ldbm = yes ; then
19764                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
19765         fi
19766
19767         echo "configure: warning: disabling LDBM" 1>&2
19768         ol_enable_ldbm=no
19769 fi
19770
19771
19772 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
19773         BUILD_LIBS_DYNAMIC=shared
19774         cat >> confdefs.h <<\EOF
19775 #define LDAP_LIBS_DYNAMIC 1
19776 EOF
19777
19778         LTSTATIC=""
19779 else
19780         BUILD_LIBS_DYNAMIC=static
19781         LTSTATIC="-static"
19782 fi
19783
19784 if test $ol_enable_wrappers != no ; then
19785         for ac_hdr in tcpd.h
19786 do
19787 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19788 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19789 echo "configure:19790: checking for $ac_hdr" >&5
19790 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19791   echo $ac_n "(cached) $ac_c" 1>&6
19792 else
19793   cat > conftest.$ac_ext <<EOF
19794 #line 19795 "configure"
19795 #include "confdefs.h"
19796 #include <$ac_hdr>
19797 EOF
19798 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19799 { (eval echo configure:19800: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19800 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19801 if test -z "$ac_err"; then
19802   rm -rf conftest*
19803   eval "ac_cv_header_$ac_safe=yes"
19804 else
19805   echo "$ac_err" >&5
19806   echo "configure: failed program was:" >&5
19807   cat conftest.$ac_ext >&5
19808   rm -rf conftest*
19809   eval "ac_cv_header_$ac_safe=no"
19810 fi
19811 rm -f conftest*
19812 fi
19813 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19814   echo "$ac_t""yes" 1>&6
19815     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19816   cat >> confdefs.h <<EOF
19817 #define $ac_tr_hdr 1
19818 EOF
19819  
19820                 echo $ac_n "checking for TCP wrappers library""... $ac_c" 1>&6
19821 echo "configure:19822: checking for TCP wrappers library" >&5
19822                 save_LIBS="$LIBS"
19823                 LIBS="$LIBS -lwrap"
19824                 cat > conftest.$ac_ext <<EOF
19825 #line 19826 "configure"
19826 #include "confdefs.h"
19827
19828 #include <tcpd.h>
19829 int allow_severity = 0;
19830 int deny_severity  = 0;
19831
19832 struct request_info *req;
19833                 
19834 int main() {
19835
19836 hosts_access(req)
19837                 
19838 ; return 0; }
19839 EOF
19840 if { (eval echo configure:19841: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19841   rm -rf conftest*
19842   echo "$ac_t""-lwrap" 1>&6
19843                 have_wrappers=yes
19844                 LIBS="$save_LIBS"
19845 else
19846   echo "configure: failed program was:" >&5
19847   cat conftest.$ac_ext >&5
19848   rm -rf conftest*
19849   
19850                                 LIBS="$LIBS -lnsl"
19851                 cat > conftest.$ac_ext <<EOF
19852 #line 19853 "configure"
19853 #include "confdefs.h"
19854
19855 #include <tcpd.h>
19856 int allow_severity = 0;
19857 int deny_severity  = 0;
19858
19859 struct request_info *req;
19860                 
19861 int main() {
19862
19863 hosts_access(req)
19864                 
19865 ; return 0; }
19866 EOF
19867 if { (eval echo configure:19868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19868   rm -rf conftest*
19869   echo "$ac_t""-lwrap -lnsl" 1>&6
19870                 have_wrappers=yes
19871                 LIBS="$save_LIBS -lnsl"
19872 else
19873   echo "configure: failed program was:" >&5
19874   cat conftest.$ac_ext >&5
19875   rm -rf conftest*
19876   
19877                 echo "$ac_t""no" 1>&6
19878                 have_wrappers=no
19879                 LIBS=$save_LIBS
19880 fi
19881 rm -f conftest*
19882 fi
19883 rm -f conftest*
19884 else
19885   echo "$ac_t""no" 1>&6
19886 have_wrappers=no
19887 fi
19888 done
19889
19890
19891         if test $have_wrappers = yes ; then
19892                 cat >> confdefs.h <<\EOF
19893 #define HAVE_TCPD 1
19894 EOF
19895
19896                 WRAP_LIBS="-lwrap"
19897         elif test $ol_enable_wrappers = yes ; then
19898                 { echo "configure: error: could not find TCP wrappers, select apppropriate options ore disable" 1>&2; exit 1; }
19899         else
19900                 echo "configure: warning: could not find TCP wrappers, support disabled" 1>&2
19901                 WRAP_LIBS=""
19902         fi
19903 fi
19904
19905 if test $ol_enable_syslog != no ; then
19906         echo $ac_n "checking for openlog""... $ac_c" 1>&6
19907 echo "configure:19908: checking for openlog" >&5
19908 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
19909   echo $ac_n "(cached) $ac_c" 1>&6
19910 else
19911   cat > conftest.$ac_ext <<EOF
19912 #line 19913 "configure"
19913 #include "confdefs.h"
19914 /* System header to define __stub macros and hopefully few prototypes,
19915     which can conflict with char openlog(); below.  */
19916 #include <assert.h>
19917 /* Override any gcc2 internal prototype to avoid an error.  */
19918 /* We use char because int might match the return type of a gcc2
19919     builtin and then its argument prototype would still apply.  */
19920 char openlog();
19921 char (*f)();
19922
19923 int main() {
19924
19925 /* The GNU C library defines this for functions which it implements
19926     to always fail with ENOSYS.  Some functions are actually named
19927     something starting with __ and the normal name is an alias.  */
19928 #if defined (__stub_openlog) || defined (__stub___openlog)
19929 choke me
19930 #else
19931 f = openlog;
19932 #endif
19933
19934 ; return 0; }
19935 EOF
19936 if { (eval echo configure:19937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19937   rm -rf conftest*
19938   eval "ac_cv_func_openlog=yes"
19939 else
19940   echo "configure: failed program was:" >&5
19941   cat conftest.$ac_ext >&5
19942   rm -rf conftest*
19943   eval "ac_cv_func_openlog=no"
19944 fi
19945 rm -f conftest*
19946 fi
19947
19948 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
19949   echo "$ac_t""yes" 1>&6
19950   :
19951 else
19952   echo "$ac_t""no" 1>&6
19953 fi
19954
19955         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
19956                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
19957         fi
19958         ol_enable_syslog=$ac_cv_func_openlog
19959 fi
19960
19961
19962 ol_link_sql=no
19963 if test $ol_enable_sql != no ; then
19964         for ac_hdr in sql.h sqlext.h
19965 do
19966 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19967 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19968 echo "configure:19969: checking for $ac_hdr" >&5
19969 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19970   echo $ac_n "(cached) $ac_c" 1>&6
19971 else
19972   cat > conftest.$ac_ext <<EOF
19973 #line 19974 "configure"
19974 #include "confdefs.h"
19975 #include <$ac_hdr>
19976 EOF
19977 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19978 { (eval echo configure:19979: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19979 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19980 if test -z "$ac_err"; then
19981   rm -rf conftest*
19982   eval "ac_cv_header_$ac_safe=yes"
19983 else
19984   echo "$ac_err" >&5
19985   echo "configure: failed program was:" >&5
19986   cat conftest.$ac_ext >&5
19987   rm -rf conftest*
19988   eval "ac_cv_header_$ac_safe=no"
19989 fi
19990 rm -f conftest*
19991 fi
19992 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19993   echo "$ac_t""yes" 1>&6
19994     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19995   cat >> confdefs.h <<EOF
19996 #define $ac_tr_hdr 1
19997 EOF
19998  
19999 else
20000   echo "$ac_t""no" 1>&6
20001 { echo "configure: error: could not locate SQL headers" 1>&2; exit 1; }
20002         
20003 fi
20004 done
20005
20006
20007         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
20008 echo "configure:20009: checking for SQLDriverConnect in -liodbc" >&5
20009 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
20010 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20011   echo $ac_n "(cached) $ac_c" 1>&6
20012 else
20013   ac_save_LIBS="$LIBS"
20014 LIBS="-liodbc  $LIBS"
20015 cat > conftest.$ac_ext <<EOF
20016 #line 20017 "configure"
20017 #include "confdefs.h"
20018 /* Override any gcc2 internal prototype to avoid an error.  */
20019 /* We use char because int might match the return type of a gcc2
20020     builtin and then its argument prototype would still apply.  */
20021 char SQLDriverConnect();
20022
20023 int main() {
20024 SQLDriverConnect()
20025 ; return 0; }
20026 EOF
20027 if { (eval echo configure:20028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20028   rm -rf conftest*
20029   eval "ac_cv_lib_$ac_lib_var=yes"
20030 else
20031   echo "configure: failed program was:" >&5
20032   cat conftest.$ac_ext >&5
20033   rm -rf conftest*
20034   eval "ac_cv_lib_$ac_lib_var=no"
20035 fi
20036 rm -f conftest*
20037 LIBS="$ac_save_LIBS"
20038
20039 fi
20040 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20041   echo "$ac_t""yes" 1>&6
20042   have_iodbc=yes
20043 else
20044   echo "$ac_t""no" 1>&6
20045 have_iodbc=no
20046 fi
20047
20048         if test $have_iodbc = yes ; then
20049                 ol_link_sql="-liodbc"
20050         else
20051                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
20052 echo "configure:20053: checking for SQLDriverConnect in -lodbc" >&5
20053 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
20054 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20055   echo $ac_n "(cached) $ac_c" 1>&6
20056 else
20057   ac_save_LIBS="$LIBS"
20058 LIBS="-lodbc  $LIBS"
20059 cat > conftest.$ac_ext <<EOF
20060 #line 20061 "configure"
20061 #include "confdefs.h"
20062 /* Override any gcc2 internal prototype to avoid an error.  */
20063 /* We use char because int might match the return type of a gcc2
20064     builtin and then its argument prototype would still apply.  */
20065 char SQLDriverConnect();
20066
20067 int main() {
20068 SQLDriverConnect()
20069 ; return 0; }
20070 EOF
20071 if { (eval echo configure:20072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20072   rm -rf conftest*
20073   eval "ac_cv_lib_$ac_lib_var=yes"
20074 else
20075   echo "configure: failed program was:" >&5
20076   cat conftest.$ac_ext >&5
20077   rm -rf conftest*
20078   eval "ac_cv_lib_$ac_lib_var=no"
20079 fi
20080 rm -f conftest*
20081 LIBS="$ac_save_LIBS"
20082
20083 fi
20084 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20085   echo "$ac_t""yes" 1>&6
20086   have_odbc=yes
20087 else
20088   echo "$ac_t""no" 1>&6
20089 have_odbc=no
20090 fi
20091
20092                 if test $have_odbc = yes ; then
20093                         ol_link_sql="-lodbc"
20094                 fi
20095         fi
20096
20097         if test $ol_link_sql != no ; then
20098                 SLAPD_SQL_LIBS="$ol_link_sql"
20099
20100         elif test $ol_enable_sql != auto ; then
20101                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
20102         fi
20103 fi
20104
20105 if test $ol_enable_tcl != no ; then
20106         for ac_hdr in tcl.h
20107 do
20108 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20109 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20110 echo "configure:20111: checking for $ac_hdr" >&5
20111 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20112   echo $ac_n "(cached) $ac_c" 1>&6
20113 else
20114   cat > conftest.$ac_ext <<EOF
20115 #line 20116 "configure"
20116 #include "confdefs.h"
20117 #include <$ac_hdr>
20118 EOF
20119 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20120 { (eval echo configure:20121: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20121 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20122 if test -z "$ac_err"; then
20123   rm -rf conftest*
20124   eval "ac_cv_header_$ac_safe=yes"
20125 else
20126   echo "$ac_err" >&5
20127   echo "configure: failed program was:" >&5
20128   cat conftest.$ac_ext >&5
20129   rm -rf conftest*
20130   eval "ac_cv_header_$ac_safe=no"
20131 fi
20132 rm -f conftest*
20133 fi
20134 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20135   echo "$ac_t""yes" 1>&6
20136     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20137   cat >> confdefs.h <<EOF
20138 #define $ac_tr_hdr 1
20139 EOF
20140  
20141 else
20142   echo "$ac_t""no" 1>&6
20143 fi
20144 done
20145
20146
20147         if test $ac_cv_header_tcl_h != yes ; then
20148                 have_tcl=no
20149         else
20150                 for lib in tcl tcl7.6 tcl8.0 tcl8.2 ; do
20151                         echo $ac_n "checking for main in -l$lib""... $ac_c" 1>&6
20152 echo "configure:20153: checking for main in -l$lib" >&5
20153 ac_lib_var=`echo $lib'_'main | sed 'y%./+-:%__p__%'`
20154 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20155   echo $ac_n "(cached) $ac_c" 1>&6
20156 else
20157   ac_save_LIBS="$LIBS"
20158 LIBS="-l$lib  $LIBS"
20159 cat > conftest.$ac_ext <<EOF
20160 #line 20161 "configure"
20161 #include "confdefs.h"
20162
20163 int main() {
20164 main()
20165 ; return 0; }
20166 EOF
20167 if { (eval echo configure:20168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20168   rm -rf conftest*
20169   eval "ac_cv_lib_$ac_lib_var=yes"
20170 else
20171   echo "configure: failed program was:" >&5
20172   cat conftest.$ac_ext >&5
20173   rm -rf conftest*
20174   eval "ac_cv_lib_$ac_lib_var=no"
20175 fi
20176 rm -f conftest*
20177 LIBS="$ac_save_LIBS"
20178
20179 fi
20180 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20181   echo "$ac_t""yes" 1>&6
20182   have_tcl=yes
20183                            if test x"$ol_with_tcl_module" = "xstatic" ; then
20184                                         SLAPD_LIBS="$SLAPD_LIBS -l${lib}"
20185                            else
20186                                         MOD_TCL_LIB="-l${lib}"
20187                            fi;break
20188 else
20189   echo "$ac_t""no" 1>&6
20190 have_tcl=no
20191 fi
20192
20193                 done
20194         fi
20195
20196         if test $have_tcl != yes ; then
20197                 echo "configure: warning: could not find -ltcl" 1>&2
20198                 if test $ol_enable_tcl = yes ; then
20199                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
20200                 fi
20201
20202                 ol_enable_tcl=no
20203         fi
20204 fi
20205
20206 ol_link_termcap=no
20207 for ac_hdr in termcap.h ncurses.h
20208 do
20209 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20210 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20211 echo "configure:20212: checking for $ac_hdr" >&5
20212 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20213   echo $ac_n "(cached) $ac_c" 1>&6
20214 else
20215   cat > conftest.$ac_ext <<EOF
20216 #line 20217 "configure"
20217 #include "confdefs.h"
20218 #include <$ac_hdr>
20219 EOF
20220 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20221 { (eval echo configure:20222: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20222 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20223 if test -z "$ac_err"; then
20224   rm -rf conftest*
20225   eval "ac_cv_header_$ac_safe=yes"
20226 else
20227   echo "$ac_err" >&5
20228   echo "configure: failed program was:" >&5
20229   cat conftest.$ac_ext >&5
20230   rm -rf conftest*
20231   eval "ac_cv_header_$ac_safe=no"
20232 fi
20233 rm -f conftest*
20234 fi
20235 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20236   echo "$ac_t""yes" 1>&6
20237     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20238   cat >> confdefs.h <<EOF
20239 #define $ac_tr_hdr 1
20240 EOF
20241  
20242 else
20243   echo "$ac_t""no" 1>&6
20244 fi
20245 done
20246
20247
20248 if test $ol_link_termcap = no ; then
20249         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
20250 echo "configure:20251: checking for tputs in -ltermcap" >&5
20251 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
20252 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20253   echo $ac_n "(cached) $ac_c" 1>&6
20254 else
20255   ac_save_LIBS="$LIBS"
20256 LIBS="-ltermcap  $LIBS"
20257 cat > conftest.$ac_ext <<EOF
20258 #line 20259 "configure"
20259 #include "confdefs.h"
20260 /* Override any gcc2 internal prototype to avoid an error.  */
20261 /* We use char because int might match the return type of a gcc2
20262     builtin and then its argument prototype would still apply.  */
20263 char tputs();
20264
20265 int main() {
20266 tputs()
20267 ; return 0; }
20268 EOF
20269 if { (eval echo configure:20270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20270   rm -rf conftest*
20271   eval "ac_cv_lib_$ac_lib_var=yes"
20272 else
20273   echo "configure: failed program was:" >&5
20274   cat conftest.$ac_ext >&5
20275   rm -rf conftest*
20276   eval "ac_cv_lib_$ac_lib_var=no"
20277 fi
20278 rm -f conftest*
20279 LIBS="$ac_save_LIBS"
20280
20281 fi
20282 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20283   echo "$ac_t""yes" 1>&6
20284   have_termcap=yes
20285 else
20286   echo "$ac_t""no" 1>&6
20287 have_termcap=no
20288 fi
20289
20290         if test $have_termcap = yes ; then
20291                 cat >> confdefs.h <<\EOF
20292 #define HAVE_TERMCAP 1
20293 EOF
20294
20295                 ol_link_termcap=yes
20296                 TERMCAP_LIBS=-ltermcap
20297         fi
20298 fi
20299
20300 if test $ol_link_termcap = no ; then
20301         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
20302 echo "configure:20303: checking for initscr in -lncurses" >&5
20303 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
20304 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20305   echo $ac_n "(cached) $ac_c" 1>&6
20306 else
20307   ac_save_LIBS="$LIBS"
20308 LIBS="-lncurses  $LIBS"
20309 cat > conftest.$ac_ext <<EOF
20310 #line 20311 "configure"
20311 #include "confdefs.h"
20312 /* Override any gcc2 internal prototype to avoid an error.  */
20313 /* We use char because int might match the return type of a gcc2
20314     builtin and then its argument prototype would still apply.  */
20315 char initscr();
20316
20317 int main() {
20318 initscr()
20319 ; return 0; }
20320 EOF
20321 if { (eval echo configure:20322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20322   rm -rf conftest*
20323   eval "ac_cv_lib_$ac_lib_var=yes"
20324 else
20325   echo "configure: failed program was:" >&5
20326   cat conftest.$ac_ext >&5
20327   rm -rf conftest*
20328   eval "ac_cv_lib_$ac_lib_var=no"
20329 fi
20330 rm -f conftest*
20331 LIBS="$ac_save_LIBS"
20332
20333 fi
20334 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20335   echo "$ac_t""yes" 1>&6
20336   have_ncurses=yes
20337 else
20338   echo "$ac_t""no" 1>&6
20339 have_ncurses=no
20340 fi
20341
20342         if test $have_ncurses = yes ; then
20343                 cat >> confdefs.h <<\EOF
20344 #define HAVE_NCURSES 1
20345 EOF
20346
20347                 ol_link_termcap=yes
20348                 TERMCAP_LIBS=-lncurses
20349         fi
20350 fi
20351
20352 if test $ol_link_termcap = no ; then
20353         cat >> confdefs.h <<\EOF
20354 #define NO_TERMCAP 1
20355 EOF
20356
20357         TERMCAP_LIBS=
20358 fi
20359
20360 ol_link_sasl=no
20361 ol_link_spasswd=no
20362 if test $ol_with_cyrus_sasl != no ; then
20363         for ac_hdr in sasl/sasl.h sasl.h
20364 do
20365 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20366 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20367 echo "configure:20368: checking for $ac_hdr" >&5
20368 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20369   echo $ac_n "(cached) $ac_c" 1>&6
20370 else
20371   cat > conftest.$ac_ext <<EOF
20372 #line 20373 "configure"
20373 #include "confdefs.h"
20374 #include <$ac_hdr>
20375 EOF
20376 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20377 { (eval echo configure:20378: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20378 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20379 if test -z "$ac_err"; then
20380   rm -rf conftest*
20381   eval "ac_cv_header_$ac_safe=yes"
20382 else
20383   echo "$ac_err" >&5
20384   echo "configure: failed program was:" >&5
20385   cat conftest.$ac_ext >&5
20386   rm -rf conftest*
20387   eval "ac_cv_header_$ac_safe=no"
20388 fi
20389 rm -f conftest*
20390 fi
20391 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20392   echo "$ac_t""yes" 1>&6
20393     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20394   cat >> confdefs.h <<EOF
20395 #define $ac_tr_hdr 1
20396 EOF
20397  
20398 else
20399   echo "$ac_t""no" 1>&6
20400 fi
20401 done
20402
20403
20404         if test $ac_cv_header_sasl_sasl_h = yes -o $ac_cv_header_sasl_h = yes; then
20405                 echo $ac_n "checking for sasl_client_init in -lsasl2""... $ac_c" 1>&6
20406 echo "configure:20407: checking for sasl_client_init in -lsasl2" >&5
20407 ac_lib_var=`echo sasl2'_'sasl_client_init | sed 'y%./+-:%__p__%'`
20408 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20409   echo $ac_n "(cached) $ac_c" 1>&6
20410 else
20411   ac_save_LIBS="$LIBS"
20412 LIBS="-lsasl2  $LIBS"
20413 cat > conftest.$ac_ext <<EOF
20414 #line 20415 "configure"
20415 #include "confdefs.h"
20416 /* Override any gcc2 internal prototype to avoid an error.  */
20417 /* We use char because int might match the return type of a gcc2
20418     builtin and then its argument prototype would still apply.  */
20419 char sasl_client_init();
20420
20421 int main() {
20422 sasl_client_init()
20423 ; return 0; }
20424 EOF
20425 if { (eval echo configure:20426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20426   rm -rf conftest*
20427   eval "ac_cv_lib_$ac_lib_var=yes"
20428 else
20429   echo "configure: failed program was:" >&5
20430   cat conftest.$ac_ext >&5
20431   rm -rf conftest*
20432   eval "ac_cv_lib_$ac_lib_var=no"
20433 fi
20434 rm -f conftest*
20435 LIBS="$ac_save_LIBS"
20436
20437 fi
20438 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20439   echo "$ac_t""yes" 1>&6
20440   ol_link_sasl="-lsasl2"
20441 else
20442   echo "$ac_t""no" 1>&6
20443 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
20444 echo "configure:20445: checking for sasl_client_init in -lsasl" >&5
20445 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
20446 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20447   echo $ac_n "(cached) $ac_c" 1>&6
20448 else
20449   ac_save_LIBS="$LIBS"
20450 LIBS="-lsasl  $LIBS"
20451 cat > conftest.$ac_ext <<EOF
20452 #line 20453 "configure"
20453 #include "confdefs.h"
20454 /* Override any gcc2 internal prototype to avoid an error.  */
20455 /* We use char because int might match the return type of a gcc2
20456     builtin and then its argument prototype would still apply.  */
20457 char sasl_client_init();
20458
20459 int main() {
20460 sasl_client_init()
20461 ; return 0; }
20462 EOF
20463 if { (eval echo configure:20464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20464   rm -rf conftest*
20465   eval "ac_cv_lib_$ac_lib_var=yes"
20466 else
20467   echo "configure: failed program was:" >&5
20468   cat conftest.$ac_ext >&5
20469   rm -rf conftest*
20470   eval "ac_cv_lib_$ac_lib_var=no"
20471 fi
20472 rm -f conftest*
20473 LIBS="$ac_save_LIBS"
20474
20475 fi
20476 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20477   echo "$ac_t""yes" 1>&6
20478   ol_link_sasl="-lsasl"
20479 else
20480   echo "$ac_t""no" 1>&6
20481 fi
20482
20483 fi
20484
20485         fi
20486
20487         if test $ol_link_sasl = no ; then
20488                 if test $ol_with_cyrus_sasl != auto ; then
20489                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
20490                 else
20491                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
20492                         echo "configure: warning: SASL authentication not supported!" 1>&2
20493                         if test $ol_link_tls = no ; then
20494                                 echo "configure: warning: Strong authentication not supported!" 1>&2
20495                         fi
20496                 fi
20497         else
20498                 echo $ac_n "checking Cyrus SASL library version""... $ac_c" 1>&6
20499 echo "configure:20500: checking Cyrus SASL library version" >&5
20500 if eval "test \"\${ol_cv_sasl_compat+set}\" = set"; then
20501   echo $ac_n "(cached) $ac_c" 1>&6
20502 else
20503   
20504         cat > conftest.$ac_ext <<EOF
20505 #line 20506 "configure"
20506 #include "confdefs.h"
20507
20508 #ifdef HAVE_SASL_SASL_H
20509 #include <sasl/sasl.h>
20510 #else
20511 #include <sasl.h>
20512 #endif
20513
20514 /* require 2.1.3 or later */
20515 #if SASL_VERSION_MAJOR == 1  && SASL_VERSION_MINOR >= 5
20516         char *__sasl_compat = "1.5.x okay";
20517 #elif SASL_VERSION_MAJOR == 2  && SASL_VERSION_MINOR > 1
20518         __sasl_compat "2.2+ or better okay (we guess)";
20519 #elif SASL_VERSION_MAJOR == 2  && SASL_VERSION_MINOR == 1 \
20520         && SASL_VERSION_STEP >=3
20521         __sasl_compat = "2.1.3+ or better okay";
20522 #endif
20523         
20524 EOF
20525 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20526   egrep "__sasl_compat" >/dev/null 2>&1; then
20527   rm -rf conftest*
20528   ol_cv_sasl_compat=yes
20529 else
20530   rm -rf conftest*
20531   ol_cv_sasl_compat=no
20532 fi
20533 rm -f conftest*
20534
20535 fi
20536
20537 echo "$ac_t""$ol_cv_sasl_compat" 1>&6
20538
20539                 if test $ol_cv_sasl_compat = no ; then
20540                         ol_link_sasl=no
20541                         { echo "configure: error: Cyrus SASL library located but incompatible" 1>&2; exit 1; }
20542                 fi
20543
20544                 cat >> confdefs.h <<\EOF
20545 #define HAVE_CYRUS_SASL 1
20546 EOF
20547
20548                 SASL_LIBS="$ol_link_sasl"
20549                 if test $ol_enable_spasswd != no ; then
20550                         ol_link_spasswd=yes
20551                 fi
20552
20553                 ac_save_LIBS="$LIBS"
20554                 LIBS="$LIBS $ol_link_sasl"
20555                 echo $ac_n "checking for sasl_version""... $ac_c" 1>&6
20556 echo "configure:20557: checking for sasl_version" >&5
20557 if eval "test \"\${ac_cv_func_sasl_version+set}\" = set"; then
20558   echo $ac_n "(cached) $ac_c" 1>&6
20559 else
20560   cat > conftest.$ac_ext <<EOF
20561 #line 20562 "configure"
20562 #include "confdefs.h"
20563 /* System header to define __stub macros and hopefully few prototypes,
20564     which can conflict with char sasl_version(); below.  */
20565 #include <assert.h>
20566 /* Override any gcc2 internal prototype to avoid an error.  */
20567 /* We use char because int might match the return type of a gcc2
20568     builtin and then its argument prototype would still apply.  */
20569 char sasl_version();
20570 char (*f)();
20571
20572 int main() {
20573
20574 /* The GNU C library defines this for functions which it implements
20575     to always fail with ENOSYS.  Some functions are actually named
20576     something starting with __ and the normal name is an alias.  */
20577 #if defined (__stub_sasl_version) || defined (__stub___sasl_version)
20578 choke me
20579 #else
20580 f = sasl_version;
20581 #endif
20582
20583 ; return 0; }
20584 EOF
20585 if { (eval echo configure:20586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20586   rm -rf conftest*
20587   eval "ac_cv_func_sasl_version=yes"
20588 else
20589   echo "configure: failed program was:" >&5
20590   cat conftest.$ac_ext >&5
20591   rm -rf conftest*
20592   eval "ac_cv_func_sasl_version=no"
20593 fi
20594 rm -f conftest*
20595 fi
20596
20597 if eval "test \"`echo '$ac_cv_func_'sasl_version`\" = yes"; then
20598   echo "$ac_t""yes" 1>&6
20599   cat >> confdefs.h <<\EOF
20600 #define HAVE_SASL_VERSION 1
20601 EOF
20602
20603 else
20604   echo "$ac_t""no" 1>&6
20605 fi
20606
20607                 LIBS="$ac_save_LIBS"
20608         fi
20609
20610 else
20611         echo "configure: warning: SASL authentication not supported!" 1>&2
20612         if test $ol_link_tls = no ; then
20613                 echo "configure: warning: Strong authentication not supported!" 1>&2
20614         fi
20615 fi
20616
20617 if test $cross_compiling != yes -a "$ac_cv_mingw32" != yes ; then
20618         dev=no
20619         if test -r /dev/urandom ; then
20620                 dev="/dev/urandom";
20621         elif test -r /idev/urandom ; then
20622                 dev="/idev/urandom";
20623         elif test -r /dev/srandom ; then
20624                 dev="/dev/srandom";
20625         elif test -r /dev/random ; then
20626                 dev="/dev/random";
20627         elif test -r /idev/random ; then
20628                 dev="/idev/random";
20629         fi
20630
20631         if test $dev != no ; then
20632                 cat >> confdefs.h <<EOF
20633 #define URANDOM_DEVICE "$dev"
20634 EOF
20635
20636         fi
20637 fi
20638
20639 ol_link_fetch=no
20640 if test $ol_with_fetch != no ; then
20641         ol_LIBS=$LIBS
20642 LIBS="-lfetch -lcom_err $LIBS"
20643 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
20644 echo "configure:20645: checking fetch(3) library" >&5
20645 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
20646   echo $ac_n "(cached) $ac_c" 1>&6
20647 else
20648   
20649         cat > conftest.$ac_ext <<EOF
20650 #line 20651 "configure"
20651 #include "confdefs.h"
20652
20653 #include <sys/param.h>
20654 #include <stdio.h>
20655 #include <fetch.h>
20656 int main() {
20657 struct url *u = fetchParseURL("file:///"); 
20658 ; return 0; }
20659 EOF
20660 if { (eval echo configure:20661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20661   rm -rf conftest*
20662   ol_cv_lib_fetch=yes
20663 else
20664   echo "configure: failed program was:" >&5
20665   cat conftest.$ac_ext >&5
20666   rm -rf conftest*
20667   ol_cv_lib_fetch=no
20668 fi
20669 rm -f conftest*
20670 fi
20671
20672 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
20673 LIBS=$ol_LIBS
20674 if test $ol_cv_lib_fetch != no ; then
20675         ol_link_fetch="-lfetch -lcom_err"
20676         cat >> confdefs.h <<\EOF
20677 #define HAVE_FETCH 1
20678 EOF
20679
20680 fi
20681
20682
20683         if test $ol_cv_lib_fetch != no ; then
20684                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
20685                 ol_link_fetch=freebsd
20686
20687         elif test $ol_with_fetch != auto ; then
20688                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
20689         fi 
20690 fi
20691
20692 ol_link_readline=no
20693 if test $ol_with_readline != no ; then
20694         for ac_hdr in readline/readline.h readline/history.h
20695 do
20696 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20697 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20698 echo "configure:20699: checking for $ac_hdr" >&5
20699 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20700   echo $ac_n "(cached) $ac_c" 1>&6
20701 else
20702   cat > conftest.$ac_ext <<EOF
20703 #line 20704 "configure"
20704 #include "confdefs.h"
20705 #include <$ac_hdr>
20706 EOF
20707 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20708 { (eval echo configure:20709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20709 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20710 if test -z "$ac_err"; then
20711   rm -rf conftest*
20712   eval "ac_cv_header_$ac_safe=yes"
20713 else
20714   echo "$ac_err" >&5
20715   echo "configure: failed program was:" >&5
20716   cat conftest.$ac_ext >&5
20717   rm -rf conftest*
20718   eval "ac_cv_header_$ac_safe=no"
20719 fi
20720 rm -f conftest*
20721 fi
20722 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20723   echo "$ac_t""yes" 1>&6
20724     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20725   cat >> confdefs.h <<EOF
20726 #define $ac_tr_hdr 1
20727 EOF
20728  
20729 else
20730   echo "$ac_t""no" 1>&6
20731 fi
20732 done
20733
20734
20735         if test $ac_cv_header_readline_readline_h = yes ; then
20736                 save_LIBS="$LIBS"
20737                 LIBS="$TERMCAP_LIBS $LIBS"
20738                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
20739 echo "configure:20740: checking for readline in -lreadline" >&5
20740 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
20741 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20742   echo $ac_n "(cached) $ac_c" 1>&6
20743 else
20744   ac_save_LIBS="$LIBS"
20745 LIBS="-lreadline  $LIBS"
20746 cat > conftest.$ac_ext <<EOF
20747 #line 20748 "configure"
20748 #include "confdefs.h"
20749 /* Override any gcc2 internal prototype to avoid an error.  */
20750 /* We use char because int might match the return type of a gcc2
20751     builtin and then its argument prototype would still apply.  */
20752 char readline();
20753
20754 int main() {
20755 readline()
20756 ; return 0; }
20757 EOF
20758 if { (eval echo configure:20759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20759   rm -rf conftest*
20760   eval "ac_cv_lib_$ac_lib_var=yes"
20761 else
20762   echo "configure: failed program was:" >&5
20763   cat conftest.$ac_ext >&5
20764   rm -rf conftest*
20765   eval "ac_cv_lib_$ac_lib_var=no"
20766 fi
20767 rm -f conftest*
20768 LIBS="$ac_save_LIBS"
20769
20770 fi
20771 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20772   echo "$ac_t""yes" 1>&6
20773   have_readline=yes
20774 else
20775   echo "$ac_t""no" 1>&6
20776 have_readline=no
20777 fi
20778
20779                 LIBS="$save_LIBS"
20780                         
20781                 if test $have_readline = yes ; then
20782                         ol_with_readline=found
20783                         ol_link_readline=yes
20784
20785                         READLINE_LIBS="-lreadline"
20786                 fi
20787         fi
20788 fi
20789
20790 if test $ol_link_readline = yes ; then
20791         cat >> confdefs.h <<\EOF
20792 #define HAVE_READLINE 1
20793 EOF
20794
20795 fi
20796
20797
20798 if test $ol_enable_crypt != no ; then
20799         save_LIBS="$LIBS"
20800         LIBS="$TLS_LIBS $LIBS"
20801
20802         echo $ac_n "checking for crypt""... $ac_c" 1>&6
20803 echo "configure:20804: checking for crypt" >&5
20804 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
20805   echo $ac_n "(cached) $ac_c" 1>&6
20806 else
20807   cat > conftest.$ac_ext <<EOF
20808 #line 20809 "configure"
20809 #include "confdefs.h"
20810 /* System header to define __stub macros and hopefully few prototypes,
20811     which can conflict with char crypt(); below.  */
20812 #include <assert.h>
20813 /* Override any gcc2 internal prototype to avoid an error.  */
20814 /* We use char because int might match the return type of a gcc2
20815     builtin and then its argument prototype would still apply.  */
20816 char crypt();
20817 char (*f)();
20818
20819 int main() {
20820
20821 /* The GNU C library defines this for functions which it implements
20822     to always fail with ENOSYS.  Some functions are actually named
20823     something starting with __ and the normal name is an alias.  */
20824 #if defined (__stub_crypt) || defined (__stub___crypt)
20825 choke me
20826 #else
20827 f = crypt;
20828 #endif
20829
20830 ; return 0; }
20831 EOF
20832 if { (eval echo configure:20833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20833   rm -rf conftest*
20834   eval "ac_cv_func_crypt=yes"
20835 else
20836   echo "configure: failed program was:" >&5
20837   cat conftest.$ac_ext >&5
20838   rm -rf conftest*
20839   eval "ac_cv_func_crypt=no"
20840 fi
20841 rm -f conftest*
20842 fi
20843
20844 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
20845   echo "$ac_t""yes" 1>&6
20846   have_crypt=yes
20847 else
20848   echo "$ac_t""no" 1>&6
20849
20850                 LIBS="$save_LIBS"
20851                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
20852 echo "configure:20853: checking for crypt in -lcrypt" >&5
20853 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
20854 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20855   echo $ac_n "(cached) $ac_c" 1>&6
20856 else
20857   ac_save_LIBS="$LIBS"
20858 LIBS="-lcrypt  $LIBS"
20859 cat > conftest.$ac_ext <<EOF
20860 #line 20861 "configure"
20861 #include "confdefs.h"
20862 /* Override any gcc2 internal prototype to avoid an error.  */
20863 /* We use char because int might match the return type of a gcc2
20864     builtin and then its argument prototype would still apply.  */
20865 char crypt();
20866
20867 int main() {
20868 crypt()
20869 ; return 0; }
20870 EOF
20871 if { (eval echo configure:20872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20872   rm -rf conftest*
20873   eval "ac_cv_lib_$ac_lib_var=yes"
20874 else
20875   echo "configure: failed program was:" >&5
20876   cat conftest.$ac_ext >&5
20877   rm -rf conftest*
20878   eval "ac_cv_lib_$ac_lib_var=no"
20879 fi
20880 rm -f conftest*
20881 LIBS="$ac_save_LIBS"
20882
20883 fi
20884 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20885   echo "$ac_t""yes" 1>&6
20886   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
20887                         have_crypt=yes
20888 else
20889   echo "$ac_t""no" 1>&6
20890 have_crypt=no
20891 fi
20892
20893 fi
20894
20895
20896         LIBS="$save_LIBS"
20897
20898         if test $have_crypt = yes ; then
20899                 cat >> confdefs.h <<\EOF
20900 #define HAVE_CRYPT 1
20901 EOF
20902
20903         else
20904                 echo "configure: warning: could not find crypt" 1>&2
20905                 if test $ol_enable_crypt = yes ; then
20906                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
20907                 fi
20908
20909                 echo "configure: warning: disabling crypt support" 1>&2
20910                 ol_enable_crypt=no
20911         fi
20912 fi
20913
20914 if test $ol_enable_proctitle != no ; then
20915         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
20916 echo "configure:20917: checking for setproctitle" >&5
20917 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
20918   echo $ac_n "(cached) $ac_c" 1>&6
20919 else
20920   cat > conftest.$ac_ext <<EOF
20921 #line 20922 "configure"
20922 #include "confdefs.h"
20923 /* System header to define __stub macros and hopefully few prototypes,
20924     which can conflict with char setproctitle(); below.  */
20925 #include <assert.h>
20926 /* Override any gcc2 internal prototype to avoid an error.  */
20927 /* We use char because int might match the return type of a gcc2
20928     builtin and then its argument prototype would still apply.  */
20929 char setproctitle();
20930 char (*f)();
20931
20932 int main() {
20933
20934 /* The GNU C library defines this for functions which it implements
20935     to always fail with ENOSYS.  Some functions are actually named
20936     something starting with __ and the normal name is an alias.  */
20937 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
20938 choke me
20939 #else
20940 f = setproctitle;
20941 #endif
20942
20943 ; return 0; }
20944 EOF
20945 if { (eval echo configure:20946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20946   rm -rf conftest*
20947   eval "ac_cv_func_setproctitle=yes"
20948 else
20949   echo "configure: failed program was:" >&5
20950   cat conftest.$ac_ext >&5
20951   rm -rf conftest*
20952   eval "ac_cv_func_setproctitle=no"
20953 fi
20954 rm -f conftest*
20955 fi
20956
20957 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
20958   echo "$ac_t""yes" 1>&6
20959   have_setproctitle=yes
20960 else
20961   echo "$ac_t""no" 1>&6
20962
20963                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
20964 echo "configure:20965: checking for setproctitle in -lutil" >&5
20965 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
20966 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20967   echo $ac_n "(cached) $ac_c" 1>&6
20968 else
20969   ac_save_LIBS="$LIBS"
20970 LIBS="-lutil  $LIBS"
20971 cat > conftest.$ac_ext <<EOF
20972 #line 20973 "configure"
20973 #include "confdefs.h"
20974 /* Override any gcc2 internal prototype to avoid an error.  */
20975 /* We use char because int might match the return type of a gcc2
20976     builtin and then its argument prototype would still apply.  */
20977 char setproctitle();
20978
20979 int main() {
20980 setproctitle()
20981 ; return 0; }
20982 EOF
20983 if { (eval echo configure:20984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20984   rm -rf conftest*
20985   eval "ac_cv_lib_$ac_lib_var=yes"
20986 else
20987   echo "configure: failed program was:" >&5
20988   cat conftest.$ac_ext >&5
20989   rm -rf conftest*
20990   eval "ac_cv_lib_$ac_lib_var=no"
20991 fi
20992 rm -f conftest*
20993 LIBS="$ac_save_LIBS"
20994
20995 fi
20996 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20997   echo "$ac_t""yes" 1>&6
20998   have_setproctitle=yes
20999                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
21000 else
21001   echo "$ac_t""no" 1>&6
21002 have_setproctitle=no
21003                         LIBOBJS="$LIBOBJS setproctitle.o"
21004                         LIBSRCS="$LIBSRCS setproctitle.c"
21005 fi
21006
21007 fi
21008
21009
21010         if test $have_setproctitle = yes ; then
21011                 cat >> confdefs.h <<\EOF
21012 #define HAVE_SETPROCTITLE 1
21013 EOF
21014
21015         fi
21016 fi
21017
21018 if test $ol_enable_slp != no ; then
21019         for ac_hdr in slp.h 
21020 do
21021 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
21022 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
21023 echo "configure:21024: checking for $ac_hdr" >&5
21024 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
21025   echo $ac_n "(cached) $ac_c" 1>&6
21026 else
21027   cat > conftest.$ac_ext <<EOF
21028 #line 21029 "configure"
21029 #include "confdefs.h"
21030 #include <$ac_hdr>
21031 EOF
21032 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
21033 { (eval echo configure:21034: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
21034 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
21035 if test -z "$ac_err"; then
21036   rm -rf conftest*
21037   eval "ac_cv_header_$ac_safe=yes"
21038 else
21039   echo "$ac_err" >&5
21040   echo "configure: failed program was:" >&5
21041   cat conftest.$ac_ext >&5
21042   rm -rf conftest*
21043   eval "ac_cv_header_$ac_safe=no"
21044 fi
21045 rm -f conftest*
21046 fi
21047 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
21048   echo "$ac_t""yes" 1>&6
21049     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
21050   cat >> confdefs.h <<EOF
21051 #define $ac_tr_hdr 1
21052 EOF
21053  
21054 else
21055   echo "$ac_t""no" 1>&6
21056 fi
21057 done
21058
21059
21060         if test $ac_cv_header_slp_h = yes ; then
21061                 echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
21062 echo "configure:21063: checking for SLPOpen in -lslp" >&5
21063 ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-:%__p__%'`
21064 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
21065   echo $ac_n "(cached) $ac_c" 1>&6
21066 else
21067   ac_save_LIBS="$LIBS"
21068 LIBS="-lslp  $LIBS"
21069 cat > conftest.$ac_ext <<EOF
21070 #line 21071 "configure"
21071 #include "confdefs.h"
21072 /* Override any gcc2 internal prototype to avoid an error.  */
21073 /* We use char because int might match the return type of a gcc2
21074     builtin and then its argument prototype would still apply.  */
21075 char SLPOpen();
21076
21077 int main() {
21078 SLPOpen()
21079 ; return 0; }
21080 EOF
21081 if { (eval echo configure:21082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21082   rm -rf conftest*
21083   eval "ac_cv_lib_$ac_lib_var=yes"
21084 else
21085   echo "configure: failed program was:" >&5
21086   cat conftest.$ac_ext >&5
21087   rm -rf conftest*
21088   eval "ac_cv_lib_$ac_lib_var=no"
21089 fi
21090 rm -f conftest*
21091 LIBS="$ac_save_LIBS"
21092
21093 fi
21094 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
21095   echo "$ac_t""yes" 1>&6
21096   have_slp=yes
21097 else
21098   echo "$ac_t""no" 1>&6
21099 have_slp=no
21100 fi
21101
21102                 if test $have_slp = yes ; then
21103                         cat >> confdefs.h <<\EOF
21104 #define HAVE_SLP 1
21105 EOF
21106
21107                         SLAPD_SLP_LIBS=-lslp
21108                 fi
21109
21110         elif test $ol_enable_slp = yes ; then
21111                 { echo "configure: error: SLP not found" 1>&2; exit 1; }
21112         fi
21113 fi
21114
21115 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
21116 echo "configure:21117: checking for ANSI C header files" >&5
21117 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
21118   echo $ac_n "(cached) $ac_c" 1>&6
21119 else
21120   cat > conftest.$ac_ext <<EOF
21121 #line 21122 "configure"
21122 #include "confdefs.h"
21123 #include <stdlib.h>
21124 #include <stdarg.h>
21125 #include <string.h>
21126 #include <float.h>
21127 EOF
21128 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
21129 { (eval echo configure:21130: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
21130 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
21131 if test -z "$ac_err"; then
21132   rm -rf conftest*
21133   ac_cv_header_stdc=yes
21134 else
21135   echo "$ac_err" >&5
21136   echo "configure: failed program was:" >&5
21137   cat conftest.$ac_ext >&5
21138   rm -rf conftest*
21139   ac_cv_header_stdc=no
21140 fi
21141 rm -f conftest*
21142
21143 if test $ac_cv_header_stdc = yes; then
21144   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
21145 cat > conftest.$ac_ext <<EOF
21146 #line 21147 "configure"
21147 #include "confdefs.h"
21148 #include <string.h>
21149 EOF
21150 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21151   egrep "memchr" >/dev/null 2>&1; then
21152   :
21153 else
21154   rm -rf conftest*
21155   ac_cv_header_stdc=no
21156 fi
21157 rm -f conftest*
21158
21159 fi
21160
21161 if test $ac_cv_header_stdc = yes; then
21162   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
21163 cat > conftest.$ac_ext <<EOF
21164 #line 21165 "configure"
21165 #include "confdefs.h"
21166 #include <stdlib.h>
21167 EOF
21168 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21169   egrep "free" >/dev/null 2>&1; then
21170   :
21171 else
21172   rm -rf conftest*
21173   ac_cv_header_stdc=no
21174 fi
21175 rm -f conftest*
21176
21177 fi
21178
21179 if test $ac_cv_header_stdc = yes; then
21180   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
21181 if test "$cross_compiling" = yes; then
21182   :
21183 else
21184   cat > conftest.$ac_ext <<EOF
21185 #line 21186 "configure"
21186 #include "confdefs.h"
21187 #include <ctype.h>
21188 #if ((' ' & 0x0FF) == 0x020)
21189 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
21190 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
21191 #else
21192 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
21193  || ('j' <= (c) && (c) <= 'r') \
21194  || ('s' <= (c) && (c) <= 'z'))
21195 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
21196 #endif
21197 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
21198 int main () { int i; for (i = 0; i < 256; i++)
21199 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
21200 exit (0); }
21201
21202 EOF
21203 if { (eval echo configure:21204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
21204 then
21205   :
21206 else
21207   echo "configure: failed program was:" >&5
21208   cat conftest.$ac_ext >&5
21209   rm -fr conftest*
21210   ac_cv_header_stdc=no
21211 fi
21212 rm -fr conftest*
21213 fi
21214
21215 fi
21216 fi
21217
21218 echo "$ac_t""$ac_cv_header_stdc" 1>&6
21219 if test $ac_cv_header_stdc = yes; then
21220   cat >> confdefs.h <<\EOF
21221 #define STDC_HEADERS 1
21222 EOF
21223
21224 fi
21225
21226 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
21227 echo "configure:21228: checking for mode_t" >&5
21228 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
21229   echo $ac_n "(cached) $ac_c" 1>&6
21230 else
21231   cat > conftest.$ac_ext <<EOF
21232 #line 21233 "configure"
21233 #include "confdefs.h"
21234 #include <sys/types.h>
21235 #if STDC_HEADERS
21236 #include <stdlib.h>
21237 #include <stddef.h>
21238 #endif
21239
21240 EOF
21241 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21242   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21243   rm -rf conftest*
21244   eval "ac_cv_type_mode_t=yes"
21245 else
21246   rm -rf conftest*
21247   eval "ac_cv_type_mode_t=no"
21248 fi
21249 rm -f conftest*
21250
21251 fi
21252 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
21253   echo "$ac_t""yes" 1>&6
21254 else
21255   echo "$ac_t""no" 1>&6
21256   cat >> confdefs.h <<EOF
21257 #define mode_t int
21258 EOF
21259
21260 fi
21261
21262 echo $ac_n "checking for off_t""... $ac_c" 1>&6
21263 echo "configure:21264: checking for off_t" >&5
21264 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
21265   echo $ac_n "(cached) $ac_c" 1>&6
21266 else
21267   cat > conftest.$ac_ext <<EOF
21268 #line 21269 "configure"
21269 #include "confdefs.h"
21270 #include <sys/types.h>
21271 #if STDC_HEADERS
21272 #include <stdlib.h>
21273 #include <stddef.h>
21274 #endif
21275
21276 EOF
21277 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21278   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21279   rm -rf conftest*
21280   eval "ac_cv_type_off_t=yes"
21281 else
21282   rm -rf conftest*
21283   eval "ac_cv_type_off_t=no"
21284 fi
21285 rm -f conftest*
21286
21287 fi
21288 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
21289   echo "$ac_t""yes" 1>&6
21290 else
21291   echo "$ac_t""no" 1>&6
21292   cat >> confdefs.h <<EOF
21293 #define off_t long
21294 EOF
21295
21296 fi
21297
21298 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
21299 echo "configure:21300: checking for pid_t" >&5
21300 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
21301   echo $ac_n "(cached) $ac_c" 1>&6
21302 else
21303   cat > conftest.$ac_ext <<EOF
21304 #line 21305 "configure"
21305 #include "confdefs.h"
21306 #include <sys/types.h>
21307 #if STDC_HEADERS
21308 #include <stdlib.h>
21309 #include <stddef.h>
21310 #endif
21311
21312 EOF
21313 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21314   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21315   rm -rf conftest*
21316   eval "ac_cv_type_pid_t=yes"
21317 else
21318   rm -rf conftest*
21319   eval "ac_cv_type_pid_t=no"
21320 fi
21321 rm -f conftest*
21322
21323 fi
21324 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
21325   echo "$ac_t""yes" 1>&6
21326 else
21327   echo "$ac_t""no" 1>&6
21328   cat >> confdefs.h <<EOF
21329 #define pid_t int
21330 EOF
21331
21332 fi
21333
21334 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
21335 echo "configure:21336: checking for ptrdiff_t" >&5
21336 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
21337   echo $ac_n "(cached) $ac_c" 1>&6
21338 else
21339   cat > conftest.$ac_ext <<EOF
21340 #line 21341 "configure"
21341 #include "confdefs.h"
21342 #include <stddef.h>
21343 int main() {
21344 ptrdiff_t p
21345 ; return 0; }
21346 EOF
21347 if { (eval echo configure:21348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21348   rm -rf conftest*
21349   am_cv_type_ptrdiff_t=yes
21350 else
21351   echo "configure: failed program was:" >&5
21352   cat conftest.$ac_ext >&5
21353   rm -rf conftest*
21354   am_cv_type_ptrdiff_t=no
21355 fi
21356 rm -f conftest*
21357 fi
21358
21359 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
21360    if test $am_cv_type_ptrdiff_t = yes; then
21361      cat >> confdefs.h <<\EOF
21362 #define HAVE_PTRDIFF_T 1
21363 EOF
21364
21365    fi
21366
21367 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
21368 echo "configure:21369: checking return type of signal handlers" >&5
21369 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
21370   echo $ac_n "(cached) $ac_c" 1>&6
21371 else
21372   cat > conftest.$ac_ext <<EOF
21373 #line 21374 "configure"
21374 #include "confdefs.h"
21375 #include <sys/types.h>
21376 #include <signal.h>
21377 #ifdef signal
21378 #undef signal
21379 #endif
21380 #ifdef __cplusplus
21381 extern "C" void (*signal (int, void (*)(int)))(int);
21382 #else
21383 void (*signal ()) ();
21384 #endif
21385
21386 int main() {
21387 int i;
21388 ; return 0; }
21389 EOF
21390 if { (eval echo configure:21391: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21391   rm -rf conftest*
21392   ac_cv_type_signal=void
21393 else
21394   echo "configure: failed program was:" >&5
21395   cat conftest.$ac_ext >&5
21396   rm -rf conftest*
21397   ac_cv_type_signal=int
21398 fi
21399 rm -f conftest*
21400 fi
21401
21402 echo "$ac_t""$ac_cv_type_signal" 1>&6
21403 cat >> confdefs.h <<EOF
21404 #define RETSIGTYPE $ac_cv_type_signal
21405 EOF
21406
21407
21408 echo $ac_n "checking for size_t""... $ac_c" 1>&6
21409 echo "configure:21410: checking for size_t" >&5
21410 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
21411   echo $ac_n "(cached) $ac_c" 1>&6
21412 else
21413   cat > conftest.$ac_ext <<EOF
21414 #line 21415 "configure"
21415 #include "confdefs.h"
21416 #include <sys/types.h>
21417 #if STDC_HEADERS
21418 #include <stdlib.h>
21419 #include <stddef.h>
21420 #endif
21421
21422 EOF
21423 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21424   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21425   rm -rf conftest*
21426   eval "ac_cv_type_size_t=yes"
21427 else
21428   rm -rf conftest*
21429   eval "ac_cv_type_size_t=no"
21430 fi
21431 rm -f conftest*
21432
21433 fi
21434 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
21435   echo "$ac_t""yes" 1>&6
21436 else
21437   echo "$ac_t""no" 1>&6
21438   cat >> confdefs.h <<EOF
21439 #define size_t unsigned
21440 EOF
21441
21442 fi
21443
21444
21445 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
21446 echo "configure:21447: checking for ssize_t" >&5
21447 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
21448   echo $ac_n "(cached) $ac_c" 1>&6
21449 else
21450   cat > conftest.$ac_ext <<EOF
21451 #line 21452 "configure"
21452 #include "confdefs.h"
21453 #include <sys/types.h>
21454 #if STDC_HEADERS
21455 #include <stdlib.h>
21456 #include <stddef.h>
21457 #endif
21458
21459 EOF
21460 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21461   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21462   rm -rf conftest*
21463   eval "ac_cv_type_ssize_t=yes"
21464 else
21465   rm -rf conftest*
21466   eval "ac_cv_type_ssize_t=no"
21467 fi
21468 rm -f conftest*
21469
21470 fi
21471 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
21472   echo "$ac_t""yes" 1>&6
21473 else
21474   echo "$ac_t""no" 1>&6
21475   cat >> confdefs.h <<EOF
21476 #define ssize_t signed int
21477 EOF
21478
21479 fi
21480
21481 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
21482 echo "configure:21483: checking for caddr_t" >&5
21483 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
21484   echo $ac_n "(cached) $ac_c" 1>&6
21485 else
21486   cat > conftest.$ac_ext <<EOF
21487 #line 21488 "configure"
21488 #include "confdefs.h"
21489 #include <sys/types.h>
21490 #if STDC_HEADERS
21491 #include <stdlib.h>
21492 #include <stddef.h>
21493 #endif
21494
21495 EOF
21496 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21497   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21498   rm -rf conftest*
21499   eval "ac_cv_type_caddr_t=yes"
21500 else
21501   rm -rf conftest*
21502   eval "ac_cv_type_caddr_t=no"
21503 fi
21504 rm -f conftest*
21505
21506 fi
21507 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
21508   echo "$ac_t""yes" 1>&6
21509 else
21510   echo "$ac_t""no" 1>&6
21511   cat >> confdefs.h <<EOF
21512 #define caddr_t char *
21513 EOF
21514
21515 fi
21516
21517
21518 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
21519 echo "configure:21520: checking for socklen_t" >&5
21520 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
21521   echo $ac_n "(cached) $ac_c" 1>&6
21522 else
21523   cat > conftest.$ac_ext <<EOF
21524 #line 21525 "configure"
21525 #include "confdefs.h"
21526
21527 #ifdef HAVE_SYS_TYPES_H
21528 #include <sys/types.h>
21529 #endif
21530 #ifdef HAVE_SYS_SOCKET_H
21531 #include <sys/socket.h>
21532 #endif
21533
21534 int main() {
21535 socklen_t len;
21536 ; return 0; }
21537 EOF
21538 if { (eval echo configure:21539: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21539   rm -rf conftest*
21540   ol_cv_type_socklen_t=yes
21541 else
21542   echo "configure: failed program was:" >&5
21543   cat conftest.$ac_ext >&5
21544   rm -rf conftest*
21545   ol_cv_type_socklen_t=no
21546 fi
21547 rm -f conftest*
21548 fi
21549
21550 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
21551   if test $ol_cv_type_socklen_t = no; then
21552     cat >> confdefs.h <<\EOF
21553 #define socklen_t int
21554 EOF
21555
21556   fi
21557  
21558 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
21559 echo "configure:21560: checking for member st_blksize in aggregate type struct stat" >&5
21560 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
21561   echo $ac_n "(cached) $ac_c" 1>&6
21562 else
21563   cat > conftest.$ac_ext <<EOF
21564 #line 21565 "configure"
21565 #include "confdefs.h"
21566 #include <sys/types.h>
21567 #include <sys/stat.h>
21568 int main() {
21569 struct stat foo; foo.st_blksize;
21570 ; return 0; }
21571 EOF
21572 if { (eval echo configure:21573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21573   rm -rf conftest*
21574   ac_cv_c_struct_member_st_blksize=yes
21575 else
21576   echo "configure: failed program was:" >&5
21577   cat conftest.$ac_ext >&5
21578   rm -rf conftest*
21579   ac_cv_c_struct_member_st_blksize=no
21580 fi
21581 rm -f conftest*
21582 fi
21583
21584 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
21585 st_blksize="$ac_cv_c_struct_member_st_blksize"
21586 if test $ac_cv_c_struct_member_st_blksize = yes; then
21587   cat >> confdefs.h <<\EOF
21588 #define HAVE_ST_BLKSIZE 1
21589 EOF
21590
21591 fi
21592
21593 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
21594 echo "configure:21595: checking whether time.h and sys/time.h may both be included" >&5
21595 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
21596   echo $ac_n "(cached) $ac_c" 1>&6
21597 else
21598   cat > conftest.$ac_ext <<EOF
21599 #line 21600 "configure"
21600 #include "confdefs.h"
21601 #include <sys/types.h>
21602 #include <sys/time.h>
21603 #include <time.h>
21604 int main() {
21605 struct tm *tp;
21606 ; return 0; }
21607 EOF
21608 if { (eval echo configure:21609: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21609   rm -rf conftest*
21610   ac_cv_header_time=yes
21611 else
21612   echo "configure: failed program was:" >&5
21613   cat conftest.$ac_ext >&5
21614   rm -rf conftest*
21615   ac_cv_header_time=no
21616 fi
21617 rm -f conftest*
21618 fi
21619
21620 echo "$ac_t""$ac_cv_header_time" 1>&6
21621 if test $ac_cv_header_time = yes; then
21622   cat >> confdefs.h <<\EOF
21623 #define TIME_WITH_SYS_TIME 1
21624 EOF
21625
21626 fi
21627
21628 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
21629 echo "configure:21630: checking whether struct tm is in sys/time.h or time.h" >&5
21630 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
21631   echo $ac_n "(cached) $ac_c" 1>&6
21632 else
21633   cat > conftest.$ac_ext <<EOF
21634 #line 21635 "configure"
21635 #include "confdefs.h"
21636 #include <sys/types.h>
21637 #include <time.h>
21638 int main() {
21639 struct tm *tp; tp->tm_sec;
21640 ; return 0; }
21641 EOF
21642 if { (eval echo configure:21643: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21643   rm -rf conftest*
21644   ac_cv_struct_tm=time.h
21645 else
21646   echo "configure: failed program was:" >&5
21647   cat conftest.$ac_ext >&5
21648   rm -rf conftest*
21649   ac_cv_struct_tm=sys/time.h
21650 fi
21651 rm -f conftest*
21652 fi
21653
21654 echo "$ac_t""$ac_cv_struct_tm" 1>&6
21655 if test $ac_cv_struct_tm = sys/time.h; then
21656   cat >> confdefs.h <<\EOF
21657 #define TM_IN_SYS_TIME 1
21658 EOF
21659
21660 fi
21661
21662 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
21663 echo "configure:21664: checking for uid_t in sys/types.h" >&5
21664 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
21665   echo $ac_n "(cached) $ac_c" 1>&6
21666 else
21667   cat > conftest.$ac_ext <<EOF
21668 #line 21669 "configure"
21669 #include "confdefs.h"
21670 #include <sys/types.h>
21671 EOF
21672 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21673   egrep "uid_t" >/dev/null 2>&1; then
21674   rm -rf conftest*
21675   ac_cv_type_uid_t=yes
21676 else
21677   rm -rf conftest*
21678   ac_cv_type_uid_t=no
21679 fi
21680 rm -f conftest*
21681
21682 fi
21683
21684 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
21685 if test $ac_cv_type_uid_t = no; then
21686   cat >> confdefs.h <<\EOF
21687 #define uid_t int
21688 EOF
21689
21690   cat >> confdefs.h <<\EOF
21691 #define gid_t int
21692 EOF
21693
21694 fi
21695
21696 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
21697 echo "configure:21698: checking for sig_atomic_t" >&5
21698 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
21699   echo $ac_n "(cached) $ac_c" 1>&6
21700 else
21701   cat > conftest.$ac_ext <<EOF
21702 #line 21703 "configure"
21703 #include "confdefs.h"
21704 #include <signal.h>
21705 int main() {
21706 sig_atomic_t atomic;
21707 ; return 0; }
21708 EOF
21709 if { (eval echo configure:21710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21710   rm -rf conftest*
21711   ol_cv_type_sig_atomic_t=yes
21712 else
21713   echo "configure: failed program was:" >&5
21714   cat conftest.$ac_ext >&5
21715   rm -rf conftest*
21716   ol_cv_type_sig_atomic_t=no
21717 fi
21718 rm -f conftest*
21719 fi
21720
21721 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
21722   if test $ol_cv_type_sig_atomic_t = no; then
21723     cat >> confdefs.h <<\EOF
21724 #define sig_atomic_t int
21725 EOF
21726
21727   fi
21728  
21729
21730
21731 # test for pw_gecos in struct passwd
21732 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
21733 echo "configure:21734: checking struct passwd for pw_gecos" >&5
21734 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
21735   echo $ac_n "(cached) $ac_c" 1>&6
21736 else
21737   
21738         cat > conftest.$ac_ext <<EOF
21739 #line 21740 "configure"
21740 #include "confdefs.h"
21741 #include <pwd.h>
21742 int main() {
21743
21744         struct passwd pwd;
21745         pwd.pw_gecos = pwd.pw_name;
21746
21747 ; return 0; }
21748 EOF
21749 if { (eval echo configure:21750: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21750   rm -rf conftest*
21751   ol_cv_struct_passwd_pw_gecos=yes
21752 else
21753   echo "configure: failed program was:" >&5
21754   cat conftest.$ac_ext >&5
21755   rm -rf conftest*
21756   ol_cv_struct_passwd_pw_gecos=no
21757 fi
21758 rm -f conftest*
21759 fi
21760
21761 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
21762 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
21763         cat >> confdefs.h <<\EOF
21764 #define HAVE_PW_GECOS 1
21765 EOF
21766
21767 fi
21768
21769 # test for pw_passwd in struct passwd
21770 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
21771 echo "configure:21772: checking struct passwd for pw_passwd" >&5
21772 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
21773   echo $ac_n "(cached) $ac_c" 1>&6
21774 else
21775   
21776         cat > conftest.$ac_ext <<EOF
21777 #line 21778 "configure"
21778 #include "confdefs.h"
21779 #include <pwd.h>
21780 int main() {
21781
21782         struct passwd pwd;
21783         pwd.pw_passwd = pwd.pw_name;
21784
21785 ; return 0; }
21786 EOF
21787 if { (eval echo configure:21788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21788   rm -rf conftest*
21789   ol_cv_struct_passwd_pw_passwd=yes
21790 else
21791   echo "configure: failed program was:" >&5
21792   cat conftest.$ac_ext >&5
21793   rm -rf conftest*
21794   ol_cv_struct_passwd_pw_passwd=no
21795 fi
21796 rm -f conftest*
21797 fi
21798
21799 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
21800 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
21801         cat >> confdefs.h <<\EOF
21802 #define HAVE_PW_PASSWD 1
21803 EOF
21804
21805 fi
21806
21807
21808 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
21809 echo "configure:21810: checking if toupper() requires islower()" >&5
21810 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
21811   echo $ac_n "(cached) $ac_c" 1>&6
21812 else
21813   
21814         if test "$cross_compiling" = yes; then
21815   ol_cv_c_upper_lower=safe
21816 else
21817   cat > conftest.$ac_ext <<EOF
21818 #line 21819 "configure"
21819 #include "confdefs.h"
21820
21821 #include <ctype.h>
21822 main()
21823 {
21824         if ('C' == toupper('C'))
21825                 exit(0);
21826         else
21827                 exit(1);
21828 }
21829 EOF
21830 if { (eval echo configure:21831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
21831 then
21832   ol_cv_c_upper_lower=no
21833 else
21834   echo "configure: failed program was:" >&5
21835   cat conftest.$ac_ext >&5
21836   rm -fr conftest*
21837   ol_cv_c_upper_lower=yes
21838 fi
21839 rm -fr conftest*
21840 fi
21841
21842 fi
21843
21844 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
21845 if test $ol_cv_c_upper_lower != no ; then
21846         cat >> confdefs.h <<\EOF
21847 #define C_UPPER_LOWER 1
21848 EOF
21849
21850 fi
21851
21852 echo $ac_n "checking for working const""... $ac_c" 1>&6
21853 echo "configure:21854: checking for working const" >&5
21854 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
21855   echo $ac_n "(cached) $ac_c" 1>&6
21856 else
21857   cat > conftest.$ac_ext <<EOF
21858 #line 21859 "configure"
21859 #include "confdefs.h"
21860
21861 int main() {
21862
21863 /* Ultrix mips cc rejects this.  */
21864 typedef int charset[2]; const charset x;
21865 /* SunOS 4.1.1 cc rejects this.  */
21866 char const *const *ccp;
21867 char **p;
21868 /* NEC SVR4.0.2 mips cc rejects this.  */
21869 struct point {int x, y;};
21870 static struct point const zero = {0,0};
21871 /* AIX XL C 1.02.0.0 rejects this.
21872    It does not let you subtract one const X* pointer from another in an arm
21873    of an if-expression whose if-part is not a constant expression */
21874 const char *g = "string";
21875 ccp = &g + (g ? g-g : 0);
21876 /* HPUX 7.0 cc rejects these. */
21877 ++ccp;
21878 p = (char**) ccp;
21879 ccp = (char const *const *) p;
21880 { /* SCO 3.2v4 cc rejects this.  */
21881   char *t;
21882   char const *s = 0 ? (char *) 0 : (char const *) 0;
21883
21884   *t++ = 0;
21885 }
21886 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
21887   int x[] = {25, 17};
21888   const int *foo = &x[0];
21889   ++foo;
21890 }
21891 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
21892   typedef const int *iptr;
21893   iptr p = 0;
21894   ++p;
21895 }
21896 { /* AIX XL C 1.02.0.0 rejects this saying
21897      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
21898   struct s { int j; const int *ap[3]; };
21899   struct s *b; b->j = 5;
21900 }
21901 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
21902   const int foo = 10;
21903 }
21904
21905 ; return 0; }
21906 EOF
21907 if { (eval echo configure:21908: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21908   rm -rf conftest*
21909   ac_cv_c_const=yes
21910 else
21911   echo "configure: failed program was:" >&5
21912   cat conftest.$ac_ext >&5
21913   rm -rf conftest*
21914   ac_cv_c_const=no
21915 fi
21916 rm -f conftest*
21917 fi
21918
21919 echo "$ac_t""$ac_cv_c_const" 1>&6
21920 if test $ac_cv_c_const = no; then
21921   cat >> confdefs.h <<\EOF
21922 #define const 
21923 EOF
21924
21925 fi
21926
21927 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
21928 echo "configure:21929: checking if compiler understands volatile" >&5
21929 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
21930   echo $ac_n "(cached) $ac_c" 1>&6
21931 else
21932   cat > conftest.$ac_ext <<EOF
21933 #line 21934 "configure"
21934 #include "confdefs.h"
21935 int x, y, z;
21936 int main() {
21937 volatile int a; int * volatile b = x ? &y : &z;
21938       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
21939       *b = 0;
21940 ; return 0; }
21941 EOF
21942 if { (eval echo configure:21943: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21943   rm -rf conftest*
21944   ol_cv_c_volatile=yes
21945 else
21946   echo "configure: failed program was:" >&5
21947   cat conftest.$ac_ext >&5
21948   rm -rf conftest*
21949   ol_cv_c_volatile=no
21950 fi
21951 rm -f conftest*
21952 fi
21953
21954 echo "$ac_t""$ol_cv_c_volatile" 1>&6
21955   if test $ol_cv_c_volatile = yes; then
21956     : 
21957   else
21958     cat >> confdefs.h <<\EOF
21959 #define volatile 
21960 EOF
21961
21962   fi
21963  
21964
21965 if test $cross_compiling = yes ; then
21966         cat >> confdefs.h <<\EOF
21967 #define CROSS_COMPILING 1
21968 EOF
21969
21970 else
21971         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
21972 echo "configure:21973: checking whether byte ordering is bigendian" >&5
21973 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
21974   echo $ac_n "(cached) $ac_c" 1>&6
21975 else
21976   ac_cv_c_bigendian=unknown
21977 # See if sys/param.h defines the BYTE_ORDER macro.
21978 cat > conftest.$ac_ext <<EOF
21979 #line 21980 "configure"
21980 #include "confdefs.h"
21981 #include <sys/types.h>
21982 #include <sys/param.h>
21983 int main() {
21984
21985 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
21986  bogus endian macros
21987 #endif
21988 ; return 0; }
21989 EOF
21990 if { (eval echo configure:21991: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21991   rm -rf conftest*
21992   # It does; now see whether it defined to BIG_ENDIAN or not.
21993 cat > conftest.$ac_ext <<EOF
21994 #line 21995 "configure"
21995 #include "confdefs.h"
21996 #include <sys/types.h>
21997 #include <sys/param.h>
21998 int main() {
21999
22000 #if BYTE_ORDER != BIG_ENDIAN
22001  not big endian
22002 #endif
22003 ; return 0; }
22004 EOF
22005 if { (eval echo configure:22006: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22006   rm -rf conftest*
22007   ac_cv_c_bigendian=yes
22008 else
22009   echo "configure: failed program was:" >&5
22010   cat conftest.$ac_ext >&5
22011   rm -rf conftest*
22012   ac_cv_c_bigendian=no
22013 fi
22014 rm -f conftest*
22015 else
22016   echo "configure: failed program was:" >&5
22017   cat conftest.$ac_ext >&5
22018 fi
22019 rm -f conftest*
22020 if test $ac_cv_c_bigendian = unknown; then
22021 if test "$cross_compiling" = yes; then
22022     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
22023 else
22024   cat > conftest.$ac_ext <<EOF
22025 #line 22026 "configure"
22026 #include "confdefs.h"
22027 main () {
22028   /* Are we little or big endian?  From Harbison&Steele.  */
22029   union
22030   {
22031     long l;
22032     char c[sizeof (long)];
22033   } u;
22034   u.l = 1;
22035   exit (u.c[sizeof (long) - 1] == 1);
22036 }
22037 EOF
22038 if { (eval echo configure:22039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
22039 then
22040   ac_cv_c_bigendian=no
22041 else
22042   echo "configure: failed program was:" >&5
22043   cat conftest.$ac_ext >&5
22044   rm -fr conftest*
22045   ac_cv_c_bigendian=yes
22046 fi
22047 rm -fr conftest*
22048 fi
22049
22050 fi
22051 fi
22052
22053 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
22054 if test $ac_cv_c_bigendian = yes; then
22055   cat >> confdefs.h <<\EOF
22056 #define WORDS_BIGENDIAN 1
22057 EOF
22058
22059 fi
22060
22061 fi
22062
22063 echo $ac_n "checking size of short""... $ac_c" 1>&6
22064 echo "configure:22065: checking size of short" >&5 
22065 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
22066   echo $ac_n "(cached) $ac_c" 1>&6
22067 else
22068   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
22069   cat > conftest.$ac_ext <<EOF
22070 #line 22071 "configure"
22071 #include "confdefs.h"
22072 #include "confdefs.h" 
22073 #include <sys/types.h> 
22074  
22075
22076 int main() {
22077 switch (0) case 0: case (sizeof (short) == $ac_size):;
22078 ; return 0; }
22079 EOF
22080 if { (eval echo configure:22081: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22081   rm -rf conftest*
22082   ac_cv_sizeof_short=$ac_size
22083 else
22084   echo "configure: failed program was:" >&5
22085   cat conftest.$ac_ext >&5
22086 fi
22087 rm -f conftest* 
22088   if test x$ac_cv_sizeof_short != x ; then break; fi 
22089 done 
22090
22091 fi
22092  
22093 if test x$ac_cv_sizeof_short = x ; then 
22094   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
22095 fi 
22096 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
22097 cat >> confdefs.h <<EOF
22098 #define SIZEOF_SHORT $ac_cv_sizeof_short
22099 EOF
22100  
22101  
22102 echo $ac_n "checking size of int""... $ac_c" 1>&6
22103 echo "configure:22104: checking size of int" >&5 
22104 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
22105   echo $ac_n "(cached) $ac_c" 1>&6
22106 else
22107   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
22108   cat > conftest.$ac_ext <<EOF
22109 #line 22110 "configure"
22110 #include "confdefs.h"
22111 #include "confdefs.h" 
22112 #include <sys/types.h> 
22113  
22114
22115 int main() {
22116 switch (0) case 0: case (sizeof (int) == $ac_size):;
22117 ; return 0; }
22118 EOF
22119 if { (eval echo configure:22120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22120   rm -rf conftest*
22121   ac_cv_sizeof_int=$ac_size
22122 else
22123   echo "configure: failed program was:" >&5
22124   cat conftest.$ac_ext >&5
22125 fi
22126 rm -f conftest* 
22127   if test x$ac_cv_sizeof_int != x ; then break; fi 
22128 done 
22129
22130 fi
22131  
22132 if test x$ac_cv_sizeof_int = x ; then 
22133   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
22134 fi 
22135 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
22136 cat >> confdefs.h <<EOF
22137 #define SIZEOF_INT $ac_cv_sizeof_int
22138 EOF
22139  
22140  
22141 echo $ac_n "checking size of long""... $ac_c" 1>&6
22142 echo "configure:22143: checking size of long" >&5 
22143 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
22144   echo $ac_n "(cached) $ac_c" 1>&6
22145 else
22146   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
22147   cat > conftest.$ac_ext <<EOF
22148 #line 22149 "configure"
22149 #include "confdefs.h"
22150 #include "confdefs.h" 
22151 #include <sys/types.h> 
22152  
22153
22154 int main() {
22155 switch (0) case 0: case (sizeof (long) == $ac_size):;
22156 ; return 0; }
22157 EOF
22158 if { (eval echo configure:22159: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22159   rm -rf conftest*
22160   ac_cv_sizeof_long=$ac_size
22161 else
22162   echo "configure: failed program was:" >&5
22163   cat conftest.$ac_ext >&5
22164 fi
22165 rm -f conftest* 
22166   if test x$ac_cv_sizeof_long != x ; then break; fi 
22167 done 
22168
22169 fi
22170  
22171 if test x$ac_cv_sizeof_long = x ; then 
22172   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
22173 fi 
22174 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
22175 cat >> confdefs.h <<EOF
22176 #define SIZEOF_LONG $ac_cv_sizeof_long
22177 EOF
22178  
22179
22180
22181 if test "$ac_cv_sizeof_int" -lt 4 ; then
22182         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
22183
22184         cat >> confdefs.h <<\EOF
22185 #define LBER_INT_T long
22186 EOF
22187
22188 else
22189         cat >> confdefs.h <<\EOF
22190 #define LBER_INT_T int
22191 EOF
22192
22193 fi
22194
22195 cat >> confdefs.h <<\EOF
22196 #define LBER_LEN_T long
22197 EOF
22198
22199 cat >> confdefs.h <<\EOF
22200 #define LBER_SOCKET_T int
22201 EOF
22202
22203 cat >> confdefs.h <<\EOF
22204 #define LBER_TAG_T long
22205 EOF
22206
22207
22208 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
22209 echo "configure:22210: checking for 8-bit clean memcmp" >&5
22210 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
22211   echo $ac_n "(cached) $ac_c" 1>&6
22212 else
22213   if test "$cross_compiling" = yes; then
22214   ac_cv_func_memcmp_clean=no
22215 else
22216   cat > conftest.$ac_ext <<EOF
22217 #line 22218 "configure"
22218 #include "confdefs.h"
22219
22220 main()
22221 {
22222   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
22223   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
22224 }
22225
22226 EOF
22227 if { (eval echo configure:22228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
22228 then
22229   ac_cv_func_memcmp_clean=yes
22230 else
22231   echo "configure: failed program was:" >&5
22232   cat conftest.$ac_ext >&5
22233   rm -fr conftest*
22234   ac_cv_func_memcmp_clean=no
22235 fi
22236 rm -fr conftest*
22237 fi
22238
22239 fi
22240
22241 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
22242 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
22243
22244 echo $ac_n "checking for strftime""... $ac_c" 1>&6
22245 echo "configure:22246: checking for strftime" >&5
22246 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
22247   echo $ac_n "(cached) $ac_c" 1>&6
22248 else
22249   cat > conftest.$ac_ext <<EOF
22250 #line 22251 "configure"
22251 #include "confdefs.h"
22252 /* System header to define __stub macros and hopefully few prototypes,
22253     which can conflict with char strftime(); below.  */
22254 #include <assert.h>
22255 /* Override any gcc2 internal prototype to avoid an error.  */
22256 /* We use char because int might match the return type of a gcc2
22257     builtin and then its argument prototype would still apply.  */
22258 char strftime();
22259 char (*f)();
22260
22261 int main() {
22262
22263 /* The GNU C library defines this for functions which it implements
22264     to always fail with ENOSYS.  Some functions are actually named
22265     something starting with __ and the normal name is an alias.  */
22266 #if defined (__stub_strftime) || defined (__stub___strftime)
22267 choke me
22268 #else
22269 f = strftime;
22270 #endif
22271
22272 ; return 0; }
22273 EOF
22274 if { (eval echo configure:22275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22275   rm -rf conftest*
22276   eval "ac_cv_func_strftime=yes"
22277 else
22278   echo "configure: failed program was:" >&5
22279   cat conftest.$ac_ext >&5
22280   rm -rf conftest*
22281   eval "ac_cv_func_strftime=no"
22282 fi
22283 rm -f conftest*
22284 fi
22285
22286 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
22287   echo "$ac_t""yes" 1>&6
22288   cat >> confdefs.h <<\EOF
22289 #define HAVE_STRFTIME 1
22290 EOF
22291
22292 else
22293   echo "$ac_t""no" 1>&6
22294 # strftime is in -lintl on SCO UNIX.
22295 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
22296 echo "configure:22297: checking for strftime in -lintl" >&5
22297 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
22298 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
22299   echo $ac_n "(cached) $ac_c" 1>&6
22300 else
22301   ac_save_LIBS="$LIBS"
22302 LIBS="-lintl  $LIBS"
22303 cat > conftest.$ac_ext <<EOF
22304 #line 22305 "configure"
22305 #include "confdefs.h"
22306 /* Override any gcc2 internal prototype to avoid an error.  */
22307 /* We use char because int might match the return type of a gcc2
22308     builtin and then its argument prototype would still apply.  */
22309 char strftime();
22310
22311 int main() {
22312 strftime()
22313 ; return 0; }
22314 EOF
22315 if { (eval echo configure:22316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22316   rm -rf conftest*
22317   eval "ac_cv_lib_$ac_lib_var=yes"
22318 else
22319   echo "configure: failed program was:" >&5
22320   cat conftest.$ac_ext >&5
22321   rm -rf conftest*
22322   eval "ac_cv_lib_$ac_lib_var=no"
22323 fi
22324 rm -f conftest*
22325 LIBS="$ac_save_LIBS"
22326
22327 fi
22328 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
22329   echo "$ac_t""yes" 1>&6
22330   cat >> confdefs.h <<\EOF
22331 #define HAVE_STRFTIME 1
22332 EOF
22333
22334 LIBS="-lintl $LIBS"
22335 else
22336   echo "$ac_t""no" 1>&6
22337 fi
22338
22339 fi
22340
22341
22342 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
22343 echo "configure:22344: checking for inet_aton()" >&5
22344 if eval "test \"\${ol_cv_func_inet_aton+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
22351 #ifdef HAVE_SYS_TYPES_H
22352 #       include <sys/types.h>
22353 #endif
22354 #ifdef HAVE_SYS_SOCKET_H
22355 #       include <sys/socket.h>
22356 #       ifdef HAVE_SYS_SELECT_H
22357 #               include <sys/select.h>
22358 #       endif
22359 #       include <netinet/in.h>
22360 #       ifdef HAVE_ARPA_INET_H
22361 #               include <arpa/inet.h>
22362 #       endif
22363 #endif
22364
22365 int main() {
22366 struct in_addr in;
22367 int rc = inet_aton( "255.255.255.255", &in );
22368 ; return 0; }
22369 EOF
22370 if { (eval echo configure:22371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22371   rm -rf conftest*
22372   ol_cv_func_inet_aton=yes
22373 else
22374   echo "configure: failed program was:" >&5
22375   cat conftest.$ac_ext >&5
22376   rm -rf conftest*
22377   ol_cv_func_inet_aton=no
22378 fi
22379 rm -f conftest*
22380 fi
22381
22382 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
22383   if test $ol_cv_func_inet_aton != no; then
22384     cat >> confdefs.h <<\EOF
22385 #define HAVE_INET_ATON 1
22386 EOF
22387
22388   fi
22389  
22390
22391 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
22392 echo "configure:22393: checking for _spawnlp" >&5
22393 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
22394   echo $ac_n "(cached) $ac_c" 1>&6
22395 else
22396   cat > conftest.$ac_ext <<EOF
22397 #line 22398 "configure"
22398 #include "confdefs.h"
22399 /* System header to define __stub macros and hopefully few prototypes,
22400     which can conflict with char _spawnlp(); below.  */
22401 #include <assert.h>
22402 /* Override any gcc2 internal prototype to avoid an error.  */
22403 /* We use char because int might match the return type of a gcc2
22404     builtin and then its argument prototype would still apply.  */
22405 char _spawnlp();
22406 char (*f)();
22407
22408 int main() {
22409
22410 /* The GNU C library defines this for functions which it implements
22411     to always fail with ENOSYS.  Some functions are actually named
22412     something starting with __ and the normal name is an alias.  */
22413 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
22414 choke me
22415 #else
22416 f = _spawnlp;
22417 #endif
22418
22419 ; return 0; }
22420 EOF
22421 if { (eval echo configure:22422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22422   rm -rf conftest*
22423   eval "ac_cv_func__spawnlp=yes"
22424 else
22425   echo "configure: failed program was:" >&5
22426   cat conftest.$ac_ext >&5
22427   rm -rf conftest*
22428   eval "ac_cv_func__spawnlp=no"
22429 fi
22430 rm -f conftest*
22431 fi
22432
22433 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
22434   echo "$ac_t""yes" 1>&6
22435   cat >> confdefs.h <<\EOF
22436 #define HAVE_SPAWNLP 1
22437 EOF
22438
22439 else
22440   echo "$ac_t""no" 1>&6
22441 fi
22442
22443
22444 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
22445 echo "configure:22446: checking for _snprintf" >&5
22446 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
22447   echo $ac_n "(cached) $ac_c" 1>&6
22448 else
22449   cat > conftest.$ac_ext <<EOF
22450 #line 22451 "configure"
22451 #include "confdefs.h"
22452 /* System header to define __stub macros and hopefully few prototypes,
22453     which can conflict with char _snprintf(); below.  */
22454 #include <assert.h>
22455 /* Override any gcc2 internal prototype to avoid an error.  */
22456 /* We use char because int might match the return type of a gcc2
22457     builtin and then its argument prototype would still apply.  */
22458 char _snprintf();
22459 char (*f)();
22460
22461 int main() {
22462
22463 /* The GNU C library defines this for functions which it implements
22464     to always fail with ENOSYS.  Some functions are actually named
22465     something starting with __ and the normal name is an alias.  */
22466 #if defined (__stub__snprintf) || defined (__stub____snprintf)
22467 choke me
22468 #else
22469 f = _snprintf;
22470 #endif
22471
22472 ; return 0; }
22473 EOF
22474 if { (eval echo configure:22475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22475   rm -rf conftest*
22476   eval "ac_cv_func__snprintf=yes"
22477 else
22478   echo "configure: failed program was:" >&5
22479   cat conftest.$ac_ext >&5
22480   rm -rf conftest*
22481   eval "ac_cv_func__snprintf=no"
22482 fi
22483 rm -f conftest*
22484 fi
22485
22486 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
22487   echo "$ac_t""yes" 1>&6
22488   ac_cv_func_snprintf=yes
22489         cat >> confdefs.h <<\EOF
22490 #define snprintf _snprintf
22491 EOF
22492
22493
22494 else
22495   echo "$ac_t""no" 1>&6
22496 fi
22497
22498
22499 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
22500 echo "configure:22501: checking for _vsnprintf" >&5
22501 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
22502   echo $ac_n "(cached) $ac_c" 1>&6
22503 else
22504   cat > conftest.$ac_ext <<EOF
22505 #line 22506 "configure"
22506 #include "confdefs.h"
22507 /* System header to define __stub macros and hopefully few prototypes,
22508     which can conflict with char _vsnprintf(); below.  */
22509 #include <assert.h>
22510 /* Override any gcc2 internal prototype to avoid an error.  */
22511 /* We use char because int might match the return type of a gcc2
22512     builtin and then its argument prototype would still apply.  */
22513 char _vsnprintf();
22514 char (*f)();
22515
22516 int main() {
22517
22518 /* The GNU C library defines this for functions which it implements
22519     to always fail with ENOSYS.  Some functions are actually named
22520     something starting with __ and the normal name is an alias.  */
22521 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
22522 choke me
22523 #else
22524 f = _vsnprintf;
22525 #endif
22526
22527 ; return 0; }
22528 EOF
22529 if { (eval echo configure:22530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22530   rm -rf conftest*
22531   eval "ac_cv_func__vsnprintf=yes"
22532 else
22533   echo "configure: failed program was:" >&5
22534   cat conftest.$ac_ext >&5
22535   rm -rf conftest*
22536   eval "ac_cv_func__vsnprintf=no"
22537 fi
22538 rm -f conftest*
22539 fi
22540
22541 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
22542   echo "$ac_t""yes" 1>&6
22543   ac_cv_func_vsnprintf=yes
22544         cat >> confdefs.h <<\EOF
22545 #define vsnprintf _vsnprintf
22546 EOF
22547
22548
22549 else
22550   echo "$ac_t""no" 1>&6
22551 fi
22552
22553
22554 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
22555 echo "configure:22556: checking for vprintf" >&5
22556 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
22557   echo $ac_n "(cached) $ac_c" 1>&6
22558 else
22559   cat > conftest.$ac_ext <<EOF
22560 #line 22561 "configure"
22561 #include "confdefs.h"
22562 /* System header to define __stub macros and hopefully few prototypes,
22563     which can conflict with char vprintf(); below.  */
22564 #include <assert.h>
22565 /* Override any gcc2 internal prototype to avoid an error.  */
22566 /* We use char because int might match the return type of a gcc2
22567     builtin and then its argument prototype would still apply.  */
22568 char vprintf();
22569 char (*f)();
22570
22571 int main() {
22572
22573 /* The GNU C library defines this for functions which it implements
22574     to always fail with ENOSYS.  Some functions are actually named
22575     something starting with __ and the normal name is an alias.  */
22576 #if defined (__stub_vprintf) || defined (__stub___vprintf)
22577 choke me
22578 #else
22579 f = vprintf;
22580 #endif
22581
22582 ; return 0; }
22583 EOF
22584 if { (eval echo configure:22585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22585   rm -rf conftest*
22586   eval "ac_cv_func_vprintf=yes"
22587 else
22588   echo "configure: failed program was:" >&5
22589   cat conftest.$ac_ext >&5
22590   rm -rf conftest*
22591   eval "ac_cv_func_vprintf=no"
22592 fi
22593 rm -f conftest*
22594 fi
22595
22596 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
22597   echo "$ac_t""yes" 1>&6
22598   cat >> confdefs.h <<\EOF
22599 #define HAVE_VPRINTF 1
22600 EOF
22601
22602 else
22603   echo "$ac_t""no" 1>&6
22604 fi
22605
22606 if test "$ac_cv_func_vprintf" != yes; then
22607 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
22608 echo "configure:22609: checking for _doprnt" >&5
22609 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
22610   echo $ac_n "(cached) $ac_c" 1>&6
22611 else
22612   cat > conftest.$ac_ext <<EOF
22613 #line 22614 "configure"
22614 #include "confdefs.h"
22615 /* System header to define __stub macros and hopefully few prototypes,
22616     which can conflict with char _doprnt(); below.  */
22617 #include <assert.h>
22618 /* Override any gcc2 internal prototype to avoid an error.  */
22619 /* We use char because int might match the return type of a gcc2
22620     builtin and then its argument prototype would still apply.  */
22621 char _doprnt();
22622 char (*f)();
22623
22624 int main() {
22625
22626 /* The GNU C library defines this for functions which it implements
22627     to always fail with ENOSYS.  Some functions are actually named
22628     something starting with __ and the normal name is an alias.  */
22629 #if defined (__stub__doprnt) || defined (__stub____doprnt)
22630 choke me
22631 #else
22632 f = _doprnt;
22633 #endif
22634
22635 ; return 0; }
22636 EOF
22637 if { (eval echo configure:22638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22638   rm -rf conftest*
22639   eval "ac_cv_func__doprnt=yes"
22640 else
22641   echo "configure: failed program was:" >&5
22642   cat conftest.$ac_ext >&5
22643   rm -rf conftest*
22644   eval "ac_cv_func__doprnt=no"
22645 fi
22646 rm -f conftest*
22647 fi
22648
22649 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
22650   echo "$ac_t""yes" 1>&6
22651   cat >> confdefs.h <<\EOF
22652 #define HAVE_DOPRNT 1
22653 EOF
22654
22655 else
22656   echo "$ac_t""no" 1>&6
22657 fi
22658
22659 fi
22660
22661
22662 if test $ac_cv_func_vprintf = yes ; then
22663                 for ac_func in snprintf vsnprintf
22664 do
22665 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
22666 echo "configure:22667: checking for $ac_func" >&5
22667 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
22668   echo $ac_n "(cached) $ac_c" 1>&6
22669 else
22670   cat > conftest.$ac_ext <<EOF
22671 #line 22672 "configure"
22672 #include "confdefs.h"
22673 /* System header to define __stub macros and hopefully few prototypes,
22674     which can conflict with char $ac_func(); below.  */
22675 #include <assert.h>
22676 /* Override any gcc2 internal prototype to avoid an error.  */
22677 /* We use char because int might match the return type of a gcc2
22678     builtin and then its argument prototype would still apply.  */
22679 char $ac_func();
22680 char (*f)();
22681
22682 int main() {
22683
22684 /* The GNU C library defines this for functions which it implements
22685     to always fail with ENOSYS.  Some functions are actually named
22686     something starting with __ and the normal name is an alias.  */
22687 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
22688 choke me
22689 #else
22690 f = $ac_func;
22691 #endif
22692
22693 ; return 0; }
22694 EOF
22695 if { (eval echo configure:22696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22696   rm -rf conftest*
22697   eval "ac_cv_func_$ac_func=yes"
22698 else
22699   echo "configure: failed program was:" >&5
22700   cat conftest.$ac_ext >&5
22701   rm -rf conftest*
22702   eval "ac_cv_func_$ac_func=no"
22703 fi
22704 rm -f conftest*
22705 fi
22706
22707 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
22708   echo "$ac_t""yes" 1>&6
22709     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
22710   cat >> confdefs.h <<EOF
22711 #define $ac_tr_func 1
22712 EOF
22713  
22714 else
22715   echo "$ac_t""no" 1>&6
22716 fi
22717 done
22718
22719 fi
22720
22721 for ac_func in \
22722         bcopy                   \
22723         closesocket             \
22724         chroot                  \
22725         endgrent                \
22726         endpwent                \
22727         fcntl                   \
22728         flock                   \
22729         fstat                   \
22730         getdtablesize   \
22731         getgrgid                \
22732         gethostname             \
22733         getpass                 \
22734         getpassphrase   \
22735         getpwuid                \
22736         getpwnam                \
22737         getspnam                \
22738         gettimeofday    \
22739         initgroups              \
22740         lockf                   \
22741         memcpy                  \
22742         memmove                 \
22743         mkstemp                 \
22744         mktemp                  \
22745         pipe                    \
22746         read                    \
22747         recv                    \
22748         recvfrom                \
22749         setpwfile               \
22750         setgid                  \
22751         setegid                 \
22752         setsid                  \
22753         setuid                  \
22754         seteuid                 \
22755         sigaction               \
22756         signal                  \
22757         sigset                  \
22758         strdup                  \
22759         strerror                \
22760         strpbrk                 \
22761         strrchr                 \
22762         strsep                  \
22763         strstr                  \
22764         strtol                  \
22765         strtoul                 \
22766         strspn                  \
22767         sysconf                 \
22768         usleep                  \
22769         waitpid                 \
22770         wait4                   \
22771         write                   \
22772         send                    \
22773         sendmsg                 \
22774         sendto                  \
22775
22776 do
22777 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
22778 echo "configure:22779: checking for $ac_func" >&5
22779 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
22780   echo $ac_n "(cached) $ac_c" 1>&6
22781 else
22782   cat > conftest.$ac_ext <<EOF
22783 #line 22784 "configure"
22784 #include "confdefs.h"
22785 /* System header to define __stub macros and hopefully few prototypes,
22786     which can conflict with char $ac_func(); below.  */
22787 #include <assert.h>
22788 /* Override any gcc2 internal prototype to avoid an error.  */
22789 /* We use char because int might match the return type of a gcc2
22790     builtin and then its argument prototype would still apply.  */
22791 char $ac_func();
22792 char (*f)();
22793
22794 int main() {
22795
22796 /* The GNU C library defines this for functions which it implements
22797     to always fail with ENOSYS.  Some functions are actually named
22798     something starting with __ and the normal name is an alias.  */
22799 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
22800 choke me
22801 #else
22802 f = $ac_func;
22803 #endif
22804
22805 ; return 0; }
22806 EOF
22807 if { (eval echo configure:22808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22808   rm -rf conftest*
22809   eval "ac_cv_func_$ac_func=yes"
22810 else
22811   echo "configure: failed program was:" >&5
22812   cat conftest.$ac_ext >&5
22813   rm -rf conftest*
22814   eval "ac_cv_func_$ac_func=no"
22815 fi
22816 rm -f conftest*
22817 fi
22818
22819 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
22820   echo "$ac_t""yes" 1>&6
22821     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
22822   cat >> confdefs.h <<EOF
22823 #define $ac_tr_func 1
22824 EOF
22825  
22826 else
22827   echo "$ac_t""no" 1>&6
22828 fi
22829 done
22830
22831
22832 for ac_func in getopt getpeereid
22833 do
22834 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
22835 echo "configure:22836: checking for $ac_func" >&5
22836 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
22837   echo $ac_n "(cached) $ac_c" 1>&6
22838 else
22839   cat > conftest.$ac_ext <<EOF
22840 #line 22841 "configure"
22841 #include "confdefs.h"
22842 /* System header to define __stub macros and hopefully few prototypes,
22843     which can conflict with char $ac_func(); below.  */
22844 #include <assert.h>
22845 /* Override any gcc2 internal prototype to avoid an error.  */
22846 /* We use char because int might match the return type of a gcc2
22847     builtin and then its argument prototype would still apply.  */
22848 char $ac_func();
22849 char (*f)();
22850
22851 int main() {
22852
22853 /* The GNU C library defines this for functions which it implements
22854     to always fail with ENOSYS.  Some functions are actually named
22855     something starting with __ and the normal name is an alias.  */
22856 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
22857 choke me
22858 #else
22859 f = $ac_func;
22860 #endif
22861
22862 ; return 0; }
22863 EOF
22864 if { (eval echo configure:22865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22865   rm -rf conftest*
22866   eval "ac_cv_func_$ac_func=yes"
22867 else
22868   echo "configure: failed program was:" >&5
22869   cat conftest.$ac_ext >&5
22870   rm -rf conftest*
22871   eval "ac_cv_func_$ac_func=no"
22872 fi
22873 rm -f conftest*
22874 fi
22875
22876 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
22877   echo "$ac_t""yes" 1>&6
22878     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
22879   cat >> confdefs.h <<EOF
22880 #define $ac_tr_func 1
22881 EOF
22882  
22883 else
22884   echo "$ac_t""no" 1>&6
22885 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
22886 fi
22887 done
22888
22889
22890
22891 if test "$ac_cv_func_getopt" != yes; then
22892         LIBSRCS="$LIBSRCS getopt.c"
22893 fi
22894 if test "$ac_cv_func_getpeereid" != yes; then
22895         echo $ac_n "checking for msg_accrights in msghdr""... $ac_c" 1>&6
22896 echo "configure:22897: checking for msg_accrights in msghdr" >&5
22897 if eval "test \"\${ol_cv_msghdr_msg_accrights+set}\" = set"; then
22898   echo $ac_n "(cached) $ac_c" 1>&6
22899 else
22900   cat > conftest.$ac_ext <<EOF
22901 #line 22902 "configure"
22902 #include "confdefs.h"
22903 #include <sys/socket.h>
22904 int main() {
22905 struct msghdr m; m.msg_accrightslen=0
22906 ; return 0; }
22907 EOF
22908 if { (eval echo configure:22909: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22909   rm -rf conftest*
22910   ol_cv_msghdr_msg_accrights=yes
22911 else
22912   echo "configure: failed program was:" >&5
22913   cat conftest.$ac_ext >&5
22914   rm -rf conftest*
22915   ol_cv_msghdr_msg_accrights=no
22916 fi
22917 rm -f conftest*
22918         
22919 fi
22920
22921 echo "$ac_t""$ol_cv_msghdr_msg_accrights" 1>&6
22922   if test $ol_cv_msghdr_msg_accrights = "yes" ; then
22923         cat >> confdefs.h <<\EOF
22924 #define HAVE_MSGHDR_MSG_ACCRIGHTS 1
22925 EOF
22926
22927   fi
22928
22929         LIBSRCS="$LIBSRCS getpeereid.c"
22930 fi
22931 if test "$ac_cv_func_snprintf" != yes -o "$ac_cv_func_vsnprintf" != yes; then
22932         if test "$ac_cv_func_snprintf" != yes; then
22933                 cat >> confdefs.h <<\EOF
22934 #define snprintf ber_pvt_snprintf
22935 EOF
22936
22937         fi
22938         if test "$ac_cv_func_vsnprintf" != yes; then
22939                 cat >> confdefs.h <<\EOF
22940 #define vsnprintf ber_pvt_vsnprintf
22941 EOF
22942
22943         fi
22944 fi
22945
22946 # Check Configuration
22947 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
22948 echo "configure:22949: checking declaration of sys_errlist" >&5
22949 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
22950   echo $ac_n "(cached) $ac_c" 1>&6
22951 else
22952   
22953         cat > conftest.$ac_ext <<EOF
22954 #line 22955 "configure"
22955 #include "confdefs.h"
22956
22957 #include <stdio.h>
22958 #include <sys/types.h>
22959 #include <errno.h>
22960 #ifdef WINNT
22961 #include <stdlib.h>
22962 #endif 
22963 int main() {
22964 char *c = (char *) *sys_errlist
22965 ; return 0; }
22966 EOF
22967 if { (eval echo configure:22968: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22968   rm -rf conftest*
22969   ol_cv_dcl_sys_errlist=yes
22970         ol_cv_have_sys_errlist=yes
22971 else
22972   echo "configure: failed program was:" >&5
22973   cat conftest.$ac_ext >&5
22974   rm -rf conftest*
22975   ol_cv_dcl_sys_errlist=no
22976 fi
22977 rm -f conftest*
22978 fi
22979
22980 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
22981 #
22982 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
22983 if test $ol_cv_dcl_sys_errlist = no ; then
22984         cat >> confdefs.h <<\EOF
22985 #define DECL_SYS_ERRLIST 1
22986 EOF
22987
22988
22989         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
22990 echo "configure:22991: checking existence of sys_errlist" >&5
22991 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
22992   echo $ac_n "(cached) $ac_c" 1>&6
22993 else
22994   
22995                 cat > conftest.$ac_ext <<EOF
22996 #line 22997 "configure"
22997 #include "confdefs.h"
22998 #include <errno.h>
22999 int main() {
23000 char *c = (char *) *sys_errlist
23001 ; return 0; }
23002 EOF
23003 if { (eval echo configure:23004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
23004   rm -rf conftest*
23005   ol_cv_have_sys_errlist=yes
23006 else
23007   echo "configure: failed program was:" >&5
23008   cat conftest.$ac_ext >&5
23009   rm -rf conftest*
23010   ol_cv_have_sys_errlist=no
23011 fi
23012 rm -f conftest*
23013 fi
23014
23015 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
23016 fi
23017 if test $ol_cv_have_sys_errlist = yes ; then
23018         cat >> confdefs.h <<\EOF
23019 #define HAVE_SYS_ERRLIST 1
23020 EOF
23021
23022 fi
23023
23024
23025
23026 if test "$ol_enable_slapi" != no ; then
23027                         for ac_hdr in ltdl.h
23028 do
23029 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
23030 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
23031 echo "configure:23032: checking for $ac_hdr" >&5
23032 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
23033   echo $ac_n "(cached) $ac_c" 1>&6
23034 else
23035   cat > conftest.$ac_ext <<EOF
23036 #line 23037 "configure"
23037 #include "confdefs.h"
23038 #include <$ac_hdr>
23039 EOF
23040 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
23041 { (eval echo configure:23042: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
23042 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
23043 if test -z "$ac_err"; then
23044   rm -rf conftest*
23045   eval "ac_cv_header_$ac_safe=yes"
23046 else
23047   echo "$ac_err" >&5
23048   echo "configure: failed program was:" >&5
23049   cat conftest.$ac_ext >&5
23050   rm -rf conftest*
23051   eval "ac_cv_header_$ac_safe=no"
23052 fi
23053 rm -f conftest*
23054 fi
23055 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
23056   echo "$ac_t""yes" 1>&6
23057     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
23058   cat >> confdefs.h <<EOF
23059 #define $ac_tr_hdr 1
23060 EOF
23061  
23062 else
23063   echo "$ac_t""no" 1>&6
23064 fi
23065 done
23066
23067
23068         if test $ac_cv_header_ltdl_h != yes ; then
23069                 { echo "configure: error: could not locate <ltdl.h>" 1>&2; exit 1; }
23070         fi
23071         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
23072 echo "configure:23073: checking for lt_dlinit in -lltdl" >&5
23073 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
23074 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
23075   echo $ac_n "(cached) $ac_c" 1>&6
23076 else
23077   ac_save_LIBS="$LIBS"
23078 LIBS="-lltdl  $LIBS"
23079 cat > conftest.$ac_ext <<EOF
23080 #line 23081 "configure"
23081 #include "confdefs.h"
23082 /* Override any gcc2 internal prototype to avoid an error.  */
23083 /* We use char because int might match the return type of a gcc2
23084     builtin and then its argument prototype would still apply.  */
23085 char lt_dlinit();
23086
23087 int main() {
23088 lt_dlinit()
23089 ; return 0; }
23090 EOF
23091 if { (eval echo configure:23092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
23092   rm -rf conftest*
23093   eval "ac_cv_lib_$ac_lib_var=yes"
23094 else
23095   echo "configure: failed program was:" >&5
23096   cat conftest.$ac_ext >&5
23097   rm -rf conftest*
23098   eval "ac_cv_lib_$ac_lib_var=no"
23099 fi
23100 rm -f conftest*
23101 LIBS="$ac_save_LIBS"
23102
23103 fi
23104 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
23105   echo "$ac_t""yes" 1>&6
23106   
23107                 SLAPI_LIBS=-lltdl
23108                 LIBSLAPI=./libslapi.a
23109                 LIBSLAPITOOLS=../libslapi.a
23110                 cat >> confdefs.h <<\EOF
23111 #define HAVE_LIBLTDL 1
23112 EOF
23113
23114         
23115 else
23116   echo "$ac_t""no" 1>&6
23117 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
23118 fi
23119
23120
23121         cat >> confdefs.h <<\EOF
23122 #define LDAP_SLAPI 1
23123 EOF
23124
23125 fi
23126
23127 if test "$ol_enable_debug" != no ; then
23128         cat >> confdefs.h <<\EOF
23129 #define LDAP_DEBUG 1
23130 EOF
23131
23132 fi
23133 if test "$ol_enable_syslog" = yes ; then
23134         cat >> confdefs.h <<\EOF
23135 #define LDAP_SYSLOG 1
23136 EOF
23137
23138 fi
23139 if test "$ol_link_kbind" != no ; then
23140         cat >> confdefs.h <<\EOF
23141 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
23142 EOF
23143
23144 fi
23145 if test "$ol_enable_proctitle" != no ; then
23146         cat >> confdefs.h <<\EOF
23147 #define LDAP_PROCTITLE 1
23148 EOF
23149
23150 fi
23151 if test "$ol_enable_referrals" != no ; then
23152         cat >> confdefs.h <<\EOF
23153 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
23154 EOF
23155
23156 fi
23157 if test "$ol_enable_local" != no; then
23158         cat >> confdefs.h <<\EOF
23159 #define LDAP_PF_LOCAL 1
23160 EOF
23161
23162 fi
23163 if test "$ol_link_ipv6" != no; then
23164         cat >> confdefs.h <<\EOF
23165 #define LDAP_PF_INET6 1
23166 EOF
23167
23168 fi
23169 if test "$ol_enable_cleartext" != no ; then
23170         cat >> confdefs.h <<\EOF
23171 #define SLAPD_CLEARTEXT 1
23172 EOF
23173
23174 fi
23175 if test "$ol_enable_crypt" != no ; then
23176         cat >> confdefs.h <<\EOF
23177 #define SLAPD_CRYPT 1
23178 EOF
23179
23180 fi
23181 if test "$ol_link_kpasswd" != no ; then
23182         cat >> confdefs.h <<\EOF
23183 #define SLAPD_KPASSWD 1
23184 EOF
23185
23186 fi
23187 if test "$ol_link_spasswd" != no ; then
23188         cat >> confdefs.h <<\EOF
23189 #define SLAPD_SPASSWD 1
23190 EOF
23191
23192 fi
23193 if test "$ol_enable_multimaster" != no ; then
23194         cat >> confdefs.h <<\EOF
23195 #define SLAPD_MULTIMASTER 1
23196 EOF
23197
23198 fi
23199 if test "$ol_enable_phonetic" != no ; then
23200         cat >> confdefs.h <<\EOF
23201 #define SLAPD_PHONETIC 1
23202 EOF
23203
23204 fi
23205 if test "$ol_enable_rlookups" != no ; then
23206         cat >> confdefs.h <<\EOF
23207 #define SLAPD_RLOOKUPS 1
23208 EOF
23209
23210 fi
23211 if test "$ol_enable_aci" != no ; then
23212         cat >> confdefs.h <<\EOF
23213 #define SLAPD_ACI_ENABLED 1
23214 EOF
23215
23216 fi
23217
23218 if test "$ol_link_modules" != no ; then
23219         cat >> confdefs.h <<\EOF
23220 #define SLAPD_MODULES 1
23221 EOF
23222
23223         BUILD_SLAPD=yes
23224         SLAPD_MODULES_LDFLAGS="-dlopen self"
23225 fi
23226
23227 if test "$ol_enable_bdb" != no ; then
23228         cat >> confdefs.h <<\EOF
23229 #define SLAPD_BDB 1
23230 EOF
23231
23232         BUILD_SLAPD=yes
23233         BUILD_BDB=yes
23234         if test "$ol_with_bdb_module" != static ; then
23235                 cat >> confdefs.h <<\EOF
23236 #define SLAPD_BDB_DYNAMIC 1
23237 EOF
23238
23239                 BUILD_BDB=mod
23240                 BUILD_BDB_DYNAMIC=shared
23241                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-bdb"
23242         else
23243                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-bdb"
23244         fi
23245 fi
23246
23247 if test "$ol_link_dnssrv" != no ; then
23248         cat >> confdefs.h <<\EOF
23249 #define SLAPD_DNSSRV 1
23250 EOF
23251
23252         BUILD_SLAPD=yes
23253         BUILD_DNSSRV=yes
23254         if test "$ol_with_dnssrv_module" != static ; then
23255                 cat >> confdefs.h <<\EOF
23256 #define SLAPD_DNSSRV_DYNAMIC 1
23257 EOF
23258
23259                 BUILD_DNSSRV=mod
23260                 BUILD_DNSSRV_DYNAMIC=shared
23261                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-dnssrv"
23262         else
23263                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-dnssrv"
23264         fi
23265 fi
23266
23267 if test "$ol_enable_ldap" != no ; then
23268         cat >> confdefs.h <<\EOF
23269 #define SLAPD_LDAP 1
23270 EOF
23271
23272         BUILD_SLAPD=yes
23273         BUILD_LDAP=yes
23274         if test "$ol_with_ldap_module" != static ; then
23275                 cat >> confdefs.h <<\EOF
23276 #define SLAPD_LDAP_DYNAMIC 1
23277 EOF
23278
23279                 BUILD_LDAP=mod
23280                 BUILD_LDAP_DYNAMIC=shared
23281                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldap"
23282         else
23283                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldap"
23284         fi
23285 fi
23286
23287 if test "$ol_link_ldbm" != no -a $ol_enable_ldbm != no; then
23288         cat >> confdefs.h <<\EOF
23289 #define SLAPD_LDBM 1
23290 EOF
23291
23292         BUILD_SLAPD=yes
23293         BUILD_LDBM=yes
23294         if test "$ol_with_ldbm_module" != static ; then
23295                 cat >> confdefs.h <<\EOF
23296 #define SLAPD_LDBM_DYNAMIC 1
23297 EOF
23298
23299                 BUILD_LDBM=mod
23300                 BUILD_LDBM_DYNAMIC=shared
23301                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldbm"
23302         else
23303                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldbm"
23304         fi
23305 fi
23306
23307 if test "$ol_enable_meta" != no ; then
23308         if test "$ol_enable_ldap" = no ; then
23309                 { echo "configure: error: need --enable-ldap to use --enable-meta" 1>&2; exit 1; }
23310         fi
23311         if test "$ol_enable_rewrite" = no ; then
23312                 { echo "configure: error: need --enable-rewrite to use --enable-meta" 1>&2; exit 1; }
23313         fi
23314         cat >> confdefs.h <<\EOF
23315 #define SLAPD_META 1
23316 EOF
23317
23318         BUILD_SLAPD=yes
23319         BUILD_META=yes
23320         BUILD_LDAP=yes
23321         BUILD_REWRITE=yes
23322         if test "$ol_with_meta_module" != static ; then
23323                 cat >> confdefs.h <<\EOF
23324 #define SLAPD_META_DYNAMIC 1
23325 EOF
23326
23327                 BUILD_META=mod
23328                 BUILD_META_DYNAMIC=shared
23329                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-meta"
23330         else
23331                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-meta"
23332         fi
23333 fi
23334
23335 if test "$ol_enable_monitor" != no ; then
23336         cat >> confdefs.h <<\EOF
23337 #define SLAPD_MONITOR 1
23338 EOF
23339
23340         BUILD_SLAPD=yes
23341         BUILD_MONITOR=yes
23342         if test "$ol_with_monitor_module" != static ; then
23343                 cat >> confdefs.h <<\EOF
23344 #define SLAPD_MONITOR_DYNAMIC 1
23345 EOF
23346
23347                 BUILD_MONITOR=mod
23348                 BUILD_MONITOR_DYNAMIC=shared
23349                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-monitor"
23350         else
23351                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-monitor"
23352         fi
23353 fi
23354
23355 if test "$ol_enable_null" != no ; then
23356         cat >> confdefs.h <<\EOF
23357 #define SLAPD_NULL 1
23358 EOF
23359
23360         BUILD_SLAPD=yes
23361         BUILD_NULL=yes
23362         if test "$ol_with_null_module" != static ; then
23363                 cat >> confdefs.h <<\EOF
23364 #define SLAPD_NULL_DYNAMIC 1
23365 EOF
23366
23367                 BUILD_NULL=mod
23368                 BUILD_NULL_DYNAMIC=shared
23369                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-null"
23370         else
23371                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-null"
23372         fi
23373 fi
23374
23375 if test "$ol_enable_passwd" != no ; then
23376         cat >> confdefs.h <<\EOF
23377 #define SLAPD_PASSWD 1
23378 EOF
23379
23380         BUILD_SLAPD=yes
23381         BUILD_PASSWD=yes
23382         if test "$ol_with_passwd_module" != static ; then
23383                 cat >> confdefs.h <<\EOF
23384 #define SLAPD_PASSWD_DYNAMIC 1
23385 EOF
23386
23387                 BUILD_PASSWD=mod
23388                 BUILD_PASSWD_DYNAMIC=shared
23389                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-passwd"
23390         else
23391                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-passwd"
23392         fi
23393 fi
23394
23395 if test "$ol_link_perl" != no ; then
23396         cat >> confdefs.h <<\EOF
23397 #define SLAPD_PERL 1
23398 EOF
23399
23400         BUILD_SLAPD=yes
23401         BUILD_PERL=yes
23402         if test "$ol_with_perl_module" != static ; then
23403                 cat >> confdefs.h <<\EOF
23404 #define SLAPD_PERL_DYNAMIC 1
23405 EOF
23406
23407                 BUILD_PERL=mod
23408                 BUILD_PERL_DYNAMIC=shared
23409                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-perl"
23410         else
23411                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-perl"
23412         fi
23413 fi
23414
23415 if test "$ol_enable_shell" != no ; then
23416         if test "$ol_link_thread" != no ; then
23417                 echo "configure: warning: Use of --without-threads is recommended with back-shell" 1>&2
23418         fi
23419         cat >> confdefs.h <<\EOF
23420 #define SLAPD_SHELL 1
23421 EOF
23422
23423         BUILD_SLAPD=yes
23424         BUILD_SHELL=yes
23425         if test "$ol_with_shell_module" != static ; then
23426                 cat >> confdefs.h <<\EOF
23427 #define SLAPD_SHELL_DYNAMIC 1
23428 EOF
23429
23430                 BUILD_SHELL=mod
23431                 BUILD_SHELL_DYNAMIC=shared
23432                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-shell"
23433         else
23434                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-shell"
23435         fi
23436 fi
23437
23438 if test "$ol_enable_tcl" != no ; then
23439         cat >> confdefs.h <<\EOF
23440 #define SLAPD_TCL 1
23441 EOF
23442
23443         BUILD_SLAPD=yes
23444         BUILD_TCL=yes
23445         if test "$ol_with_tcl_module" != static; then
23446                 cat >> confdefs.h <<\EOF
23447 #define SLAPD_TCL_DYNAMIC 1
23448 EOF
23449
23450                 BUILD_TCL=mod
23451                 BUILD_TCL_DYNAMIC=shared
23452                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-tcl"
23453         else
23454                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-tcl"
23455         fi
23456 fi
23457
23458 if test "$ol_link_sql" != no ; then
23459         cat >> confdefs.h <<\EOF
23460 #define SLAPD_SQL 1
23461 EOF
23462
23463         BUILD_SLAPD=yes
23464         BUILD_SQL=yes
23465         if test "$ol_with_sql_module" != static; then
23466                 cat >> confdefs.h <<\EOF
23467 #define SLAPD_SQL_DYNAMIC 1
23468 EOF
23469
23470                 BUILD_SQL=mod
23471                 BUILD_SQL_DYNAMIC=shared
23472                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-sql"
23473         else
23474                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-sql"
23475         fi
23476 fi
23477
23478 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
23479         $BUILD_SLAPD = yes ; then
23480         BUILD_SLURPD=yes
23481 fi
23482
23483 if test "$ol_enable_rewrite" != no ; then
23484         cat >> confdefs.h <<\EOF
23485 #define ENABLE_REWRITE 1
23486 EOF
23487
23488         BUILD_REWRITE=yes
23489 fi
23490
23491 if test "$ol_enable_slapi" != no ; then
23492         cat >> confdefs.h <<\EOF
23493 #define ENABLE_SLAPI 1
23494 EOF
23495
23496         BUILD_SLAPI=yes
23497         SLAPD_SLAPI_DEPEND=libslapi.a
23498 fi
23499
23500
23501
23502 if test "$ac_cv_mingw32" = yes ; then
23503         PLAT=NT
23504         SLAPD_MODULES_LDFLAGS=
23505 else
23506         PLAT=UNIX
23507 fi
23508
23509 if test -z "$SLAPD_STATIC_BACKENDS"; then
23510         SLAPD_NO_STATIC='#'
23511 else
23512         SLAPD_NO_STATIC=
23513 fi
23514
23515
23516
23517
23518
23519
23520   
23521   
23522   
23523   
23524   
23525   
23526   
23527   
23528   
23529   
23530   
23531   
23532   
23533   
23534   
23535   
23536   
23537   
23538   
23539   
23540   
23541   
23542   
23543   
23544   
23545   
23546
23547
23548
23549
23550
23551
23552
23553
23554
23555
23556
23557
23558
23559
23560
23561
23562
23563
23564
23565
23566
23567
23568
23569
23570
23571
23572
23573
23574
23575
23576
23577
23578
23579
23580
23581
23582
23583
23584
23585
23586
23587 # Check whether --with-xxinstall or --without-xxinstall was given.
23588 if test "${with_xxinstall+set}" = set; then
23589   withval="$with_xxinstall"
23590   :
23591 fi
23592
23593
23594
23595 trap '' 1 2 15
23596
23597 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
23598
23599 test "x$prefix" = xNONE && prefix=$ac_default_prefix
23600 # Let make expand exec_prefix.
23601 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
23602
23603 # Any assignment to VPATH causes Sun make to only execute
23604 # the first set of double-colon rules, so remove it if not needed.
23605 # If there is a colon in the path, we need to keep it.
23606 if test "x$srcdir" = x.; then
23607   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
23608 fi
23609
23610 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
23611
23612 DEFS=-DHAVE_CONFIG_H
23613
23614 # Without the "./", some shells look in PATH for config.status.
23615 : ${CONFIG_STATUS=./config.status}
23616
23617 echo creating $CONFIG_STATUS
23618 rm -f $CONFIG_STATUS
23619 cat > $CONFIG_STATUS <<EOF
23620 #! /bin/sh
23621 # Generated automatically by configure.
23622 # Run this file to recreate the current configuration.
23623 # This directory was configured as follows,
23624 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
23625 #
23626 # $0 $ac_configure_args
23627 #
23628 # Compiler output produced by configure, useful for debugging
23629 # configure, is in ./config.log if it exists.
23630
23631 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
23632 for ac_option
23633 do
23634   case "\$ac_option" in
23635   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
23636     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
23637     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
23638   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
23639     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
23640     exit 0 ;;
23641   -help | --help | --hel | --he | --h)
23642     echo "\$ac_cs_usage"; exit 0 ;;
23643   *) echo "\$ac_cs_usage"; exit 1 ;;
23644   esac
23645 done
23646
23647 ac_given_srcdir=$srcdir
23648 ac_given_INSTALL="$INSTALL"
23649
23650 trap 'rm -fr `echo "\
23651 Makefile:build/top.mk:Makefile.in:build/dir.mk \
23652 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
23653 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
23654 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
23655 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
23656 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
23657 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
23658 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
23659 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
23660 include/Makefile:build/top.mk:include/Makefile.in \
23661 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
23662 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
23663 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23664 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23665 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
23666 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
23667 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
23668 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
23669 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
23670 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
23671 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
23672 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
23673 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
23674 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
23675 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
23676 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
23677 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
23678 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
23679 servers/slapd/back-null/Makefile:build/top.mk:servers/slapd/back-null/Makefile.in:build/mod.mk \
23680 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
23681 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
23682 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
23683 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
23684 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
23685 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
23686 servers/slapd/slapi/Makefile:build/top.mk:servers/slapd/slapi/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23687 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
23688 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
23689 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
23690 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
23691  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
23692 EOF
23693 cat >> $CONFIG_STATUS <<EOF
23694
23695 # Protect against being on the right side of a sed subst in config.status.
23696 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
23697  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
23698 $ac_vpsub
23699 $extrasub
23700 s%@SHELL@%$SHELL%g
23701 s%@CFLAGS@%$CFLAGS%g
23702 s%@CPPFLAGS@%$CPPFLAGS%g
23703 s%@CXXFLAGS@%$CXXFLAGS%g
23704 s%@FFLAGS@%$FFLAGS%g
23705 s%@DEFS@%$DEFS%g
23706 s%@LDFLAGS@%$LDFLAGS%g
23707 s%@LIBS@%$LIBS%g
23708 s%@exec_prefix@%$exec_prefix%g
23709 s%@prefix@%$prefix%g
23710 s%@program_transform_name@%$program_transform_name%g
23711 s%@bindir@%$bindir%g
23712 s%@sbindir@%$sbindir%g
23713 s%@libexecdir@%$libexecdir%g
23714 s%@datadir@%$datadir%g
23715 s%@sysconfdir@%$sysconfdir%g
23716 s%@sharedstatedir@%$sharedstatedir%g
23717 s%@localstatedir@%$localstatedir%g
23718 s%@libdir@%$libdir%g
23719 s%@includedir@%$includedir%g
23720 s%@oldincludedir@%$oldincludedir%g
23721 s%@infodir@%$infodir%g
23722 s%@mandir@%$mandir%g
23723 s%@host@%$host%g
23724 s%@host_alias@%$host_alias%g
23725 s%@host_cpu@%$host_cpu%g
23726 s%@host_vendor@%$host_vendor%g
23727 s%@host_os@%$host_os%g
23728 s%@target@%$target%g
23729 s%@target_alias@%$target_alias%g
23730 s%@target_cpu@%$target_cpu%g
23731 s%@target_vendor@%$target_vendor%g
23732 s%@target_os@%$target_os%g
23733 s%@build@%$build%g
23734 s%@build_alias@%$build_alias%g
23735 s%@build_cpu@%$build_cpu%g
23736 s%@build_vendor@%$build_vendor%g
23737 s%@build_os@%$build_os%g
23738 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
23739 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
23740 s%@INSTALL_DATA@%$INSTALL_DATA%g
23741 s%@PACKAGE@%$PACKAGE%g
23742 s%@VERSION@%$VERSION%g
23743 s%@ACLOCAL@%$ACLOCAL%g
23744 s%@AUTOCONF@%$AUTOCONF%g
23745 s%@AUTOMAKE@%$AUTOMAKE%g
23746 s%@AUTOHEADER@%$AUTOHEADER%g
23747 s%@MAKEINFO@%$MAKEINFO%g
23748 s%@install_sh@%$install_sh%g
23749 s%@AMTAR@%$AMTAR%g
23750 s%@AWK@%$AWK%g
23751 s%@AMTARFLAGS@%$AMTARFLAGS%g
23752 s%@SET_MAKE@%$SET_MAKE%g
23753 s%@OPENLDAP_LIBVERSION@%$OPENLDAP_LIBVERSION%g
23754 s%@OPENLDAP_RELEASE_DATE@%$OPENLDAP_RELEASE_DATE%g
23755 s%@top_builddir@%$top_builddir%g
23756 s%@ldap_subdir@%$ldap_subdir%g
23757 s%@CC@%$CC%g
23758 s%@AR@%$AR%g
23759 s%@LN_S@%$LN_S%g
23760 s%@OBJEXT@%$OBJEXT%g
23761 s%@EXEEXT@%$EXEEXT%g
23762 s%@ECHO@%$ECHO%g
23763 s%@RANLIB@%$RANLIB%g
23764 s%@STRIP@%$STRIP%g
23765 s%@DLLTOOL@%$DLLTOOL%g
23766 s%@AS@%$AS%g
23767 s%@OBJDUMP@%$OBJDUMP%g
23768 s%@CPP@%$CPP%g
23769 s%@LIBTOOL@%$LIBTOOL%g
23770 s%@LN_H@%$LN_H%g
23771 s%@PERLBIN@%$PERLBIN%g
23772 s%@OL_MKDEP@%$OL_MKDEP%g
23773 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
23774 s%@LTSTATIC@%$LTSTATIC%g
23775 s%@LIBOBJS@%$LIBOBJS%g
23776 s%@LIBSRCS@%$LIBSRCS%g
23777 s%@PLAT@%$PLAT%g
23778 s%@BUILD_LIBS_DYNAMIC@%$BUILD_LIBS_DYNAMIC%g
23779 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
23780 s%@BUILD_SLAPI@%$BUILD_SLAPI%g
23781 s%@SLAPD_SLAPI_DEPEND@%$SLAPD_SLAPI_DEPEND%g
23782 s%@BUILD_BDB@%$BUILD_BDB%g
23783 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
23784 s%@BUILD_LDAP@%$BUILD_LDAP%g
23785 s%@BUILD_LDBM@%$BUILD_LDBM%g
23786 s%@BUILD_META@%$BUILD_META%g
23787 s%@BUILD_MONITOR@%$BUILD_MONITOR%g
23788 s%@BUILD_NULL@%$BUILD_NULL%g
23789 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
23790 s%@BUILD_PERL@%$BUILD_PERL%g
23791 s%@BUILD_SHELL@%$BUILD_SHELL%g
23792 s%@BUILD_SQL@%$BUILD_SQL%g
23793 s%@BUILD_TCL@%$BUILD_TCL%g
23794 s%@BUILD_BDB_DYNAMIC@%$BUILD_BDB_DYNAMIC%g
23795 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
23796 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
23797 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
23798 s%@BUILD_META_DYNAMIC@%$BUILD_META_DYNAMIC%g
23799 s%@BUILD_MONITOR_DYNAMIC@%$BUILD_MONITOR_DYNAMIC%g
23800 s%@BUILD_NULL_DYNAMIC@%$BUILD_NULL_DYNAMIC%g
23801 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
23802 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
23803 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
23804 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
23805 s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g
23806 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
23807 s%@LDAP_LIBS@%$LDAP_LIBS%g
23808 s%@LDIF_LIBS@%$LDIF_LIBS%g
23809 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
23810 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
23811 s%@LDBM_LIBS@%$LDBM_LIBS%g
23812 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
23813 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
23814 s%@WRAP_LIBS@%$WRAP_LIBS%g
23815 s%@MOD_TCL_LIB@%$MOD_TCL_LIB%g
23816 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
23817 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
23818 s%@SLAPD_NO_STATIC@%$SLAPD_NO_STATIC%g
23819 s%@SLAPD_STATIC_BACKENDS@%$SLAPD_STATIC_BACKENDS%g
23820 s%@SLAPD_DYNAMIC_BACKENDS@%$SLAPD_DYNAMIC_BACKENDS%g
23821 s%@PERL_CPPFLAGS@%$PERL_CPPFLAGS%g
23822 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
23823 s%@MOD_PERL_LDFLAGS@%$MOD_PERL_LDFLAGS%g
23824 s%@KRB4_LIBS@%$KRB4_LIBS%g
23825 s%@KRB5_LIBS@%$KRB5_LIBS%g
23826 s%@READLINE_LIBS@%$READLINE_LIBS%g
23827 s%@SASL_LIBS@%$SASL_LIBS%g
23828 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
23829 s%@TLS_LIBS@%$TLS_LIBS%g
23830 s%@MODULES_LIBS@%$MODULES_LIBS%g
23831 s%@SLAPI_LIBS@%$SLAPI_LIBS%g
23832 s%@LIBSLAPI@%$LIBSLAPI%g
23833 s%@LIBSLAPITOOLS@%$LIBSLAPITOOLS%g
23834 s%@AUTH_LIBS@%$AUTH_LIBS%g
23835 s%@SLAPD_SLP_LIBS@%$SLAPD_SLP_LIBS%g
23836 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
23837 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
23838 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
23839
23840 CEOF
23841 EOF
23842
23843 cat >> $CONFIG_STATUS <<\EOF
23844
23845 # Split the substitutions into bite-sized pieces for seds with
23846 # small command number limits, like on Digital OSF/1 and HP-UX.
23847 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
23848 ac_file=1 # Number of current file.
23849 ac_beg=1 # First line for current file.
23850 ac_end=$ac_max_sed_cmds # Line after last line for current file.
23851 ac_more_lines=:
23852 ac_sed_cmds=""
23853 while $ac_more_lines; do
23854   if test $ac_beg -gt 1; then
23855     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
23856   else
23857     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
23858   fi
23859   if test ! -s conftest.s$ac_file; then
23860     ac_more_lines=false
23861     rm -f conftest.s$ac_file
23862   else
23863     if test -z "$ac_sed_cmds"; then
23864       ac_sed_cmds="sed -f conftest.s$ac_file"
23865     else
23866       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
23867     fi
23868     ac_file=`expr $ac_file + 1`
23869     ac_beg=$ac_end
23870     ac_end=`expr $ac_end + $ac_max_sed_cmds`
23871   fi
23872 done
23873 if test -z "$ac_sed_cmds"; then
23874   ac_sed_cmds=cat
23875 fi
23876 EOF
23877
23878 cat >> $CONFIG_STATUS <<EOF
23879
23880 CONFIG_FILES=\${CONFIG_FILES-"\
23881 Makefile:build/top.mk:Makefile.in:build/dir.mk \
23882 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
23883 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
23884 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
23885 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
23886 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
23887 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
23888 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
23889 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
23890 include/Makefile:build/top.mk:include/Makefile.in \
23891 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
23892 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
23893 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23894 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23895 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
23896 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
23897 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
23898 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
23899 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
23900 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
23901 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
23902 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
23903 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
23904 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
23905 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
23906 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
23907 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
23908 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
23909 servers/slapd/back-null/Makefile:build/top.mk:servers/slapd/back-null/Makefile.in:build/mod.mk \
23910 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
23911 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
23912 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
23913 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
23914 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
23915 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
23916 servers/slapd/slapi/Makefile:build/top.mk:servers/slapd/slapi/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23917 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
23918 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
23919 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
23920 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
23921 "}
23922 EOF
23923 cat >> $CONFIG_STATUS <<\EOF
23924 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
23925   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23926   case "$ac_file" in
23927   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
23928        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
23929   *) ac_file_in="${ac_file}.in" ;;
23930   esac
23931
23932   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
23933
23934   # Remove last slash and all that follows it.  Not all systems have dirname.
23935   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
23936   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23937     # The file is in a subdirectory.
23938     test ! -d "$ac_dir" && mkdir "$ac_dir"
23939     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
23940     # A "../" for each directory in $ac_dir_suffix.
23941     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
23942   else
23943     ac_dir_suffix= ac_dots=
23944   fi
23945
23946   case "$ac_given_srcdir" in
23947   .)  srcdir=.
23948       if test -z "$ac_dots"; then top_srcdir=.
23949       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
23950   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
23951   *) # Relative path.
23952     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
23953     top_srcdir="$ac_dots$ac_given_srcdir" ;;
23954   esac
23955
23956   case "$ac_given_INSTALL" in
23957   [/$]*) INSTALL="$ac_given_INSTALL" ;;
23958   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
23959   esac
23960
23961   echo creating "$ac_file"
23962   rm -f "$ac_file"
23963   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
23964   case "$ac_file" in
23965   *[Mm]akefile*) ac_comsub="1i\\
23966 # $configure_input" ;;
23967   *) ac_comsub= ;;
23968   esac
23969
23970   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
23971   sed -e "$ac_comsub
23972 s%@configure_input@%$configure_input%g
23973 s%@srcdir@%$srcdir%g
23974 s%@top_srcdir@%$top_srcdir%g
23975 s%@INSTALL@%$INSTALL%g
23976 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
23977 fi; done
23978 rm -f conftest.s*
23979
23980 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
23981 # NAME is the cpp macro being defined and VALUE is the value it is being given.
23982 #
23983 # ac_d sets the value in "#define NAME VALUE" lines.
23984 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
23985 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
23986 ac_dC='\3'
23987 ac_dD='%g'
23988 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
23989 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23990 ac_uB='\([      ]\)%\1#\2define\3'
23991 ac_uC=' '
23992 ac_uD='\4%g'
23993 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
23994 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23995 ac_eB='$%\1#\2define\3'
23996 ac_eC=' '
23997 ac_eD='%g'
23998
23999 if test "${CONFIG_HEADERS+set}" != set; then
24000 EOF
24001 cat >> $CONFIG_STATUS <<EOF
24002   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
24003 EOF
24004 cat >> $CONFIG_STATUS <<\EOF
24005 fi
24006 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
24007   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
24008   case "$ac_file" in
24009   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
24010        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
24011   *) ac_file_in="${ac_file}.in" ;;
24012   esac
24013
24014   echo creating $ac_file
24015
24016   rm -f conftest.frag conftest.in conftest.out
24017   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
24018   cat $ac_file_inputs > conftest.in
24019
24020 EOF
24021
24022 # Transform confdefs.h into a sed script conftest.vals that substitutes
24023 # the proper values into config.h.in to produce config.h.  And first:
24024 # Protect against being on the right side of a sed subst in config.status.
24025 # Protect against being in an unquoted here document in config.status.
24026 rm -f conftest.vals
24027 cat > conftest.hdr <<\EOF
24028 s/[\\&%]/\\&/g
24029 s%[\\$`]%\\&%g
24030 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
24031 s%ac_d%ac_u%gp
24032 s%ac_u%ac_e%gp
24033 EOF
24034 sed -n -f conftest.hdr confdefs.h > conftest.vals
24035 rm -f conftest.hdr
24036
24037 # This sed command replaces #undef with comments.  This is necessary, for
24038 # example, in the case of _POSIX_SOURCE, which is predefined and required
24039 # on some systems where configure will not decide to define it.
24040 cat >> conftest.vals <<\EOF
24041 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
24042 EOF
24043
24044 # Break up conftest.vals because some shells have a limit on
24045 # the size of here documents, and old seds have small limits too.
24046
24047 rm -f conftest.tail
24048 while :
24049 do
24050   ac_lines=`grep -c . conftest.vals`
24051   # grep -c gives empty output for an empty file on some AIX systems.
24052   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
24053   # Write a limited-size here document to conftest.frag.
24054   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
24055   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
24056   echo 'CEOF
24057   sed -f conftest.frag conftest.in > conftest.out
24058   rm -f conftest.in
24059   mv conftest.out conftest.in
24060 ' >> $CONFIG_STATUS
24061   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
24062   rm -f conftest.vals
24063   mv conftest.tail conftest.vals
24064 done
24065 rm -f conftest.vals
24066
24067 cat >> $CONFIG_STATUS <<\EOF
24068   rm -f conftest.frag conftest.h
24069   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
24070   cat conftest.in >> conftest.h
24071   rm -f conftest.in
24072   if cmp -s $ac_file conftest.h 2>/dev/null; then
24073     echo "$ac_file is unchanged"
24074     rm -f conftest.h
24075   else
24076     # Remove last slash and all that follows it.  Not all systems have dirname.
24077       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
24078       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
24079       # The file is in a subdirectory.
24080       test ! -d "$ac_dir" && mkdir "$ac_dir"
24081     fi
24082     rm -f $ac_file
24083     mv conftest.h $ac_file
24084   fi
24085 fi; done
24086
24087 EOF
24088 cat >> $CONFIG_STATUS <<EOF
24089
24090 EOF
24091 cat >> $CONFIG_STATUS <<\EOF
24092
24093 date > stamp-h
24094 echo Please run \"make depend\" to build dependencies
24095
24096 exit 0
24097 EOF
24098 chmod +x $CONFIG_STATUS
24099 rm -fr confdefs* $ac_clean_files
24100 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
24101