]> git.sur5r.net Git - openldap/blob - configure
Sync with HEAD
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.478.2.21 2004/07/26 18:15:05 hyc Exp  
4
5 # This work is part of OpenLDAP Software <http://www.openldap.org/>.
6 #
7 # Copyright 1998-2004 The OpenLDAP Foundation.
8 # All rights reserved.
9 #
10 # Redistribution and use in source and binary forms, with or without
11 # modification, are permitted only as authorized by the OpenLDAP
12 # Public License.
13 #
14 # A copy of this license is available in the file LICENSE in the
15 # top-level directory of the distribution or, alternatively, at
16 # <http://www.OpenLDAP.org/license.html>.
17
18 echo "Copyright 1998-2004 The OpenLDAP Foundation. All rights reserved."
19 echo "  Restrictions apply, see COPYRIGHT and LICENSE files."
20
21 # Guess values for system-dependent variables and create Makefiles.
22 # Generated automatically using autoconf version 2.13.1 
23 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
24 #
25 # This configure script is free software; the Free Software Foundation
26 # gives unlimited permission to copy, distribute and modify it.
27
28 # Defaults:
29 ac_help=
30 ac_default_prefix=/usr/local
31 # Any additions from configure.in:
32 ac_default_prefix=/usr/local
33 ac_help="$ac_help
34   --with-subdir=DIR       change default subdirectory used for installs"
35 ac_help="$ac_help
36   --enable-debug          enable debugging [yes]"
37 ac_help="$ac_help
38   --enable-dynamic        enable linking built binaries with dynamic libs [no]"
39 ac_help="$ac_help
40   --enable-syslog         enable syslog support [auto]"
41 ac_help="$ac_help
42   --enable-proctitle      enable proctitle support [yes]"
43 ac_help="$ac_help
44   --enable-ipv6           enable IPv6 support [auto]"
45 ac_help="$ac_help
46   --enable-local          enable AF_LOCAL (AF_UNIX) socket support [auto]"
47 ac_help="$ac_help
48   --with-cyrus-sasl       with Cyrus SASL support [auto]"
49 ac_help="$ac_help
50   --with-fetch            with fetch(3) URL support [auto]"
51 ac_help="$ac_help
52   --with-threads          with threads [auto]"
53 ac_help="$ac_help
54   --with-tls              with TLS/SSL support [auto]"
55 ac_help="$ac_help
56   --with-yielding-select  with implicitly yielding select [auto]"
57 ac_help="$ac_help
58
59 SLAPD (Standalone LDAP Daemon) Options:"
60 ac_help="$ac_help
61   --enable-slapd          enable building slapd [yes]"
62 ac_help="$ac_help
63     --enable-aci          enable per-object ACIs (experimental) [no]"
64 ac_help="$ac_help
65     --enable-cleartext    enable cleartext passwords [yes]"
66 ac_help="$ac_help
67     --enable-crypt        enable crypt(3) passwords [no]"
68 ac_help="$ac_help
69     --enable-lmpasswd     enable LAN Manager passwords [no]"
70 ac_help="$ac_help
71     --enable-spasswd      enable (Cyrus) SASL password verification [no]"
72 ac_help="$ac_help
73     --enable-modules      enable dynamic module support [no]"
74 ac_help="$ac_help
75     --enable-rewrite      enable DN rewriting in back-ldap and the rwm overlay [auto]"
76 ac_help="$ac_help
77     --enable-rlookups     enable reverse lookups of client hostnames [no]"
78 ac_help="$ac_help
79     --enable-slapi        enable SLAPI support (experimental) [no]"
80 ac_help="$ac_help
81     --enable-slp          enable SLPv2 support [no]"
82 ac_help="$ac_help
83     --enable-wrappers     enable tcp wrapper support [no]"
84 ac_help="$ac_help
85
86 SLAPD Backend Options:"
87 ac_help="$ac_help
88     --enable-bdb          enable Berkeley DB backend no|yes|mod [yes]"
89 ac_help="$ac_help
90     --enable-dnssrv       enable dnssrv backend no|yes|mod [no]"
91 ac_help="$ac_help
92     --enable-hdb          enable Hierarchical DB backend no|yes|mod [no]"
93 ac_help="$ac_help
94     --enable-ldap         enable ldap backend no|yes|mod [no]"
95 ac_help="$ac_help
96     --enable-ldbm         enable ldbm backend no|yes|mod [no]"
97 ac_help="$ac_help
98       --with-ldbm-api     with LDBM API auto|berkeley|bcompat|mdbm|gdbm [auto]"
99 ac_help="$ac_help
100       --with-ldbm-type    use LDBM type auto|btree|hash [auto]"
101 ac_help="$ac_help
102     --enable-meta         enable metadirectory backend no|yes|mod [no]"
103 ac_help="$ac_help
104     --enable-monitor      enable monitor backend no|yes|mod [yes]"
105 ac_help="$ac_help
106     --enable-null         enable null backend no|yes|mod [no]"
107 ac_help="$ac_help
108     --enable-passwd       enable passwd backend no|yes|mod [no]"
109 ac_help="$ac_help
110     --enable-perl         enable perl backend no|yes|mod [no]"
111 ac_help="$ac_help
112     --enable-shell        enable shell backend no|yes|mod [no]"
113 ac_help="$ac_help
114     --enable-sql          enable sql backend no|yes|mod [no]"
115 ac_help="$ac_help
116
117 SLAPD Overlay Options:"
118 ac_help="$ac_help
119     --enable-dyngroup     Dynamic Group overlay no|yes|mod [no]"
120 ac_help="$ac_help
121     --enable-proxycache   Proxy Cache overlay no|yes|mod [no]"
122 ac_help="$ac_help
123
124 SLURPD (Replication Daemon) Options:"
125 ac_help="$ac_help
126   --enable-slurpd         enable building slurpd [auto]"
127 ac_help="$ac_help
128
129 Library Generation & Linking Options"
130 ac_help="$ac_help
131   --enable-static[=PKGS]  build static libraries [default=yes]"
132 ac_help="$ac_help
133   --enable-shared[=PKGS]  build shared libraries [default=yes]"
134 ac_help="$ac_help
135   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
136 ac_help="$ac_help
137   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
138
139 # Find the correct PATH separator.  Usually this is `:', but
140 # DJGPP uses `;' like DOS.
141 if test "X${PATH_SEPARATOR+set}" != Xset; then
142   UNAME=${UNAME-`uname 2>/dev/null`}
143   case X$UNAME in
144     *-DOS) lt_cv_sys_path_separator=';' ;;
145     *)     lt_cv_sys_path_separator=':' ;;
146   esac
147   PATH_SEPARATOR=$lt_cv_sys_path_separator
148 fi
149
150
151 # Check that we are running under the correct shell.
152 SHELL=${CONFIG_SHELL-/bin/sh}
153
154 case X$ECHO in
155 X*--fallback-echo)
156   # Remove one level of quotation (which was required for Make).
157   ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
158   ;;
159 esac
160
161 echo=${ECHO-echo}
162 if test "X$1" = X--no-reexec; then
163   # Discard the --no-reexec flag, and continue.
164   shift
165 elif test "X$1" = X--fallback-echo; then
166   # Avoid inline document here, it may be left over
167   :
168 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
169   # Yippee, $echo works!
170   :
171 else
172   # Restart under the correct shell.
173   exec $SHELL "$0" --no-reexec ${1+"$@"}
174 fi
175
176 if test "X$1" = X--fallback-echo; then
177   # used as fallback echo
178   shift
179   cat <<EOF
180
181 EOF
182   exit 0
183 fi
184
185 # The HP-UX ksh and POSIX shell print the target directory to stdout
186 # if CDPATH is set.
187 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
188
189 if test -z "$ECHO"; then
190 if test "X${echo_test_string+set}" != Xset; then
191 # find a string as large as possible, as long as the shell can cope with it
192   for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
193     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
194     if (echo_test_string="`eval $cmd`") 2>/dev/null &&
195        echo_test_string="`eval $cmd`" &&
196        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
197     then
198       break
199     fi
200   done
201 fi
202
203 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
204    echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
205    test "X$echo_testing_string" = "X$echo_test_string"; then
206   :
207 else
208   # The Solaris, AIX, and Digital Unix default echo programs unquote
209   # backslashes.  This makes it impossible to quote backslashes using
210   #   echo "$something" | sed 's/\\/\\\\/g'
211   #
212   # So, first we look for a working echo in the user's PATH.
213
214   IFS="${IFS=   }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
215   for dir in $PATH /usr/ucb; do
216     if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
217        test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
218        echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
219        test "X$echo_testing_string" = "X$echo_test_string"; then
220       echo="$dir/echo"
221       break
222     fi
223   done
224   IFS="$save_ifs"
225
226   if test "X$echo" = Xecho; then
227     # We didn't find a better echo, so look for alternatives.
228     if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
229        echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
230        test "X$echo_testing_string" = "X$echo_test_string"; then
231       # This shell has a builtin print -r that does the trick.
232       echo='print -r'
233     elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
234          test "X$CONFIG_SHELL" != X/bin/ksh; then
235       # If we have ksh, try running configure again with it.
236       ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
237       export ORIGINAL_CONFIG_SHELL
238       CONFIG_SHELL=/bin/ksh
239       export CONFIG_SHELL
240       exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
241     else
242       # Try using printf.
243       echo='printf %s\n'
244       if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
245          echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
246          test "X$echo_testing_string" = "X$echo_test_string"; then
247         # Cool, printf works
248         :
249       elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
250            test "X$echo_testing_string" = 'X\t' &&
251            echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
252            test "X$echo_testing_string" = "X$echo_test_string"; then
253         CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
254         export CONFIG_SHELL
255         SHELL="$CONFIG_SHELL"
256         export SHELL
257         echo="$CONFIG_SHELL $0 --fallback-echo"
258       elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
259            test "X$echo_testing_string" = 'X\t' &&
260            echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
261            test "X$echo_testing_string" = "X$echo_test_string"; then
262         echo="$CONFIG_SHELL $0 --fallback-echo"
263       else
264         # maybe with a smaller string...
265         prev=:
266
267         for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
268           if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
269           then
270             break
271           fi
272           prev="$cmd"
273         done
274
275         if test "$prev" != 'sed 50q "$0"'; then
276           echo_test_string=`eval $prev`
277           export echo_test_string
278           exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
279         else
280           # Oops.  We lost completely, so just stick with echo.
281           echo=echo
282         fi
283       fi
284     fi
285   fi
286 fi
287 fi
288
289 # Copy echo and quote the copy suitably for passing to libtool from
290 # the Makefile, instead of quoting the original, which is used later.
291 ECHO=$echo
292 if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
293    ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
294 fi
295
296
297 ac_help="$ac_help
298   --disable-libtool-lock  avoid locking (might break parallel builds)"
299 ac_help="$ac_help
300   --with-pic              try to use only PIC/non-PIC objects [default=use both]"
301 ac_help="$ac_help
302
303 See INSTALL file for further details."
304
305 # Initialize some variables set by options.
306 # The variables have the same names as the options, with
307 # dashes changed to underlines.
308 build=NONE
309 cache_file=./config.cache
310 exec_prefix=NONE
311 host=NONE
312 no_create=
313 nonopt=NONE
314 no_recursion=
315 prefix=NONE
316 program_prefix=NONE
317 program_suffix=NONE
318 program_transform_name=s,x,x,
319 silent=
320 site=
321 srcdir=
322 target=NONE
323 verbose=
324 x_includes=NONE
325 x_libraries=NONE
326 bindir='${exec_prefix}/bin'
327 sbindir='${exec_prefix}/sbin'
328 libexecdir='${exec_prefix}/libexec'
329 datadir='${prefix}/share'
330 sysconfdir='${prefix}/etc'
331 sharedstatedir='${prefix}/com'
332 localstatedir='${prefix}/var'
333 libdir='${exec_prefix}/lib'
334 includedir='${prefix}/include'
335 oldincludedir='/usr/include'
336 infodir='${prefix}/info'
337 mandir='${prefix}/man'
338
339 # Initialize some other variables.
340 subdirs=
341 MFLAGS= MAKEFLAGS=
342 SHELL=${CONFIG_SHELL-/bin/sh}
343 # Maximum number of lines to put in a shell here document.
344 ac_max_here_lines=12
345
346 ac_prev=
347 for ac_option
348 do
349
350   # If the previous option needs an argument, assign it.
351   if test -n "$ac_prev"; then
352     eval "$ac_prev=\$ac_option"
353     ac_prev=
354     continue
355   fi
356
357   case "$ac_option" in
358   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
359   *) ac_optarg= ;;
360   esac
361
362   # Accept the important Cygnus configure options, so we can diagnose typos.
363
364   case "$ac_option" in
365
366   -bindir | --bindir | --bindi | --bind | --bin | --bi)
367     ac_prev=bindir ;;
368   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
369     bindir="$ac_optarg" ;;
370
371   -build | --build | --buil | --bui | --bu)
372     ac_prev=build ;;
373   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
374     build="$ac_optarg" ;;
375
376   -cache-file | --cache-file | --cache-fil | --cache-fi \
377   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
378     ac_prev=cache_file ;;
379   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
380   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
381     cache_file="$ac_optarg" ;;
382
383   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
384     ac_prev=datadir ;;
385   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
386   | --da=*)
387     datadir="$ac_optarg" ;;
388
389   -disable-* | --disable-*)
390     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
391     # Reject names that are not valid shell variable names.
392     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
393       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
394     fi
395     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
396     eval "enable_${ac_feature}=no" ;;
397
398   -enable-* | --enable-*)
399     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
400     # Reject names that are not valid shell variable names.
401     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
402       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
403     fi
404     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
405     case "$ac_option" in
406       *=*) ;;
407       *) ac_optarg=yes ;;
408     esac
409     eval "enable_${ac_feature}='$ac_optarg'" ;;
410
411   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
412   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
413   | --exec | --exe | --ex)
414     ac_prev=exec_prefix ;;
415   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
416   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
417   | --exec=* | --exe=* | --ex=*)
418     exec_prefix="$ac_optarg" ;;
419
420   -gas | --gas | --ga | --g)
421     # Obsolete; use --with-gas.
422     with_gas=yes ;;
423
424   -help | --help | --hel | --he)
425     # Omit some internal or obsolete options to make the list less imposing.
426     # This message is too long to be a string in the A/UX 3.1 sh.
427     cat << EOF
428 Usage: configure [options] [host]
429 Options: [defaults in brackets after descriptions]
430 Configuration:
431   --cache-file=FILE       cache test results in FILE
432   --help                  print this message
433   --no-create             do not create output files
434   --quiet, --silent       do not print \`checking...' messages
435   --version               print the version of autoconf that created configure
436 Directory and file names:
437   --prefix=PREFIX         install architecture-independent files in PREFIX
438                           [$ac_default_prefix]
439   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
440                           [same as prefix]
441   --bindir=DIR            user executables in DIR [EPREFIX/bin]
442   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
443   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
444   --datadir=DIR           read-only architecture-independent data in DIR
445                           [PREFIX/share]
446   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
447   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
448                           [PREFIX/com]
449   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
450   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
451   --includedir=DIR        C header files in DIR [PREFIX/include]
452   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
453   --infodir=DIR           info documentation in DIR [PREFIX/info]
454   --mandir=DIR            man documentation in DIR [PREFIX/man]
455   --srcdir=DIR            find the sources in DIR [configure dir or ..]
456   --program-prefix=PREFIX prepend PREFIX to installed program names
457   --program-suffix=SUFFIX append SUFFIX to installed program names
458   --program-transform-name=PROGRAM
459                           run sed PROGRAM on installed program names
460 EOF
461     cat << EOF
462 Host type:
463   --build=BUILD           configure for building on BUILD [BUILD=HOST]
464   --host=HOST             configure for HOST [guessed]
465   --target=TARGET         configure for TARGET [TARGET=HOST]
466 Features and packages:
467   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
468   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
469   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
470   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
471   --x-includes=DIR        X include files are in DIR
472   --x-libraries=DIR       X library files are in DIR
473 EOF
474     if test -n "$ac_help"; then
475       echo "--enable and --with options recognized:$ac_help"
476     fi
477     exit 0 ;;
478
479   -host | --host | --hos | --ho)
480     ac_prev=host ;;
481   -host=* | --host=* | --hos=* | --ho=*)
482     host="$ac_optarg" ;;
483
484   -includedir | --includedir | --includedi | --included | --include \
485   | --includ | --inclu | --incl | --inc)
486     ac_prev=includedir ;;
487   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
488   | --includ=* | --inclu=* | --incl=* | --inc=*)
489     includedir="$ac_optarg" ;;
490
491   -infodir | --infodir | --infodi | --infod | --info | --inf)
492     ac_prev=infodir ;;
493   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
494     infodir="$ac_optarg" ;;
495
496   -libdir | --libdir | --libdi | --libd)
497     ac_prev=libdir ;;
498   -libdir=* | --libdir=* | --libdi=* | --libd=*)
499     libdir="$ac_optarg" ;;
500
501   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
502   | --libexe | --libex | --libe)
503     ac_prev=libexecdir ;;
504   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
505   | --libexe=* | --libex=* | --libe=*)
506     libexecdir="$ac_optarg" ;;
507
508   -localstatedir | --localstatedir | --localstatedi | --localstated \
509   | --localstate | --localstat | --localsta | --localst \
510   | --locals | --local | --loca | --loc | --lo)
511     ac_prev=localstatedir ;;
512   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
513   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
514   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
515     localstatedir="$ac_optarg" ;;
516
517   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
518     ac_prev=mandir ;;
519   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
520     mandir="$ac_optarg" ;;
521
522   -nfp | --nfp | --nf)
523     # Obsolete; use --without-fp.
524     with_fp=no ;;
525
526   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
527   | --no-cr | --no-c)
528     no_create=yes ;;
529
530   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
531   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
532     no_recursion=yes ;;
533
534   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
535   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
536   | --oldin | --oldi | --old | --ol | --o)
537     ac_prev=oldincludedir ;;
538   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
539   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
540   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
541     oldincludedir="$ac_optarg" ;;
542
543   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
544     ac_prev=prefix ;;
545   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
546     prefix="$ac_optarg" ;;
547
548   -program-prefix | --program-prefix | --program-prefi | --program-pref \
549   | --program-pre | --program-pr | --program-p)
550     ac_prev=program_prefix ;;
551   -program-prefix=* | --program-prefix=* | --program-prefi=* \
552   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
553     program_prefix="$ac_optarg" ;;
554
555   -program-suffix | --program-suffix | --program-suffi | --program-suff \
556   | --program-suf | --program-su | --program-s)
557     ac_prev=program_suffix ;;
558   -program-suffix=* | --program-suffix=* | --program-suffi=* \
559   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
560     program_suffix="$ac_optarg" ;;
561
562   -program-transform-name | --program-transform-name \
563   | --program-transform-nam | --program-transform-na \
564   | --program-transform-n | --program-transform- \
565   | --program-transform | --program-transfor \
566   | --program-transfo | --program-transf \
567   | --program-trans | --program-tran \
568   | --progr-tra | --program-tr | --program-t)
569     ac_prev=program_transform_name ;;
570   -program-transform-name=* | --program-transform-name=* \
571   | --program-transform-nam=* | --program-transform-na=* \
572   | --program-transform-n=* | --program-transform-=* \
573   | --program-transform=* | --program-transfor=* \
574   | --program-transfo=* | --program-transf=* \
575   | --program-trans=* | --program-tran=* \
576   | --progr-tra=* | --program-tr=* | --program-t=*)
577     program_transform_name="$ac_optarg" ;;
578
579   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
580   | -silent | --silent | --silen | --sile | --sil)
581     silent=yes ;;
582
583   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
584     ac_prev=sbindir ;;
585   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
586   | --sbi=* | --sb=*)
587     sbindir="$ac_optarg" ;;
588
589   -sharedstatedir | --sharedstatedir | --sharedstatedi \
590   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
591   | --sharedst | --shareds | --shared | --share | --shar \
592   | --sha | --sh)
593     ac_prev=sharedstatedir ;;
594   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
595   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
596   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
597   | --sha=* | --sh=*)
598     sharedstatedir="$ac_optarg" ;;
599
600   -site | --site | --sit)
601     ac_prev=site ;;
602   -site=* | --site=* | --sit=*)
603     site="$ac_optarg" ;;
604
605   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
606     ac_prev=srcdir ;;
607   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
608     srcdir="$ac_optarg" ;;
609
610   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
611   | --syscon | --sysco | --sysc | --sys | --sy)
612     ac_prev=sysconfdir ;;
613   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
614   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
615     sysconfdir="$ac_optarg" ;;
616
617   -target | --target | --targe | --targ | --tar | --ta | --t)
618     ac_prev=target ;;
619   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
620     target="$ac_optarg" ;;
621
622   -v | -verbose | --verbose | --verbos | --verbo | --verb)
623     verbose=yes ;;
624
625   -version | --version | --versio | --versi | --vers)
626     echo "configure generated by autoconf version 2.13.1"
627     exit 0 ;;
628
629   -with-* | --with-*)
630     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
631     # Reject names that are not valid shell variable names.
632     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
633       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
634     fi
635     ac_package=`echo $ac_package| sed 's/-/_/g'`
636     case "$ac_option" in
637       *=*) ;;
638       *) ac_optarg=yes ;;
639     esac
640     eval "with_${ac_package}='$ac_optarg'" ;;
641
642   -without-* | --without-*)
643     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
644     # Reject names that are not valid shell variable names.
645     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
646       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
647     fi
648     ac_package=`echo $ac_package| sed 's/-/_/g'`
649     eval "with_${ac_package}=no" ;;
650
651   --x)
652     # Obsolete; use --with-x.
653     with_x=yes ;;
654
655   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
656   | --x-incl | --x-inc | --x-in | --x-i)
657     ac_prev=x_includes ;;
658   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
659   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
660     x_includes="$ac_optarg" ;;
661
662   -x-libraries | --x-libraries | --x-librarie | --x-librari \
663   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
664     ac_prev=x_libraries ;;
665   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
666   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
667     x_libraries="$ac_optarg" ;;
668
669   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
670     ;;
671
672   *)
673     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
674       echo "configure: warning: $ac_option: invalid host type" 1>&2
675     fi
676     if test "x$nonopt" != xNONE; then
677       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
678     fi
679     nonopt="$ac_option"
680     ;;
681
682   esac
683 done
684
685 if test -n "$ac_prev"; then
686   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
687 fi
688
689 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
690
691 # File descriptor usage:
692 # 0 standard input
693 # 1 file creation
694 # 2 errors and warnings
695 # 3 some systems may open it to /dev/tty
696 # 4 used on the Kubota Titan
697 # 6 checking for... messages and results
698 # 5 compiler messages saved in config.log
699 if test "$silent" = yes; then
700   exec 6>/dev/null
701 else
702   exec 6>&1
703 fi
704 exec 5>./config.log
705
706 echo "\
707 This file contains any messages produced by compilers while
708 running configure, to aid debugging if configure makes a mistake.
709 " 1>&5
710
711 # Strip out --no-create and --no-recursion so they do not pile up.
712 # Also quote any args containing shell metacharacters.
713 ac_configure_args=
714 for ac_arg
715 do
716   case "$ac_arg" in
717   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
718   | --no-cr | --no-c) ;;
719   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
720   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
721   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
722   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
723   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
724   esac
725 done
726
727 # NLS nuisances.
728 # Only set these to C if already set.  These must not be set unconditionally
729 # because not all systems understand e.g. LANG=C (notably SCO).
730 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
731 # Non-C LC_CTYPE values break the ctype check.
732 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
733 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
734 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
735 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
736
737 # confdefs.h avoids OS command line length limits that DEFS can exceed.
738 rm -rf conftest* confdefs.h
739 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
740 echo > confdefs.h
741
742 # A filename unique to this package, relative to the directory that
743 # configure is in, which we can look for to find out if srcdir is correct.
744 ac_unique_file=build/version.sh
745
746 # Find the source files, if location was not specified.
747 if test -z "$srcdir"; then
748   ac_srcdir_defaulted=yes
749   # Try the directory containing this script, then its parent.
750   ac_prog=$0
751   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
752   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
753   srcdir=$ac_confdir
754   if test ! -r $srcdir/$ac_unique_file; then
755     srcdir=..
756   fi
757 else
758   ac_srcdir_defaulted=no
759 fi
760 if test ! -r $srcdir/$ac_unique_file; then
761   if test "$ac_srcdir_defaulted" = yes; then
762     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
763   else
764     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
765   fi
766 fi
767 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
768
769 # Prefer explicitly selected file to automatically selected ones.
770 if test -z "$CONFIG_SITE"; then
771   if test "x$prefix" != xNONE; then
772     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
773   else
774     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
775   fi
776 fi
777 for ac_site_file in $CONFIG_SITE; do
778   if test -r "$ac_site_file"; then
779     echo "loading site script $ac_site_file"
780     . "$ac_site_file"
781   fi
782 done
783
784
785 ac_ext=c
786 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
787 ac_cpp='$CPP $CPPFLAGS'
788 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
789 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
790 cross_compiling=$ac_cv_prog_cc_cross
791
792 ac_exeext=
793 ac_objext=o
794 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
795   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
796   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
797     ac_n= ac_c='
798 ' ac_t='        '
799   else
800     ac_n=-n ac_c= ac_t=
801   fi
802 else
803   ac_n= ac_c='\c' ac_t=
804 fi
805
806
807 # set unset (borrowed from autoconf 2.49c)
808 if (OL_FOO=OL_FOO; unset OL_FOO) >/dev/null 2>&1; then
809   ol_unset=unset
810 else
811   ol_unset=false
812 fi
813 # unset CDPATH
814 $ol_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
815
816 ac_aux_dir=
817 for ac_dir in build $srcdir/build; do
818   if test -f $ac_dir/install-sh; then
819     ac_aux_dir=$ac_dir
820     ac_install_sh="$ac_aux_dir/install-sh -c"
821     break
822   elif test -f $ac_dir/install.sh; then
823     ac_aux_dir=$ac_dir
824     ac_install_sh="$ac_aux_dir/install.sh -c"
825     break
826   elif test -f $ac_dir/shtool; then
827     ac_aux_dir=$ac_dir
828     ac_install_sh="$ac_aux_dir/shtool install -c"
829     break
830   fi
831 done
832 if test -z "$ac_aux_dir"; then
833   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
834 fi
835 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
836 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
837 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
838
839 eval `$ac_aux_dir/version.sh`
840 if test -z "$OL_STRING"; then
841         { echo "configure: error: could not determine version" 1>&2; exit 1; }
842 fi
843
844 if test -f "$ac_aux_dir/shtool" -a ! -d $ac_aux_dir/shtool; then
845         ac_cv_shtool="$ac_aux_dir/shtool"
846 else
847         { echo "configure: error: no shtool found in $ac_aux_dir" 1>&2; exit 1; }
848 fi
849
850 SHTOOL="$ac_cv_shtool"
851
852 TB="`$SHTOOL echo -e '%B' 2>/dev/null`"
853 TN="`$SHTOOL echo -e '%b' 2>/dev/null`"
854
855 OPENLDAP_CVS=""
856 if test -d $ac_aux_dir/CVS; then
857         OPENLDAP_CVS="(from CVS sources) "
858 fi
859
860 echo "Configuring ${TB}${OL_STRING}${TN} ${OPENLDAP_CVS}..."
861
862
863 echo $ac_n "checking host system type""... $ac_c" 1>&6
864 echo "configure:865: checking host system type" >&5
865 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
866
867 # Make sure we can run config.sub.
868   if $ac_config_sub sun4 >/dev/null 2>&1; then :
869     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
870   fi
871
872   ac_cv_host_alias=$host
873   case "$ac_cv_host_alias" in
874   NONE)
875     case $nonopt in
876     NONE)
877       if ac_cv_host_alias=`$ac_config_guess`; then :
878       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
879       fi ;;
880     *) ac_cv_host_alias=$nonopt ;;
881     esac ;;
882   esac
883
884   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
885   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
886   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
887   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
888 else
889   echo $ac_n "(cached) $ac_c" 1>&6
890 fi
891
892 echo "$ac_t""$ac_cv_host" 1>&6
893
894 host=$ac_cv_host
895 host_alias=$ac_cv_host_alias
896 host_cpu=$ac_cv_host_cpu
897 host_vendor=$ac_cv_host_vendor
898 host_os=$ac_cv_host_os
899
900
901
902
903
904 echo $ac_n "checking target system type""... $ac_c" 1>&6
905 echo "configure:906: checking target system type" >&5
906 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
907
908 # Make sure we can run config.sub.
909   if $ac_config_sub sun4 >/dev/null 2>&1; then :
910     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
911   fi
912
913   ac_cv_target_alias=$target
914   case "$ac_cv_target_alias" in
915   NONE)
916     case $nonopt in
917     NONE)
918       ac_cv_target_alias=$host_alias ;;
919
920     *) ac_cv_target_alias=$nonopt ;;
921     esac ;;
922   esac
923
924   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
925   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
926   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
927   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
928 else
929   echo $ac_n "(cached) $ac_c" 1>&6
930 fi
931
932 echo "$ac_t""$ac_cv_target" 1>&6
933
934 target=$ac_cv_target
935 target_alias=$ac_cv_target_alias
936 target_cpu=$ac_cv_target_cpu
937 target_vendor=$ac_cv_target_vendor
938 target_os=$ac_cv_target_os
939
940
941
942
943
944 echo $ac_n "checking build system type""... $ac_c" 1>&6
945 echo "configure:946: checking build system type" >&5
946 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
947
948 # Make sure we can run config.sub.
949   if $ac_config_sub sun4 >/dev/null 2>&1; then :
950     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
951   fi
952
953   ac_cv_build_alias=$build
954   case "$ac_cv_build_alias" in
955   NONE)
956     case $nonopt in
957     NONE)
958       ac_cv_build_alias=$host_alias ;;
959
960     *) ac_cv_build_alias=$nonopt ;;
961     esac ;;
962   esac
963
964   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
965   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
966   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
967   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
968 else
969   echo $ac_n "(cached) $ac_c" 1>&6
970 fi
971
972 echo "$ac_t""$ac_cv_build" 1>&6
973
974 build=$ac_cv_build
975 build_alias=$ac_cv_build_alias
976 build_cpu=$ac_cv_build_cpu
977 build_vendor=$ac_cv_build_vendor
978 build_os=$ac_cv_build_os
979
980
981
982
983
984 # Do some error checking and defaulting for the host and target type.
985 # The inputs are:
986 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
987 #
988 # The rules are:
989 # 1. You are not allowed to specify --host, --target, and nonopt at the
990 #    same time.
991 # 2. Host defaults to nonopt.
992 # 3. If nonopt is not specified, then host defaults to the current host,
993 #    as determined by config.guess.
994 # 4. Target and build default to nonopt.
995 # 5. If nonopt is not specified, then target and build default to host.
996
997 # The aliases save the names the user supplied, while $host etc.
998 # will get canonicalized.
999 case $host---$target---$nonopt in
1000 NONE---*---* | *---NONE---* | *---*---NONE) ;;
1001 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
1002 esac
1003
1004 test "$host_alias" != "$target_alias" &&
1005   test "$program_prefix$program_suffix$program_transform_name" = \
1006     NONENONEs,x,x, &&
1007   program_prefix=${target_alias}-
1008
1009
1010 # Find a good install program.  We prefer a C program (faster),
1011 # so one script is as good as another.  But avoid the broken or
1012 # incompatible versions:
1013 # SysV /etc/install, /usr/sbin/install
1014 # SunOS /usr/etc/install
1015 # IRIX /sbin/install
1016 # AIX /bin/install
1017 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1018 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1019 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1020 # ./install, which can be erroneously created by make from ./install.sh.
1021 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1022 echo "configure:1023: checking for a BSD compatible install" >&5
1023 if test -z "$INSTALL"; then
1024 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
1025   echo $ac_n "(cached) $ac_c" 1>&6
1026 else
1027     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1028   for ac_dir in $PATH; do
1029     # Account for people who put trailing slashes in PATH elements.
1030     case "$ac_dir/" in
1031     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1032     *)
1033       # OSF1 and SCO ODT 3.0 have their own names for install.
1034       # Don't use installbsd from OSF since it installs stuff as root
1035       # by default.
1036       for ac_prog in ginstall scoinst install; do
1037         if test -f $ac_dir/$ac_prog; then
1038           if test $ac_prog = install &&
1039             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1040             # AIX install.  It has an incompatible calling convention.
1041             :
1042           elif test $ac_prog = install &&
1043             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
1044             # program-specific install script used by HP pwplus--don't use.
1045             :
1046           else
1047             ac_cv_path_install="$ac_dir/$ac_prog -c"
1048             break 2
1049           fi
1050         fi
1051       done
1052       ;;
1053     esac
1054   done
1055   IFS="$ac_save_IFS"
1056
1057 fi
1058   if test "${ac_cv_path_install+set}" = set; then
1059     INSTALL="$ac_cv_path_install"
1060   else
1061     # As a last resort, use the slow shell script.  We don't cache a
1062     # path for INSTALL within a source directory, because that will
1063     # break other packages using the cache if that directory is
1064     # removed, or if the path is relative.
1065     INSTALL="$ac_install_sh"
1066   fi
1067 fi
1068 echo "$ac_t""$INSTALL" 1>&6
1069
1070 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1071 # It thinks the first close brace ends the variable substitution.
1072 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1073
1074 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
1075
1076 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1077
1078 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
1079 echo "configure:1080: checking whether build environment is sane" >&5
1080 # Just in case
1081 sleep 1
1082 echo timestamp > conftestfile
1083 # Do `set' in a subshell so we don't clobber the current shell's
1084 # arguments.  Must try -L first in case configure is actually a
1085 # symlink; some systems play weird games with the mod time of symlinks
1086 # (eg FreeBSD returns the mod time of the symlink's containing
1087 # directory).
1088 if (
1089    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1090    if test "$*" = "X"; then
1091       # -L didn't work.
1092       set X `ls -t $srcdir/configure conftestfile`
1093    fi
1094    if test "$*" != "X $srcdir/configure conftestfile" \
1095       && test "$*" != "X conftestfile $srcdir/configure"; then
1096
1097       # If neither matched, then we have a broken ls.  This can happen
1098       # if, for instance, CONFIG_SHELL is bash and it inherits a
1099       # broken ls alias from the environment.  This has actually
1100       # happened.  Such a system could not be considered "sane".
1101       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
1102 alias in your environment" 1>&2; exit 1; }
1103    fi
1104
1105    test "$2" = conftestfile
1106    )
1107 then
1108    # Ok.
1109    :
1110 else
1111    { echo "configure: error: newly created file is older than distributed files!
1112 Check your system clock" 1>&2; exit 1; }
1113 fi
1114 rm -f conftest*
1115 echo "$ac_t""yes" 1>&6
1116 if test "$program_transform_name" = s,x,x,; then
1117   program_transform_name=
1118 else
1119   # Double any \ or $.  echo might interpret backslashes.
1120   cat <<\EOF_SED > conftestsed
1121 s,\\,\\\\,g; s,\$,$$,g
1122 EOF_SED
1123   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
1124   rm -f conftestsed
1125 fi
1126 test "$program_prefix" != NONE &&
1127   program_transform_name="s,^,${program_prefix},;$program_transform_name"
1128 # Use a double $ so make ignores it.
1129 test "$program_suffix" != NONE &&
1130   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
1131
1132 # sed with no file args requires a program.
1133 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
1134
1135 for ac_prog in mawk gawk nawk awk
1136 do
1137 # Extract the first word of "$ac_prog", so it can be a program name with args.
1138 set dummy $ac_prog; ac_word=$2
1139 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1140 echo "configure:1141: checking for $ac_word" >&5
1141 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
1142   echo $ac_n "(cached) $ac_c" 1>&6
1143 else
1144   if test -n "$AWK"; then
1145   ac_cv_prog_AWK="$AWK" # Let the user override the test.
1146 else
1147   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1148   ac_dummy="$PATH"
1149   for ac_dir in $ac_dummy; do
1150     test -z "$ac_dir" && ac_dir=.
1151     if test -f $ac_dir/$ac_word; then
1152       ac_cv_prog_AWK="$ac_prog"
1153       break
1154     fi
1155   done
1156   IFS="$ac_save_ifs"
1157 fi
1158 fi
1159 AWK="$ac_cv_prog_AWK"
1160 if test -n "$AWK"; then
1161   echo "$ac_t""$AWK" 1>&6
1162 else
1163   echo "$ac_t""no" 1>&6
1164 fi
1165
1166 test -n "$AWK" && break
1167 done
1168
1169 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1170 echo "configure:1171: checking whether ${MAKE-make} sets \${MAKE}" >&5
1171 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1172 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1173   echo $ac_n "(cached) $ac_c" 1>&6
1174 else
1175   cat > conftestmake <<\EOF
1176 all:
1177         @echo 'ac_maketemp="${MAKE}"'
1178 EOF
1179 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1180 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1181 if test -n "$ac_maketemp"; then
1182   eval ac_cv_prog_make_${ac_make}_set=yes
1183 else
1184   eval ac_cv_prog_make_${ac_make}_set=no
1185 fi
1186 rm -f conftestmake
1187 fi
1188 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1189   echo "$ac_t""yes" 1>&6
1190   SET_MAKE=
1191 else
1192   echo "$ac_t""no" 1>&6
1193   SET_MAKE="MAKE=${MAKE-make}"
1194 fi
1195
1196
1197
1198 PACKAGE=$OL_PACKAGE
1199
1200 VERSION=$OL_VERSION
1201
1202 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1203   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
1204 fi
1205
1206
1207
1208 missing_dir=`cd $ac_aux_dir && pwd`
1209 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1210 echo "configure:1211: checking for working aclocal" >&5
1211 # Run test in a subshell; some versions of sh will print an error if
1212 # an executable is not found, even if stderr is redirected.
1213 # Redirect stdin to placate older versions of autoconf.  Sigh.
1214 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1215    ACLOCAL=aclocal
1216    echo "$ac_t""found" 1>&6
1217 else
1218    ACLOCAL="$missing_dir/missing aclocal"
1219    echo "$ac_t""missing" 1>&6
1220 fi
1221
1222 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1223 echo "configure:1224: checking for working autoconf" >&5
1224 # Run test in a subshell; some versions of sh will print an error if
1225 # an executable is not found, even if stderr is redirected.
1226 # Redirect stdin to placate older versions of autoconf.  Sigh.
1227 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1228    AUTOCONF=autoconf
1229    echo "$ac_t""found" 1>&6
1230 else
1231    AUTOCONF="$missing_dir/missing autoconf"
1232    echo "$ac_t""missing" 1>&6
1233 fi
1234
1235 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1236 echo "configure:1237: checking for working automake" >&5
1237 # Run test in a subshell; some versions of sh will print an error if
1238 # an executable is not found, even if stderr is redirected.
1239 # Redirect stdin to placate older versions of autoconf.  Sigh.
1240 if (automake --version) < /dev/null > /dev/null 2>&1; then
1241    AUTOMAKE=automake
1242    echo "$ac_t""found" 1>&6
1243 else
1244    AUTOMAKE="$missing_dir/missing automake"
1245    echo "$ac_t""missing" 1>&6
1246 fi
1247
1248 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1249 echo "configure:1250: checking for working autoheader" >&5
1250 # Run test in a subshell; some versions of sh will print an error if
1251 # an executable is not found, even if stderr is redirected.
1252 # Redirect stdin to placate older versions of autoconf.  Sigh.
1253 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1254    AUTOHEADER=autoheader
1255    echo "$ac_t""found" 1>&6
1256 else
1257    AUTOHEADER="$missing_dir/missing autoheader"
1258    echo "$ac_t""missing" 1>&6
1259 fi
1260
1261 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1262 echo "configure:1263: checking for working makeinfo" >&5
1263 # Run test in a subshell; some versions of sh will print an error if
1264 # an executable is not found, even if stderr is redirected.
1265 # Redirect stdin to placate older versions of autoconf.  Sigh.
1266 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1267    MAKEINFO=makeinfo
1268    echo "$ac_t""found" 1>&6
1269 else
1270    MAKEINFO="$missing_dir/missing makeinfo"
1271    echo "$ac_t""missing" 1>&6
1272 fi
1273
1274 install_sh="$missing_dir/install-sh"
1275 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1276
1277 for ac_prog in gnutar gtar tar
1278 do
1279 # Extract the first word of "$ac_prog", so it can be a program name with args.
1280 set dummy $ac_prog; ac_word=$2
1281 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1282 echo "configure:1283: checking for $ac_word" >&5
1283 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1284   echo $ac_n "(cached) $ac_c" 1>&6
1285 else
1286   if test -n "$AMTAR"; then
1287   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1288 else
1289   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1290   ac_dummy="$PATH"
1291   for ac_dir in $ac_dummy; do
1292     test -z "$ac_dir" && ac_dir=.
1293     if test -f $ac_dir/$ac_word; then
1294       ac_cv_prog_AMTAR="$ac_prog"
1295       break
1296     fi
1297   done
1298   IFS="$ac_save_ifs"
1299 fi
1300 fi
1301 AMTAR="$ac_cv_prog_AMTAR"
1302 if test -n "$AMTAR"; then
1303   echo "$ac_t""$AMTAR" 1>&6
1304 else
1305   echo "$ac_t""no" 1>&6
1306 fi
1307
1308 test -n "$AMTAR" && break
1309 done
1310
1311
1312 AMTARFLAGS=
1313 if test -n "$AMTAR"; then
1314   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1315         AMTARFLAGS=o
1316   fi
1317 fi
1318
1319 cat >> confdefs.h <<EOF
1320 #define OPENLDAP_PACKAGE "$PACKAGE"
1321 EOF
1322
1323 cat >> confdefs.h <<EOF
1324 #define OPENLDAP_VERSION "$VERSION"
1325 EOF
1326
1327
1328 cat >> confdefs.h <<EOF
1329 #define LDAP_VENDOR_VERSION $OL_API_INC
1330 EOF
1331
1332 cat >> confdefs.h <<EOF
1333 #define LDAP_VENDOR_VERSION_MAJOR $OL_MAJOR
1334 EOF
1335
1336 cat >> confdefs.h <<EOF
1337 #define LDAP_VENDOR_VERSION_MINOR $OL_MINOR
1338 EOF
1339
1340 cat >> confdefs.h <<EOF
1341 #define LDAP_VENDOR_VERSION_PATCH $OL_PATCH
1342 EOF
1343
1344
1345 OPENLDAP_LIBRELEASE=$OL_API_LIB_RELEASE
1346
1347 OPENLDAP_LIBVERSION=$OL_API_LIB_VERSION
1348
1349 OPENLDAP_RELEASE_DATE="$OL_RELEASE_DATE"
1350
1351
1352
1353 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1354 echo "configure:1355: checking configure arguments" >&5
1355
1356
1357 top_builddir=`pwd`
1358
1359 ldap_subdir="/openldap"
1360
1361 # Check whether --with-subdir or --without-subdir was given.
1362 if test "${with_subdir+set}" = set; then
1363   withval="$with_subdir"
1364   case "$withval" in
1365         no) ldap_subdir=""
1366                 ;;
1367         yes)
1368                 ;;
1369         /*|\\*)
1370                 ldap_subdir="$withval"
1371                 ;;
1372         *)
1373                 ldap_subdir="/$withval"
1374                 ;;
1375 esac
1376
1377 fi
1378
1379
1380 # OpenLDAP --enable-debug
1381         # Check whether --enable-debug or --disable-debug was given.
1382 if test "${enable_debug+set}" = set; then
1383   enableval="$enable_debug"
1384   
1385         ol_arg=invalid
1386         for ol_val in auto yes no ; do
1387                 if test "$enableval" = "$ol_val" ; then
1388                         ol_arg="$ol_val"
1389                 fi
1390         done
1391         if test "$ol_arg" = "invalid" ; then
1392                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1393         fi
1394         ol_enable_debug="$ol_arg"
1395
1396 else
1397         ol_enable_debug="yes"
1398 fi
1399 # end --enable-debug
1400 # OpenLDAP --enable-dynamic
1401         # Check whether --enable-dynamic or --disable-dynamic was given.
1402 if test "${enable_dynamic+set}" = set; then
1403   enableval="$enable_dynamic"
1404   
1405         ol_arg=invalid
1406         for ol_val in auto yes no ; do
1407                 if test "$enableval" = "$ol_val" ; then
1408                         ol_arg="$ol_val"
1409                 fi
1410         done
1411         if test "$ol_arg" = "invalid" ; then
1412                 { echo "configure: error: bad value $enableval for --enable-dynamic" 1>&2; exit 1; }
1413         fi
1414         ol_enable_dynamic="$ol_arg"
1415
1416 else
1417         ol_enable_dynamic="no"
1418 fi
1419 # end --enable-dynamic
1420 # OpenLDAP --enable-syslog
1421         # Check whether --enable-syslog or --disable-syslog was given.
1422 if test "${enable_syslog+set}" = set; then
1423   enableval="$enable_syslog"
1424   
1425         ol_arg=invalid
1426         for ol_val in auto yes no ; do
1427                 if test "$enableval" = "$ol_val" ; then
1428                         ol_arg="$ol_val"
1429                 fi
1430         done
1431         if test "$ol_arg" = "invalid" ; then
1432                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1433         fi
1434         ol_enable_syslog="$ol_arg"
1435
1436 else
1437         ol_enable_syslog="auto"
1438 fi
1439 # end --enable-syslog
1440 # OpenLDAP --enable-proctitle
1441         # Check whether --enable-proctitle or --disable-proctitle was given.
1442 if test "${enable_proctitle+set}" = set; then
1443   enableval="$enable_proctitle"
1444   
1445         ol_arg=invalid
1446         for ol_val in auto yes no ; do
1447                 if test "$enableval" = "$ol_val" ; then
1448                         ol_arg="$ol_val"
1449                 fi
1450         done
1451         if test "$ol_arg" = "invalid" ; then
1452                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1453         fi
1454         ol_enable_proctitle="$ol_arg"
1455
1456 else
1457         ol_enable_proctitle="yes"
1458 fi
1459 # end --enable-proctitle
1460 ol_enable_referrals=${ol_enable_referrals-no}
1461 ol_enable_kbind=${ol_enable_kbind-no}
1462 # OpenLDAP --enable-ipv6
1463         # Check whether --enable-ipv6 or --disable-ipv6 was given.
1464 if test "${enable_ipv6+set}" = set; then
1465   enableval="$enable_ipv6"
1466   
1467         ol_arg=invalid
1468         for ol_val in auto yes no ; do
1469                 if test "$enableval" = "$ol_val" ; then
1470                         ol_arg="$ol_val"
1471                 fi
1472         done
1473         if test "$ol_arg" = "invalid" ; then
1474                 { echo "configure: error: bad value $enableval for --enable-ipv6" 1>&2; exit 1; }
1475         fi
1476         ol_enable_ipv6="$ol_arg"
1477
1478 else
1479         ol_enable_ipv6="auto"
1480 fi
1481 # end --enable-ipv6
1482 # OpenLDAP --enable-local
1483         # Check whether --enable-local or --disable-local was given.
1484 if test "${enable_local+set}" = set; then
1485   enableval="$enable_local"
1486   
1487         ol_arg=invalid
1488         for ol_val in auto yes no ; do
1489                 if test "$enableval" = "$ol_val" ; then
1490                         ol_arg="$ol_val"
1491                 fi
1492         done
1493         if test "$ol_arg" = "invalid" ; then
1494                 { echo "configure: error: bad value $enableval for --enable-local" 1>&2; exit 1; }
1495         fi
1496         ol_enable_local="$ol_arg"
1497
1498 else
1499         ol_enable_local="auto"
1500 fi
1501 # end --enable-local
1502
1503
1504 # OpenLDAP --with-cyrus_sasl
1505         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1506 if test "${with_cyrus_sasl+set}" = set; then
1507   withval="$with_cyrus_sasl"
1508   
1509         ol_arg=invalid
1510         for ol_val in auto yes no  ; do
1511                 if test "$withval" = "$ol_val" ; then
1512                         ol_arg="$ol_val"
1513                 fi
1514         done
1515         if test "$ol_arg" = "invalid" ; then
1516                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1517         fi
1518         ol_with_cyrus_sasl="$ol_arg"
1519
1520 else
1521         ol_with_cyrus_sasl="auto"
1522 fi
1523 # end --with-cyrus_sasl
1524
1525 # OpenLDAP --with-fetch
1526         # Check whether --with-fetch or --without-fetch was given.
1527 if test "${with_fetch+set}" = set; then
1528   withval="$with_fetch"
1529   
1530         ol_arg=invalid
1531         for ol_val in auto yes no  ; do
1532                 if test "$withval" = "$ol_val" ; then
1533                         ol_arg="$ol_val"
1534                 fi
1535         done
1536         if test "$ol_arg" = "invalid" ; then
1537                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1538         fi
1539         ol_with_fetch="$ol_arg"
1540
1541 else
1542         ol_with_fetch="auto"
1543 fi
1544 # end --with-fetch
1545
1546 ol_with_kerberos=${ol_with_kerberos-auto}
1547 # OpenLDAP --with-threads
1548         # Check whether --with-threads or --without-threads was given.
1549 if test "${with_threads+set}" = set; then
1550   withval="$with_threads"
1551   
1552         ol_arg=invalid
1553         for ol_val in auto nt posix mach pth lwp yes no manual  ; do
1554                 if test "$withval" = "$ol_val" ; then
1555                         ol_arg="$ol_val"
1556                 fi
1557         done
1558         if test "$ol_arg" = "invalid" ; then
1559                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1560         fi
1561         ol_with_threads="$ol_arg"
1562
1563 else
1564         ol_with_threads="auto"
1565 fi
1566 # end --with-threads
1567
1568 # OpenLDAP --with-tls
1569         # Check whether --with-tls or --without-tls was given.
1570 if test "${with_tls+set}" = set; then
1571   withval="$with_tls"
1572   
1573         ol_arg=invalid
1574         for ol_val in auto ssleay openssl yes no  ; do
1575                 if test "$withval" = "$ol_val" ; then
1576                         ol_arg="$ol_val"
1577                 fi
1578         done
1579         if test "$ol_arg" = "invalid" ; then
1580                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1581         fi
1582         ol_with_tls="$ol_arg"
1583
1584 else
1585         ol_with_tls="auto"
1586 fi
1587 # end --with-tls
1588
1589 # OpenLDAP --with-yielding_select
1590         # Check whether --with-yielding_select or --without-yielding_select was given.
1591 if test "${with_yielding_select+set}" = set; then
1592   withval="$with_yielding_select"
1593   
1594         ol_arg=invalid
1595         for ol_val in auto yes no manual  ; do
1596                 if test "$withval" = "$ol_val" ; then
1597                         ol_arg="$ol_val"
1598                 fi
1599         done
1600         if test "$ol_arg" = "invalid" ; then
1601                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1602         fi
1603         ol_with_yielding_select="$ol_arg"
1604
1605 else
1606         ol_with_yielding_select="auto"
1607 fi
1608 # end --with-yielding_select
1609
1610
1611
1612 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1613 if test "${with_xxslapdoptions+set}" = set; then
1614   withval="$with_xxslapdoptions"
1615   :
1616 fi
1617
1618 # OpenLDAP --enable-slapd
1619         # Check whether --enable-slapd or --disable-slapd was given.
1620 if test "${enable_slapd+set}" = set; then
1621   enableval="$enable_slapd"
1622   
1623         ol_arg=invalid
1624         for ol_val in auto yes no ; do
1625                 if test "$enableval" = "$ol_val" ; then
1626                         ol_arg="$ol_val"
1627                 fi
1628         done
1629         if test "$ol_arg" = "invalid" ; then
1630                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1631         fi
1632         ol_enable_slapd="$ol_arg"
1633
1634 else
1635         ol_enable_slapd="yes"
1636 fi
1637 # end --enable-slapd
1638 # OpenLDAP --enable-aci
1639         # Check whether --enable-aci or --disable-aci was given.
1640 if test "${enable_aci+set}" = set; then
1641   enableval="$enable_aci"
1642   
1643         ol_arg=invalid
1644         for ol_val in auto yes no ; do
1645                 if test "$enableval" = "$ol_val" ; then
1646                         ol_arg="$ol_val"
1647                 fi
1648         done
1649         if test "$ol_arg" = "invalid" ; then
1650                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1651         fi
1652         ol_enable_aci="$ol_arg"
1653
1654 else
1655         ol_enable_aci="no"
1656 fi
1657 # end --enable-aci
1658 # OpenLDAP --enable-cleartext
1659         # Check whether --enable-cleartext or --disable-cleartext was given.
1660 if test "${enable_cleartext+set}" = set; then
1661   enableval="$enable_cleartext"
1662   
1663         ol_arg=invalid
1664         for ol_val in auto yes no ; do
1665                 if test "$enableval" = "$ol_val" ; then
1666                         ol_arg="$ol_val"
1667                 fi
1668         done
1669         if test "$ol_arg" = "invalid" ; then
1670                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1671         fi
1672         ol_enable_cleartext="$ol_arg"
1673
1674 else
1675         ol_enable_cleartext="yes"
1676 fi
1677 # end --enable-cleartext
1678 # OpenLDAP --enable-crypt
1679         # Check whether --enable-crypt or --disable-crypt was given.
1680 if test "${enable_crypt+set}" = set; then
1681   enableval="$enable_crypt"
1682   
1683         ol_arg=invalid
1684         for ol_val in auto yes no ; do
1685                 if test "$enableval" = "$ol_val" ; then
1686                         ol_arg="$ol_val"
1687                 fi
1688         done
1689         if test "$ol_arg" = "invalid" ; then
1690                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1691         fi
1692         ol_enable_crypt="$ol_arg"
1693
1694 else
1695         ol_enable_crypt="no"
1696 fi
1697 # end --enable-crypt
1698 # OpenLDAP --enable-lmpasswd
1699         # Check whether --enable-lmpasswd or --disable-lmpasswd was given.
1700 if test "${enable_lmpasswd+set}" = set; then
1701   enableval="$enable_lmpasswd"
1702   
1703         ol_arg=invalid
1704         for ol_val in auto yes no ; do
1705                 if test "$enableval" = "$ol_val" ; then
1706                         ol_arg="$ol_val"
1707                 fi
1708         done
1709         if test "$ol_arg" = "invalid" ; then
1710                 { echo "configure: error: bad value $enableval for --enable-lmpasswd" 1>&2; exit 1; }
1711         fi
1712         ol_enable_lmpasswd="$ol_arg"
1713
1714 else
1715         ol_enable_lmpasswd="no"
1716 fi
1717 # end --enable-lmpasswd
1718 # OpenLDAP --enable-spasswd
1719         # Check whether --enable-spasswd or --disable-spasswd was given.
1720 if test "${enable_spasswd+set}" = set; then
1721   enableval="$enable_spasswd"
1722   
1723         ol_arg=invalid
1724         for ol_val in auto yes no ; do
1725                 if test "$enableval" = "$ol_val" ; then
1726                         ol_arg="$ol_val"
1727                 fi
1728         done
1729         if test "$ol_arg" = "invalid" ; then
1730                 { echo "configure: error: bad value $enableval for --enable-spasswd" 1>&2; exit 1; }
1731         fi
1732         ol_enable_spasswd="$ol_arg"
1733
1734 else
1735         ol_enable_spasswd="no"
1736 fi
1737 # end --enable-spasswd
1738 # OpenLDAP --enable-modules
1739         # Check whether --enable-modules or --disable-modules was given.
1740 if test "${enable_modules+set}" = set; then
1741   enableval="$enable_modules"
1742   
1743         ol_arg=invalid
1744         for ol_val in auto yes no ; do
1745                 if test "$enableval" = "$ol_val" ; then
1746                         ol_arg="$ol_val"
1747                 fi
1748         done
1749         if test "$ol_arg" = "invalid" ; then
1750                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1751         fi
1752         ol_enable_modules="$ol_arg"
1753
1754 else
1755         ol_enable_modules="no"
1756 fi
1757 # end --enable-modules
1758 ol_enable_multimaster=${ol_enable_multimaster-no}
1759 # OpenLDAP --enable-rewrite
1760         # Check whether --enable-rewrite or --disable-rewrite was given.
1761 if test "${enable_rewrite+set}" = set; then
1762   enableval="$enable_rewrite"
1763   
1764         ol_arg=invalid
1765         for ol_val in auto yes no ; do
1766                 if test "$enableval" = "$ol_val" ; then
1767                         ol_arg="$ol_val"
1768                 fi
1769         done
1770         if test "$ol_arg" = "invalid" ; then
1771                 { echo "configure: error: bad value $enableval for --enable-rewrite" 1>&2; exit 1; }
1772         fi
1773         ol_enable_rewrite="$ol_arg"
1774
1775 else
1776         ol_enable_rewrite="auto"
1777 fi
1778 # end --enable-rewrite
1779 # OpenLDAP --enable-rlookups
1780         # Check whether --enable-rlookups or --disable-rlookups was given.
1781 if test "${enable_rlookups+set}" = set; then
1782   enableval="$enable_rlookups"
1783   
1784         ol_arg=invalid
1785         for ol_val in auto yes no ; do
1786                 if test "$enableval" = "$ol_val" ; then
1787                         ol_arg="$ol_val"
1788                 fi
1789         done
1790         if test "$ol_arg" = "invalid" ; then
1791                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1792         fi
1793         ol_enable_rlookups="$ol_arg"
1794
1795 else
1796         ol_enable_rlookups="no"
1797 fi
1798 # end --enable-rlookups
1799 # OpenLDAP --enable-slapi
1800         # Check whether --enable-slapi or --disable-slapi was given.
1801 if test "${enable_slapi+set}" = set; then
1802   enableval="$enable_slapi"
1803   
1804         ol_arg=invalid
1805         for ol_val in auto yes no ; do
1806                 if test "$enableval" = "$ol_val" ; then
1807                         ol_arg="$ol_val"
1808                 fi
1809         done
1810         if test "$ol_arg" = "invalid" ; then
1811                 { echo "configure: error: bad value $enableval for --enable-slapi" 1>&2; exit 1; }
1812         fi
1813         ol_enable_slapi="$ol_arg"
1814
1815 else
1816         ol_enable_slapi="no"
1817 fi
1818 # end --enable-slapi
1819 # OpenLDAP --enable-slp
1820         # Check whether --enable-slp or --disable-slp was given.
1821 if test "${enable_slp+set}" = set; then
1822   enableval="$enable_slp"
1823   
1824         ol_arg=invalid
1825         for ol_val in auto yes no ; do
1826                 if test "$enableval" = "$ol_val" ; then
1827                         ol_arg="$ol_val"
1828                 fi
1829         done
1830         if test "$ol_arg" = "invalid" ; then
1831                 { echo "configure: error: bad value $enableval for --enable-slp" 1>&2; exit 1; }
1832         fi
1833         ol_enable_slp="$ol_arg"
1834
1835 else
1836         ol_enable_slp="no"
1837 fi
1838 # end --enable-slp
1839 # OpenLDAP --enable-wrappers
1840         # Check whether --enable-wrappers or --disable-wrappers was given.
1841 if test "${enable_wrappers+set}" = set; then
1842   enableval="$enable_wrappers"
1843   
1844         ol_arg=invalid
1845         for ol_val in auto yes no ; do
1846                 if test "$enableval" = "$ol_val" ; then
1847                         ol_arg="$ol_val"
1848                 fi
1849         done
1850         if test "$ol_arg" = "invalid" ; then
1851                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1852         fi
1853         ol_enable_wrappers="$ol_arg"
1854
1855 else
1856         ol_enable_wrappers="no"
1857 fi
1858 # end --enable-wrappers
1859
1860 Backends="bdb dnssrv hdb ldap ldbm meta monitor null \
1861         passwd perl shell sql"
1862
1863 # Check whether --with-xxslapoverlays or --without-xxslapoverlays was given.
1864 if test "${with_xxslapoverlays+set}" = set; then
1865   withval="$with_xxslapoverlays"
1866   :
1867 fi
1868
1869
1870 # OpenLDAP --enable-bdb
1871         # Check whether --enable-bdb or --disable-bdb was given.
1872 if test "${enable_bdb+set}" = set; then
1873   enableval="$enable_bdb"
1874   
1875         ol_arg=invalid
1876         for ol_val in no yes mod ; do
1877                 if test "$enableval" = "$ol_val" ; then
1878                         ol_arg="$ol_val"
1879                 fi
1880         done
1881         if test "$ol_arg" = "invalid" ; then
1882                 { echo "configure: error: bad value $enableval for --enable-bdb" 1>&2; exit 1; }
1883         fi
1884         ol_enable_bdb="$ol_arg"
1885
1886 else
1887         ol_enable_bdb="yes"
1888 fi
1889 # end --enable-bdb
1890 # OpenLDAP --enable-dnssrv
1891         # Check whether --enable-dnssrv or --disable-dnssrv was given.
1892 if test "${enable_dnssrv+set}" = set; then
1893   enableval="$enable_dnssrv"
1894   
1895         ol_arg=invalid
1896         for ol_val in no yes mod ; do
1897                 if test "$enableval" = "$ol_val" ; then
1898                         ol_arg="$ol_val"
1899                 fi
1900         done
1901         if test "$ol_arg" = "invalid" ; then
1902                 { echo "configure: error: bad value $enableval for --enable-dnssrv" 1>&2; exit 1; }
1903         fi
1904         ol_enable_dnssrv="$ol_arg"
1905
1906 else
1907         ol_enable_dnssrv="no"
1908 fi
1909 # end --enable-dnssrv
1910 # OpenLDAP --enable-hdb
1911         # Check whether --enable-hdb or --disable-hdb was given.
1912 if test "${enable_hdb+set}" = set; then
1913   enableval="$enable_hdb"
1914   
1915         ol_arg=invalid
1916         for ol_val in no yes mod ; do
1917                 if test "$enableval" = "$ol_val" ; then
1918                         ol_arg="$ol_val"
1919                 fi
1920         done
1921         if test "$ol_arg" = "invalid" ; then
1922                 { echo "configure: error: bad value $enableval for --enable-hdb" 1>&2; exit 1; }
1923         fi
1924         ol_enable_hdb="$ol_arg"
1925
1926 else
1927         ol_enable_hdb="no"
1928 fi
1929 # end --enable-hdb
1930 # OpenLDAP --enable-ldap
1931         # Check whether --enable-ldap or --disable-ldap was given.
1932 if test "${enable_ldap+set}" = set; then
1933   enableval="$enable_ldap"
1934   
1935         ol_arg=invalid
1936         for ol_val in no yes mod ; do
1937                 if test "$enableval" = "$ol_val" ; then
1938                         ol_arg="$ol_val"
1939                 fi
1940         done
1941         if test "$ol_arg" = "invalid" ; then
1942                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1943         fi
1944         ol_enable_ldap="$ol_arg"
1945
1946 else
1947         ol_enable_ldap="no"
1948 fi
1949 # end --enable-ldap
1950 # OpenLDAP --enable-ldbm
1951         # Check whether --enable-ldbm or --disable-ldbm was given.
1952 if test "${enable_ldbm+set}" = set; then
1953   enableval="$enable_ldbm"
1954   
1955         ol_arg=invalid
1956         for ol_val in no yes mod ; do
1957                 if test "$enableval" = "$ol_val" ; then
1958                         ol_arg="$ol_val"
1959                 fi
1960         done
1961         if test "$ol_arg" = "invalid" ; then
1962                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1963         fi
1964         ol_enable_ldbm="$ol_arg"
1965
1966 else
1967         ol_enable_ldbm="no"
1968 fi
1969 # end --enable-ldbm
1970 # OpenLDAP --with-ldbm_api
1971         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1972 if test "${with_ldbm_api+set}" = set; then
1973   withval="$with_ldbm_api"
1974   
1975         ol_arg=invalid
1976         for ol_val in auto berkeley bcompat mdbm gdbm ; do
1977                 if test "$withval" = "$ol_val" ; then
1978                         ol_arg="$ol_val"
1979                 fi
1980         done
1981         if test "$ol_arg" = "invalid" ; then
1982                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1983         fi
1984         ol_with_ldbm_api="$ol_arg"
1985
1986 else
1987         ol_with_ldbm_api="auto"
1988 fi
1989 # end --with-ldbm_api
1990
1991 # OpenLDAP --with-ldbm_type
1992         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1993 if test "${with_ldbm_type+set}" = set; then
1994   withval="$with_ldbm_type"
1995   
1996         ol_arg=invalid
1997         for ol_val in auto btree hash ; do
1998                 if test "$withval" = "$ol_val" ; then
1999                         ol_arg="$ol_val"
2000                 fi
2001         done
2002         if test "$ol_arg" = "invalid" ; then
2003                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
2004         fi
2005         ol_with_ldbm_type="$ol_arg"
2006
2007 else
2008         ol_with_ldbm_type="auto"
2009 fi
2010 # end --with-ldbm_type
2011
2012 # OpenLDAP --enable-meta
2013         # Check whether --enable-meta or --disable-meta was given.
2014 if test "${enable_meta+set}" = set; then
2015   enableval="$enable_meta"
2016   
2017         ol_arg=invalid
2018         for ol_val in no yes mod ; do
2019                 if test "$enableval" = "$ol_val" ; then
2020                         ol_arg="$ol_val"
2021                 fi
2022         done
2023         if test "$ol_arg" = "invalid" ; then
2024                 { echo "configure: error: bad value $enableval for --enable-meta" 1>&2; exit 1; }
2025         fi
2026         ol_enable_meta="$ol_arg"
2027
2028 else
2029         ol_enable_meta="no"
2030 fi
2031 # end --enable-meta
2032 # OpenLDAP --enable-monitor
2033         # Check whether --enable-monitor or --disable-monitor was given.
2034 if test "${enable_monitor+set}" = set; then
2035   enableval="$enable_monitor"
2036   
2037         ol_arg=invalid
2038         for ol_val in no yes mod ; do
2039                 if test "$enableval" = "$ol_val" ; then
2040                         ol_arg="$ol_val"
2041                 fi
2042         done
2043         if test "$ol_arg" = "invalid" ; then
2044                 { echo "configure: error: bad value $enableval for --enable-monitor" 1>&2; exit 1; }
2045         fi
2046         ol_enable_monitor="$ol_arg"
2047
2048 else
2049         ol_enable_monitor="yes"
2050 fi
2051 # end --enable-monitor
2052 # OpenLDAP --enable-null
2053         # Check whether --enable-null or --disable-null was given.
2054 if test "${enable_null+set}" = set; then
2055   enableval="$enable_null"
2056   
2057         ol_arg=invalid
2058         for ol_val in no yes mod ; do
2059                 if test "$enableval" = "$ol_val" ; then
2060                         ol_arg="$ol_val"
2061                 fi
2062         done
2063         if test "$ol_arg" = "invalid" ; then
2064                 { echo "configure: error: bad value $enableval for --enable-null" 1>&2; exit 1; }
2065         fi
2066         ol_enable_null="$ol_arg"
2067
2068 else
2069         ol_enable_null="no"
2070 fi
2071 # end --enable-null
2072 # OpenLDAP --enable-passwd
2073         # Check whether --enable-passwd or --disable-passwd was given.
2074 if test "${enable_passwd+set}" = set; then
2075   enableval="$enable_passwd"
2076   
2077         ol_arg=invalid
2078         for ol_val in no yes mod ; do
2079                 if test "$enableval" = "$ol_val" ; then
2080                         ol_arg="$ol_val"
2081                 fi
2082         done
2083         if test "$ol_arg" = "invalid" ; then
2084                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
2085         fi
2086         ol_enable_passwd="$ol_arg"
2087
2088 else
2089         ol_enable_passwd="no"
2090 fi
2091 # end --enable-passwd
2092 # OpenLDAP --enable-perl
2093         # Check whether --enable-perl or --disable-perl was given.
2094 if test "${enable_perl+set}" = set; then
2095   enableval="$enable_perl"
2096   
2097         ol_arg=invalid
2098         for ol_val in no yes mod ; do
2099                 if test "$enableval" = "$ol_val" ; then
2100                         ol_arg="$ol_val"
2101                 fi
2102         done
2103         if test "$ol_arg" = "invalid" ; then
2104                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
2105         fi
2106         ol_enable_perl="$ol_arg"
2107
2108 else
2109         ol_enable_perl="no"
2110 fi
2111 # end --enable-perl
2112 # OpenLDAP --enable-shell
2113         # Check whether --enable-shell or --disable-shell was given.
2114 if test "${enable_shell+set}" = set; then
2115   enableval="$enable_shell"
2116   
2117         ol_arg=invalid
2118         for ol_val in no yes mod ; do
2119                 if test "$enableval" = "$ol_val" ; then
2120                         ol_arg="$ol_val"
2121                 fi
2122         done
2123         if test "$ol_arg" = "invalid" ; then
2124                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
2125         fi
2126         ol_enable_shell="$ol_arg"
2127
2128 else
2129         ol_enable_shell="no"
2130 fi
2131 # end --enable-shell
2132 # OpenLDAP --enable-sql
2133         # Check whether --enable-sql or --disable-sql was given.
2134 if test "${enable_sql+set}" = set; then
2135   enableval="$enable_sql"
2136   
2137         ol_arg=invalid
2138         for ol_val in no yes mod ; do
2139                 if test "$enableval" = "$ol_val" ; then
2140                         ol_arg="$ol_val"
2141                 fi
2142         done
2143         if test "$ol_arg" = "invalid" ; then
2144                 { echo "configure: error: bad value $enableval for --enable-sql" 1>&2; exit 1; }
2145         fi
2146         ol_enable_sql="$ol_arg"
2147
2148 else
2149         ol_enable_sql="no"
2150 fi
2151 # end --enable-sql
2152
2153 Overlays="dyngroup proxycache"
2154
2155 # Check whether --with-xxslapoverlays or --without-xxslapoverlays was given.
2156 if test "${with_xxslapoverlays+set}" = set; then
2157   withval="$with_xxslapoverlays"
2158   :
2159 fi
2160
2161
2162 # OpenLDAP --enable-dyngroup
2163         # Check whether --enable-dyngroup or --disable-dyngroup was given.
2164 if test "${enable_dyngroup+set}" = set; then
2165   enableval="$enable_dyngroup"
2166   
2167         ol_arg=invalid
2168         for ol_val in no yes mod ; do
2169                 if test "$enableval" = "$ol_val" ; then
2170                         ol_arg="$ol_val"
2171                 fi
2172         done
2173         if test "$ol_arg" = "invalid" ; then
2174                 { echo "configure: error: bad value $enableval for --enable-dyngroup" 1>&2; exit 1; }
2175         fi
2176         ol_enable_dyngroup="$ol_arg"
2177
2178 else
2179         ol_enable_dyngroup="no"
2180 fi
2181 # end --enable-dyngroup
2182
2183 # OpenLDAP --enable-proxycache
2184         # Check whether --enable-proxycache or --disable-proxycache was given.
2185 if test "${enable_proxycache+set}" = set; then
2186   enableval="$enable_proxycache"
2187   
2188         ol_arg=invalid
2189         for ol_val in no yes mod ; do
2190                 if test "$enableval" = "$ol_val" ; then
2191                         ol_arg="$ol_val"
2192                 fi
2193         done
2194         if test "$ol_arg" = "invalid" ; then
2195                 { echo "configure: error: bad value $enableval for --enable-proxycache" 1>&2; exit 1; }
2196         fi
2197         ol_enable_proxycache="$ol_arg"
2198
2199 else
2200         ol_enable_proxycache="no"
2201 fi
2202 # end --enable-proxycache
2203
2204
2205 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2206 if test "${with_xxslurpdoptions+set}" = set; then
2207   withval="$with_xxslurpdoptions"
2208   :
2209 fi
2210
2211 # OpenLDAP --enable-slurpd
2212         # Check whether --enable-slurpd or --disable-slurpd was given.
2213 if test "${enable_slurpd+set}" = set; then
2214   enableval="$enable_slurpd"
2215   
2216         ol_arg=invalid
2217         for ol_val in auto yes no ; do
2218                 if test "$enableval" = "$ol_val" ; then
2219                         ol_arg="$ol_val"
2220                 fi
2221         done
2222         if test "$ol_arg" = "invalid" ; then
2223                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2224         fi
2225         ol_enable_slurpd="$ol_arg"
2226
2227 else
2228         ol_enable_slurpd="auto"
2229 fi
2230 # end --enable-slurpd
2231
2232 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2233 if test "${with_xxliboptions+set}" = set; then
2234   withval="$with_xxliboptions"
2235   :
2236 fi
2237
2238 # Check whether --enable-static or --disable-static was given.
2239 if test "${enable_static+set}" = set; then
2240   enableval="$enable_static"
2241   p=${PACKAGE-default}
2242 case $enableval in
2243 yes) enable_static=yes ;;
2244 no) enable_static=no ;;
2245 *)
2246   enable_static=no
2247   # Look at the argument we got.  We use all the common list separators.
2248   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2249   for pkg in $enableval; do
2250     if test "X$pkg" = "X$p"; then
2251       enable_static=yes
2252     fi
2253   done
2254   IFS="$ac_save_ifs"
2255   ;;
2256 esac
2257 else
2258   enable_static=yes
2259 fi
2260
2261 # Check whether --enable-shared or --disable-shared was given.
2262 if test "${enable_shared+set}" = set; then
2263   enableval="$enable_shared"
2264   p=${PACKAGE-default}
2265 case $enableval in
2266 yes) enable_shared=yes ;;
2267 no) enable_shared=no ;;
2268 *)
2269   enable_shared=no
2270   # Look at the argument we got.  We use all the common list separators.
2271   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2272   for pkg in $enableval; do
2273     if test "X$pkg" = "X$p"; then
2274       enable_shared=yes
2275     fi
2276   done
2277   IFS="$ac_save_ifs"
2278   ;;
2279 esac
2280 else
2281   enable_shared=yes
2282 fi
2283
2284
2285
2286 # validate options
2287 if test $ol_enable_slapd = no ; then
2288                 if test $ol_enable_slapi = yes ; then
2289                 echo "configure: warning: slapd disabled, ignoring --enable-slapi argument" 1>&2
2290         fi
2291         for i in $Backends; do
2292                 eval "ol_tmp=\$ol_enable_$i"
2293                 if test $ol_tmp != no ; then
2294                         echo "configure: warning: slapd disabled, ignoring --enable-$i argument" 1>&2
2295                         eval "ol_enable_$i=no"
2296                 fi
2297         done
2298         if test $ol_enable_modules = yes ; then
2299                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2300         fi
2301         if test $ol_enable_multimaster = yes ; then
2302                 echo "configure: warning: slapd disabled, ignoring --enable-multimaster argument" 1>&2
2303         fi
2304         if test $ol_enable_wrappers = yes ; then
2305                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2306         fi
2307         if test $ol_enable_rlookups = yes ; then
2308                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2309         fi
2310         if test $ol_enable_aci = yes ; then
2311                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2312         fi
2313         if test $ol_with_ldbm_api != auto ; then
2314                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2315         fi
2316         if test $ol_with_ldbm_type != auto ; then
2317                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2318         fi
2319         if test $ol_enable_slurpd = yes ; then
2320                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2321         fi
2322         if test $ol_enable_rewrite = yes ; then
2323                 echo "configure: warning: slapd disabled, ignoring --enable-rewrite argument" 1>&2
2324         fi
2325                 for i in $Overlays; do
2326                 eval "ol_tmp=\$ol_enable_$i"
2327                 if test $ol_tmp != no ; then
2328                         echo "configure: warning: slapd disabled, ignoring --enable-$i argument" 1>&2
2329                         eval "ol_enable_$i=no"
2330                 fi
2331         done
2332
2333         # force settings to no
2334         ol_enable_slapi=no
2335
2336         ol_enable_modules=no
2337         ol_enable_multimaster=no
2338         ol_enable_rlookups=no
2339         ol_enable_aci=no
2340         ol_enable_wrappers=no
2341
2342         ol_with_ldbm_api=no
2343         ol_with_ldbm_type=no
2344
2345         ol_enable_slurpd=no
2346
2347         ol_enable_rewrite=no
2348
2349 elif test $ol_enable_ldbm = no ; then
2350         
2351         if test $ol_with_ldbm_api != auto ; then
2352                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2353         fi
2354
2355         if test $ol_with_ldbm_type != auto ; then
2356                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2357         fi
2358
2359         if test $ol_enable_modules != yes -a \
2360                 $ol_enable_bdb = no -a \
2361                 $ol_enable_dnssrv = no -a \
2362                 $ol_enable_hdb = no -a \
2363                 $ol_enable_ldap = no -a \
2364                 $ol_enable_meta = no -a \
2365                 $ol_enable_monitor = no -a \
2366                 $ol_enable_null = no -a \
2367                 $ol_enable_passwd = no -a \
2368                 $ol_enable_perl = no -a \
2369                 $ol_enable_shell = no -a \
2370                 $ol_enable_sql = no ; then
2371
2372                 if test $ol_enable_slapd = yes ; then
2373                         { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2374                 else
2375                         echo "configure: warning: skipping slapd, no backend specified" 1>&2
2376                         ol_enable_slapd=no
2377                 fi
2378         fi
2379
2380         ol_with_ldbm_api=no
2381         ol_with_ldbm_type=no
2382
2383         if test $ol_enable_bdb != no -o $ol_enable_hdb != no; then
2384                 ol_with_ldbm_api=berkeley
2385         fi
2386
2387 else
2388                 if test $ol_with_ldbm_api = gdbm -a \
2389                 $ol_with_ldbm_type = btree ; then
2390                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2391         fi
2392         if test $ol_with_ldbm_api = mdbm -a \
2393                 $ol_with_ldbm_type = btree ; then
2394                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2395         fi
2396         if test $ol_with_ldbm_api = ndbm -a \
2397                 $ol_with_ldbm_type = btree ; then
2398                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2399         fi
2400
2401         if test $ol_enable_bdb = yes -o $ol_enable_hdb = yes ; then
2402                 if test $ol_with_ldbm_api = auto ; then
2403                         ol_with_ldbm_api=berkeley
2404                 elif test $ol_with_ldbm_api != berkeley ; then
2405                         { echo "configure: error: LDBM API not compatible with BDB/HDB" 1>&2; exit 1; }
2406                 fi
2407
2408         elif test $ol_enable_bdb = auto ; then
2409                 if test $ol_with_ldbm_api != berkeley \
2410                         -o $ol_with_ldbm_api != auto ; then
2411                         echo "configure: warning: LDBM API not compatible with BDB, disabling BDB" 1>&2
2412                         ol_enable_bdb=no
2413                 fi
2414         fi
2415 fi
2416
2417 if test $ol_enable_meta = yes -a $ol_enable_ldap = no ; then
2418         { echo "configure: error: --enable-meta requires --enable-ldap" 1>&2; exit 1; }
2419 fi
2420
2421 if test $ol_enable_slurpd = yes ; then
2422                 if test $ol_with_threads = no ; then
2423                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2424         fi
2425 fi
2426
2427 if test $ol_enable_lmpasswd = yes ; then
2428         if test $ol_with_tls = no ; then
2429                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
2430         fi
2431 fi
2432
2433 if test $ol_enable_kbind = yes ; then
2434         if test $ol_with_kerberos = no ; then
2435                 { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
2436         elif test $ol_with_kerberos = auto ; then
2437                 ol_with_kerberos=yes
2438         fi
2439
2440 elif test $ol_enable_kbind = no ; then
2441         if test $ol_with_kerberos = auto ; then
2442                 ol_with_kerberos=no
2443         elif test $ol_with_kerberos != no ; then
2444                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2445                 ol_with_kerberos=no
2446         fi
2447 fi
2448
2449 if test $ol_enable_spasswd = yes ; then
2450         if test $ol_with_cyrus_sasl = no ; then
2451                 { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
2452         fi
2453         ol_with_cyrus_sasl=yes
2454 fi
2455
2456 echo "$ac_t""done" 1>&6
2457
2458 LDAP_LIBS=
2459 LDBM_LIBS=
2460 LTHREAD_LIBS=
2461 LUTIL_LIBS=
2462
2463 SLAPD_LIBS=
2464 SLURPD_LIBS=
2465
2466 BUILD_SLAPD=no
2467 BUILD_SLURPD=no
2468
2469 BUILD_THREAD=no
2470
2471 BUILD_SLAPI=no
2472 SLAPD_SLAPI_DEPEND=
2473
2474 BUILD_BDB=no
2475 BUILD_DNSSRV=no
2476 BUILD_HDB=no
2477 BUILD_LDAP=no
2478 BUILD_LDBM=no
2479 BUILD_META=no
2480 BUILD_MONITOR=no
2481 BUILD_NULL=no
2482 BUILD_PASSWD=no
2483 BUILD_PERL=no
2484 BUILD_SHELL=no
2485 BUILD_SQL=no
2486
2487 BUILD_DYNGROUP=no
2488 BUILD_PROXYCACHE=no
2489
2490 SLAPD_DYNAMIC_OVERLAYS=
2491
2492 SLAPD_MODULES_LDFLAGS=
2493 SLAPD_MODULES_CPPFLAGS=
2494
2495 SLAPD_STATIC_BACKENDS=
2496 SLAPD_DYNAMIC_BACKENDS=
2497
2498 SLAPD_PERL_LDFLAGS=
2499 MOD_PERL_LDFLAGS=
2500 PERL_CPPFLAGS=
2501
2502 SLAPD_SQL_LDFLAGS=
2503 SLAPD_SQL_LIBS=
2504 SLAPD_SQL_INCLUDES=
2505
2506 KRB4_LIBS=
2507 KRB5_LIBS=
2508 SASL_LIBS=
2509 TLS_LIBS=
2510 MODULES_LIBS=
2511 SLAPI_LIBS=
2512 LIBSLAPI=
2513 LIBSLAPITOOLS=
2514 AUTH_LIBS=
2515
2516 SLAPD_SLP_LIBS=
2517
2518
2519 # Find a good install program.  We prefer a C program (faster),
2520 # so one script is as good as another.  But avoid the broken or
2521 # incompatible versions:
2522 # SysV /etc/install, /usr/sbin/install
2523 # SunOS /usr/etc/install
2524 # IRIX /sbin/install
2525 # AIX /bin/install
2526 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2527 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2528 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2529 # ./install, which can be erroneously created by make from ./install.sh.
2530 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
2531 echo "configure:2532: checking for a BSD compatible install" >&5
2532 if test -z "$INSTALL"; then
2533 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
2534   echo $ac_n "(cached) $ac_c" 1>&6
2535 else
2536     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
2537   for ac_dir in $PATH; do
2538     # Account for people who put trailing slashes in PATH elements.
2539     case "$ac_dir/" in
2540     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
2541     *)
2542       # OSF1 and SCO ODT 3.0 have their own names for install.
2543       # Don't use installbsd from OSF since it installs stuff as root
2544       # by default.
2545       for ac_prog in ginstall scoinst install; do
2546         if test -f $ac_dir/$ac_prog; then
2547           if test $ac_prog = install &&
2548             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
2549             # AIX install.  It has an incompatible calling convention.
2550             :
2551           elif test $ac_prog = install &&
2552             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
2553             # program-specific install script used by HP pwplus--don't use.
2554             :
2555           else
2556             ac_cv_path_install="$ac_dir/$ac_prog -c"
2557             break 2
2558           fi
2559         fi
2560       done
2561       ;;
2562     esac
2563   done
2564   IFS="$ac_save_IFS"
2565
2566 fi
2567   if test "${ac_cv_path_install+set}" = set; then
2568     INSTALL="$ac_cv_path_install"
2569   else
2570     # As a last resort, use the slow shell script.  We don't cache a
2571     # path for INSTALL within a source directory, because that will
2572     # break other packages using the cache if that directory is
2573     # removed, or if the path is relative.
2574     INSTALL="$ac_install_sh"
2575   fi
2576 fi
2577 echo "$ac_t""$INSTALL" 1>&6
2578
2579 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2580 # It thinks the first close brace ends the variable substitution.
2581 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2582
2583 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2584
2585 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2586
2587
2588 cat >> confdefs.h <<\EOF
2589 #define HAVE_MKVERSION 1
2590 EOF
2591
2592
2593
2594
2595 ol_aix_threads=no
2596 case "$target" in
2597 *-*-aix*)       if test -z "$CC" ; then
2598                 case "$ol_with_threads" in
2599                 auto | yes |  posix) ol_aix_threads=yes ;;
2600                 esac
2601         fi
2602 ;;
2603 esac
2604
2605 if test $ol_aix_threads = yes ; then
2606         if test -z "${CC}" ; then
2607                 for ac_prog in cc_r xlc_r cc
2608 do
2609 # Extract the first word of "$ac_prog", so it can be a program name with args.
2610 set dummy $ac_prog; ac_word=$2
2611 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2612 echo "configure:2613: checking for $ac_word" >&5
2613 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2614   echo $ac_n "(cached) $ac_c" 1>&6
2615 else
2616   if test -n "$CC"; then
2617   ac_cv_prog_CC="$CC" # Let the user override the test.
2618 else
2619   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2620   ac_dummy="$PATH"
2621   for ac_dir in $ac_dummy; do
2622     test -z "$ac_dir" && ac_dir=.
2623     if test -f $ac_dir/$ac_word; then
2624       ac_cv_prog_CC="$ac_prog"
2625       break
2626     fi
2627   done
2628   IFS="$ac_save_ifs"
2629 fi
2630 fi
2631 CC="$ac_cv_prog_CC"
2632 if test -n "$CC"; then
2633   echo "$ac_t""$CC" 1>&6
2634 else
2635   echo "$ac_t""no" 1>&6
2636 fi
2637
2638 test -n "$CC" && break
2639 done
2640
2641
2642                 if test "$CC" = cc ; then
2643                                                 if test $ol_with_threads != auto ; then
2644                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2645                         else
2646                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2647                         fi
2648                         ol_with_threads=no
2649                 fi
2650         fi
2651
2652         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2653                 ol_with_threads=posix
2654                 ol_cv_pthread_create=yes
2655         fi
2656 fi
2657
2658 if test -z "${CC}"; then
2659         for ac_prog in cc gcc
2660 do
2661 # Extract the first word of "$ac_prog", so it can be a program name with args.
2662 set dummy $ac_prog; ac_word=$2
2663 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2664 echo "configure:2665: checking for $ac_word" >&5
2665 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2666   echo $ac_n "(cached) $ac_c" 1>&6
2667 else
2668   if test -n "$CC"; then
2669   ac_cv_prog_CC="$CC" # Let the user override the test.
2670 else
2671   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2672   ac_dummy="$PATH"
2673   for ac_dir in $ac_dummy; do
2674     test -z "$ac_dir" && ac_dir=.
2675     if test -f $ac_dir/$ac_word; then
2676       ac_cv_prog_CC="$ac_prog"
2677       break
2678     fi
2679   done
2680   IFS="$ac_save_ifs"
2681 fi
2682 fi
2683 CC="$ac_cv_prog_CC"
2684 if test -n "$CC"; then
2685   echo "$ac_t""$CC" 1>&6
2686 else
2687   echo "$ac_t""no" 1>&6
2688 fi
2689
2690 test -n "$CC" && break
2691 done
2692 test -n "$CC" || CC="missing"
2693
2694
2695         if test "${CC}" = "missing" ; then
2696                 { echo "configure: error: Unable to locate cc(1) or suitable replacement.  Check PATH or set CC." 1>&2; exit 1; }
2697         fi
2698 fi
2699
2700 if test -z "${AR}"; then
2701         for ac_prog in ar gar
2702 do
2703 # Extract the first word of "$ac_prog", so it can be a program name with args.
2704 set dummy $ac_prog; ac_word=$2
2705 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2706 echo "configure:2707: checking for $ac_word" >&5
2707 if eval "test \"\${ac_cv_prog_AR+set}\" = set"; then
2708   echo $ac_n "(cached) $ac_c" 1>&6
2709 else
2710   if test -n "$AR"; then
2711   ac_cv_prog_AR="$AR" # Let the user override the test.
2712 else
2713   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2714   ac_dummy="$PATH"
2715   for ac_dir in $ac_dummy; do
2716     test -z "$ac_dir" && ac_dir=.
2717     if test -f $ac_dir/$ac_word; then
2718       ac_cv_prog_AR="$ac_prog"
2719       break
2720     fi
2721   done
2722   IFS="$ac_save_ifs"
2723 fi
2724 fi
2725 AR="$ac_cv_prog_AR"
2726 if test -n "$AR"; then
2727   echo "$ac_t""$AR" 1>&6
2728 else
2729   echo "$ac_t""no" 1>&6
2730 fi
2731
2732 test -n "$AR" && break
2733 done
2734 test -n "$AR" || AR="missing"
2735
2736
2737         if test "${AR}" = "missing" ; then
2738                 { echo "configure: error: Unable to locate ar(1) or suitable replacement.  Check PATH or set AR." 1>&2; exit 1; }
2739         fi
2740 fi
2741
2742
2743
2744 # Find the correct PATH separator.  Usually this is `:', but
2745 # DJGPP uses `;' like DOS.
2746 if test "X${PATH_SEPARATOR+set}" != Xset; then
2747   UNAME=${UNAME-`uname 2>/dev/null`}
2748   case X$UNAME in
2749     *-DOS) lt_cv_sys_path_separator=';' ;;
2750     *)     lt_cv_sys_path_separator=':' ;;
2751   esac
2752   PATH_SEPARATOR=$lt_cv_sys_path_separator
2753 fi
2754
2755 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
2756 echo "configure:2757: checking for Cygwin environment" >&5
2757 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
2758   echo $ac_n "(cached) $ac_c" 1>&6
2759 else
2760   cat > conftest.$ac_ext <<EOF
2761 #line 2762 "configure"
2762 #include "confdefs.h"
2763
2764 int main() {
2765
2766 #ifndef __CYGWIN__
2767 #define __CYGWIN__ __CYGWIN32__
2768 #endif
2769 return __CYGWIN__;
2770 ; return 0; }
2771 EOF
2772 if { (eval echo configure:2773: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2773   rm -rf conftest*
2774   ac_cv_cygwin=yes
2775 else
2776   echo "configure: failed program was:" >&5
2777   cat conftest.$ac_ext >&5
2778   rm -rf conftest*
2779   ac_cv_cygwin=no
2780 fi
2781 rm -f conftest*
2782 fi
2783
2784 echo "$ac_t""$ac_cv_cygwin" 1>&6
2785 CYGWIN=
2786 test "$ac_cv_cygwin" = yes && CYGWIN=yes
2787 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
2788 echo "configure:2789: checking for mingw32 environment" >&5
2789 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
2790   echo $ac_n "(cached) $ac_c" 1>&6
2791 else
2792   cat > conftest.$ac_ext <<EOF
2793 #line 2794 "configure"
2794 #include "confdefs.h"
2795
2796 int main() {
2797 return __MINGW32__;
2798 ; return 0; }
2799 EOF
2800 if { (eval echo configure:2801: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2801   rm -rf conftest*
2802   ac_cv_mingw32=yes
2803 else
2804   echo "configure: failed program was:" >&5
2805   cat conftest.$ac_ext >&5
2806   rm -rf conftest*
2807   ac_cv_mingw32=no
2808 fi
2809 rm -f conftest*
2810 fi
2811
2812 echo "$ac_t""$ac_cv_mingw32" 1>&6
2813 MINGW32=
2814 test "$ac_cv_mingw32" = yes && MINGW32=yes
2815 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
2816 echo "configure:2817: checking for EMX OS/2 environment" >&5
2817 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
2818   echo $ac_n "(cached) $ac_c" 1>&6
2819 else
2820   cat > conftest.$ac_ext <<EOF
2821 #line 2822 "configure"
2822 #include "confdefs.h"
2823
2824 int main() {
2825 return __EMX__;
2826 ; return 0; }
2827 EOF
2828 if { (eval echo configure:2829: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2829   rm -rf conftest*
2830   ac_cv_emxos2=yes
2831 else
2832   echo "configure: failed program was:" >&5
2833   cat conftest.$ac_ext >&5
2834   rm -rf conftest*
2835   ac_cv_emxos2=no
2836 fi
2837 rm -f conftest*
2838 fi
2839
2840 echo "$ac_t""$ac_cv_emxos2" 1>&6
2841 EMXOS2=
2842 test "$ac_cv_emxos2" = yes && EMXOS2=yes
2843 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2844 echo "configure:2845: checking how to run the C preprocessor" >&5
2845 # On Suns, sometimes $CPP names a directory.
2846 if test -n "$CPP" && test -d "$CPP"; then
2847   CPP=
2848 fi
2849 if test -z "$CPP"; then
2850 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
2851   echo $ac_n "(cached) $ac_c" 1>&6
2852 else
2853     # This must be in double quotes, not single quotes, because CPP may get
2854   # substituted into the Makefile and "${CC-cc}" will confuse make.
2855   CPP="${CC-cc} -E"
2856   # On the NeXT, cc -E runs the code through the compiler's parser,
2857   # not just through cpp.
2858   cat > conftest.$ac_ext <<EOF
2859 #line 2860 "configure"
2860 #include "confdefs.h"
2861 #include <assert.h>
2862 Syntax Error
2863 EOF
2864 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2865 { (eval echo configure:2866: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2866 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2867 if test -z "$ac_err"; then
2868   :
2869 else
2870   echo "$ac_err" >&5
2871   echo "configure: failed program was:" >&5
2872   cat conftest.$ac_ext >&5
2873   rm -rf conftest*
2874   CPP="${CC-cc} -E -traditional-cpp"
2875   cat > conftest.$ac_ext <<EOF
2876 #line 2877 "configure"
2877 #include "confdefs.h"
2878 #include <assert.h>
2879 Syntax Error
2880 EOF
2881 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2882 { (eval echo configure:2883: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2883 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2884 if test -z "$ac_err"; then
2885   :
2886 else
2887   echo "$ac_err" >&5
2888   echo "configure: failed program was:" >&5
2889   cat conftest.$ac_ext >&5
2890   rm -rf conftest*
2891   CPP="${CC-cc} -nologo -E"
2892   cat > conftest.$ac_ext <<EOF
2893 #line 2894 "configure"
2894 #include "confdefs.h"
2895 #include <assert.h>
2896 Syntax Error
2897 EOF
2898 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2899 { (eval echo configure:2900: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2900 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2901 if test -z "$ac_err"; then
2902   :
2903 else
2904   echo "$ac_err" >&5
2905   echo "configure: failed program was:" >&5
2906   cat conftest.$ac_ext >&5
2907   rm -rf conftest*
2908   CPP=/lib/cpp
2909 fi
2910 rm -f conftest*
2911 fi
2912 rm -f conftest*
2913 fi
2914 rm -f conftest*
2915   ac_cv_prog_CPP="$CPP"
2916 fi
2917   CPP="$ac_cv_prog_CPP"
2918 else
2919   ac_cv_prog_CPP="$CPP"
2920 fi
2921 echo "$ac_t""$CPP" 1>&6
2922
2923 # Check whether --enable-fast-install or --disable-fast-install was given.
2924 if test "${enable_fast_install+set}" = set; then
2925   enableval="$enable_fast_install"
2926   p=${PACKAGE-default}
2927 case $enableval in
2928 yes) enable_fast_install=yes ;;
2929 no) enable_fast_install=no ;;
2930 *)
2931   enable_fast_install=no
2932   # Look at the argument we got.  We use all the common list separators.
2933   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2934   for pkg in $enableval; do
2935     if test "X$pkg" = "X$p"; then
2936       enable_fast_install=yes
2937     fi
2938   done
2939   IFS="$ac_save_ifs"
2940   ;;
2941 esac
2942 else
2943   enable_fast_install=yes
2944 fi
2945
2946 # Extract the first word of "gcc", so it can be a program name with args.
2947 set dummy gcc; ac_word=$2
2948 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2949 echo "configure:2950: checking for $ac_word" >&5
2950 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2951   echo $ac_n "(cached) $ac_c" 1>&6
2952 else
2953   if test -n "$CC"; then
2954   ac_cv_prog_CC="$CC" # Let the user override the test.
2955 else
2956   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2957   ac_dummy="$PATH"
2958   for ac_dir in $ac_dummy; do
2959     test -z "$ac_dir" && ac_dir=.
2960     if test -f $ac_dir/$ac_word; then
2961       ac_cv_prog_CC="gcc"
2962       break
2963     fi
2964   done
2965   IFS="$ac_save_ifs"
2966 fi
2967 fi
2968 CC="$ac_cv_prog_CC"
2969 if test -n "$CC"; then
2970   echo "$ac_t""$CC" 1>&6
2971 else
2972   echo "$ac_t""no" 1>&6
2973 fi
2974
2975 if test -z "$CC"; then
2976   # Extract the first word of "cc", so it can be a program name with args.
2977 set dummy cc; ac_word=$2
2978 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2979 echo "configure:2980: checking for $ac_word" >&5
2980 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2981   echo $ac_n "(cached) $ac_c" 1>&6
2982 else
2983   if test -n "$CC"; then
2984   ac_cv_prog_CC="$CC" # Let the user override the test.
2985 else
2986   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2987   ac_prog_rejected=no
2988   ac_dummy="$PATH"
2989   for ac_dir in $ac_dummy; do
2990     test -z "$ac_dir" && ac_dir=.
2991     if test -f $ac_dir/$ac_word; then
2992       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2993         ac_prog_rejected=yes
2994         continue
2995       fi
2996       ac_cv_prog_CC="cc"
2997       break
2998     fi
2999   done
3000   IFS="$ac_save_ifs"
3001 if test $ac_prog_rejected = yes; then
3002   # We found a bogon in the path, so make sure we never use it.
3003   set dummy $ac_cv_prog_CC
3004   shift
3005   if test $# -gt 0; then
3006     # We chose a different compiler from the bogus one.
3007     # However, it has the same basename, so the bogon will be chosen
3008     # first if we set CC to just the basename; use the full file name.
3009     shift
3010     set dummy "$ac_dir/$ac_word" "$@"
3011     shift
3012     ac_cv_prog_CC="$@"
3013   fi
3014 fi
3015 fi
3016 fi
3017 CC="$ac_cv_prog_CC"
3018 if test -n "$CC"; then
3019   echo "$ac_t""$CC" 1>&6
3020 else
3021   echo "$ac_t""no" 1>&6
3022 fi
3023
3024   if test -z "$CC"; then
3025     case "`uname -s`" in
3026     *win32* | *WIN32* | *CYGWIN*)
3027       # Extract the first word of "cl", so it can be a program name with args.
3028 set dummy cl; ac_word=$2
3029 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3030 echo "configure:3031: checking for $ac_word" >&5
3031 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3032   echo $ac_n "(cached) $ac_c" 1>&6
3033 else
3034   if test -n "$CC"; then
3035   ac_cv_prog_CC="$CC" # Let the user override the test.
3036 else
3037   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3038   ac_dummy="$PATH"
3039   for ac_dir in $ac_dummy; do
3040     test -z "$ac_dir" && ac_dir=.
3041     if test -f $ac_dir/$ac_word; then
3042       ac_cv_prog_CC="cl"
3043       break
3044     fi
3045   done
3046   IFS="$ac_save_ifs"
3047 fi
3048 fi
3049 CC="$ac_cv_prog_CC"
3050 if test -n "$CC"; then
3051   echo "$ac_t""$CC" 1>&6
3052 else
3053   echo "$ac_t""no" 1>&6
3054 fi
3055  ;;
3056     esac
3057   fi
3058   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
3059 fi
3060
3061 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
3062 echo "configure:3063: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
3063
3064 ac_ext=c
3065 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3066 ac_cpp='$CPP $CPPFLAGS'
3067 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3068 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3069 cross_compiling=$ac_cv_prog_cc_cross
3070
3071 cat > conftest.$ac_ext << EOF
3072
3073 #line 3074 "configure"
3074 #include "confdefs.h"
3075
3076 main(){return(0);}
3077 EOF
3078 if { (eval echo configure:3079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3079   ac_cv_prog_cc_works=yes
3080   # If we can't run a trivial program, we are probably using a cross compiler.
3081   if (./conftest; exit) 2>/dev/null; then
3082     ac_cv_prog_cc_cross=no
3083   else
3084     ac_cv_prog_cc_cross=yes
3085   fi
3086 else
3087   echo "configure: failed program was:" >&5
3088   cat conftest.$ac_ext >&5
3089   ac_cv_prog_cc_works=no
3090 fi
3091 rm -fr conftest*
3092 ac_ext=c
3093 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3094 ac_cpp='$CPP $CPPFLAGS'
3095 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3096 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3097 cross_compiling=$ac_cv_prog_cc_cross
3098
3099 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
3100 if test $ac_cv_prog_cc_works = no; then
3101   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
3102 fi
3103 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
3104 echo "configure:3105: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
3105 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
3106 cross_compiling=$ac_cv_prog_cc_cross
3107
3108 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
3109 echo "configure:3110: checking whether we are using GNU C" >&5
3110 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
3111   echo $ac_n "(cached) $ac_c" 1>&6
3112 else
3113   cat > conftest.c <<EOF
3114 #ifdef __GNUC__
3115   yes;
3116 #endif
3117 EOF
3118 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3119: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
3119   ac_cv_prog_gcc=yes
3120 else
3121   ac_cv_prog_gcc=no
3122 fi
3123 fi
3124
3125 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
3126
3127 if test $ac_cv_prog_gcc = yes; then
3128   GCC=yes
3129 else
3130   GCC=
3131 fi
3132
3133 ac_test_CFLAGS="${CFLAGS+set}"
3134 ac_save_CFLAGS="$CFLAGS"
3135 CFLAGS=
3136 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
3137 echo "configure:3138: checking whether ${CC-cc} accepts -g" >&5
3138 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
3139   echo $ac_n "(cached) $ac_c" 1>&6
3140 else
3141   echo 'void f(){}' > conftest.c
3142 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
3143   ac_cv_prog_cc_g=yes
3144 else
3145   ac_cv_prog_cc_g=no
3146 fi
3147 rm -f conftest*
3148
3149 fi
3150
3151 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
3152 if test "$ac_test_CFLAGS" = set; then
3153   CFLAGS="$ac_save_CFLAGS"
3154 elif test $ac_cv_prog_cc_g = yes; then
3155   if test "$GCC" = yes; then
3156     CFLAGS="-g -O2"
3157   else
3158     CFLAGS="-g"
3159   fi
3160 else
3161   if test "$GCC" = yes; then
3162     CFLAGS="-O2"
3163   else
3164     CFLAGS=
3165   fi
3166 fi
3167
3168 # Check whether --with-gnu-ld or --without-gnu-ld was given.
3169 if test "${with_gnu_ld+set}" = set; then
3170   withval="$with_gnu_ld"
3171   test "$withval" = no || with_gnu_ld=yes
3172 else
3173   with_gnu_ld=no
3174 fi
3175
3176 ac_prog=ld
3177 if test "$GCC" = yes; then
3178   # Check if gcc -print-prog-name=ld gives a path.
3179   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
3180 echo "configure:3181: checking for ld used by GCC" >&5
3181   case $host in
3182   *-*-mingw*)
3183     # gcc leaves a trailing carriage return which upsets mingw
3184     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3185   *)
3186     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3187   esac
3188   case $ac_prog in
3189     # Accept absolute paths.
3190     [\\/]* | [A-Za-z]:[\\/]*)
3191       re_direlt='/[^/][^/]*/\.\./'
3192       # Canonicalize the path of ld
3193       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3194       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3195         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3196       done
3197       test -z "$LD" && LD="$ac_prog"
3198       ;;
3199   "")
3200     # If it fails, then pretend we aren't using GCC.
3201     ac_prog=ld
3202     ;;
3203   *)
3204     # If it is relative, then search for the first ld in PATH.
3205     with_gnu_ld=unknown
3206     ;;
3207   esac
3208 elif test "$with_gnu_ld" = yes; then
3209   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
3210 echo "configure:3211: checking for GNU ld" >&5
3211 else
3212   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
3213 echo "configure:3214: checking for non-GNU ld" >&5
3214 fi
3215 if eval "test \"\${lt_cv_path_LD+set}\" = set"; then
3216   echo $ac_n "(cached) $ac_c" 1>&6
3217 else
3218   if test -z "$LD"; then
3219   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3220   for ac_dir in $PATH; do
3221     test -z "$ac_dir" && ac_dir=.
3222     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3223       lt_cv_path_LD="$ac_dir/$ac_prog"
3224       # Check to see if the program is GNU ld.  I'd rather use --version,
3225       # but apparently some GNU ld's only accept -v.
3226       # Break only if it was the GNU/non-GNU ld that we prefer.
3227       if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3228         test "$with_gnu_ld" != no && break
3229       else
3230         test "$with_gnu_ld" != yes && break
3231       fi
3232     fi
3233   done
3234   IFS="$ac_save_ifs"
3235 else
3236   lt_cv_path_LD="$LD" # Let the user override the test with a path.
3237 fi
3238 fi
3239
3240 LD="$lt_cv_path_LD"
3241 if test -n "$LD"; then
3242   echo "$ac_t""$LD" 1>&6
3243 else
3244   echo "$ac_t""no" 1>&6
3245 fi
3246 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
3247 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
3248 echo "configure:3249: checking if the linker ($LD) is GNU ld" >&5
3249 if eval "test \"\${lt_cv_prog_gnu_ld+set}\" = set"; then
3250   echo $ac_n "(cached) $ac_c" 1>&6
3251 else
3252   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
3253 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3254   lt_cv_prog_gnu_ld=yes
3255 else
3256   lt_cv_prog_gnu_ld=no
3257 fi
3258 fi
3259
3260 echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
3261 with_gnu_ld=$lt_cv_prog_gnu_ld
3262
3263
3264 echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
3265 echo "configure:3266: checking for $LD option to reload object files" >&5
3266 if eval "test \"\${lt_cv_ld_reload_flag+set}\" = set"; then
3267   echo $ac_n "(cached) $ac_c" 1>&6
3268 else
3269   lt_cv_ld_reload_flag='-r'
3270 fi
3271
3272 echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6
3273 reload_flag=$lt_cv_ld_reload_flag
3274 test -n "$reload_flag" && reload_flag=" $reload_flag"
3275
3276 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
3277 echo "configure:3278: checking for BSD-compatible nm" >&5
3278 if eval "test \"\${lt_cv_path_NM+set}\" = set"; then
3279   echo $ac_n "(cached) $ac_c" 1>&6
3280 else
3281   if test -n "$NM"; then
3282   # Let the user override the test.
3283   lt_cv_path_NM="$NM"
3284 else
3285   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3286   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3287     test -z "$ac_dir" && ac_dir=.
3288     tmp_nm=$ac_dir/${ac_tool_prefix}nm
3289     if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
3290       # Check to see if the nm accepts a BSD-compat flag.
3291       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3292       #   nm: unknown option "B" ignored
3293       # Tru64's nm complains that /dev/null is an invalid object file
3294       if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
3295         lt_cv_path_NM="$tmp_nm -B"
3296         break
3297       elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3298         lt_cv_path_NM="$tmp_nm -p"
3299         break
3300       else
3301         lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3302         continue # so that we can try to find one that supports BSD flags
3303       fi
3304     fi
3305   done
3306   IFS="$ac_save_ifs"
3307   test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
3308 fi
3309 fi
3310
3311 NM="$lt_cv_path_NM"
3312 echo "$ac_t""$NM" 1>&6
3313
3314 echo $ac_n "checking for a sed that does not truncate output""... $ac_c" 1>&6
3315 echo "configure:3316: checking for a sed that does not truncate output" >&5
3316 if eval "test \"\${lt_cv_path_SED+set}\" = set"; then
3317   echo $ac_n "(cached) $ac_c" 1>&6
3318 else
3319   # Loop through the user's path and test for sed and gsed.
3320 # Then use that list of sed's as ones to test for truncation.
3321 as_executable_p="test -f"
3322 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3323 for as_dir in $PATH
3324 do
3325   IFS=$as_save_IFS
3326   test -z "$as_dir" && as_dir=.
3327   for ac_prog in sed gsed; do
3328     for ac_exec_ext in '' $ac_executable_extensions; do
3329       if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
3330         _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
3331       fi
3332     done
3333   done
3334 done
3335
3336   # Create a temporary directory, and hook for its removal unless debugging.
3337 $debug ||
3338 {
3339   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
3340   trap '{ (exit 1); exit 1; }' 1 2 13 15
3341 }
3342
3343 # Create a (secure) tmp directory for tmp files.
3344 : ${TMPDIR=/tmp}
3345 {
3346   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
3347   test -n "$tmp" && test -d "$tmp"
3348 }  ||
3349 {
3350   tmp=$TMPDIR/sed$$-$RANDOM
3351   (umask 077 && mkdir $tmp)
3352 } ||
3353 {
3354    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
3355    { (exit 1); exit 1; }
3356 }
3357   _max=0
3358   _count=0
3359   # Add /usr/xpg4/bin/sed as it is typically found on Solaris
3360   # along with /bin/sed that truncates output.
3361   for _sed in $_sed_list /usr/xpg4/bin/sed; do
3362     test ! -f ${_sed} && break
3363     cat /dev/null > "$tmp/sed.in"
3364     _count=0
3365     echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
3366     # Check for GNU sed and select it if it is found.
3367     if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
3368       lt_cv_path_SED=${_sed}
3369       break
3370     fi
3371     while true; do
3372       cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
3373       mv "$tmp/sed.tmp" "$tmp/sed.in"
3374       cp "$tmp/sed.in" "$tmp/sed.nl"
3375       echo >>"$tmp/sed.nl"
3376       ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
3377       cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
3378       # 40000 chars as input seems more than enough
3379       test $_count -gt 10 && break
3380       _count=`expr $_count + 1`
3381       if test $_count -gt $_max; then
3382         _max=$_count
3383         lt_cv_path_SED=$_sed
3384       fi
3385     done
3386   done
3387   rm -rf "$tmp"
3388
3389 fi
3390
3391 if test "X$SED" != "X"; then
3392   lt_cv_path_SED=$SED
3393 else
3394   SED=$lt_cv_path_SED
3395 fi
3396 echo "$ac_t""$SED" 1>&6
3397
3398 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3399 echo "configure:3400: checking whether ln -s works" >&5
3400 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3401   echo $ac_n "(cached) $ac_c" 1>&6
3402 else
3403   rm -f conftestdata
3404 if ln -s X conftestdata 2>/dev/null
3405 then
3406   rm -f conftestdata
3407   ac_cv_prog_LN_S="ln -s"
3408 else
3409   ac_cv_prog_LN_S=ln
3410 fi
3411 fi
3412 LN_S="$ac_cv_prog_LN_S"
3413 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3414   echo "$ac_t""yes" 1>&6
3415 else
3416   echo "$ac_t""no" 1>&6
3417 fi
3418
3419 echo $ac_n "checking how to recognise dependent libraries""... $ac_c" 1>&6
3420 echo "configure:3421: checking how to recognise dependent libraries" >&5
3421 if eval "test \"\${lt_cv_deplibs_check_method+set}\" = set"; then
3422   echo $ac_n "(cached) $ac_c" 1>&6
3423 else
3424   lt_cv_file_magic_cmd='$MAGIC_CMD'
3425 lt_cv_file_magic_test_file=
3426 lt_cv_deplibs_check_method='unknown'
3427 # Need to set the preceding variable on all platforms that support
3428 # interlibrary dependencies.
3429 # 'none' -- dependencies not supported.
3430 # `unknown' -- same as none, but documents that we really don't know.
3431 # 'pass_all' -- all dependencies passed with no checks.
3432 # 'test_compile' -- check by making test program.
3433 # 'file_magic [[regex]]' -- check by looking for files in library path
3434 # which responds to the $file_magic_cmd with a given egrep regex.
3435 # If you have `file' or equivalent on your system and you're not sure
3436 # whether `pass_all' will *always* work, you probably want this one.
3437
3438 case $host_os in
3439 aix4* | aix5*)
3440   lt_cv_deplibs_check_method=pass_all
3441   ;;
3442
3443 beos*)
3444   lt_cv_deplibs_check_method=pass_all
3445   ;;
3446
3447 bsdi4*)
3448   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
3449   lt_cv_file_magic_cmd='/usr/bin/file -L'
3450   lt_cv_file_magic_test_file=/shlib/libc.so
3451   ;;
3452
3453 cygwin* | mingw* | pw32*)
3454   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3455   lt_cv_file_magic_cmd='$OBJDUMP -f'
3456   ;;
3457
3458 darwin* | rhapsody*)
3459   lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
3460   lt_cv_file_magic_cmd='/usr/bin/file -L'
3461   case "$host_os" in
3462   rhapsody* | darwin1.[012])
3463     lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
3464     ;;
3465   *) # Darwin 1.3 on
3466     lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
3467     ;;
3468   esac
3469   ;;
3470
3471 freebsd*)
3472   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3473     case $host_cpu in
3474     i*86 )
3475       # Not sure whether the presence of OpenBSD here was a mistake.
3476       # Let's accept both of them until this is cleared up.
3477       lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
3478       lt_cv_file_magic_cmd=/usr/bin/file
3479       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3480       ;;
3481     esac
3482   else
3483     lt_cv_deplibs_check_method=pass_all
3484   fi
3485   ;;
3486
3487 gnu*)
3488   lt_cv_deplibs_check_method=pass_all
3489   ;;
3490
3491 hpux10.20*|hpux11*)
3492   lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
3493   lt_cv_file_magic_cmd=/usr/bin/file
3494   lt_cv_file_magic_test_file=/usr/lib/libc.sl
3495   ;;
3496
3497 irix5* | irix6* | nonstopux*)
3498   case $host_os in
3499   irix5* | nonstopux*)
3500     # this will be overridden with pass_all, but let us keep it just in case
3501     lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
3502     ;;
3503   *)
3504     case $LD in
3505     *-32|*"-32 ") libmagic=32-bit;;
3506     *-n32|*"-n32 ") libmagic=N32;;
3507     *-64|*"-64 ") libmagic=64-bit;;
3508     *) libmagic=never-match;;
3509     esac
3510     # this will be overridden with pass_all, but let us keep it just in case
3511     lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
3512     ;;
3513   esac
3514   lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
3515   lt_cv_deplibs_check_method=pass_all
3516   ;;
3517
3518 # This must be Linux ELF.
3519 linux-gnu*)
3520   case $host_cpu in
3521   alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64*)
3522     lt_cv_deplibs_check_method=pass_all ;;
3523   *)
3524     # glibc up to 2.1.1 does not perform some relocations on ARM
3525     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
3526   esac
3527   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
3528   ;;
3529
3530 netbsd*)
3531   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3532     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
3533   else
3534     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
3535   fi
3536   ;;
3537
3538 newos6*)
3539   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
3540   lt_cv_file_magic_cmd=/usr/bin/file
3541   lt_cv_file_magic_test_file=/usr/lib/libnls.so
3542   ;;
3543
3544 openbsd*)
3545   lt_cv_file_magic_cmd=/usr/bin/file
3546   lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3547   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3548     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
3549   else
3550     lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
3551   fi
3552   ;;
3553
3554 openedition*)
3555   lt_cv_deplibs_check_method=pass_all
3556   ;;
3557
3558 osf3* | osf4* | osf5*)
3559   # this will be overridden with pass_all, but let us keep it just in case
3560   lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
3561   lt_cv_file_magic_test_file=/shlib/libc.so
3562   lt_cv_deplibs_check_method=pass_all
3563   ;;
3564
3565 sco3.2v5*)
3566   lt_cv_deplibs_check_method=pass_all
3567   ;;
3568
3569 solaris*)
3570   lt_cv_deplibs_check_method=pass_all
3571   lt_cv_file_magic_test_file=/lib/libc.so
3572   ;;
3573
3574 sysv5uw[78]* | sysv4*uw2*)
3575   lt_cv_deplibs_check_method=pass_all
3576   ;;
3577
3578 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
3579   case $host_vendor in
3580   motorola)
3581     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]'
3582     lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3583     ;;
3584   ncr)
3585     lt_cv_deplibs_check_method=pass_all
3586     ;;
3587   sequent)
3588     lt_cv_file_magic_cmd='/bin/file'
3589     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
3590     ;;
3591   sni)
3592     lt_cv_file_magic_cmd='/bin/file'
3593     lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
3594     lt_cv_file_magic_test_file=/lib/libc.so
3595     ;;
3596   siemens)
3597     lt_cv_deplibs_check_method=pass_all
3598     ;;
3599   esac
3600   ;;
3601 esac
3602
3603 fi
3604
3605 echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6
3606 file_magic_cmd=$lt_cv_file_magic_cmd
3607 deplibs_check_method=$lt_cv_deplibs_check_method
3608
3609 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
3610 echo "configure:3611: checking for object suffix" >&5
3611 if eval "test \"\${ac_cv_objext+set}\" = set"; then
3612   echo $ac_n "(cached) $ac_c" 1>&6
3613 else
3614   rm -f conftest*
3615 echo 'int i = 1;' > conftest.$ac_ext
3616 if { (eval echo configure:3617: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3617   for ac_file in conftest.*; do
3618     case $ac_file in
3619     *.c) ;;
3620     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
3621     esac
3622   done
3623 else
3624   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
3625 fi
3626 rm -f conftest*
3627 fi
3628
3629 echo "$ac_t""$ac_cv_objext" 1>&6
3630 OBJEXT=$ac_cv_objext
3631 ac_objext=$ac_cv_objext
3632
3633
3634
3635
3636 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
3637 echo "configure:3638: checking for executable suffix" >&5
3638 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
3639   echo $ac_n "(cached) $ac_c" 1>&6
3640 else
3641   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
3642   ac_cv_exeext=.exe
3643 else
3644   rm -f conftest*
3645   echo 'int main () { return 0; }' > conftest.$ac_ext
3646   ac_cv_exeext=
3647   if { (eval echo configure:3648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
3648     for file in conftest.*; do
3649       case $file in
3650       *.c | *.C | *.o | *.obj | *.xcoff) ;;
3651       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
3652       esac
3653     done
3654   else
3655     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
3656   fi
3657   rm -f conftest*
3658   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
3659 fi
3660 fi
3661
3662 EXEEXT=""
3663 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
3664 echo "$ac_t""${ac_cv_exeext}" 1>&6
3665 ac_exeext=$EXEEXT
3666
3667 if test $host != $build; then
3668   ac_tool_prefix=${host_alias}-
3669 else
3670   ac_tool_prefix=
3671 fi
3672
3673
3674
3675
3676 # Check for command to grab the raw symbol name followed by C symbol from nm.
3677 echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
3678 echo "configure:3679: checking command to parse $NM output" >&5
3679 if eval "test \"\${lt_cv_sys_global_symbol_pipe+set}\" = set"; then
3680   echo $ac_n "(cached) $ac_c" 1>&6
3681 else
3682   
3683 # These are sane defaults that work on at least a few old systems.
3684 # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3685
3686 # Character class describing NM global symbol codes.
3687 symcode='[BCDEGRST]'
3688
3689 # Regexp to match symbols that can be accessed directly from C.
3690 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
3691
3692 # Transform the above into a raw symbol and a C symbol.
3693 symxfrm='\1 \2\3 \3'
3694
3695 # Transform an extracted symbol line into a proper C declaration
3696 lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
3697
3698 # Transform an extracted symbol line into symbol name and symbol address
3699 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'"
3700
3701 # Define system-specific variables.
3702 case $host_os in
3703 aix*)
3704   symcode='[BCDT]'
3705   ;;
3706 cygwin* | mingw* | pw32*)
3707   symcode='[ABCDGISTW]'
3708   ;;
3709 hpux*) # Its linker distinguishes data from code symbols
3710   lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3711   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'"
3712   ;;
3713 irix* | nonstopux*)
3714   symcode='[BCDEGRST]'
3715   ;;
3716 osf*)
3717   symcode='[BCDEGQRST]'
3718   ;;
3719 solaris* | sysv5*)
3720   symcode='[BDT]'
3721   ;;
3722 sysv4)
3723   symcode='[DFNSTU]'
3724   ;;
3725 esac
3726
3727 # Handle CRLF in mingw tool chain
3728 opt_cr=
3729 case $host_os in
3730 mingw*)
3731   opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
3732   ;;
3733 esac
3734
3735 # If we're using GNU nm, then use its standard symbol codes.
3736 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
3737   symcode='[ABCDGISTW]'
3738 fi
3739
3740 # Try without a prefix undercore, then with it.
3741 for ac_symprfx in "" "_"; do
3742
3743   # Write the raw and C identifiers.
3744 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[         ]\($symcode$symcode*\)[         ][      ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
3745
3746   # Check to see that the pipe works correctly.
3747   pipe_works=no
3748   rm -f conftest*
3749   cat > conftest.$ac_ext <<EOF
3750 #ifdef __cplusplus
3751 extern "C" {
3752 #endif
3753 char nm_test_var;
3754 void nm_test_func(){}
3755 #ifdef __cplusplus
3756 }
3757 #endif
3758 int main(){nm_test_var='a';nm_test_func();return(0);}
3759 EOF
3760
3761   if { (eval echo configure:3762: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3762     # Now try to grab the symbols.
3763     nlist=conftest.nm
3764     if { (eval echo configure:3765: \"$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
3765       # Try sorting and uniquifying the output.
3766       if sort "$nlist" | uniq > "$nlist"T; then
3767         mv -f "$nlist"T "$nlist"
3768       else
3769         rm -f "$nlist"T
3770       fi
3771
3772       # Make sure that we snagged all the symbols we need.
3773       if egrep ' nm_test_var$' "$nlist" >/dev/null; then
3774         if egrep ' nm_test_func$' "$nlist" >/dev/null; then
3775           cat <<EOF > conftest.$ac_ext
3776 #ifdef __cplusplus
3777 extern "C" {
3778 #endif
3779
3780 EOF
3781           # Now generate the symbol file.
3782           eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
3783
3784           cat <<EOF >> conftest.$ac_ext
3785 #if defined (__STDC__) && __STDC__
3786 # define lt_ptr void *
3787 #else
3788 # define lt_ptr char *
3789 # define const
3790 #endif
3791
3792 /* The mapping between symbol names and symbols. */
3793 const struct {
3794   const char *name;
3795   lt_ptr address;
3796 }
3797 lt_preloaded_symbols[] =
3798 {
3799 EOF
3800           sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
3801           cat <<\EOF >> conftest.$ac_ext
3802   {0, (lt_ptr) 0}
3803 };
3804
3805 #ifdef __cplusplus
3806 }
3807 #endif
3808 EOF
3809           # Now try linking the two files.
3810           mv conftest.$ac_objext conftstm.$ac_objext
3811           save_LIBS="$LIBS"
3812           save_CFLAGS="$CFLAGS"
3813           LIBS="conftstm.$ac_objext"
3814           CFLAGS="$CFLAGS$no_builtin_flag"
3815           if { (eval echo configure:3816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest$ac_exeext; then
3816             pipe_works=yes
3817           fi
3818           LIBS="$save_LIBS"
3819           CFLAGS="$save_CFLAGS"
3820         else
3821           echo "cannot find nm_test_func in $nlist" >&5
3822         fi
3823       else
3824         echo "cannot find nm_test_var in $nlist" >&5
3825       fi
3826     else
3827       echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
3828     fi
3829   else
3830     echo "$progname: failed program was:" >&5
3831     cat conftest.$ac_ext >&5
3832   fi
3833   rm -f conftest* conftst*
3834
3835   # Do not use the global_symbol_pipe unless it works.
3836   if test "$pipe_works" = yes; then
3837     break
3838   else
3839     lt_cv_sys_global_symbol_pipe=
3840   fi
3841 done
3842
3843 fi
3844
3845 global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
3846 if test -z "$lt_cv_sys_global_symbol_pipe"; then
3847   global_symbol_to_cdecl=
3848   global_symbol_to_c_name_address=
3849 else
3850   global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
3851   global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
3852 fi
3853 if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
3854 then
3855   echo "$ac_t""failed" 1>&6
3856 else
3857   echo "$ac_t""ok" 1>&6
3858 fi
3859
3860 for ac_hdr in dlfcn.h
3861 do
3862 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3863 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3864 echo "configure:3865: checking for $ac_hdr" >&5
3865 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3866   echo $ac_n "(cached) $ac_c" 1>&6
3867 else
3868   cat > conftest.$ac_ext <<EOF
3869 #line 3870 "configure"
3870 #include "confdefs.h"
3871 #include <$ac_hdr>
3872 EOF
3873 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3874 { (eval echo configure:3875: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3875 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3876 if test -z "$ac_err"; then
3877   rm -rf conftest*
3878   eval "ac_cv_header_$ac_safe=yes"
3879 else
3880   echo "$ac_err" >&5
3881   echo "configure: failed program was:" >&5
3882   cat conftest.$ac_ext >&5
3883   rm -rf conftest*
3884   eval "ac_cv_header_$ac_safe=no"
3885 fi
3886 rm -f conftest*
3887 fi
3888 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3889   echo "$ac_t""yes" 1>&6
3890     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3891   cat >> confdefs.h <<EOF
3892 #define $ac_tr_hdr 1
3893 EOF
3894  
3895 else
3896   echo "$ac_t""no" 1>&6
3897 fi
3898 done
3899
3900
3901
3902
3903
3904
3905 # Only perform the check for file, if the check method requires it
3906 case $deplibs_check_method in
3907 file_magic*)
3908   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
3909     echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
3910 echo "configure:3911: checking for ${ac_tool_prefix}file" >&5
3911 if eval "test \"\${lt_cv_path_MAGIC_CMD+set}\" = set"; then
3912   echo $ac_n "(cached) $ac_c" 1>&6
3913 else
3914   case $MAGIC_CMD in
3915   /*)
3916   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
3917   ;;
3918   ?:/*)
3919   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
3920   ;;
3921   *)
3922   ac_save_MAGIC_CMD="$MAGIC_CMD"
3923   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3924   ac_dummy="/usr/bin:$PATH"
3925   for ac_dir in $ac_dummy; do
3926     test -z "$ac_dir" && ac_dir=.
3927     if test -f $ac_dir/${ac_tool_prefix}file; then
3928       lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
3929       if test -n "$file_magic_test_file"; then
3930         case $deplibs_check_method in
3931         "file_magic "*)
3932           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
3933           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3934           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3935             egrep "$file_magic_regex" > /dev/null; then
3936             :
3937           else
3938             cat <<EOF 1>&2
3939
3940 *** Warning: the command libtool uses to detect shared libraries,
3941 *** $file_magic_cmd, produces output that libtool cannot recognize.
3942 *** The result is that libtool may fail to recognize shared libraries
3943 *** as such.  This will affect the creation of libtool libraries that
3944 *** depend on shared libraries, but programs linked with such libtool
3945 *** libraries will work regardless of this problem.  Nevertheless, you
3946 *** may want to report the problem to your system manager and/or to
3947 *** bug-libtool@gnu.org
3948
3949 EOF
3950           fi ;;
3951         esac
3952       fi
3953       break
3954     fi
3955   done
3956   IFS="$ac_save_ifs"
3957   MAGIC_CMD="$ac_save_MAGIC_CMD"
3958   ;;
3959 esac
3960 fi
3961
3962 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3963 if test -n "$MAGIC_CMD"; then
3964   echo "$ac_t""$MAGIC_CMD" 1>&6
3965 else
3966   echo "$ac_t""no" 1>&6
3967 fi
3968
3969 if test -z "$lt_cv_path_MAGIC_CMD"; then
3970   if test -n "$ac_tool_prefix"; then
3971     echo $ac_n "checking for file""... $ac_c" 1>&6
3972 echo "configure:3973: checking for file" >&5
3973 if eval "test \"\${lt_cv_path_MAGIC_CMD+set}\" = set"; then
3974   echo $ac_n "(cached) $ac_c" 1>&6
3975 else
3976   case $MAGIC_CMD in
3977   /*)
3978   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
3979   ;;
3980   ?:/*)
3981   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
3982   ;;
3983   *)
3984   ac_save_MAGIC_CMD="$MAGIC_CMD"
3985   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3986   ac_dummy="/usr/bin:$PATH"
3987   for ac_dir in $ac_dummy; do
3988     test -z "$ac_dir" && ac_dir=.
3989     if test -f $ac_dir/file; then
3990       lt_cv_path_MAGIC_CMD="$ac_dir/file"
3991       if test -n "$file_magic_test_file"; then
3992         case $deplibs_check_method in
3993         "file_magic "*)
3994           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
3995           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3996           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3997             egrep "$file_magic_regex" > /dev/null; then
3998             :
3999           else
4000             cat <<EOF 1>&2
4001
4002 *** Warning: the command libtool uses to detect shared libraries,
4003 *** $file_magic_cmd, produces output that libtool cannot recognize.
4004 *** The result is that libtool may fail to recognize shared libraries
4005 *** as such.  This will affect the creation of libtool libraries that
4006 *** depend on shared libraries, but programs linked with such libtool
4007 *** libraries will work regardless of this problem.  Nevertheless, you
4008 *** may want to report the problem to your system manager and/or to
4009 *** bug-libtool@gnu.org
4010
4011 EOF
4012           fi ;;
4013         esac
4014       fi
4015       break
4016     fi
4017   done
4018   IFS="$ac_save_ifs"
4019   MAGIC_CMD="$ac_save_MAGIC_CMD"
4020   ;;
4021 esac
4022 fi
4023
4024 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4025 if test -n "$MAGIC_CMD"; then
4026   echo "$ac_t""$MAGIC_CMD" 1>&6
4027 else
4028   echo "$ac_t""no" 1>&6
4029 fi
4030
4031   else
4032     MAGIC_CMD=:
4033   fi
4034 fi
4035
4036   fi
4037   ;;
4038 esac
4039
4040 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
4041 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
4042 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4043 echo "configure:4044: checking for $ac_word" >&5
4044 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
4045   echo $ac_n "(cached) $ac_c" 1>&6
4046 else
4047   if test -n "$RANLIB"; then
4048   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
4049 else
4050   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4051   ac_dummy="$PATH"
4052   for ac_dir in $ac_dummy; do
4053     test -z "$ac_dir" && ac_dir=.
4054     if test -f $ac_dir/$ac_word; then
4055       ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
4056       break
4057     fi
4058   done
4059   IFS="$ac_save_ifs"
4060 fi
4061 fi
4062 RANLIB="$ac_cv_prog_RANLIB"
4063 if test -n "$RANLIB"; then
4064   echo "$ac_t""$RANLIB" 1>&6
4065 else
4066   echo "$ac_t""no" 1>&6
4067 fi
4068
4069
4070 if test -z "$ac_cv_prog_RANLIB"; then
4071 if test -n "$ac_tool_prefix"; then
4072   # Extract the first word of "ranlib", so it can be a program name with args.
4073 set dummy ranlib; ac_word=$2
4074 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4075 echo "configure:4076: checking for $ac_word" >&5
4076 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
4077   echo $ac_n "(cached) $ac_c" 1>&6
4078 else
4079   if test -n "$RANLIB"; then
4080   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
4081 else
4082   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4083   ac_dummy="$PATH"
4084   for ac_dir in $ac_dummy; do
4085     test -z "$ac_dir" && ac_dir=.
4086     if test -f $ac_dir/$ac_word; then
4087       ac_cv_prog_RANLIB="ranlib"
4088       break
4089     fi
4090   done
4091   IFS="$ac_save_ifs"
4092   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
4093 fi
4094 fi
4095 RANLIB="$ac_cv_prog_RANLIB"
4096 if test -n "$RANLIB"; then
4097   echo "$ac_t""$RANLIB" 1>&6
4098 else
4099   echo "$ac_t""no" 1>&6
4100 fi
4101
4102 else
4103   RANLIB=":"
4104 fi
4105 fi
4106
4107 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
4108 set dummy ${ac_tool_prefix}strip; ac_word=$2
4109 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4110 echo "configure:4111: checking for $ac_word" >&5
4111 if eval "test \"\${ac_cv_prog_STRIP+set}\" = set"; then
4112   echo $ac_n "(cached) $ac_c" 1>&6
4113 else
4114   if test -n "$STRIP"; then
4115   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
4116 else
4117   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4118   ac_dummy="$PATH"
4119   for ac_dir in $ac_dummy; do
4120     test -z "$ac_dir" && ac_dir=.
4121     if test -f $ac_dir/$ac_word; then
4122       ac_cv_prog_STRIP="${ac_tool_prefix}strip"
4123       break
4124     fi
4125   done
4126   IFS="$ac_save_ifs"
4127 fi
4128 fi
4129 STRIP="$ac_cv_prog_STRIP"
4130 if test -n "$STRIP"; then
4131   echo "$ac_t""$STRIP" 1>&6
4132 else
4133   echo "$ac_t""no" 1>&6
4134 fi
4135
4136
4137 if test -z "$ac_cv_prog_STRIP"; then
4138 if test -n "$ac_tool_prefix"; then
4139   # Extract the first word of "strip", so it can be a program name with args.
4140 set dummy strip; ac_word=$2
4141 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4142 echo "configure:4143: checking for $ac_word" >&5
4143 if eval "test \"\${ac_cv_prog_STRIP+set}\" = set"; then
4144   echo $ac_n "(cached) $ac_c" 1>&6
4145 else
4146   if test -n "$STRIP"; then
4147   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
4148 else
4149   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4150   ac_dummy="$PATH"
4151   for ac_dir in $ac_dummy; do
4152     test -z "$ac_dir" && ac_dir=.
4153     if test -f $ac_dir/$ac_word; then
4154       ac_cv_prog_STRIP="strip"
4155       break
4156     fi
4157   done
4158   IFS="$ac_save_ifs"
4159   test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
4160 fi
4161 fi
4162 STRIP="$ac_cv_prog_STRIP"
4163 if test -n "$STRIP"; then
4164   echo "$ac_t""$STRIP" 1>&6
4165 else
4166   echo "$ac_t""no" 1>&6
4167 fi
4168
4169 else
4170   STRIP=":"
4171 fi
4172 fi
4173
4174
4175 enable_dlopen=yes
4176 enable_win32_dll=yes
4177
4178 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
4179 if test "${enable_libtool_lock+set}" = set; then
4180   enableval="$enable_libtool_lock"
4181   :
4182 fi
4183
4184 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
4185
4186 # Some flags need to be propagated to the compiler or linker for good
4187 # libtool support.
4188 case $host in
4189 *-*-irix6*)
4190   # Find out which ABI we are using.
4191   echo '#line 4192 "configure"' > conftest.$ac_ext
4192   if { (eval echo configure:4193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4193     case `/usr/bin/file conftest.$ac_objext` in
4194     *32-bit*)
4195       LD="${LD-ld} -32"
4196       ;;
4197     *N32*)
4198       LD="${LD-ld} -n32"
4199       ;;
4200     *64-bit*)
4201       LD="${LD-ld} -64"
4202       ;;
4203     esac
4204   fi
4205   rm -rf conftest*
4206   ;;
4207
4208 *-*-sco3.2v5*)
4209   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
4210   SAVE_CFLAGS="$CFLAGS"
4211   CFLAGS="$CFLAGS -belf"
4212   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
4213 echo "configure:4214: checking whether the C compiler needs -belf" >&5
4214 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
4215   echo $ac_n "(cached) $ac_c" 1>&6
4216 else
4217   
4218      ac_ext=c
4219 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
4220 ac_cpp='$CPP $CPPFLAGS'
4221 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
4222 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
4223 cross_compiling=$ac_cv_prog_cc_cross
4224
4225      cat > conftest.$ac_ext <<EOF
4226 #line 4227 "configure"
4227 #include "confdefs.h"
4228
4229 int main() {
4230
4231 ; return 0; }
4232 EOF
4233 if { (eval echo configure:4234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4234   rm -rf conftest*
4235   lt_cv_cc_needs_belf=yes
4236 else
4237   echo "configure: failed program was:" >&5
4238   cat conftest.$ac_ext >&5
4239   rm -rf conftest*
4240   lt_cv_cc_needs_belf=no
4241 fi
4242 rm -f conftest*
4243      ac_ext=c
4244 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
4245 ac_cpp='$CPP $CPPFLAGS'
4246 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
4247 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
4248 cross_compiling=$ac_cv_prog_cc_cross
4249
4250 fi
4251
4252 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
4253   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
4254     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
4255     CFLAGS="$SAVE_CFLAGS"
4256   fi
4257   ;;
4258
4259 *-*-cygwin* | *-*-mingw* | *-*-pw32*)
4260   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
4261 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
4262 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4263 echo "configure:4264: checking for $ac_word" >&5
4264 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
4265   echo $ac_n "(cached) $ac_c" 1>&6
4266 else
4267   if test -n "$DLLTOOL"; then
4268   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
4269 else
4270   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4271   ac_dummy="$PATH"
4272   for ac_dir in $ac_dummy; do
4273     test -z "$ac_dir" && ac_dir=.
4274     if test -f $ac_dir/$ac_word; then
4275       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
4276       break
4277     fi
4278   done
4279   IFS="$ac_save_ifs"
4280 fi
4281 fi
4282 DLLTOOL="$ac_cv_prog_DLLTOOL"
4283 if test -n "$DLLTOOL"; then
4284   echo "$ac_t""$DLLTOOL" 1>&6
4285 else
4286   echo "$ac_t""no" 1>&6
4287 fi
4288
4289
4290 if test -z "$ac_cv_prog_DLLTOOL"; then
4291 if test -n "$ac_tool_prefix"; then
4292   # Extract the first word of "dlltool", so it can be a program name with args.
4293 set dummy dlltool; ac_word=$2
4294 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4295 echo "configure:4296: checking for $ac_word" >&5
4296 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
4297   echo $ac_n "(cached) $ac_c" 1>&6
4298 else
4299   if test -n "$DLLTOOL"; then
4300   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
4301 else
4302   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4303   ac_dummy="$PATH"
4304   for ac_dir in $ac_dummy; do
4305     test -z "$ac_dir" && ac_dir=.
4306     if test -f $ac_dir/$ac_word; then
4307       ac_cv_prog_DLLTOOL="dlltool"
4308       break
4309     fi
4310   done
4311   IFS="$ac_save_ifs"
4312   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
4313 fi
4314 fi
4315 DLLTOOL="$ac_cv_prog_DLLTOOL"
4316 if test -n "$DLLTOOL"; then
4317   echo "$ac_t""$DLLTOOL" 1>&6
4318 else
4319   echo "$ac_t""no" 1>&6
4320 fi
4321
4322 else
4323   DLLTOOL="false"
4324 fi
4325 fi
4326
4327   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
4328 set dummy ${ac_tool_prefix}as; ac_word=$2
4329 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4330 echo "configure:4331: checking for $ac_word" >&5
4331 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
4332   echo $ac_n "(cached) $ac_c" 1>&6
4333 else
4334   if test -n "$AS"; then
4335   ac_cv_prog_AS="$AS" # Let the user override the test.
4336 else
4337   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4338   ac_dummy="$PATH"
4339   for ac_dir in $ac_dummy; do
4340     test -z "$ac_dir" && ac_dir=.
4341     if test -f $ac_dir/$ac_word; then
4342       ac_cv_prog_AS="${ac_tool_prefix}as"
4343       break
4344     fi
4345   done
4346   IFS="$ac_save_ifs"
4347 fi
4348 fi
4349 AS="$ac_cv_prog_AS"
4350 if test -n "$AS"; then
4351   echo "$ac_t""$AS" 1>&6
4352 else
4353   echo "$ac_t""no" 1>&6
4354 fi
4355
4356
4357 if test -z "$ac_cv_prog_AS"; then
4358 if test -n "$ac_tool_prefix"; then
4359   # Extract the first word of "as", so it can be a program name with args.
4360 set dummy as; ac_word=$2
4361 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4362 echo "configure:4363: checking for $ac_word" >&5
4363 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
4364   echo $ac_n "(cached) $ac_c" 1>&6
4365 else
4366   if test -n "$AS"; then
4367   ac_cv_prog_AS="$AS" # Let the user override the test.
4368 else
4369   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4370   ac_dummy="$PATH"
4371   for ac_dir in $ac_dummy; do
4372     test -z "$ac_dir" && ac_dir=.
4373     if test -f $ac_dir/$ac_word; then
4374       ac_cv_prog_AS="as"
4375       break
4376     fi
4377   done
4378   IFS="$ac_save_ifs"
4379   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
4380 fi
4381 fi
4382 AS="$ac_cv_prog_AS"
4383 if test -n "$AS"; then
4384   echo "$ac_t""$AS" 1>&6
4385 else
4386   echo "$ac_t""no" 1>&6
4387 fi
4388
4389 else
4390   AS="false"
4391 fi
4392 fi
4393
4394   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
4395 set dummy ${ac_tool_prefix}objdump; ac_word=$2
4396 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4397 echo "configure:4398: checking for $ac_word" >&5
4398 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
4399   echo $ac_n "(cached) $ac_c" 1>&6
4400 else
4401   if test -n "$OBJDUMP"; then
4402   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
4403 else
4404   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4405   ac_dummy="$PATH"
4406   for ac_dir in $ac_dummy; do
4407     test -z "$ac_dir" && ac_dir=.
4408     if test -f $ac_dir/$ac_word; then
4409       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
4410       break
4411     fi
4412   done
4413   IFS="$ac_save_ifs"
4414 fi
4415 fi
4416 OBJDUMP="$ac_cv_prog_OBJDUMP"
4417 if test -n "$OBJDUMP"; then
4418   echo "$ac_t""$OBJDUMP" 1>&6
4419 else
4420   echo "$ac_t""no" 1>&6
4421 fi
4422
4423
4424 if test -z "$ac_cv_prog_OBJDUMP"; then
4425 if test -n "$ac_tool_prefix"; then
4426   # Extract the first word of "objdump", so it can be a program name with args.
4427 set dummy objdump; ac_word=$2
4428 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4429 echo "configure:4430: checking for $ac_word" >&5
4430 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
4431   echo $ac_n "(cached) $ac_c" 1>&6
4432 else
4433   if test -n "$OBJDUMP"; then
4434   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
4435 else
4436   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4437   ac_dummy="$PATH"
4438   for ac_dir in $ac_dummy; do
4439     test -z "$ac_dir" && ac_dir=.
4440     if test -f $ac_dir/$ac_word; then
4441       ac_cv_prog_OBJDUMP="objdump"
4442       break
4443     fi
4444   done
4445   IFS="$ac_save_ifs"
4446   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
4447 fi
4448 fi
4449 OBJDUMP="$ac_cv_prog_OBJDUMP"
4450 if test -n "$OBJDUMP"; then
4451   echo "$ac_t""$OBJDUMP" 1>&6
4452 else
4453   echo "$ac_t""no" 1>&6
4454 fi
4455
4456 else
4457   OBJDUMP="false"
4458 fi
4459 fi
4460
4461
4462   # recent cygwin and mingw systems supply a stub DllMain which the user
4463   # can override, but on older systems we have to supply one
4464   echo $ac_n "checking if libtool should supply DllMain function""... $ac_c" 1>&6
4465 echo "configure:4466: checking if libtool should supply DllMain function" >&5
4466 if eval "test \"\${lt_cv_need_dllmain+set}\" = set"; then
4467   echo $ac_n "(cached) $ac_c" 1>&6
4468 else
4469   cat > conftest.$ac_ext <<EOF
4470 #line 4471 "configure"
4471 #include "confdefs.h"
4472
4473 int main() {
4474 extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
4475       DllMain (0, 0, 0);
4476 ; return 0; }
4477 EOF
4478 if { (eval echo configure:4479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4479   rm -rf conftest*
4480   lt_cv_need_dllmain=no
4481 else
4482   echo "configure: failed program was:" >&5
4483   cat conftest.$ac_ext >&5
4484   rm -rf conftest*
4485   lt_cv_need_dllmain=yes
4486 fi
4487 rm -f conftest*
4488 fi
4489
4490 echo "$ac_t""$lt_cv_need_dllmain" 1>&6
4491
4492   case $host/$CC in
4493   *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
4494     # old mingw systems require "-dll" to link a DLL, while more recent ones
4495     # require "-mdll"
4496     SAVE_CFLAGS="$CFLAGS"
4497     CFLAGS="$CFLAGS -mdll"
4498     echo $ac_n "checking how to link DLLs""... $ac_c" 1>&6
4499 echo "configure:4500: checking how to link DLLs" >&5
4500 if eval "test \"\${lt_cv_cc_dll_switch+set}\" = set"; then
4501   echo $ac_n "(cached) $ac_c" 1>&6
4502 else
4503   cat > conftest.$ac_ext <<EOF
4504 #line 4505 "configure"
4505 #include "confdefs.h"
4506
4507 int main() {
4508
4509 ; return 0; }
4510 EOF
4511 if { (eval echo configure:4512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4512   rm -rf conftest*
4513   lt_cv_cc_dll_switch=-mdll
4514 else
4515   echo "configure: failed program was:" >&5
4516   cat conftest.$ac_ext >&5
4517   rm -rf conftest*
4518   lt_cv_cc_dll_switch=-dll
4519 fi
4520 rm -f conftest*
4521 fi
4522
4523 echo "$ac_t""$lt_cv_cc_dll_switch" 1>&6
4524     CFLAGS="$SAVE_CFLAGS" ;;
4525   *-*-cygwin* | *-*-pw32*)
4526     # cygwin systems need to pass --dll to the linker, and not link
4527     # crt.o which will require a WinMain@16 definition.
4528     lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
4529   esac
4530   ;;
4531   
4532 esac
4533
4534 # Sed substitution that helps us do robust quoting.  It backslashifies
4535 # metacharacters that are still active within double-quoted strings.
4536 Xsed='sed -e s/^X//'
4537 sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
4538
4539 # Same as above, but do not quote variable references.
4540 double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
4541
4542 # Sed substitution to delay expansion of an escaped shell variable in a
4543 # double_quote_subst'ed string.
4544 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
4545
4546 # Constants:
4547 rm="rm -f"
4548
4549 # Global variables:
4550 default_ofile=libtool
4551 can_build_shared=yes
4552
4553 # All known linkers require a `.a' archive for static linking (except M$VC,
4554 # which needs '.lib').
4555 libext=a
4556 ltmain="$ac_aux_dir/ltmain.sh"
4557 ofile="$default_ofile"
4558 with_gnu_ld="$lt_cv_prog_gnu_ld"
4559 need_locks="$enable_libtool_lock"
4560
4561 old_CC="$CC"
4562 old_CFLAGS="$CFLAGS"
4563
4564 # Set sane defaults for various variables
4565 test -z "$AR" && AR=ar
4566 test -z "$AR_FLAGS" && AR_FLAGS=cru
4567 test -z "$AS" && AS=as
4568 test -z "$CC" && CC=cc
4569 test -z "$DLLTOOL" && DLLTOOL=dlltool
4570 test -z "$LD" && LD=ld
4571 test -z "$LN_S" && LN_S="ln -s"
4572 test -z "$MAGIC_CMD" && MAGIC_CMD=file
4573 test -z "$NM" && NM=nm
4574 test -z "$OBJDUMP" && OBJDUMP=objdump
4575 test -z "$RANLIB" && RANLIB=:
4576 test -z "$STRIP" && STRIP=:
4577 test -z "$ac_objext" && ac_objext=o
4578
4579 if test x"$host" != x"$build"; then
4580   ac_tool_prefix=${host_alias}-
4581 else
4582   ac_tool_prefix=
4583 fi
4584
4585 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
4586 case $host_os in
4587 linux-gnu*) ;;
4588 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
4589 esac
4590
4591 case $host_os in
4592 aix3*)
4593   # AIX sometimes has problems with the GCC collect2 program.  For some
4594   # reason, if we set the COLLECT_NAMES environment variable, the problems
4595   # vanish in a puff of smoke.
4596   if test "X${COLLECT_NAMES+set}" != Xset; then
4597     COLLECT_NAMES=
4598     export COLLECT_NAMES
4599   fi
4600   ;;
4601 esac
4602
4603 # Determine commands to create old-style static archives.
4604 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
4605 old_postinstall_cmds='chmod 644 $oldlib'
4606 old_postuninstall_cmds=
4607
4608 if test -n "$RANLIB"; then
4609   case $host_os in
4610   openbsd*)
4611     old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
4612     ;;
4613   *)
4614     old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
4615     ;;
4616   esac
4617   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
4618 fi
4619
4620 # Allow CC to be a program name with arguments.
4621 set dummy $CC
4622 compiler="$2"
4623
4624 echo $ac_n "checking for objdir""... $ac_c" 1>&6
4625 echo "configure:4626: checking for objdir" >&5
4626 rm -f .libs 2>/dev/null
4627 mkdir .libs 2>/dev/null
4628 if test -d .libs; then
4629   objdir=.libs
4630 else
4631   # MS-DOS does not allow filenames that begin with a dot.
4632   objdir=_libs
4633 fi
4634 rmdir .libs 2>/dev/null
4635 echo "$ac_t""$objdir" 1>&6
4636
4637
4638 # Check whether --with-pic or --without-pic was given.
4639 if test "${with_pic+set}" = set; then
4640   withval="$with_pic"
4641   pic_mode="$withval"
4642 else
4643   pic_mode=default
4644 fi
4645
4646 test -z "$pic_mode" && pic_mode=default
4647
4648 # We assume here that the value for lt_cv_prog_cc_pic will not be cached
4649 # in isolation, and that seeing it set (from the cache) indicates that
4650 # the associated values are set (in the cache) correctly too.
4651 echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6
4652 echo "configure:4653: checking for $compiler option to produce PIC" >&5
4653 if eval "test \"\${lt_cv_prog_cc_pic+set}\" = set"; then
4654   echo $ac_n "(cached) $ac_c" 1>&6
4655 else
4656    lt_cv_prog_cc_pic=
4657   lt_cv_prog_cc_shlib=
4658   lt_cv_prog_cc_wl=
4659   lt_cv_prog_cc_static=
4660   lt_cv_prog_cc_no_builtin=
4661   lt_cv_prog_cc_can_build_shared=$can_build_shared
4662
4663   if test "$GCC" = yes; then
4664     lt_cv_prog_cc_wl='-Wl,'
4665     lt_cv_prog_cc_static='-static'
4666
4667     case $host_os in
4668     aix*)
4669       # Below there is a dirty hack to force normal static linking with -ldl
4670       # The problem is because libdl dynamically linked with both libc and
4671       # libC (AIX C++ library), which obviously doesn't included in libraries
4672       # list by gcc. This cause undefined symbols with -static flags.
4673       # This hack allows C programs to be linked with "-static -ldl", but
4674       # not sure about C++ programs.
4675       lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
4676       ;;
4677     amigaos*)
4678       # FIXME: we need at least 68020 code to build shared libraries, but
4679       # adding the `-m68020' flag to GCC prevents building anything better,
4680       # like `-m68040'.
4681       lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
4682       ;;
4683     beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4684       # PIC is the default for these OSes.
4685       ;;
4686     darwin* | rhapsody*)
4687       # PIC is the default on this platform
4688       # Common symbols not allowed in MH_DYLIB files
4689       lt_cv_prog_cc_pic='-fno-common'
4690       ;;
4691     cygwin* | mingw* | pw32* | os2*)
4692       # This hack is so that the source file can tell whether it is being
4693       # built for inclusion in a dll (and should export symbols for example).
4694       lt_cv_prog_cc_pic='-DDLL_EXPORT'
4695       ;;
4696     sysv4*MP*)
4697       if test -d /usr/nec; then
4698          lt_cv_prog_cc_pic=-Kconform_pic
4699       fi
4700       ;;
4701     *)
4702       lt_cv_prog_cc_pic='-fPIC'
4703       ;;
4704     esac
4705   else
4706     # PORTME Check for PIC flags for the system compiler.
4707     case $host_os in
4708     aix3* | aix4* | aix5*)
4709       lt_cv_prog_cc_wl='-Wl,'
4710       # All AIX code is PIC.
4711       if test "$host_cpu" = ia64; then
4712         # AIX 5 now supports IA64 processor
4713         lt_cv_prog_cc_static='-Bstatic'
4714       else
4715         lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
4716       fi
4717       ;;
4718
4719     hpux9* | hpux10* | hpux11*)
4720       # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
4721       lt_cv_prog_cc_wl='-Wl,'
4722       lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
4723       lt_cv_prog_cc_pic='+Z'
4724       ;;
4725
4726     irix5* | irix6* | nonstopux*)
4727       lt_cv_prog_cc_wl='-Wl,'
4728       lt_cv_prog_cc_static='-non_shared'
4729       # PIC (with -KPIC) is the default.
4730       ;;
4731
4732     cygwin* | mingw* | pw32* | os2*)
4733       # This hack is so that the source file can tell whether it is being
4734       # built for inclusion in a dll (and should export symbols for example).
4735       lt_cv_prog_cc_pic='-DDLL_EXPORT'
4736       ;;
4737
4738     newsos6)
4739       lt_cv_prog_cc_pic='-KPIC'
4740       lt_cv_prog_cc_static='-Bstatic'
4741       ;;
4742     
4743     openedition)
4744       # XPLINK code is PIC by default
4745       ;;
4746
4747     osf3* | osf4* | osf5*)
4748       # All OSF/1 code is PIC.
4749       lt_cv_prog_cc_wl='-Wl,'
4750       lt_cv_prog_cc_static='-non_shared'
4751       ;;
4752
4753     sco3.2v5*)
4754       lt_cv_prog_cc_pic='-Kpic'
4755       lt_cv_prog_cc_static='-dn'
4756       lt_cv_prog_cc_shlib='-belf'
4757       ;;
4758
4759     solaris*)
4760       lt_cv_prog_cc_pic='-KPIC'
4761       lt_cv_prog_cc_static='-Bstatic'
4762       lt_cv_prog_cc_wl='-Wl,'
4763       ;;
4764
4765     sunos4*)
4766       lt_cv_prog_cc_pic='-PIC'
4767       lt_cv_prog_cc_static='-Bstatic'
4768       lt_cv_prog_cc_wl='-Qoption ld '
4769       ;;
4770
4771     sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
4772       lt_cv_prog_cc_pic='-KPIC'
4773       lt_cv_prog_cc_static='-Bstatic'
4774       lt_cv_prog_cc_wl='-Wl,'
4775       ;;
4776
4777     uts4*)
4778       lt_cv_prog_cc_pic='-pic'
4779       lt_cv_prog_cc_static='-Bstatic'
4780       ;;
4781
4782     sysv4*MP*)
4783       if test -d /usr/nec ;then
4784         lt_cv_prog_cc_pic='-Kconform_pic'
4785         lt_cv_prog_cc_static='-Bstatic'
4786       fi
4787       ;;
4788
4789     *)
4790       lt_cv_prog_cc_can_build_shared=no
4791       ;;
4792     esac
4793   fi
4794
4795 fi
4796
4797 if test -z "$lt_cv_prog_cc_pic"; then
4798   echo "$ac_t""none" 1>&6
4799 else
4800   echo "$ac_t""$lt_cv_prog_cc_pic" 1>&6
4801
4802   # Check to make sure the pic_flag actually works.
4803   echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6
4804 echo "configure:4805: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
4805   if eval "test \"\${lt_cv_prog_cc_pic_works+set}\" = set"; then
4806   echo $ac_n "(cached) $ac_c" 1>&6
4807 else
4808       save_CFLAGS="$CFLAGS"
4809     CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
4810     cat > conftest.$ac_ext <<EOF
4811 #line 4812 "configure"
4812 #include "confdefs.h"
4813
4814 int main() {
4815
4816 ; return 0; }
4817 EOF
4818 if { (eval echo configure:4819: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4819   rm -rf conftest*
4820         case $host_os in
4821       hpux9* | hpux10* | hpux11*)
4822         # On HP-UX, both CC and GCC only warn that PIC is supported... then
4823         # they create non-PIC objects.  So, if there were any warnings, we
4824         # assume that PIC is not supported.
4825         if test -s conftest.err; then
4826           lt_cv_prog_cc_pic_works=no
4827         else
4828           lt_cv_prog_cc_pic_works=yes
4829         fi
4830         ;;
4831       *)
4832         lt_cv_prog_cc_pic_works=yes
4833         ;;
4834       esac
4835     
4836 else
4837   echo "configure: failed program was:" >&5
4838   cat conftest.$ac_ext >&5
4839   rm -rf conftest*
4840         lt_cv_prog_cc_pic_works=no
4841     
4842 fi
4843 rm -f conftest*
4844     CFLAGS="$save_CFLAGS"
4845   
4846 fi
4847
4848
4849   if test "X$lt_cv_prog_cc_pic_works" = Xno; then
4850     lt_cv_prog_cc_pic=
4851     lt_cv_prog_cc_can_build_shared=no
4852   else
4853     lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
4854   fi
4855
4856   echo "$ac_t""$lt_cv_prog_cc_pic_works" 1>&6
4857 fi
4858
4859 # Check for any special shared library compilation flags.
4860 if test -n "$lt_cv_prog_cc_shlib"; then
4861   echo "configure: warning: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" 1>&2
4862   if echo "$old_CC $old_CFLAGS " | egrep -e "[  ]$lt_cv_prog_cc_shlib[  ]" >/dev/null; then :
4863   else
4864    echo "configure: warning: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2
4865     lt_cv_prog_cc_can_build_shared=no
4866   fi
4867 fi
4868
4869 echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6
4870 echo "configure:4871: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
4871 if eval "test \"\${lt_cv_prog_cc_static_works+set}\" = set"; then
4872   echo $ac_n "(cached) $ac_c" 1>&6
4873 else
4874     lt_cv_prog_cc_static_works=no
4875   save_LDFLAGS="$LDFLAGS"
4876   LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
4877   cat > conftest.$ac_ext <<EOF
4878 #line 4879 "configure"
4879 #include "confdefs.h"
4880
4881 int main() {
4882
4883 ; return 0; }
4884 EOF
4885 if { (eval echo configure:4886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4886   rm -rf conftest*
4887   lt_cv_prog_cc_static_works=yes
4888 else
4889   echo "configure: failed program was:" >&5
4890   cat conftest.$ac_ext >&5
4891 fi
4892 rm -f conftest*
4893   LDFLAGS="$save_LDFLAGS"
4894
4895 fi
4896
4897
4898 # Belt *and* braces to stop my trousers falling down:
4899 test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
4900 echo "$ac_t""$lt_cv_prog_cc_static_works" 1>&6
4901
4902 pic_flag="$lt_cv_prog_cc_pic"
4903 special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
4904 wl="$lt_cv_prog_cc_wl"
4905 link_static_flag="$lt_cv_prog_cc_static"
4906 no_builtin_flag="$lt_cv_prog_cc_no_builtin"
4907 can_build_shared="$lt_cv_prog_cc_can_build_shared"
4908
4909
4910 # Check to see if options -o and -c are simultaneously supported by compiler
4911 echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6
4912 echo "configure:4913: checking if $compiler supports -c -o file.$ac_objext" >&5
4913 if eval "test \"\${lt_cv_compiler_c_o+set}\" = set"; then
4914   echo $ac_n "(cached) $ac_c" 1>&6
4915 else
4916   
4917 $rm -r conftest 2>/dev/null
4918 mkdir conftest
4919 cd conftest
4920 echo "int some_variable = 0;" > conftest.$ac_ext
4921 mkdir out
4922 # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
4923 # that will create temporary files in the current directory regardless of
4924 # the output directory.  Thus, making CWD read-only will cause this test
4925 # to fail, enabling locking or at least warning the user not to do parallel
4926 # builds.
4927 chmod -w .
4928 save_CFLAGS="$CFLAGS"
4929 CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
4930 compiler_c_o=no
4931 if { (eval echo configure:4932: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
4932   # The compiler can only warn and ignore the option if not recognized
4933   # So say no if there are warnings
4934   if test -s out/conftest.err; then
4935     lt_cv_compiler_c_o=no
4936   else
4937     lt_cv_compiler_c_o=yes
4938   fi
4939 else
4940   # Append any errors to the config.log.
4941   cat out/conftest.err 1>&5
4942   lt_cv_compiler_c_o=no
4943 fi
4944 CFLAGS="$save_CFLAGS"
4945 chmod u+w .
4946 $rm conftest* out/*
4947 rmdir out
4948 cd ..
4949 rmdir conftest
4950 $rm -r conftest 2>/dev/null
4951
4952 fi
4953
4954 compiler_c_o=$lt_cv_compiler_c_o
4955 echo "$ac_t""$compiler_c_o" 1>&6
4956
4957 if test x"$compiler_c_o" = x"yes"; then
4958   # Check to see if we can write to a .lo
4959   echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6
4960 echo "configure:4961: checking if $compiler supports -c -o file.lo" >&5
4961   if eval "test \"\${lt_cv_compiler_o_lo+set}\" = set"; then
4962   echo $ac_n "(cached) $ac_c" 1>&6
4963 else
4964   
4965   lt_cv_compiler_o_lo=no
4966   save_CFLAGS="$CFLAGS"
4967   CFLAGS="$CFLAGS -c -o conftest.lo"
4968   save_objext="$ac_objext"
4969   ac_objext=lo
4970   cat > conftest.$ac_ext <<EOF
4971 #line 4972 "configure"
4972 #include "confdefs.h"
4973
4974 int main() {
4975 int some_variable = 0;
4976 ; return 0; }
4977 EOF
4978 if { (eval echo configure:4979: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4979   rm -rf conftest*
4980       # The compiler can only warn and ignore the option if not recognized
4981     # So say no if there are warnings
4982     if test -s conftest.err; then
4983       lt_cv_compiler_o_lo=no
4984     else
4985       lt_cv_compiler_o_lo=yes
4986     fi
4987   
4988 else
4989   echo "configure: failed program was:" >&5
4990   cat conftest.$ac_ext >&5
4991 fi
4992 rm -f conftest*
4993   ac_objext="$save_objext"
4994   CFLAGS="$save_CFLAGS"
4995   
4996 fi
4997
4998   compiler_o_lo=$lt_cv_compiler_o_lo
4999   echo "$ac_t""$compiler_o_lo" 1>&6
5000 else
5001   compiler_o_lo=no
5002 fi
5003
5004 # Check to see if we can do hard links to lock some files if needed
5005 hard_links="nottested"
5006 if test "$compiler_c_o" = no && test "$need_locks" != no; then
5007   # do not overwrite the value of need_locks provided by the user
5008   echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6
5009 echo "configure:5010: checking if we can lock with hard links" >&5
5010   hard_links=yes
5011   $rm conftest*
5012   ln conftest.a conftest.b 2>/dev/null && hard_links=no
5013   touch conftest.a
5014   ln conftest.a conftest.b 2>&5 || hard_links=no
5015   ln conftest.a conftest.b 2>/dev/null && hard_links=no
5016   echo "$ac_t""$hard_links" 1>&6
5017   if test "$hard_links" = no; then
5018     echo "configure: warning: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" 1>&2
5019     need_locks=warn
5020   fi
5021 else
5022   need_locks=no
5023 fi
5024
5025 if test "$GCC" = yes; then
5026   # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
5027   echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6
5028 echo "configure:5029: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
5029   echo "int some_variable = 0;" > conftest.$ac_ext
5030   save_CFLAGS="$CFLAGS"
5031   CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
5032   compiler_rtti_exceptions=no
5033   cat > conftest.$ac_ext <<EOF
5034 #line 5035 "configure"
5035 #include "confdefs.h"
5036
5037 int main() {
5038 int some_variable = 0;
5039 ; return 0; }
5040 EOF
5041 if { (eval echo configure:5042: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5042   rm -rf conftest*
5043       # The compiler can only warn and ignore the option if not recognized
5044     # So say no if there are warnings
5045     if test -s conftest.err; then
5046       compiler_rtti_exceptions=no
5047     else
5048       compiler_rtti_exceptions=yes
5049     fi
5050   
5051 else
5052   echo "configure: failed program was:" >&5
5053   cat conftest.$ac_ext >&5
5054 fi
5055 rm -f conftest*
5056   CFLAGS="$save_CFLAGS"
5057   echo "$ac_t""$compiler_rtti_exceptions" 1>&6
5058
5059   if test "$compiler_rtti_exceptions" = "yes"; then
5060     no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
5061   else
5062     no_builtin_flag=' -fno-builtin'
5063   fi
5064 fi
5065
5066 # See if the linker supports building shared libraries.
5067 echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6
5068 echo "configure:5069: checking whether the linker ($LD) supports shared libraries" >&5
5069
5070 allow_undefined_flag=
5071 no_undefined_flag=
5072 need_lib_prefix=unknown
5073 need_version=unknown
5074 # when you set need_version to no, make sure it does not cause -set_version
5075 # flags to be left without arguments
5076 archive_cmds=
5077 archive_expsym_cmds=
5078 old_archive_from_new_cmds=
5079 old_archive_from_expsyms_cmds=
5080 export_dynamic_flag_spec=
5081 whole_archive_flag_spec=
5082 thread_safe_flag_spec=
5083 hardcode_into_libs=no
5084 hardcode_libdir_flag_spec=
5085 hardcode_libdir_separator=
5086 hardcode_direct=no
5087 hardcode_minus_L=no
5088 hardcode_shlibpath_var=unsupported
5089 runpath_var=
5090 link_all_deplibs=unknown
5091 always_export_symbols=no
5092 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
5093 # include_expsyms should be a list of space-separated symbols to be *always*
5094 # included in the symbol list
5095 include_expsyms=
5096 # exclude_expsyms can be an egrep regular expression of symbols to exclude
5097 # it will be wrapped by ` (' and `)$', so one must not match beginning or
5098 # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5099 # as well as any symbol that contains `d'.
5100 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
5101 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5102 # platforms (ab)use it in PIC code, but their linkers get confused if
5103 # the symbol is explicitly referenced.  Since portable code cannot
5104 # rely on this symbol name, it's probably fine to never include it in
5105 # preloaded symbol tables.
5106 extract_expsyms_cmds=
5107
5108 case $host_os in
5109 cygwin* | mingw* | pw32*)
5110   # FIXME: the MSVC++ port hasn't been tested in a loooong time
5111   # When not using gcc, we currently assume that we are using
5112   # Microsoft Visual C++.
5113   if test "$GCC" != yes; then
5114     with_gnu_ld=no
5115   fi
5116   ;;
5117 openbsd*)
5118   with_gnu_ld=no
5119   ;;
5120 esac
5121
5122 ld_shlibs=yes
5123 if test "$with_gnu_ld" = yes; then
5124   # If archive_cmds runs LD, not CC, wlarc should be empty
5125   wlarc='${wl}'
5126
5127   # See if GNU ld supports shared libraries.
5128   case $host_os in
5129   aix3* | aix4* | aix5*)
5130     # On AIX, the GNU linker is very broken
5131     # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
5132     ld_shlibs=no
5133     cat <<EOF 1>&2
5134
5135 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
5136 *** to be unable to reliably create shared libraries on AIX.
5137 *** Therefore, libtool is disabling shared libraries support.  If you
5138 *** really care for shared libraries, you may want to modify your PATH
5139 *** so that a non-GNU linker is found, and then restart.
5140
5141 EOF
5142     ;;
5143
5144   amigaos*)
5145     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)'
5146     hardcode_libdir_flag_spec='-L$libdir'
5147     hardcode_minus_L=yes
5148
5149     # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
5150     # that the semantics of dynamic libraries on AmigaOS, at least up
5151     # to version 4, is to share data among multiple programs linked
5152     # with the same dynamic library.  Since this doesn't match the
5153     # behavior of shared libraries on other platforms, we can use
5154     # them.
5155     ld_shlibs=no
5156     ;;
5157
5158   beos*)
5159     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5160       allow_undefined_flag=unsupported
5161       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5162       # support --undefined.  This deserves some investigation.  FIXME
5163       archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5164     else
5165       ld_shlibs=no
5166     fi
5167     ;;
5168
5169   cygwin* | mingw* | pw32*)
5170     # hardcode_libdir_flag_spec is actually meaningless, as there is
5171     # no search path for DLLs.
5172     hardcode_libdir_flag_spec='-L$libdir'
5173     allow_undefined_flag=unsupported
5174     always_export_symbols=yes
5175
5176     extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
5177       sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
5178       test -f $output_objdir/impgen.exe || (cd $output_objdir && \
5179       if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
5180       else $CC -o impgen impgen.c ; fi)~
5181       $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
5182
5183     old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
5184
5185     # cygwin and mingw dlls have different entry points and sets of symbols
5186     # to exclude.
5187     # FIXME: what about values for MSVC?
5188     dll_entry=__cygwin_dll_entry@12
5189     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
5190     case $host_os in
5191     mingw*)
5192       # mingw values
5193       dll_entry=_DllMainCRTStartup@12
5194       dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
5195       ;;
5196     esac
5197
5198     # mingw and cygwin differ, and it's simplest to just exclude the union
5199     # of the two symbol sets.
5200     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
5201
5202     # recent cygwin and mingw systems supply a stub DllMain which the user
5203     # can override, but on older systems we have to supply one (in ltdll.c)
5204     if test "x$lt_cv_need_dllmain" = "xyes"; then
5205       ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
5206       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~
5207         test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
5208     else
5209       ltdll_obj=
5210       ltdll_cmds=
5211     fi
5212
5213     # Extract the symbol export list from an `--export-all' def file,
5214     # then regenerate the def file from the symbol export list, so that
5215     # the compiled dll only exports the symbol export list.
5216     # Be careful not to strip the DATA tag left be newer dlltools.
5217     export_symbols_cmds="$ltdll_cmds"'
5218       $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
5219       sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
5220
5221     # If the export-symbols file already is a .def file (1st line
5222     # is EXPORTS), use it as is.
5223     # If DATA tags from a recent dlltool are present, honour them!
5224     archive_expsym_cmds='if test "x`sed 1q $export_symbols`" = xEXPORTS; then
5225         cp $export_symbols $output_objdir/$soname-def;
5226       else
5227         echo EXPORTS > $output_objdir/$soname-def;
5228         _lt_hint=1;
5229         cat $export_symbols | while read symbol; do
5230          set dummy \$symbol;
5231          case \$# in
5232            2) echo "   \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
5233            4) echo "   \$2 \$3 \$4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
5234            *) echo "     \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
5235          esac;
5236          _lt_hint=`expr 1 + \$_lt_hint`;
5237         done;
5238       fi~
5239       '"$ltdll_cmds"'
5240       $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~
5241       $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~
5242       $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~
5243       $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~
5244       $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
5245     ;;
5246
5247   netbsd*)
5248     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5249       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5250       wlarc=
5251     else
5252       archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5253       archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5254     fi
5255     ;;
5256
5257   solaris* | sysv5*)
5258     if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
5259       ld_shlibs=no
5260       cat <<EOF 1>&2
5261
5262 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
5263 *** create shared libraries on Solaris systems.  Therefore, libtool
5264 *** is disabling shared libraries support.  We urge you to upgrade GNU
5265 *** binutils to release 2.9.1 or newer.  Another option is to modify
5266 *** your PATH or compiler configuration so that the native linker is
5267 *** used, and then restart.
5268
5269 EOF
5270     elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5271       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5272       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5273     else
5274       ld_shlibs=no
5275     fi
5276     ;;
5277
5278   sunos4*)
5279     archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5280     wlarc=
5281     hardcode_direct=yes
5282     hardcode_shlibpath_var=no
5283     ;;
5284
5285   *)
5286     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5287       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5288       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5289     else
5290       ld_shlibs=no
5291     fi
5292     ;;
5293   esac
5294
5295   if test "$ld_shlibs" = yes; then
5296     runpath_var=LD_RUN_PATH
5297     hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
5298     export_dynamic_flag_spec='${wl}--export-dynamic'
5299     case $host_os in
5300     cygwin* | mingw* | pw32*)
5301       # dlltool doesn't understand --whole-archive et. al.
5302       whole_archive_flag_spec=
5303       ;;
5304     *)
5305       # ancient GNU ld didn't support --whole-archive et. al.
5306       if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
5307         whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5308       else
5309         whole_archive_flag_spec=
5310       fi
5311       ;;
5312     esac
5313   fi
5314 else
5315   # PORTME fill in a description of your system's linker (not GNU ld)
5316   case $host_os in
5317   aix3*)
5318     allow_undefined_flag=unsupported
5319     always_export_symbols=yes
5320     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'
5321     # Note: this linker hardcodes the directories in LIBPATH if there
5322     # are no directories specified by -L.
5323     hardcode_minus_L=yes
5324     if test "$GCC" = yes && test -z "$link_static_flag"; then
5325       # Neither direct hardcoding nor static linking is supported with a
5326       # broken collect2.
5327       hardcode_direct=unsupported
5328     fi
5329     ;;
5330
5331   aix4* | aix5*)
5332     if test "$host_cpu" = ia64; then
5333       # On IA64, the linker does run time linking by default, so we don't
5334       # have to do anything special.
5335       aix_use_runtimelinking=no
5336       exp_sym_flag='-Bexport'
5337       no_entry_flag=""
5338     else
5339       aix_use_runtimelinking=no
5340
5341       # Test if we are trying to use run time linking or normal
5342       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5343       # need to do runtime linking.
5344       case $host_os in aix4.[23]|aix4.[23].*|aix5*)
5345         for ld_flag in $LDFLAGS; do
5346           case $ld_flag in
5347           *-brtl*)
5348             aix_use_runtimelinking=yes
5349             break
5350           ;;
5351           esac
5352         done
5353       esac
5354
5355       exp_sym_flag='-bexport'
5356       no_entry_flag='-bnoentry'
5357     fi
5358
5359     # When large executables or shared objects are built, AIX ld can
5360     # have problems creating the table of contents.  If linking a library
5361     # or program results in "error TOC overflow" add -mminimal-toc to
5362     # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5363     # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5364
5365     hardcode_direct=yes
5366     archive_cmds=''
5367     hardcode_libdir_separator=':'
5368     if test "$GCC" = yes; then
5369       case $host_os in aix4.[012]|aix4.[012].*)
5370         collect2name=`${CC} -print-prog-name=collect2`
5371         if test -f "$collect2name" && \
5372           strings "$collect2name" | grep resolve_lib_name >/dev/null
5373         then
5374           # We have reworked collect2
5375           hardcode_direct=yes
5376         else
5377           # We have old collect2
5378           hardcode_direct=unsupported
5379           # It fails to find uninstalled libraries when the uninstalled
5380           # path is not listed in the libpath.  Setting hardcode_minus_L
5381           # to unsupported forces relinking
5382           hardcode_minus_L=yes
5383           hardcode_libdir_flag_spec='-L$libdir'
5384           hardcode_libdir_separator=
5385         fi
5386       esac
5387
5388       shared_flag='-shared'
5389     else
5390       # not using gcc
5391       if test "$host_cpu" = ia64; then
5392         shared_flag='${wl}-G'
5393       else
5394         if test "$aix_use_runtimelinking" = yes; then
5395           shared_flag='${wl}-G'
5396         else
5397           shared_flag='${wl}-bM:SRE'
5398         fi
5399       fi
5400     fi
5401
5402     # It seems that -bexpall can do strange things, so it is better to
5403     # generate a list of symbols to export.
5404     always_export_symbols=yes
5405     if test "$aix_use_runtimelinking" = yes; then
5406       # Warning - without using the other runtime loading flags (-brtl),
5407       # -berok will link without error, but may produce a broken library.
5408       allow_undefined_flag='-berok'
5409       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
5410       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"
5411     else
5412       if test "$host_cpu" = ia64; then
5413         hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
5414         allow_undefined_flag="-z nodefs"
5415         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"
5416       else
5417         hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
5418         # Warning - without using the other run time loading flags,
5419         # -berok will link without error, but may produce a broken library.
5420         allow_undefined_flag='${wl}-berok'
5421         # This is a bit strange, but is similar to how AIX traditionally builds
5422         # it's shared libraries.
5423         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'
5424       fi
5425     fi
5426     ;;
5427
5428   amigaos*)
5429     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)'
5430     hardcode_libdir_flag_spec='-L$libdir'
5431     hardcode_minus_L=yes
5432     # see comment about different semantics on the GNU ld section
5433     ld_shlibs=no
5434     ;;
5435
5436   cygwin* | mingw* | pw32*)
5437     # When not using gcc, we currently assume that we are using
5438     # Microsoft Visual C++.
5439     # hardcode_libdir_flag_spec is actually meaningless, as there is
5440     # no search path for DLLs.
5441     hardcode_libdir_flag_spec=' '
5442     allow_undefined_flag=unsupported
5443     # Tell ltmain to make .lib files, not .a files.
5444     libext=lib
5445     # FIXME: Setting linknames here is a bad hack.
5446     archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
5447     # The linker will automatically build a .lib file if we build a DLL.
5448     old_archive_from_new_cmds='true'
5449     # FIXME: Should let the user specify the lib program.
5450     old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
5451     fix_srcfile_path='`cygpath -w "$srcfile"`'
5452     ;;
5453
5454   darwin* | rhapsody*)
5455     case "$host_os" in
5456     rhapsody* | darwin1.[012])
5457       allow_undefined_flag='-undefined suppress'
5458       ;;
5459     *) # Darwin 1.3 on
5460       allow_undefined_flag='-flat_namespace -undefined suppress'
5461       ;;
5462     esac
5463     # FIXME: Relying on posixy $() will cause problems for
5464     #        cross-compilation, but unfortunately the echo tests do not
5465     #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
5466     #        `"' quotes if we put them in here... so don't!
5467     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)'
5468     # We need to add '_' to the symbols in $export_symbols first
5469     #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
5470     hardcode_direct=yes
5471     hardcode_shlibpath_var=no
5472     whole_archive_flag_spec='-all_load $convenience'
5473     ;;
5474
5475   freebsd1*)
5476     ld_shlibs=no
5477     ;;
5478
5479   # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5480   # support.  Future versions do this automatically, but an explicit c++rt0.o
5481   # does not break anything, and helps significantly (at the cost of a little
5482   # extra space).
5483   freebsd2.2*)
5484     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5485     hardcode_libdir_flag_spec='-R$libdir'
5486     hardcode_direct=yes
5487     hardcode_shlibpath_var=no
5488     ;;
5489
5490   # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5491   freebsd2*)
5492     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5493     hardcode_direct=yes
5494     hardcode_minus_L=yes
5495     hardcode_shlibpath_var=no
5496     ;;
5497
5498   # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5499   freebsd*)
5500     archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
5501     hardcode_libdir_flag_spec='-R$libdir'
5502     hardcode_direct=yes
5503     hardcode_shlibpath_var=no
5504     ;;
5505
5506   hpux9* | hpux10* | hpux11*)
5507     case $host_os in
5508     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' ;;
5509     *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
5510     esac
5511     hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
5512     hardcode_libdir_separator=:
5513     hardcode_direct=yes
5514     hardcode_minus_L=yes # Not in the search PATH, but as the default
5515                          # location of the library.
5516     export_dynamic_flag_spec='${wl}-E'
5517     ;;
5518
5519   irix5* | irix6* | nonstopux*)
5520     if test "$GCC" = yes; then
5521       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'
5522       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5523     else
5524       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'
5525       hardcode_libdir_flag_spec='-rpath $libdir'
5526     fi
5527     hardcode_libdir_separator=:
5528     link_all_deplibs=yes
5529     ;;
5530
5531   netbsd*)
5532     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5533       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5534     else
5535       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5536     fi
5537     hardcode_libdir_flag_spec='-R$libdir'
5538     hardcode_direct=yes
5539     hardcode_shlibpath_var=no
5540     ;;
5541
5542   newsos6)
5543     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5544     hardcode_direct=yes
5545     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5546     hardcode_libdir_separator=:
5547     hardcode_shlibpath_var=no
5548     ;;
5549
5550   openbsd*)
5551     hardcode_direct=yes
5552     hardcode_shlibpath_var=no
5553     if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5554       archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5555       hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
5556       export_dynamic_flag_spec='${wl}-E'
5557     else
5558       case "$host_os" in
5559       openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
5560         archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5561         hardcode_libdir_flag_spec='-R$libdir'
5562         ;;
5563       *)
5564         archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5565         hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
5566         ;;
5567       esac
5568     fi
5569     ;;
5570
5571   openedition*)
5572     archive_cmds="\$CC -Wl,DLL \$libobjs \$deplibs \$compiler_flags -o \$lib &&
5573         cp \$linknames \$output_objdir && linknames=''"
5574     export_dynamic_flag_spec="-Wl,DLL"
5575     ;;
5576
5577   os2*)
5578     hardcode_libdir_flag_spec='-L$libdir'
5579     hardcode_minus_L=yes
5580     allow_undefined_flag=unsupported
5581     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'
5582     old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
5583     ;;
5584
5585   osf3*)
5586     if test "$GCC" = yes; then
5587       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
5588       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'
5589     else
5590       allow_undefined_flag=' -expect_unresolved \*'
5591       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'
5592     fi
5593     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5594     hardcode_libdir_separator=:
5595     ;;
5596
5597   osf4* | osf5*)        # as osf3* with the addition of -msym flag
5598     if test "$GCC" = yes; then
5599       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
5600       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'
5601       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5602     else
5603       allow_undefined_flag=' -expect_unresolved \*'
5604       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'
5605       archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
5606       $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'
5607
5608       #Both c and cxx compiler support -rpath directly
5609       hardcode_libdir_flag_spec='-rpath $libdir'
5610     fi
5611     hardcode_libdir_separator=:
5612     ;;
5613
5614   sco3.2v5*)
5615     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5616     hardcode_shlibpath_var=no
5617     runpath_var=LD_RUN_PATH
5618     hardcode_runpath_var=yes
5619     export_dynamic_flag_spec='${wl}-Bexport'
5620     ;;
5621
5622   solaris*)
5623     # gcc --version < 3.0 without binutils cannot create self contained
5624     # shared libraries reliably, requiring libgcc.a to resolve some of
5625     # the object symbols generated in some cases.  Libraries that use
5626     # assert need libgcc.a to resolve __eprintf, for example.  Linking
5627     # a copy of libgcc.a into every shared library to guarantee resolving
5628     # such symbols causes other problems:  According to Tim Van Holder
5629     # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
5630     # (to the application) exception stack for one thing.
5631     no_undefined_flag=' -z defs'
5632     if test "$GCC" = yes; then
5633       case `$CC --version 2>/dev/null` in
5634       [12].*)
5635         cat <<EOF 1>&2
5636
5637 *** Warning: Releases of GCC earlier than version 3.0 cannot reliably
5638 *** create self contained shared libraries on Solaris systems, without
5639 *** introducing a dependency on libgcc.a.  Therefore, libtool is disabling
5640 *** -no-undefined support, which will at least allow you to build shared
5641 *** libraries.  However, you may find that when you link such libraries
5642 *** into an application without using GCC, you have to manually add
5643 *** \`gcc --print-libgcc-file-name\` to the link command.  We urge you to
5644 *** upgrade to a newer version of GCC.  Another option is to rebuild your
5645 *** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
5646
5647 EOF
5648         no_undefined_flag=
5649         ;;
5650       esac
5651     fi
5652     # $CC -shared without GNU ld will not create a library from C++
5653     # object files and a static libstdc++, better avoid it by now
5654     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
5655     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
5656                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
5657     hardcode_libdir_flag_spec='-R$libdir'
5658     hardcode_shlibpath_var=no
5659     case $host_os in
5660     solaris2.[0-5] | solaris2.[0-5].*) ;;
5661     *) # Supported since Solaris 2.6 (maybe 2.5.1?)
5662       whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
5663     esac
5664     link_all_deplibs=yes
5665     ;;
5666
5667   sunos4*)
5668     if test "x$host_vendor" = xsequent; then
5669       # Use $CC to link under sequent, because it throws in some extra .o
5670       # files that make .init and .fini sections work.
5671       archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5672     else
5673       archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5674     fi
5675     hardcode_libdir_flag_spec='-L$libdir'
5676     hardcode_direct=yes
5677     hardcode_minus_L=yes
5678     hardcode_shlibpath_var=no
5679     ;;
5680
5681   sysv4)
5682     case $host_vendor in
5683       sni)
5684         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5685         hardcode_direct=yes # is this really true???
5686         ;;
5687       siemens)
5688         ## LD is ld it makes a PLAMLIB
5689         ## CC just makes a GrossModule.
5690         archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5691         reload_cmds='$CC -r -o $output$reload_objs'
5692         hardcode_direct=no
5693         ;;
5694       motorola)
5695         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5696         hardcode_direct=no #Motorola manual says yes, but my tests say they lie
5697         ;;
5698     esac
5699     runpath_var='LD_RUN_PATH'
5700     hardcode_shlibpath_var=no
5701     ;;
5702
5703   sysv4.3*)
5704     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5705     hardcode_shlibpath_var=no
5706     export_dynamic_flag_spec='-Bexport'
5707     ;;
5708
5709   sysv5*)
5710     no_undefined_flag=' -z text'
5711     # $CC -shared without GNU ld will not create a library from C++
5712     # object files and a static libstdc++, better avoid it by now
5713     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
5714     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
5715                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
5716     hardcode_libdir_flag_spec=
5717     hardcode_shlibpath_var=no
5718     runpath_var='LD_RUN_PATH'
5719     ;;
5720
5721   uts4*)
5722     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5723     hardcode_libdir_flag_spec='-L$libdir'
5724     hardcode_shlibpath_var=no
5725     ;;
5726
5727   dgux*)
5728     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5729     hardcode_libdir_flag_spec='-L$libdir'
5730     hardcode_shlibpath_var=no
5731     ;;
5732
5733   sysv4*MP*)
5734     if test -d /usr/nec; then
5735       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5736       hardcode_shlibpath_var=no
5737       runpath_var=LD_RUN_PATH
5738       hardcode_runpath_var=yes
5739       ld_shlibs=yes
5740     fi
5741     ;;
5742
5743   sysv4.2uw2*)
5744     archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5745     hardcode_direct=yes
5746     hardcode_minus_L=no
5747     hardcode_shlibpath_var=no
5748     hardcode_runpath_var=yes
5749     runpath_var=LD_RUN_PATH
5750     ;;
5751
5752   sysv5uw7* | unixware7*)
5753     no_undefined_flag='${wl}-z ${wl}text'
5754     if test "$GCC" = yes; then
5755       archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5756     else
5757       archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5758     fi
5759     runpath_var='LD_RUN_PATH'
5760     hardcode_shlibpath_var=no
5761     ;;
5762
5763   *)
5764     ld_shlibs=no
5765     ;;
5766   esac
5767 fi
5768 echo "$ac_t""$ld_shlibs" 1>&6
5769 test "$ld_shlibs" = no && can_build_shared=no
5770
5771 # Check hardcoding attributes.
5772 echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6
5773 echo "configure:5774: checking how to hardcode library paths into programs" >&5
5774 hardcode_action=
5775 if test -n "$hardcode_libdir_flag_spec" || \
5776    test -n "$runpath_var"; then
5777
5778   # We can hardcode non-existant directories.
5779   if test "$hardcode_direct" != no &&
5780      # If the only mechanism to avoid hardcoding is shlibpath_var, we
5781      # have to relink, otherwise we might link with an installed library
5782      # when we should be linking with a yet-to-be-installed one
5783      ## test "$hardcode_shlibpath_var" != no &&
5784      test "$hardcode_minus_L" != no; then
5785     # Linking always hardcodes the temporary library directory.
5786     hardcode_action=relink
5787   else
5788     # We can link without hardcoding, and we can hardcode nonexisting dirs.
5789     hardcode_action=immediate
5790   fi
5791 else
5792   # We cannot hardcode anything, or else we can only hardcode existing
5793   # directories.
5794   hardcode_action=unsupported
5795 fi
5796 echo "$ac_t""$hardcode_action" 1>&6
5797
5798 striplib=
5799 old_striplib=
5800 echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6
5801 echo "configure:5802: checking whether stripping libraries is possible" >&5
5802 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
5803   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
5804   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
5805   echo "$ac_t""yes" 1>&6
5806 else
5807   echo "$ac_t""no" 1>&6
5808 fi
5809
5810 reload_cmds='$LD$reload_flag -o $output$reload_objs'
5811 test -z "$deplibs_check_method" && deplibs_check_method=unknown
5812
5813 # PORTME Fill in your ld.so characteristics
5814 echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6
5815 echo "configure:5816: checking dynamic linker characteristics" >&5
5816 library_names_spec=
5817 libname_spec='lib$name'
5818 soname_spec=
5819 postinstall_cmds=
5820 postuninstall_cmds=
5821 finish_cmds=
5822 finish_eval=
5823 shlibpath_var=
5824 shlibpath_overrides_runpath=unknown
5825 version_type=none
5826 dynamic_linker="$host_os ld.so"
5827 sys_lib_dlsearch_path_spec="/lib /usr/lib"
5828 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
5829
5830 case $host_os in
5831 aix3*)
5832   version_type=linux
5833   library_names_spec='${libname}${release}.so$versuffix $libname.a'
5834   shlibpath_var=LIBPATH
5835
5836   # AIX has no versioning support, so we append a major version to the name.
5837   soname_spec='${libname}${release}.so$major'
5838   ;;
5839
5840 aix4* | aix5*)
5841   version_type=linux
5842   need_lib_prefix=no
5843   need_version=no
5844   hardcode_into_libs=yes
5845   if test "$host_cpu" = ia64; then
5846     # AIX 5 supports IA64
5847     library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
5848     shlibpath_var=LD_LIBRARY_PATH
5849   else
5850     # With GCC up to 2.95.x, collect2 would create an import file
5851     # for dependence libraries.  The import file would start with
5852     # the line `#! .'.  This would cause the generated library to
5853     # depend on `.', always an invalid library.  This was fixed in
5854     # development snapshots of GCC prior to 3.0.
5855     case $host_os in
5856       aix4 | aix4.[01] | aix4.[01].*)
5857         if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
5858              echo ' yes '
5859              echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
5860           :
5861         else
5862           can_build_shared=no
5863         fi
5864         ;;
5865     esac
5866     # AIX (on Power*) has no versioning support, so currently we can
5867     # not hardcode correct soname into executable. Probably we can
5868     # add versioning support to collect2, so additional links can
5869     # be useful in future.
5870     if test "$aix_use_runtimelinking" = yes; then
5871       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
5872       # instead of lib<name>.a to let people know that these are not
5873       # typical AIX shared libraries.
5874       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
5875     else
5876       # We preserve .a as extension for shared libraries through AIX4.2
5877       # and later when we are not doing run time linking.
5878       library_names_spec='${libname}${release}.a $libname.a'
5879       soname_spec='${libname}${release}.so$major'
5880     fi
5881     shlibpath_var=LIBPATH
5882   fi
5883   hardcode_into_libs=yes
5884   ;;
5885
5886 amigaos*)
5887   library_names_spec='$libname.ixlibrary $libname.a'
5888   # Create ${libname}_ixlibrary.a entries in /sys/libs.
5889   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'
5890   ;;
5891
5892 beos*)
5893   library_names_spec='${libname}.so'
5894   dynamic_linker="$host_os ld.so"
5895   shlibpath_var=LIBRARY_PATH
5896   ;;
5897
5898 bsdi4*)
5899   version_type=linux
5900   need_version=no
5901   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
5902   soname_spec='${libname}${release}.so$major'
5903   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
5904   shlibpath_var=LD_LIBRARY_PATH
5905   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
5906   sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
5907   export_dynamic_flag_spec=-rdynamic
5908   # the default ld.so.conf also contains /usr/contrib/lib and
5909   # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
5910   # libtool to hard-code these into programs
5911   ;;
5912
5913 cygwin* | mingw* | pw32*)
5914   version_type=windows
5915   need_version=no
5916   need_lib_prefix=no
5917   case $GCC,$host_os in
5918   yes,cygwin*)
5919     library_names_spec='$libname.dll.a'
5920     soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
5921     postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
5922       dldir=$destdir/`dirname \$dlpath`~
5923       test -d \$dldir || mkdir -p \$dldir~
5924       $install_prog .libs/$dlname \$dldir/$dlname'
5925     postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
5926       dlpath=$dir/\$dldll~
5927        $rm \$dlpath'
5928     ;;
5929   yes,mingw*)
5930     library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
5931     sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
5932     ;;
5933   yes,pw32*)
5934     library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll'
5935     ;;
5936   *)
5937     library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
5938     ;;
5939   esac
5940   dynamic_linker='Win32 ld.exe'
5941   # FIXME: first we should search . and the directory the executable is in
5942   shlibpath_var=PATH
5943   ;;
5944
5945 darwin* | rhapsody*)
5946   dynamic_linker="$host_os dyld"
5947   version_type=darwin
5948   need_lib_prefix=no
5949   need_version=no
5950   # FIXME: Relying on posixy $() will cause problems for
5951   #        cross-compilation, but unfortunately the echo tests do not
5952   #        yet detect zsh echo's removal of \ escapes.
5953   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)'
5954   soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
5955   shlibpath_overrides_runpath=yes
5956   shlibpath_var=DYLD_LIBRARY_PATH
5957   ;;
5958
5959 freebsd1*)
5960   dynamic_linker=no
5961   ;;
5962
5963 freebsd*)
5964   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
5965   version_type=freebsd-$objformat
5966   case $version_type in
5967     freebsd-elf*)
5968       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
5969       need_version=no
5970       need_lib_prefix=no
5971       ;;
5972     freebsd-*)
5973       library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
5974       need_version=yes
5975       ;;
5976   esac
5977   shlibpath_var=LD_LIBRARY_PATH
5978   case $host_os in
5979   freebsd2*)
5980     shlibpath_overrides_runpath=yes
5981     ;;
5982   *)
5983     shlibpath_overrides_runpath=no
5984     hardcode_into_libs=yes
5985     ;;
5986   esac
5987   ;;
5988
5989 gnu*)
5990   version_type=linux
5991   need_lib_prefix=no
5992   need_version=no
5993   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
5994   soname_spec='${libname}${release}.so$major'
5995   shlibpath_var=LD_LIBRARY_PATH
5996   hardcode_into_libs=yes
5997   ;;
5998
5999 hpux9* | hpux10* | hpux11*)
6000   # Give a soname corresponding to the major version so that dld.sl refuses to
6001   # link against other versions.
6002   dynamic_linker="$host_os dld.sl"
6003   version_type=sunos
6004   need_lib_prefix=no
6005   need_version=no
6006   shlibpath_var=SHLIB_PATH
6007   shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
6008   library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
6009   soname_spec='${libname}${release}.sl$major'
6010   # HP-UX runs *really* slowly unless shared libraries are mode 555.
6011   postinstall_cmds='chmod 555 $lib'
6012   ;;
6013
6014 irix5* | irix6* | nonstopux*)
6015   case $host_os in
6016     nonstopux*) version_type=nonstopux ;;
6017     *)          version_type=irix ;;
6018   esac
6019   need_lib_prefix=no
6020   need_version=no
6021   soname_spec='${libname}${release}.so$major'
6022   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
6023   case $host_os in
6024   irix5* | nonstopux*)
6025     libsuff= shlibsuff=
6026     ;;
6027   *)
6028     case $LD in # libtool.m4 will add one of these switches to LD
6029     *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
6030     *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
6031     *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
6032     *) libsuff= shlibsuff= libmagic=never-match;;
6033     esac
6034     ;;
6035   esac
6036   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
6037   shlibpath_overrides_runpath=no
6038   sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
6039   sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
6040   ;;
6041
6042 # No shared lib support for Linux oldld, aout, or coff.
6043 linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
6044   dynamic_linker=no
6045   ;;
6046
6047 # This must be Linux ELF.
6048 linux-gnu*)
6049   version_type=linux
6050   need_lib_prefix=no
6051   need_version=no
6052   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6053   soname_spec='${libname}${release}.so$major'
6054   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
6055   shlibpath_var=LD_LIBRARY_PATH
6056   shlibpath_overrides_runpath=no
6057   # This implies no fast_install, which is unacceptable.
6058   # Some rework will be needed to allow for fast_install
6059   # before this can be enabled.
6060   hardcode_into_libs=yes
6061
6062   # We used to test for /lib/ld.so.1 and disable shared libraries on
6063   # powerpc, because MkLinux only supported shared libraries with the
6064   # GNU dynamic linker.  Since this was broken with cross compilers,
6065   # most powerpc-linux boxes support dynamic linking these days and
6066   # people can always --disable-shared, the test was removed, and we
6067   # assume the GNU/Linux dynamic linker is in use.
6068   dynamic_linker='GNU/Linux ld.so'
6069   ;;
6070
6071 netbsd*)
6072   version_type=sunos
6073   need_lib_prefix=no
6074   need_version=no
6075   if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6076     library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6077     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6078     dynamic_linker='NetBSD (a.out) ld.so'
6079   else
6080     library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
6081     soname_spec='${libname}${release}.so$major'
6082     dynamic_linker='NetBSD ld.elf_so'
6083   fi
6084   shlibpath_var=LD_LIBRARY_PATH
6085   shlibpath_overrides_runpath=yes
6086   hardcode_into_libs=yes
6087   ;;
6088
6089 newsos6)
6090   version_type=linux
6091   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6092   shlibpath_var=LD_LIBRARY_PATH
6093   shlibpath_overrides_runpath=yes
6094   ;;
6095
6096 openbsd*)
6097   version_type=sunos
6098   need_lib_prefix=no
6099   need_version=no
6100   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6101     case "$host_os" in
6102     openbsd2.[89] | openbsd2.[89].*)
6103       shlibpath_overrides_runpath=no
6104       ;;
6105     *)
6106       shlibpath_overrides_runpath=yes
6107       ;;
6108     esac
6109   else
6110     shlibpath_overrides_runpath=yes
6111   fi
6112   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6113   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6114   shlibpath_var=LD_LIBRARY_PATH
6115   ;;
6116
6117 openedition*)
6118   need_lib_prefix=no
6119   need_version=no
6120   shlibpath_overrides_runpath=yes
6121   shlibpath_var=LIBPATH
6122   postinstall_cmds="rm \$destdir/\$linkname; cp \$linkname \$destdir; chmod a+x \$lib"
6123   # the library's exports are in libname.x; this is the file that must
6124   # actually be linked with to use a DLL.
6125   library_names_spec="\${libname}\${release}.so\$versuffix \${libname}.x"
6126   ;;
6127
6128 os2*)
6129   libname_spec='$name'
6130   need_lib_prefix=no
6131   library_names_spec='$libname.dll $libname.a'
6132   dynamic_linker='OS/2 ld.exe'
6133   shlibpath_var=LIBPATH
6134   ;;
6135
6136 osf3* | osf4* | osf5*)
6137   version_type=osf
6138   need_version=no
6139   soname_spec='${libname}${release}.so$major'
6140   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6141   shlibpath_var=LD_LIBRARY_PATH
6142   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
6143   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
6144   hardcode_into_libs=yes
6145   ;;
6146
6147 sco3.2v5*)
6148   version_type=osf
6149   soname_spec='${libname}${release}.so$major'
6150   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6151   shlibpath_var=LD_LIBRARY_PATH
6152   ;;
6153
6154 solaris*)
6155   version_type=linux
6156   need_lib_prefix=no
6157   need_version=no
6158   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6159   soname_spec='${libname}${release}.so$major'
6160   shlibpath_var=LD_LIBRARY_PATH
6161   shlibpath_overrides_runpath=yes
6162   hardcode_into_libs=yes
6163   # ldd complains unless libraries are executable
6164   postinstall_cmds='chmod +x $lib'
6165   ;;
6166
6167 sunos4*)
6168   version_type=sunos
6169   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6170   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
6171   shlibpath_var=LD_LIBRARY_PATH
6172   shlibpath_overrides_runpath=yes
6173   if test "$with_gnu_ld" = yes; then
6174     need_lib_prefix=no
6175   fi
6176   need_version=yes
6177   ;;
6178
6179 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6180   version_type=linux
6181   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6182   soname_spec='${libname}${release}.so$major'
6183   shlibpath_var=LD_LIBRARY_PATH
6184   case $host_vendor in
6185     sni)
6186       shlibpath_overrides_runpath=no
6187       need_lib_prefix=no
6188       export_dynamic_flag_spec='${wl}-Blargedynsym'
6189       runpath_var=LD_RUN_PATH
6190       ;;
6191     siemens)
6192       need_lib_prefix=no
6193       ;;
6194     motorola)
6195       need_lib_prefix=no
6196       need_version=no
6197       shlibpath_overrides_runpath=no
6198       sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
6199       ;;
6200   esac
6201   ;;
6202
6203 uts4*)
6204   version_type=linux
6205   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6206   soname_spec='${libname}${release}.so$major'
6207   shlibpath_var=LD_LIBRARY_PATH
6208   ;;
6209
6210 dgux*)
6211   version_type=linux
6212   need_lib_prefix=no
6213   need_version=no
6214   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6215   soname_spec='${libname}${release}.so$major'
6216   shlibpath_var=LD_LIBRARY_PATH
6217   ;;
6218
6219 sysv4*MP*)
6220   if test -d /usr/nec ;then
6221     version_type=linux
6222     library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
6223     soname_spec='$libname.so.$major'
6224     shlibpath_var=LD_LIBRARY_PATH
6225   fi
6226   ;;
6227
6228 *)
6229   dynamic_linker=no
6230   ;;
6231 esac
6232 echo "$ac_t""$dynamic_linker" 1>&6
6233 test "$dynamic_linker" = no && can_build_shared=no
6234
6235 # Report the final consequences.
6236 echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6
6237 echo "configure:6238: checking if libtool supports shared libraries" >&5
6238 echo "$ac_t""$can_build_shared" 1>&6
6239
6240 echo $ac_n "checking whether to build shared libraries""... $ac_c" 1>&6
6241 echo "configure:6242: checking whether to build shared libraries" >&5
6242 test "$can_build_shared" = "no" && enable_shared=no
6243
6244 # On AIX, shared libraries and static libraries use the same namespace, and
6245 # are all built from PIC.
6246 case "$host_os" in
6247 aix3*)
6248   test "$enable_shared" = yes && enable_static=no
6249   if test -n "$RANLIB"; then
6250     archive_cmds="$archive_cmds~\$RANLIB \$lib"
6251     postinstall_cmds='$RANLIB $lib'
6252   fi
6253   ;;
6254
6255 aix4*)
6256   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6257     test "$enable_shared" = yes && enable_static=no
6258   fi
6259   ;;
6260 esac
6261 echo "$ac_t""$enable_shared" 1>&6
6262
6263 echo $ac_n "checking whether to build static libraries""... $ac_c" 1>&6
6264 echo "configure:6265: checking whether to build static libraries" >&5
6265 # Make sure either enable_shared or enable_static is yes.
6266 test "$enable_shared" = yes || enable_static=yes
6267 echo "$ac_t""$enable_static" 1>&6
6268
6269 if test "$hardcode_action" = relink; then
6270   # Fast installation is not supported
6271   enable_fast_install=no
6272 elif test "$shlibpath_overrides_runpath" = yes ||
6273      test "$enable_shared" = no; then
6274   # Fast installation is not necessary
6275   enable_fast_install=needless
6276 fi
6277
6278 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
6279 if test "$GCC" = yes; then
6280   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
6281 fi
6282
6283 if test "x$enable_dlopen" != xyes; then
6284   enable_dlopen=unknown
6285   enable_dlopen_self=unknown
6286   enable_dlopen_self_static=unknown
6287 else
6288   lt_cv_dlopen=no
6289   lt_cv_dlopen_libs=
6290
6291   case $host_os in
6292   beos*)
6293     lt_cv_dlopen="load_add_on"
6294     lt_cv_dlopen_libs=
6295     lt_cv_dlopen_self=yes
6296     ;;
6297
6298   cygwin* | mingw* | pw32*)
6299     lt_cv_dlopen="LoadLibrary"
6300     lt_cv_dlopen_libs=
6301    ;;
6302
6303   *)
6304     echo $ac_n "checking for dllload""... $ac_c" 1>&6
6305 echo "configure:6306: checking for dllload" >&5
6306 if eval "test \"\${ac_cv_func_dllload+set}\" = set"; then
6307   echo $ac_n "(cached) $ac_c" 1>&6
6308 else
6309   cat > conftest.$ac_ext <<EOF
6310 #line 6311 "configure"
6311 #include "confdefs.h"
6312 /* System header to define __stub macros and hopefully few prototypes,
6313     which can conflict with char dllload(); below.  */
6314 #include <assert.h>
6315 /* Override any gcc2 internal prototype to avoid an error.  */
6316 /* We use char because int might match the return type of a gcc2
6317     builtin and then its argument prototype would still apply.  */
6318 char dllload();
6319 char (*f)();
6320
6321 int main() {
6322
6323 /* The GNU C library defines this for functions which it implements
6324     to always fail with ENOSYS.  Some functions are actually named
6325     something starting with __ and the normal name is an alias.  */
6326 #if defined (__stub_dllload) || defined (__stub___dllload)
6327 choke me
6328 #else
6329 f = dllload;
6330 #endif
6331
6332 ; return 0; }
6333 EOF
6334 if { (eval echo configure:6335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6335   rm -rf conftest*
6336   eval "ac_cv_func_dllload=yes"
6337 else
6338   echo "configure: failed program was:" >&5
6339   cat conftest.$ac_ext >&5
6340   rm -rf conftest*
6341   eval "ac_cv_func_dllload=no"
6342 fi
6343 rm -f conftest*
6344 fi
6345
6346 if eval "test \"`echo '$ac_cv_func_'dllload`\" = yes"; then
6347   echo "$ac_t""yes" 1>&6
6348   lt_cv_dlopen="dllload"
6349 else
6350   echo "$ac_t""no" 1>&6
6351 echo $ac_n "checking for shl_load""... $ac_c" 1>&6
6352 echo "configure:6353: checking for shl_load" >&5
6353 if eval "test \"\${ac_cv_func_shl_load+set}\" = set"; then
6354   echo $ac_n "(cached) $ac_c" 1>&6
6355 else
6356   cat > conftest.$ac_ext <<EOF
6357 #line 6358 "configure"
6358 #include "confdefs.h"
6359 /* System header to define __stub macros and hopefully few prototypes,
6360     which can conflict with char shl_load(); below.  */
6361 #include <assert.h>
6362 /* Override any gcc2 internal prototype to avoid an error.  */
6363 /* We use char because int might match the return type of a gcc2
6364     builtin and then its argument prototype would still apply.  */
6365 char shl_load();
6366 char (*f)();
6367
6368 int main() {
6369
6370 /* The GNU C library defines this for functions which it implements
6371     to always fail with ENOSYS.  Some functions are actually named
6372     something starting with __ and the normal name is an alias.  */
6373 #if defined (__stub_shl_load) || defined (__stub___shl_load)
6374 choke me
6375 #else
6376 f = shl_load;
6377 #endif
6378
6379 ; return 0; }
6380 EOF
6381 if { (eval echo configure:6382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6382   rm -rf conftest*
6383   eval "ac_cv_func_shl_load=yes"
6384 else
6385   echo "configure: failed program was:" >&5
6386   cat conftest.$ac_ext >&5
6387   rm -rf conftest*
6388   eval "ac_cv_func_shl_load=no"
6389 fi
6390 rm -f conftest*
6391 fi
6392
6393 if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
6394   echo "$ac_t""yes" 1>&6
6395   lt_cv_dlopen="shl_load"
6396 else
6397   echo "$ac_t""no" 1>&6
6398 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
6399 echo "configure:6400: checking for shl_load in -ldld" >&5
6400 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-:%__p__%'`
6401 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6402   echo $ac_n "(cached) $ac_c" 1>&6
6403 else
6404   ac_save_LIBS="$LIBS"
6405 LIBS="-ldld  $LIBS"
6406 cat > conftest.$ac_ext <<EOF
6407 #line 6408 "configure"
6408 #include "confdefs.h"
6409 /* Override any gcc2 internal prototype to avoid an error.  */
6410 /* We use char because int might match the return type of a gcc2
6411     builtin and then its argument prototype would still apply.  */
6412 char shl_load();
6413
6414 int main() {
6415 shl_load()
6416 ; return 0; }
6417 EOF
6418 if { (eval echo configure:6419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6419   rm -rf conftest*
6420   eval "ac_cv_lib_$ac_lib_var=yes"
6421 else
6422   echo "configure: failed program was:" >&5
6423   cat conftest.$ac_ext >&5
6424   rm -rf conftest*
6425   eval "ac_cv_lib_$ac_lib_var=no"
6426 fi
6427 rm -f conftest*
6428 LIBS="$ac_save_LIBS"
6429
6430 fi
6431 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6432   echo "$ac_t""yes" 1>&6
6433   lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
6434 else
6435   echo "$ac_t""no" 1>&6
6436 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
6437 echo "configure:6438: checking for dlopen" >&5
6438 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
6439   echo $ac_n "(cached) $ac_c" 1>&6
6440 else
6441   cat > conftest.$ac_ext <<EOF
6442 #line 6443 "configure"
6443 #include "confdefs.h"
6444 /* System header to define __stub macros and hopefully few prototypes,
6445     which can conflict with char dlopen(); below.  */
6446 #include <assert.h>
6447 /* Override any gcc2 internal prototype to avoid an error.  */
6448 /* We use char because int might match the return type of a gcc2
6449     builtin and then its argument prototype would still apply.  */
6450 char dlopen();
6451 char (*f)();
6452
6453 int main() {
6454
6455 /* The GNU C library defines this for functions which it implements
6456     to always fail with ENOSYS.  Some functions are actually named
6457     something starting with __ and the normal name is an alias.  */
6458 #if defined (__stub_dlopen) || defined (__stub___dlopen)
6459 choke me
6460 #else
6461 f = dlopen;
6462 #endif
6463
6464 ; return 0; }
6465 EOF
6466 if { (eval echo configure:6467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6467   rm -rf conftest*
6468   eval "ac_cv_func_dlopen=yes"
6469 else
6470   echo "configure: failed program was:" >&5
6471   cat conftest.$ac_ext >&5
6472   rm -rf conftest*
6473   eval "ac_cv_func_dlopen=no"
6474 fi
6475 rm -f conftest*
6476 fi
6477
6478 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
6479   echo "$ac_t""yes" 1>&6
6480   lt_cv_dlopen="dlopen"
6481 else
6482   echo "$ac_t""no" 1>&6
6483 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
6484 echo "configure:6485: checking for dlopen in -ldl" >&5
6485 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
6486 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6487   echo $ac_n "(cached) $ac_c" 1>&6
6488 else
6489   ac_save_LIBS="$LIBS"
6490 LIBS="-ldl  $LIBS"
6491 cat > conftest.$ac_ext <<EOF
6492 #line 6493 "configure"
6493 #include "confdefs.h"
6494 /* Override any gcc2 internal prototype to avoid an error.  */
6495 /* We use char because int might match the return type of a gcc2
6496     builtin and then its argument prototype would still apply.  */
6497 char dlopen();
6498
6499 int main() {
6500 dlopen()
6501 ; return 0; }
6502 EOF
6503 if { (eval echo configure:6504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6504   rm -rf conftest*
6505   eval "ac_cv_lib_$ac_lib_var=yes"
6506 else
6507   echo "configure: failed program was:" >&5
6508   cat conftest.$ac_ext >&5
6509   rm -rf conftest*
6510   eval "ac_cv_lib_$ac_lib_var=no"
6511 fi
6512 rm -f conftest*
6513 LIBS="$ac_save_LIBS"
6514
6515 fi
6516 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6517   echo "$ac_t""yes" 1>&6
6518   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
6519 else
6520   echo "$ac_t""no" 1>&6
6521 echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
6522 echo "configure:6523: checking for dlopen in -lsvld" >&5
6523 ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-:%__p__%'`
6524 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6525   echo $ac_n "(cached) $ac_c" 1>&6
6526 else
6527   ac_save_LIBS="$LIBS"
6528 LIBS="-lsvld  $LIBS"
6529 cat > conftest.$ac_ext <<EOF
6530 #line 6531 "configure"
6531 #include "confdefs.h"
6532 /* Override any gcc2 internal prototype to avoid an error.  */
6533 /* We use char because int might match the return type of a gcc2
6534     builtin and then its argument prototype would still apply.  */
6535 char dlopen();
6536
6537 int main() {
6538 dlopen()
6539 ; return 0; }
6540 EOF
6541 if { (eval echo configure:6542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6542   rm -rf conftest*
6543   eval "ac_cv_lib_$ac_lib_var=yes"
6544 else
6545   echo "configure: failed program was:" >&5
6546   cat conftest.$ac_ext >&5
6547   rm -rf conftest*
6548   eval "ac_cv_lib_$ac_lib_var=no"
6549 fi
6550 rm -f conftest*
6551 LIBS="$ac_save_LIBS"
6552
6553 fi
6554 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6555   echo "$ac_t""yes" 1>&6
6556   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
6557 else
6558   echo "$ac_t""no" 1>&6
6559 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
6560 echo "configure:6561: checking for dld_link in -ldld" >&5
6561 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-:%__p__%'`
6562 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6563   echo $ac_n "(cached) $ac_c" 1>&6
6564 else
6565   ac_save_LIBS="$LIBS"
6566 LIBS="-ldld  $LIBS"
6567 cat > conftest.$ac_ext <<EOF
6568 #line 6569 "configure"
6569 #include "confdefs.h"
6570 /* Override any gcc2 internal prototype to avoid an error.  */
6571 /* We use char because int might match the return type of a gcc2
6572     builtin and then its argument prototype would still apply.  */
6573 char dld_link();
6574
6575 int main() {
6576 dld_link()
6577 ; return 0; }
6578 EOF
6579 if { (eval echo configure:6580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6580   rm -rf conftest*
6581   eval "ac_cv_lib_$ac_lib_var=yes"
6582 else
6583   echo "configure: failed program was:" >&5
6584   cat conftest.$ac_ext >&5
6585   rm -rf conftest*
6586   eval "ac_cv_lib_$ac_lib_var=no"
6587 fi
6588 rm -f conftest*
6589 LIBS="$ac_save_LIBS"
6590
6591 fi
6592 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6593   echo "$ac_t""yes" 1>&6
6594   lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
6595 else
6596   echo "$ac_t""no" 1>&6
6597 fi
6598
6599               
6600 fi
6601
6602             
6603 fi
6604
6605           
6606 fi
6607
6608         
6609 fi
6610
6611       
6612 fi
6613
6614     
6615 fi
6616
6617     ;;
6618   esac
6619
6620   if test "x$lt_cv_dlopen" != xno; then
6621     enable_dlopen=yes
6622   else
6623     enable_dlopen=no
6624   fi
6625
6626   case $lt_cv_dlopen in
6627   dlopen)
6628     save_CPPFLAGS="$CPPFLAGS"
6629         test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
6630
6631     save_LDFLAGS="$LDFLAGS"
6632     eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
6633
6634     save_LIBS="$LIBS"
6635     LIBS="$lt_cv_dlopen_libs $LIBS"
6636
6637     echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
6638 echo "configure:6639: checking whether a program can dlopen itself" >&5
6639 if eval "test \"\${lt_cv_dlopen_self+set}\" = set"; then
6640   echo $ac_n "(cached) $ac_c" 1>&6
6641 else
6642           if test "$cross_compiling" = yes; then :
6643   lt_cv_dlopen_self=cross
6644 else
6645     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
6646   lt_status=$lt_dlunknown
6647   cat > conftest.$ac_ext <<EOF
6648 #line 6649 "configure"
6649 #include "confdefs.h"
6650
6651 #if HAVE_DLFCN_H
6652 #include <dlfcn.h>
6653 #endif
6654
6655 #include <stdio.h>
6656
6657 #ifdef RTLD_GLOBAL
6658 #  define LT_DLGLOBAL           RTLD_GLOBAL
6659 #else
6660 #  ifdef DL_GLOBAL
6661 #    define LT_DLGLOBAL         DL_GLOBAL
6662 #  else
6663 #    define LT_DLGLOBAL         0
6664 #  endif
6665 #endif
6666
6667 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
6668    find out it does not work in some platform. */
6669 #ifndef LT_DLLAZY_OR_NOW
6670 #  ifdef RTLD_LAZY
6671 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
6672 #  else
6673 #    ifdef DL_LAZY
6674 #      define LT_DLLAZY_OR_NOW          DL_LAZY
6675 #    else
6676 #      ifdef RTLD_NOW
6677 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
6678 #      else
6679 #        ifdef DL_NOW
6680 #          define LT_DLLAZY_OR_NOW      DL_NOW
6681 #        else
6682 #          define LT_DLLAZY_OR_NOW      0
6683 #        endif
6684 #      endif
6685 #    endif
6686 #  endif
6687 #endif
6688
6689 #ifdef __cplusplus
6690 extern "C" void exit (int);
6691 #endif
6692
6693 void fnord() { int i=42;}
6694 int main ()
6695 {
6696   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
6697   int status = $lt_dlunknown;
6698
6699   if (self)
6700     {
6701       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
6702       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
6703       /* dlclose (self); */
6704     }
6705
6706     exit (status);
6707 }
6708 EOF
6709   if { (eval echo configure:6710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
6710     (./conftest; exit; ) 2>/dev/null
6711     lt_status=$?
6712     case x$lt_status in
6713       x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
6714       x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
6715       x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
6716     esac
6717   else :
6718     # compilation failed
6719     lt_cv_dlopen_self=no
6720   fi
6721 fi
6722 rm -fr conftest*
6723
6724     
6725 fi
6726
6727 echo "$ac_t""$lt_cv_dlopen_self" 1>&6
6728
6729     if test "x$lt_cv_dlopen_self" = xyes; then
6730       LDFLAGS="$LDFLAGS $link_static_flag"
6731       echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
6732 echo "configure:6733: checking whether a statically linked program can dlopen itself" >&5
6733 if eval "test \"\${lt_cv_dlopen_self_static+set}\" = set"; then
6734   echo $ac_n "(cached) $ac_c" 1>&6
6735 else
6736           if test "$cross_compiling" = yes; then :
6737   lt_cv_dlopen_self_static=cross
6738 else
6739     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
6740   lt_status=$lt_dlunknown
6741   cat > conftest.$ac_ext <<EOF
6742 #line 6743 "configure"
6743 #include "confdefs.h"
6744
6745 #if HAVE_DLFCN_H
6746 #include <dlfcn.h>
6747 #endif
6748
6749 #include <stdio.h>
6750
6751 #ifdef RTLD_GLOBAL
6752 #  define LT_DLGLOBAL           RTLD_GLOBAL
6753 #else
6754 #  ifdef DL_GLOBAL
6755 #    define LT_DLGLOBAL         DL_GLOBAL
6756 #  else
6757 #    define LT_DLGLOBAL         0
6758 #  endif
6759 #endif
6760
6761 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
6762    find out it does not work in some platform. */
6763 #ifndef LT_DLLAZY_OR_NOW
6764 #  ifdef RTLD_LAZY
6765 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
6766 #  else
6767 #    ifdef DL_LAZY
6768 #      define LT_DLLAZY_OR_NOW          DL_LAZY
6769 #    else
6770 #      ifdef RTLD_NOW
6771 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
6772 #      else
6773 #        ifdef DL_NOW
6774 #          define LT_DLLAZY_OR_NOW      DL_NOW
6775 #        else
6776 #          define LT_DLLAZY_OR_NOW      0
6777 #        endif
6778 #      endif
6779 #    endif
6780 #  endif
6781 #endif
6782
6783 #ifdef __cplusplus
6784 extern "C" void exit (int);
6785 #endif
6786
6787 void fnord() { int i=42;}
6788 int main ()
6789 {
6790   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
6791   int status = $lt_dlunknown;
6792
6793   if (self)
6794     {
6795       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
6796       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
6797       /* dlclose (self); */
6798     }
6799
6800     exit (status);
6801 }
6802 EOF
6803   if { (eval echo configure:6804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
6804     (./conftest; exit; ) 2>/dev/null
6805     lt_status=$?
6806     case x$lt_status in
6807       x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
6808       x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
6809       x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
6810     esac
6811   else :
6812     # compilation failed
6813     lt_cv_dlopen_self_static=no
6814   fi
6815 fi
6816 rm -fr conftest*
6817
6818       
6819 fi
6820
6821 echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
6822     fi
6823
6824     CPPFLAGS="$save_CPPFLAGS"
6825     LDFLAGS="$save_LDFLAGS"
6826     LIBS="$save_LIBS"
6827     ;;
6828   esac
6829
6830   case $lt_cv_dlopen_self in
6831   yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
6832   *) enable_dlopen_self=unknown ;;
6833   esac
6834
6835   case $lt_cv_dlopen_self_static in
6836   yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
6837   *) enable_dlopen_self_static=unknown ;;
6838   esac
6839 fi
6840
6841
6842 if test "$enable_shared" = yes && test "$GCC" = yes; then
6843   case $archive_cmds in
6844   *'~'*)
6845     # FIXME: we may have to deal with multi-command sequences.
6846     ;;
6847   '$CC '*)
6848     # Test whether the compiler implicitly links with -lc since on some
6849     # systems, -lgcc has to come before -lc. If gcc already passes -lc
6850     # to ld, don't add -lc before -lgcc.
6851     echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6
6852 echo "configure:6853: checking whether -lc should be explicitly linked in" >&5
6853     if eval "test \"\${lt_cv_archive_cmds_need_lc+set}\" = set"; then
6854   echo $ac_n "(cached) $ac_c" 1>&6
6855 else
6856   $rm conftest*
6857     echo 'static int dummy;' > conftest.$ac_ext
6858
6859     if { (eval echo configure:6860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6860       soname=conftest
6861       lib=conftest
6862       libobjs=conftest.$ac_objext
6863       deplibs=
6864       wl=$lt_cv_prog_cc_wl
6865       compiler_flags=-v
6866       linker_flags=-v
6867       verstring=
6868       output_objdir=.
6869       libname=conftest
6870       save_allow_undefined_flag=$allow_undefined_flag
6871       allow_undefined_flag=
6872       if { (eval echo configure:6873: \"$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; }
6873       then
6874         lt_cv_archive_cmds_need_lc=no
6875       else
6876         lt_cv_archive_cmds_need_lc=yes
6877       fi
6878       allow_undefined_flag=$save_allow_undefined_flag
6879     else
6880       cat conftest.err 1>&5
6881     fi
6882 fi
6883
6884     echo "$ac_t""$lt_cv_archive_cmds_need_lc" 1>&6
6885     ;;
6886   esac
6887 fi
6888 need_lc=${lt_cv_archive_cmds_need_lc-yes}
6889
6890 # The second clause should only fire when bootstrapping the
6891 # libtool distribution, otherwise you forgot to ship ltmain.sh
6892 # with your package, and you will get complaints that there are
6893 # no rules to generate ltmain.sh.
6894 if test -f "$ltmain"; then
6895   :
6896 else
6897   # If there is no Makefile yet, we rely on a make rule to execute
6898   # `config.status --recheck' to rerun these tests and create the
6899   # libtool script then.
6900   test -f Makefile && make "$ltmain"
6901 fi
6902
6903 if test -f "$ltmain"; then
6904   trap "$rm \"${ofile}T\"; exit 1" 1 2 15
6905   $rm -f "${ofile}T"
6906
6907   echo creating $ofile
6908
6909   # Now quote all the things that may contain metacharacters while being
6910   # careful not to overquote the AC_SUBSTed values.  We take copies of the
6911   # variables and quote the copies for generation of the libtool script.
6912   for var in echo old_CC old_CFLAGS SED \
6913     AR AR_FLAGS CC LD LN_S NM SHELL \
6914     reload_flag reload_cmds wl \
6915     pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
6916     thread_safe_flag_spec whole_archive_flag_spec libname_spec \
6917     library_names_spec soname_spec \
6918     RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
6919     old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
6920     postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
6921     old_striplib striplib file_magic_cmd export_symbols_cmds \
6922     deplibs_check_method allow_undefined_flag no_undefined_flag \
6923     finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
6924     global_symbol_to_c_name_address \
6925     hardcode_libdir_flag_spec hardcode_libdir_separator  \
6926     sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
6927     compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
6928
6929     case $var in
6930     reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
6931     old_postinstall_cmds | old_postuninstall_cmds | \
6932     export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
6933     extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
6934     postinstall_cmds | postuninstall_cmds | \
6935     finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
6936       # Double-quote double-evaled strings.
6937       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
6938       ;;
6939     *)
6940       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
6941       ;;
6942     esac
6943   done
6944
6945   cat <<__EOF__ > "${ofile}T"
6946 #! $SHELL
6947
6948 # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
6949 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
6950 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
6951 #
6952 # Copyright (C) 1996-2000 Free Software Foundation, Inc.
6953 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
6954 #
6955 # This program is free software; you can redistribute it and/or modify
6956 # it under the terms of the GNU General Public License as published by
6957 # the Free Software Foundation; either version 2 of the License, or
6958 # (at your option) any later version.
6959 #
6960 # This program is distributed in the hope that it will be useful, but
6961 # WITHOUT ANY WARRANTY; without even the implied warranty of
6962 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
6963 # General Public License for more details.
6964 #
6965 # You should have received a copy of the GNU General Public License
6966 # along with this program; if not, write to the Free Software
6967 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
6968 #
6969 # As a special exception to the GNU General Public License, if you
6970 # distribute this file as part of a program that contains a
6971 # configuration script generated by Autoconf, you may include it under
6972 # the same distribution terms that you use for the rest of that program.
6973
6974 # A sed that does not truncate output.
6975 SED=$lt_SED
6976
6977 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
6978 Xsed="${SED} -e s/^X//"
6979
6980 # The HP-UX ksh and POSIX shell print the target directory to stdout
6981 # if CDPATH is set.
6982 if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
6983
6984 # ### BEGIN LIBTOOL CONFIG
6985
6986 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
6987
6988 # Shell to use when invoking shell scripts.
6989 SHELL=$lt_SHELL
6990
6991 # Whether or not to build shared libraries.
6992 build_libtool_libs=$enable_shared
6993
6994 # Whether or not to build static libraries.
6995 build_old_libs=$enable_static
6996
6997 # Whether or not to add -lc for building shared libraries.
6998 build_libtool_need_lc=$need_lc
6999
7000 # Whether or not to optimize for fast installation.
7001 fast_install=$enable_fast_install
7002
7003 # The host system.
7004 host_alias=$host_alias
7005 host=$host
7006
7007 # An echo program that does not interpret backslashes.
7008 echo=$lt_echo
7009
7010 # The archiver.
7011 AR=$lt_AR
7012 AR_FLAGS=$lt_AR_FLAGS
7013
7014 # The default C compiler.
7015 CC=$lt_CC
7016
7017 # Is the compiler the GNU C compiler?
7018 with_gcc=$GCC
7019
7020 # The linker used to build libraries.
7021 LD=$lt_LD
7022
7023 # Whether we need hard or soft links.
7024 LN_S=$lt_LN_S
7025
7026 # A BSD-compatible nm program.
7027 NM=$lt_NM
7028
7029 # A symbol stripping program
7030 STRIP=$STRIP
7031
7032 # Used to examine libraries when file_magic_cmd begins "file"
7033 MAGIC_CMD=$MAGIC_CMD
7034
7035 # Used on cygwin: DLL creation program.
7036 DLLTOOL="$DLLTOOL"
7037
7038 # Used on cygwin: object dumper.
7039 OBJDUMP="$OBJDUMP"
7040
7041 # Used on cygwin: assembler.
7042 AS="$AS"
7043
7044 # The name of the directory that contains temporary libtool files.
7045 objdir=$objdir
7046
7047 # How to create reloadable object files.
7048 reload_flag=$lt_reload_flag
7049 reload_cmds=$lt_reload_cmds
7050
7051 # How to pass a linker flag through the compiler.
7052 wl=$lt_wl
7053
7054 # Object file suffix (normally "o").
7055 objext="$ac_objext"
7056
7057 # Old archive suffix (normally "a").
7058 libext="$libext"
7059
7060 # Executable file suffix (normally "").
7061 exeext="$exeext"
7062
7063 # Additional compiler flags for building library objects.
7064 pic_flag=$lt_pic_flag
7065 pic_mode=$pic_mode
7066
7067 # Does compiler simultaneously support -c and -o options?
7068 compiler_c_o=$lt_compiler_c_o
7069
7070 # Can we write directly to a .lo ?
7071 compiler_o_lo=$lt_compiler_o_lo
7072
7073 # Must we lock files when doing compilation ?
7074 need_locks=$lt_need_locks
7075
7076 # Do we need the lib prefix for modules?
7077 need_lib_prefix=$need_lib_prefix
7078
7079 # Do we need a version for libraries?
7080 need_version=$need_version
7081
7082 # Whether dlopen is supported.
7083 dlopen_support=$enable_dlopen
7084
7085 # Whether dlopen of programs is supported.
7086 dlopen_self=$enable_dlopen_self
7087
7088 # Whether dlopen of statically linked programs is supported.
7089 dlopen_self_static=$enable_dlopen_self_static
7090
7091 # Compiler flag to prevent dynamic linking.
7092 link_static_flag=$lt_link_static_flag
7093
7094 # Compiler flag to turn off builtin functions.
7095 no_builtin_flag=$lt_no_builtin_flag
7096
7097 # Compiler flag to allow reflexive dlopens.
7098 export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
7099
7100 # Compiler flag to generate shared objects directly from archives.
7101 whole_archive_flag_spec=$lt_whole_archive_flag_spec
7102
7103 # Compiler flag to generate thread-safe objects.
7104 thread_safe_flag_spec=$lt_thread_safe_flag_spec
7105
7106 # Library versioning type.
7107 version_type=$version_type
7108
7109 # Format of library name prefix.
7110 libname_spec=$lt_libname_spec
7111
7112 # List of archive names.  First name is the real one, the rest are links.
7113 # The last name is the one that the linker finds with -lNAME.
7114 library_names_spec=$lt_library_names_spec
7115
7116 # The coded name of the library, if different from the real name.
7117 soname_spec=$lt_soname_spec
7118
7119 # Commands used to build and install an old-style archive.
7120 RANLIB=$lt_RANLIB
7121 old_archive_cmds=$lt_old_archive_cmds
7122 old_postinstall_cmds=$lt_old_postinstall_cmds
7123 old_postuninstall_cmds=$lt_old_postuninstall_cmds
7124
7125 # Create an old-style archive from a shared archive.
7126 old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
7127
7128 # Create a temporary old-style archive to link instead of a shared archive.
7129 old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
7130
7131 # Commands used to build and install a shared archive.
7132 archive_cmds=$lt_archive_cmds
7133 archive_expsym_cmds=$lt_archive_expsym_cmds
7134 postinstall_cmds=$lt_postinstall_cmds
7135 postuninstall_cmds=$lt_postuninstall_cmds
7136
7137 # Commands to strip libraries.
7138 old_striplib=$lt_old_striplib
7139 striplib=$lt_striplib
7140
7141 # Method to check whether dependent libraries are shared objects.
7142 deplibs_check_method=$lt_deplibs_check_method
7143
7144 # Command to use when deplibs_check_method == file_magic.
7145 file_magic_cmd=$lt_file_magic_cmd
7146
7147 # Flag that allows shared libraries with undefined symbols to be built.
7148 allow_undefined_flag=$lt_allow_undefined_flag
7149
7150 # Flag that forces no undefined symbols.
7151 no_undefined_flag=$lt_no_undefined_flag
7152
7153 # Commands used to finish a libtool library installation in a directory.
7154 finish_cmds=$lt_finish_cmds
7155
7156 # Same as above, but a single script fragment to be evaled but not shown.
7157 finish_eval=$lt_finish_eval
7158
7159 # Take the output of nm and produce a listing of raw symbols and C names.
7160 global_symbol_pipe=$lt_global_symbol_pipe
7161
7162 # Transform the output of nm in a proper C declaration
7163 global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
7164
7165 # Transform the output of nm in a C name address pair
7166 global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
7167
7168 # This is the shared library runtime path variable.
7169 runpath_var=$runpath_var
7170
7171 # This is the shared library path variable.
7172 shlibpath_var=$shlibpath_var
7173
7174 # Is shlibpath searched before the hard-coded library search path?
7175 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
7176
7177 # How to hardcode a shared library path into an executable.
7178 hardcode_action=$hardcode_action
7179
7180 # Whether we should hardcode library paths into libraries.
7181 hardcode_into_libs=$hardcode_into_libs
7182
7183 # Flag to hardcode \$libdir into a binary during linking.
7184 # This must work even if \$libdir does not exist.
7185 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
7186
7187 # Whether we need a single -rpath flag with a separated argument.
7188 hardcode_libdir_separator=$lt_hardcode_libdir_separator
7189
7190 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
7191 # resulting binary.
7192 hardcode_direct=$hardcode_direct
7193
7194 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7195 # resulting binary.
7196 hardcode_minus_L=$hardcode_minus_L
7197
7198 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7199 # the resulting binary.
7200 hardcode_shlibpath_var=$hardcode_shlibpath_var
7201
7202 # Variables whose values should be saved in libtool wrapper scripts and
7203 # restored at relink time.
7204 variables_saved_for_relink="$variables_saved_for_relink"
7205
7206 # Whether libtool must link a program against all its dependency libraries.
7207 link_all_deplibs=$link_all_deplibs
7208
7209 # Compile-time system search path for libraries
7210 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
7211
7212 # Run-time system search path for libraries
7213 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
7214
7215 # Fix the shell variable \$srcfile for the compiler.
7216 fix_srcfile_path="$fix_srcfile_path"
7217
7218 # Set to yes if exported symbols are required.
7219 always_export_symbols=$always_export_symbols
7220
7221 # The commands to list exported symbols.
7222 export_symbols_cmds=$lt_export_symbols_cmds
7223
7224 # The commands to extract the exported symbol list from a shared archive.
7225 extract_expsyms_cmds=$lt_extract_expsyms_cmds
7226
7227 # Symbols that should not be listed in the preloaded symbols.
7228 exclude_expsyms=$lt_exclude_expsyms
7229
7230 # Symbols that must always be exported.
7231 include_expsyms=$lt_include_expsyms
7232
7233 # ### END LIBTOOL CONFIG
7234
7235 __EOF__
7236
7237   case $host_os in
7238   aix3*)
7239     cat <<\EOF >> "${ofile}T"
7240
7241 # AIX sometimes has problems with the GCC collect2 program.  For some
7242 # reason, if we set the COLLECT_NAMES environment variable, the problems
7243 # vanish in a puff of smoke.
7244 if test "X${COLLECT_NAMES+set}" != Xset; then
7245   COLLECT_NAMES=
7246   export COLLECT_NAMES
7247 fi
7248 EOF
7249     ;;
7250   esac
7251
7252   case $host_os in
7253   cygwin* | mingw* | pw32* | os2*)
7254     cat <<'EOF' >> "${ofile}T"
7255       # This is a source program that is used to create dlls on Windows
7256       # Don't remove nor modify the starting and closing comments
7257 # /* ltdll.c starts here */
7258 # #define WIN32_LEAN_AND_MEAN
7259 # #include <windows.h>
7260 # #undef WIN32_LEAN_AND_MEAN
7261 # #include <stdio.h>
7262 #
7263 # #ifndef __CYGWIN__
7264 # #  ifdef __CYGWIN32__
7265 # #    define __CYGWIN__ __CYGWIN32__
7266 # #  endif
7267 # #endif
7268 #
7269 # #ifdef __cplusplus
7270 # extern "C" {
7271 # #endif
7272 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
7273 # #ifdef __cplusplus
7274 # }
7275 # #endif
7276 #
7277 # #ifdef __CYGWIN__
7278 # #include <cygwin/cygwin_dll.h>
7279 # DECLARE_CYGWIN_DLL( DllMain );
7280 # #endif
7281 # HINSTANCE __hDllInstance_base;
7282 #
7283 # BOOL APIENTRY
7284 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
7285 # {
7286 #   __hDllInstance_base = hInst;
7287 #   return TRUE;
7288 # }
7289 # /* ltdll.c ends here */
7290         # This is a source program that is used to create import libraries
7291         # on Windows for dlls which lack them. Don't remove nor modify the
7292         # starting and closing comments
7293 # /* impgen.c starts here */
7294 # /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
7295 #
7296 #  This file is part of GNU libtool.
7297 #
7298 #  This program is free software; you can redistribute it and/or modify
7299 #  it under the terms of the GNU General Public License as published by
7300 #  the Free Software Foundation; either version 2 of the License, or
7301 #  (at your option) any later version.
7302 #
7303 #  This program is distributed in the hope that it will be useful,
7304 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
7305 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
7306 #  GNU General Public License for more details.
7307 #
7308 #  You should have received a copy of the GNU General Public License
7309 #  along with this program; if not, write to the Free Software
7310 #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
7311 #  */
7312 #
7313 # #include <stdio.h>            /* for printf() */
7314 # #include <unistd.h>           /* for open(), lseek(), read() */
7315 # #include <fcntl.h>            /* for O_RDONLY, O_BINARY */
7316 # #include <string.h>           /* for strdup() */
7317 #
7318 # /* O_BINARY isn't required (or even defined sometimes) under Unix */
7319 # #ifndef O_BINARY
7320 # #define O_BINARY 0
7321 # #endif
7322 #
7323 # static unsigned int
7324 # pe_get16 (fd, offset)
7325 #      int fd;
7326 #      int offset;
7327 # {
7328 #   unsigned char b[2];
7329 #   lseek (fd, offset, SEEK_SET);
7330 #   read (fd, b, 2);
7331 #   return b[0] + (b[1]<<8);
7332 # }
7333 #
7334 # static unsigned int
7335 # pe_get32 (fd, offset)
7336 #     int fd;
7337 #     int offset;
7338 # {
7339 #   unsigned char b[4];
7340 #   lseek (fd, offset, SEEK_SET);
7341 #   read (fd, b, 4);
7342 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
7343 # }
7344 #
7345 # static unsigned int
7346 # pe_as32 (ptr)
7347 #      void *ptr;
7348 # {
7349 #   unsigned char *b = ptr;
7350 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
7351 # }
7352 #
7353 # int
7354 # main (argc, argv)
7355 #     int argc;
7356 #     char *argv[];
7357 # {
7358 #     int dll;
7359 #     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
7360 #     unsigned long export_rva, export_size, nsections, secptr, expptr;
7361 #     unsigned long name_rvas, nexp;
7362 #     unsigned char *expdata, *erva;
7363 #     char *filename, *dll_name;
7364 #
7365 #     filename = argv[1];
7366 #
7367 #     dll = open(filename, O_RDONLY|O_BINARY);
7368 #     if (dll < 1)
7369 #       return 1;
7370 #
7371 #     dll_name = filename;
7372 #
7373 #     for (i=0; filename[i]; i++)
7374 #       if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
7375 #           dll_name = filename + i +1;
7376 #
7377 #     pe_header_offset = pe_get32 (dll, 0x3c);
7378 #     opthdr_ofs = pe_header_offset + 4 + 20;
7379 #     num_entries = pe_get32 (dll, opthdr_ofs + 92);
7380 #
7381 #     if (num_entries < 1) /* no exports */
7382 #       return 1;
7383 #
7384 #     export_rva = pe_get32 (dll, opthdr_ofs + 96);
7385 #     export_size = pe_get32 (dll, opthdr_ofs + 100);
7386 #     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
7387 #     secptr = (pe_header_offset + 4 + 20 +
7388 #             pe_get16 (dll, pe_header_offset + 4 + 16));
7389 #
7390 #     expptr = 0;
7391 #     for (i = 0; i < nsections; i++)
7392 #     {
7393 #       char sname[8];
7394 #       unsigned long secptr1 = secptr + 40 * i;
7395 #       unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
7396 #       unsigned long vsize = pe_get32 (dll, secptr1 + 16);
7397 #       unsigned long fptr = pe_get32 (dll, secptr1 + 20);
7398 #       lseek(dll, secptr1, SEEK_SET);
7399 #       read(dll, sname, 8);
7400 #       if (vaddr <= export_rva && vaddr+vsize > export_rva)
7401 #       {
7402 #           expptr = fptr + (export_rva - vaddr);
7403 #           if (export_rva + export_size > vaddr + vsize)
7404 #               export_size = vsize - (export_rva - vaddr);
7405 #           break;
7406 #       }
7407 #     }
7408 #
7409 #     expdata = (unsigned char*)malloc(export_size);
7410 #     lseek (dll, expptr, SEEK_SET);
7411 #     read (dll, expdata, export_size);
7412 #     erva = expdata - export_rva;
7413 #
7414 #     nexp = pe_as32 (expdata+24);
7415 #     name_rvas = pe_as32 (expdata+32);
7416 #
7417 #     printf ("EXPORTS\n");
7418 #     for (i = 0; i<nexp; i++)
7419 #     {
7420 #       unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
7421 #       printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
7422 #     }
7423 #
7424 #     return 0;
7425 # }
7426 # /* impgen.c ends here */
7427
7428 EOF
7429     ;;
7430   esac
7431
7432   # We use sed instead of cat because bash on DJGPP gets confused if
7433   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
7434   # text mode, it properly converts lines to CR/LF.  This bash problem
7435   # is reportedly fixed, but why not run on old versions too?
7436   sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
7437
7438   mv -f "${ofile}T" "$ofile" || \
7439     (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
7440   chmod +x "$ofile"
7441 fi
7442
7443
7444
7445
7446
7447 # This can be used to rebuild libtool when needed
7448 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
7449
7450 # Always use our own libtool.
7451 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
7452
7453 # Prevent multiple expansion
7454
7455
7456
7457 # test for ln hardlink support
7458 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
7459 echo "configure:7460: checking whether ln works" >&5
7460 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
7461   echo $ac_n "(cached) $ac_c" 1>&6
7462 else
7463   rm -f conftest.src conftest.dst
7464 echo "conftest" > conftest.src
7465 if ln conftest.src conftest.dst 2>/dev/null
7466 then
7467   ol_cv_prog_LN_H="ln"
7468 else
7469   ol_cv_prog_LN_H="cp"
7470 fi
7471 rm -f conftest.src conftest.dst
7472
7473 fi
7474 LN_H="$ol_cv_prog_LN_H"
7475 if test "$ol_cv_prog_LN_H" = "ln"; then
7476         echo "$ac_t""yes" 1>&6
7477 else
7478         echo "$ac_t""no" 1>&6
7479 fi
7480
7481 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
7482 echo "configure:7483: checking whether ln -s works" >&5
7483 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
7484   echo $ac_n "(cached) $ac_c" 1>&6
7485 else
7486   rm -f conftestdata
7487 if ln -s X conftestdata 2>/dev/null
7488 then
7489   rm -f conftestdata
7490   ac_cv_prog_LN_S="ln -s"
7491 else
7492   ac_cv_prog_LN_S=ln
7493 fi
7494 fi
7495 LN_S="$ac_cv_prog_LN_S"
7496 if test "$ac_cv_prog_LN_S" = "ln -s"; then
7497   echo "$ac_t""yes" 1>&6
7498 else
7499   echo "$ac_t""no" 1>&6
7500 fi
7501
7502
7503 ol_link_perl=no
7504 if test $ol_enable_perl != no ; then
7505         # Extract the first word of "perl", so it can be a program name with args.
7506 set dummy perl; ac_word=$2
7507 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7508 echo "configure:7509: checking for $ac_word" >&5
7509 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
7510   echo $ac_n "(cached) $ac_c" 1>&6
7511 else
7512   case "$PERLBIN" in
7513   /*)
7514   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
7515   ;;
7516   ?:/*)
7517   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
7518   ;;
7519   *)
7520   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7521   ac_dummy="$PATH"
7522   for ac_dir in $ac_dummy; do 
7523     test -z "$ac_dir" && ac_dir=.
7524     if test -f $ac_dir/$ac_word; then
7525       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
7526       break
7527     fi
7528   done
7529   IFS="$ac_save_ifs"
7530   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
7531   ;;
7532 esac
7533 fi
7534 PERLBIN="$ac_cv_path_PERLBIN"
7535 if test -n "$PERLBIN"; then
7536   echo "$ac_t""$PERLBIN" 1>&6
7537 else
7538   echo "$ac_t""no" 1>&6
7539 fi
7540
7541
7542         if test "no$PERLBIN" = "no" ; then
7543                 if test $ol_enable_perl = yes ; then
7544                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
7545                 fi
7546
7547         else
7548                 PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
7549                 PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e 's/ -lc / /' -e 's/ -lc$//'`"
7550
7551                 if test x"$ol_enable_perl" = "xyes" ; then
7552                         SLAPD_PERL_LDFLAGS="$PERL_LDFLAGS"
7553                 else
7554                         MOD_PERL_LDFLAGS="$PERL_LDFLAGS"
7555                 fi
7556                                 ol_link_perl=yes
7557         fi
7558 fi
7559
7560 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
7561 echo "configure:7562: checking how to run the C preprocessor" >&5
7562 # On Suns, sometimes $CPP names a directory.
7563 if test -n "$CPP" && test -d "$CPP"; then
7564   CPP=
7565 fi
7566 if test -z "$CPP"; then
7567 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
7568   echo $ac_n "(cached) $ac_c" 1>&6
7569 else
7570     # This must be in double quotes, not single quotes, because CPP may get
7571   # substituted into the Makefile and "${CC-cc}" will confuse make.
7572   CPP="${CC-cc} -E"
7573   # On the NeXT, cc -E runs the code through the compiler's parser,
7574   # not just through cpp.
7575   cat > conftest.$ac_ext <<EOF
7576 #line 7577 "configure"
7577 #include "confdefs.h"
7578 #include <assert.h>
7579 Syntax Error
7580 EOF
7581 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7582 { (eval echo configure:7583: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7583 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7584 if test -z "$ac_err"; then
7585   :
7586 else
7587   echo "$ac_err" >&5
7588   echo "configure: failed program was:" >&5
7589   cat conftest.$ac_ext >&5
7590   rm -rf conftest*
7591   CPP="${CC-cc} -E -traditional-cpp"
7592   cat > conftest.$ac_ext <<EOF
7593 #line 7594 "configure"
7594 #include "confdefs.h"
7595 #include <assert.h>
7596 Syntax Error
7597 EOF
7598 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7599 { (eval echo configure:7600: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7600 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7601 if test -z "$ac_err"; then
7602   :
7603 else
7604   echo "$ac_err" >&5
7605   echo "configure: failed program was:" >&5
7606   cat conftest.$ac_ext >&5
7607   rm -rf conftest*
7608   CPP="${CC-cc} -nologo -E"
7609   cat > conftest.$ac_ext <<EOF
7610 #line 7611 "configure"
7611 #include "confdefs.h"
7612 #include <assert.h>
7613 Syntax Error
7614 EOF
7615 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7616 { (eval echo configure:7617: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7617 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7618 if test -z "$ac_err"; then
7619   :
7620 else
7621   echo "$ac_err" >&5
7622   echo "configure: failed program was:" >&5
7623   cat conftest.$ac_ext >&5
7624   rm -rf conftest*
7625   CPP=/lib/cpp
7626 fi
7627 rm -f conftest*
7628 fi
7629 rm -f conftest*
7630 fi
7631 rm -f conftest*
7632   ac_cv_prog_CPP="$CPP"
7633 fi
7634   CPP="$ac_cv_prog_CPP"
7635 else
7636   ac_cv_prog_CPP="$CPP"
7637 fi
7638 echo "$ac_t""$CPP" 1>&6
7639
7640
7641
7642 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
7643 echo "configure:7644: checking for Cygwin environment" >&5
7644 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
7645   echo $ac_n "(cached) $ac_c" 1>&6
7646 else
7647   cat > conftest.$ac_ext <<EOF
7648 #line 7649 "configure"
7649 #include "confdefs.h"
7650
7651 int main() {
7652
7653 #ifndef __CYGWIN__
7654 #define __CYGWIN__ __CYGWIN32__
7655 #endif
7656 return __CYGWIN__;
7657 ; return 0; }
7658 EOF
7659 if { (eval echo configure:7660: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7660   rm -rf conftest*
7661   ac_cv_cygwin=yes
7662 else
7663   echo "configure: failed program was:" >&5
7664   cat conftest.$ac_ext >&5
7665   rm -rf conftest*
7666   ac_cv_cygwin=no
7667 fi
7668 rm -f conftest*
7669 fi
7670
7671 echo "$ac_t""$ac_cv_cygwin" 1>&6
7672 CYGWIN=
7673 test "$ac_cv_cygwin" = yes && CYGWIN=yes
7674 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
7675 echo "configure:7676: checking for mingw32 environment" >&5
7676 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
7677   echo $ac_n "(cached) $ac_c" 1>&6
7678 else
7679   cat > conftest.$ac_ext <<EOF
7680 #line 7681 "configure"
7681 #include "confdefs.h"
7682
7683 int main() {
7684 return __MINGW32__;
7685 ; return 0; }
7686 EOF
7687 if { (eval echo configure:7688: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7688   rm -rf conftest*
7689   ac_cv_mingw32=yes
7690 else
7691   echo "configure: failed program was:" >&5
7692   cat conftest.$ac_ext >&5
7693   rm -rf conftest*
7694   ac_cv_mingw32=no
7695 fi
7696 rm -f conftest*
7697 fi
7698
7699 echo "$ac_t""$ac_cv_mingw32" 1>&6
7700 MINGW32=
7701 test "$ac_cv_mingw32" = yes && MINGW32=yes
7702
7703
7704
7705 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
7706 echo "configure:7707: checking for executable suffix" >&5
7707 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
7708   echo $ac_n "(cached) $ac_c" 1>&6
7709 else
7710   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
7711   ac_cv_exeext=.exe
7712 else
7713   rm -f conftest*
7714   echo 'int main () { return 0; }' > conftest.$ac_ext
7715   ac_cv_exeext=
7716   if { (eval echo configure:7717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
7717     for file in conftest.*; do
7718       case $file in
7719       *.c | *.C | *.o | *.obj | *.xcoff) ;;
7720       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
7721       esac
7722     done
7723   else
7724     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
7725   fi
7726   rm -f conftest*
7727   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
7728 fi
7729 fi
7730
7731 EXEEXT=""
7732 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
7733 echo "$ac_t""${ac_cv_exeext}" 1>&6
7734 ac_exeext=$EXEEXT
7735
7736 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
7737 echo "configure:7738: checking for object suffix" >&5
7738 if eval "test \"\${ac_cv_objext+set}\" = set"; then
7739   echo $ac_n "(cached) $ac_c" 1>&6
7740 else
7741   rm -f conftest*
7742 echo 'int i = 1;' > conftest.$ac_ext
7743 if { (eval echo configure:7744: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7744   for ac_file in conftest.*; do
7745     case $ac_file in
7746     *.c) ;;
7747     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
7748     esac
7749   done
7750 else
7751   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
7752 fi
7753 rm -f conftest*
7754 fi
7755
7756 echo "$ac_t""$ac_cv_objext" 1>&6
7757 OBJEXT=$ac_cv_objext
7758 ac_objext=$ac_cv_objext
7759
7760
7761 cat >> confdefs.h <<EOF
7762 #define EXEEXT "${EXEEXT}"
7763 EOF
7764
7765
7766 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
7767 echo "configure:7768: checking for be_app in -lbe" >&5
7768 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
7769 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
7770   echo $ac_n "(cached) $ac_c" 1>&6
7771 else
7772   ac_save_LIBS="$LIBS"
7773 LIBS="-lbe -lroot -lnet $LIBS"
7774 cat > conftest.$ac_ext <<EOF
7775 #line 7776 "configure"
7776 #include "confdefs.h"
7777 /* Override any gcc2 internal prototype to avoid an error.  */
7778 /* We use char because int might match the return type of a gcc2
7779     builtin and then its argument prototype would still apply.  */
7780 char be_app();
7781
7782 int main() {
7783 be_app()
7784 ; return 0; }
7785 EOF
7786 if { (eval echo configure:7787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7787   rm -rf conftest*
7788   eval "ac_cv_lib_$ac_lib_var=yes"
7789 else
7790   echo "configure: failed program was:" >&5
7791   cat conftest.$ac_ext >&5
7792   rm -rf conftest*
7793   eval "ac_cv_lib_$ac_lib_var=no"
7794 fi
7795 rm -f conftest*
7796 LIBS="$ac_save_LIBS"
7797
7798 fi
7799 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7800   echo "$ac_t""yes" 1>&6
7801   LIBS="$LIBS -lbe -lroot -lnet"
7802 else
7803   echo "$ac_t""no" 1>&6
7804 :
7805 fi
7806
7807
7808
7809
7810
7811 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
7812 echo "configure:7813: checking for ${CC-cc} option to accept ANSI C" >&5
7813 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
7814   echo $ac_n "(cached) $ac_c" 1>&6
7815 else
7816   am_cv_prog_cc_stdc=no
7817 ac_save_CC="$CC"
7818 # Don't try gcc -ansi; that turns off useful extensions and
7819 # breaks some systems' header files.
7820 # AIX                   -qlanglvl=ansi
7821 # Ultrix and OSF/1      -std1
7822 # HP-UX 10.20 and later -Ae
7823 # HP-UX older versions  -Aa -D_HPUX_SOURCE
7824 # SVR4                  -Xc -D__EXTENSIONS__
7825 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
7826 do
7827   CC="$ac_save_CC $ac_arg"
7828   cat > conftest.$ac_ext <<EOF
7829 #line 7830 "configure"
7830 #include "confdefs.h"
7831 #include <stdarg.h>
7832 #include <stdio.h>
7833 #include <sys/types.h>
7834 #include <sys/stat.h>
7835 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
7836 struct buf { int x; };
7837 FILE * (*rcsopen) (struct buf *, struct stat *, int);
7838 static char *e (p, i)
7839      char **p;
7840      int i;
7841 {
7842   return p[i];
7843 }
7844 static char *f (char * (*g) (char **, int), char **p, ...)
7845 {
7846   char *s;
7847   va_list v;
7848   va_start (v,p);
7849   s = g (p, va_arg (v,int));
7850   va_end (v);
7851   return s;
7852 }
7853 int test (int i, double x);
7854 struct s1 {int (*f) (int a);};
7855 struct s2 {int (*f) (double a);};
7856 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
7857 int argc;
7858 char **argv;
7859
7860 int main() {
7861
7862 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
7863
7864 ; return 0; }
7865 EOF
7866 if { (eval echo configure:7867: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7867   rm -rf conftest*
7868   am_cv_prog_cc_stdc="$ac_arg"; break
7869 else
7870   echo "configure: failed program was:" >&5
7871   cat conftest.$ac_ext >&5
7872 fi
7873 rm -f conftest*
7874 done
7875 CC="$ac_save_CC"
7876
7877 fi
7878
7879 if test -z "$am_cv_prog_cc_stdc"; then
7880   echo "$ac_t""none needed" 1>&6
7881 else
7882   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
7883 fi
7884 case "x$am_cv_prog_cc_stdc" in
7885   x|xno) ;;
7886   *) CC="$CC $am_cv_prog_cc_stdc" ;;
7887 esac
7888
7889 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
7890         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
7891 fi
7892
7893 # test for make depend flag
7894 OL_MKDEP=
7895 OL_MKDEP_FLAGS=
7896 if test -z "${MKDEP}"; then
7897         OL_MKDEP="${CC-cc}"
7898         if test -z "${MKDEP_FLAGS}"; then
7899                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
7900 echo "configure:7901: checking for ${OL_MKDEP} depend flag" >&5
7901 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
7902   echo $ac_n "(cached) $ac_c" 1>&6
7903 else
7904   
7905                         ol_cv_mkdep=no
7906                         for flag in "-M" "-xM"; do
7907                                 cat > conftest.c <<EOF
7908  noCode;
7909 EOF
7910                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:7911: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
7911                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
7912                                 then
7913                                         if test ! -f conftest."${ac_object}" ; then
7914                                                 ol_cv_mkdep=$flag
7915                                                 OL_MKDEP_FLAGS="$flag"
7916                                                 break
7917                                         fi
7918                                 fi
7919                         done
7920                         rm -f conftest*
7921                 
7922 fi
7923
7924 echo "$ac_t""$ol_cv_mkdep" 1>&6
7925         else
7926                 cc_cv_mkdep=yes
7927                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
7928         fi
7929 else
7930         cc_cv_mkdep=yes
7931         OL_MKDEP="${MKDEP}"
7932         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
7933 fi
7934
7935
7936
7937 if test "${ol_cv_mkdep}" = no ; then
7938         # this will soon become an error
7939         echo "configure: warning: do not know how to generate dependencies" 1>&2
7940 fi
7941
7942 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
7943 echo "configure:7944: checking for afopen in -ls" >&5
7944 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
7945 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
7946   echo $ac_n "(cached) $ac_c" 1>&6
7947 else
7948   ac_save_LIBS="$LIBS"
7949 LIBS="-ls  $LIBS"
7950 cat > conftest.$ac_ext <<EOF
7951 #line 7952 "configure"
7952 #include "confdefs.h"
7953 /* Override any gcc2 internal prototype to avoid an error.  */
7954 /* We use char because int might match the return type of a gcc2
7955     builtin and then its argument prototype would still apply.  */
7956 char afopen();
7957
7958 int main() {
7959 afopen()
7960 ; return 0; }
7961 EOF
7962 if { (eval echo configure:7963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7963   rm -rf conftest*
7964   eval "ac_cv_lib_$ac_lib_var=yes"
7965 else
7966   echo "configure: failed program was:" >&5
7967   cat conftest.$ac_ext >&5
7968   rm -rf conftest*
7969   eval "ac_cv_lib_$ac_lib_var=no"
7970 fi
7971 rm -f conftest*
7972 LIBS="$ac_save_LIBS"
7973
7974 fi
7975 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7976   echo "$ac_t""yes" 1>&6
7977   
7978         AUTH_LIBS=-ls
7979         cat >> confdefs.h <<\EOF
7980 #define HAVE_AIX_SECURITY 1
7981 EOF
7982
7983
7984 else
7985   echo "$ac_t""no" 1>&6
7986 fi
7987
7988
7989 case "$target" in
7990 *-ibm-openedition)
7991         ac_cv_func_getopt=no
7992         cat >> confdefs.h <<\EOF
7993 #define BOTH_STRINGS_H 1
7994 EOF
7995
7996         ;;
7997 esac
7998
7999 ol_link_modules=no
8000 if test $ol_enable_modules != no ; then
8001         for ac_hdr in ltdl.h
8002 do
8003 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8004 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8005 echo "configure:8006: checking for $ac_hdr" >&5
8006 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8007   echo $ac_n "(cached) $ac_c" 1>&6
8008 else
8009   cat > conftest.$ac_ext <<EOF
8010 #line 8011 "configure"
8011 #include "confdefs.h"
8012 #include <$ac_hdr>
8013 EOF
8014 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8015 { (eval echo configure:8016: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8016 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8017 if test -z "$ac_err"; then
8018   rm -rf conftest*
8019   eval "ac_cv_header_$ac_safe=yes"
8020 else
8021   echo "$ac_err" >&5
8022   echo "configure: failed program was:" >&5
8023   cat conftest.$ac_ext >&5
8024   rm -rf conftest*
8025   eval "ac_cv_header_$ac_safe=no"
8026 fi
8027 rm -f conftest*
8028 fi
8029 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8030   echo "$ac_t""yes" 1>&6
8031     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8032   cat >> confdefs.h <<EOF
8033 #define $ac_tr_hdr 1
8034 EOF
8035  
8036 else
8037   echo "$ac_t""no" 1>&6
8038 fi
8039 done
8040
8041
8042         if test $ac_cv_header_ltdl_h = no ; then
8043                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
8044         fi
8045
8046         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
8047 echo "configure:8048: checking for lt_dlinit in -lltdl" >&5
8048 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
8049 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8050   echo $ac_n "(cached) $ac_c" 1>&6
8051 else
8052   ac_save_LIBS="$LIBS"
8053 LIBS="-lltdl  $LIBS"
8054 cat > conftest.$ac_ext <<EOF
8055 #line 8056 "configure"
8056 #include "confdefs.h"
8057 /* Override any gcc2 internal prototype to avoid an error.  */
8058 /* We use char because int might match the return type of a gcc2
8059     builtin and then its argument prototype would still apply.  */
8060 char lt_dlinit();
8061
8062 int main() {
8063 lt_dlinit()
8064 ; return 0; }
8065 EOF
8066 if { (eval echo configure:8067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8067   rm -rf conftest*
8068   eval "ac_cv_lib_$ac_lib_var=yes"
8069 else
8070   echo "configure: failed program was:" >&5
8071   cat conftest.$ac_ext >&5
8072   rm -rf conftest*
8073   eval "ac_cv_lib_$ac_lib_var=no"
8074 fi
8075 rm -f conftest*
8076 LIBS="$ac_save_LIBS"
8077
8078 fi
8079 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8080   echo "$ac_t""yes" 1>&6
8081   
8082                 MODULES_LIBS=-lltdl
8083                 cat >> confdefs.h <<\EOF
8084 #define HAVE_LIBLTDL 1
8085 EOF
8086
8087         
8088 else
8089   echo "$ac_t""no" 1>&6
8090 fi
8091
8092
8093         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
8094                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
8095         fi
8096         ol_link_modules=yes
8097
8098 else
8099         for i in $Backends; do
8100                 eval "ol_tmp=\$ol_enable_$i"
8101                 if test $ol_tmp = mod ; then
8102                         echo "configure: warning: building static $i backend" 1>&2
8103                         eval "ol_enable_$i=yes"
8104                 fi
8105         done
8106         for i in $Overlays; do
8107                 eval "ol_tmp=\$ol_enable_$i"
8108                 if test $ol_tmp = mod ; then
8109                         echo "configure: warning: building static $i overlay" 1>&2
8110                         eval "ol_enable_$i=yes"
8111                 fi
8112         done
8113 fi
8114
8115 # test for EBCDIC
8116 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
8117 echo "configure:8118: checking for EBCDIC" >&5
8118 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
8119   echo $ac_n "(cached) $ac_c" 1>&6
8120 else
8121   
8122         cat > conftest.$ac_ext <<EOF
8123 #line 8124 "configure"
8124 #include "confdefs.h"
8125
8126 #if !('M' == 0xd4)
8127 #include <__ASCII__/generate_error.h>
8128 #endif
8129
8130 EOF
8131 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8132 { (eval echo configure:8133: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8133 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8134 if test -z "$ac_err"; then
8135   rm -rf conftest*
8136   ol_cv_cpp_ebcdic=yes
8137 else
8138   echo "$ac_err" >&5
8139   echo "configure: failed program was:" >&5
8140   cat conftest.$ac_ext >&5
8141   rm -rf conftest*
8142   ol_cv_cpp_ebcdic=no
8143 fi
8144 rm -f conftest*
8145 fi
8146
8147 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
8148 if test $ol_cv_cpp_ebcdic = yes ; then
8149         cat >> confdefs.h <<\EOF
8150 #define HAVE_EBCDIC 1
8151 EOF
8152
8153 fi
8154
8155 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
8156 echo "configure:8157: checking for ANSI C header files" >&5
8157 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
8158   echo $ac_n "(cached) $ac_c" 1>&6
8159 else
8160   cat > conftest.$ac_ext <<EOF
8161 #line 8162 "configure"
8162 #include "confdefs.h"
8163 #include <stdlib.h>
8164 #include <stdarg.h>
8165 #include <string.h>
8166 #include <float.h>
8167 EOF
8168 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8169 { (eval echo configure:8170: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8170 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8171 if test -z "$ac_err"; then
8172   rm -rf conftest*
8173   ol_cv_header_stdc=yes
8174 else
8175   echo "$ac_err" >&5
8176   echo "configure: failed program was:" >&5
8177   cat conftest.$ac_ext >&5
8178   rm -rf conftest*
8179   ol_cv_header_stdc=no
8180 fi
8181 rm -f conftest*
8182
8183 if test $ol_cv_header_stdc = yes; then
8184   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
8185 cat > conftest.$ac_ext <<EOF
8186 #line 8187 "configure"
8187 #include "confdefs.h"
8188 #include <string.h>
8189 EOF
8190 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8191   egrep "memchr" >/dev/null 2>&1; then
8192   :
8193 else
8194   rm -rf conftest*
8195   ol_cv_header_stdc=no
8196 fi
8197 rm -f conftest*
8198
8199 fi
8200
8201 if test $ol_cv_header_stdc = yes; then
8202   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
8203 cat > conftest.$ac_ext <<EOF
8204 #line 8205 "configure"
8205 #include "confdefs.h"
8206 #include <stdlib.h>
8207 EOF
8208 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8209   egrep "free" >/dev/null 2>&1; then
8210   :
8211 else
8212   rm -rf conftest*
8213   ol_cv_header_stdc=no
8214 fi
8215 rm -f conftest*
8216
8217 fi
8218
8219 if test $ol_cv_header_stdc = yes; then
8220   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
8221 if test "$cross_compiling" = yes; then
8222   :
8223 else
8224   cat > conftest.$ac_ext <<EOF
8225 #line 8226 "configure"
8226 #include "confdefs.h"
8227 #include <ctype.h>
8228 #ifndef HAVE_EBCDIC
8229 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
8230 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
8231 #else
8232 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
8233                 || ('j' <= (c) && (c) <= 'r') \
8234                 || ('s' <= (c) && (c) <= 'z'))
8235 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
8236 #endif
8237 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
8238 int main () { int i; for (i = 0; i < 256; i++)
8239 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
8240 exit (0); }
8241
8242 EOF
8243 if { (eval echo configure:8244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8244 then
8245   :
8246 else
8247   echo "configure: failed program was:" >&5
8248   cat conftest.$ac_ext >&5
8249   rm -fr conftest*
8250   ol_cv_header_stdc=no
8251 fi
8252 rm -fr conftest*
8253 fi
8254
8255 fi
8256 fi
8257
8258 echo "$ac_t""$ol_cv_header_stdc" 1>&6
8259 if test $ol_cv_header_stdc = yes; then
8260   cat >> confdefs.h <<\EOF
8261 #define STDC_HEADERS 1
8262 EOF
8263
8264 fi
8265 ac_cv_header_stdc=disable
8266
8267
8268 if test $ol_cv_header_stdc != yes; then
8269         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
8270 fi
8271
8272 ac_header_dirent=no
8273 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
8274 do
8275 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8276 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
8277 echo "configure:8278: checking for $ac_hdr that defines DIR" >&5
8278 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
8279   echo $ac_n "(cached) $ac_c" 1>&6
8280 else
8281   cat > conftest.$ac_ext <<EOF
8282 #line 8283 "configure"
8283 #include "confdefs.h"
8284 #include <sys/types.h>
8285 #include <$ac_hdr>
8286 int main() {
8287 DIR *dirp = 0;
8288 ; return 0; }
8289 EOF
8290 if { (eval echo configure:8291: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8291   rm -rf conftest*
8292   eval "ac_cv_header_dirent_$ac_safe=yes"
8293 else
8294   echo "configure: failed program was:" >&5
8295   cat conftest.$ac_ext >&5
8296   rm -rf conftest*
8297   eval "ac_cv_header_dirent_$ac_safe=no"
8298 fi
8299 rm -f conftest*
8300 fi
8301 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
8302   echo "$ac_t""yes" 1>&6
8303     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8304   cat >> confdefs.h <<EOF
8305 #define $ac_tr_hdr 1
8306 EOF
8307  ac_header_dirent=$ac_hdr; break
8308 else
8309   echo "$ac_t""no" 1>&6
8310 fi
8311 done
8312 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
8313 if test $ac_header_dirent = dirent.h; then
8314 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
8315 echo "configure:8316: checking for opendir in -ldir" >&5
8316 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
8317 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8318   echo $ac_n "(cached) $ac_c" 1>&6
8319 else
8320   ac_save_LIBS="$LIBS"
8321 LIBS="-ldir  $LIBS"
8322 cat > conftest.$ac_ext <<EOF
8323 #line 8324 "configure"
8324 #include "confdefs.h"
8325 /* Override any gcc2 internal prototype to avoid an error.  */
8326 /* We use char because int might match the return type of a gcc2
8327     builtin and then its argument prototype would still apply.  */
8328 char opendir();
8329
8330 int main() {
8331 opendir()
8332 ; return 0; }
8333 EOF
8334 if { (eval echo configure:8335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8335   rm -rf conftest*
8336   eval "ac_cv_lib_$ac_lib_var=yes"
8337 else
8338   echo "configure: failed program was:" >&5
8339   cat conftest.$ac_ext >&5
8340   rm -rf conftest*
8341   eval "ac_cv_lib_$ac_lib_var=no"
8342 fi
8343 rm -f conftest*
8344 LIBS="$ac_save_LIBS"
8345
8346 fi
8347 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8348   echo "$ac_t""yes" 1>&6
8349   LIBS="$LIBS -ldir"
8350 else
8351   echo "$ac_t""no" 1>&6
8352 fi
8353
8354 else
8355 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
8356 echo "configure:8357: checking for opendir in -lx" >&5
8357 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
8358 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8359   echo $ac_n "(cached) $ac_c" 1>&6
8360 else
8361   ac_save_LIBS="$LIBS"
8362 LIBS="-lx  $LIBS"
8363 cat > conftest.$ac_ext <<EOF
8364 #line 8365 "configure"
8365 #include "confdefs.h"
8366 /* Override any gcc2 internal prototype to avoid an error.  */
8367 /* We use char because int might match the return type of a gcc2
8368     builtin and then its argument prototype would still apply.  */
8369 char opendir();
8370
8371 int main() {
8372 opendir()
8373 ; return 0; }
8374 EOF
8375 if { (eval echo configure:8376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8376   rm -rf conftest*
8377   eval "ac_cv_lib_$ac_lib_var=yes"
8378 else
8379   echo "configure: failed program was:" >&5
8380   cat conftest.$ac_ext >&5
8381   rm -rf conftest*
8382   eval "ac_cv_lib_$ac_lib_var=no"
8383 fi
8384 rm -f conftest*
8385 LIBS="$ac_save_LIBS"
8386
8387 fi
8388 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8389   echo "$ac_t""yes" 1>&6
8390   LIBS="$LIBS -lx"
8391 else
8392   echo "$ac_t""no" 1>&6
8393 fi
8394
8395 fi
8396
8397 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
8398 echo "configure:8399: checking for sys/wait.h that is POSIX.1 compatible" >&5
8399 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
8400   echo $ac_n "(cached) $ac_c" 1>&6
8401 else
8402   cat > conftest.$ac_ext <<EOF
8403 #line 8404 "configure"
8404 #include "confdefs.h"
8405 #include <sys/types.h>
8406 #include <sys/wait.h>
8407 #ifndef WEXITSTATUS
8408 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
8409 #endif
8410 #ifndef WIFEXITED
8411 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
8412 #endif
8413 int main() {
8414 int s;
8415 wait (&s);
8416 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
8417 ; return 0; }
8418 EOF
8419 if { (eval echo configure:8420: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8420   rm -rf conftest*
8421   ac_cv_header_sys_wait_h=yes
8422 else
8423   echo "configure: failed program was:" >&5
8424   cat conftest.$ac_ext >&5
8425   rm -rf conftest*
8426   ac_cv_header_sys_wait_h=no
8427 fi
8428 rm -f conftest*
8429 fi
8430
8431 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
8432 if test $ac_cv_header_sys_wait_h = yes; then
8433   cat >> confdefs.h <<\EOF
8434 #define HAVE_SYS_WAIT_H 1
8435 EOF
8436
8437 fi
8438
8439 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
8440 echo "configure:8441: checking POSIX termios" >&5
8441 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
8442   echo $ac_n "(cached) $ac_c" 1>&6
8443 else
8444   cat > conftest.$ac_ext <<EOF
8445 #line 8446 "configure"
8446 #include "confdefs.h"
8447 #include <sys/types.h>
8448 #include <unistd.h>
8449 #include <termios.h>
8450 int main() {
8451 /* SunOS 4.0.3 has termios.h but not the library calls.  */
8452    tcgetattr(0, 0);
8453 ; return 0; }
8454 EOF
8455 if { (eval echo configure:8456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8456   rm -rf conftest*
8457   am_cv_sys_posix_termios=yes
8458 else
8459   echo "configure: failed program was:" >&5
8460   cat conftest.$ac_ext >&5
8461   rm -rf conftest*
8462   am_cv_sys_posix_termios=no
8463 fi
8464 rm -f conftest*
8465 fi
8466
8467 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
8468
8469
8470  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
8471 echo "configure:8472: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
8472 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
8473   echo $ac_n "(cached) $ac_c" 1>&6
8474 else
8475   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
8476
8477   gwinsz_in_termios_h=no
8478   if test $am_cv_sys_posix_termios = yes; then
8479     cat > conftest.$ac_ext <<EOF
8480 #line 8481 "configure"
8481 #include "confdefs.h"
8482 #include <sys/types.h>
8483 #     include <termios.h>
8484 #     ifdef TIOCGWINSZ
8485         yes
8486 #     endif
8487     
8488 EOF
8489 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8490   egrep "yes" >/dev/null 2>&1; then
8491   rm -rf conftest*
8492   gwinsz_in_termios_h=yes
8493 fi
8494 rm -f conftest*
8495
8496   fi
8497
8498   if test $gwinsz_in_termios_h = no; then
8499     cat > conftest.$ac_ext <<EOF
8500 #line 8501 "configure"
8501 #include "confdefs.h"
8502 #include <sys/types.h>
8503 #     include <sys/ioctl.h>
8504 #     ifdef TIOCGWINSZ
8505         yes
8506 #     endif
8507     
8508 EOF
8509 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8510   egrep "yes" >/dev/null 2>&1; then
8511   rm -rf conftest*
8512   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
8513 fi
8514 rm -f conftest*
8515
8516   fi
8517   
8518 fi
8519
8520 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
8521   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
8522     cat >> confdefs.h <<\EOF
8523 #define GWINSZ_IN_SYS_IOCTL 1
8524 EOF
8525
8526   fi
8527
8528 if test $am_cv_sys_posix_termios = yes ; then
8529         cat >> confdefs.h <<\EOF
8530 #define HAVE_POSIX_TERMIOS 1
8531 EOF
8532
8533 fi
8534
8535 for ac_hdr in \
8536         arpa/inet.h             \
8537         arpa/nameser.h  \
8538         assert.h                \
8539         bits/types.h    \
8540         conio.h                 \
8541         crypt.h                 \
8542         direct.h                \
8543         errno.h                 \
8544         fcntl.h                 \
8545         filio.h                 \
8546         getopt.h                \
8547         grp.h                   \
8548         io.h                    \
8549         libutil.h               \
8550         limits.h                \
8551         locale.h                \
8552         netinet/tcp.h   \
8553         malloc.h                \
8554         memory.h                \
8555         psap.h                  \
8556         pwd.h                   \
8557         process.h               \
8558         resolv.h                \
8559         sgtty.h                 \
8560         shadow.h                \
8561         stddef.h                \
8562         string.h                \
8563         strings.h               \
8564         sysexits.h              \
8565         sys/file.h              \
8566         sys/filio.h             \
8567         sys/errno.h             \
8568         sys/ioctl.h             \
8569         sys/param.h             \
8570         sys/resource.h  \
8571         sys/select.h    \
8572         sys/socket.h    \
8573         sys/stat.h              \
8574         sys/syslog.h    \
8575         sys/time.h              \
8576         sys/types.h             \
8577         sys/ucred.h             \
8578         sys/uio.h               \
8579         syslog.h                \
8580         termios.h               \
8581         unistd.h                \
8582         winsock.h               \
8583         winsock2.h              \
8584
8585 do
8586 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8587 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8588 echo "configure:8589: checking for $ac_hdr" >&5
8589 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8590   echo $ac_n "(cached) $ac_c" 1>&6
8591 else
8592   cat > conftest.$ac_ext <<EOF
8593 #line 8594 "configure"
8594 #include "confdefs.h"
8595 #include <$ac_hdr>
8596 EOF
8597 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8598 { (eval echo configure:8599: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8599 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8600 if test -z "$ac_err"; then
8601   rm -rf conftest*
8602   eval "ac_cv_header_$ac_safe=yes"
8603 else
8604   echo "$ac_err" >&5
8605   echo "configure: failed program was:" >&5
8606   cat conftest.$ac_ext >&5
8607   rm -rf conftest*
8608   eval "ac_cv_header_$ac_safe=no"
8609 fi
8610 rm -f conftest*
8611 fi
8612 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8613   echo "$ac_t""yes" 1>&6
8614     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8615   cat >> confdefs.h <<EOF
8616 #define $ac_tr_hdr 1
8617 EOF
8618  
8619 else
8620   echo "$ac_t""no" 1>&6
8621 fi
8622 done
8623
8624
8625
8626
8627 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
8628 echo "configure:8629: checking for sigset in -lV3" >&5
8629 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
8630 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8631   echo $ac_n "(cached) $ac_c" 1>&6
8632 else
8633   ac_save_LIBS="$LIBS"
8634 LIBS="-lV3  $LIBS"
8635 cat > conftest.$ac_ext <<EOF
8636 #line 8637 "configure"
8637 #include "confdefs.h"
8638 /* Override any gcc2 internal prototype to avoid an error.  */
8639 /* We use char because int might match the return type of a gcc2
8640     builtin and then its argument prototype would still apply.  */
8641 char sigset();
8642
8643 int main() {
8644 sigset()
8645 ; return 0; }
8646 EOF
8647 if { (eval echo configure:8648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8648   rm -rf conftest*
8649   eval "ac_cv_lib_$ac_lib_var=yes"
8650 else
8651   echo "configure: failed program was:" >&5
8652   cat conftest.$ac_ext >&5
8653   rm -rf conftest*
8654   eval "ac_cv_lib_$ac_lib_var=no"
8655 fi
8656 rm -f conftest*
8657 LIBS="$ac_save_LIBS"
8658
8659 fi
8660 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8661   echo "$ac_t""yes" 1>&6
8662     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8663     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8664   cat >> confdefs.h <<EOF
8665 #define $ac_tr_lib 1
8666 EOF
8667
8668   LIBS="-lV3 $LIBS"
8669
8670 else
8671   echo "$ac_t""no" 1>&6
8672 fi
8673
8674
8675 if test "$ac_cv_header_winsock_h" = yes; then
8676 echo $ac_n "checking for winsock""... $ac_c" 1>&6
8677 echo "configure:8678: checking for winsock" >&5
8678 if eval "test \"\${ol_cv_winsock+set}\" = set"; then
8679   echo $ac_n "(cached) $ac_c" 1>&6
8680 else
8681   save_LIBS="$LIBS"
8682 for curlib in ws2_32 wsock32; do
8683         LIBS="$LIBS -l$curlib"
8684         cat > conftest.$ac_ext <<EOF
8685 #line 8686 "configure"
8686 #include "confdefs.h"
8687 #include <winsock.h>
8688                         
8689 int main() {
8690
8691                         socket(0,0,0);
8692                         select(0,NULL,NULL,NULL,NULL);
8693                         closesocket(0);
8694                         gethostname(NULL,0);
8695                         
8696 ; return 0; }
8697 EOF
8698 if { (eval echo configure:8699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8699   rm -rf conftest*
8700   ol_cv_winsock=yes
8701 else
8702   echo "configure: failed program was:" >&5
8703   cat conftest.$ac_ext >&5
8704   rm -rf conftest*
8705   ol_cv_winsock=no
8706 fi
8707 rm -f conftest*
8708
8709         if test $ol_cv_winsock = yes; then
8710                 cat >> confdefs.h <<\EOF
8711 #define HAVE_WINSOCK 1
8712 EOF
8713
8714                 ac_cv_func_socket=yes
8715                 ac_cv_func_select=yes
8716                 ac_cv_func_closesocket=yes
8717                 ac_cv_func_gethostname=yes
8718                 if test $curlib = ws2_32; then
8719                         ol_cv_winsock=winsock2
8720                         cat >> confdefs.h <<\EOF
8721 #define HAVE_WINSOCK2 1
8722 EOF
8723
8724                 fi
8725                 break
8726         fi
8727         LIBS="$save_LIBS"
8728 done
8729 fi
8730
8731 echo "$ac_t""$ol_cv_winsock" 1>&6
8732 fi
8733
8734
8735 echo $ac_n "checking for socket""... $ac_c" 1>&6
8736 echo "configure:8737: checking for socket" >&5
8737 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
8738   echo $ac_n "(cached) $ac_c" 1>&6
8739 else
8740   cat > conftest.$ac_ext <<EOF
8741 #line 8742 "configure"
8742 #include "confdefs.h"
8743 /* System header to define __stub macros and hopefully few prototypes,
8744     which can conflict with char socket(); below.  */
8745 #include <assert.h>
8746 /* Override any gcc2 internal prototype to avoid an error.  */
8747 /* We use char because int might match the return type of a gcc2
8748     builtin and then its argument prototype would still apply.  */
8749 char socket();
8750 char (*f)();
8751
8752 int main() {
8753
8754 /* The GNU C library defines this for functions which it implements
8755     to always fail with ENOSYS.  Some functions are actually named
8756     something starting with __ and the normal name is an alias.  */
8757 #if defined (__stub_socket) || defined (__stub___socket)
8758 choke me
8759 #else
8760 f = socket;
8761 #endif
8762
8763 ; return 0; }
8764 EOF
8765 if { (eval echo configure:8766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8766   rm -rf conftest*
8767   eval "ac_cv_func_socket=yes"
8768 else
8769   echo "configure: failed program was:" >&5
8770   cat conftest.$ac_ext >&5
8771   rm -rf conftest*
8772   eval "ac_cv_func_socket=no"
8773 fi
8774 rm -f conftest*
8775 fi
8776
8777 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
8778   echo "$ac_t""yes" 1>&6
8779   :
8780 else
8781   echo "$ac_t""no" 1>&6
8782         
8783         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
8784 echo "configure:8785: checking for main in -lsocket" >&5
8785 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
8786 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8787   echo $ac_n "(cached) $ac_c" 1>&6
8788 else
8789   ac_save_LIBS="$LIBS"
8790 LIBS="-lsocket  $LIBS"
8791 cat > conftest.$ac_ext <<EOF
8792 #line 8793 "configure"
8793 #include "confdefs.h"
8794
8795 int main() {
8796 main()
8797 ; return 0; }
8798 EOF
8799 if { (eval echo configure:8800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8800   rm -rf conftest*
8801   eval "ac_cv_lib_$ac_lib_var=yes"
8802 else
8803   echo "configure: failed program was:" >&5
8804   cat conftest.$ac_ext >&5
8805   rm -rf conftest*
8806   eval "ac_cv_lib_$ac_lib_var=no"
8807 fi
8808 rm -f conftest*
8809 LIBS="$ac_save_LIBS"
8810
8811 fi
8812 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8813   echo "$ac_t""yes" 1>&6
8814     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8815     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8816   cat >> confdefs.h <<EOF
8817 #define $ac_tr_lib 1
8818 EOF
8819
8820   LIBS="-lsocket $LIBS"
8821
8822 else
8823   echo "$ac_t""no" 1>&6
8824 fi
8825
8826         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
8827 echo "configure:8828: checking for main in -lnet" >&5
8828 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
8829 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8830   echo $ac_n "(cached) $ac_c" 1>&6
8831 else
8832   ac_save_LIBS="$LIBS"
8833 LIBS="-lnet  $LIBS"
8834 cat > conftest.$ac_ext <<EOF
8835 #line 8836 "configure"
8836 #include "confdefs.h"
8837
8838 int main() {
8839 main()
8840 ; return 0; }
8841 EOF
8842 if { (eval echo configure:8843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8843   rm -rf conftest*
8844   eval "ac_cv_lib_$ac_lib_var=yes"
8845 else
8846   echo "configure: failed program was:" >&5
8847   cat conftest.$ac_ext >&5
8848   rm -rf conftest*
8849   eval "ac_cv_lib_$ac_lib_var=no"
8850 fi
8851 rm -f conftest*
8852 LIBS="$ac_save_LIBS"
8853
8854 fi
8855 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8856   echo "$ac_t""yes" 1>&6
8857     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8858     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8859   cat >> confdefs.h <<EOF
8860 #define $ac_tr_lib 1
8861 EOF
8862
8863   LIBS="-lnet $LIBS"
8864
8865 else
8866   echo "$ac_t""no" 1>&6
8867 fi
8868
8869         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
8870 echo "configure:8871: checking for main in -lnsl_s" >&5
8871 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
8872 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8873   echo $ac_n "(cached) $ac_c" 1>&6
8874 else
8875   ac_save_LIBS="$LIBS"
8876 LIBS="-lnsl_s  $LIBS"
8877 cat > conftest.$ac_ext <<EOF
8878 #line 8879 "configure"
8879 #include "confdefs.h"
8880
8881 int main() {
8882 main()
8883 ; return 0; }
8884 EOF
8885 if { (eval echo configure:8886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8886   rm -rf conftest*
8887   eval "ac_cv_lib_$ac_lib_var=yes"
8888 else
8889   echo "configure: failed program was:" >&5
8890   cat conftest.$ac_ext >&5
8891   rm -rf conftest*
8892   eval "ac_cv_lib_$ac_lib_var=no"
8893 fi
8894 rm -f conftest*
8895 LIBS="$ac_save_LIBS"
8896
8897 fi
8898 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8899   echo "$ac_t""yes" 1>&6
8900     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8901     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8902   cat >> confdefs.h <<EOF
8903 #define $ac_tr_lib 1
8904 EOF
8905
8906   LIBS="-lnsl_s $LIBS"
8907
8908 else
8909   echo "$ac_t""no" 1>&6
8910 fi
8911
8912         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
8913 echo "configure:8914: checking for main in -lnsl" >&5
8914 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
8915 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8916   echo $ac_n "(cached) $ac_c" 1>&6
8917 else
8918   ac_save_LIBS="$LIBS"
8919 LIBS="-lnsl  $LIBS"
8920 cat > conftest.$ac_ext <<EOF
8921 #line 8922 "configure"
8922 #include "confdefs.h"
8923
8924 int main() {
8925 main()
8926 ; return 0; }
8927 EOF
8928 if { (eval echo configure:8929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8929   rm -rf conftest*
8930   eval "ac_cv_lib_$ac_lib_var=yes"
8931 else
8932   echo "configure: failed program was:" >&5
8933   cat conftest.$ac_ext >&5
8934   rm -rf conftest*
8935   eval "ac_cv_lib_$ac_lib_var=no"
8936 fi
8937 rm -f conftest*
8938 LIBS="$ac_save_LIBS"
8939
8940 fi
8941 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8942   echo "$ac_t""yes" 1>&6
8943     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8944     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8945   cat >> confdefs.h <<EOF
8946 #define $ac_tr_lib 1
8947 EOF
8948
8949   LIBS="-lnsl $LIBS"
8950
8951 else
8952   echo "$ac_t""no" 1>&6
8953 fi
8954
8955         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
8956 echo "configure:8957: checking for socket in -linet" >&5
8957 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
8958 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8959   echo $ac_n "(cached) $ac_c" 1>&6
8960 else
8961   ac_save_LIBS="$LIBS"
8962 LIBS="-linet  $LIBS"
8963 cat > conftest.$ac_ext <<EOF
8964 #line 8965 "configure"
8965 #include "confdefs.h"
8966 /* Override any gcc2 internal prototype to avoid an error.  */
8967 /* We use char because int might match the return type of a gcc2
8968     builtin and then its argument prototype would still apply.  */
8969 char socket();
8970
8971 int main() {
8972 socket()
8973 ; return 0; }
8974 EOF
8975 if { (eval echo configure:8976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8976   rm -rf conftest*
8977   eval "ac_cv_lib_$ac_lib_var=yes"
8978 else
8979   echo "configure: failed program was:" >&5
8980   cat conftest.$ac_ext >&5
8981   rm -rf conftest*
8982   eval "ac_cv_lib_$ac_lib_var=no"
8983 fi
8984 rm -f conftest*
8985 LIBS="$ac_save_LIBS"
8986
8987 fi
8988 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8989   echo "$ac_t""yes" 1>&6
8990     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8991     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8992   cat >> confdefs.h <<EOF
8993 #define $ac_tr_lib 1
8994 EOF
8995
8996   LIBS="-linet $LIBS"
8997
8998 else
8999   echo "$ac_t""no" 1>&6
9000 fi
9001
9002         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
9003 echo "configure:9004: checking for main in -lgen" >&5
9004 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
9005 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9006   echo $ac_n "(cached) $ac_c" 1>&6
9007 else
9008   ac_save_LIBS="$LIBS"
9009 LIBS="-lgen  $LIBS"
9010 cat > conftest.$ac_ext <<EOF
9011 #line 9012 "configure"
9012 #include "confdefs.h"
9013
9014 int main() {
9015 main()
9016 ; return 0; }
9017 EOF
9018 if { (eval echo configure:9019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9019   rm -rf conftest*
9020   eval "ac_cv_lib_$ac_lib_var=yes"
9021 else
9022   echo "configure: failed program was:" >&5
9023   cat conftest.$ac_ext >&5
9024   rm -rf conftest*
9025   eval "ac_cv_lib_$ac_lib_var=no"
9026 fi
9027 rm -f conftest*
9028 LIBS="$ac_save_LIBS"
9029
9030 fi
9031 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9032   echo "$ac_t""yes" 1>&6
9033     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9034     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9035   cat >> confdefs.h <<EOF
9036 #define $ac_tr_lib 1
9037 EOF
9038
9039   LIBS="-lgen $LIBS"
9040
9041 else
9042   echo "$ac_t""no" 1>&6
9043 fi
9044
9045
9046 fi
9047
9048
9049 echo $ac_n "checking for select""... $ac_c" 1>&6
9050 echo "configure:9051: checking for select" >&5
9051 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
9052   echo $ac_n "(cached) $ac_c" 1>&6
9053 else
9054   cat > conftest.$ac_ext <<EOF
9055 #line 9056 "configure"
9056 #include "confdefs.h"
9057 /* System header to define __stub macros and hopefully few prototypes,
9058     which can conflict with char select(); below.  */
9059 #include <assert.h>
9060 /* Override any gcc2 internal prototype to avoid an error.  */
9061 /* We use char because int might match the return type of a gcc2
9062     builtin and then its argument prototype would still apply.  */
9063 char select();
9064 char (*f)();
9065
9066 int main() {
9067
9068 /* The GNU C library defines this for functions which it implements
9069     to always fail with ENOSYS.  Some functions are actually named
9070     something starting with __ and the normal name is an alias.  */
9071 #if defined (__stub_select) || defined (__stub___select)
9072 choke me
9073 #else
9074 f = select;
9075 #endif
9076
9077 ; return 0; }
9078 EOF
9079 if { (eval echo configure:9080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9080   rm -rf conftest*
9081   eval "ac_cv_func_select=yes"
9082 else
9083   echo "configure: failed program was:" >&5
9084   cat conftest.$ac_ext >&5
9085   rm -rf conftest*
9086   eval "ac_cv_func_select=no"
9087 fi
9088 rm -f conftest*
9089 fi
9090
9091 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
9092   echo "$ac_t""yes" 1>&6
9093   :
9094 else
9095   echo "$ac_t""no" 1>&6
9096 { echo "configure: error: select() required." 1>&2; exit 1; }
9097 fi
9098
9099
9100 if test "${ac_cv_header_winsock_h}" != yes; then
9101                                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
9102 echo "configure:9103: checking types of arguments for select()" >&5
9103  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
9104   echo $ac_n "(cached) $ac_c" 1>&6
9105 else
9106    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
9107   echo $ac_n "(cached) $ac_c" 1>&6
9108 else
9109     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
9110   echo $ac_n "(cached) $ac_c" 1>&6
9111 else
9112      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
9113      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
9114       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
9115        cat > conftest.$ac_ext <<EOF
9116 #line 9117 "configure"
9117 #include "confdefs.h"
9118 #ifdef HAVE_SYS_TYPES_H
9119 #include <sys/types.h>
9120 #endif
9121 #ifdef HAVE_SYS_TIME_H
9122 #include <sys/time.h>
9123 #endif
9124 #ifdef HAVE_SYS_SELECT_H
9125 #include <sys/select.h>
9126 #endif
9127 #ifdef HAVE_SYS_SOCKET_H
9128 #include <sys/socket.h>
9129 #endif
9130 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);
9131 int main() {
9132
9133 ; return 0; }
9134 EOF
9135 if { (eval echo configure:9136: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9136   rm -rf conftest*
9137           ac_not_found=no ; break 3
9138 else
9139   echo "configure: failed program was:" >&5
9140   cat conftest.$ac_ext >&5
9141   rm -rf conftest*
9142   ac_not_found=yes
9143 fi
9144 rm -f conftest*
9145       done
9146      done
9147     done
9148    
9149 fi
9150   
9151 fi
9152  
9153 fi
9154  if test "$ac_not_found" = yes; then
9155   ac_cv_func_select_arg1=int 
9156   ac_cv_func_select_arg234='int *' 
9157   ac_cv_func_select_arg5='struct timeval *'
9158  fi
9159  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
9160  cat >> confdefs.h <<EOF
9161 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
9162 EOF
9163
9164  cat >> confdefs.h <<EOF
9165 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
9166 EOF
9167
9168  cat >> confdefs.h <<EOF
9169 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
9170 EOF
9171
9172
9173 fi
9174
9175
9176 for ac_hdr in regex.h 
9177 do
9178 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9179 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9180 echo "configure:9181: checking for $ac_hdr" >&5
9181 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9182   echo $ac_n "(cached) $ac_c" 1>&6
9183 else
9184   cat > conftest.$ac_ext <<EOF
9185 #line 9186 "configure"
9186 #include "confdefs.h"
9187 #include <$ac_hdr>
9188 EOF
9189 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9190 { (eval echo configure:9191: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9191 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9192 if test -z "$ac_err"; then
9193   rm -rf conftest*
9194   eval "ac_cv_header_$ac_safe=yes"
9195 else
9196   echo "$ac_err" >&5
9197   echo "configure: failed program was:" >&5
9198   cat conftest.$ac_ext >&5
9199   rm -rf conftest*
9200   eval "ac_cv_header_$ac_safe=no"
9201 fi
9202 rm -f conftest*
9203 fi
9204 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9205   echo "$ac_t""yes" 1>&6
9206     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9207   cat >> confdefs.h <<EOF
9208 #define $ac_tr_hdr 1
9209 EOF
9210  
9211 else
9212   echo "$ac_t""no" 1>&6
9213 fi
9214 done
9215
9216 if test "$ac_cv_header_regex_h" != yes ; then
9217         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
9218 fi
9219
9220 echo $ac_n "checking for library containing regfree""... $ac_c" 1>&6
9221 echo "configure:9222: checking for library containing regfree" >&5
9222 if eval "test \"\${ac_cv_search_regfree+set}\" = set"; then
9223   echo $ac_n "(cached) $ac_c" 1>&6
9224 else
9225   ac_func_search_save_LIBS="$LIBS"
9226 ac_cv_search_regfree="no"
9227 cat > conftest.$ac_ext <<EOF
9228 #line 9229 "configure"
9229 #include "confdefs.h"
9230 /* Override any gcc2 internal prototype to avoid an error.  */
9231 /* We use char because int might match the return type of a gcc2
9232     builtin and then its argument prototype would still apply.  */
9233 char regfree();
9234
9235 int main() {
9236 regfree()
9237 ; return 0; }
9238 EOF
9239 if { (eval echo configure:9240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9240   rm -rf conftest*
9241   ac_cv_search_regfree="none required"
9242 else
9243   echo "configure: failed program was:" >&5
9244   cat conftest.$ac_ext >&5
9245 fi
9246 rm -f conftest*
9247 test "$ac_cv_search_regfree" = "no" && for ac_lib in regex gnuregex; do
9248 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9249 cat > conftest.$ac_ext <<EOF
9250 #line 9251 "configure"
9251 #include "confdefs.h"
9252 /* Override any gcc2 internal prototype to avoid an error.  */
9253 /* We use char because int might match the return type of a gcc2
9254     builtin and then its argument prototype would still apply.  */
9255 char regfree();
9256
9257 int main() {
9258 regfree()
9259 ; return 0; }
9260 EOF
9261 if { (eval echo configure:9262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9262   rm -rf conftest*
9263   ac_cv_search_regfree="-l$ac_lib"
9264 break
9265 else
9266   echo "configure: failed program was:" >&5
9267   cat conftest.$ac_ext >&5
9268 fi
9269 rm -f conftest*
9270 done
9271 LIBS="$ac_func_search_save_LIBS"
9272 fi
9273
9274 echo "$ac_t""$ac_cv_search_regfree" 1>&6
9275 if test "$ac_cv_search_regfree" != "no"; then
9276   test "$ac_cv_search_regfree" = "none required" || LIBS="$ac_cv_search_regfree $LIBS"
9277   :
9278 else :
9279   { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
9280 fi
9281
9282
9283 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
9284 echo "configure:9285: checking for compatible POSIX regex" >&5
9285 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
9286   echo $ac_n "(cached) $ac_c" 1>&6
9287 else
9288   
9289         if test "$cross_compiling" = yes; then
9290   ol_cv_c_posix_regex=cross
9291 else
9292   cat > conftest.$ac_ext <<EOF
9293 #line 9294 "configure"
9294 #include "confdefs.h"
9295
9296 #include <sys/types.h>
9297 #include <regex.h>
9298 static char *pattern, *string;
9299 main()
9300 {
9301         int rc;
9302         regex_t re;
9303
9304         pattern = "^A";
9305
9306         if(regcomp(&re, pattern, 0)) {
9307                 return -1;
9308         }
9309         
9310         string = "ALL MATCH";
9311         
9312         rc = regexec(&re, string, 0, (void*)0, 0);
9313
9314         regfree(&re);
9315
9316         return rc;
9317 }
9318 EOF
9319 if { (eval echo configure:9320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9320 then
9321   ol_cv_c_posix_regex=yes
9322 else
9323   echo "configure: failed program was:" >&5
9324   cat conftest.$ac_ext >&5
9325   rm -fr conftest*
9326   ol_cv_c_posix_regex=no
9327 fi
9328 rm -fr conftest*
9329 fi
9330
9331 fi
9332
9333 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
9334
9335 if test "$ol_cv_c_posix_regex" = no ; then
9336         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
9337 fi
9338
9339
9340 have_uuid=no
9341 for ac_hdr in sys/uuid.h
9342 do
9343 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9344 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9345 echo "configure:9346: checking for $ac_hdr" >&5
9346 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9347   echo $ac_n "(cached) $ac_c" 1>&6
9348 else
9349   cat > conftest.$ac_ext <<EOF
9350 #line 9351 "configure"
9351 #include "confdefs.h"
9352 #include <$ac_hdr>
9353 EOF
9354 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9355 { (eval echo configure:9356: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9356 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9357 if test -z "$ac_err"; then
9358   rm -rf conftest*
9359   eval "ac_cv_header_$ac_safe=yes"
9360 else
9361   echo "$ac_err" >&5
9362   echo "configure: failed program was:" >&5
9363   cat conftest.$ac_ext >&5
9364   rm -rf conftest*
9365   eval "ac_cv_header_$ac_safe=no"
9366 fi
9367 rm -f conftest*
9368 fi
9369 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9370   echo "$ac_t""yes" 1>&6
9371     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9372   cat >> confdefs.h <<EOF
9373 #define $ac_tr_hdr 1
9374 EOF
9375  
9376 else
9377   echo "$ac_t""no" 1>&6
9378 fi
9379 done
9380
9381 if test $ac_cv_header_sys_uuid_h = yes ; then
9382         save_LIBS="$LIBS"
9383         
9384 echo $ac_n "checking for library containing uuid_to_str""... $ac_c" 1>&6
9385 echo "configure:9386: checking for library containing uuid_to_str" >&5
9386 if eval "test \"\${ac_cv_search_uuid_to_str+set}\" = set"; then
9387   echo $ac_n "(cached) $ac_c" 1>&6
9388 else
9389   ac_func_search_save_LIBS="$LIBS"
9390 ac_cv_search_uuid_to_str="no"
9391 cat > conftest.$ac_ext <<EOF
9392 #line 9393 "configure"
9393 #include "confdefs.h"
9394 /* Override any gcc2 internal prototype to avoid an error.  */
9395 /* We use char because int might match the return type of a gcc2
9396     builtin and then its argument prototype would still apply.  */
9397 char uuid_to_str();
9398
9399 int main() {
9400 uuid_to_str()
9401 ; return 0; }
9402 EOF
9403 if { (eval echo configure:9404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9404   rm -rf conftest*
9405   ac_cv_search_uuid_to_str="none required"
9406 else
9407   echo "configure: failed program was:" >&5
9408   cat conftest.$ac_ext >&5
9409 fi
9410 rm -f conftest*
9411 test "$ac_cv_search_uuid_to_str" = "no" && for ac_lib in uuid; do
9412 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9413 cat > conftest.$ac_ext <<EOF
9414 #line 9415 "configure"
9415 #include "confdefs.h"
9416 /* Override any gcc2 internal prototype to avoid an error.  */
9417 /* We use char because int might match the return type of a gcc2
9418     builtin and then its argument prototype would still apply.  */
9419 char uuid_to_str();
9420
9421 int main() {
9422 uuid_to_str()
9423 ; return 0; }
9424 EOF
9425 if { (eval echo configure:9426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9426   rm -rf conftest*
9427   ac_cv_search_uuid_to_str="-l$ac_lib"
9428 break
9429 else
9430   echo "configure: failed program was:" >&5
9431   cat conftest.$ac_ext >&5
9432 fi
9433 rm -f conftest*
9434 done
9435 LIBS="$ac_func_search_save_LIBS"
9436 fi
9437
9438 echo "$ac_t""$ac_cv_search_uuid_to_str" 1>&6
9439 if test "$ac_cv_search_uuid_to_str" != "no"; then
9440   test "$ac_cv_search_uuid_to_str" = "none required" || LIBS="$ac_cv_search_uuid_to_str $LIBS"
9441   have_uuid=yes
9442 else :
9443   :
9444 fi
9445         LIBS="$save_LIBS"
9446
9447         if test have_uuid = yes ; then
9448                 cat >> confdefs.h <<\EOF
9449 #define HAVE_UUID_TO_STR 1
9450 EOF
9451
9452
9453                 test "$ac_cv_search_uuid_to_str" = "none required" || \
9454                         SLAPD_LIBS="$SLAPD_LIBS $ac_cv_search_uuid_to_str"
9455         fi
9456 fi
9457
9458 if test $have_uuid = no ; then
9459         echo $ac_n "checking to see if -lrpcrt4 is needed for win32 UUID support""... $ac_c" 1>&6
9460 echo "configure:9461: checking to see if -lrpcrt4 is needed for win32 UUID support" >&5
9461         save_LIBS="$LIBS"
9462         LIBS="$LIBS -lrpcrt4"
9463         cat > conftest.$ac_ext <<EOF
9464 #line 9465 "configure"
9465 #include "confdefs.h"
9466
9467                 int __stdcall UuidCreate(void *);
9468                 int __stdcall UuidToStringA(void *,void **);
9469                 
9470 int main() {
9471
9472                 UuidCreate(0);
9473                 UuidToStringA(0,0);
9474                 
9475 ; return 0; }
9476 EOF
9477 if { (eval echo configure:9478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9478   rm -rf conftest*
9479   need_rpcrt=yes
9480 else
9481   echo "configure: failed program was:" >&5
9482   cat conftest.$ac_ext >&5
9483   rm -rf conftest*
9484   need_rpcrt=no
9485 fi
9486 rm -f conftest*
9487         if test $need_rpcrt = yes; then
9488                 SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
9489         fi
9490         LIBS="$save_LIBS"
9491         echo "$ac_t""$need_rpcrt" 1>&6
9492 fi
9493
9494 ol_link_dnssrv=no
9495 echo $ac_n "checking for res_query""... $ac_c" 1>&6
9496 echo "configure:9497: checking for res_query" >&5
9497 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
9498   echo $ac_n "(cached) $ac_c" 1>&6
9499 else
9500   cat > conftest.$ac_ext <<EOF
9501 #line 9502 "configure"
9502 #include "confdefs.h"
9503 /* System header to define __stub macros and hopefully few prototypes,
9504     which can conflict with char res_query(); below.  */
9505 #include <assert.h>
9506 /* Override any gcc2 internal prototype to avoid an error.  */
9507 /* We use char because int might match the return type of a gcc2
9508     builtin and then its argument prototype would still apply.  */
9509 char res_query();
9510 char (*f)();
9511
9512 int main() {
9513
9514 /* The GNU C library defines this for functions which it implements
9515     to always fail with ENOSYS.  Some functions are actually named
9516     something starting with __ and the normal name is an alias.  */
9517 #if defined (__stub_res_query) || defined (__stub___res_query)
9518 choke me
9519 #else
9520 f = res_query;
9521 #endif
9522
9523 ; return 0; }
9524 EOF
9525 if { (eval echo configure:9526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9526   rm -rf conftest*
9527   eval "ac_cv_func_res_query=yes"
9528 else
9529   echo "configure: failed program was:" >&5
9530   cat conftest.$ac_ext >&5
9531   rm -rf conftest*
9532   eval "ac_cv_func_res_query=no"
9533 fi
9534 rm -f conftest*
9535 fi
9536
9537 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
9538   echo "$ac_t""yes" 1>&6
9539   :
9540 else
9541   echo "$ac_t""no" 1>&6
9542 fi
9543
9544 if test $ac_cv_func_res_query = no ; then 
9545         echo $ac_n "checking for __res_query""... $ac_c" 1>&6
9546 echo "configure:9547: checking for __res_query" >&5
9547 if eval "test \"\${ac_cv_func___res_query+set}\" = set"; then
9548   echo $ac_n "(cached) $ac_c" 1>&6
9549 else
9550   cat > conftest.$ac_ext <<EOF
9551 #line 9552 "configure"
9552 #include "confdefs.h"
9553 /* System header to define __stub macros and hopefully few prototypes,
9554     which can conflict with char __res_query(); below.  */
9555 #include <assert.h>
9556 /* Override any gcc2 internal prototype to avoid an error.  */
9557 /* We use char because int might match the return type of a gcc2
9558     builtin and then its argument prototype would still apply.  */
9559 char __res_query();
9560 char (*f)();
9561
9562 int main() {
9563
9564 /* The GNU C library defines this for functions which it implements
9565     to always fail with ENOSYS.  Some functions are actually named
9566     something starting with __ and the normal name is an alias.  */
9567 #if defined (__stub___res_query) || defined (__stub_____res_query)
9568 choke me
9569 #else
9570 f = __res_query;
9571 #endif
9572
9573 ; return 0; }
9574 EOF
9575 if { (eval echo configure:9576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9576   rm -rf conftest*
9577   eval "ac_cv_func___res_query=yes"
9578 else
9579   echo "configure: failed program was:" >&5
9580   cat conftest.$ac_ext >&5
9581   rm -rf conftest*
9582   eval "ac_cv_func___res_query=no"
9583 fi
9584 rm -f conftest*
9585 fi
9586
9587 if eval "test \"`echo '$ac_cv_func_'__res_query`\" = yes"; then
9588   echo "$ac_t""yes" 1>&6
9589   :
9590 else
9591   echo "$ac_t""no" 1>&6
9592 fi
9593
9594         ac_cv_func_res_query=$ac_cv_func___res_query
9595 fi
9596
9597 if test $ac_cv_func_res_query = no ; then 
9598         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
9599 echo "configure:9600: checking for res_query in -lbind" >&5
9600 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
9601 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9602   echo $ac_n "(cached) $ac_c" 1>&6
9603 else
9604   ac_save_LIBS="$LIBS"
9605 LIBS="-lbind  $LIBS"
9606 cat > conftest.$ac_ext <<EOF
9607 #line 9608 "configure"
9608 #include "confdefs.h"
9609 /* Override any gcc2 internal prototype to avoid an error.  */
9610 /* We use char because int might match the return type of a gcc2
9611     builtin and then its argument prototype would still apply.  */
9612 char res_query();
9613
9614 int main() {
9615 res_query()
9616 ; return 0; }
9617 EOF
9618 if { (eval echo configure:9619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9619   rm -rf conftest*
9620   eval "ac_cv_lib_$ac_lib_var=yes"
9621 else
9622   echo "configure: failed program was:" >&5
9623   cat conftest.$ac_ext >&5
9624   rm -rf conftest*
9625   eval "ac_cv_lib_$ac_lib_var=no"
9626 fi
9627 rm -f conftest*
9628 LIBS="$ac_save_LIBS"
9629
9630 fi
9631 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9632   echo "$ac_t""yes" 1>&6
9633     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9634     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9635   cat >> confdefs.h <<EOF
9636 #define $ac_tr_lib 1
9637 EOF
9638
9639   LIBS="-lbind $LIBS"
9640
9641 else
9642   echo "$ac_t""no" 1>&6
9643 fi
9644
9645         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
9646 fi
9647
9648 if test $ac_cv_func_res_query = no ; then 
9649         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
9650 echo "configure:9651: checking for __res_query in -lbind" >&5
9651 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
9652 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9653   echo $ac_n "(cached) $ac_c" 1>&6
9654 else
9655   ac_save_LIBS="$LIBS"
9656 LIBS="-lbind  $LIBS"
9657 cat > conftest.$ac_ext <<EOF
9658 #line 9659 "configure"
9659 #include "confdefs.h"
9660 /* Override any gcc2 internal prototype to avoid an error.  */
9661 /* We use char because int might match the return type of a gcc2
9662     builtin and then its argument prototype would still apply.  */
9663 char __res_query();
9664
9665 int main() {
9666 __res_query()
9667 ; return 0; }
9668 EOF
9669 if { (eval echo configure:9670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9670   rm -rf conftest*
9671   eval "ac_cv_lib_$ac_lib_var=yes"
9672 else
9673   echo "configure: failed program was:" >&5
9674   cat conftest.$ac_ext >&5
9675   rm -rf conftest*
9676   eval "ac_cv_lib_$ac_lib_var=no"
9677 fi
9678 rm -f conftest*
9679 LIBS="$ac_save_LIBS"
9680
9681 fi
9682 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9683   echo "$ac_t""yes" 1>&6
9684     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9685     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9686   cat >> confdefs.h <<EOF
9687 #define $ac_tr_lib 1
9688 EOF
9689
9690   LIBS="-lbind $LIBS"
9691
9692 else
9693   echo "$ac_t""no" 1>&6
9694 fi
9695
9696         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
9697 fi
9698
9699 if test $ac_cv_func_res_query = no ; then 
9700         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
9701 echo "configure:9702: checking for res_query in -lresolv" >&5
9702 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
9703 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9704   echo $ac_n "(cached) $ac_c" 1>&6
9705 else
9706   ac_save_LIBS="$LIBS"
9707 LIBS="-lresolv  $LIBS"
9708 cat > conftest.$ac_ext <<EOF
9709 #line 9710 "configure"
9710 #include "confdefs.h"
9711 /* Override any gcc2 internal prototype to avoid an error.  */
9712 /* We use char because int might match the return type of a gcc2
9713     builtin and then its argument prototype would still apply.  */
9714 char res_query();
9715
9716 int main() {
9717 res_query()
9718 ; return 0; }
9719 EOF
9720 if { (eval echo configure:9721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9721   rm -rf conftest*
9722   eval "ac_cv_lib_$ac_lib_var=yes"
9723 else
9724   echo "configure: failed program was:" >&5
9725   cat conftest.$ac_ext >&5
9726   rm -rf conftest*
9727   eval "ac_cv_lib_$ac_lib_var=no"
9728 fi
9729 rm -f conftest*
9730 LIBS="$ac_save_LIBS"
9731
9732 fi
9733 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9734   echo "$ac_t""yes" 1>&6
9735     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9736     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9737   cat >> confdefs.h <<EOF
9738 #define $ac_tr_lib 1
9739 EOF
9740
9741   LIBS="-lresolv $LIBS"
9742
9743 else
9744   echo "$ac_t""no" 1>&6
9745 fi
9746
9747         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
9748 fi
9749
9750 if test $ac_cv_func_res_query = no ; then 
9751         echo $ac_n "checking for __res_query in -lresolv""... $ac_c" 1>&6
9752 echo "configure:9753: checking for __res_query in -lresolv" >&5
9753 ac_lib_var=`echo resolv'_'__res_query | sed 'y%./+-:%__p__%'`
9754 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9755   echo $ac_n "(cached) $ac_c" 1>&6
9756 else
9757   ac_save_LIBS="$LIBS"
9758 LIBS="-lresolv  $LIBS"
9759 cat > conftest.$ac_ext <<EOF
9760 #line 9761 "configure"
9761 #include "confdefs.h"
9762 /* Override any gcc2 internal prototype to avoid an error.  */
9763 /* We use char because int might match the return type of a gcc2
9764     builtin and then its argument prototype would still apply.  */
9765 char __res_query();
9766
9767 int main() {
9768 __res_query()
9769 ; return 0; }
9770 EOF
9771 if { (eval echo configure:9772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9772   rm -rf conftest*
9773   eval "ac_cv_lib_$ac_lib_var=yes"
9774 else
9775   echo "configure: failed program was:" >&5
9776   cat conftest.$ac_ext >&5
9777   rm -rf conftest*
9778   eval "ac_cv_lib_$ac_lib_var=no"
9779 fi
9780 rm -f conftest*
9781 LIBS="$ac_save_LIBS"
9782
9783 fi
9784 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9785   echo "$ac_t""yes" 1>&6
9786     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9787     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9788   cat >> confdefs.h <<EOF
9789 #define $ac_tr_lib 1
9790 EOF
9791
9792   LIBS="-lresolv $LIBS"
9793
9794 else
9795   echo "$ac_t""no" 1>&6
9796 fi
9797
9798         ac_cv_func_res_query=$ac_cv_lib_resolv___res_query
9799 fi
9800
9801 if test $ac_cv_func_res_query = no ; then 
9802         echo $ac_n "checking for _res_9_query in -lresolv""... $ac_c" 1>&6
9803 echo "configure:9804: checking for _res_9_query in -lresolv" >&5
9804 ac_lib_var=`echo resolv'_'_res_9_query | sed 'y%./+-:%__p__%'`
9805 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9806   echo $ac_n "(cached) $ac_c" 1>&6
9807 else
9808   ac_save_LIBS="$LIBS"
9809 LIBS="-lresolv  $LIBS"
9810 cat > conftest.$ac_ext <<EOF
9811 #line 9812 "configure"
9812 #include "confdefs.h"
9813 /* Override any gcc2 internal prototype to avoid an error.  */
9814 /* We use char because int might match the return type of a gcc2
9815     builtin and then its argument prototype would still apply.  */
9816 char _res_9_query();
9817
9818 int main() {
9819 _res_9_query()
9820 ; return 0; }
9821 EOF
9822 if { (eval echo configure:9823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9823   rm -rf conftest*
9824   eval "ac_cv_lib_$ac_lib_var=yes"
9825 else
9826   echo "configure: failed program was:" >&5
9827   cat conftest.$ac_ext >&5
9828   rm -rf conftest*
9829   eval "ac_cv_lib_$ac_lib_var=no"
9830 fi
9831 rm -f conftest*
9832 LIBS="$ac_save_LIBS"
9833
9834 fi
9835 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9836   echo "$ac_t""yes" 1>&6
9837     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9838     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9839   cat >> confdefs.h <<EOF
9840 #define $ac_tr_lib 1
9841 EOF
9842
9843   LIBS="-lresolv $LIBS"
9844
9845 else
9846   echo "$ac_t""no" 1>&6
9847 fi
9848
9849         ac_cv_func_res_query=$ac_cv_lib_resolv_res_9_query
9850 fi
9851
9852 if test "$ac_cv_func_res_query" = yes ; then
9853         cat >> confdefs.h <<\EOF
9854 #define HAVE_RES_QUERY 1
9855 EOF
9856
9857
9858         if test $ol_enable_dnssrv != no ; then
9859                 ol_link_dnssrv=yes
9860         fi
9861 fi
9862
9863 if test "$ol_enable_dnssrv" != no -a "$ol_link_dnssrv" = no ; then
9864         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
9865 fi
9866
9867 for ac_func in getaddrinfo getnameinfo gai_strerror inet_ntop 
9868 do
9869 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9870 echo "configure:9871: checking for $ac_func" >&5
9871 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9872   echo $ac_n "(cached) $ac_c" 1>&6
9873 else
9874   cat > conftest.$ac_ext <<EOF
9875 #line 9876 "configure"
9876 #include "confdefs.h"
9877 /* System header to define __stub macros and hopefully few prototypes,
9878     which can conflict with char $ac_func(); below.  */
9879 #include <assert.h>
9880 /* Override any gcc2 internal prototype to avoid an error.  */
9881 /* We use char because int might match the return type of a gcc2
9882     builtin and then its argument prototype would still apply.  */
9883 char $ac_func();
9884 char (*f)();
9885
9886 int main() {
9887
9888 /* The GNU C library defines this for functions which it implements
9889     to always fail with ENOSYS.  Some functions are actually named
9890     something starting with __ and the normal name is an alias.  */
9891 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9892 choke me
9893 #else
9894 f = $ac_func;
9895 #endif
9896
9897 ; return 0; }
9898 EOF
9899 if { (eval echo configure:9900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9900   rm -rf conftest*
9901   eval "ac_cv_func_$ac_func=yes"
9902 else
9903   echo "configure: failed program was:" >&5
9904   cat conftest.$ac_ext >&5
9905   rm -rf conftest*
9906   eval "ac_cv_func_$ac_func=no"
9907 fi
9908 rm -f conftest*
9909 fi
9910
9911 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9912   echo "$ac_t""yes" 1>&6
9913     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9914   cat >> confdefs.h <<EOF
9915 #define $ac_tr_func 1
9916 EOF
9917  
9918 else
9919   echo "$ac_t""no" 1>&6
9920 fi
9921 done
9922
9923
9924 ol_link_ipv6=no
9925 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
9926         if test $ol_enable_ipv6 = yes ; then
9927                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
9928         fi
9929 elif test $ol_enable_ipv6 != no ; then
9930         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
9931 echo "configure:9932: checking INET6_ADDRSTRLEN" >&5
9932 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
9933   echo $ac_n "(cached) $ac_c" 1>&6
9934 else
9935   
9936                 cat > conftest.$ac_ext <<EOF
9937 #line 9938 "configure"
9938 #include "confdefs.h"
9939
9940 #                       include <netinet/in.h>
9941 #                       ifdef INET6_ADDRSTRLEN
9942                                 __has_inet6_addrstrlen__;
9943 #                       endif
9944                 
9945 EOF
9946 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9947   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
9948   rm -rf conftest*
9949   ol_cv_inet6_addrstrlen=yes
9950 else
9951   rm -rf conftest*
9952   ol_cv_inet6_addrstrlen=no
9953 fi
9954 rm -f conftest*
9955
9956 fi
9957
9958 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
9959
9960
9961         echo $ac_n "checking struct sockaddr_storage""... $ac_c" 1>&6
9962 echo "configure:9963: checking struct sockaddr_storage" >&5
9963 if eval "test \"\${ol_cv_struct_sockaddr_storage+set}\" = set"; then
9964   echo $ac_n "(cached) $ac_c" 1>&6
9965 else
9966   
9967                 cat > conftest.$ac_ext <<EOF
9968 #line 9969 "configure"
9969 #include "confdefs.h"
9970
9971 #include <sys/types.h>
9972 #include <sys/socket.h>
9973
9974 int main() {
9975
9976                         struct sockaddr_storage ss;
9977
9978 ; return 0; }
9979 EOF
9980 if { (eval echo configure:9981: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9981   rm -rf conftest*
9982   ol_cv_struct_sockaddr_storage=yes
9983 else
9984   echo "configure: failed program was:" >&5
9985   cat conftest.$ac_ext >&5
9986   rm -rf conftest*
9987   ol_cv_struct_sockaddr_storage=no
9988 fi
9989 rm -f conftest*
9990 fi
9991
9992 echo "$ac_t""$ol_cv_struct_sockaddr_storage" 1>&6
9993
9994         if test $ol_cv_inet6_addrstrlen = yes \
9995                 -a $ol_cv_struct_sockaddr_storage = yes ; then
9996                 ol_link_ipv6=yes
9997         elif test $ol_enable_ipv6 = yes \
9998                         -a $ol_cv_inet6_addrstrlen = no ; then
9999                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
10000         elif test $ol_enable_ipv6 = yes \
10001                         -a $ol_cv_struct_sockaddr_storage = no ; then
10002                 { echo "configure: error: IPv6 support requires struct sockaddr_storage" 1>&2; exit 1; }
10003         fi
10004 fi
10005
10006 if test $ol_enable_local != no ; then
10007         for ac_hdr in sys/un.h 
10008 do
10009 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10010 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10011 echo "configure:10012: checking for $ac_hdr" >&5
10012 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10013   echo $ac_n "(cached) $ac_c" 1>&6
10014 else
10015   cat > conftest.$ac_ext <<EOF
10016 #line 10017 "configure"
10017 #include "confdefs.h"
10018 #include <$ac_hdr>
10019 EOF
10020 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10021 { (eval echo configure:10022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10022 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10023 if test -z "$ac_err"; then
10024   rm -rf conftest*
10025   eval "ac_cv_header_$ac_safe=yes"
10026 else
10027   echo "$ac_err" >&5
10028   echo "configure: failed program was:" >&5
10029   cat conftest.$ac_ext >&5
10030   rm -rf conftest*
10031   eval "ac_cv_header_$ac_safe=no"
10032 fi
10033 rm -f conftest*
10034 fi
10035 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10036   echo "$ac_t""yes" 1>&6
10037     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10038   cat >> confdefs.h <<EOF
10039 #define $ac_tr_hdr 1
10040 EOF
10041  
10042 else
10043   echo "$ac_t""no" 1>&6
10044 fi
10045 done
10046
10047
10048         if test $ol_enable_local = auto ; then
10049                 ol_enable_local=$ac_cv_header_sys_un_h
10050         elif test $ac_cv_header_sys_un_h = no ; then
10051                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
10052         fi
10053 fi
10054
10055 ol_link_kbind=no
10056 ol_link_krb5=no
10057 ol_link_krb4=no
10058
10059 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
10060         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
10061         -o $ol_with_kerberos = k425 ; then
10062
10063         for ac_hdr in krb5.h
10064 do
10065 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10066 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10067 echo "configure:10068: checking for $ac_hdr" >&5
10068 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10069   echo $ac_n "(cached) $ac_c" 1>&6
10070 else
10071   cat > conftest.$ac_ext <<EOF
10072 #line 10073 "configure"
10073 #include "confdefs.h"
10074 #include <$ac_hdr>
10075 EOF
10076 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10077 { (eval echo configure:10078: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10078 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10079 if test -z "$ac_err"; then
10080   rm -rf conftest*
10081   eval "ac_cv_header_$ac_safe=yes"
10082 else
10083   echo "$ac_err" >&5
10084   echo "configure: failed program was:" >&5
10085   cat conftest.$ac_ext >&5
10086   rm -rf conftest*
10087   eval "ac_cv_header_$ac_safe=no"
10088 fi
10089 rm -f conftest*
10090 fi
10091 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10092   echo "$ac_t""yes" 1>&6
10093     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10094   cat >> confdefs.h <<EOF
10095 #define $ac_tr_hdr 1
10096 EOF
10097  
10098 else
10099   echo "$ac_t""no" 1>&6
10100 fi
10101 done
10102
10103
10104         if test $ac_cv_header_krb5_h = yes ; then
10105                                 for ac_hdr in heim_err.h
10106 do
10107 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10108 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10109 echo "configure:10110: checking for $ac_hdr" >&5
10110 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10111   echo $ac_n "(cached) $ac_c" 1>&6
10112 else
10113   cat > conftest.$ac_ext <<EOF
10114 #line 10115 "configure"
10115 #include "confdefs.h"
10116 #include <$ac_hdr>
10117 EOF
10118 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10119 { (eval echo configure:10120: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10120 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10121 if test -z "$ac_err"; then
10122   rm -rf conftest*
10123   eval "ac_cv_header_$ac_safe=yes"
10124 else
10125   echo "$ac_err" >&5
10126   echo "configure: failed program was:" >&5
10127   cat conftest.$ac_ext >&5
10128   rm -rf conftest*
10129   eval "ac_cv_header_$ac_safe=no"
10130 fi
10131 rm -f conftest*
10132 fi
10133 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10134   echo "$ac_t""yes" 1>&6
10135     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10136   cat >> confdefs.h <<EOF
10137 #define $ac_tr_hdr 1
10138 EOF
10139  
10140 else
10141   echo "$ac_t""no" 1>&6
10142 fi
10143 done
10144
10145                 if test $ac_cv_header_heim_err_h = yes ; then
10146                         krb5_impl=heimdal
10147                 else
10148                         krb5_impl=mit
10149                 fi
10150
10151                 if test $krb5_impl = mit; then
10152                         echo $ac_n "checking for main in -lk5crypto""... $ac_c" 1>&6
10153 echo "configure:10154: checking for main in -lk5crypto" >&5
10154 ac_lib_var=`echo k5crypto'_'main | sed 'y%./+-:%__p__%'`
10155 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10156   echo $ac_n "(cached) $ac_c" 1>&6
10157 else
10158   ac_save_LIBS="$LIBS"
10159 LIBS="-lk5crypto  $LIBS"
10160 cat > conftest.$ac_ext <<EOF
10161 #line 10162 "configure"
10162 #include "confdefs.h"
10163
10164 int main() {
10165 main()
10166 ; return 0; }
10167 EOF
10168 if { (eval echo configure:10169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10169   rm -rf conftest*
10170   eval "ac_cv_lib_$ac_lib_var=yes"
10171 else
10172   echo "configure: failed program was:" >&5
10173   cat conftest.$ac_ext >&5
10174   rm -rf conftest*
10175   eval "ac_cv_lib_$ac_lib_var=no"
10176 fi
10177 rm -f conftest*
10178 LIBS="$ac_save_LIBS"
10179
10180 fi
10181 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10182   echo "$ac_t""yes" 1>&6
10183   krb5crypto=k5crypto
10184 else
10185   echo "$ac_t""no" 1>&6
10186 krb5crypto=crypto
10187 fi
10188
10189
10190                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
10191 echo "configure:10192: checking for main in -lkrb5" >&5
10192 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
10193 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10194   echo $ac_n "(cached) $ac_c" 1>&6
10195 else
10196   ac_save_LIBS="$LIBS"
10197 LIBS="-lkrb5 -l$krb5crypto -lcom_err $LIBS"
10198 cat > conftest.$ac_ext <<EOF
10199 #line 10200 "configure"
10200 #include "confdefs.h"
10201
10202 int main() {
10203 main()
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   have_krb5=yes
10222                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lcom_err"
10223 else
10224   echo "$ac_t""no" 1>&6
10225 have_krb5=no
10226 fi
10227
10228
10229                 elif test $krb5_impl = heimdal; then
10230                         echo $ac_n "checking for main in -ldes""... $ac_c" 1>&6
10231 echo "configure:10232: checking for main in -ldes" >&5
10232 ac_lib_var=`echo des'_'main | sed 'y%./+-:%__p__%'`
10233 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10234   echo $ac_n "(cached) $ac_c" 1>&6
10235 else
10236   ac_save_LIBS="$LIBS"
10237 LIBS="-ldes  $LIBS"
10238 cat > conftest.$ac_ext <<EOF
10239 #line 10240 "configure"
10240 #include "confdefs.h"
10241
10242 int main() {
10243 main()
10244 ; return 0; }
10245 EOF
10246 if { (eval echo configure:10247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10247   rm -rf conftest*
10248   eval "ac_cv_lib_$ac_lib_var=yes"
10249 else
10250   echo "configure: failed program was:" >&5
10251   cat conftest.$ac_ext >&5
10252   rm -rf conftest*
10253   eval "ac_cv_lib_$ac_lib_var=no"
10254 fi
10255 rm -f conftest*
10256 LIBS="$ac_save_LIBS"
10257
10258 fi
10259 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10260   echo "$ac_t""yes" 1>&6
10261   krb5crypto=des
10262 else
10263   echo "$ac_t""no" 1>&6
10264 krb5crypto=crypto
10265 fi
10266
10267
10268                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
10269 echo "configure:10270: checking for main in -lkrb5" >&5
10270 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
10271 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10272   echo $ac_n "(cached) $ac_c" 1>&6
10273 else
10274   ac_save_LIBS="$LIBS"
10275 LIBS="-lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err $LIBS"
10276 cat > conftest.$ac_ext <<EOF
10277 #line 10278 "configure"
10278 #include "confdefs.h"
10279
10280 int main() {
10281 main()
10282 ; return 0; }
10283 EOF
10284 if { (eval echo configure:10285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10285   rm -rf conftest*
10286   eval "ac_cv_lib_$ac_lib_var=yes"
10287 else
10288   echo "configure: failed program was:" >&5
10289   cat conftest.$ac_ext >&5
10290   rm -rf conftest*
10291   eval "ac_cv_lib_$ac_lib_var=no"
10292 fi
10293 rm -f conftest*
10294 LIBS="$ac_save_LIBS"
10295
10296 fi
10297 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10298   echo "$ac_t""yes" 1>&6
10299   have_krb5=yes
10300                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err"
10301 else
10302   echo "$ac_t""no" 1>&6
10303 have_krb5=no
10304 fi
10305
10306
10307                         cat >> confdefs.h <<\EOF
10308 #define HAVE_HEIMDAL_KERBEROS 1
10309 EOF
10310
10311
10312                 else
10313                         have_krb5=no
10314                         echo "configure: warning: Unrecognized Kerberos5 Implementation" 1>&2
10315                 fi
10316
10317                 if test $have_krb5 = yes ; then
10318                         ol_link_krb5=yes
10319
10320                         cat >> confdefs.h <<\EOF
10321 #define HAVE_KRB5 1
10322 EOF
10323
10324
10325                         if test $ol_with_kerberos = k5only ; then
10326                                 ol_with_kerberos=found
10327                         fi
10328
10329                 elif test $ol_with_kerberos != auto ; then
10330                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
10331                 fi
10332
10333         fi
10334 fi
10335
10336 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
10337         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
10338
10339         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
10340 do
10341 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10342 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10343 echo "configure:10344: checking for $ac_hdr" >&5
10344 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10345   echo $ac_n "(cached) $ac_c" 1>&6
10346 else
10347   cat > conftest.$ac_ext <<EOF
10348 #line 10349 "configure"
10349 #include "confdefs.h"
10350 #include <$ac_hdr>
10351 EOF
10352 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10353 { (eval echo configure:10354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10354 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10355 if test -z "$ac_err"; then
10356   rm -rf conftest*
10357   eval "ac_cv_header_$ac_safe=yes"
10358 else
10359   echo "$ac_err" >&5
10360   echo "configure: failed program was:" >&5
10361   cat conftest.$ac_ext >&5
10362   rm -rf conftest*
10363   eval "ac_cv_header_$ac_safe=no"
10364 fi
10365 rm -f conftest*
10366 fi
10367 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10368   echo "$ac_t""yes" 1>&6
10369     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10370   cat >> confdefs.h <<EOF
10371 #define $ac_tr_hdr 1
10372 EOF
10373  
10374 else
10375   echo "$ac_t""no" 1>&6
10376 fi
10377 done
10378
10379
10380         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
10381                 if test $krb5_impl = mit; then
10382                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
10383 echo "configure:10384: checking for main in -lkrb4" >&5
10384 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
10385 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10386   echo $ac_n "(cached) $ac_c" 1>&6
10387 else
10388   ac_save_LIBS="$LIBS"
10389 LIBS="-lkrb4 -ldes425 -lkrb5 -l$krb5crypto -lcom_err $LIBS"
10390 cat > conftest.$ac_ext <<EOF
10391 #line 10392 "configure"
10392 #include "confdefs.h"
10393
10394 int main() {
10395 main()
10396 ; return 0; }
10397 EOF
10398 if { (eval echo configure:10399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10399   rm -rf conftest*
10400   eval "ac_cv_lib_$ac_lib_var=yes"
10401 else
10402   echo "configure: failed program was:" >&5
10403   cat conftest.$ac_ext >&5
10404   rm -rf conftest*
10405   eval "ac_cv_lib_$ac_lib_var=no"
10406 fi
10407 rm -f conftest*
10408 LIBS="$ac_save_LIBS"
10409
10410 fi
10411 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10412   echo "$ac_t""yes" 1>&6
10413   have_k425=yes
10414                                 KRB4_LIBS="-lkrb4 -ldes425"
10415 else
10416   echo "$ac_t""no" 1>&6
10417 have_k425=no
10418 fi
10419
10420
10421                 elif test $krb5_impl = heimdal; then
10422                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
10423 echo "configure:10424: checking for main in -lkrb4" >&5
10424 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
10425 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10426   echo $ac_n "(cached) $ac_c" 1>&6
10427 else
10428   ac_save_LIBS="$LIBS"
10429 LIBS="-lkrb4 -lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err $LIBS"
10430 cat > conftest.$ac_ext <<EOF
10431 #line 10432 "configure"
10432 #include "confdefs.h"
10433
10434 int main() {
10435 main()
10436 ; return 0; }
10437 EOF
10438 if { (eval echo configure:10439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10439   rm -rf conftest*
10440   eval "ac_cv_lib_$ac_lib_var=yes"
10441 else
10442   echo "configure: failed program was:" >&5
10443   cat conftest.$ac_ext >&5
10444   rm -rf conftest*
10445   eval "ac_cv_lib_$ac_lib_var=no"
10446 fi
10447 rm -f conftest*
10448 LIBS="$ac_save_LIBS"
10449
10450 fi
10451 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10452   echo "$ac_t""yes" 1>&6
10453   have_k425=yes
10454                                 KRB4_LIBS="-lkrb4"
10455 else
10456   echo "$ac_t""no" 1>&6
10457 have_k425=no
10458 fi
10459
10460
10461                 else
10462                         have_425=no
10463                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
10464                 fi
10465
10466                 if test $have_k425 = yes ; then
10467                         ol_with_kerberos=found
10468                         ol_link_krb4=yes
10469
10470                         cat >> confdefs.h <<\EOF
10471 #define HAVE_KRB425 1
10472 EOF
10473
10474                         cat >> confdefs.h <<\EOF
10475 #define HAVE_KRB4 1
10476 EOF
10477
10478
10479                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
10480 echo "configure:10481: checking for des_debug in Kerberos libraries" >&5
10481 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
10482   echo $ac_n "(cached) $ac_c" 1>&6
10483 else
10484   
10485                                                                 save_LIBS="$LIBS"
10486                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
10487                                 cat > conftest.$ac_ext <<EOF
10488 #line 10489 "configure"
10489 #include "confdefs.h"
10490
10491 #include <kerberosIV/krb.h>
10492 #include <kerberosIV/des.h>
10493 extern int des_debug;
10494
10495 int main() {
10496
10497 des_debug = 1;
10498
10499 ; return 0; }
10500 EOF
10501 if { (eval echo configure:10502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10502   rm -rf conftest*
10503   ol_cv_var_des_debug=yes
10504 else
10505   echo "configure: failed program was:" >&5
10506   cat conftest.$ac_ext >&5
10507   rm -rf conftest*
10508   ol_cv_var_des_debug=no
10509 fi
10510 rm -f conftest*
10511                                                                 LIBS="$save_LIBS"
10512                         
10513 fi
10514
10515 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
10516
10517                         if test $ol_cv_var_des_debug = yes ; then
10518                                 cat >> confdefs.h <<\EOF
10519 #define HAVE_DES_DEBUG 1
10520 EOF
10521
10522                         fi
10523
10524                         LIBS="$save_LIBS"
10525                 fi
10526         fi
10527 fi
10528
10529 if test $ol_link_krb5 = yes ; then
10530         ol_with_kerberos=found
10531 fi
10532
10533 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
10534         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
10535
10536         for ac_hdr in krb.h des.h krb-archaeology.h 
10537 do
10538 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10539 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10540 echo "configure:10541: checking for $ac_hdr" >&5
10541 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10542   echo $ac_n "(cached) $ac_c" 1>&6
10543 else
10544   cat > conftest.$ac_ext <<EOF
10545 #line 10546 "configure"
10546 #include "confdefs.h"
10547 #include <$ac_hdr>
10548 EOF
10549 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10550 { (eval echo configure:10551: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10551 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10552 if test -z "$ac_err"; then
10553   rm -rf conftest*
10554   eval "ac_cv_header_$ac_safe=yes"
10555 else
10556   echo "$ac_err" >&5
10557   echo "configure: failed program was:" >&5
10558   cat conftest.$ac_ext >&5
10559   rm -rf conftest*
10560   eval "ac_cv_header_$ac_safe=no"
10561 fi
10562 rm -f conftest*
10563 fi
10564 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10565   echo "$ac_t""yes" 1>&6
10566     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10567   cat >> confdefs.h <<EOF
10568 #define $ac_tr_hdr 1
10569 EOF
10570  
10571 else
10572   echo "$ac_t""no" 1>&6
10573 fi
10574 done
10575
10576
10577         if test $ac_cv_header_krb_h = yes ; then
10578                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
10579 echo "configure:10580: checking for main in -lkrb" >&5
10580 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
10581 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10582   echo $ac_n "(cached) $ac_c" 1>&6
10583 else
10584   ac_save_LIBS="$LIBS"
10585 LIBS="-lkrb -ldes $LIBS"
10586 cat > conftest.$ac_ext <<EOF
10587 #line 10588 "configure"
10588 #include "confdefs.h"
10589
10590 int main() {
10591 main()
10592 ; return 0; }
10593 EOF
10594 if { (eval echo configure:10595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10595   rm -rf conftest*
10596   eval "ac_cv_lib_$ac_lib_var=yes"
10597 else
10598   echo "configure: failed program was:" >&5
10599   cat conftest.$ac_ext >&5
10600   rm -rf conftest*
10601   eval "ac_cv_lib_$ac_lib_var=no"
10602 fi
10603 rm -f conftest*
10604 LIBS="$ac_save_LIBS"
10605
10606 fi
10607 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10608   echo "$ac_t""yes" 1>&6
10609   have_k4=yes
10610 else
10611   echo "$ac_t""no" 1>&6
10612 have_k4=no
10613 fi
10614
10615
10616                 if test $have_k4 = yes ; then
10617                         ol_with_kerberos=found
10618                         ol_link_krb4=yes
10619
10620                         cat >> confdefs.h <<\EOF
10621 #define HAVE_KRB4 1
10622 EOF
10623
10624
10625                         KRB4_LIBS="-lkrb -ldes"
10626
10627                         if test $ac_cv_header_krb_archaeology_h = yes ; then
10628                                 cat >> confdefs.h <<\EOF
10629 #define HAVE_KTH_KERBEROS 1
10630 EOF
10631
10632                         fi
10633                 fi
10634         fi
10635 fi
10636
10637 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
10638         ol_link_kbind=yes
10639
10640 elif test $ol_enable_kbind = yes ; then
10641         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
10642 fi
10643
10644 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
10645         cat >> confdefs.h <<\EOF
10646 #define HAVE_KERBEROS 1
10647 EOF
10648
10649
10650 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
10651         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
10652 fi
10653
10654 ol_link_tls=no
10655 if test $ol_with_tls != no ; then
10656         for ac_hdr in openssl/ssl.h ssl.h
10657 do
10658 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10659 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10660 echo "configure:10661: checking for $ac_hdr" >&5
10661 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10662   echo $ac_n "(cached) $ac_c" 1>&6
10663 else
10664   cat > conftest.$ac_ext <<EOF
10665 #line 10666 "configure"
10666 #include "confdefs.h"
10667 #include <$ac_hdr>
10668 EOF
10669 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10670 { (eval echo configure:10671: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10671 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10672 if test -z "$ac_err"; then
10673   rm -rf conftest*
10674   eval "ac_cv_header_$ac_safe=yes"
10675 else
10676   echo "$ac_err" >&5
10677   echo "configure: failed program was:" >&5
10678   cat conftest.$ac_ext >&5
10679   rm -rf conftest*
10680   eval "ac_cv_header_$ac_safe=no"
10681 fi
10682 rm -f conftest*
10683 fi
10684 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10685   echo "$ac_t""yes" 1>&6
10686     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10687   cat >> confdefs.h <<EOF
10688 #define $ac_tr_hdr 1
10689 EOF
10690  
10691 else
10692   echo "$ac_t""no" 1>&6
10693 fi
10694 done
10695
10696         
10697         if test $ac_cv_header_openssl_ssl_h = yes \
10698                 -o $ac_cv_header_ssl_h = yes ; then
10699                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
10700 echo "configure:10701: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
10701 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
10702 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10703   echo $ac_n "(cached) $ac_c" 1>&6
10704 else
10705   ac_save_LIBS="$LIBS"
10706 LIBS="-lssl -lcrypto $LIBS"
10707 cat > conftest.$ac_ext <<EOF
10708 #line 10709 "configure"
10709 #include "confdefs.h"
10710 /* Override any gcc2 internal prototype to avoid an error.  */
10711 /* We use char because int might match the return type of a gcc2
10712     builtin and then its argument prototype would still apply.  */
10713 char SSLeay_add_ssl_algorithms();
10714
10715 int main() {
10716 SSLeay_add_ssl_algorithms()
10717 ; return 0; }
10718 EOF
10719 if { (eval echo configure:10720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10720   rm -rf conftest*
10721   eval "ac_cv_lib_$ac_lib_var=yes"
10722 else
10723   echo "configure: failed program was:" >&5
10724   cat conftest.$ac_ext >&5
10725   rm -rf conftest*
10726   eval "ac_cv_lib_$ac_lib_var=no"
10727 fi
10728 rm -f conftest*
10729 LIBS="$ac_save_LIBS"
10730
10731 fi
10732 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10733   echo "$ac_t""yes" 1>&6
10734   have_ssleay=yes
10735                         need_rsaref=no
10736 else
10737   echo "$ac_t""no" 1>&6
10738 have_ssleay=no
10739 fi
10740
10741                         
10742                 if test $have_ssleay = no ; then
10743                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
10744 echo "configure:10745: checking for SSL_library_init in -lssl" >&5
10745 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
10746 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10747   echo $ac_n "(cached) $ac_c" 1>&6
10748 else
10749   ac_save_LIBS="$LIBS"
10750 LIBS="-lssl -lcrypto $LIBS"
10751 cat > conftest.$ac_ext <<EOF
10752 #line 10753 "configure"
10753 #include "confdefs.h"
10754 /* Override any gcc2 internal prototype to avoid an error.  */
10755 /* We use char because int might match the return type of a gcc2
10756     builtin and then its argument prototype would still apply.  */
10757 char SSL_library_init();
10758
10759 int main() {
10760 SSL_library_init()
10761 ; return 0; }
10762 EOF
10763 if { (eval echo configure:10764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10764   rm -rf conftest*
10765   eval "ac_cv_lib_$ac_lib_var=yes"
10766 else
10767   echo "configure: failed program was:" >&5
10768   cat conftest.$ac_ext >&5
10769   rm -rf conftest*
10770   eval "ac_cv_lib_$ac_lib_var=no"
10771 fi
10772 rm -f conftest*
10773 LIBS="$ac_save_LIBS"
10774
10775 fi
10776 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10777   echo "$ac_t""yes" 1>&6
10778   have_ssleay=yes
10779                                 need_rsaref=no
10780 else
10781   echo "$ac_t""no" 1>&6
10782 have_ssleay=no
10783 fi
10784
10785                 fi
10786
10787                 if test $have_ssleay = no ; then
10788                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
10789 echo "configure:10790: checking for ssl3_accept in -lssl" >&5
10790 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
10791 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10792   echo $ac_n "(cached) $ac_c" 1>&6
10793 else
10794   ac_save_LIBS="$LIBS"
10795 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
10796 cat > conftest.$ac_ext <<EOF
10797 #line 10798 "configure"
10798 #include "confdefs.h"
10799 /* Override any gcc2 internal prototype to avoid an error.  */
10800 /* We use char because int might match the return type of a gcc2
10801     builtin and then its argument prototype would still apply.  */
10802 char ssl3_accept();
10803
10804 int main() {
10805 ssl3_accept()
10806 ; return 0; }
10807 EOF
10808 if { (eval echo configure:10809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10809   rm -rf conftest*
10810   eval "ac_cv_lib_$ac_lib_var=yes"
10811 else
10812   echo "configure: failed program was:" >&5
10813   cat conftest.$ac_ext >&5
10814   rm -rf conftest*
10815   eval "ac_cv_lib_$ac_lib_var=no"
10816 fi
10817 rm -f conftest*
10818 LIBS="$ac_save_LIBS"
10819
10820 fi
10821 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10822   echo "$ac_t""yes" 1>&6
10823   have_ssleay=yes
10824                                 need_rsaref=yes
10825 else
10826   echo "$ac_t""no" 1>&6
10827 have_ssleay=no
10828 fi
10829
10830                 fi
10831
10832                 if test $have_ssleay = yes ; then
10833                         ol_with_tls=found
10834                         ol_link_tls=yes
10835
10836                         cat >> confdefs.h <<\EOF
10837 #define HAVE_SSLEAY 1
10838 EOF
10839
10840
10841                         if test $need_rsaref = yes; then
10842                                 cat >> confdefs.h <<\EOF
10843 #define HAVE_RSAREF 1
10844 EOF
10845
10846
10847                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
10848                         else
10849                                 TLS_LIBS="-lssl -lcrypto"
10850                         fi
10851                 fi
10852         fi
10853
10854 else
10855         echo "configure: warning: TLS data protection not supported!" 1>&2
10856 fi
10857
10858 WITH_TLS=no
10859 if test $ol_link_tls = yes ; then
10860         cat >> confdefs.h <<\EOF
10861 #define HAVE_TLS 1
10862 EOF
10863
10864         WITH_TLS=yes
10865
10866 elif test $ol_with_tls = auto ; then
10867         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
10868         echo "configure: warning: TLS data protection not supported!" 1>&2
10869
10870 elif test $ol_with_tls != no ; then
10871         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
10872 fi
10873
10874 if test $ol_enable_lmpasswd != no; then
10875         if test $ol_link_tls != yes ; then
10876                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
10877         fi
10878
10879         cat >> confdefs.h <<\EOF
10880 #define SLAPD_LMHASH 1
10881 EOF
10882
10883 fi
10884
10885 ol_link_threads=no
10886
10887 if test $ol_with_threads = auto -o $ol_with_threads = yes \
10888         -o $ol_with_threads = nt ; then
10889
10890         
10891         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
10892 echo "configure:10893: checking for _beginthread" >&5
10893 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
10894   echo $ac_n "(cached) $ac_c" 1>&6
10895 else
10896   cat > conftest.$ac_ext <<EOF
10897 #line 10898 "configure"
10898 #include "confdefs.h"
10899 /* System header to define __stub macros and hopefully few prototypes,
10900     which can conflict with char _beginthread(); below.  */
10901 #include <assert.h>
10902 /* Override any gcc2 internal prototype to avoid an error.  */
10903 /* We use char because int might match the return type of a gcc2
10904     builtin and then its argument prototype would still apply.  */
10905 char _beginthread();
10906 char (*f)();
10907
10908 int main() {
10909
10910 /* The GNU C library defines this for functions which it implements
10911     to always fail with ENOSYS.  Some functions are actually named
10912     something starting with __ and the normal name is an alias.  */
10913 #if defined (__stub__beginthread) || defined (__stub____beginthread)
10914 choke me
10915 #else
10916 f = _beginthread;
10917 #endif
10918
10919 ; return 0; }
10920 EOF
10921 if { (eval echo configure:10922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10922   rm -rf conftest*
10923   eval "ac_cv_func__beginthread=yes"
10924 else
10925   echo "configure: failed program was:" >&5
10926   cat conftest.$ac_ext >&5
10927   rm -rf conftest*
10928   eval "ac_cv_func__beginthread=no"
10929 fi
10930 rm -f conftest*
10931 fi
10932
10933 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
10934   echo "$ac_t""yes" 1>&6
10935   :
10936 else
10937   echo "$ac_t""no" 1>&6
10938 fi
10939
10940
10941         if test $ac_cv_func__beginthread = yes ; then
10942                 cat >> confdefs.h <<\EOF
10943 #define HAVE_NT_THREADS 1
10944 EOF
10945
10946                 ol_cv_nt_threads=yes
10947         fi
10948
10949
10950         if test "$ol_cv_nt_threads" = yes ; then
10951                 ol_link_threads=nt
10952                 ol_with_threads=found
10953                 ol_with_yielding_select=yes
10954
10955                 cat >> confdefs.h <<\EOF
10956 #define HAVE_NT_SERVICE_MANAGER 1
10957 EOF
10958
10959                 cat >> confdefs.h <<\EOF
10960 #define HAVE_NT_EVENT_LOG 1
10961 EOF
10962
10963         fi
10964
10965         if test $ol_with_threads = nt ; then
10966                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
10967         fi
10968 fi
10969
10970 if test $ol_with_threads = auto -o $ol_with_threads = yes \
10971         -o $ol_with_threads = posix ; then
10972
10973         for ac_hdr in pthread.h
10974 do
10975 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10976 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10977 echo "configure:10978: checking for $ac_hdr" >&5
10978 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10979   echo $ac_n "(cached) $ac_c" 1>&6
10980 else
10981   cat > conftest.$ac_ext <<EOF
10982 #line 10983 "configure"
10983 #include "confdefs.h"
10984 #include <$ac_hdr>
10985 EOF
10986 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10987 { (eval echo configure:10988: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10988 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10989 if test -z "$ac_err"; then
10990   rm -rf conftest*
10991   eval "ac_cv_header_$ac_safe=yes"
10992 else
10993   echo "$ac_err" >&5
10994   echo "configure: failed program was:" >&5
10995   cat conftest.$ac_ext >&5
10996   rm -rf conftest*
10997   eval "ac_cv_header_$ac_safe=no"
10998 fi
10999 rm -f conftest*
11000 fi
11001 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11002   echo "$ac_t""yes" 1>&6
11003     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11004   cat >> confdefs.h <<EOF
11005 #define $ac_tr_hdr 1
11006 EOF
11007  
11008 else
11009   echo "$ac_t""no" 1>&6
11010 fi
11011 done
11012
11013
11014         if test $ac_cv_header_pthread_h = yes ; then
11015                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
11016 echo "configure:11017: checking POSIX thread version" >&5
11017 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
11018   echo $ac_n "(cached) $ac_c" 1>&6
11019 else
11020   
11021         cat > conftest.$ac_ext <<EOF
11022 #line 11023 "configure"
11023 #include "confdefs.h"
11024
11025 #               include <pthread.h>
11026         
11027 int main() {
11028
11029                 int i = PTHREAD_CREATE_JOINABLE;
11030         
11031 ; return 0; }
11032 EOF
11033 if { (eval echo configure:11034: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11034   rm -rf conftest*
11035   
11036         cat > conftest.$ac_ext <<EOF
11037 #line 11038 "configure"
11038 #include "confdefs.h"
11039 #include <pthread.h>
11040 EOF
11041 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11042   egrep "pthread_detach" >/dev/null 2>&1; then
11043   rm -rf conftest*
11044   ol_cv_pthread_version=10
11045 else
11046   rm -rf conftest*
11047   ol_cv_pthread_version=8
11048 fi
11049 rm -f conftest*
11050
11051 else
11052   echo "configure: failed program was:" >&5
11053   cat conftest.$ac_ext >&5
11054   rm -rf conftest*
11055   
11056         cat > conftest.$ac_ext <<EOF
11057 #line 11058 "configure"
11058 #include "confdefs.h"
11059
11060 #               include <pthread.h>
11061 #               ifdef PTHREAD_CREATE_UNDETACHED
11062                 draft7
11063 #               endif
11064         
11065 EOF
11066 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11067   egrep "draft7" >/dev/null 2>&1; then
11068   rm -rf conftest*
11069   ol_cv_pthread_version=7
11070 else
11071   rm -rf conftest*
11072   
11073         cat > conftest.$ac_ext <<EOF
11074 #line 11075 "configure"
11075 #include "confdefs.h"
11076 #include <pthread.h>
11077 EOF
11078 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11079   egrep "pthread_attr_init" >/dev/null 2>&1; then
11080   rm -rf conftest*
11081   ol_cv_pthread_version=6
11082 else
11083   rm -rf conftest*
11084   
11085         cat > conftest.$ac_ext <<EOF
11086 #line 11087 "configure"
11087 #include "confdefs.h"
11088
11089 #               include <pthread.h>
11090 #ifdef          PTHREAD_MUTEX_INITIALIZER
11091                 draft5
11092 #endif
11093         
11094 EOF
11095 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11096   egrep "draft5" >/dev/null 2>&1; then
11097   rm -rf conftest*
11098   ol_cv_pthread_version=5
11099 else
11100   rm -rf conftest*
11101   ol_cv_pthread_version=4
11102 fi
11103 rm -f conftest*
11104  
11105 fi
11106 rm -f conftest*
11107  
11108 fi
11109 rm -f conftest*
11110  
11111 fi
11112 rm -f conftest*
11113
11114 fi
11115
11116 echo "$ac_t""$ol_cv_pthread_version" 1>&6
11117
11118
11119                 if test $ol_cv_pthread_version != 0 ; then
11120                         cat >> confdefs.h <<EOF
11121 #define HAVE_PTHREADS $ol_cv_pthread_version
11122 EOF
11123
11124                 else
11125                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
11126                 fi
11127
11128                 # consider threads found
11129                 ol_with_threads=found
11130
11131                 
11132         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
11133 echo "configure:11134: checking for LinuxThreads pthread.h" >&5
11134 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
11135   echo $ac_n "(cached) $ac_c" 1>&6
11136 else
11137   cat > conftest.$ac_ext <<EOF
11138 #line 11139 "configure"
11139 #include "confdefs.h"
11140 #include <pthread.h>
11141 EOF
11142 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11143   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
11144   rm -rf conftest*
11145   ol_cv_header_linux_threads=yes
11146 else
11147   rm -rf conftest*
11148   ol_cv_header_linux_threads=no
11149 fi
11150 rm -f conftest*
11151
11152                 
11153 fi
11154
11155 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
11156         if test $ol_cv_header_linux_threads = yes; then
11157                 cat >> confdefs.h <<\EOF
11158 #define HAVE_LINUX_THREADS 1
11159 EOF
11160
11161         fi
11162
11163                 
11164         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
11165 echo "configure:11166: checking for GNU Pth pthread.h" >&5
11166 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
11167   echo $ac_n "(cached) $ac_c" 1>&6
11168 else
11169   cat > conftest.$ac_ext <<EOF
11170 #line 11171 "configure"
11171 #include "confdefs.h"
11172 #include <pthread.h>
11173 #ifdef _POSIX_THREAD_IS_GNU_PTH
11174         __gnu_pth__;
11175 #endif
11176
11177 EOF
11178 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11179   egrep "__gnu_pth__" >/dev/null 2>&1; then
11180   rm -rf conftest*
11181   ol_cv_header_gnu_pth_pthread_h=yes
11182 else
11183   rm -rf conftest*
11184   ol_cv_header_gnu_pth_pthread_h=no
11185 fi
11186 rm -f conftest*
11187
11188                 
11189 fi
11190
11191 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
11192
11193
11194                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
11195                         for ac_hdr in sched.h
11196 do
11197 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11198 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11199 echo "configure:11200: checking for $ac_hdr" >&5
11200 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11201   echo $ac_n "(cached) $ac_c" 1>&6
11202 else
11203   cat > conftest.$ac_ext <<EOF
11204 #line 11205 "configure"
11205 #include "confdefs.h"
11206 #include <$ac_hdr>
11207 EOF
11208 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11209 { (eval echo configure:11210: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11210 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11211 if test -z "$ac_err"; then
11212   rm -rf conftest*
11213   eval "ac_cv_header_$ac_safe=yes"
11214 else
11215   echo "$ac_err" >&5
11216   echo "configure: failed program was:" >&5
11217   cat conftest.$ac_ext >&5
11218   rm -rf conftest*
11219   eval "ac_cv_header_$ac_safe=no"
11220 fi
11221 rm -f conftest*
11222 fi
11223 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11224   echo "$ac_t""yes" 1>&6
11225     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11226   cat >> confdefs.h <<EOF
11227 #define $ac_tr_hdr 1
11228 EOF
11229  
11230 else
11231   echo "$ac_t""no" 1>&6
11232 fi
11233 done
11234
11235                 fi
11236
11237                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
11238                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
11239 echo "configure:11240: checking for pthread_create in default libraries" >&5
11240 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
11241   echo $ac_n "(cached) $ac_c" 1>&6
11242 else
11243   
11244                 if test "$cross_compiling" = yes; then
11245   cat > conftest.$ac_ext <<EOF
11246 #line 11247 "configure"
11247 #include "confdefs.h"
11248 /* pthread test headers */
11249 #include <pthread.h>
11250 #if HAVE_PTHREADS < 7
11251 #include <errno.h>
11252 #endif
11253 #ifndef NULL
11254 #define NULL (void*)0
11255 #endif
11256
11257 static void *task(p)
11258         void *p;
11259 {
11260         return (void *) (p == NULL);
11261 }
11262
11263 int main() {
11264
11265         /* pthread test function */
11266 #ifndef PTHREAD_CREATE_DETACHED
11267 #define PTHREAD_CREATE_DETACHED 1
11268 #endif
11269         pthread_t t;
11270         int status;
11271         int detach = PTHREAD_CREATE_DETACHED;
11272
11273 #if HAVE_PTHREADS > 4
11274         /* Final pthreads */
11275         pthread_attr_t attr;
11276
11277         status = pthread_attr_init(&attr);
11278         if( status ) return status;
11279
11280 #if HAVE_PTHREADS < 7
11281         status = pthread_attr_setdetachstate(&attr, &detach);
11282         if( status < 0 ) status = errno;
11283 #else
11284         status = pthread_attr_setdetachstate(&attr, detach);
11285 #endif
11286         if( status ) return status;
11287         status = pthread_create( &t, &attr, task, NULL );
11288 #if HAVE_PTHREADS < 7
11289         if( status < 0 ) status = errno;
11290 #endif
11291         if( status ) return status;
11292 #else
11293         /* Draft 4 pthreads */
11294         status = pthread_create( &t, pthread_attr_default, task, NULL );
11295         if( status ) return errno;
11296
11297         /* give thread a chance to complete */
11298         /* it should remain joinable and hence detachable */
11299         sleep( 1 );
11300
11301         status = pthread_detach( &t );
11302         if( status ) return errno;
11303 #endif
11304
11305 #ifdef HAVE_LINUX_THREADS
11306         pthread_kill_other_threads_np();
11307 #endif
11308
11309         return 0;
11310
11311 ; return 0; }
11312 EOF
11313 if { (eval echo configure:11314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11314   rm -rf conftest*
11315   ol_cv_pthread_create=yes
11316 else
11317   echo "configure: failed program was:" >&5
11318   cat conftest.$ac_ext >&5
11319   rm -rf conftest*
11320   ol_cv_pthread_create=no
11321 fi
11322 rm -f conftest*
11323 else
11324   cat > conftest.$ac_ext <<EOF
11325 #line 11326 "configure"
11326 #include "confdefs.h"
11327 /* pthread test headers */
11328 #include <pthread.h>
11329 #if HAVE_PTHREADS < 7
11330 #include <errno.h>
11331 #endif
11332 #ifndef NULL
11333 #define NULL (void*)0
11334 #endif
11335
11336 static void *task(p)
11337         void *p;
11338 {
11339         return (void *) (p == NULL);
11340 }
11341
11342
11343 int main(argc, argv)
11344         int argc;
11345         char **argv;
11346 {
11347
11348         /* pthread test function */
11349 #ifndef PTHREAD_CREATE_DETACHED
11350 #define PTHREAD_CREATE_DETACHED 1
11351 #endif
11352         pthread_t t;
11353         int status;
11354         int detach = PTHREAD_CREATE_DETACHED;
11355
11356 #if HAVE_PTHREADS > 4
11357         /* Final pthreads */
11358         pthread_attr_t attr;
11359
11360         status = pthread_attr_init(&attr);
11361         if( status ) return status;
11362
11363 #if HAVE_PTHREADS < 7
11364         status = pthread_attr_setdetachstate(&attr, &detach);
11365         if( status < 0 ) status = errno;
11366 #else
11367         status = pthread_attr_setdetachstate(&attr, detach);
11368 #endif
11369         if( status ) return status;
11370         status = pthread_create( &t, &attr, task, NULL );
11371 #if HAVE_PTHREADS < 7
11372         if( status < 0 ) status = errno;
11373 #endif
11374         if( status ) return status;
11375 #else
11376         /* Draft 4 pthreads */
11377         status = pthread_create( &t, pthread_attr_default, task, NULL );
11378         if( status ) return errno;
11379
11380         /* give thread a chance to complete */
11381         /* it should remain joinable and hence detachable */
11382         sleep( 1 );
11383
11384         status = pthread_detach( &t );
11385         if( status ) return errno;
11386 #endif
11387
11388 #ifdef HAVE_LINUX_THREADS
11389         pthread_kill_other_threads_np();
11390 #endif
11391
11392         return 0;
11393
11394 }
11395
11396 EOF
11397 if { (eval echo configure:11398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11398 then
11399   ol_cv_pthread_create=yes
11400 else
11401   echo "configure: failed program was:" >&5
11402   cat conftest.$ac_ext >&5
11403   rm -fr conftest*
11404   ol_cv_pthread_create=no
11405 fi
11406 rm -fr conftest*
11407 fi
11408
11409 fi
11410
11411 echo "$ac_t""$ol_cv_pthread_create" 1>&6
11412
11413                 if test $ol_cv_pthread_create != no ; then
11414                         ol_link_threads=posix
11415                         ol_link_pthreads=""
11416                 fi
11417                 
11418                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
11419 if test "$ol_link_threads" = no ; then
11420         # try -kthread
11421         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
11422 echo "configure:11423: checking for pthread link with -kthread" >&5
11423 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
11424   echo $ac_n "(cached) $ac_c" 1>&6
11425 else
11426   
11427                 # save the flags
11428                 ol_LIBS="$LIBS"
11429                 LIBS="-kthread $LIBS"
11430
11431                 if test "$cross_compiling" = yes; then
11432   cat > conftest.$ac_ext <<EOF
11433 #line 11434 "configure"
11434 #include "confdefs.h"
11435 /* pthread test headers */
11436 #include <pthread.h>
11437 #if HAVE_PTHREADS < 7
11438 #include <errno.h>
11439 #endif
11440 #ifndef NULL
11441 #define NULL (void*)0
11442 #endif
11443
11444 static void *task(p)
11445         void *p;
11446 {
11447         return (void *) (p == NULL);
11448 }
11449
11450 int main() {
11451
11452         /* pthread test function */
11453 #ifndef PTHREAD_CREATE_DETACHED
11454 #define PTHREAD_CREATE_DETACHED 1
11455 #endif
11456         pthread_t t;
11457         int status;
11458         int detach = PTHREAD_CREATE_DETACHED;
11459
11460 #if HAVE_PTHREADS > 4
11461         /* Final pthreads */
11462         pthread_attr_t attr;
11463
11464         status = pthread_attr_init(&attr);
11465         if( status ) return status;
11466
11467 #if HAVE_PTHREADS < 7
11468         status = pthread_attr_setdetachstate(&attr, &detach);
11469         if( status < 0 ) status = errno;
11470 #else
11471         status = pthread_attr_setdetachstate(&attr, detach);
11472 #endif
11473         if( status ) return status;
11474         status = pthread_create( &t, &attr, task, NULL );
11475 #if HAVE_PTHREADS < 7
11476         if( status < 0 ) status = errno;
11477 #endif
11478         if( status ) return status;
11479 #else
11480         /* Draft 4 pthreads */
11481         status = pthread_create( &t, pthread_attr_default, task, NULL );
11482         if( status ) return errno;
11483
11484         /* give thread a chance to complete */
11485         /* it should remain joinable and hence detachable */
11486         sleep( 1 );
11487
11488         status = pthread_detach( &t );
11489         if( status ) return errno;
11490 #endif
11491
11492 #ifdef HAVE_LINUX_THREADS
11493         pthread_kill_other_threads_np();
11494 #endif
11495
11496         return 0;
11497
11498 ; return 0; }
11499 EOF
11500 if { (eval echo configure:11501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11501   rm -rf conftest*
11502   ol_cv_pthread_kthread=yes
11503 else
11504   echo "configure: failed program was:" >&5
11505   cat conftest.$ac_ext >&5
11506   rm -rf conftest*
11507   ol_cv_pthread_kthread=no
11508 fi
11509 rm -f conftest*
11510 else
11511   cat > conftest.$ac_ext <<EOF
11512 #line 11513 "configure"
11513 #include "confdefs.h"
11514 /* pthread test headers */
11515 #include <pthread.h>
11516 #if HAVE_PTHREADS < 7
11517 #include <errno.h>
11518 #endif
11519 #ifndef NULL
11520 #define NULL (void*)0
11521 #endif
11522
11523 static void *task(p)
11524         void *p;
11525 {
11526         return (void *) (p == NULL);
11527 }
11528
11529
11530 int main(argc, argv)
11531         int argc;
11532         char **argv;
11533 {
11534
11535         /* pthread test function */
11536 #ifndef PTHREAD_CREATE_DETACHED
11537 #define PTHREAD_CREATE_DETACHED 1
11538 #endif
11539         pthread_t t;
11540         int status;
11541         int detach = PTHREAD_CREATE_DETACHED;
11542
11543 #if HAVE_PTHREADS > 4
11544         /* Final pthreads */
11545         pthread_attr_t attr;
11546
11547         status = pthread_attr_init(&attr);
11548         if( status ) return status;
11549
11550 #if HAVE_PTHREADS < 7
11551         status = pthread_attr_setdetachstate(&attr, &detach);
11552         if( status < 0 ) status = errno;
11553 #else
11554         status = pthread_attr_setdetachstate(&attr, detach);
11555 #endif
11556         if( status ) return status;
11557         status = pthread_create( &t, &attr, task, NULL );
11558 #if HAVE_PTHREADS < 7
11559         if( status < 0 ) status = errno;
11560 #endif
11561         if( status ) return status;
11562 #else
11563         /* Draft 4 pthreads */
11564         status = pthread_create( &t, pthread_attr_default, task, NULL );
11565         if( status ) return errno;
11566
11567         /* give thread a chance to complete */
11568         /* it should remain joinable and hence detachable */
11569         sleep( 1 );
11570
11571         status = pthread_detach( &t );
11572         if( status ) return errno;
11573 #endif
11574
11575 #ifdef HAVE_LINUX_THREADS
11576         pthread_kill_other_threads_np();
11577 #endif
11578
11579         return 0;
11580
11581 }
11582
11583 EOF
11584 if { (eval echo configure:11585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11585 then
11586   ol_cv_pthread_kthread=yes
11587 else
11588   echo "configure: failed program was:" >&5
11589   cat conftest.$ac_ext >&5
11590   rm -fr conftest*
11591   ol_cv_pthread_kthread=no
11592 fi
11593 rm -fr conftest*
11594 fi
11595
11596
11597                 # restore the LIBS
11598                 LIBS="$ol_LIBS"
11599         
11600 fi
11601
11602 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
11603
11604         if test $ol_cv_pthread_kthread = yes ; then
11605                 ol_link_pthreads="-kthread"
11606                 ol_link_threads=posix
11607         fi
11608 fi
11609
11610                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
11611 if test "$ol_link_threads" = no ; then
11612         # try -pthread
11613         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
11614 echo "configure:11615: checking for pthread link with -pthread" >&5
11615 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
11616   echo $ac_n "(cached) $ac_c" 1>&6
11617 else
11618   
11619                 # save the flags
11620                 ol_LIBS="$LIBS"
11621                 LIBS="-pthread $LIBS"
11622
11623                 if test "$cross_compiling" = yes; then
11624   cat > conftest.$ac_ext <<EOF
11625 #line 11626 "configure"
11626 #include "confdefs.h"
11627 /* pthread test headers */
11628 #include <pthread.h>
11629 #if HAVE_PTHREADS < 7
11630 #include <errno.h>
11631 #endif
11632 #ifndef NULL
11633 #define NULL (void*)0
11634 #endif
11635
11636 static void *task(p)
11637         void *p;
11638 {
11639         return (void *) (p == NULL);
11640 }
11641
11642 int main() {
11643
11644         /* pthread test function */
11645 #ifndef PTHREAD_CREATE_DETACHED
11646 #define PTHREAD_CREATE_DETACHED 1
11647 #endif
11648         pthread_t t;
11649         int status;
11650         int detach = PTHREAD_CREATE_DETACHED;
11651
11652 #if HAVE_PTHREADS > 4
11653         /* Final pthreads */
11654         pthread_attr_t attr;
11655
11656         status = pthread_attr_init(&attr);
11657         if( status ) return status;
11658
11659 #if HAVE_PTHREADS < 7
11660         status = pthread_attr_setdetachstate(&attr, &detach);
11661         if( status < 0 ) status = errno;
11662 #else
11663         status = pthread_attr_setdetachstate(&attr, detach);
11664 #endif
11665         if( status ) return status;
11666         status = pthread_create( &t, &attr, task, NULL );
11667 #if HAVE_PTHREADS < 7
11668         if( status < 0 ) status = errno;
11669 #endif
11670         if( status ) return status;
11671 #else
11672         /* Draft 4 pthreads */
11673         status = pthread_create( &t, pthread_attr_default, task, NULL );
11674         if( status ) return errno;
11675
11676         /* give thread a chance to complete */
11677         /* it should remain joinable and hence detachable */
11678         sleep( 1 );
11679
11680         status = pthread_detach( &t );
11681         if( status ) return errno;
11682 #endif
11683
11684 #ifdef HAVE_LINUX_THREADS
11685         pthread_kill_other_threads_np();
11686 #endif
11687
11688         return 0;
11689
11690 ; return 0; }
11691 EOF
11692 if { (eval echo configure:11693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11693   rm -rf conftest*
11694   ol_cv_pthread_pthread=yes
11695 else
11696   echo "configure: failed program was:" >&5
11697   cat conftest.$ac_ext >&5
11698   rm -rf conftest*
11699   ol_cv_pthread_pthread=no
11700 fi
11701 rm -f conftest*
11702 else
11703   cat > conftest.$ac_ext <<EOF
11704 #line 11705 "configure"
11705 #include "confdefs.h"
11706 /* pthread test headers */
11707 #include <pthread.h>
11708 #if HAVE_PTHREADS < 7
11709 #include <errno.h>
11710 #endif
11711 #ifndef NULL
11712 #define NULL (void*)0
11713 #endif
11714
11715 static void *task(p)
11716         void *p;
11717 {
11718         return (void *) (p == NULL);
11719 }
11720
11721
11722 int main(argc, argv)
11723         int argc;
11724         char **argv;
11725 {
11726
11727         /* pthread test function */
11728 #ifndef PTHREAD_CREATE_DETACHED
11729 #define PTHREAD_CREATE_DETACHED 1
11730 #endif
11731         pthread_t t;
11732         int status;
11733         int detach = PTHREAD_CREATE_DETACHED;
11734
11735 #if HAVE_PTHREADS > 4
11736         /* Final pthreads */
11737         pthread_attr_t attr;
11738
11739         status = pthread_attr_init(&attr);
11740         if( status ) return status;
11741
11742 #if HAVE_PTHREADS < 7
11743         status = pthread_attr_setdetachstate(&attr, &detach);
11744         if( status < 0 ) status = errno;
11745 #else
11746         status = pthread_attr_setdetachstate(&attr, detach);
11747 #endif
11748         if( status ) return status;
11749         status = pthread_create( &t, &attr, task, NULL );
11750 #if HAVE_PTHREADS < 7
11751         if( status < 0 ) status = errno;
11752 #endif
11753         if( status ) return status;
11754 #else
11755         /* Draft 4 pthreads */
11756         status = pthread_create( &t, pthread_attr_default, task, NULL );
11757         if( status ) return errno;
11758
11759         /* give thread a chance to complete */
11760         /* it should remain joinable and hence detachable */
11761         sleep( 1 );
11762
11763         status = pthread_detach( &t );
11764         if( status ) return errno;
11765 #endif
11766
11767 #ifdef HAVE_LINUX_THREADS
11768         pthread_kill_other_threads_np();
11769 #endif
11770
11771         return 0;
11772
11773 }
11774
11775 EOF
11776 if { (eval echo configure:11777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11777 then
11778   ol_cv_pthread_pthread=yes
11779 else
11780   echo "configure: failed program was:" >&5
11781   cat conftest.$ac_ext >&5
11782   rm -fr conftest*
11783   ol_cv_pthread_pthread=no
11784 fi
11785 rm -fr conftest*
11786 fi
11787
11788
11789                 # restore the LIBS
11790                 LIBS="$ol_LIBS"
11791         
11792 fi
11793
11794 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
11795
11796         if test $ol_cv_pthread_pthread = yes ; then
11797                 ol_link_pthreads="-pthread"
11798                 ol_link_threads=posix
11799         fi
11800 fi
11801
11802                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
11803 if test "$ol_link_threads" = no ; then
11804         # try -pthreads
11805         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
11806 echo "configure:11807: checking for pthread link with -pthreads" >&5
11807 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
11808   echo $ac_n "(cached) $ac_c" 1>&6
11809 else
11810   
11811                 # save the flags
11812                 ol_LIBS="$LIBS"
11813                 LIBS="-pthreads $LIBS"
11814
11815                 if test "$cross_compiling" = yes; then
11816   cat > conftest.$ac_ext <<EOF
11817 #line 11818 "configure"
11818 #include "confdefs.h"
11819 /* pthread test headers */
11820 #include <pthread.h>
11821 #if HAVE_PTHREADS < 7
11822 #include <errno.h>
11823 #endif
11824 #ifndef NULL
11825 #define NULL (void*)0
11826 #endif
11827
11828 static void *task(p)
11829         void *p;
11830 {
11831         return (void *) (p == NULL);
11832 }
11833
11834 int main() {
11835
11836         /* pthread test function */
11837 #ifndef PTHREAD_CREATE_DETACHED
11838 #define PTHREAD_CREATE_DETACHED 1
11839 #endif
11840         pthread_t t;
11841         int status;
11842         int detach = PTHREAD_CREATE_DETACHED;
11843
11844 #if HAVE_PTHREADS > 4
11845         /* Final pthreads */
11846         pthread_attr_t attr;
11847
11848         status = pthread_attr_init(&attr);
11849         if( status ) return status;
11850
11851 #if HAVE_PTHREADS < 7
11852         status = pthread_attr_setdetachstate(&attr, &detach);
11853         if( status < 0 ) status = errno;
11854 #else
11855         status = pthread_attr_setdetachstate(&attr, detach);
11856 #endif
11857         if( status ) return status;
11858         status = pthread_create( &t, &attr, task, NULL );
11859 #if HAVE_PTHREADS < 7
11860         if( status < 0 ) status = errno;
11861 #endif
11862         if( status ) return status;
11863 #else
11864         /* Draft 4 pthreads */
11865         status = pthread_create( &t, pthread_attr_default, task, NULL );
11866         if( status ) return errno;
11867
11868         /* give thread a chance to complete */
11869         /* it should remain joinable and hence detachable */
11870         sleep( 1 );
11871
11872         status = pthread_detach( &t );
11873         if( status ) return errno;
11874 #endif
11875
11876 #ifdef HAVE_LINUX_THREADS
11877         pthread_kill_other_threads_np();
11878 #endif
11879
11880         return 0;
11881
11882 ; return 0; }
11883 EOF
11884 if { (eval echo configure:11885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11885   rm -rf conftest*
11886   ol_cv_pthread_pthreads=yes
11887 else
11888   echo "configure: failed program was:" >&5
11889   cat conftest.$ac_ext >&5
11890   rm -rf conftest*
11891   ol_cv_pthread_pthreads=no
11892 fi
11893 rm -f conftest*
11894 else
11895   cat > conftest.$ac_ext <<EOF
11896 #line 11897 "configure"
11897 #include "confdefs.h"
11898 /* pthread test headers */
11899 #include <pthread.h>
11900 #if HAVE_PTHREADS < 7
11901 #include <errno.h>
11902 #endif
11903 #ifndef NULL
11904 #define NULL (void*)0
11905 #endif
11906
11907 static void *task(p)
11908         void *p;
11909 {
11910         return (void *) (p == NULL);
11911 }
11912
11913
11914 int main(argc, argv)
11915         int argc;
11916         char **argv;
11917 {
11918
11919         /* pthread test function */
11920 #ifndef PTHREAD_CREATE_DETACHED
11921 #define PTHREAD_CREATE_DETACHED 1
11922 #endif
11923         pthread_t t;
11924         int status;
11925         int detach = PTHREAD_CREATE_DETACHED;
11926
11927 #if HAVE_PTHREADS > 4
11928         /* Final pthreads */
11929         pthread_attr_t attr;
11930
11931         status = pthread_attr_init(&attr);
11932         if( status ) return status;
11933
11934 #if HAVE_PTHREADS < 7
11935         status = pthread_attr_setdetachstate(&attr, &detach);
11936         if( status < 0 ) status = errno;
11937 #else
11938         status = pthread_attr_setdetachstate(&attr, detach);
11939 #endif
11940         if( status ) return status;
11941         status = pthread_create( &t, &attr, task, NULL );
11942 #if HAVE_PTHREADS < 7
11943         if( status < 0 ) status = errno;
11944 #endif
11945         if( status ) return status;
11946 #else
11947         /* Draft 4 pthreads */
11948         status = pthread_create( &t, pthread_attr_default, task, NULL );
11949         if( status ) return errno;
11950
11951         /* give thread a chance to complete */
11952         /* it should remain joinable and hence detachable */
11953         sleep( 1 );
11954
11955         status = pthread_detach( &t );
11956         if( status ) return errno;
11957 #endif
11958
11959 #ifdef HAVE_LINUX_THREADS
11960         pthread_kill_other_threads_np();
11961 #endif
11962
11963         return 0;
11964
11965 }
11966
11967 EOF
11968 if { (eval echo configure:11969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11969 then
11970   ol_cv_pthread_pthreads=yes
11971 else
11972   echo "configure: failed program was:" >&5
11973   cat conftest.$ac_ext >&5
11974   rm -fr conftest*
11975   ol_cv_pthread_pthreads=no
11976 fi
11977 rm -fr conftest*
11978 fi
11979
11980
11981                 # restore the LIBS
11982                 LIBS="$ol_LIBS"
11983         
11984 fi
11985
11986 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
11987
11988         if test $ol_cv_pthread_pthreads = yes ; then
11989                 ol_link_pthreads="-pthreads"
11990                 ol_link_threads=posix
11991         fi
11992 fi
11993
11994                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
11995 if test "$ol_link_threads" = no ; then
11996         # try -mthreads
11997         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
11998 echo "configure:11999: checking for pthread link with -mthreads" >&5
11999 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
12000   echo $ac_n "(cached) $ac_c" 1>&6
12001 else
12002   
12003                 # save the flags
12004                 ol_LIBS="$LIBS"
12005                 LIBS="-mthreads $LIBS"
12006
12007                 if test "$cross_compiling" = yes; then
12008   cat > conftest.$ac_ext <<EOF
12009 #line 12010 "configure"
12010 #include "confdefs.h"
12011 /* pthread test headers */
12012 #include <pthread.h>
12013 #if HAVE_PTHREADS < 7
12014 #include <errno.h>
12015 #endif
12016 #ifndef NULL
12017 #define NULL (void*)0
12018 #endif
12019
12020 static void *task(p)
12021         void *p;
12022 {
12023         return (void *) (p == NULL);
12024 }
12025
12026 int main() {
12027
12028         /* pthread test function */
12029 #ifndef PTHREAD_CREATE_DETACHED
12030 #define PTHREAD_CREATE_DETACHED 1
12031 #endif
12032         pthread_t t;
12033         int status;
12034         int detach = PTHREAD_CREATE_DETACHED;
12035
12036 #if HAVE_PTHREADS > 4
12037         /* Final pthreads */
12038         pthread_attr_t attr;
12039
12040         status = pthread_attr_init(&attr);
12041         if( status ) return status;
12042
12043 #if HAVE_PTHREADS < 7
12044         status = pthread_attr_setdetachstate(&attr, &detach);
12045         if( status < 0 ) status = errno;
12046 #else
12047         status = pthread_attr_setdetachstate(&attr, detach);
12048 #endif
12049         if( status ) return status;
12050         status = pthread_create( &t, &attr, task, NULL );
12051 #if HAVE_PTHREADS < 7
12052         if( status < 0 ) status = errno;
12053 #endif
12054         if( status ) return status;
12055 #else
12056         /* Draft 4 pthreads */
12057         status = pthread_create( &t, pthread_attr_default, task, NULL );
12058         if( status ) return errno;
12059
12060         /* give thread a chance to complete */
12061         /* it should remain joinable and hence detachable */
12062         sleep( 1 );
12063
12064         status = pthread_detach( &t );
12065         if( status ) return errno;
12066 #endif
12067
12068 #ifdef HAVE_LINUX_THREADS
12069         pthread_kill_other_threads_np();
12070 #endif
12071
12072         return 0;
12073
12074 ; return 0; }
12075 EOF
12076 if { (eval echo configure:12077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12077   rm -rf conftest*
12078   ol_cv_pthread_mthreads=yes
12079 else
12080   echo "configure: failed program was:" >&5
12081   cat conftest.$ac_ext >&5
12082   rm -rf conftest*
12083   ol_cv_pthread_mthreads=no
12084 fi
12085 rm -f conftest*
12086 else
12087   cat > conftest.$ac_ext <<EOF
12088 #line 12089 "configure"
12089 #include "confdefs.h"
12090 /* pthread test headers */
12091 #include <pthread.h>
12092 #if HAVE_PTHREADS < 7
12093 #include <errno.h>
12094 #endif
12095 #ifndef NULL
12096 #define NULL (void*)0
12097 #endif
12098
12099 static void *task(p)
12100         void *p;
12101 {
12102         return (void *) (p == NULL);
12103 }
12104
12105
12106 int main(argc, argv)
12107         int argc;
12108         char **argv;
12109 {
12110
12111         /* pthread test function */
12112 #ifndef PTHREAD_CREATE_DETACHED
12113 #define PTHREAD_CREATE_DETACHED 1
12114 #endif
12115         pthread_t t;
12116         int status;
12117         int detach = PTHREAD_CREATE_DETACHED;
12118
12119 #if HAVE_PTHREADS > 4
12120         /* Final pthreads */
12121         pthread_attr_t attr;
12122
12123         status = pthread_attr_init(&attr);
12124         if( status ) return status;
12125
12126 #if HAVE_PTHREADS < 7
12127         status = pthread_attr_setdetachstate(&attr, &detach);
12128         if( status < 0 ) status = errno;
12129 #else
12130         status = pthread_attr_setdetachstate(&attr, detach);
12131 #endif
12132         if( status ) return status;
12133         status = pthread_create( &t, &attr, task, NULL );
12134 #if HAVE_PTHREADS < 7
12135         if( status < 0 ) status = errno;
12136 #endif
12137         if( status ) return status;
12138 #else
12139         /* Draft 4 pthreads */
12140         status = pthread_create( &t, pthread_attr_default, task, NULL );
12141         if( status ) return errno;
12142
12143         /* give thread a chance to complete */
12144         /* it should remain joinable and hence detachable */
12145         sleep( 1 );
12146
12147         status = pthread_detach( &t );
12148         if( status ) return errno;
12149 #endif
12150
12151 #ifdef HAVE_LINUX_THREADS
12152         pthread_kill_other_threads_np();
12153 #endif
12154
12155         return 0;
12156
12157 }
12158
12159 EOF
12160 if { (eval echo configure:12161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12161 then
12162   ol_cv_pthread_mthreads=yes
12163 else
12164   echo "configure: failed program was:" >&5
12165   cat conftest.$ac_ext >&5
12166   rm -fr conftest*
12167   ol_cv_pthread_mthreads=no
12168 fi
12169 rm -fr conftest*
12170 fi
12171
12172
12173                 # restore the LIBS
12174                 LIBS="$ol_LIBS"
12175         
12176 fi
12177
12178 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
12179
12180         if test $ol_cv_pthread_mthreads = yes ; then
12181                 ol_link_pthreads="-mthreads"
12182                 ol_link_threads=posix
12183         fi
12184 fi
12185
12186                 # Pthread try link: -thread (ol_cv_pthread_thread)
12187 if test "$ol_link_threads" = no ; then
12188         # try -thread
12189         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
12190 echo "configure:12191: checking for pthread link with -thread" >&5
12191 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
12192   echo $ac_n "(cached) $ac_c" 1>&6
12193 else
12194   
12195                 # save the flags
12196                 ol_LIBS="$LIBS"
12197                 LIBS="-thread $LIBS"
12198
12199                 if test "$cross_compiling" = yes; then
12200   cat > conftest.$ac_ext <<EOF
12201 #line 12202 "configure"
12202 #include "confdefs.h"
12203 /* pthread test headers */
12204 #include <pthread.h>
12205 #if HAVE_PTHREADS < 7
12206 #include <errno.h>
12207 #endif
12208 #ifndef NULL
12209 #define NULL (void*)0
12210 #endif
12211
12212 static void *task(p)
12213         void *p;
12214 {
12215         return (void *) (p == NULL);
12216 }
12217
12218 int main() {
12219
12220         /* pthread test function */
12221 #ifndef PTHREAD_CREATE_DETACHED
12222 #define PTHREAD_CREATE_DETACHED 1
12223 #endif
12224         pthread_t t;
12225         int status;
12226         int detach = PTHREAD_CREATE_DETACHED;
12227
12228 #if HAVE_PTHREADS > 4
12229         /* Final pthreads */
12230         pthread_attr_t attr;
12231
12232         status = pthread_attr_init(&attr);
12233         if( status ) return status;
12234
12235 #if HAVE_PTHREADS < 7
12236         status = pthread_attr_setdetachstate(&attr, &detach);
12237         if( status < 0 ) status = errno;
12238 #else
12239         status = pthread_attr_setdetachstate(&attr, detach);
12240 #endif
12241         if( status ) return status;
12242         status = pthread_create( &t, &attr, task, NULL );
12243 #if HAVE_PTHREADS < 7
12244         if( status < 0 ) status = errno;
12245 #endif
12246         if( status ) return status;
12247 #else
12248         /* Draft 4 pthreads */
12249         status = pthread_create( &t, pthread_attr_default, task, NULL );
12250         if( status ) return errno;
12251
12252         /* give thread a chance to complete */
12253         /* it should remain joinable and hence detachable */
12254         sleep( 1 );
12255
12256         status = pthread_detach( &t );
12257         if( status ) return errno;
12258 #endif
12259
12260 #ifdef HAVE_LINUX_THREADS
12261         pthread_kill_other_threads_np();
12262 #endif
12263
12264         return 0;
12265
12266 ; return 0; }
12267 EOF
12268 if { (eval echo configure:12269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12269   rm -rf conftest*
12270   ol_cv_pthread_thread=yes
12271 else
12272   echo "configure: failed program was:" >&5
12273   cat conftest.$ac_ext >&5
12274   rm -rf conftest*
12275   ol_cv_pthread_thread=no
12276 fi
12277 rm -f conftest*
12278 else
12279   cat > conftest.$ac_ext <<EOF
12280 #line 12281 "configure"
12281 #include "confdefs.h"
12282 /* pthread test headers */
12283 #include <pthread.h>
12284 #if HAVE_PTHREADS < 7
12285 #include <errno.h>
12286 #endif
12287 #ifndef NULL
12288 #define NULL (void*)0
12289 #endif
12290
12291 static void *task(p)
12292         void *p;
12293 {
12294         return (void *) (p == NULL);
12295 }
12296
12297
12298 int main(argc, argv)
12299         int argc;
12300         char **argv;
12301 {
12302
12303         /* pthread test function */
12304 #ifndef PTHREAD_CREATE_DETACHED
12305 #define PTHREAD_CREATE_DETACHED 1
12306 #endif
12307         pthread_t t;
12308         int status;
12309         int detach = PTHREAD_CREATE_DETACHED;
12310
12311 #if HAVE_PTHREADS > 4
12312         /* Final pthreads */
12313         pthread_attr_t attr;
12314
12315         status = pthread_attr_init(&attr);
12316         if( status ) return status;
12317
12318 #if HAVE_PTHREADS < 7
12319         status = pthread_attr_setdetachstate(&attr, &detach);
12320         if( status < 0 ) status = errno;
12321 #else
12322         status = pthread_attr_setdetachstate(&attr, detach);
12323 #endif
12324         if( status ) return status;
12325         status = pthread_create( &t, &attr, task, NULL );
12326 #if HAVE_PTHREADS < 7
12327         if( status < 0 ) status = errno;
12328 #endif
12329         if( status ) return status;
12330 #else
12331         /* Draft 4 pthreads */
12332         status = pthread_create( &t, pthread_attr_default, task, NULL );
12333         if( status ) return errno;
12334
12335         /* give thread a chance to complete */
12336         /* it should remain joinable and hence detachable */
12337         sleep( 1 );
12338
12339         status = pthread_detach( &t );
12340         if( status ) return errno;
12341 #endif
12342
12343 #ifdef HAVE_LINUX_THREADS
12344         pthread_kill_other_threads_np();
12345 #endif
12346
12347         return 0;
12348
12349 }
12350
12351 EOF
12352 if { (eval echo configure:12353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12353 then
12354   ol_cv_pthread_thread=yes
12355 else
12356   echo "configure: failed program was:" >&5
12357   cat conftest.$ac_ext >&5
12358   rm -fr conftest*
12359   ol_cv_pthread_thread=no
12360 fi
12361 rm -fr conftest*
12362 fi
12363
12364
12365                 # restore the LIBS
12366                 LIBS="$ol_LIBS"
12367         
12368 fi
12369
12370 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
12371
12372         if test $ol_cv_pthread_thread = yes ; then
12373                 ol_link_pthreads="-thread"
12374                 ol_link_threads=posix
12375         fi
12376 fi
12377
12378
12379                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
12380 if test "$ol_link_threads" = no ; then
12381         # try -lpthread -lmach -lexc -lc_r
12382         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
12383 echo "configure:12384: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
12384 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
12385   echo $ac_n "(cached) $ac_c" 1>&6
12386 else
12387   
12388                 # save the flags
12389                 ol_LIBS="$LIBS"
12390                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
12391
12392                 if test "$cross_compiling" = yes; then
12393   cat > conftest.$ac_ext <<EOF
12394 #line 12395 "configure"
12395 #include "confdefs.h"
12396 /* pthread test headers */
12397 #include <pthread.h>
12398 #if HAVE_PTHREADS < 7
12399 #include <errno.h>
12400 #endif
12401 #ifndef NULL
12402 #define NULL (void*)0
12403 #endif
12404
12405 static void *task(p)
12406         void *p;
12407 {
12408         return (void *) (p == NULL);
12409 }
12410
12411 int main() {
12412
12413         /* pthread test function */
12414 #ifndef PTHREAD_CREATE_DETACHED
12415 #define PTHREAD_CREATE_DETACHED 1
12416 #endif
12417         pthread_t t;
12418         int status;
12419         int detach = PTHREAD_CREATE_DETACHED;
12420
12421 #if HAVE_PTHREADS > 4
12422         /* Final pthreads */
12423         pthread_attr_t attr;
12424
12425         status = pthread_attr_init(&attr);
12426         if( status ) return status;
12427
12428 #if HAVE_PTHREADS < 7
12429         status = pthread_attr_setdetachstate(&attr, &detach);
12430         if( status < 0 ) status = errno;
12431 #else
12432         status = pthread_attr_setdetachstate(&attr, detach);
12433 #endif
12434         if( status ) return status;
12435         status = pthread_create( &t, &attr, task, NULL );
12436 #if HAVE_PTHREADS < 7
12437         if( status < 0 ) status = errno;
12438 #endif
12439         if( status ) return status;
12440 #else
12441         /* Draft 4 pthreads */
12442         status = pthread_create( &t, pthread_attr_default, task, NULL );
12443         if( status ) return errno;
12444
12445         /* give thread a chance to complete */
12446         /* it should remain joinable and hence detachable */
12447         sleep( 1 );
12448
12449         status = pthread_detach( &t );
12450         if( status ) return errno;
12451 #endif
12452
12453 #ifdef HAVE_LINUX_THREADS
12454         pthread_kill_other_threads_np();
12455 #endif
12456
12457         return 0;
12458
12459 ; return 0; }
12460 EOF
12461 if { (eval echo configure:12462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12462   rm -rf conftest*
12463   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
12464 else
12465   echo "configure: failed program was:" >&5
12466   cat conftest.$ac_ext >&5
12467   rm -rf conftest*
12468   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
12469 fi
12470 rm -f conftest*
12471 else
12472   cat > conftest.$ac_ext <<EOF
12473 #line 12474 "configure"
12474 #include "confdefs.h"
12475 /* pthread test headers */
12476 #include <pthread.h>
12477 #if HAVE_PTHREADS < 7
12478 #include <errno.h>
12479 #endif
12480 #ifndef NULL
12481 #define NULL (void*)0
12482 #endif
12483
12484 static void *task(p)
12485         void *p;
12486 {
12487         return (void *) (p == NULL);
12488 }
12489
12490
12491 int main(argc, argv)
12492         int argc;
12493         char **argv;
12494 {
12495
12496         /* pthread test function */
12497 #ifndef PTHREAD_CREATE_DETACHED
12498 #define PTHREAD_CREATE_DETACHED 1
12499 #endif
12500         pthread_t t;
12501         int status;
12502         int detach = PTHREAD_CREATE_DETACHED;
12503
12504 #if HAVE_PTHREADS > 4
12505         /* Final pthreads */
12506         pthread_attr_t attr;
12507
12508         status = pthread_attr_init(&attr);
12509         if( status ) return status;
12510
12511 #if HAVE_PTHREADS < 7
12512         status = pthread_attr_setdetachstate(&attr, &detach);
12513         if( status < 0 ) status = errno;
12514 #else
12515         status = pthread_attr_setdetachstate(&attr, detach);
12516 #endif
12517         if( status ) return status;
12518         status = pthread_create( &t, &attr, task, NULL );
12519 #if HAVE_PTHREADS < 7
12520         if( status < 0 ) status = errno;
12521 #endif
12522         if( status ) return status;
12523 #else
12524         /* Draft 4 pthreads */
12525         status = pthread_create( &t, pthread_attr_default, task, NULL );
12526         if( status ) return errno;
12527
12528         /* give thread a chance to complete */
12529         /* it should remain joinable and hence detachable */
12530         sleep( 1 );
12531
12532         status = pthread_detach( &t );
12533         if( status ) return errno;
12534 #endif
12535
12536 #ifdef HAVE_LINUX_THREADS
12537         pthread_kill_other_threads_np();
12538 #endif
12539
12540         return 0;
12541
12542 }
12543
12544 EOF
12545 if { (eval echo configure:12546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12546 then
12547   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
12548 else
12549   echo "configure: failed program was:" >&5
12550   cat conftest.$ac_ext >&5
12551   rm -fr conftest*
12552   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
12553 fi
12554 rm -fr conftest*
12555 fi
12556
12557
12558                 # restore the LIBS
12559                 LIBS="$ol_LIBS"
12560         
12561 fi
12562
12563 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
12564
12565         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
12566                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
12567                 ol_link_threads=posix
12568         fi
12569 fi
12570
12571                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
12572 if test "$ol_link_threads" = no ; then
12573         # try -lpthread -lmach -lexc
12574         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
12575 echo "configure:12576: checking for pthread link with -lpthread -lmach -lexc" >&5
12576 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
12577   echo $ac_n "(cached) $ac_c" 1>&6
12578 else
12579   
12580                 # save the flags
12581                 ol_LIBS="$LIBS"
12582                 LIBS="-lpthread -lmach -lexc $LIBS"
12583
12584                 if test "$cross_compiling" = yes; then
12585   cat > conftest.$ac_ext <<EOF
12586 #line 12587 "configure"
12587 #include "confdefs.h"
12588 /* pthread test headers */
12589 #include <pthread.h>
12590 #if HAVE_PTHREADS < 7
12591 #include <errno.h>
12592 #endif
12593 #ifndef NULL
12594 #define NULL (void*)0
12595 #endif
12596
12597 static void *task(p)
12598         void *p;
12599 {
12600         return (void *) (p == NULL);
12601 }
12602
12603 int main() {
12604
12605         /* pthread test function */
12606 #ifndef PTHREAD_CREATE_DETACHED
12607 #define PTHREAD_CREATE_DETACHED 1
12608 #endif
12609         pthread_t t;
12610         int status;
12611         int detach = PTHREAD_CREATE_DETACHED;
12612
12613 #if HAVE_PTHREADS > 4
12614         /* Final pthreads */
12615         pthread_attr_t attr;
12616
12617         status = pthread_attr_init(&attr);
12618         if( status ) return status;
12619
12620 #if HAVE_PTHREADS < 7
12621         status = pthread_attr_setdetachstate(&attr, &detach);
12622         if( status < 0 ) status = errno;
12623 #else
12624         status = pthread_attr_setdetachstate(&attr, detach);
12625 #endif
12626         if( status ) return status;
12627         status = pthread_create( &t, &attr, task, NULL );
12628 #if HAVE_PTHREADS < 7
12629         if( status < 0 ) status = errno;
12630 #endif
12631         if( status ) return status;
12632 #else
12633         /* Draft 4 pthreads */
12634         status = pthread_create( &t, pthread_attr_default, task, NULL );
12635         if( status ) return errno;
12636
12637         /* give thread a chance to complete */
12638         /* it should remain joinable and hence detachable */
12639         sleep( 1 );
12640
12641         status = pthread_detach( &t );
12642         if( status ) return errno;
12643 #endif
12644
12645 #ifdef HAVE_LINUX_THREADS
12646         pthread_kill_other_threads_np();
12647 #endif
12648
12649         return 0;
12650
12651 ; return 0; }
12652 EOF
12653 if { (eval echo configure:12654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12654   rm -rf conftest*
12655   ol_cv_pthread_lpthread_lmach_lexc=yes
12656 else
12657   echo "configure: failed program was:" >&5
12658   cat conftest.$ac_ext >&5
12659   rm -rf conftest*
12660   ol_cv_pthread_lpthread_lmach_lexc=no
12661 fi
12662 rm -f conftest*
12663 else
12664   cat > conftest.$ac_ext <<EOF
12665 #line 12666 "configure"
12666 #include "confdefs.h"
12667 /* pthread test headers */
12668 #include <pthread.h>
12669 #if HAVE_PTHREADS < 7
12670 #include <errno.h>
12671 #endif
12672 #ifndef NULL
12673 #define NULL (void*)0
12674 #endif
12675
12676 static void *task(p)
12677         void *p;
12678 {
12679         return (void *) (p == NULL);
12680 }
12681
12682
12683 int main(argc, argv)
12684         int argc;
12685         char **argv;
12686 {
12687
12688         /* pthread test function */
12689 #ifndef PTHREAD_CREATE_DETACHED
12690 #define PTHREAD_CREATE_DETACHED 1
12691 #endif
12692         pthread_t t;
12693         int status;
12694         int detach = PTHREAD_CREATE_DETACHED;
12695
12696 #if HAVE_PTHREADS > 4
12697         /* Final pthreads */
12698         pthread_attr_t attr;
12699
12700         status = pthread_attr_init(&attr);
12701         if( status ) return status;
12702
12703 #if HAVE_PTHREADS < 7
12704         status = pthread_attr_setdetachstate(&attr, &detach);
12705         if( status < 0 ) status = errno;
12706 #else
12707         status = pthread_attr_setdetachstate(&attr, detach);
12708 #endif
12709         if( status ) return status;
12710         status = pthread_create( &t, &attr, task, NULL );
12711 #if HAVE_PTHREADS < 7
12712         if( status < 0 ) status = errno;
12713 #endif
12714         if( status ) return status;
12715 #else
12716         /* Draft 4 pthreads */
12717         status = pthread_create( &t, pthread_attr_default, task, NULL );
12718         if( status ) return errno;
12719
12720         /* give thread a chance to complete */
12721         /* it should remain joinable and hence detachable */
12722         sleep( 1 );
12723
12724         status = pthread_detach( &t );
12725         if( status ) return errno;
12726 #endif
12727
12728 #ifdef HAVE_LINUX_THREADS
12729         pthread_kill_other_threads_np();
12730 #endif
12731
12732         return 0;
12733
12734 }
12735
12736 EOF
12737 if { (eval echo configure:12738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12738 then
12739   ol_cv_pthread_lpthread_lmach_lexc=yes
12740 else
12741   echo "configure: failed program was:" >&5
12742   cat conftest.$ac_ext >&5
12743   rm -fr conftest*
12744   ol_cv_pthread_lpthread_lmach_lexc=no
12745 fi
12746 rm -fr conftest*
12747 fi
12748
12749
12750                 # restore the LIBS
12751                 LIBS="$ol_LIBS"
12752         
12753 fi
12754
12755 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
12756
12757         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
12758                 ol_link_pthreads="-lpthread -lmach -lexc"
12759                 ol_link_threads=posix
12760         fi
12761 fi
12762
12763
12764                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
12765 if test "$ol_link_threads" = no ; then
12766         # try -lpthread -Wl,-woff,85
12767         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
12768 echo "configure:12769: checking for pthread link with -lpthread -Wl,-woff,85" >&5
12769 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
12770   echo $ac_n "(cached) $ac_c" 1>&6
12771 else
12772   
12773                 # save the flags
12774                 ol_LIBS="$LIBS"
12775                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
12776
12777                 if test "$cross_compiling" = yes; then
12778   cat > conftest.$ac_ext <<EOF
12779 #line 12780 "configure"
12780 #include "confdefs.h"
12781 /* pthread test headers */
12782 #include <pthread.h>
12783 #if HAVE_PTHREADS < 7
12784 #include <errno.h>
12785 #endif
12786 #ifndef NULL
12787 #define NULL (void*)0
12788 #endif
12789
12790 static void *task(p)
12791         void *p;
12792 {
12793         return (void *) (p == NULL);
12794 }
12795
12796 int main() {
12797
12798         /* pthread test function */
12799 #ifndef PTHREAD_CREATE_DETACHED
12800 #define PTHREAD_CREATE_DETACHED 1
12801 #endif
12802         pthread_t t;
12803         int status;
12804         int detach = PTHREAD_CREATE_DETACHED;
12805
12806 #if HAVE_PTHREADS > 4
12807         /* Final pthreads */
12808         pthread_attr_t attr;
12809
12810         status = pthread_attr_init(&attr);
12811         if( status ) return status;
12812
12813 #if HAVE_PTHREADS < 7
12814         status = pthread_attr_setdetachstate(&attr, &detach);
12815         if( status < 0 ) status = errno;
12816 #else
12817         status = pthread_attr_setdetachstate(&attr, detach);
12818 #endif
12819         if( status ) return status;
12820         status = pthread_create( &t, &attr, task, NULL );
12821 #if HAVE_PTHREADS < 7
12822         if( status < 0 ) status = errno;
12823 #endif
12824         if( status ) return status;
12825 #else
12826         /* Draft 4 pthreads */
12827         status = pthread_create( &t, pthread_attr_default, task, NULL );
12828         if( status ) return errno;
12829
12830         /* give thread a chance to complete */
12831         /* it should remain joinable and hence detachable */
12832         sleep( 1 );
12833
12834         status = pthread_detach( &t );
12835         if( status ) return errno;
12836 #endif
12837
12838 #ifdef HAVE_LINUX_THREADS
12839         pthread_kill_other_threads_np();
12840 #endif
12841
12842         return 0;
12843
12844 ; return 0; }
12845 EOF
12846 if { (eval echo configure:12847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12847   rm -rf conftest*
12848   ol_cv_pthread_lib_lpthread_woff=yes
12849 else
12850   echo "configure: failed program was:" >&5
12851   cat conftest.$ac_ext >&5
12852   rm -rf conftest*
12853   ol_cv_pthread_lib_lpthread_woff=no
12854 fi
12855 rm -f conftest*
12856 else
12857   cat > conftest.$ac_ext <<EOF
12858 #line 12859 "configure"
12859 #include "confdefs.h"
12860 /* pthread test headers */
12861 #include <pthread.h>
12862 #if HAVE_PTHREADS < 7
12863 #include <errno.h>
12864 #endif
12865 #ifndef NULL
12866 #define NULL (void*)0
12867 #endif
12868
12869 static void *task(p)
12870         void *p;
12871 {
12872         return (void *) (p == NULL);
12873 }
12874
12875
12876 int main(argc, argv)
12877         int argc;
12878         char **argv;
12879 {
12880
12881         /* pthread test function */
12882 #ifndef PTHREAD_CREATE_DETACHED
12883 #define PTHREAD_CREATE_DETACHED 1
12884 #endif
12885         pthread_t t;
12886         int status;
12887         int detach = PTHREAD_CREATE_DETACHED;
12888
12889 #if HAVE_PTHREADS > 4
12890         /* Final pthreads */
12891         pthread_attr_t attr;
12892
12893         status = pthread_attr_init(&attr);
12894         if( status ) return status;
12895
12896 #if HAVE_PTHREADS < 7
12897         status = pthread_attr_setdetachstate(&attr, &detach);
12898         if( status < 0 ) status = errno;
12899 #else
12900         status = pthread_attr_setdetachstate(&attr, detach);
12901 #endif
12902         if( status ) return status;
12903         status = pthread_create( &t, &attr, task, NULL );
12904 #if HAVE_PTHREADS < 7
12905         if( status < 0 ) status = errno;
12906 #endif
12907         if( status ) return status;
12908 #else
12909         /* Draft 4 pthreads */
12910         status = pthread_create( &t, pthread_attr_default, task, NULL );
12911         if( status ) return errno;
12912
12913         /* give thread a chance to complete */
12914         /* it should remain joinable and hence detachable */
12915         sleep( 1 );
12916
12917         status = pthread_detach( &t );
12918         if( status ) return errno;
12919 #endif
12920
12921 #ifdef HAVE_LINUX_THREADS
12922         pthread_kill_other_threads_np();
12923 #endif
12924
12925         return 0;
12926
12927 }
12928
12929 EOF
12930 if { (eval echo configure:12931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12931 then
12932   ol_cv_pthread_lib_lpthread_woff=yes
12933 else
12934   echo "configure: failed program was:" >&5
12935   cat conftest.$ac_ext >&5
12936   rm -fr conftest*
12937   ol_cv_pthread_lib_lpthread_woff=no
12938 fi
12939 rm -fr conftest*
12940 fi
12941
12942
12943                 # restore the LIBS
12944                 LIBS="$ol_LIBS"
12945         
12946 fi
12947
12948 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
12949
12950         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
12951                 ol_link_pthreads="-lpthread -Wl,-woff,85"
12952                 ol_link_threads=posix
12953         fi
12954 fi
12955
12956
12957                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
12958 if test "$ol_link_threads" = no ; then
12959         # try -lpthread
12960         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
12961 echo "configure:12962: checking for pthread link with -lpthread" >&5
12962 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
12963   echo $ac_n "(cached) $ac_c" 1>&6
12964 else
12965   
12966                 # save the flags
12967                 ol_LIBS="$LIBS"
12968                 LIBS="-lpthread $LIBS"
12969
12970                 if test "$cross_compiling" = yes; then
12971   cat > conftest.$ac_ext <<EOF
12972 #line 12973 "configure"
12973 #include "confdefs.h"
12974 /* pthread test headers */
12975 #include <pthread.h>
12976 #if HAVE_PTHREADS < 7
12977 #include <errno.h>
12978 #endif
12979 #ifndef NULL
12980 #define NULL (void*)0
12981 #endif
12982
12983 static void *task(p)
12984         void *p;
12985 {
12986         return (void *) (p == NULL);
12987 }
12988
12989 int main() {
12990
12991         /* pthread test function */
12992 #ifndef PTHREAD_CREATE_DETACHED
12993 #define PTHREAD_CREATE_DETACHED 1
12994 #endif
12995         pthread_t t;
12996         int status;
12997         int detach = PTHREAD_CREATE_DETACHED;
12998
12999 #if HAVE_PTHREADS > 4
13000         /* Final pthreads */
13001         pthread_attr_t attr;
13002
13003         status = pthread_attr_init(&attr);
13004         if( status ) return status;
13005
13006 #if HAVE_PTHREADS < 7
13007         status = pthread_attr_setdetachstate(&attr, &detach);
13008         if( status < 0 ) status = errno;
13009 #else
13010         status = pthread_attr_setdetachstate(&attr, detach);
13011 #endif
13012         if( status ) return status;
13013         status = pthread_create( &t, &attr, task, NULL );
13014 #if HAVE_PTHREADS < 7
13015         if( status < 0 ) status = errno;
13016 #endif
13017         if( status ) return status;
13018 #else
13019         /* Draft 4 pthreads */
13020         status = pthread_create( &t, pthread_attr_default, task, NULL );
13021         if( status ) return errno;
13022
13023         /* give thread a chance to complete */
13024         /* it should remain joinable and hence detachable */
13025         sleep( 1 );
13026
13027         status = pthread_detach( &t );
13028         if( status ) return errno;
13029 #endif
13030
13031 #ifdef HAVE_LINUX_THREADS
13032         pthread_kill_other_threads_np();
13033 #endif
13034
13035         return 0;
13036
13037 ; return 0; }
13038 EOF
13039 if { (eval echo configure:13040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13040   rm -rf conftest*
13041   ol_cv_pthread_lpthread=yes
13042 else
13043   echo "configure: failed program was:" >&5
13044   cat conftest.$ac_ext >&5
13045   rm -rf conftest*
13046   ol_cv_pthread_lpthread=no
13047 fi
13048 rm -f conftest*
13049 else
13050   cat > conftest.$ac_ext <<EOF
13051 #line 13052 "configure"
13052 #include "confdefs.h"
13053 /* pthread test headers */
13054 #include <pthread.h>
13055 #if HAVE_PTHREADS < 7
13056 #include <errno.h>
13057 #endif
13058 #ifndef NULL
13059 #define NULL (void*)0
13060 #endif
13061
13062 static void *task(p)
13063         void *p;
13064 {
13065         return (void *) (p == NULL);
13066 }
13067
13068
13069 int main(argc, argv)
13070         int argc;
13071         char **argv;
13072 {
13073
13074         /* pthread test function */
13075 #ifndef PTHREAD_CREATE_DETACHED
13076 #define PTHREAD_CREATE_DETACHED 1
13077 #endif
13078         pthread_t t;
13079         int status;
13080         int detach = PTHREAD_CREATE_DETACHED;
13081
13082 #if HAVE_PTHREADS > 4
13083         /* Final pthreads */
13084         pthread_attr_t attr;
13085
13086         status = pthread_attr_init(&attr);
13087         if( status ) return status;
13088
13089 #if HAVE_PTHREADS < 7
13090         status = pthread_attr_setdetachstate(&attr, &detach);
13091         if( status < 0 ) status = errno;
13092 #else
13093         status = pthread_attr_setdetachstate(&attr, detach);
13094 #endif
13095         if( status ) return status;
13096         status = pthread_create( &t, &attr, task, NULL );
13097 #if HAVE_PTHREADS < 7
13098         if( status < 0 ) status = errno;
13099 #endif
13100         if( status ) return status;
13101 #else
13102         /* Draft 4 pthreads */
13103         status = pthread_create( &t, pthread_attr_default, task, NULL );
13104         if( status ) return errno;
13105
13106         /* give thread a chance to complete */
13107         /* it should remain joinable and hence detachable */
13108         sleep( 1 );
13109
13110         status = pthread_detach( &t );
13111         if( status ) return errno;
13112 #endif
13113
13114 #ifdef HAVE_LINUX_THREADS
13115         pthread_kill_other_threads_np();
13116 #endif
13117
13118         return 0;
13119
13120 }
13121
13122 EOF
13123 if { (eval echo configure:13124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13124 then
13125   ol_cv_pthread_lpthread=yes
13126 else
13127   echo "configure: failed program was:" >&5
13128   cat conftest.$ac_ext >&5
13129   rm -fr conftest*
13130   ol_cv_pthread_lpthread=no
13131 fi
13132 rm -fr conftest*
13133 fi
13134
13135
13136                 # restore the LIBS
13137                 LIBS="$ol_LIBS"
13138         
13139 fi
13140
13141 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
13142
13143         if test $ol_cv_pthread_lpthread = yes ; then
13144                 ol_link_pthreads="-lpthread"
13145                 ol_link_threads=posix
13146         fi
13147 fi
13148
13149                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
13150 if test "$ol_link_threads" = no ; then
13151         # try -lc_r
13152         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
13153 echo "configure:13154: checking for pthread link with -lc_r" >&5
13154 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
13155   echo $ac_n "(cached) $ac_c" 1>&6
13156 else
13157   
13158                 # save the flags
13159                 ol_LIBS="$LIBS"
13160                 LIBS="-lc_r $LIBS"
13161
13162                 if test "$cross_compiling" = yes; then
13163   cat > conftest.$ac_ext <<EOF
13164 #line 13165 "configure"
13165 #include "confdefs.h"
13166 /* pthread test headers */
13167 #include <pthread.h>
13168 #if HAVE_PTHREADS < 7
13169 #include <errno.h>
13170 #endif
13171 #ifndef NULL
13172 #define NULL (void*)0
13173 #endif
13174
13175 static void *task(p)
13176         void *p;
13177 {
13178         return (void *) (p == NULL);
13179 }
13180
13181 int main() {
13182
13183         /* pthread test function */
13184 #ifndef PTHREAD_CREATE_DETACHED
13185 #define PTHREAD_CREATE_DETACHED 1
13186 #endif
13187         pthread_t t;
13188         int status;
13189         int detach = PTHREAD_CREATE_DETACHED;
13190
13191 #if HAVE_PTHREADS > 4
13192         /* Final pthreads */
13193         pthread_attr_t attr;
13194
13195         status = pthread_attr_init(&attr);
13196         if( status ) return status;
13197
13198 #if HAVE_PTHREADS < 7
13199         status = pthread_attr_setdetachstate(&attr, &detach);
13200         if( status < 0 ) status = errno;
13201 #else
13202         status = pthread_attr_setdetachstate(&attr, detach);
13203 #endif
13204         if( status ) return status;
13205         status = pthread_create( &t, &attr, task, NULL );
13206 #if HAVE_PTHREADS < 7
13207         if( status < 0 ) status = errno;
13208 #endif
13209         if( status ) return status;
13210 #else
13211         /* Draft 4 pthreads */
13212         status = pthread_create( &t, pthread_attr_default, task, NULL );
13213         if( status ) return errno;
13214
13215         /* give thread a chance to complete */
13216         /* it should remain joinable and hence detachable */
13217         sleep( 1 );
13218
13219         status = pthread_detach( &t );
13220         if( status ) return errno;
13221 #endif
13222
13223 #ifdef HAVE_LINUX_THREADS
13224         pthread_kill_other_threads_np();
13225 #endif
13226
13227         return 0;
13228
13229 ; return 0; }
13230 EOF
13231 if { (eval echo configure:13232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13232   rm -rf conftest*
13233   ol_cv_pthread_lc_r=yes
13234 else
13235   echo "configure: failed program was:" >&5
13236   cat conftest.$ac_ext >&5
13237   rm -rf conftest*
13238   ol_cv_pthread_lc_r=no
13239 fi
13240 rm -f conftest*
13241 else
13242   cat > conftest.$ac_ext <<EOF
13243 #line 13244 "configure"
13244 #include "confdefs.h"
13245 /* pthread test headers */
13246 #include <pthread.h>
13247 #if HAVE_PTHREADS < 7
13248 #include <errno.h>
13249 #endif
13250 #ifndef NULL
13251 #define NULL (void*)0
13252 #endif
13253
13254 static void *task(p)
13255         void *p;
13256 {
13257         return (void *) (p == NULL);
13258 }
13259
13260
13261 int main(argc, argv)
13262         int argc;
13263         char **argv;
13264 {
13265
13266         /* pthread test function */
13267 #ifndef PTHREAD_CREATE_DETACHED
13268 #define PTHREAD_CREATE_DETACHED 1
13269 #endif
13270         pthread_t t;
13271         int status;
13272         int detach = PTHREAD_CREATE_DETACHED;
13273
13274 #if HAVE_PTHREADS > 4
13275         /* Final pthreads */
13276         pthread_attr_t attr;
13277
13278         status = pthread_attr_init(&attr);
13279         if( status ) return status;
13280
13281 #if HAVE_PTHREADS < 7
13282         status = pthread_attr_setdetachstate(&attr, &detach);
13283         if( status < 0 ) status = errno;
13284 #else
13285         status = pthread_attr_setdetachstate(&attr, detach);
13286 #endif
13287         if( status ) return status;
13288         status = pthread_create( &t, &attr, task, NULL );
13289 #if HAVE_PTHREADS < 7
13290         if( status < 0 ) status = errno;
13291 #endif
13292         if( status ) return status;
13293 #else
13294         /* Draft 4 pthreads */
13295         status = pthread_create( &t, pthread_attr_default, task, NULL );
13296         if( status ) return errno;
13297
13298         /* give thread a chance to complete */
13299         /* it should remain joinable and hence detachable */
13300         sleep( 1 );
13301
13302         status = pthread_detach( &t );
13303         if( status ) return errno;
13304 #endif
13305
13306 #ifdef HAVE_LINUX_THREADS
13307         pthread_kill_other_threads_np();
13308 #endif
13309
13310         return 0;
13311
13312 }
13313
13314 EOF
13315 if { (eval echo configure:13316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13316 then
13317   ol_cv_pthread_lc_r=yes
13318 else
13319   echo "configure: failed program was:" >&5
13320   cat conftest.$ac_ext >&5
13321   rm -fr conftest*
13322   ol_cv_pthread_lc_r=no
13323 fi
13324 rm -fr conftest*
13325 fi
13326
13327
13328                 # restore the LIBS
13329                 LIBS="$ol_LIBS"
13330         
13331 fi
13332
13333 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
13334
13335         if test $ol_cv_pthread_lc_r = yes ; then
13336                 ol_link_pthreads="-lc_r"
13337                 ol_link_threads=posix
13338         fi
13339 fi
13340
13341
13342                 # Pthread try link: -threads (ol_cv_pthread_threads)
13343 if test "$ol_link_threads" = no ; then
13344         # try -threads
13345         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
13346 echo "configure:13347: checking for pthread link with -threads" >&5
13347 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
13348   echo $ac_n "(cached) $ac_c" 1>&6
13349 else
13350   
13351                 # save the flags
13352                 ol_LIBS="$LIBS"
13353                 LIBS="-threads $LIBS"
13354
13355                 if test "$cross_compiling" = yes; then
13356   cat > conftest.$ac_ext <<EOF
13357 #line 13358 "configure"
13358 #include "confdefs.h"
13359 /* pthread test headers */
13360 #include <pthread.h>
13361 #if HAVE_PTHREADS < 7
13362 #include <errno.h>
13363 #endif
13364 #ifndef NULL
13365 #define NULL (void*)0
13366 #endif
13367
13368 static void *task(p)
13369         void *p;
13370 {
13371         return (void *) (p == NULL);
13372 }
13373
13374 int main() {
13375
13376         /* pthread test function */
13377 #ifndef PTHREAD_CREATE_DETACHED
13378 #define PTHREAD_CREATE_DETACHED 1
13379 #endif
13380         pthread_t t;
13381         int status;
13382         int detach = PTHREAD_CREATE_DETACHED;
13383
13384 #if HAVE_PTHREADS > 4
13385         /* Final pthreads */
13386         pthread_attr_t attr;
13387
13388         status = pthread_attr_init(&attr);
13389         if( status ) return status;
13390
13391 #if HAVE_PTHREADS < 7
13392         status = pthread_attr_setdetachstate(&attr, &detach);
13393         if( status < 0 ) status = errno;
13394 #else
13395         status = pthread_attr_setdetachstate(&attr, detach);
13396 #endif
13397         if( status ) return status;
13398         status = pthread_create( &t, &attr, task, NULL );
13399 #if HAVE_PTHREADS < 7
13400         if( status < 0 ) status = errno;
13401 #endif
13402         if( status ) return status;
13403 #else
13404         /* Draft 4 pthreads */
13405         status = pthread_create( &t, pthread_attr_default, task, NULL );
13406         if( status ) return errno;
13407
13408         /* give thread a chance to complete */
13409         /* it should remain joinable and hence detachable */
13410         sleep( 1 );
13411
13412         status = pthread_detach( &t );
13413         if( status ) return errno;
13414 #endif
13415
13416 #ifdef HAVE_LINUX_THREADS
13417         pthread_kill_other_threads_np();
13418 #endif
13419
13420         return 0;
13421
13422 ; return 0; }
13423 EOF
13424 if { (eval echo configure:13425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13425   rm -rf conftest*
13426   ol_cv_pthread_threads=yes
13427 else
13428   echo "configure: failed program was:" >&5
13429   cat conftest.$ac_ext >&5
13430   rm -rf conftest*
13431   ol_cv_pthread_threads=no
13432 fi
13433 rm -f conftest*
13434 else
13435   cat > conftest.$ac_ext <<EOF
13436 #line 13437 "configure"
13437 #include "confdefs.h"
13438 /* pthread test headers */
13439 #include <pthread.h>
13440 #if HAVE_PTHREADS < 7
13441 #include <errno.h>
13442 #endif
13443 #ifndef NULL
13444 #define NULL (void*)0
13445 #endif
13446
13447 static void *task(p)
13448         void *p;
13449 {
13450         return (void *) (p == NULL);
13451 }
13452
13453
13454 int main(argc, argv)
13455         int argc;
13456         char **argv;
13457 {
13458
13459         /* pthread test function */
13460 #ifndef PTHREAD_CREATE_DETACHED
13461 #define PTHREAD_CREATE_DETACHED 1
13462 #endif
13463         pthread_t t;
13464         int status;
13465         int detach = PTHREAD_CREATE_DETACHED;
13466
13467 #if HAVE_PTHREADS > 4
13468         /* Final pthreads */
13469         pthread_attr_t attr;
13470
13471         status = pthread_attr_init(&attr);
13472         if( status ) return status;
13473
13474 #if HAVE_PTHREADS < 7
13475         status = pthread_attr_setdetachstate(&attr, &detach);
13476         if( status < 0 ) status = errno;
13477 #else
13478         status = pthread_attr_setdetachstate(&attr, detach);
13479 #endif
13480         if( status ) return status;
13481         status = pthread_create( &t, &attr, task, NULL );
13482 #if HAVE_PTHREADS < 7
13483         if( status < 0 ) status = errno;
13484 #endif
13485         if( status ) return status;
13486 #else
13487         /* Draft 4 pthreads */
13488         status = pthread_create( &t, pthread_attr_default, task, NULL );
13489         if( status ) return errno;
13490
13491         /* give thread a chance to complete */
13492         /* it should remain joinable and hence detachable */
13493         sleep( 1 );
13494
13495         status = pthread_detach( &t );
13496         if( status ) return errno;
13497 #endif
13498
13499 #ifdef HAVE_LINUX_THREADS
13500         pthread_kill_other_threads_np();
13501 #endif
13502
13503         return 0;
13504
13505 }
13506
13507 EOF
13508 if { (eval echo configure:13509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13509 then
13510   ol_cv_pthread_threads=yes
13511 else
13512   echo "configure: failed program was:" >&5
13513   cat conftest.$ac_ext >&5
13514   rm -fr conftest*
13515   ol_cv_pthread_threads=no
13516 fi
13517 rm -fr conftest*
13518 fi
13519
13520
13521                 # restore the LIBS
13522                 LIBS="$ol_LIBS"
13523         
13524 fi
13525
13526 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
13527
13528         if test $ol_cv_pthread_threads = yes ; then
13529                 ol_link_pthreads="-threads"
13530                 ol_link_threads=posix
13531         fi
13532 fi
13533
13534
13535                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
13536 if test "$ol_link_threads" = no ; then
13537         # try -lpthreads -lmach -lexc -lc_r
13538         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
13539 echo "configure:13540: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
13540 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
13541   echo $ac_n "(cached) $ac_c" 1>&6
13542 else
13543   
13544                 # save the flags
13545                 ol_LIBS="$LIBS"
13546                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
13547
13548                 if test "$cross_compiling" = yes; then
13549   cat > conftest.$ac_ext <<EOF
13550 #line 13551 "configure"
13551 #include "confdefs.h"
13552 /* pthread test headers */
13553 #include <pthread.h>
13554 #if HAVE_PTHREADS < 7
13555 #include <errno.h>
13556 #endif
13557 #ifndef NULL
13558 #define NULL (void*)0
13559 #endif
13560
13561 static void *task(p)
13562         void *p;
13563 {
13564         return (void *) (p == NULL);
13565 }
13566
13567 int main() {
13568
13569         /* pthread test function */
13570 #ifndef PTHREAD_CREATE_DETACHED
13571 #define PTHREAD_CREATE_DETACHED 1
13572 #endif
13573         pthread_t t;
13574         int status;
13575         int detach = PTHREAD_CREATE_DETACHED;
13576
13577 #if HAVE_PTHREADS > 4
13578         /* Final pthreads */
13579         pthread_attr_t attr;
13580
13581         status = pthread_attr_init(&attr);
13582         if( status ) return status;
13583
13584 #if HAVE_PTHREADS < 7
13585         status = pthread_attr_setdetachstate(&attr, &detach);
13586         if( status < 0 ) status = errno;
13587 #else
13588         status = pthread_attr_setdetachstate(&attr, detach);
13589 #endif
13590         if( status ) return status;
13591         status = pthread_create( &t, &attr, task, NULL );
13592 #if HAVE_PTHREADS < 7
13593         if( status < 0 ) status = errno;
13594 #endif
13595         if( status ) return status;
13596 #else
13597         /* Draft 4 pthreads */
13598         status = pthread_create( &t, pthread_attr_default, task, NULL );
13599         if( status ) return errno;
13600
13601         /* give thread a chance to complete */
13602         /* it should remain joinable and hence detachable */
13603         sleep( 1 );
13604
13605         status = pthread_detach( &t );
13606         if( status ) return errno;
13607 #endif
13608
13609 #ifdef HAVE_LINUX_THREADS
13610         pthread_kill_other_threads_np();
13611 #endif
13612
13613         return 0;
13614
13615 ; return 0; }
13616 EOF
13617 if { (eval echo configure:13618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13618   rm -rf conftest*
13619   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
13620 else
13621   echo "configure: failed program was:" >&5
13622   cat conftest.$ac_ext >&5
13623   rm -rf conftest*
13624   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
13625 fi
13626 rm -f conftest*
13627 else
13628   cat > conftest.$ac_ext <<EOF
13629 #line 13630 "configure"
13630 #include "confdefs.h"
13631 /* pthread test headers */
13632 #include <pthread.h>
13633 #if HAVE_PTHREADS < 7
13634 #include <errno.h>
13635 #endif
13636 #ifndef NULL
13637 #define NULL (void*)0
13638 #endif
13639
13640 static void *task(p)
13641         void *p;
13642 {
13643         return (void *) (p == NULL);
13644 }
13645
13646
13647 int main(argc, argv)
13648         int argc;
13649         char **argv;
13650 {
13651
13652         /* pthread test function */
13653 #ifndef PTHREAD_CREATE_DETACHED
13654 #define PTHREAD_CREATE_DETACHED 1
13655 #endif
13656         pthread_t t;
13657         int status;
13658         int detach = PTHREAD_CREATE_DETACHED;
13659
13660 #if HAVE_PTHREADS > 4
13661         /* Final pthreads */
13662         pthread_attr_t attr;
13663
13664         status = pthread_attr_init(&attr);
13665         if( status ) return status;
13666
13667 #if HAVE_PTHREADS < 7
13668         status = pthread_attr_setdetachstate(&attr, &detach);
13669         if( status < 0 ) status = errno;
13670 #else
13671         status = pthread_attr_setdetachstate(&attr, detach);
13672 #endif
13673         if( status ) return status;
13674         status = pthread_create( &t, &attr, task, NULL );
13675 #if HAVE_PTHREADS < 7
13676         if( status < 0 ) status = errno;
13677 #endif
13678         if( status ) return status;
13679 #else
13680         /* Draft 4 pthreads */
13681         status = pthread_create( &t, pthread_attr_default, task, NULL );
13682         if( status ) return errno;
13683
13684         /* give thread a chance to complete */
13685         /* it should remain joinable and hence detachable */
13686         sleep( 1 );
13687
13688         status = pthread_detach( &t );
13689         if( status ) return errno;
13690 #endif
13691
13692 #ifdef HAVE_LINUX_THREADS
13693         pthread_kill_other_threads_np();
13694 #endif
13695
13696         return 0;
13697
13698 }
13699
13700 EOF
13701 if { (eval echo configure:13702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13702 then
13703   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
13704 else
13705   echo "configure: failed program was:" >&5
13706   cat conftest.$ac_ext >&5
13707   rm -fr conftest*
13708   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
13709 fi
13710 rm -fr conftest*
13711 fi
13712
13713
13714                 # restore the LIBS
13715                 LIBS="$ol_LIBS"
13716         
13717 fi
13718
13719 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
13720
13721         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
13722                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
13723                 ol_link_threads=posix
13724         fi
13725 fi
13726
13727                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
13728 if test "$ol_link_threads" = no ; then
13729         # try -lpthreads -lmach -lexc
13730         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
13731 echo "configure:13732: checking for pthread link with -lpthreads -lmach -lexc" >&5
13732 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
13733   echo $ac_n "(cached) $ac_c" 1>&6
13734 else
13735   
13736                 # save the flags
13737                 ol_LIBS="$LIBS"
13738                 LIBS="-lpthreads -lmach -lexc $LIBS"
13739
13740                 if test "$cross_compiling" = yes; then
13741   cat > conftest.$ac_ext <<EOF
13742 #line 13743 "configure"
13743 #include "confdefs.h"
13744 /* pthread test headers */
13745 #include <pthread.h>
13746 #if HAVE_PTHREADS < 7
13747 #include <errno.h>
13748 #endif
13749 #ifndef NULL
13750 #define NULL (void*)0
13751 #endif
13752
13753 static void *task(p)
13754         void *p;
13755 {
13756         return (void *) (p == NULL);
13757 }
13758
13759 int main() {
13760
13761         /* pthread test function */
13762 #ifndef PTHREAD_CREATE_DETACHED
13763 #define PTHREAD_CREATE_DETACHED 1
13764 #endif
13765         pthread_t t;
13766         int status;
13767         int detach = PTHREAD_CREATE_DETACHED;
13768
13769 #if HAVE_PTHREADS > 4
13770         /* Final pthreads */
13771         pthread_attr_t attr;
13772
13773         status = pthread_attr_init(&attr);
13774         if( status ) return status;
13775
13776 #if HAVE_PTHREADS < 7
13777         status = pthread_attr_setdetachstate(&attr, &detach);
13778         if( status < 0 ) status = errno;
13779 #else
13780         status = pthread_attr_setdetachstate(&attr, detach);
13781 #endif
13782         if( status ) return status;
13783         status = pthread_create( &t, &attr, task, NULL );
13784 #if HAVE_PTHREADS < 7
13785         if( status < 0 ) status = errno;
13786 #endif
13787         if( status ) return status;
13788 #else
13789         /* Draft 4 pthreads */
13790         status = pthread_create( &t, pthread_attr_default, task, NULL );
13791         if( status ) return errno;
13792
13793         /* give thread a chance to complete */
13794         /* it should remain joinable and hence detachable */
13795         sleep( 1 );
13796
13797         status = pthread_detach( &t );
13798         if( status ) return errno;
13799 #endif
13800
13801 #ifdef HAVE_LINUX_THREADS
13802         pthread_kill_other_threads_np();
13803 #endif
13804
13805         return 0;
13806
13807 ; return 0; }
13808 EOF
13809 if { (eval echo configure:13810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13810   rm -rf conftest*
13811   ol_cv_pthread_lpthreads_lmach_lexc=yes
13812 else
13813   echo "configure: failed program was:" >&5
13814   cat conftest.$ac_ext >&5
13815   rm -rf conftest*
13816   ol_cv_pthread_lpthreads_lmach_lexc=no
13817 fi
13818 rm -f conftest*
13819 else
13820   cat > conftest.$ac_ext <<EOF
13821 #line 13822 "configure"
13822 #include "confdefs.h"
13823 /* pthread test headers */
13824 #include <pthread.h>
13825 #if HAVE_PTHREADS < 7
13826 #include <errno.h>
13827 #endif
13828 #ifndef NULL
13829 #define NULL (void*)0
13830 #endif
13831
13832 static void *task(p)
13833         void *p;
13834 {
13835         return (void *) (p == NULL);
13836 }
13837
13838
13839 int main(argc, argv)
13840         int argc;
13841         char **argv;
13842 {
13843
13844         /* pthread test function */
13845 #ifndef PTHREAD_CREATE_DETACHED
13846 #define PTHREAD_CREATE_DETACHED 1
13847 #endif
13848         pthread_t t;
13849         int status;
13850         int detach = PTHREAD_CREATE_DETACHED;
13851
13852 #if HAVE_PTHREADS > 4
13853         /* Final pthreads */
13854         pthread_attr_t attr;
13855
13856         status = pthread_attr_init(&attr);
13857         if( status ) return status;
13858
13859 #if HAVE_PTHREADS < 7
13860         status = pthread_attr_setdetachstate(&attr, &detach);
13861         if( status < 0 ) status = errno;
13862 #else
13863         status = pthread_attr_setdetachstate(&attr, detach);
13864 #endif
13865         if( status ) return status;
13866         status = pthread_create( &t, &attr, task, NULL );
13867 #if HAVE_PTHREADS < 7
13868         if( status < 0 ) status = errno;
13869 #endif
13870         if( status ) return status;
13871 #else
13872         /* Draft 4 pthreads */
13873         status = pthread_create( &t, pthread_attr_default, task, NULL );
13874         if( status ) return errno;
13875
13876         /* give thread a chance to complete */
13877         /* it should remain joinable and hence detachable */
13878         sleep( 1 );
13879
13880         status = pthread_detach( &t );
13881         if( status ) return errno;
13882 #endif
13883
13884 #ifdef HAVE_LINUX_THREADS
13885         pthread_kill_other_threads_np();
13886 #endif
13887
13888         return 0;
13889
13890 }
13891
13892 EOF
13893 if { (eval echo configure:13894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13894 then
13895   ol_cv_pthread_lpthreads_lmach_lexc=yes
13896 else
13897   echo "configure: failed program was:" >&5
13898   cat conftest.$ac_ext >&5
13899   rm -fr conftest*
13900   ol_cv_pthread_lpthreads_lmach_lexc=no
13901 fi
13902 rm -fr conftest*
13903 fi
13904
13905
13906                 # restore the LIBS
13907                 LIBS="$ol_LIBS"
13908         
13909 fi
13910
13911 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
13912
13913         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
13914                 ol_link_pthreads="-lpthreads -lmach -lexc"
13915                 ol_link_threads=posix
13916         fi
13917 fi
13918
13919                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
13920 if test "$ol_link_threads" = no ; then
13921         # try -lpthreads -lexc
13922         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
13923 echo "configure:13924: checking for pthread link with -lpthreads -lexc" >&5
13924 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
13925   echo $ac_n "(cached) $ac_c" 1>&6
13926 else
13927   
13928                 # save the flags
13929                 ol_LIBS="$LIBS"
13930                 LIBS="-lpthreads -lexc $LIBS"
13931
13932                 if test "$cross_compiling" = yes; then
13933   cat > conftest.$ac_ext <<EOF
13934 #line 13935 "configure"
13935 #include "confdefs.h"
13936 /* pthread test headers */
13937 #include <pthread.h>
13938 #if HAVE_PTHREADS < 7
13939 #include <errno.h>
13940 #endif
13941 #ifndef NULL
13942 #define NULL (void*)0
13943 #endif
13944
13945 static void *task(p)
13946         void *p;
13947 {
13948         return (void *) (p == NULL);
13949 }
13950
13951 int main() {
13952
13953         /* pthread test function */
13954 #ifndef PTHREAD_CREATE_DETACHED
13955 #define PTHREAD_CREATE_DETACHED 1
13956 #endif
13957         pthread_t t;
13958         int status;
13959         int detach = PTHREAD_CREATE_DETACHED;
13960
13961 #if HAVE_PTHREADS > 4
13962         /* Final pthreads */
13963         pthread_attr_t attr;
13964
13965         status = pthread_attr_init(&attr);
13966         if( status ) return status;
13967
13968 #if HAVE_PTHREADS < 7
13969         status = pthread_attr_setdetachstate(&attr, &detach);
13970         if( status < 0 ) status = errno;
13971 #else
13972         status = pthread_attr_setdetachstate(&attr, detach);
13973 #endif
13974         if( status ) return status;
13975         status = pthread_create( &t, &attr, task, NULL );
13976 #if HAVE_PTHREADS < 7
13977         if( status < 0 ) status = errno;
13978 #endif
13979         if( status ) return status;
13980 #else
13981         /* Draft 4 pthreads */
13982         status = pthread_create( &t, pthread_attr_default, task, NULL );
13983         if( status ) return errno;
13984
13985         /* give thread a chance to complete */
13986         /* it should remain joinable and hence detachable */
13987         sleep( 1 );
13988
13989         status = pthread_detach( &t );
13990         if( status ) return errno;
13991 #endif
13992
13993 #ifdef HAVE_LINUX_THREADS
13994         pthread_kill_other_threads_np();
13995 #endif
13996
13997         return 0;
13998
13999 ; return 0; }
14000 EOF
14001 if { (eval echo configure:14002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14002   rm -rf conftest*
14003   ol_cv_pthread_lpthreads_lexc=yes
14004 else
14005   echo "configure: failed program was:" >&5
14006   cat conftest.$ac_ext >&5
14007   rm -rf conftest*
14008   ol_cv_pthread_lpthreads_lexc=no
14009 fi
14010 rm -f conftest*
14011 else
14012   cat > conftest.$ac_ext <<EOF
14013 #line 14014 "configure"
14014 #include "confdefs.h"
14015 /* pthread test headers */
14016 #include <pthread.h>
14017 #if HAVE_PTHREADS < 7
14018 #include <errno.h>
14019 #endif
14020 #ifndef NULL
14021 #define NULL (void*)0
14022 #endif
14023
14024 static void *task(p)
14025         void *p;
14026 {
14027         return (void *) (p == NULL);
14028 }
14029
14030
14031 int main(argc, argv)
14032         int argc;
14033         char **argv;
14034 {
14035
14036         /* pthread test function */
14037 #ifndef PTHREAD_CREATE_DETACHED
14038 #define PTHREAD_CREATE_DETACHED 1
14039 #endif
14040         pthread_t t;
14041         int status;
14042         int detach = PTHREAD_CREATE_DETACHED;
14043
14044 #if HAVE_PTHREADS > 4
14045         /* Final pthreads */
14046         pthread_attr_t attr;
14047
14048         status = pthread_attr_init(&attr);
14049         if( status ) return status;
14050
14051 #if HAVE_PTHREADS < 7
14052         status = pthread_attr_setdetachstate(&attr, &detach);
14053         if( status < 0 ) status = errno;
14054 #else
14055         status = pthread_attr_setdetachstate(&attr, detach);
14056 #endif
14057         if( status ) return status;
14058         status = pthread_create( &t, &attr, task, NULL );
14059 #if HAVE_PTHREADS < 7
14060         if( status < 0 ) status = errno;
14061 #endif
14062         if( status ) return status;
14063 #else
14064         /* Draft 4 pthreads */
14065         status = pthread_create( &t, pthread_attr_default, task, NULL );
14066         if( status ) return errno;
14067
14068         /* give thread a chance to complete */
14069         /* it should remain joinable and hence detachable */
14070         sleep( 1 );
14071
14072         status = pthread_detach( &t );
14073         if( status ) return errno;
14074 #endif
14075
14076 #ifdef HAVE_LINUX_THREADS
14077         pthread_kill_other_threads_np();
14078 #endif
14079
14080         return 0;
14081
14082 }
14083
14084 EOF
14085 if { (eval echo configure:14086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14086 then
14087   ol_cv_pthread_lpthreads_lexc=yes
14088 else
14089   echo "configure: failed program was:" >&5
14090   cat conftest.$ac_ext >&5
14091   rm -fr conftest*
14092   ol_cv_pthread_lpthreads_lexc=no
14093 fi
14094 rm -fr conftest*
14095 fi
14096
14097
14098                 # restore the LIBS
14099                 LIBS="$ol_LIBS"
14100         
14101 fi
14102
14103 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
14104
14105         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
14106                 ol_link_pthreads="-lpthreads -lexc"
14107                 ol_link_threads=posix
14108         fi
14109 fi
14110
14111
14112                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
14113 if test "$ol_link_threads" = no ; then
14114         # try -lpthreads
14115         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
14116 echo "configure:14117: checking for pthread link with -lpthreads" >&5
14117 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
14118   echo $ac_n "(cached) $ac_c" 1>&6
14119 else
14120   
14121                 # save the flags
14122                 ol_LIBS="$LIBS"
14123                 LIBS="-lpthreads $LIBS"
14124
14125                 if test "$cross_compiling" = yes; then
14126   cat > conftest.$ac_ext <<EOF
14127 #line 14128 "configure"
14128 #include "confdefs.h"
14129 /* pthread test headers */
14130 #include <pthread.h>
14131 #if HAVE_PTHREADS < 7
14132 #include <errno.h>
14133 #endif
14134 #ifndef NULL
14135 #define NULL (void*)0
14136 #endif
14137
14138 static void *task(p)
14139         void *p;
14140 {
14141         return (void *) (p == NULL);
14142 }
14143
14144 int main() {
14145
14146         /* pthread test function */
14147 #ifndef PTHREAD_CREATE_DETACHED
14148 #define PTHREAD_CREATE_DETACHED 1
14149 #endif
14150         pthread_t t;
14151         int status;
14152         int detach = PTHREAD_CREATE_DETACHED;
14153
14154 #if HAVE_PTHREADS > 4
14155         /* Final pthreads */
14156         pthread_attr_t attr;
14157
14158         status = pthread_attr_init(&attr);
14159         if( status ) return status;
14160
14161 #if HAVE_PTHREADS < 7
14162         status = pthread_attr_setdetachstate(&attr, &detach);
14163         if( status < 0 ) status = errno;
14164 #else
14165         status = pthread_attr_setdetachstate(&attr, detach);
14166 #endif
14167         if( status ) return status;
14168         status = pthread_create( &t, &attr, task, NULL );
14169 #if HAVE_PTHREADS < 7
14170         if( status < 0 ) status = errno;
14171 #endif
14172         if( status ) return status;
14173 #else
14174         /* Draft 4 pthreads */
14175         status = pthread_create( &t, pthread_attr_default, task, NULL );
14176         if( status ) return errno;
14177
14178         /* give thread a chance to complete */
14179         /* it should remain joinable and hence detachable */
14180         sleep( 1 );
14181
14182         status = pthread_detach( &t );
14183         if( status ) return errno;
14184 #endif
14185
14186 #ifdef HAVE_LINUX_THREADS
14187         pthread_kill_other_threads_np();
14188 #endif
14189
14190         return 0;
14191
14192 ; return 0; }
14193 EOF
14194 if { (eval echo configure:14195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14195   rm -rf conftest*
14196   ol_cv_pthread_lib_lpthreads=yes
14197 else
14198   echo "configure: failed program was:" >&5
14199   cat conftest.$ac_ext >&5
14200   rm -rf conftest*
14201   ol_cv_pthread_lib_lpthreads=no
14202 fi
14203 rm -f conftest*
14204 else
14205   cat > conftest.$ac_ext <<EOF
14206 #line 14207 "configure"
14207 #include "confdefs.h"
14208 /* pthread test headers */
14209 #include <pthread.h>
14210 #if HAVE_PTHREADS < 7
14211 #include <errno.h>
14212 #endif
14213 #ifndef NULL
14214 #define NULL (void*)0
14215 #endif
14216
14217 static void *task(p)
14218         void *p;
14219 {
14220         return (void *) (p == NULL);
14221 }
14222
14223
14224 int main(argc, argv)
14225         int argc;
14226         char **argv;
14227 {
14228
14229         /* pthread test function */
14230 #ifndef PTHREAD_CREATE_DETACHED
14231 #define PTHREAD_CREATE_DETACHED 1
14232 #endif
14233         pthread_t t;
14234         int status;
14235         int detach = PTHREAD_CREATE_DETACHED;
14236
14237 #if HAVE_PTHREADS > 4
14238         /* Final pthreads */
14239         pthread_attr_t attr;
14240
14241         status = pthread_attr_init(&attr);
14242         if( status ) return status;
14243
14244 #if HAVE_PTHREADS < 7
14245         status = pthread_attr_setdetachstate(&attr, &detach);
14246         if( status < 0 ) status = errno;
14247 #else
14248         status = pthread_attr_setdetachstate(&attr, detach);
14249 #endif
14250         if( status ) return status;
14251         status = pthread_create( &t, &attr, task, NULL );
14252 #if HAVE_PTHREADS < 7
14253         if( status < 0 ) status = errno;
14254 #endif
14255         if( status ) return status;
14256 #else
14257         /* Draft 4 pthreads */
14258         status = pthread_create( &t, pthread_attr_default, task, NULL );
14259         if( status ) return errno;
14260
14261         /* give thread a chance to complete */
14262         /* it should remain joinable and hence detachable */
14263         sleep( 1 );
14264
14265         status = pthread_detach( &t );
14266         if( status ) return errno;
14267 #endif
14268
14269 #ifdef HAVE_LINUX_THREADS
14270         pthread_kill_other_threads_np();
14271 #endif
14272
14273         return 0;
14274
14275 }
14276
14277 EOF
14278 if { (eval echo configure:14279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14279 then
14280   ol_cv_pthread_lib_lpthreads=yes
14281 else
14282   echo "configure: failed program was:" >&5
14283   cat conftest.$ac_ext >&5
14284   rm -fr conftest*
14285   ol_cv_pthread_lib_lpthreads=no
14286 fi
14287 rm -fr conftest*
14288 fi
14289
14290
14291                 # restore the LIBS
14292                 LIBS="$ol_LIBS"
14293         
14294 fi
14295
14296 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
14297
14298         if test $ol_cv_pthread_lib_lpthreads = yes ; then
14299                 ol_link_pthreads="-lpthreads"
14300                 ol_link_threads=posix
14301         fi
14302 fi
14303
14304
14305                 if test $ol_link_threads != no ; then
14306                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
14307
14308                                                 save_CPPFLAGS="$CPPFLAGS"
14309                         save_LIBS="$LIBS"
14310                         LIBS="$LTHREAD_LIBS $LIBS"
14311
14312                                                                                                 for ac_func in sched_yield pthread_yield thr_yield
14313 do
14314 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14315 echo "configure:14316: checking for $ac_func" >&5
14316 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14317   echo $ac_n "(cached) $ac_c" 1>&6
14318 else
14319   cat > conftest.$ac_ext <<EOF
14320 #line 14321 "configure"
14321 #include "confdefs.h"
14322 /* System header to define __stub macros and hopefully few prototypes,
14323     which can conflict with char $ac_func(); below.  */
14324 #include <assert.h>
14325 /* Override any gcc2 internal prototype to avoid an error.  */
14326 /* We use char because int might match the return type of a gcc2
14327     builtin and then its argument prototype would still apply.  */
14328 char $ac_func();
14329 char (*f)();
14330
14331 int main() {
14332
14333 /* The GNU C library defines this for functions which it implements
14334     to always fail with ENOSYS.  Some functions are actually named
14335     something starting with __ and the normal name is an alias.  */
14336 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14337 choke me
14338 #else
14339 f = $ac_func;
14340 #endif
14341
14342 ; return 0; }
14343 EOF
14344 if { (eval echo configure:14345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14345   rm -rf conftest*
14346   eval "ac_cv_func_$ac_func=yes"
14347 else
14348   echo "configure: failed program was:" >&5
14349   cat conftest.$ac_ext >&5
14350   rm -rf conftest*
14351   eval "ac_cv_func_$ac_func=no"
14352 fi
14353 rm -f conftest*
14354 fi
14355
14356 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14357   echo "$ac_t""yes" 1>&6
14358     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14359   cat >> confdefs.h <<EOF
14360 #define $ac_tr_func 1
14361 EOF
14362  
14363 else
14364   echo "$ac_t""no" 1>&6
14365 fi
14366 done
14367
14368
14369                         if test $ac_cv_func_sched_yield = no -a \
14370                                 $ac_cv_func_pthread_yield = no -a \
14371                                 $ac_cv_func_thr_yield = no ; then
14372                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
14373 echo "configure:14374: checking for sched_yield in -lrt" >&5
14374 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
14375 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14376   echo $ac_n "(cached) $ac_c" 1>&6
14377 else
14378   ac_save_LIBS="$LIBS"
14379 LIBS="-lrt  $LIBS"
14380 cat > conftest.$ac_ext <<EOF
14381 #line 14382 "configure"
14382 #include "confdefs.h"
14383 /* Override any gcc2 internal prototype to avoid an error.  */
14384 /* We use char because int might match the return type of a gcc2
14385     builtin and then its argument prototype would still apply.  */
14386 char sched_yield();
14387
14388 int main() {
14389 sched_yield()
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   eval "ac_cv_lib_$ac_lib_var=yes"
14395 else
14396   echo "configure: failed program was:" >&5
14397   cat conftest.$ac_ext >&5
14398   rm -rf conftest*
14399   eval "ac_cv_lib_$ac_lib_var=no"
14400 fi
14401 rm -f conftest*
14402 LIBS="$ac_save_LIBS"
14403
14404 fi
14405 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14406   echo "$ac_t""yes" 1>&6
14407   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
14408                                         cat >> confdefs.h <<\EOF
14409 #define HAVE_SCHED_YIELD 1
14410 EOF
14411
14412                                         ac_cv_func_sched_yield=yes
14413 else
14414   echo "$ac_t""no" 1>&6
14415 ac_cv_func_sched_yield=no
14416 fi
14417
14418                         fi
14419                         if test $ac_cv_func_sched_yield = no -a \
14420                                 $ac_cv_func_pthread_yield = no -a \
14421                                 "$ac_cv_func_thr_yield" = no ; then
14422                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
14423                         fi
14424
14425                                                 for ac_func in pthread_kill pthread_rwlock_destroy
14426 do
14427 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14428 echo "configure:14429: checking for $ac_func" >&5
14429 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14430   echo $ac_n "(cached) $ac_c" 1>&6
14431 else
14432   cat > conftest.$ac_ext <<EOF
14433 #line 14434 "configure"
14434 #include "confdefs.h"
14435 /* System header to define __stub macros and hopefully few prototypes,
14436     which can conflict with char $ac_func(); below.  */
14437 #include <assert.h>
14438 /* Override any gcc2 internal prototype to avoid an error.  */
14439 /* We use char because int might match the return type of a gcc2
14440     builtin and then its argument prototype would still apply.  */
14441 char $ac_func();
14442 char (*f)();
14443
14444 int main() {
14445
14446 /* The GNU C library defines this for functions which it implements
14447     to always fail with ENOSYS.  Some functions are actually named
14448     something starting with __ and the normal name is an alias.  */
14449 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14450 choke me
14451 #else
14452 f = $ac_func;
14453 #endif
14454
14455 ; return 0; }
14456 EOF
14457 if { (eval echo configure:14458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14458   rm -rf conftest*
14459   eval "ac_cv_func_$ac_func=yes"
14460 else
14461   echo "configure: failed program was:" >&5
14462   cat conftest.$ac_ext >&5
14463   rm -rf conftest*
14464   eval "ac_cv_func_$ac_func=no"
14465 fi
14466 rm -f conftest*
14467 fi
14468
14469 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14470   echo "$ac_t""yes" 1>&6
14471     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14472   cat >> confdefs.h <<EOF
14473 #define $ac_tr_func 1
14474 EOF
14475  
14476 else
14477   echo "$ac_t""no" 1>&6
14478 fi
14479 done
14480
14481
14482                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
14483 echo "configure:14484: checking for pthread_detach with <pthread.h>" >&5
14484 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
14485   echo $ac_n "(cached) $ac_c" 1>&6
14486 else
14487   
14488                                                                 cat > conftest.$ac_ext <<EOF
14489 #line 14490 "configure"
14490 #include "confdefs.h"
14491
14492 #include <pthread.h>
14493 #ifndef NULL
14494 #define NULL (void*)0
14495 #endif
14496
14497 int main() {
14498 pthread_detach(NULL);
14499 ; return 0; }
14500 EOF
14501 if { (eval echo configure:14502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14502   rm -rf conftest*
14503   ol_cv_func_pthread_detach=yes
14504 else
14505   echo "configure: failed program was:" >&5
14506   cat conftest.$ac_ext >&5
14507   rm -rf conftest*
14508   ol_cv_func_pthread_detach=no
14509 fi
14510 rm -f conftest*
14511                         
14512 fi
14513
14514 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
14515
14516                         if test $ol_cv_func_pthread_detach = no ; then
14517                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
14518                         fi
14519
14520                         cat >> confdefs.h <<\EOF
14521 #define HAVE_PTHREAD_DETACH 1
14522 EOF
14523
14524
14525                                                 for ac_func in \
14526                                 pthread_setconcurrency \
14527                                 pthread_getconcurrency \
14528                                 thr_setconcurrency \
14529                                 thr_getconcurrency \
14530                         
14531 do
14532 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14533 echo "configure:14534: checking for $ac_func" >&5
14534 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14535   echo $ac_n "(cached) $ac_c" 1>&6
14536 else
14537   cat > conftest.$ac_ext <<EOF
14538 #line 14539 "configure"
14539 #include "confdefs.h"
14540 /* System header to define __stub macros and hopefully few prototypes,
14541     which can conflict with char $ac_func(); below.  */
14542 #include <assert.h>
14543 /* Override any gcc2 internal prototype to avoid an error.  */
14544 /* We use char because int might match the return type of a gcc2
14545     builtin and then its argument prototype would still apply.  */
14546 char $ac_func();
14547 char (*f)();
14548
14549 int main() {
14550
14551 /* The GNU C library defines this for functions which it implements
14552     to always fail with ENOSYS.  Some functions are actually named
14553     something starting with __ and the normal name is an alias.  */
14554 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14555 choke me
14556 #else
14557 f = $ac_func;
14558 #endif
14559
14560 ; return 0; }
14561 EOF
14562 if { (eval echo configure:14563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14563   rm -rf conftest*
14564   eval "ac_cv_func_$ac_func=yes"
14565 else
14566   echo "configure: failed program was:" >&5
14567   cat conftest.$ac_ext >&5
14568   rm -rf conftest*
14569   eval "ac_cv_func_$ac_func=no"
14570 fi
14571 rm -f conftest*
14572 fi
14573
14574 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14575   echo "$ac_t""yes" 1>&6
14576     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14577   cat >> confdefs.h <<EOF
14578 #define $ac_tr_func 1
14579 EOF
14580  
14581 else
14582   echo "$ac_t""no" 1>&6
14583 fi
14584 done
14585
14586
14587                         
14588         for ac_func in pthread_kill_other_threads_np
14589 do
14590 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14591 echo "configure:14592: checking for $ac_func" >&5
14592 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14593   echo $ac_n "(cached) $ac_c" 1>&6
14594 else
14595   cat > conftest.$ac_ext <<EOF
14596 #line 14597 "configure"
14597 #include "confdefs.h"
14598 /* System header to define __stub macros and hopefully few prototypes,
14599     which can conflict with char $ac_func(); below.  */
14600 #include <assert.h>
14601 /* Override any gcc2 internal prototype to avoid an error.  */
14602 /* We use char because int might match the return type of a gcc2
14603     builtin and then its argument prototype would still apply.  */
14604 char $ac_func();
14605 char (*f)();
14606
14607 int main() {
14608
14609 /* The GNU C library defines this for functions which it implements
14610     to always fail with ENOSYS.  Some functions are actually named
14611     something starting with __ and the normal name is an alias.  */
14612 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14613 choke me
14614 #else
14615 f = $ac_func;
14616 #endif
14617
14618 ; return 0; }
14619 EOF
14620 if { (eval echo configure:14621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14621   rm -rf conftest*
14622   eval "ac_cv_func_$ac_func=yes"
14623 else
14624   echo "configure: failed program was:" >&5
14625   cat conftest.$ac_ext >&5
14626   rm -rf conftest*
14627   eval "ac_cv_func_$ac_func=no"
14628 fi
14629 rm -f conftest*
14630 fi
14631
14632 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14633   echo "$ac_t""yes" 1>&6
14634     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14635   cat >> confdefs.h <<EOF
14636 #define $ac_tr_func 1
14637 EOF
14638  
14639 else
14640   echo "$ac_t""no" 1>&6
14641 fi
14642 done
14643
14644         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
14645 echo "configure:14646: checking for LinuxThreads implementation" >&5
14646 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
14647   echo $ac_n "(cached) $ac_c" 1>&6
14648 else
14649   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
14650 fi
14651
14652 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
14653
14654                         
14655         
14656         
14657         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
14658 echo "configure:14659: checking for LinuxThreads consistency" >&5
14659 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
14660   echo $ac_n "(cached) $ac_c" 1>&6
14661 else
14662   
14663                 if test $ol_cv_header_linux_threads = yes -a \
14664                         $ol_cv_sys_linux_threads = yes; then
14665                         ol_cv_linux_threads=yes
14666                 elif test $ol_cv_header_linux_threads = no -a \
14667                         $ol_cv_sys_linux_threads = no; then
14668                         ol_cv_linux_threads=no
14669                 else
14670                         ol_cv_linux_threads=error
14671                 fi
14672         
14673 fi
14674
14675 echo "$ac_t""$ol_cv_linux_threads" 1>&6
14676
14677
14678                         if test $ol_cv_linux_threads = error; then
14679                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
14680                         fi
14681
14682                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
14683 echo "configure:14684: checking if pthread_create() works" >&5
14684 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
14685   echo $ac_n "(cached) $ac_c" 1>&6
14686 else
14687   
14688                         if test "$cross_compiling" = yes; then
14689                                 ol_cv_pthread_create_works=yes
14690 else
14691   cat > conftest.$ac_ext <<EOF
14692 #line 14693 "configure"
14693 #include "confdefs.h"
14694 /* pthread test headers */
14695 #include <pthread.h>
14696 #if HAVE_PTHREADS < 7
14697 #include <errno.h>
14698 #endif
14699 #ifndef NULL
14700 #define NULL (void*)0
14701 #endif
14702
14703 static void *task(p)
14704         void *p;
14705 {
14706         return (void *) (p == NULL);
14707 }
14708
14709
14710 int main(argc, argv)
14711         int argc;
14712         char **argv;
14713 {
14714
14715         /* pthread test function */
14716 #ifndef PTHREAD_CREATE_DETACHED
14717 #define PTHREAD_CREATE_DETACHED 1
14718 #endif
14719         pthread_t t;
14720         int status;
14721         int detach = PTHREAD_CREATE_DETACHED;
14722
14723 #if HAVE_PTHREADS > 4
14724         /* Final pthreads */
14725         pthread_attr_t attr;
14726
14727         status = pthread_attr_init(&attr);
14728         if( status ) return status;
14729
14730 #if HAVE_PTHREADS < 7
14731         status = pthread_attr_setdetachstate(&attr, &detach);
14732         if( status < 0 ) status = errno;
14733 #else
14734         status = pthread_attr_setdetachstate(&attr, detach);
14735 #endif
14736         if( status ) return status;
14737         status = pthread_create( &t, &attr, task, NULL );
14738 #if HAVE_PTHREADS < 7
14739         if( status < 0 ) status = errno;
14740 #endif
14741         if( status ) return status;
14742 #else
14743         /* Draft 4 pthreads */
14744         status = pthread_create( &t, pthread_attr_default, task, NULL );
14745         if( status ) return errno;
14746
14747         /* give thread a chance to complete */
14748         /* it should remain joinable and hence detachable */
14749         sleep( 1 );
14750
14751         status = pthread_detach( &t );
14752         if( status ) return errno;
14753 #endif
14754
14755 #ifdef HAVE_LINUX_THREADS
14756         pthread_kill_other_threads_np();
14757 #endif
14758
14759         return 0;
14760
14761 }
14762
14763 EOF
14764 if { (eval echo configure:14765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14765 then
14766   ol_cv_pthread_create_works=yes
14767 else
14768   echo "configure: failed program was:" >&5
14769   cat conftest.$ac_ext >&5
14770   rm -fr conftest*
14771   ol_cv_pthread_create_works=no
14772 fi
14773 rm -fr conftest*
14774 fi
14775
14776 fi
14777
14778 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
14779
14780                         if test $ol_cv_pthread_create_works = no ; then
14781                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
14782                         fi
14783
14784                                                 if test $ol_with_yielding_select = auto ; then
14785                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
14786 echo "configure:14787: checking if select yields when using pthreads" >&5
14787 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
14788   echo $ac_n "(cached) $ac_c" 1>&6
14789 else
14790   
14791                                 if test "$cross_compiling" = yes; then
14792   ol_cv_pthread_select_yields=cross
14793 else
14794   cat > conftest.$ac_ext <<EOF
14795 #line 14796 "configure"
14796 #include "confdefs.h"
14797
14798 #include <sys/types.h>
14799 #include <sys/time.h>
14800 #include <unistd.h>
14801 #include <pthread.h>
14802 #ifndef NULL
14803 #define NULL (void*) 0
14804 #endif
14805
14806 static int fildes[2];
14807
14808 static void *task(p)
14809         void *p;
14810 {
14811         int i;
14812         struct timeval tv;
14813
14814         fd_set rfds;
14815
14816         tv.tv_sec=10;
14817         tv.tv_usec=0;
14818
14819         FD_ZERO(&rfds);
14820         FD_SET(fildes[0], &rfds);
14821
14822         /* we're not interested in any fds */
14823         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
14824
14825         if(i < 0) {
14826                 perror("select");
14827                 exit(10);
14828         }
14829
14830         exit(0); /* if we exit here, the select blocked the whole process */
14831 }
14832
14833 int main(argc, argv)
14834         int argc;
14835         char **argv;
14836 {
14837         pthread_t t;
14838
14839         /* create a pipe to select */
14840         if(pipe(&fildes[0])) {
14841                 perror("select");
14842                 exit(1);
14843         }
14844
14845 #ifdef HAVE_PTHREAD_SETCONCURRENCY
14846         (void) pthread_setconcurrency(2);
14847 #else
14848 #ifdef HAVE_THR_SETCONCURRENCY
14849         /* Set Solaris LWP concurrency to 2 */
14850         thr_setconcurrency(2);
14851 #endif
14852 #endif
14853
14854 #if HAVE_PTHREADS < 6
14855         pthread_create(&t, pthread_attr_default, task, NULL);
14856 #else
14857         pthread_create(&t, NULL, task, NULL);
14858 #endif
14859
14860         /* make sure task runs first */
14861 #if HAVE_THR_YIELD
14862         thr_yield();
14863 #elif defined( HAVE_SCHED_YIELD )
14864         sched_yield();
14865 #elif defined( HAVE_PTHREAD_YIELD )
14866         pthread_yield();
14867 #endif
14868
14869         exit(2);
14870 }
14871 EOF
14872 if { (eval echo configure:14873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14873 then
14874   ol_cv_pthread_select_yields=no
14875 else
14876   echo "configure: failed program was:" >&5
14877   cat conftest.$ac_ext >&5
14878   rm -fr conftest*
14879   ol_cv_pthread_select_yields=yes
14880 fi
14881 rm -fr conftest*
14882 fi
14883
14884 fi
14885
14886 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
14887
14888                                 if test $ol_cv_pthread_select_yields = cross ; then
14889                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
14890                                 fi
14891
14892                                 if test $ol_cv_pthread_select_yields = yes ; then
14893                                         ol_with_yielding_select=yes
14894                                 fi
14895                         fi
14896
14897                                                 CPPFLAGS="$save_CPPFLAGS"
14898                         LIBS="$save_LIBS"
14899                 else
14900                         { echo "configure: error: could not locate usable POSIX Threads" 1>&2; exit 1; }
14901                 fi
14902         fi
14903
14904         if test $ol_with_threads = posix ; then
14905                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
14906         fi
14907 fi
14908
14909 if test $ol_with_threads = auto -o $ol_with_threads = yes \
14910         -o $ol_with_threads = mach ; then
14911
14912                 for ac_hdr in mach/cthreads.h cthreads.h
14913 do
14914 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14915 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14916 echo "configure:14917: checking for $ac_hdr" >&5
14917 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14918   echo $ac_n "(cached) $ac_c" 1>&6
14919 else
14920   cat > conftest.$ac_ext <<EOF
14921 #line 14922 "configure"
14922 #include "confdefs.h"
14923 #include <$ac_hdr>
14924 EOF
14925 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14926 { (eval echo configure:14927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14927 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14928 if test -z "$ac_err"; then
14929   rm -rf conftest*
14930   eval "ac_cv_header_$ac_safe=yes"
14931 else
14932   echo "$ac_err" >&5
14933   echo "configure: failed program was:" >&5
14934   cat conftest.$ac_ext >&5
14935   rm -rf conftest*
14936   eval "ac_cv_header_$ac_safe=no"
14937 fi
14938 rm -f conftest*
14939 fi
14940 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14941   echo "$ac_t""yes" 1>&6
14942     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14943   cat >> confdefs.h <<EOF
14944 #define $ac_tr_hdr 1
14945 EOF
14946  
14947 else
14948   echo "$ac_t""no" 1>&6
14949 fi
14950 done
14951
14952         if test $ac_cv_header_mach_cthreads_h = yes ; then
14953                 ol_with_threads=found
14954
14955                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
14956 echo "configure:14957: checking for cthread_fork" >&5
14957 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
14958   echo $ac_n "(cached) $ac_c" 1>&6
14959 else
14960   cat > conftest.$ac_ext <<EOF
14961 #line 14962 "configure"
14962 #include "confdefs.h"
14963 /* System header to define __stub macros and hopefully few prototypes,
14964     which can conflict with char cthread_fork(); below.  */
14965 #include <assert.h>
14966 /* Override any gcc2 internal prototype to avoid an error.  */
14967 /* We use char because int might match the return type of a gcc2
14968     builtin and then its argument prototype would still apply.  */
14969 char cthread_fork();
14970 char (*f)();
14971
14972 int main() {
14973
14974 /* The GNU C library defines this for functions which it implements
14975     to always fail with ENOSYS.  Some functions are actually named
14976     something starting with __ and the normal name is an alias.  */
14977 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
14978 choke me
14979 #else
14980 f = cthread_fork;
14981 #endif
14982
14983 ; return 0; }
14984 EOF
14985 if { (eval echo configure:14986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14986   rm -rf conftest*
14987   eval "ac_cv_func_cthread_fork=yes"
14988 else
14989   echo "configure: failed program was:" >&5
14990   cat conftest.$ac_ext >&5
14991   rm -rf conftest*
14992   eval "ac_cv_func_cthread_fork=no"
14993 fi
14994 rm -f conftest*
14995 fi
14996
14997 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
14998   echo "$ac_t""yes" 1>&6
14999   ol_link_threads=yes
15000 else
15001   echo "$ac_t""no" 1>&6
15002 fi
15003
15004
15005                 if test $ol_link_threads = no ; then
15006                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
15007 echo "configure:15008: checking for cthread_fork with -all_load" >&5
15008 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
15009   echo $ac_n "(cached) $ac_c" 1>&6
15010 else
15011   
15012                                                                 save_LIBS="$LIBS"
15013                                 LIBS="-all_load $LIBS"
15014                                 cat > conftest.$ac_ext <<EOF
15015 #line 15016 "configure"
15016 #include "confdefs.h"
15017 #include <mach/cthreads.h>
15018 int main() {
15019
15020                                         cthread_fork((void *)0, (void *)0);
15021                                         
15022 ; return 0; }
15023 EOF
15024 if { (eval echo configure:15025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15025   rm -rf conftest*
15026   ol_cv_cthread_all_load=yes
15027 else
15028   echo "configure: failed program was:" >&5
15029   cat conftest.$ac_ext >&5
15030   rm -rf conftest*
15031   ol_cv_cthread_all_load=no
15032 fi
15033 rm -f conftest*
15034                                                                 LIBS="$save_LIBS"
15035                         
15036 fi
15037
15038 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
15039
15040                         if test $ol_cv_cthread_all_load = yes ; then
15041                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
15042                                 ol_link_threads=mach
15043                                 ol_with_threads=found
15044                         fi
15045                 fi
15046
15047         elif test $ac_cv_header_cthreads_h = yes ; then
15048                                 
15049                 ol_with_threads=found
15050  
15051                                 save_LIBS="$LIBS"
15052                 LIBS="$LIBS -lthreads"
15053                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
15054 echo "configure:15055: checking for cthread_fork" >&5
15055 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
15056   echo $ac_n "(cached) $ac_c" 1>&6
15057 else
15058   cat > conftest.$ac_ext <<EOF
15059 #line 15060 "configure"
15060 #include "confdefs.h"
15061 /* System header to define __stub macros and hopefully few prototypes,
15062     which can conflict with char cthread_fork(); below.  */
15063 #include <assert.h>
15064 /* Override any gcc2 internal prototype to avoid an error.  */
15065 /* We use char because int might match the return type of a gcc2
15066     builtin and then its argument prototype would still apply.  */
15067 char cthread_fork();
15068 char (*f)();
15069
15070 int main() {
15071
15072 /* The GNU C library defines this for functions which it implements
15073     to always fail with ENOSYS.  Some functions are actually named
15074     something starting with __ and the normal name is an alias.  */
15075 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
15076 choke me
15077 #else
15078 f = cthread_fork;
15079 #endif
15080
15081 ; return 0; }
15082 EOF
15083 if { (eval echo configure:15084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15084   rm -rf conftest*
15085   eval "ac_cv_func_cthread_fork=yes"
15086 else
15087   echo "configure: failed program was:" >&5
15088   cat conftest.$ac_ext >&5
15089   rm -rf conftest*
15090   eval "ac_cv_func_cthread_fork=no"
15091 fi
15092 rm -f conftest*
15093 fi
15094
15095 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
15096   echo "$ac_t""yes" 1>&6
15097   ol_link_threads=yes
15098 else
15099   echo "$ac_t""no" 1>&6
15100 fi
15101
15102                 LIBS="$save_LIBS"
15103
15104                 if test $ol_link_threads = yes ; then
15105                         LTHREAD_LIBS="-lthreads"
15106                         ol_link_threads=mach
15107                         ol_with_threads=found
15108                 else
15109                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
15110                 fi
15111
15112         elif test $ol_with_threads = mach ; then
15113                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
15114         fi
15115
15116         if test $ol_link_threads = mach ; then
15117                 cat >> confdefs.h <<\EOF
15118 #define HAVE_MACH_CTHREADS 1
15119 EOF
15120
15121         elif test $ol_with_threads = found ; then
15122                 { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
15123         fi
15124 fi
15125
15126 if test $ol_with_threads = auto -o $ol_with_threads = yes \
15127         -o $ol_with_threads = pth ; then
15128
15129         for ac_hdr in pth.h
15130 do
15131 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15132 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15133 echo "configure:15134: checking for $ac_hdr" >&5
15134 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15135   echo $ac_n "(cached) $ac_c" 1>&6
15136 else
15137   cat > conftest.$ac_ext <<EOF
15138 #line 15139 "configure"
15139 #include "confdefs.h"
15140 #include <$ac_hdr>
15141 EOF
15142 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15143 { (eval echo configure:15144: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15144 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15145 if test -z "$ac_err"; then
15146   rm -rf conftest*
15147   eval "ac_cv_header_$ac_safe=yes"
15148 else
15149   echo "$ac_err" >&5
15150   echo "configure: failed program was:" >&5
15151   cat conftest.$ac_ext >&5
15152   rm -rf conftest*
15153   eval "ac_cv_header_$ac_safe=no"
15154 fi
15155 rm -f conftest*
15156 fi
15157 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15158   echo "$ac_t""yes" 1>&6
15159     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15160   cat >> confdefs.h <<EOF
15161 #define $ac_tr_hdr 1
15162 EOF
15163  
15164 else
15165   echo "$ac_t""no" 1>&6
15166 fi
15167 done
15168
15169
15170         if test $ac_cv_header_pth_h = yes ; then
15171                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
15172 echo "configure:15173: checking for pth_version in -lpth" >&5
15173 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
15174 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15175   echo $ac_n "(cached) $ac_c" 1>&6
15176 else
15177   ac_save_LIBS="$LIBS"
15178 LIBS="-lpth  $LIBS"
15179 cat > conftest.$ac_ext <<EOF
15180 #line 15181 "configure"
15181 #include "confdefs.h"
15182 /* Override any gcc2 internal prototype to avoid an error.  */
15183 /* We use char because int might match the return type of a gcc2
15184     builtin and then its argument prototype would still apply.  */
15185 char pth_version();
15186
15187 int main() {
15188 pth_version()
15189 ; return 0; }
15190 EOF
15191 if { (eval echo configure:15192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15192   rm -rf conftest*
15193   eval "ac_cv_lib_$ac_lib_var=yes"
15194 else
15195   echo "configure: failed program was:" >&5
15196   cat conftest.$ac_ext >&5
15197   rm -rf conftest*
15198   eval "ac_cv_lib_$ac_lib_var=no"
15199 fi
15200 rm -f conftest*
15201 LIBS="$ac_save_LIBS"
15202
15203 fi
15204 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15205   echo "$ac_t""yes" 1>&6
15206   have_pth=yes
15207 else
15208   echo "$ac_t""no" 1>&6
15209 have_pth=no
15210 fi
15211
15212
15213                 if test $have_pth = yes ; then
15214                         cat >> confdefs.h <<\EOF
15215 #define HAVE_GNU_PTH 1
15216 EOF
15217
15218                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
15219                         ol_link_threads=pth
15220                         ol_with_threads=found
15221
15222                         if test $ol_with_yielding_select = auto ; then
15223                                 ol_with_yielding_select=yes
15224                         fi
15225                 fi
15226         fi
15227 fi
15228
15229 if test $ol_with_threads = auto -o $ol_with_threads = yes \
15230         -o $ol_with_threads = lwp ; then
15231
15232                 for ac_hdr in thread.h synch.h
15233 do
15234 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15235 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15236 echo "configure:15237: checking for $ac_hdr" >&5
15237 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15238   echo $ac_n "(cached) $ac_c" 1>&6
15239 else
15240   cat > conftest.$ac_ext <<EOF
15241 #line 15242 "configure"
15242 #include "confdefs.h"
15243 #include <$ac_hdr>
15244 EOF
15245 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15246 { (eval echo configure:15247: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15247 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15248 if test -z "$ac_err"; then
15249   rm -rf conftest*
15250   eval "ac_cv_header_$ac_safe=yes"
15251 else
15252   echo "$ac_err" >&5
15253   echo "configure: failed program was:" >&5
15254   cat conftest.$ac_ext >&5
15255   rm -rf conftest*
15256   eval "ac_cv_header_$ac_safe=no"
15257 fi
15258 rm -f conftest*
15259 fi
15260 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15261   echo "$ac_t""yes" 1>&6
15262     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15263   cat >> confdefs.h <<EOF
15264 #define $ac_tr_hdr 1
15265 EOF
15266  
15267 else
15268   echo "$ac_t""no" 1>&6
15269 fi
15270 done
15271
15272         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
15273                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
15274 echo "configure:15275: checking for thr_create in -lthread" >&5
15275 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
15276 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15277   echo $ac_n "(cached) $ac_c" 1>&6
15278 else
15279   ac_save_LIBS="$LIBS"
15280 LIBS="-lthread  $LIBS"
15281 cat > conftest.$ac_ext <<EOF
15282 #line 15283 "configure"
15283 #include "confdefs.h"
15284 /* Override any gcc2 internal prototype to avoid an error.  */
15285 /* We use char because int might match the return type of a gcc2
15286     builtin and then its argument prototype would still apply.  */
15287 char thr_create();
15288
15289 int main() {
15290 thr_create()
15291 ; return 0; }
15292 EOF
15293 if { (eval echo configure:15294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15294   rm -rf conftest*
15295   eval "ac_cv_lib_$ac_lib_var=yes"
15296 else
15297   echo "configure: failed program was:" >&5
15298   cat conftest.$ac_ext >&5
15299   rm -rf conftest*
15300   eval "ac_cv_lib_$ac_lib_var=no"
15301 fi
15302 rm -f conftest*
15303 LIBS="$ac_save_LIBS"
15304
15305 fi
15306 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15307   echo "$ac_t""yes" 1>&6
15308   have_thr=yes
15309 else
15310   echo "$ac_t""no" 1>&6
15311 have_thr=no
15312 fi
15313
15314
15315                 if test $have_thr = yes ; then
15316                         cat >> confdefs.h <<\EOF
15317 #define HAVE_THR 1
15318 EOF
15319
15320                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
15321                         ol_link_threads=thr
15322
15323                         if test $ol_with_yielding_select = auto ; then
15324                                 ol_with_yielding_select=yes
15325                         fi
15326
15327                                                 for ac_func in \
15328                                 thr_setconcurrency \
15329                                 thr_getconcurrency \
15330                         
15331 do
15332 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15333 echo "configure:15334: checking for $ac_func" >&5
15334 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15335   echo $ac_n "(cached) $ac_c" 1>&6
15336 else
15337   cat > conftest.$ac_ext <<EOF
15338 #line 15339 "configure"
15339 #include "confdefs.h"
15340 /* System header to define __stub macros and hopefully few prototypes,
15341     which can conflict with char $ac_func(); below.  */
15342 #include <assert.h>
15343 /* Override any gcc2 internal prototype to avoid an error.  */
15344 /* We use char because int might match the return type of a gcc2
15345     builtin and then its argument prototype would still apply.  */
15346 char $ac_func();
15347 char (*f)();
15348
15349 int main() {
15350
15351 /* The GNU C library defines this for functions which it implements
15352     to always fail with ENOSYS.  Some functions are actually named
15353     something starting with __ and the normal name is an alias.  */
15354 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15355 choke me
15356 #else
15357 f = $ac_func;
15358 #endif
15359
15360 ; return 0; }
15361 EOF
15362 if { (eval echo configure:15363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15363   rm -rf conftest*
15364   eval "ac_cv_func_$ac_func=yes"
15365 else
15366   echo "configure: failed program was:" >&5
15367   cat conftest.$ac_ext >&5
15368   rm -rf conftest*
15369   eval "ac_cv_func_$ac_func=no"
15370 fi
15371 rm -f conftest*
15372 fi
15373
15374 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15375   echo "$ac_t""yes" 1>&6
15376     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15377   cat >> confdefs.h <<EOF
15378 #define $ac_tr_func 1
15379 EOF
15380  
15381 else
15382   echo "$ac_t""no" 1>&6
15383 fi
15384 done
15385
15386                 fi
15387         fi
15388
15389                 for ac_hdr in lwp/lwp.h
15390 do
15391 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15392 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15393 echo "configure:15394: checking for $ac_hdr" >&5
15394 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15395   echo $ac_n "(cached) $ac_c" 1>&6
15396 else
15397   cat > conftest.$ac_ext <<EOF
15398 #line 15399 "configure"
15399 #include "confdefs.h"
15400 #include <$ac_hdr>
15401 EOF
15402 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15403 { (eval echo configure:15404: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15404 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15405 if test -z "$ac_err"; then
15406   rm -rf conftest*
15407   eval "ac_cv_header_$ac_safe=yes"
15408 else
15409   echo "$ac_err" >&5
15410   echo "configure: failed program was:" >&5
15411   cat conftest.$ac_ext >&5
15412   rm -rf conftest*
15413   eval "ac_cv_header_$ac_safe=no"
15414 fi
15415 rm -f conftest*
15416 fi
15417 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15418   echo "$ac_t""yes" 1>&6
15419     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15420   cat >> confdefs.h <<EOF
15421 #define $ac_tr_hdr 1
15422 EOF
15423  
15424 else
15425   echo "$ac_t""no" 1>&6
15426 fi
15427 done
15428
15429         if test $ac_cv_header_lwp_lwp_h = yes ; then
15430                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
15431 echo "configure:15432: checking for lwp_create in -llwp" >&5
15432 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
15433 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15434   echo $ac_n "(cached) $ac_c" 1>&6
15435 else
15436   ac_save_LIBS="$LIBS"
15437 LIBS="-llwp  $LIBS"
15438 cat > conftest.$ac_ext <<EOF
15439 #line 15440 "configure"
15440 #include "confdefs.h"
15441 /* Override any gcc2 internal prototype to avoid an error.  */
15442 /* We use char because int might match the return type of a gcc2
15443     builtin and then its argument prototype would still apply.  */
15444 char lwp_create();
15445
15446 int main() {
15447 lwp_create()
15448 ; return 0; }
15449 EOF
15450 if { (eval echo configure:15451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15451   rm -rf conftest*
15452   eval "ac_cv_lib_$ac_lib_var=yes"
15453 else
15454   echo "configure: failed program was:" >&5
15455   cat conftest.$ac_ext >&5
15456   rm -rf conftest*
15457   eval "ac_cv_lib_$ac_lib_var=no"
15458 fi
15459 rm -f conftest*
15460 LIBS="$ac_save_LIBS"
15461
15462 fi
15463 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15464   echo "$ac_t""yes" 1>&6
15465   have_lwp=yes
15466 else
15467   echo "$ac_t""no" 1>&6
15468 have_lwp=no
15469 fi
15470
15471
15472                 if test $have_lwp = yes ; then
15473                         cat >> confdefs.h <<\EOF
15474 #define HAVE_LWP 1
15475 EOF
15476
15477                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
15478                         ol_link_threads=lwp
15479
15480                         if test $ol_with_yielding_select = auto ; then
15481                                 ol_with_yielding_select=no
15482                         fi
15483                 fi
15484         fi
15485 fi
15486
15487 if test $ol_with_yielding_select = yes ; then
15488         cat >> confdefs.h <<\EOF
15489 #define HAVE_YIELDING_SELECT 1
15490 EOF
15491
15492 fi
15493
15494 if test $ol_with_threads = manual ; then
15495                 ol_link_threads=yes
15496
15497         echo "configure: warning: thread defines and link options must be set manually" 1>&2
15498
15499         for ac_hdr in pthread.h sched.h
15500 do
15501 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15502 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15503 echo "configure:15504: checking for $ac_hdr" >&5
15504 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15505   echo $ac_n "(cached) $ac_c" 1>&6
15506 else
15507   cat > conftest.$ac_ext <<EOF
15508 #line 15509 "configure"
15509 #include "confdefs.h"
15510 #include <$ac_hdr>
15511 EOF
15512 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15513 { (eval echo configure:15514: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15514 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15515 if test -z "$ac_err"; then
15516   rm -rf conftest*
15517   eval "ac_cv_header_$ac_safe=yes"
15518 else
15519   echo "$ac_err" >&5
15520   echo "configure: failed program was:" >&5
15521   cat conftest.$ac_ext >&5
15522   rm -rf conftest*
15523   eval "ac_cv_header_$ac_safe=no"
15524 fi
15525 rm -f conftest*
15526 fi
15527 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15528   echo "$ac_t""yes" 1>&6
15529     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15530   cat >> confdefs.h <<EOF
15531 #define $ac_tr_hdr 1
15532 EOF
15533  
15534 else
15535   echo "$ac_t""no" 1>&6
15536 fi
15537 done
15538
15539         for ac_func in sched_yield pthread_yield
15540 do
15541 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15542 echo "configure:15543: checking for $ac_func" >&5
15543 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15544   echo $ac_n "(cached) $ac_c" 1>&6
15545 else
15546   cat > conftest.$ac_ext <<EOF
15547 #line 15548 "configure"
15548 #include "confdefs.h"
15549 /* System header to define __stub macros and hopefully few prototypes,
15550     which can conflict with char $ac_func(); below.  */
15551 #include <assert.h>
15552 /* Override any gcc2 internal prototype to avoid an error.  */
15553 /* We use char because int might match the return type of a gcc2
15554     builtin and then its argument prototype would still apply.  */
15555 char $ac_func();
15556 char (*f)();
15557
15558 int main() {
15559
15560 /* The GNU C library defines this for functions which it implements
15561     to always fail with ENOSYS.  Some functions are actually named
15562     something starting with __ and the normal name is an alias.  */
15563 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15564 choke me
15565 #else
15566 f = $ac_func;
15567 #endif
15568
15569 ; return 0; }
15570 EOF
15571 if { (eval echo configure:15572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15572   rm -rf conftest*
15573   eval "ac_cv_func_$ac_func=yes"
15574 else
15575   echo "configure: failed program was:" >&5
15576   cat conftest.$ac_ext >&5
15577   rm -rf conftest*
15578   eval "ac_cv_func_$ac_func=no"
15579 fi
15580 rm -f conftest*
15581 fi
15582
15583 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15584   echo "$ac_t""yes" 1>&6
15585     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15586   cat >> confdefs.h <<EOF
15587 #define $ac_tr_func 1
15588 EOF
15589  
15590 else
15591   echo "$ac_t""no" 1>&6
15592 fi
15593 done
15594
15595         
15596         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
15597 echo "configure:15598: checking for LinuxThreads pthread.h" >&5
15598 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
15599   echo $ac_n "(cached) $ac_c" 1>&6
15600 else
15601   cat > conftest.$ac_ext <<EOF
15602 #line 15603 "configure"
15603 #include "confdefs.h"
15604 #include <pthread.h>
15605 EOF
15606 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15607   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
15608   rm -rf conftest*
15609   ol_cv_header_linux_threads=yes
15610 else
15611   rm -rf conftest*
15612   ol_cv_header_linux_threads=no
15613 fi
15614 rm -f conftest*
15615
15616                 
15617 fi
15618
15619 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
15620         if test $ol_cv_header_linux_threads = yes; then
15621                 cat >> confdefs.h <<\EOF
15622 #define HAVE_LINUX_THREADS 1
15623 EOF
15624
15625         fi
15626
15627
15628         for ac_hdr in mach/cthreads.h
15629 do
15630 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15631 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15632 echo "configure:15633: checking for $ac_hdr" >&5
15633 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15634   echo $ac_n "(cached) $ac_c" 1>&6
15635 else
15636   cat > conftest.$ac_ext <<EOF
15637 #line 15638 "configure"
15638 #include "confdefs.h"
15639 #include <$ac_hdr>
15640 EOF
15641 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15642 { (eval echo configure:15643: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15643 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15644 if test -z "$ac_err"; then
15645   rm -rf conftest*
15646   eval "ac_cv_header_$ac_safe=yes"
15647 else
15648   echo "$ac_err" >&5
15649   echo "configure: failed program was:" >&5
15650   cat conftest.$ac_ext >&5
15651   rm -rf conftest*
15652   eval "ac_cv_header_$ac_safe=no"
15653 fi
15654 rm -f conftest*
15655 fi
15656 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15657   echo "$ac_t""yes" 1>&6
15658     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15659   cat >> confdefs.h <<EOF
15660 #define $ac_tr_hdr 1
15661 EOF
15662  
15663 else
15664   echo "$ac_t""no" 1>&6
15665 fi
15666 done
15667
15668         for ac_hdr in lwp/lwp.h
15669 do
15670 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15671 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15672 echo "configure:15673: checking for $ac_hdr" >&5
15673 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15674   echo $ac_n "(cached) $ac_c" 1>&6
15675 else
15676   cat > conftest.$ac_ext <<EOF
15677 #line 15678 "configure"
15678 #include "confdefs.h"
15679 #include <$ac_hdr>
15680 EOF
15681 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15682 { (eval echo configure:15683: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15683 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15684 if test -z "$ac_err"; then
15685   rm -rf conftest*
15686   eval "ac_cv_header_$ac_safe=yes"
15687 else
15688   echo "$ac_err" >&5
15689   echo "configure: failed program was:" >&5
15690   cat conftest.$ac_ext >&5
15691   rm -rf conftest*
15692   eval "ac_cv_header_$ac_safe=no"
15693 fi
15694 rm -f conftest*
15695 fi
15696 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15697   echo "$ac_t""yes" 1>&6
15698     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15699   cat >> confdefs.h <<EOF
15700 #define $ac_tr_hdr 1
15701 EOF
15702  
15703 else
15704   echo "$ac_t""no" 1>&6
15705 fi
15706 done
15707
15708         for ac_hdr in thread.h synch.h
15709 do
15710 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15711 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15712 echo "configure:15713: checking for $ac_hdr" >&5
15713 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15714   echo $ac_n "(cached) $ac_c" 1>&6
15715 else
15716   cat > conftest.$ac_ext <<EOF
15717 #line 15718 "configure"
15718 #include "confdefs.h"
15719 #include <$ac_hdr>
15720 EOF
15721 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15722 { (eval echo configure:15723: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15723 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15724 if test -z "$ac_err"; then
15725   rm -rf conftest*
15726   eval "ac_cv_header_$ac_safe=yes"
15727 else
15728   echo "$ac_err" >&5
15729   echo "configure: failed program was:" >&5
15730   cat conftest.$ac_ext >&5
15731   rm -rf conftest*
15732   eval "ac_cv_header_$ac_safe=no"
15733 fi
15734 rm -f conftest*
15735 fi
15736 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15737   echo "$ac_t""yes" 1>&6
15738     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15739   cat >> confdefs.h <<EOF
15740 #define $ac_tr_hdr 1
15741 EOF
15742  
15743 else
15744   echo "$ac_t""no" 1>&6
15745 fi
15746 done
15747
15748 fi
15749
15750 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
15751                         cat >> confdefs.h <<\EOF
15752 #define REENTRANT 1
15753 EOF
15754
15755         cat >> confdefs.h <<\EOF
15756 #define _REENTRANT 1
15757 EOF
15758
15759         cat >> confdefs.h <<\EOF
15760 #define THREAD_SAFE 1
15761 EOF
15762
15763         cat >> confdefs.h <<\EOF
15764 #define _THREAD_SAFE 1
15765 EOF
15766
15767         cat >> confdefs.h <<\EOF
15768 #define THREADSAFE 1
15769 EOF
15770
15771         cat >> confdefs.h <<\EOF
15772 #define _THREADSAFE 1
15773 EOF
15774
15775         cat >> confdefs.h <<\EOF
15776 #define _SGI_MP_SOURCE 1
15777 EOF
15778
15779
15780                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
15781 echo "configure:15782: checking for thread specific errno" >&5
15782 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
15783   echo $ac_n "(cached) $ac_c" 1>&6
15784 else
15785   
15786                 cat > conftest.$ac_ext <<EOF
15787 #line 15788 "configure"
15788 #include "confdefs.h"
15789 #include <errno.h>
15790 int main() {
15791 errno = 0;
15792 ; return 0; }
15793 EOF
15794 if { (eval echo configure:15795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15795   rm -rf conftest*
15796   ol_cv_errno_thread_specific=yes
15797 else
15798   echo "configure: failed program was:" >&5
15799   cat conftest.$ac_ext >&5
15800   rm -rf conftest*
15801   ol_cv_errno_thread_specific=no
15802 fi
15803 rm -f conftest*
15804         
15805 fi
15806
15807 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
15808
15809                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
15810 echo "configure:15811: checking for thread specific h_errno" >&5
15811 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
15812   echo $ac_n "(cached) $ac_c" 1>&6
15813 else
15814   
15815                 cat > conftest.$ac_ext <<EOF
15816 #line 15817 "configure"
15817 #include "confdefs.h"
15818 #include <netdb.h>
15819 int main() {
15820 h_errno = 0;
15821 ; return 0; }
15822 EOF
15823 if { (eval echo configure:15824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15824   rm -rf conftest*
15825   ol_cv_h_errno_thread_specific=yes
15826 else
15827   echo "configure: failed program was:" >&5
15828   cat conftest.$ac_ext >&5
15829   rm -rf conftest*
15830   ol_cv_h_errno_thread_specific=no
15831 fi
15832 rm -f conftest*
15833         
15834 fi
15835
15836 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
15837
15838         if test $ol_cv_errno_thread_specific != yes \
15839                 -o $ol_cv_h_errno_thread_specific != yes ; then
15840                 LIBS="$LTHREAD_LIBS $LIBS"
15841                 LTHREAD_LIBS=""
15842         fi
15843
15844 fi  
15845
15846 if test $ol_link_threads = no ; then
15847         if test $ol_with_threads = yes ; then
15848                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
15849         fi
15850
15851         if test $ol_with_threads = auto ; then
15852                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
15853                 ol_with_threads=no
15854         fi
15855
15856         cat >> confdefs.h <<\EOF
15857 #define NO_THREADS 1
15858 EOF
15859
15860         LTHREAD_LIBS=""
15861 fi
15862
15863 if test $ol_link_threads != no ; then
15864         cat >> confdefs.h <<\EOF
15865 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
15866 EOF
15867
15868 fi
15869
15870 for ac_func in \
15871         ctime_r                 \
15872         gethostbyname_r gethostbyaddr_r \
15873
15874 do
15875 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15876 echo "configure:15877: checking for $ac_func" >&5
15877 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15878   echo $ac_n "(cached) $ac_c" 1>&6
15879 else
15880   cat > conftest.$ac_ext <<EOF
15881 #line 15882 "configure"
15882 #include "confdefs.h"
15883 /* System header to define __stub macros and hopefully few prototypes,
15884     which can conflict with char $ac_func(); below.  */
15885 #include <assert.h>
15886 /* Override any gcc2 internal prototype to avoid an error.  */
15887 /* We use char because int might match the return type of a gcc2
15888     builtin and then its argument prototype would still apply.  */
15889 char $ac_func();
15890 char (*f)();
15891
15892 int main() {
15893
15894 /* The GNU C library defines this for functions which it implements
15895     to always fail with ENOSYS.  Some functions are actually named
15896     something starting with __ and the normal name is an alias.  */
15897 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15898 choke me
15899 #else
15900 f = $ac_func;
15901 #endif
15902
15903 ; return 0; }
15904 EOF
15905 if { (eval echo configure:15906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15906   rm -rf conftest*
15907   eval "ac_cv_func_$ac_func=yes"
15908 else
15909   echo "configure: failed program was:" >&5
15910   cat conftest.$ac_ext >&5
15911   rm -rf conftest*
15912   eval "ac_cv_func_$ac_func=no"
15913 fi
15914 rm -f conftest*
15915 fi
15916
15917 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15918   echo "$ac_t""yes" 1>&6
15919     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15920   cat >> confdefs.h <<EOF
15921 #define $ac_tr_func 1
15922 EOF
15923  
15924 else
15925   echo "$ac_t""no" 1>&6
15926 fi
15927 done
15928
15929
15930 if test "$ac_cv_func_ctime_r" = no ; then
15931         ol_cv_func_ctime_r_nargs=0
15932 else
15933         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
15934 echo "configure:15935: checking number of arguments of ctime_r" >&5
15935 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
15936   echo $ac_n "(cached) $ac_c" 1>&6
15937 else
15938   cat > conftest.$ac_ext <<EOF
15939 #line 15940 "configure"
15940 #include "confdefs.h"
15941 #include <time.h>
15942 int main() {
15943 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
15944 ; return 0; }
15945 EOF
15946 if { (eval echo configure:15947: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15947   rm -rf conftest*
15948   ol_cv_func_ctime_r_nargs3=yes
15949 else
15950   echo "configure: failed program was:" >&5
15951   cat conftest.$ac_ext >&5
15952   rm -rf conftest*
15953   ol_cv_func_ctime_r_nargs3=no
15954 fi
15955 rm -f conftest*
15956
15957         cat > conftest.$ac_ext <<EOF
15958 #line 15959 "configure"
15959 #include "confdefs.h"
15960 #include <time.h>
15961 int main() {
15962 time_t ti; char *buffer; ctime_r(&ti,buffer);
15963 ; return 0; }
15964 EOF
15965 if { (eval echo configure:15966: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15966   rm -rf conftest*
15967   ol_cv_func_ctime_r_nargs2=yes
15968 else
15969   echo "configure: failed program was:" >&5
15970   cat conftest.$ac_ext >&5
15971   rm -rf conftest*
15972   ol_cv_func_ctime_r_nargs2=no
15973 fi
15974 rm -f conftest*
15975
15976         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
15977                 $ol_cv_func_ctime_r_nargs2 = no ; then
15978
15979                 ol_cv_func_ctime_r_nargs=3
15980
15981         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
15982                 $ol_cv_func_ctime_r_nargs2 = yes ; then
15983
15984                 ol_cv_func_ctime_r_nargs=2
15985
15986         else
15987                 ol_cv_func_ctime_r_nargs=0
15988         fi
15989   
15990 fi
15991
15992 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
15993
15994   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
15995         cat >> confdefs.h <<EOF
15996 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
15997 EOF
15998
15999   fi
16000
16001 fi
16002
16003 if test "$ac_cv_func_gethostbyname_r" = yes ; then
16004         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
16005 echo "configure:16006: checking number of arguments of gethostbyname_r" >&5
16006 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
16007   echo $ac_n "(cached) $ac_c" 1>&6
16008 else
16009   cat > conftest.$ac_ext <<EOF
16010 #line 16011 "configure"
16011 #include "confdefs.h"
16012 #include <sys/types.h>
16013 #include <sys/socket.h>
16014 #include <netinet/in.h>
16015 #include <netdb.h>
16016 #define BUFSIZE (sizeof(struct hostent)+10)
16017 int main() {
16018 struct hostent hent; char buffer[BUFSIZE];
16019                 int bufsize=BUFSIZE;int h_errno;
16020                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
16021                         buffer, bufsize, &h_errno);
16022 ; return 0; }
16023 EOF
16024 if { (eval echo configure:16025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16025   rm -rf conftest*
16026   ol_cv_func_gethostbyname_r_nargs5=yes
16027 else
16028   echo "configure: failed program was:" >&5
16029   cat conftest.$ac_ext >&5
16030   rm -rf conftest*
16031   ol_cv_func_gethostbyname_r_nargs5=no
16032 fi
16033 rm -f conftest*
16034
16035         cat > conftest.$ac_ext <<EOF
16036 #line 16037 "configure"
16037 #include "confdefs.h"
16038 #include <sys/types.h>
16039 #include <sys/socket.h>
16040 #include <netinet/in.h>
16041 #include <netdb.h>
16042 #define BUFSIZE (sizeof(struct hostent)+10)
16043 int main() {
16044 struct hostent hent;struct hostent *rhent;
16045                 char buffer[BUFSIZE];
16046                 int bufsize=BUFSIZE;int h_errno;
16047                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
16048                         &rhent, &h_errno);
16049 ; return 0; }
16050 EOF
16051 if { (eval echo configure:16052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16052   rm -rf conftest*
16053   ol_cv_func_gethostbyname_r_nargs6=yes
16054 else
16055   echo "configure: failed program was:" >&5
16056   cat conftest.$ac_ext >&5
16057   rm -rf conftest*
16058   ol_cv_func_gethostbyname_r_nargs6=no
16059 fi
16060 rm -f conftest*
16061
16062         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
16063                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
16064
16065                 ol_cv_func_gethostbyname_r_nargs=5
16066
16067         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
16068                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
16069
16070                 ol_cv_func_gethostbyname_r_nargs=6
16071
16072         else
16073                 ol_cv_func_gethostbyname_r_nargs=0
16074         fi
16075   
16076 fi
16077
16078 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
16079   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
16080         cat >> confdefs.h <<EOF
16081 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
16082 EOF
16083
16084   fi
16085
16086 else
16087         ol_cv_func_gethostbyname_r_nargs=0
16088 fi
16089  
16090 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
16091         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
16092 echo "configure:16093: checking number of arguments of gethostbyaddr_r" >&5
16093 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
16094   echo $ac_n "(cached) $ac_c" 1>&6
16095 else
16096   cat > conftest.$ac_ext <<EOF
16097 #line 16098 "configure"
16098 #include "confdefs.h"
16099 #include <sys/types.h>
16100 #include <sys/socket.h>
16101 #include <netinet/in.h>
16102 #include <netdb.h>
16103 #define BUFSIZE (sizeof(struct hostent)+10)
16104 int main() {
16105 struct hostent hent; char buffer[BUFSIZE]; 
16106             struct in_addr add;
16107             size_t alen=sizeof(struct in_addr);
16108             int bufsize=BUFSIZE;int h_errno;
16109                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
16110                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
16111 ; return 0; }
16112 EOF
16113 if { (eval echo configure:16114: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16114   rm -rf conftest*
16115   ol_cv_func_gethostbyaddr_r_nargs7=yes
16116 else
16117   echo "configure: failed program was:" >&5
16118   cat conftest.$ac_ext >&5
16119   rm -rf conftest*
16120   ol_cv_func_gethostbyaddr_r_nargs7=no
16121 fi
16122 rm -f conftest*
16123
16124         cat > conftest.$ac_ext <<EOF
16125 #line 16126 "configure"
16126 #include "confdefs.h"
16127 #include <sys/types.h>
16128 #include <sys/socket.h>
16129 #include <netinet/in.h>
16130 #include <netdb.h>
16131 #define BUFSIZE (sizeof(struct hostent)+10)
16132 int main() {
16133 struct hostent hent;
16134                 struct hostent *rhent; char buffer[BUFSIZE]; 
16135                 struct in_addr add;
16136                 size_t alen=sizeof(struct in_addr);
16137                 int bufsize=BUFSIZE;int h_errno;
16138                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
16139                         alen, AF_INET, &hent, buffer, bufsize, 
16140                         &rhent, &h_errno);
16141 ; return 0; }
16142 EOF
16143 if { (eval echo configure:16144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16144   rm -rf conftest*
16145   ol_cv_func_gethostbyaddr_r_nargs8=yes
16146 else
16147   echo "configure: failed program was:" >&5
16148   cat conftest.$ac_ext >&5
16149   rm -rf conftest*
16150   ol_cv_func_gethostbyaddr_r_nargs8=no
16151 fi
16152 rm -f conftest*
16153
16154         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
16155                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
16156
16157                 ol_cv_func_gethostbyaddr_r_nargs=7
16158
16159         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
16160                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
16161
16162                 ol_cv_func_gethostbyaddr_r_nargs=8
16163
16164         else
16165                 ol_cv_func_gethostbyaddr_r_nargs=0
16166         fi
16167   
16168 fi
16169
16170 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
16171   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
16172     cat >> confdefs.h <<EOF
16173 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
16174 EOF
16175
16176   fi
16177
16178 else
16179         ol_cv_func_gethostbyaddr_r_nargs=0
16180 fi
16181
16182 ol_link_ldbm=no 
16183
16184 if test $ol_with_ldbm_api = auto \
16185         -o $ol_with_ldbm_api = berkeley \
16186         -o $ol_with_ldbm_api = bcompat ; then
16187
16188         if test $ol_with_ldbm_api = bcompat; then \
16189                 for ac_hdr in db_185.h db.h
16190 do
16191 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16192 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16193 echo "configure:16194: checking for $ac_hdr" >&5
16194 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16195   echo $ac_n "(cached) $ac_c" 1>&6
16196 else
16197   cat > conftest.$ac_ext <<EOF
16198 #line 16199 "configure"
16199 #include "confdefs.h"
16200 #include <$ac_hdr>
16201 EOF
16202 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16203 { (eval echo configure:16204: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16204 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16205 if test -z "$ac_err"; then
16206   rm -rf conftest*
16207   eval "ac_cv_header_$ac_safe=yes"
16208 else
16209   echo "$ac_err" >&5
16210   echo "configure: failed program was:" >&5
16211   cat conftest.$ac_ext >&5
16212   rm -rf conftest*
16213   eval "ac_cv_header_$ac_safe=no"
16214 fi
16215 rm -f conftest*
16216 fi
16217 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16218   echo "$ac_t""yes" 1>&6
16219     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16220   cat >> confdefs.h <<EOF
16221 #define $ac_tr_hdr 1
16222 EOF
16223  
16224 else
16225   echo "$ac_t""no" 1>&6
16226 fi
16227 done
16228
16229 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
16230         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
16231 echo "configure:16232: checking if Berkeley DB header compatibility" >&5
16232 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
16233   echo $ac_n "(cached) $ac_c" 1>&6
16234 else
16235   
16236                 cat > conftest.$ac_ext <<EOF
16237 #line 16238 "configure"
16238 #include "confdefs.h"
16239
16240 #if HAVE_DB_185_H
16241 #       include <db_185.h>
16242 #else
16243 #       include <db.h>
16244 #endif
16245
16246  /* this check could be improved */
16247 #ifndef DB_VERSION_MAJOR
16248 #       define DB_VERSION_MAJOR 1
16249 #endif
16250
16251 #if DB_VERSION_MAJOR == 1 
16252         __db_version_1
16253 #endif
16254
16255 EOF
16256 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16257   egrep "__db_version_1" >/dev/null 2>&1; then
16258   rm -rf conftest*
16259   ol_cv_header_db1=yes
16260 else
16261   rm -rf conftest*
16262   ol_cv_header_db1=no
16263 fi
16264 rm -f conftest*
16265
16266 fi
16267
16268 echo "$ac_t""$ol_cv_header_db1" 1>&6
16269
16270         if test $ol_cv_header_db1 = yes ; then
16271                 ol_cv_lib_db=no
16272 if test $ol_cv_lib_db = no ; then
16273         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
16274 echo "configure:16275: checking for Berkeley DB link (default)" >&5
16275 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
16276   echo $ac_n "(cached) $ac_c" 1>&6
16277 else
16278   
16279         ol_DB_LIB=
16280         ol_LIBS=$LIBS
16281         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16282
16283         cat > conftest.$ac_ext <<EOF
16284 #line 16285 "configure"
16285 #include "confdefs.h"
16286
16287 #ifdef HAVE_DB_185_H
16288 # include <db_185.h>
16289 #else
16290 # include <db.h>
16291 #endif
16292
16293 #ifndef DB_VERSION_MAJOR
16294 # define DB_VERSION_MAJOR 1
16295 #endif
16296
16297 #ifndef NULL
16298 #define NULL ((void*)0)
16299 #endif
16300
16301 int main() {
16302
16303 #if DB_VERSION_MAJOR > 1
16304         {
16305                 char *version;
16306                 int major, minor, patch;
16307
16308                 version = db_version( &major, &minor, &patch );
16309
16310                 if( major != DB_VERSION_MAJOR ||
16311                         minor < DB_VERSION_MINOR )
16312                 {
16313                         printf("Berkeley DB version mismatch\n"
16314                                 "\texpected: %s\n\tgot: %s\n",
16315                                 DB_VERSION_STRING, version);
16316                         return 1;
16317                 }
16318         }
16319 #endif
16320
16321 #if DB_VERSION_MAJOR > 2
16322         db_env_create( NULL, 0 );
16323 #elif DB_VERSION_MAJOR > 1
16324         db_appexit( NULL );
16325 #else
16326         (void) dbopen( NULL, 0, 0, 0, NULL);
16327 #endif
16328
16329 ; return 0; }
16330 EOF
16331 if { (eval echo configure:16332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16332   rm -rf conftest*
16333   ol_cv_db_none=yes
16334 else
16335   echo "configure: failed program was:" >&5
16336   cat conftest.$ac_ext >&5
16337   rm -rf conftest*
16338   ol_cv_db_none=no
16339 fi
16340 rm -f conftest*
16341
16342         LIBS="$ol_LIBS"
16343
16344 fi
16345
16346 echo "$ac_t""$ol_cv_db_none" 1>&6
16347
16348         if test $ol_cv_db_none = yes ; then
16349                 ol_cv_lib_db=yes
16350         fi
16351 fi
16352
16353 if test $ol_cv_lib_db = no ; then
16354         echo $ac_n "checking for Berkeley DB link (-ldb42)""... $ac_c" 1>&6
16355 echo "configure:16356: checking for Berkeley DB link (-ldb42)" >&5
16356 if eval "test \"\${ol_cv_db_db42+set}\" = set"; then
16357   echo $ac_n "(cached) $ac_c" 1>&6
16358 else
16359   
16360         ol_DB_LIB=-ldb42
16361         ol_LIBS=$LIBS
16362         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16363
16364         cat > conftest.$ac_ext <<EOF
16365 #line 16366 "configure"
16366 #include "confdefs.h"
16367
16368 #ifdef HAVE_DB_185_H
16369 # include <db_185.h>
16370 #else
16371 # include <db.h>
16372 #endif
16373
16374 #ifndef DB_VERSION_MAJOR
16375 # define DB_VERSION_MAJOR 1
16376 #endif
16377
16378 #ifndef NULL
16379 #define NULL ((void*)0)
16380 #endif
16381
16382 int main() {
16383
16384 #if DB_VERSION_MAJOR > 1
16385         {
16386                 char *version;
16387                 int major, minor, patch;
16388
16389                 version = db_version( &major, &minor, &patch );
16390
16391                 if( major != DB_VERSION_MAJOR ||
16392                         minor < DB_VERSION_MINOR )
16393                 {
16394                         printf("Berkeley DB version mismatch\n"
16395                                 "\texpected: %s\n\tgot: %s\n",
16396                                 DB_VERSION_STRING, version);
16397                         return 1;
16398                 }
16399         }
16400 #endif
16401
16402 #if DB_VERSION_MAJOR > 2
16403         db_env_create( NULL, 0 );
16404 #elif DB_VERSION_MAJOR > 1
16405         db_appexit( NULL );
16406 #else
16407         (void) dbopen( NULL, 0, 0, 0, NULL);
16408 #endif
16409
16410 ; return 0; }
16411 EOF
16412 if { (eval echo configure:16413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16413   rm -rf conftest*
16414   ol_cv_db_db42=yes
16415 else
16416   echo "configure: failed program was:" >&5
16417   cat conftest.$ac_ext >&5
16418   rm -rf conftest*
16419   ol_cv_db_db42=no
16420 fi
16421 rm -f conftest*
16422
16423         LIBS="$ol_LIBS"
16424
16425 fi
16426
16427 echo "$ac_t""$ol_cv_db_db42" 1>&6
16428
16429         if test $ol_cv_db_db42 = yes ; then
16430                 ol_cv_lib_db=-ldb42
16431         fi
16432 fi
16433
16434 if test $ol_cv_lib_db = no ; then
16435         echo $ac_n "checking for Berkeley DB link (-ldb-42)""... $ac_c" 1>&6
16436 echo "configure:16437: checking for Berkeley DB link (-ldb-42)" >&5
16437 if eval "test \"\${ol_cv_db_db_42+set}\" = set"; then
16438   echo $ac_n "(cached) $ac_c" 1>&6
16439 else
16440   
16441         ol_DB_LIB=-ldb-42
16442         ol_LIBS=$LIBS
16443         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16444
16445         cat > conftest.$ac_ext <<EOF
16446 #line 16447 "configure"
16447 #include "confdefs.h"
16448
16449 #ifdef HAVE_DB_185_H
16450 # include <db_185.h>
16451 #else
16452 # include <db.h>
16453 #endif
16454
16455 #ifndef DB_VERSION_MAJOR
16456 # define DB_VERSION_MAJOR 1
16457 #endif
16458
16459 #ifndef NULL
16460 #define NULL ((void*)0)
16461 #endif
16462
16463 int main() {
16464
16465 #if DB_VERSION_MAJOR > 1
16466         {
16467                 char *version;
16468                 int major, minor, patch;
16469
16470                 version = db_version( &major, &minor, &patch );
16471
16472                 if( major != DB_VERSION_MAJOR ||
16473                         minor < DB_VERSION_MINOR )
16474                 {
16475                         printf("Berkeley DB version mismatch\n"
16476                                 "\texpected: %s\n\tgot: %s\n",
16477                                 DB_VERSION_STRING, version);
16478                         return 1;
16479                 }
16480         }
16481 #endif
16482
16483 #if DB_VERSION_MAJOR > 2
16484         db_env_create( NULL, 0 );
16485 #elif DB_VERSION_MAJOR > 1
16486         db_appexit( NULL );
16487 #else
16488         (void) dbopen( NULL, 0, 0, 0, NULL);
16489 #endif
16490
16491 ; return 0; }
16492 EOF
16493 if { (eval echo configure:16494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16494   rm -rf conftest*
16495   ol_cv_db_db_42=yes
16496 else
16497   echo "configure: failed program was:" >&5
16498   cat conftest.$ac_ext >&5
16499   rm -rf conftest*
16500   ol_cv_db_db_42=no
16501 fi
16502 rm -f conftest*
16503
16504         LIBS="$ol_LIBS"
16505
16506 fi
16507
16508 echo "$ac_t""$ol_cv_db_db_42" 1>&6
16509
16510         if test $ol_cv_db_db_42 = yes ; then
16511                 ol_cv_lib_db=-ldb-42
16512         fi
16513 fi
16514
16515 if test $ol_cv_lib_db = no ; then
16516         echo $ac_n "checking for Berkeley DB link (-ldb-4.2)""... $ac_c" 1>&6
16517 echo "configure:16518: checking for Berkeley DB link (-ldb-4.2)" >&5
16518 if eval "test \"\${ol_cv_db_db_4_dot_2+set}\" = set"; then
16519   echo $ac_n "(cached) $ac_c" 1>&6
16520 else
16521   
16522         ol_DB_LIB=-ldb-4.2
16523         ol_LIBS=$LIBS
16524         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16525
16526         cat > conftest.$ac_ext <<EOF
16527 #line 16528 "configure"
16528 #include "confdefs.h"
16529
16530 #ifdef HAVE_DB_185_H
16531 # include <db_185.h>
16532 #else
16533 # include <db.h>
16534 #endif
16535
16536 #ifndef DB_VERSION_MAJOR
16537 # define DB_VERSION_MAJOR 1
16538 #endif
16539
16540 #ifndef NULL
16541 #define NULL ((void*)0)
16542 #endif
16543
16544 int main() {
16545
16546 #if DB_VERSION_MAJOR > 1
16547         {
16548                 char *version;
16549                 int major, minor, patch;
16550
16551                 version = db_version( &major, &minor, &patch );
16552
16553                 if( major != DB_VERSION_MAJOR ||
16554                         minor < DB_VERSION_MINOR )
16555                 {
16556                         printf("Berkeley DB version mismatch\n"
16557                                 "\texpected: %s\n\tgot: %s\n",
16558                                 DB_VERSION_STRING, version);
16559                         return 1;
16560                 }
16561         }
16562 #endif
16563
16564 #if DB_VERSION_MAJOR > 2
16565         db_env_create( NULL, 0 );
16566 #elif DB_VERSION_MAJOR > 1
16567         db_appexit( NULL );
16568 #else
16569         (void) dbopen( NULL, 0, 0, 0, NULL);
16570 #endif
16571
16572 ; return 0; }
16573 EOF
16574 if { (eval echo configure:16575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16575   rm -rf conftest*
16576   ol_cv_db_db_4_dot_2=yes
16577 else
16578   echo "configure: failed program was:" >&5
16579   cat conftest.$ac_ext >&5
16580   rm -rf conftest*
16581   ol_cv_db_db_4_dot_2=no
16582 fi
16583 rm -f conftest*
16584
16585         LIBS="$ol_LIBS"
16586
16587 fi
16588
16589 echo "$ac_t""$ol_cv_db_db_4_dot_2" 1>&6
16590
16591         if test $ol_cv_db_db_4_dot_2 = yes ; then
16592                 ol_cv_lib_db=-ldb-4.2
16593         fi
16594 fi
16595
16596 if test $ol_cv_lib_db = no ; then
16597         echo $ac_n "checking for Berkeley DB link (-ldb-4-2)""... $ac_c" 1>&6
16598 echo "configure:16599: checking for Berkeley DB link (-ldb-4-2)" >&5
16599 if eval "test \"\${ol_cv_db_db_4_2+set}\" = set"; then
16600   echo $ac_n "(cached) $ac_c" 1>&6
16601 else
16602   
16603         ol_DB_LIB=-ldb-4-2
16604         ol_LIBS=$LIBS
16605         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16606
16607         cat > conftest.$ac_ext <<EOF
16608 #line 16609 "configure"
16609 #include "confdefs.h"
16610
16611 #ifdef HAVE_DB_185_H
16612 # include <db_185.h>
16613 #else
16614 # include <db.h>
16615 #endif
16616
16617 #ifndef DB_VERSION_MAJOR
16618 # define DB_VERSION_MAJOR 1
16619 #endif
16620
16621 #ifndef NULL
16622 #define NULL ((void*)0)
16623 #endif
16624
16625 int main() {
16626
16627 #if DB_VERSION_MAJOR > 1
16628         {
16629                 char *version;
16630                 int major, minor, patch;
16631
16632                 version = db_version( &major, &minor, &patch );
16633
16634                 if( major != DB_VERSION_MAJOR ||
16635                         minor < DB_VERSION_MINOR )
16636                 {
16637                         printf("Berkeley DB version mismatch\n"
16638                                 "\texpected: %s\n\tgot: %s\n",
16639                                 DB_VERSION_STRING, version);
16640                         return 1;
16641                 }
16642         }
16643 #endif
16644
16645 #if DB_VERSION_MAJOR > 2
16646         db_env_create( NULL, 0 );
16647 #elif DB_VERSION_MAJOR > 1
16648         db_appexit( NULL );
16649 #else
16650         (void) dbopen( NULL, 0, 0, 0, NULL);
16651 #endif
16652
16653 ; return 0; }
16654 EOF
16655 if { (eval echo configure:16656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16656   rm -rf conftest*
16657   ol_cv_db_db_4_2=yes
16658 else
16659   echo "configure: failed program was:" >&5
16660   cat conftest.$ac_ext >&5
16661   rm -rf conftest*
16662   ol_cv_db_db_4_2=no
16663 fi
16664 rm -f conftest*
16665
16666         LIBS="$ol_LIBS"
16667
16668 fi
16669
16670 echo "$ac_t""$ol_cv_db_db_4_2" 1>&6
16671
16672         if test $ol_cv_db_db_4_2 = yes ; then
16673                 ol_cv_lib_db=-ldb-4-2
16674         fi
16675 fi
16676
16677 if test $ol_cv_lib_db = no ; then
16678         echo $ac_n "checking for Berkeley DB link (-ldb-4)""... $ac_c" 1>&6
16679 echo "configure:16680: checking for Berkeley DB link (-ldb-4)" >&5
16680 if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then
16681   echo $ac_n "(cached) $ac_c" 1>&6
16682 else
16683   
16684         ol_DB_LIB=-ldb-4
16685         ol_LIBS=$LIBS
16686         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16687
16688         cat > conftest.$ac_ext <<EOF
16689 #line 16690 "configure"
16690 #include "confdefs.h"
16691
16692 #ifdef HAVE_DB_185_H
16693 # include <db_185.h>
16694 #else
16695 # include <db.h>
16696 #endif
16697
16698 #ifndef DB_VERSION_MAJOR
16699 # define DB_VERSION_MAJOR 1
16700 #endif
16701
16702 #ifndef NULL
16703 #define NULL ((void*)0)
16704 #endif
16705
16706 int main() {
16707
16708 #if DB_VERSION_MAJOR > 1
16709         {
16710                 char *version;
16711                 int major, minor, patch;
16712
16713                 version = db_version( &major, &minor, &patch );
16714
16715                 if( major != DB_VERSION_MAJOR ||
16716                         minor < DB_VERSION_MINOR )
16717                 {
16718                         printf("Berkeley DB version mismatch\n"
16719                                 "\texpected: %s\n\tgot: %s\n",
16720                                 DB_VERSION_STRING, version);
16721                         return 1;
16722                 }
16723         }
16724 #endif
16725
16726 #if DB_VERSION_MAJOR > 2
16727         db_env_create( NULL, 0 );
16728 #elif DB_VERSION_MAJOR > 1
16729         db_appexit( NULL );
16730 #else
16731         (void) dbopen( NULL, 0, 0, 0, NULL);
16732 #endif
16733
16734 ; return 0; }
16735 EOF
16736 if { (eval echo configure:16737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16737   rm -rf conftest*
16738   ol_cv_db_db_4=yes
16739 else
16740   echo "configure: failed program was:" >&5
16741   cat conftest.$ac_ext >&5
16742   rm -rf conftest*
16743   ol_cv_db_db_4=no
16744 fi
16745 rm -f conftest*
16746
16747         LIBS="$ol_LIBS"
16748
16749 fi
16750
16751 echo "$ac_t""$ol_cv_db_db_4" 1>&6
16752
16753         if test $ol_cv_db_db_4 = yes ; then
16754                 ol_cv_lib_db=-ldb-4
16755         fi
16756 fi
16757
16758 if test $ol_cv_lib_db = no ; then
16759         echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
16760 echo "configure:16761: checking for Berkeley DB link (-ldb4)" >&5
16761 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
16762   echo $ac_n "(cached) $ac_c" 1>&6
16763 else
16764   
16765         ol_DB_LIB=-ldb4
16766         ol_LIBS=$LIBS
16767         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16768
16769         cat > conftest.$ac_ext <<EOF
16770 #line 16771 "configure"
16771 #include "confdefs.h"
16772
16773 #ifdef HAVE_DB_185_H
16774 # include <db_185.h>
16775 #else
16776 # include <db.h>
16777 #endif
16778
16779 #ifndef DB_VERSION_MAJOR
16780 # define DB_VERSION_MAJOR 1
16781 #endif
16782
16783 #ifndef NULL
16784 #define NULL ((void*)0)
16785 #endif
16786
16787 int main() {
16788
16789 #if DB_VERSION_MAJOR > 1
16790         {
16791                 char *version;
16792                 int major, minor, patch;
16793
16794                 version = db_version( &major, &minor, &patch );
16795
16796                 if( major != DB_VERSION_MAJOR ||
16797                         minor < DB_VERSION_MINOR )
16798                 {
16799                         printf("Berkeley DB version mismatch\n"
16800                                 "\texpected: %s\n\tgot: %s\n",
16801                                 DB_VERSION_STRING, version);
16802                         return 1;
16803                 }
16804         }
16805 #endif
16806
16807 #if DB_VERSION_MAJOR > 2
16808         db_env_create( NULL, 0 );
16809 #elif DB_VERSION_MAJOR > 1
16810         db_appexit( NULL );
16811 #else
16812         (void) dbopen( NULL, 0, 0, 0, NULL);
16813 #endif
16814
16815 ; return 0; }
16816 EOF
16817 if { (eval echo configure:16818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16818   rm -rf conftest*
16819   ol_cv_db_db4=yes
16820 else
16821   echo "configure: failed program was:" >&5
16822   cat conftest.$ac_ext >&5
16823   rm -rf conftest*
16824   ol_cv_db_db4=no
16825 fi
16826 rm -f conftest*
16827
16828         LIBS="$ol_LIBS"
16829
16830 fi
16831
16832 echo "$ac_t""$ol_cv_db_db4" 1>&6
16833
16834         if test $ol_cv_db_db4 = yes ; then
16835                 ol_cv_lib_db=-ldb4
16836         fi
16837 fi
16838
16839 if test $ol_cv_lib_db = no ; then
16840         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
16841 echo "configure:16842: checking for Berkeley DB link (-ldb)" >&5
16842 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
16843   echo $ac_n "(cached) $ac_c" 1>&6
16844 else
16845   
16846         ol_DB_LIB=-ldb
16847         ol_LIBS=$LIBS
16848         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16849
16850         cat > conftest.$ac_ext <<EOF
16851 #line 16852 "configure"
16852 #include "confdefs.h"
16853
16854 #ifdef HAVE_DB_185_H
16855 # include <db_185.h>
16856 #else
16857 # include <db.h>
16858 #endif
16859
16860 #ifndef DB_VERSION_MAJOR
16861 # define DB_VERSION_MAJOR 1
16862 #endif
16863
16864 #ifndef NULL
16865 #define NULL ((void*)0)
16866 #endif
16867
16868 int main() {
16869
16870 #if DB_VERSION_MAJOR > 1
16871         {
16872                 char *version;
16873                 int major, minor, patch;
16874
16875                 version = db_version( &major, &minor, &patch );
16876
16877                 if( major != DB_VERSION_MAJOR ||
16878                         minor < DB_VERSION_MINOR )
16879                 {
16880                         printf("Berkeley DB version mismatch\n"
16881                                 "\texpected: %s\n\tgot: %s\n",
16882                                 DB_VERSION_STRING, version);
16883                         return 1;
16884                 }
16885         }
16886 #endif
16887
16888 #if DB_VERSION_MAJOR > 2
16889         db_env_create( NULL, 0 );
16890 #elif DB_VERSION_MAJOR > 1
16891         db_appexit( NULL );
16892 #else
16893         (void) dbopen( NULL, 0, 0, 0, NULL);
16894 #endif
16895
16896 ; return 0; }
16897 EOF
16898 if { (eval echo configure:16899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16899   rm -rf conftest*
16900   ol_cv_db_db=yes
16901 else
16902   echo "configure: failed program was:" >&5
16903   cat conftest.$ac_ext >&5
16904   rm -rf conftest*
16905   ol_cv_db_db=no
16906 fi
16907 rm -f conftest*
16908
16909         LIBS="$ol_LIBS"
16910
16911 fi
16912
16913 echo "$ac_t""$ol_cv_db_db" 1>&6
16914
16915         if test $ol_cv_db_db = yes ; then
16916                 ol_cv_lib_db=-ldb
16917         fi
16918 fi
16919
16920 if test $ol_cv_lib_db = no ; then
16921         echo $ac_n "checking for Berkeley DB link (-ldb41)""... $ac_c" 1>&6
16922 echo "configure:16923: checking for Berkeley DB link (-ldb41)" >&5
16923 if eval "test \"\${ol_cv_db_db41+set}\" = set"; then
16924   echo $ac_n "(cached) $ac_c" 1>&6
16925 else
16926   
16927         ol_DB_LIB=-ldb41
16928         ol_LIBS=$LIBS
16929         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16930
16931         cat > conftest.$ac_ext <<EOF
16932 #line 16933 "configure"
16933 #include "confdefs.h"
16934
16935 #ifdef HAVE_DB_185_H
16936 # include <db_185.h>
16937 #else
16938 # include <db.h>
16939 #endif
16940
16941 #ifndef DB_VERSION_MAJOR
16942 # define DB_VERSION_MAJOR 1
16943 #endif
16944
16945 #ifndef NULL
16946 #define NULL ((void*)0)
16947 #endif
16948
16949 int main() {
16950
16951 #if DB_VERSION_MAJOR > 1
16952         {
16953                 char *version;
16954                 int major, minor, patch;
16955
16956                 version = db_version( &major, &minor, &patch );
16957
16958                 if( major != DB_VERSION_MAJOR ||
16959                         minor < DB_VERSION_MINOR )
16960                 {
16961                         printf("Berkeley DB version mismatch\n"
16962                                 "\texpected: %s\n\tgot: %s\n",
16963                                 DB_VERSION_STRING, version);
16964                         return 1;
16965                 }
16966         }
16967 #endif
16968
16969 #if DB_VERSION_MAJOR > 2
16970         db_env_create( NULL, 0 );
16971 #elif DB_VERSION_MAJOR > 1
16972         db_appexit( NULL );
16973 #else
16974         (void) dbopen( NULL, 0, 0, 0, NULL);
16975 #endif
16976
16977 ; return 0; }
16978 EOF
16979 if { (eval echo configure:16980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16980   rm -rf conftest*
16981   ol_cv_db_db41=yes
16982 else
16983   echo "configure: failed program was:" >&5
16984   cat conftest.$ac_ext >&5
16985   rm -rf conftest*
16986   ol_cv_db_db41=no
16987 fi
16988 rm -f conftest*
16989
16990         LIBS="$ol_LIBS"
16991
16992 fi
16993
16994 echo "$ac_t""$ol_cv_db_db41" 1>&6
16995
16996         if test $ol_cv_db_db41 = yes ; then
16997                 ol_cv_lib_db=-ldb41
16998         fi
16999 fi
17000
17001 if test $ol_cv_lib_db = no ; then
17002         echo $ac_n "checking for Berkeley DB link (-ldb-41)""... $ac_c" 1>&6
17003 echo "configure:17004: checking for Berkeley DB link (-ldb-41)" >&5
17004 if eval "test \"\${ol_cv_db_db_41+set}\" = set"; then
17005   echo $ac_n "(cached) $ac_c" 1>&6
17006 else
17007   
17008         ol_DB_LIB=-ldb-41
17009         ol_LIBS=$LIBS
17010         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17011
17012         cat > conftest.$ac_ext <<EOF
17013 #line 17014 "configure"
17014 #include "confdefs.h"
17015
17016 #ifdef HAVE_DB_185_H
17017 # include <db_185.h>
17018 #else
17019 # include <db.h>
17020 #endif
17021
17022 #ifndef DB_VERSION_MAJOR
17023 # define DB_VERSION_MAJOR 1
17024 #endif
17025
17026 #ifndef NULL
17027 #define NULL ((void*)0)
17028 #endif
17029
17030 int main() {
17031
17032 #if DB_VERSION_MAJOR > 1
17033         {
17034                 char *version;
17035                 int major, minor, patch;
17036
17037                 version = db_version( &major, &minor, &patch );
17038
17039                 if( major != DB_VERSION_MAJOR ||
17040                         minor < DB_VERSION_MINOR )
17041                 {
17042                         printf("Berkeley DB version mismatch\n"
17043                                 "\texpected: %s\n\tgot: %s\n",
17044                                 DB_VERSION_STRING, version);
17045                         return 1;
17046                 }
17047         }
17048 #endif
17049
17050 #if DB_VERSION_MAJOR > 2
17051         db_env_create( NULL, 0 );
17052 #elif DB_VERSION_MAJOR > 1
17053         db_appexit( NULL );
17054 #else
17055         (void) dbopen( NULL, 0, 0, 0, NULL);
17056 #endif
17057
17058 ; return 0; }
17059 EOF
17060 if { (eval echo configure:17061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17061   rm -rf conftest*
17062   ol_cv_db_db_41=yes
17063 else
17064   echo "configure: failed program was:" >&5
17065   cat conftest.$ac_ext >&5
17066   rm -rf conftest*
17067   ol_cv_db_db_41=no
17068 fi
17069 rm -f conftest*
17070
17071         LIBS="$ol_LIBS"
17072
17073 fi
17074
17075 echo "$ac_t""$ol_cv_db_db_41" 1>&6
17076
17077         if test $ol_cv_db_db_41 = yes ; then
17078                 ol_cv_lib_db=-ldb-41
17079         fi
17080 fi
17081
17082 if test $ol_cv_lib_db = no ; then
17083         echo $ac_n "checking for Berkeley DB link (-ldb-4.1)""... $ac_c" 1>&6
17084 echo "configure:17085: checking for Berkeley DB link (-ldb-4.1)" >&5
17085 if eval "test \"\${ol_cv_db_db_4_dot_1+set}\" = set"; then
17086   echo $ac_n "(cached) $ac_c" 1>&6
17087 else
17088   
17089         ol_DB_LIB=-ldb-4.1
17090         ol_LIBS=$LIBS
17091         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17092
17093         cat > conftest.$ac_ext <<EOF
17094 #line 17095 "configure"
17095 #include "confdefs.h"
17096
17097 #ifdef HAVE_DB_185_H
17098 # include <db_185.h>
17099 #else
17100 # include <db.h>
17101 #endif
17102
17103 #ifndef DB_VERSION_MAJOR
17104 # define DB_VERSION_MAJOR 1
17105 #endif
17106
17107 #ifndef NULL
17108 #define NULL ((void*)0)
17109 #endif
17110
17111 int main() {
17112
17113 #if DB_VERSION_MAJOR > 1
17114         {
17115                 char *version;
17116                 int major, minor, patch;
17117
17118                 version = db_version( &major, &minor, &patch );
17119
17120                 if( major != DB_VERSION_MAJOR ||
17121                         minor < DB_VERSION_MINOR )
17122                 {
17123                         printf("Berkeley DB version mismatch\n"
17124                                 "\texpected: %s\n\tgot: %s\n",
17125                                 DB_VERSION_STRING, version);
17126                         return 1;
17127                 }
17128         }
17129 #endif
17130
17131 #if DB_VERSION_MAJOR > 2
17132         db_env_create( NULL, 0 );
17133 #elif DB_VERSION_MAJOR > 1
17134         db_appexit( NULL );
17135 #else
17136         (void) dbopen( NULL, 0, 0, 0, NULL);
17137 #endif
17138
17139 ; return 0; }
17140 EOF
17141 if { (eval echo configure:17142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17142   rm -rf conftest*
17143   ol_cv_db_db_4_dot_1=yes
17144 else
17145   echo "configure: failed program was:" >&5
17146   cat conftest.$ac_ext >&5
17147   rm -rf conftest*
17148   ol_cv_db_db_4_dot_1=no
17149 fi
17150 rm -f conftest*
17151
17152         LIBS="$ol_LIBS"
17153
17154 fi
17155
17156 echo "$ac_t""$ol_cv_db_db_4_dot_1" 1>&6
17157
17158         if test $ol_cv_db_db_4_dot_1 = yes ; then
17159                 ol_cv_lib_db=-ldb-4.1
17160         fi
17161 fi
17162
17163 if test $ol_cv_lib_db = no ; then
17164         echo $ac_n "checking for Berkeley DB link (-ldb-4-1)""... $ac_c" 1>&6
17165 echo "configure:17166: checking for Berkeley DB link (-ldb-4-1)" >&5
17166 if eval "test \"\${ol_cv_db_db_4_1+set}\" = set"; then
17167   echo $ac_n "(cached) $ac_c" 1>&6
17168 else
17169   
17170         ol_DB_LIB=-ldb-4-1
17171         ol_LIBS=$LIBS
17172         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17173
17174         cat > conftest.$ac_ext <<EOF
17175 #line 17176 "configure"
17176 #include "confdefs.h"
17177
17178 #ifdef HAVE_DB_185_H
17179 # include <db_185.h>
17180 #else
17181 # include <db.h>
17182 #endif
17183
17184 #ifndef DB_VERSION_MAJOR
17185 # define DB_VERSION_MAJOR 1
17186 #endif
17187
17188 #ifndef NULL
17189 #define NULL ((void*)0)
17190 #endif
17191
17192 int main() {
17193
17194 #if DB_VERSION_MAJOR > 1
17195         {
17196                 char *version;
17197                 int major, minor, patch;
17198
17199                 version = db_version( &major, &minor, &patch );
17200
17201                 if( major != DB_VERSION_MAJOR ||
17202                         minor < DB_VERSION_MINOR )
17203                 {
17204                         printf("Berkeley DB version mismatch\n"
17205                                 "\texpected: %s\n\tgot: %s\n",
17206                                 DB_VERSION_STRING, version);
17207                         return 1;
17208                 }
17209         }
17210 #endif
17211
17212 #if DB_VERSION_MAJOR > 2
17213         db_env_create( NULL, 0 );
17214 #elif DB_VERSION_MAJOR > 1
17215         db_appexit( NULL );
17216 #else
17217         (void) dbopen( NULL, 0, 0, 0, NULL);
17218 #endif
17219
17220 ; return 0; }
17221 EOF
17222 if { (eval echo configure:17223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17223   rm -rf conftest*
17224   ol_cv_db_db_4_1=yes
17225 else
17226   echo "configure: failed program was:" >&5
17227   cat conftest.$ac_ext >&5
17228   rm -rf conftest*
17229   ol_cv_db_db_4_1=no
17230 fi
17231 rm -f conftest*
17232
17233         LIBS="$ol_LIBS"
17234
17235 fi
17236
17237 echo "$ac_t""$ol_cv_db_db_4_1" 1>&6
17238
17239         if test $ol_cv_db_db_4_1 = yes ; then
17240                 ol_cv_lib_db=-ldb-4-1
17241         fi
17242 fi
17243
17244 if test $ol_cv_lib_db = no ; then
17245         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
17246 echo "configure:17247: checking for Berkeley DB link (-ldb3)" >&5
17247 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
17248   echo $ac_n "(cached) $ac_c" 1>&6
17249 else
17250   
17251         ol_DB_LIB=-ldb3
17252         ol_LIBS=$LIBS
17253         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17254
17255         cat > conftest.$ac_ext <<EOF
17256 #line 17257 "configure"
17257 #include "confdefs.h"
17258
17259 #ifdef HAVE_DB_185_H
17260 # include <db_185.h>
17261 #else
17262 # include <db.h>
17263 #endif
17264
17265 #ifndef DB_VERSION_MAJOR
17266 # define DB_VERSION_MAJOR 1
17267 #endif
17268
17269 #ifndef NULL
17270 #define NULL ((void*)0)
17271 #endif
17272
17273 int main() {
17274
17275 #if DB_VERSION_MAJOR > 1
17276         {
17277                 char *version;
17278                 int major, minor, patch;
17279
17280                 version = db_version( &major, &minor, &patch );
17281
17282                 if( major != DB_VERSION_MAJOR ||
17283                         minor < DB_VERSION_MINOR )
17284                 {
17285                         printf("Berkeley DB version mismatch\n"
17286                                 "\texpected: %s\n\tgot: %s\n",
17287                                 DB_VERSION_STRING, version);
17288                         return 1;
17289                 }
17290         }
17291 #endif
17292
17293 #if DB_VERSION_MAJOR > 2
17294         db_env_create( NULL, 0 );
17295 #elif DB_VERSION_MAJOR > 1
17296         db_appexit( NULL );
17297 #else
17298         (void) dbopen( NULL, 0, 0, 0, NULL);
17299 #endif
17300
17301 ; return 0; }
17302 EOF
17303 if { (eval echo configure:17304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17304   rm -rf conftest*
17305   ol_cv_db_db3=yes
17306 else
17307   echo "configure: failed program was:" >&5
17308   cat conftest.$ac_ext >&5
17309   rm -rf conftest*
17310   ol_cv_db_db3=no
17311 fi
17312 rm -f conftest*
17313
17314         LIBS="$ol_LIBS"
17315
17316 fi
17317
17318 echo "$ac_t""$ol_cv_db_db3" 1>&6
17319
17320         if test $ol_cv_db_db3 = yes ; then
17321                 ol_cv_lib_db=-ldb3
17322         fi
17323 fi
17324
17325 if test $ol_cv_lib_db = no ; then
17326         echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6
17327 echo "configure:17328: checking for Berkeley DB link (-ldb-3)" >&5
17328 if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then
17329   echo $ac_n "(cached) $ac_c" 1>&6
17330 else
17331   
17332         ol_DB_LIB=-ldb-3
17333         ol_LIBS=$LIBS
17334         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17335
17336         cat > conftest.$ac_ext <<EOF
17337 #line 17338 "configure"
17338 #include "confdefs.h"
17339
17340 #ifdef HAVE_DB_185_H
17341 # include <db_185.h>
17342 #else
17343 # include <db.h>
17344 #endif
17345
17346 #ifndef DB_VERSION_MAJOR
17347 # define DB_VERSION_MAJOR 1
17348 #endif
17349
17350 #ifndef NULL
17351 #define NULL ((void*)0)
17352 #endif
17353
17354 int main() {
17355
17356 #if DB_VERSION_MAJOR > 1
17357         {
17358                 char *version;
17359                 int major, minor, patch;
17360
17361                 version = db_version( &major, &minor, &patch );
17362
17363                 if( major != DB_VERSION_MAJOR ||
17364                         minor < DB_VERSION_MINOR )
17365                 {
17366                         printf("Berkeley DB version mismatch\n"
17367                                 "\texpected: %s\n\tgot: %s\n",
17368                                 DB_VERSION_STRING, version);
17369                         return 1;
17370                 }
17371         }
17372 #endif
17373
17374 #if DB_VERSION_MAJOR > 2
17375         db_env_create( NULL, 0 );
17376 #elif DB_VERSION_MAJOR > 1
17377         db_appexit( NULL );
17378 #else
17379         (void) dbopen( NULL, 0, 0, 0, NULL);
17380 #endif
17381
17382 ; return 0; }
17383 EOF
17384 if { (eval echo configure:17385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17385   rm -rf conftest*
17386   ol_cv_db_db_3=yes
17387 else
17388   echo "configure: failed program was:" >&5
17389   cat conftest.$ac_ext >&5
17390   rm -rf conftest*
17391   ol_cv_db_db_3=no
17392 fi
17393 rm -f conftest*
17394
17395         LIBS="$ol_LIBS"
17396
17397 fi
17398
17399 echo "$ac_t""$ol_cv_db_db_3" 1>&6
17400
17401         if test $ol_cv_db_db_3 = yes ; then
17402                 ol_cv_lib_db=-ldb-3
17403         fi
17404 fi
17405
17406 if test $ol_cv_lib_db = no ; then
17407         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
17408 echo "configure:17409: checking for Berkeley DB link (-ldb2)" >&5
17409 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
17410   echo $ac_n "(cached) $ac_c" 1>&6
17411 else
17412   
17413         ol_DB_LIB=-ldb2
17414         ol_LIBS=$LIBS
17415         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17416
17417         cat > conftest.$ac_ext <<EOF
17418 #line 17419 "configure"
17419 #include "confdefs.h"
17420
17421 #ifdef HAVE_DB_185_H
17422 # include <db_185.h>
17423 #else
17424 # include <db.h>
17425 #endif
17426
17427 #ifndef DB_VERSION_MAJOR
17428 # define DB_VERSION_MAJOR 1
17429 #endif
17430
17431 #ifndef NULL
17432 #define NULL ((void*)0)
17433 #endif
17434
17435 int main() {
17436
17437 #if DB_VERSION_MAJOR > 1
17438         {
17439                 char *version;
17440                 int major, minor, patch;
17441
17442                 version = db_version( &major, &minor, &patch );
17443
17444                 if( major != DB_VERSION_MAJOR ||
17445                         minor < DB_VERSION_MINOR )
17446                 {
17447                         printf("Berkeley DB version mismatch\n"
17448                                 "\texpected: %s\n\tgot: %s\n",
17449                                 DB_VERSION_STRING, version);
17450                         return 1;
17451                 }
17452         }
17453 #endif
17454
17455 #if DB_VERSION_MAJOR > 2
17456         db_env_create( NULL, 0 );
17457 #elif DB_VERSION_MAJOR > 1
17458         db_appexit( NULL );
17459 #else
17460         (void) dbopen( NULL, 0, 0, 0, NULL);
17461 #endif
17462
17463 ; return 0; }
17464 EOF
17465 if { (eval echo configure:17466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17466   rm -rf conftest*
17467   ol_cv_db_db2=yes
17468 else
17469   echo "configure: failed program was:" >&5
17470   cat conftest.$ac_ext >&5
17471   rm -rf conftest*
17472   ol_cv_db_db2=no
17473 fi
17474 rm -f conftest*
17475
17476         LIBS="$ol_LIBS"
17477
17478 fi
17479
17480 echo "$ac_t""$ol_cv_db_db2" 1>&6
17481
17482         if test $ol_cv_db_db2 = yes ; then
17483                 ol_cv_lib_db=-ldb2
17484         fi
17485 fi
17486
17487 if test $ol_cv_lib_db = no ; then
17488         echo $ac_n "checking for Berkeley DB link (-ldb-2)""... $ac_c" 1>&6
17489 echo "configure:17490: checking for Berkeley DB link (-ldb-2)" >&5
17490 if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then
17491   echo $ac_n "(cached) $ac_c" 1>&6
17492 else
17493   
17494         ol_DB_LIB=-ldb-2
17495         ol_LIBS=$LIBS
17496         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17497
17498         cat > conftest.$ac_ext <<EOF
17499 #line 17500 "configure"
17500 #include "confdefs.h"
17501
17502 #ifdef HAVE_DB_185_H
17503 # include <db_185.h>
17504 #else
17505 # include <db.h>
17506 #endif
17507
17508 #ifndef DB_VERSION_MAJOR
17509 # define DB_VERSION_MAJOR 1
17510 #endif
17511
17512 #ifndef NULL
17513 #define NULL ((void*)0)
17514 #endif
17515
17516 int main() {
17517
17518 #if DB_VERSION_MAJOR > 1
17519         {
17520                 char *version;
17521                 int major, minor, patch;
17522
17523                 version = db_version( &major, &minor, &patch );
17524
17525                 if( major != DB_VERSION_MAJOR ||
17526                         minor < DB_VERSION_MINOR )
17527                 {
17528                         printf("Berkeley DB version mismatch\n"
17529                                 "\texpected: %s\n\tgot: %s\n",
17530                                 DB_VERSION_STRING, version);
17531                         return 1;
17532                 }
17533         }
17534 #endif
17535
17536 #if DB_VERSION_MAJOR > 2
17537         db_env_create( NULL, 0 );
17538 #elif DB_VERSION_MAJOR > 1
17539         db_appexit( NULL );
17540 #else
17541         (void) dbopen( NULL, 0, 0, 0, NULL);
17542 #endif
17543
17544 ; return 0; }
17545 EOF
17546 if { (eval echo configure:17547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17547   rm -rf conftest*
17548   ol_cv_db_db_2=yes
17549 else
17550   echo "configure: failed program was:" >&5
17551   cat conftest.$ac_ext >&5
17552   rm -rf conftest*
17553   ol_cv_db_db_2=no
17554 fi
17555 rm -f conftest*
17556
17557         LIBS="$ol_LIBS"
17558
17559 fi
17560
17561 echo "$ac_t""$ol_cv_db_db_2" 1>&6
17562
17563         if test $ol_cv_db_db_2 = yes ; then
17564                 ol_cv_lib_db=-ldb-2
17565         fi
17566 fi
17567
17568 if test $ol_cv_lib_db = no ; then
17569         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
17570 echo "configure:17571: checking for Berkeley DB link (-ldb1)" >&5
17571 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
17572   echo $ac_n "(cached) $ac_c" 1>&6
17573 else
17574   
17575         ol_DB_LIB=-ldb1
17576         ol_LIBS=$LIBS
17577         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17578
17579         cat > conftest.$ac_ext <<EOF
17580 #line 17581 "configure"
17581 #include "confdefs.h"
17582
17583 #ifdef HAVE_DB_185_H
17584 # include <db_185.h>
17585 #else
17586 # include <db.h>
17587 #endif
17588
17589 #ifndef DB_VERSION_MAJOR
17590 # define DB_VERSION_MAJOR 1
17591 #endif
17592
17593 #ifndef NULL
17594 #define NULL ((void*)0)
17595 #endif
17596
17597 int main() {
17598
17599 #if DB_VERSION_MAJOR > 1
17600         {
17601                 char *version;
17602                 int major, minor, patch;
17603
17604                 version = db_version( &major, &minor, &patch );
17605
17606                 if( major != DB_VERSION_MAJOR ||
17607                         minor < DB_VERSION_MINOR )
17608                 {
17609                         printf("Berkeley DB version mismatch\n"
17610                                 "\texpected: %s\n\tgot: %s\n",
17611                                 DB_VERSION_STRING, version);
17612                         return 1;
17613                 }
17614         }
17615 #endif
17616
17617 #if DB_VERSION_MAJOR > 2
17618         db_env_create( NULL, 0 );
17619 #elif DB_VERSION_MAJOR > 1
17620         db_appexit( NULL );
17621 #else
17622         (void) dbopen( NULL, 0, 0, 0, NULL);
17623 #endif
17624
17625 ; return 0; }
17626 EOF
17627 if { (eval echo configure:17628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17628   rm -rf conftest*
17629   ol_cv_db_db1=yes
17630 else
17631   echo "configure: failed program was:" >&5
17632   cat conftest.$ac_ext >&5
17633   rm -rf conftest*
17634   ol_cv_db_db1=no
17635 fi
17636 rm -f conftest*
17637
17638         LIBS="$ol_LIBS"
17639
17640 fi
17641
17642 echo "$ac_t""$ol_cv_db_db1" 1>&6
17643
17644         if test $ol_cv_db_db1 = yes ; then
17645                 ol_cv_lib_db=-ldb1
17646         fi
17647 fi
17648
17649 if test $ol_cv_lib_db = no ; then
17650         echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6
17651 echo "configure:17652: checking for Berkeley DB link (-ldb-1)" >&5
17652 if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then
17653   echo $ac_n "(cached) $ac_c" 1>&6
17654 else
17655   
17656         ol_DB_LIB=-ldb-1
17657         ol_LIBS=$LIBS
17658         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17659
17660         cat > conftest.$ac_ext <<EOF
17661 #line 17662 "configure"
17662 #include "confdefs.h"
17663
17664 #ifdef HAVE_DB_185_H
17665 # include <db_185.h>
17666 #else
17667 # include <db.h>
17668 #endif
17669
17670 #ifndef DB_VERSION_MAJOR
17671 # define DB_VERSION_MAJOR 1
17672 #endif
17673
17674 #ifndef NULL
17675 #define NULL ((void*)0)
17676 #endif
17677
17678 int main() {
17679
17680 #if DB_VERSION_MAJOR > 1
17681         {
17682                 char *version;
17683                 int major, minor, patch;
17684
17685                 version = db_version( &major, &minor, &patch );
17686
17687                 if( major != DB_VERSION_MAJOR ||
17688                         minor < DB_VERSION_MINOR )
17689                 {
17690                         printf("Berkeley DB version mismatch\n"
17691                                 "\texpected: %s\n\tgot: %s\n",
17692                                 DB_VERSION_STRING, version);
17693                         return 1;
17694                 }
17695         }
17696 #endif
17697
17698 #if DB_VERSION_MAJOR > 2
17699         db_env_create( NULL, 0 );
17700 #elif DB_VERSION_MAJOR > 1
17701         db_appexit( NULL );
17702 #else
17703         (void) dbopen( NULL, 0, 0, 0, NULL);
17704 #endif
17705
17706 ; return 0; }
17707 EOF
17708 if { (eval echo configure:17709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17709   rm -rf conftest*
17710   ol_cv_db_db_1=yes
17711 else
17712   echo "configure: failed program was:" >&5
17713   cat conftest.$ac_ext >&5
17714   rm -rf conftest*
17715   ol_cv_db_db_1=no
17716 fi
17717 rm -f conftest*
17718
17719         LIBS="$ol_LIBS"
17720
17721 fi
17722
17723 echo "$ac_t""$ol_cv_db_db_1" 1>&6
17724
17725         if test $ol_cv_db_db_1 = yes ; then
17726                 ol_cv_lib_db=-ldb-1
17727         fi
17728 fi
17729
17730
17731                 if test "$ol_cv_lib_db" != no ; then
17732                         ol_cv_berkeley_db=yes
17733                 fi
17734         fi
17735 fi
17736
17737         else
17738                 ol_cv_berkeley_db=no
17739 for ac_hdr in db.h
17740 do
17741 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
17742 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
17743 echo "configure:17744: checking for $ac_hdr" >&5
17744 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
17745   echo $ac_n "(cached) $ac_c" 1>&6
17746 else
17747   cat > conftest.$ac_ext <<EOF
17748 #line 17749 "configure"
17749 #include "confdefs.h"
17750 #include <$ac_hdr>
17751 EOF
17752 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
17753 { (eval echo configure:17754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
17754 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
17755 if test -z "$ac_err"; then
17756   rm -rf conftest*
17757   eval "ac_cv_header_$ac_safe=yes"
17758 else
17759   echo "$ac_err" >&5
17760   echo "configure: failed program was:" >&5
17761   cat conftest.$ac_ext >&5
17762   rm -rf conftest*
17763   eval "ac_cv_header_$ac_safe=no"
17764 fi
17765 rm -f conftest*
17766 fi
17767 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
17768   echo "$ac_t""yes" 1>&6
17769     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
17770   cat >> confdefs.h <<EOF
17771 #define $ac_tr_hdr 1
17772 EOF
17773  
17774 else
17775   echo "$ac_t""no" 1>&6
17776 fi
17777 done
17778
17779 if test $ac_cv_header_db_h = yes; then
17780         ol_cv_lib_db=no
17781 if test $ol_cv_lib_db = no ; then
17782         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
17783 echo "configure:17784: checking for Berkeley DB link (default)" >&5
17784 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
17785   echo $ac_n "(cached) $ac_c" 1>&6
17786 else
17787   
17788         ol_DB_LIB=
17789         ol_LIBS=$LIBS
17790         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17791
17792         cat > conftest.$ac_ext <<EOF
17793 #line 17794 "configure"
17794 #include "confdefs.h"
17795
17796 #ifdef HAVE_DB_185_H
17797 # include <db_185.h>
17798 #else
17799 # include <db.h>
17800 #endif
17801
17802 #ifndef DB_VERSION_MAJOR
17803 # define DB_VERSION_MAJOR 1
17804 #endif
17805
17806 #ifndef NULL
17807 #define NULL ((void*)0)
17808 #endif
17809
17810 int main() {
17811
17812 #if DB_VERSION_MAJOR > 1
17813         {
17814                 char *version;
17815                 int major, minor, patch;
17816
17817                 version = db_version( &major, &minor, &patch );
17818
17819                 if( major != DB_VERSION_MAJOR ||
17820                         minor < DB_VERSION_MINOR )
17821                 {
17822                         printf("Berkeley DB version mismatch\n"
17823                                 "\texpected: %s\n\tgot: %s\n",
17824                                 DB_VERSION_STRING, version);
17825                         return 1;
17826                 }
17827         }
17828 #endif
17829
17830 #if DB_VERSION_MAJOR > 2
17831         db_env_create( NULL, 0 );
17832 #elif DB_VERSION_MAJOR > 1
17833         db_appexit( NULL );
17834 #else
17835         (void) dbopen( NULL, 0, 0, 0, NULL);
17836 #endif
17837
17838 ; return 0; }
17839 EOF
17840 if { (eval echo configure:17841: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17841   rm -rf conftest*
17842   ol_cv_db_none=yes
17843 else
17844   echo "configure: failed program was:" >&5
17845   cat conftest.$ac_ext >&5
17846   rm -rf conftest*
17847   ol_cv_db_none=no
17848 fi
17849 rm -f conftest*
17850
17851         LIBS="$ol_LIBS"
17852
17853 fi
17854
17855 echo "$ac_t""$ol_cv_db_none" 1>&6
17856
17857         if test $ol_cv_db_none = yes ; then
17858                 ol_cv_lib_db=yes
17859         fi
17860 fi
17861
17862 if test $ol_cv_lib_db = no ; then
17863         echo $ac_n "checking for Berkeley DB link (-ldb42)""... $ac_c" 1>&6
17864 echo "configure:17865: checking for Berkeley DB link (-ldb42)" >&5
17865 if eval "test \"\${ol_cv_db_db42+set}\" = set"; then
17866   echo $ac_n "(cached) $ac_c" 1>&6
17867 else
17868   
17869         ol_DB_LIB=-ldb42
17870         ol_LIBS=$LIBS
17871         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17872
17873         cat > conftest.$ac_ext <<EOF
17874 #line 17875 "configure"
17875 #include "confdefs.h"
17876
17877 #ifdef HAVE_DB_185_H
17878 # include <db_185.h>
17879 #else
17880 # include <db.h>
17881 #endif
17882
17883 #ifndef DB_VERSION_MAJOR
17884 # define DB_VERSION_MAJOR 1
17885 #endif
17886
17887 #ifndef NULL
17888 #define NULL ((void*)0)
17889 #endif
17890
17891 int main() {
17892
17893 #if DB_VERSION_MAJOR > 1
17894         {
17895                 char *version;
17896                 int major, minor, patch;
17897
17898                 version = db_version( &major, &minor, &patch );
17899
17900                 if( major != DB_VERSION_MAJOR ||
17901                         minor < DB_VERSION_MINOR )
17902                 {
17903                         printf("Berkeley DB version mismatch\n"
17904                                 "\texpected: %s\n\tgot: %s\n",
17905                                 DB_VERSION_STRING, version);
17906                         return 1;
17907                 }
17908         }
17909 #endif
17910
17911 #if DB_VERSION_MAJOR > 2
17912         db_env_create( NULL, 0 );
17913 #elif DB_VERSION_MAJOR > 1
17914         db_appexit( NULL );
17915 #else
17916         (void) dbopen( NULL, 0, 0, 0, NULL);
17917 #endif
17918
17919 ; return 0; }
17920 EOF
17921 if { (eval echo configure:17922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17922   rm -rf conftest*
17923   ol_cv_db_db42=yes
17924 else
17925   echo "configure: failed program was:" >&5
17926   cat conftest.$ac_ext >&5
17927   rm -rf conftest*
17928   ol_cv_db_db42=no
17929 fi
17930 rm -f conftest*
17931
17932         LIBS="$ol_LIBS"
17933
17934 fi
17935
17936 echo "$ac_t""$ol_cv_db_db42" 1>&6
17937
17938         if test $ol_cv_db_db42 = yes ; then
17939                 ol_cv_lib_db=-ldb42
17940         fi
17941 fi
17942
17943 if test $ol_cv_lib_db = no ; then
17944         echo $ac_n "checking for Berkeley DB link (-ldb-42)""... $ac_c" 1>&6
17945 echo "configure:17946: checking for Berkeley DB link (-ldb-42)" >&5
17946 if eval "test \"\${ol_cv_db_db_42+set}\" = set"; then
17947   echo $ac_n "(cached) $ac_c" 1>&6
17948 else
17949   
17950         ol_DB_LIB=-ldb-42
17951         ol_LIBS=$LIBS
17952         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17953
17954         cat > conftest.$ac_ext <<EOF
17955 #line 17956 "configure"
17956 #include "confdefs.h"
17957
17958 #ifdef HAVE_DB_185_H
17959 # include <db_185.h>
17960 #else
17961 # include <db.h>
17962 #endif
17963
17964 #ifndef DB_VERSION_MAJOR
17965 # define DB_VERSION_MAJOR 1
17966 #endif
17967
17968 #ifndef NULL
17969 #define NULL ((void*)0)
17970 #endif
17971
17972 int main() {
17973
17974 #if DB_VERSION_MAJOR > 1
17975         {
17976                 char *version;
17977                 int major, minor, patch;
17978
17979                 version = db_version( &major, &minor, &patch );
17980
17981                 if( major != DB_VERSION_MAJOR ||
17982                         minor < DB_VERSION_MINOR )
17983                 {
17984                         printf("Berkeley DB version mismatch\n"
17985                                 "\texpected: %s\n\tgot: %s\n",
17986                                 DB_VERSION_STRING, version);
17987                         return 1;
17988                 }
17989         }
17990 #endif
17991
17992 #if DB_VERSION_MAJOR > 2
17993         db_env_create( NULL, 0 );
17994 #elif DB_VERSION_MAJOR > 1
17995         db_appexit( NULL );
17996 #else
17997         (void) dbopen( NULL, 0, 0, 0, NULL);
17998 #endif
17999
18000 ; return 0; }
18001 EOF
18002 if { (eval echo configure:18003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18003   rm -rf conftest*
18004   ol_cv_db_db_42=yes
18005 else
18006   echo "configure: failed program was:" >&5
18007   cat conftest.$ac_ext >&5
18008   rm -rf conftest*
18009   ol_cv_db_db_42=no
18010 fi
18011 rm -f conftest*
18012
18013         LIBS="$ol_LIBS"
18014
18015 fi
18016
18017 echo "$ac_t""$ol_cv_db_db_42" 1>&6
18018
18019         if test $ol_cv_db_db_42 = yes ; then
18020                 ol_cv_lib_db=-ldb-42
18021         fi
18022 fi
18023
18024 if test $ol_cv_lib_db = no ; then
18025         echo $ac_n "checking for Berkeley DB link (-ldb-4.2)""... $ac_c" 1>&6
18026 echo "configure:18027: checking for Berkeley DB link (-ldb-4.2)" >&5
18027 if eval "test \"\${ol_cv_db_db_4_dot_2+set}\" = set"; then
18028   echo $ac_n "(cached) $ac_c" 1>&6
18029 else
18030   
18031         ol_DB_LIB=-ldb-4.2
18032         ol_LIBS=$LIBS
18033         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18034
18035         cat > conftest.$ac_ext <<EOF
18036 #line 18037 "configure"
18037 #include "confdefs.h"
18038
18039 #ifdef HAVE_DB_185_H
18040 # include <db_185.h>
18041 #else
18042 # include <db.h>
18043 #endif
18044
18045 #ifndef DB_VERSION_MAJOR
18046 # define DB_VERSION_MAJOR 1
18047 #endif
18048
18049 #ifndef NULL
18050 #define NULL ((void*)0)
18051 #endif
18052
18053 int main() {
18054
18055 #if DB_VERSION_MAJOR > 1
18056         {
18057                 char *version;
18058                 int major, minor, patch;
18059
18060                 version = db_version( &major, &minor, &patch );
18061
18062                 if( major != DB_VERSION_MAJOR ||
18063                         minor < DB_VERSION_MINOR )
18064                 {
18065                         printf("Berkeley DB version mismatch\n"
18066                                 "\texpected: %s\n\tgot: %s\n",
18067                                 DB_VERSION_STRING, version);
18068                         return 1;
18069                 }
18070         }
18071 #endif
18072
18073 #if DB_VERSION_MAJOR > 2
18074         db_env_create( NULL, 0 );
18075 #elif DB_VERSION_MAJOR > 1
18076         db_appexit( NULL );
18077 #else
18078         (void) dbopen( NULL, 0, 0, 0, NULL);
18079 #endif
18080
18081 ; return 0; }
18082 EOF
18083 if { (eval echo configure:18084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18084   rm -rf conftest*
18085   ol_cv_db_db_4_dot_2=yes
18086 else
18087   echo "configure: failed program was:" >&5
18088   cat conftest.$ac_ext >&5
18089   rm -rf conftest*
18090   ol_cv_db_db_4_dot_2=no
18091 fi
18092 rm -f conftest*
18093
18094         LIBS="$ol_LIBS"
18095
18096 fi
18097
18098 echo "$ac_t""$ol_cv_db_db_4_dot_2" 1>&6
18099
18100         if test $ol_cv_db_db_4_dot_2 = yes ; then
18101                 ol_cv_lib_db=-ldb-4.2
18102         fi
18103 fi
18104
18105 if test $ol_cv_lib_db = no ; then
18106         echo $ac_n "checking for Berkeley DB link (-ldb-4-2)""... $ac_c" 1>&6
18107 echo "configure:18108: checking for Berkeley DB link (-ldb-4-2)" >&5
18108 if eval "test \"\${ol_cv_db_db_4_2+set}\" = set"; then
18109   echo $ac_n "(cached) $ac_c" 1>&6
18110 else
18111   
18112         ol_DB_LIB=-ldb-4-2
18113         ol_LIBS=$LIBS
18114         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18115
18116         cat > conftest.$ac_ext <<EOF
18117 #line 18118 "configure"
18118 #include "confdefs.h"
18119
18120 #ifdef HAVE_DB_185_H
18121 # include <db_185.h>
18122 #else
18123 # include <db.h>
18124 #endif
18125
18126 #ifndef DB_VERSION_MAJOR
18127 # define DB_VERSION_MAJOR 1
18128 #endif
18129
18130 #ifndef NULL
18131 #define NULL ((void*)0)
18132 #endif
18133
18134 int main() {
18135
18136 #if DB_VERSION_MAJOR > 1
18137         {
18138                 char *version;
18139                 int major, minor, patch;
18140
18141                 version = db_version( &major, &minor, &patch );
18142
18143                 if( major != DB_VERSION_MAJOR ||
18144                         minor < DB_VERSION_MINOR )
18145                 {
18146                         printf("Berkeley DB version mismatch\n"
18147                                 "\texpected: %s\n\tgot: %s\n",
18148                                 DB_VERSION_STRING, version);
18149                         return 1;
18150                 }
18151         }
18152 #endif
18153
18154 #if DB_VERSION_MAJOR > 2
18155         db_env_create( NULL, 0 );
18156 #elif DB_VERSION_MAJOR > 1
18157         db_appexit( NULL );
18158 #else
18159         (void) dbopen( NULL, 0, 0, 0, NULL);
18160 #endif
18161
18162 ; return 0; }
18163 EOF
18164 if { (eval echo configure:18165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18165   rm -rf conftest*
18166   ol_cv_db_db_4_2=yes
18167 else
18168   echo "configure: failed program was:" >&5
18169   cat conftest.$ac_ext >&5
18170   rm -rf conftest*
18171   ol_cv_db_db_4_2=no
18172 fi
18173 rm -f conftest*
18174
18175         LIBS="$ol_LIBS"
18176
18177 fi
18178
18179 echo "$ac_t""$ol_cv_db_db_4_2" 1>&6
18180
18181         if test $ol_cv_db_db_4_2 = yes ; then
18182                 ol_cv_lib_db=-ldb-4-2
18183         fi
18184 fi
18185
18186 if test $ol_cv_lib_db = no ; then
18187         echo $ac_n "checking for Berkeley DB link (-ldb-4)""... $ac_c" 1>&6
18188 echo "configure:18189: checking for Berkeley DB link (-ldb-4)" >&5
18189 if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then
18190   echo $ac_n "(cached) $ac_c" 1>&6
18191 else
18192   
18193         ol_DB_LIB=-ldb-4
18194         ol_LIBS=$LIBS
18195         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18196
18197         cat > conftest.$ac_ext <<EOF
18198 #line 18199 "configure"
18199 #include "confdefs.h"
18200
18201 #ifdef HAVE_DB_185_H
18202 # include <db_185.h>
18203 #else
18204 # include <db.h>
18205 #endif
18206
18207 #ifndef DB_VERSION_MAJOR
18208 # define DB_VERSION_MAJOR 1
18209 #endif
18210
18211 #ifndef NULL
18212 #define NULL ((void*)0)
18213 #endif
18214
18215 int main() {
18216
18217 #if DB_VERSION_MAJOR > 1
18218         {
18219                 char *version;
18220                 int major, minor, patch;
18221
18222                 version = db_version( &major, &minor, &patch );
18223
18224                 if( major != DB_VERSION_MAJOR ||
18225                         minor < DB_VERSION_MINOR )
18226                 {
18227                         printf("Berkeley DB version mismatch\n"
18228                                 "\texpected: %s\n\tgot: %s\n",
18229                                 DB_VERSION_STRING, version);
18230                         return 1;
18231                 }
18232         }
18233 #endif
18234
18235 #if DB_VERSION_MAJOR > 2
18236         db_env_create( NULL, 0 );
18237 #elif DB_VERSION_MAJOR > 1
18238         db_appexit( NULL );
18239 #else
18240         (void) dbopen( NULL, 0, 0, 0, NULL);
18241 #endif
18242
18243 ; return 0; }
18244 EOF
18245 if { (eval echo configure:18246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18246   rm -rf conftest*
18247   ol_cv_db_db_4=yes
18248 else
18249   echo "configure: failed program was:" >&5
18250   cat conftest.$ac_ext >&5
18251   rm -rf conftest*
18252   ol_cv_db_db_4=no
18253 fi
18254 rm -f conftest*
18255
18256         LIBS="$ol_LIBS"
18257
18258 fi
18259
18260 echo "$ac_t""$ol_cv_db_db_4" 1>&6
18261
18262         if test $ol_cv_db_db_4 = yes ; then
18263                 ol_cv_lib_db=-ldb-4
18264         fi
18265 fi
18266
18267 if test $ol_cv_lib_db = no ; then
18268         echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
18269 echo "configure:18270: checking for Berkeley DB link (-ldb4)" >&5
18270 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
18271   echo $ac_n "(cached) $ac_c" 1>&6
18272 else
18273   
18274         ol_DB_LIB=-ldb4
18275         ol_LIBS=$LIBS
18276         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18277
18278         cat > conftest.$ac_ext <<EOF
18279 #line 18280 "configure"
18280 #include "confdefs.h"
18281
18282 #ifdef HAVE_DB_185_H
18283 # include <db_185.h>
18284 #else
18285 # include <db.h>
18286 #endif
18287
18288 #ifndef DB_VERSION_MAJOR
18289 # define DB_VERSION_MAJOR 1
18290 #endif
18291
18292 #ifndef NULL
18293 #define NULL ((void*)0)
18294 #endif
18295
18296 int main() {
18297
18298 #if DB_VERSION_MAJOR > 1
18299         {
18300                 char *version;
18301                 int major, minor, patch;
18302
18303                 version = db_version( &major, &minor, &patch );
18304
18305                 if( major != DB_VERSION_MAJOR ||
18306                         minor < DB_VERSION_MINOR )
18307                 {
18308                         printf("Berkeley DB version mismatch\n"
18309                                 "\texpected: %s\n\tgot: %s\n",
18310                                 DB_VERSION_STRING, version);
18311                         return 1;
18312                 }
18313         }
18314 #endif
18315
18316 #if DB_VERSION_MAJOR > 2
18317         db_env_create( NULL, 0 );
18318 #elif DB_VERSION_MAJOR > 1
18319         db_appexit( NULL );
18320 #else
18321         (void) dbopen( NULL, 0, 0, 0, NULL);
18322 #endif
18323
18324 ; return 0; }
18325 EOF
18326 if { (eval echo configure:18327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18327   rm -rf conftest*
18328   ol_cv_db_db4=yes
18329 else
18330   echo "configure: failed program was:" >&5
18331   cat conftest.$ac_ext >&5
18332   rm -rf conftest*
18333   ol_cv_db_db4=no
18334 fi
18335 rm -f conftest*
18336
18337         LIBS="$ol_LIBS"
18338
18339 fi
18340
18341 echo "$ac_t""$ol_cv_db_db4" 1>&6
18342
18343         if test $ol_cv_db_db4 = yes ; then
18344                 ol_cv_lib_db=-ldb4
18345         fi
18346 fi
18347
18348 if test $ol_cv_lib_db = no ; then
18349         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
18350 echo "configure:18351: checking for Berkeley DB link (-ldb)" >&5
18351 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
18352   echo $ac_n "(cached) $ac_c" 1>&6
18353 else
18354   
18355         ol_DB_LIB=-ldb
18356         ol_LIBS=$LIBS
18357         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18358
18359         cat > conftest.$ac_ext <<EOF
18360 #line 18361 "configure"
18361 #include "confdefs.h"
18362
18363 #ifdef HAVE_DB_185_H
18364 # include <db_185.h>
18365 #else
18366 # include <db.h>
18367 #endif
18368
18369 #ifndef DB_VERSION_MAJOR
18370 # define DB_VERSION_MAJOR 1
18371 #endif
18372
18373 #ifndef NULL
18374 #define NULL ((void*)0)
18375 #endif
18376
18377 int main() {
18378
18379 #if DB_VERSION_MAJOR > 1
18380         {
18381                 char *version;
18382                 int major, minor, patch;
18383
18384                 version = db_version( &major, &minor, &patch );
18385
18386                 if( major != DB_VERSION_MAJOR ||
18387                         minor < DB_VERSION_MINOR )
18388                 {
18389                         printf("Berkeley DB version mismatch\n"
18390                                 "\texpected: %s\n\tgot: %s\n",
18391                                 DB_VERSION_STRING, version);
18392                         return 1;
18393                 }
18394         }
18395 #endif
18396
18397 #if DB_VERSION_MAJOR > 2
18398         db_env_create( NULL, 0 );
18399 #elif DB_VERSION_MAJOR > 1
18400         db_appexit( NULL );
18401 #else
18402         (void) dbopen( NULL, 0, 0, 0, NULL);
18403 #endif
18404
18405 ; return 0; }
18406 EOF
18407 if { (eval echo configure:18408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18408   rm -rf conftest*
18409   ol_cv_db_db=yes
18410 else
18411   echo "configure: failed program was:" >&5
18412   cat conftest.$ac_ext >&5
18413   rm -rf conftest*
18414   ol_cv_db_db=no
18415 fi
18416 rm -f conftest*
18417
18418         LIBS="$ol_LIBS"
18419
18420 fi
18421
18422 echo "$ac_t""$ol_cv_db_db" 1>&6
18423
18424         if test $ol_cv_db_db = yes ; then
18425                 ol_cv_lib_db=-ldb
18426         fi
18427 fi
18428
18429 if test $ol_cv_lib_db = no ; then
18430         echo $ac_n "checking for Berkeley DB link (-ldb41)""... $ac_c" 1>&6
18431 echo "configure:18432: checking for Berkeley DB link (-ldb41)" >&5
18432 if eval "test \"\${ol_cv_db_db41+set}\" = set"; then
18433   echo $ac_n "(cached) $ac_c" 1>&6
18434 else
18435   
18436         ol_DB_LIB=-ldb41
18437         ol_LIBS=$LIBS
18438         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18439
18440         cat > conftest.$ac_ext <<EOF
18441 #line 18442 "configure"
18442 #include "confdefs.h"
18443
18444 #ifdef HAVE_DB_185_H
18445 # include <db_185.h>
18446 #else
18447 # include <db.h>
18448 #endif
18449
18450 #ifndef DB_VERSION_MAJOR
18451 # define DB_VERSION_MAJOR 1
18452 #endif
18453
18454 #ifndef NULL
18455 #define NULL ((void*)0)
18456 #endif
18457
18458 int main() {
18459
18460 #if DB_VERSION_MAJOR > 1
18461         {
18462                 char *version;
18463                 int major, minor, patch;
18464
18465                 version = db_version( &major, &minor, &patch );
18466
18467                 if( major != DB_VERSION_MAJOR ||
18468                         minor < DB_VERSION_MINOR )
18469                 {
18470                         printf("Berkeley DB version mismatch\n"
18471                                 "\texpected: %s\n\tgot: %s\n",
18472                                 DB_VERSION_STRING, version);
18473                         return 1;
18474                 }
18475         }
18476 #endif
18477
18478 #if DB_VERSION_MAJOR > 2
18479         db_env_create( NULL, 0 );
18480 #elif DB_VERSION_MAJOR > 1
18481         db_appexit( NULL );
18482 #else
18483         (void) dbopen( NULL, 0, 0, 0, NULL);
18484 #endif
18485
18486 ; return 0; }
18487 EOF
18488 if { (eval echo configure:18489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18489   rm -rf conftest*
18490   ol_cv_db_db41=yes
18491 else
18492   echo "configure: failed program was:" >&5
18493   cat conftest.$ac_ext >&5
18494   rm -rf conftest*
18495   ol_cv_db_db41=no
18496 fi
18497 rm -f conftest*
18498
18499         LIBS="$ol_LIBS"
18500
18501 fi
18502
18503 echo "$ac_t""$ol_cv_db_db41" 1>&6
18504
18505         if test $ol_cv_db_db41 = yes ; then
18506                 ol_cv_lib_db=-ldb41
18507         fi
18508 fi
18509
18510 if test $ol_cv_lib_db = no ; then
18511         echo $ac_n "checking for Berkeley DB link (-ldb-41)""... $ac_c" 1>&6
18512 echo "configure:18513: checking for Berkeley DB link (-ldb-41)" >&5
18513 if eval "test \"\${ol_cv_db_db_41+set}\" = set"; then
18514   echo $ac_n "(cached) $ac_c" 1>&6
18515 else
18516   
18517         ol_DB_LIB=-ldb-41
18518         ol_LIBS=$LIBS
18519         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18520
18521         cat > conftest.$ac_ext <<EOF
18522 #line 18523 "configure"
18523 #include "confdefs.h"
18524
18525 #ifdef HAVE_DB_185_H
18526 # include <db_185.h>
18527 #else
18528 # include <db.h>
18529 #endif
18530
18531 #ifndef DB_VERSION_MAJOR
18532 # define DB_VERSION_MAJOR 1
18533 #endif
18534
18535 #ifndef NULL
18536 #define NULL ((void*)0)
18537 #endif
18538
18539 int main() {
18540
18541 #if DB_VERSION_MAJOR > 1
18542         {
18543                 char *version;
18544                 int major, minor, patch;
18545
18546                 version = db_version( &major, &minor, &patch );
18547
18548                 if( major != DB_VERSION_MAJOR ||
18549                         minor < DB_VERSION_MINOR )
18550                 {
18551                         printf("Berkeley DB version mismatch\n"
18552                                 "\texpected: %s\n\tgot: %s\n",
18553                                 DB_VERSION_STRING, version);
18554                         return 1;
18555                 }
18556         }
18557 #endif
18558
18559 #if DB_VERSION_MAJOR > 2
18560         db_env_create( NULL, 0 );
18561 #elif DB_VERSION_MAJOR > 1
18562         db_appexit( NULL );
18563 #else
18564         (void) dbopen( NULL, 0, 0, 0, NULL);
18565 #endif
18566
18567 ; return 0; }
18568 EOF
18569 if { (eval echo configure:18570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18570   rm -rf conftest*
18571   ol_cv_db_db_41=yes
18572 else
18573   echo "configure: failed program was:" >&5
18574   cat conftest.$ac_ext >&5
18575   rm -rf conftest*
18576   ol_cv_db_db_41=no
18577 fi
18578 rm -f conftest*
18579
18580         LIBS="$ol_LIBS"
18581
18582 fi
18583
18584 echo "$ac_t""$ol_cv_db_db_41" 1>&6
18585
18586         if test $ol_cv_db_db_41 = yes ; then
18587                 ol_cv_lib_db=-ldb-41
18588         fi
18589 fi
18590
18591 if test $ol_cv_lib_db = no ; then
18592         echo $ac_n "checking for Berkeley DB link (-ldb-4.1)""... $ac_c" 1>&6
18593 echo "configure:18594: checking for Berkeley DB link (-ldb-4.1)" >&5
18594 if eval "test \"\${ol_cv_db_db_4_dot_1+set}\" = set"; then
18595   echo $ac_n "(cached) $ac_c" 1>&6
18596 else
18597   
18598         ol_DB_LIB=-ldb-4.1
18599         ol_LIBS=$LIBS
18600         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18601
18602         cat > conftest.$ac_ext <<EOF
18603 #line 18604 "configure"
18604 #include "confdefs.h"
18605
18606 #ifdef HAVE_DB_185_H
18607 # include <db_185.h>
18608 #else
18609 # include <db.h>
18610 #endif
18611
18612 #ifndef DB_VERSION_MAJOR
18613 # define DB_VERSION_MAJOR 1
18614 #endif
18615
18616 #ifndef NULL
18617 #define NULL ((void*)0)
18618 #endif
18619
18620 int main() {
18621
18622 #if DB_VERSION_MAJOR > 1
18623         {
18624                 char *version;
18625                 int major, minor, patch;
18626
18627                 version = db_version( &major, &minor, &patch );
18628
18629                 if( major != DB_VERSION_MAJOR ||
18630                         minor < DB_VERSION_MINOR )
18631                 {
18632                         printf("Berkeley DB version mismatch\n"
18633                                 "\texpected: %s\n\tgot: %s\n",
18634                                 DB_VERSION_STRING, version);
18635                         return 1;
18636                 }
18637         }
18638 #endif
18639
18640 #if DB_VERSION_MAJOR > 2
18641         db_env_create( NULL, 0 );
18642 #elif DB_VERSION_MAJOR > 1
18643         db_appexit( NULL );
18644 #else
18645         (void) dbopen( NULL, 0, 0, 0, NULL);
18646 #endif
18647
18648 ; return 0; }
18649 EOF
18650 if { (eval echo configure:18651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18651   rm -rf conftest*
18652   ol_cv_db_db_4_dot_1=yes
18653 else
18654   echo "configure: failed program was:" >&5
18655   cat conftest.$ac_ext >&5
18656   rm -rf conftest*
18657   ol_cv_db_db_4_dot_1=no
18658 fi
18659 rm -f conftest*
18660
18661         LIBS="$ol_LIBS"
18662
18663 fi
18664
18665 echo "$ac_t""$ol_cv_db_db_4_dot_1" 1>&6
18666
18667         if test $ol_cv_db_db_4_dot_1 = yes ; then
18668                 ol_cv_lib_db=-ldb-4.1
18669         fi
18670 fi
18671
18672 if test $ol_cv_lib_db = no ; then
18673         echo $ac_n "checking for Berkeley DB link (-ldb-4-1)""... $ac_c" 1>&6
18674 echo "configure:18675: checking for Berkeley DB link (-ldb-4-1)" >&5
18675 if eval "test \"\${ol_cv_db_db_4_1+set}\" = set"; then
18676   echo $ac_n "(cached) $ac_c" 1>&6
18677 else
18678   
18679         ol_DB_LIB=-ldb-4-1
18680         ol_LIBS=$LIBS
18681         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18682
18683         cat > conftest.$ac_ext <<EOF
18684 #line 18685 "configure"
18685 #include "confdefs.h"
18686
18687 #ifdef HAVE_DB_185_H
18688 # include <db_185.h>
18689 #else
18690 # include <db.h>
18691 #endif
18692
18693 #ifndef DB_VERSION_MAJOR
18694 # define DB_VERSION_MAJOR 1
18695 #endif
18696
18697 #ifndef NULL
18698 #define NULL ((void*)0)
18699 #endif
18700
18701 int main() {
18702
18703 #if DB_VERSION_MAJOR > 1
18704         {
18705                 char *version;
18706                 int major, minor, patch;
18707
18708                 version = db_version( &major, &minor, &patch );
18709
18710                 if( major != DB_VERSION_MAJOR ||
18711                         minor < DB_VERSION_MINOR )
18712                 {
18713                         printf("Berkeley DB version mismatch\n"
18714                                 "\texpected: %s\n\tgot: %s\n",
18715                                 DB_VERSION_STRING, version);
18716                         return 1;
18717                 }
18718         }
18719 #endif
18720
18721 #if DB_VERSION_MAJOR > 2
18722         db_env_create( NULL, 0 );
18723 #elif DB_VERSION_MAJOR > 1
18724         db_appexit( NULL );
18725 #else
18726         (void) dbopen( NULL, 0, 0, 0, NULL);
18727 #endif
18728
18729 ; return 0; }
18730 EOF
18731 if { (eval echo configure:18732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18732   rm -rf conftest*
18733   ol_cv_db_db_4_1=yes
18734 else
18735   echo "configure: failed program was:" >&5
18736   cat conftest.$ac_ext >&5
18737   rm -rf conftest*
18738   ol_cv_db_db_4_1=no
18739 fi
18740 rm -f conftest*
18741
18742         LIBS="$ol_LIBS"
18743
18744 fi
18745
18746 echo "$ac_t""$ol_cv_db_db_4_1" 1>&6
18747
18748         if test $ol_cv_db_db_4_1 = yes ; then
18749                 ol_cv_lib_db=-ldb-4-1
18750         fi
18751 fi
18752
18753 if test $ol_cv_lib_db = no ; then
18754         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
18755 echo "configure:18756: checking for Berkeley DB link (-ldb3)" >&5
18756 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
18757   echo $ac_n "(cached) $ac_c" 1>&6
18758 else
18759   
18760         ol_DB_LIB=-ldb3
18761         ol_LIBS=$LIBS
18762         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18763
18764         cat > conftest.$ac_ext <<EOF
18765 #line 18766 "configure"
18766 #include "confdefs.h"
18767
18768 #ifdef HAVE_DB_185_H
18769 # include <db_185.h>
18770 #else
18771 # include <db.h>
18772 #endif
18773
18774 #ifndef DB_VERSION_MAJOR
18775 # define DB_VERSION_MAJOR 1
18776 #endif
18777
18778 #ifndef NULL
18779 #define NULL ((void*)0)
18780 #endif
18781
18782 int main() {
18783
18784 #if DB_VERSION_MAJOR > 1
18785         {
18786                 char *version;
18787                 int major, minor, patch;
18788
18789                 version = db_version( &major, &minor, &patch );
18790
18791                 if( major != DB_VERSION_MAJOR ||
18792                         minor < DB_VERSION_MINOR )
18793                 {
18794                         printf("Berkeley DB version mismatch\n"
18795                                 "\texpected: %s\n\tgot: %s\n",
18796                                 DB_VERSION_STRING, version);
18797                         return 1;
18798                 }
18799         }
18800 #endif
18801
18802 #if DB_VERSION_MAJOR > 2
18803         db_env_create( NULL, 0 );
18804 #elif DB_VERSION_MAJOR > 1
18805         db_appexit( NULL );
18806 #else
18807         (void) dbopen( NULL, 0, 0, 0, NULL);
18808 #endif
18809
18810 ; return 0; }
18811 EOF
18812 if { (eval echo configure:18813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18813   rm -rf conftest*
18814   ol_cv_db_db3=yes
18815 else
18816   echo "configure: failed program was:" >&5
18817   cat conftest.$ac_ext >&5
18818   rm -rf conftest*
18819   ol_cv_db_db3=no
18820 fi
18821 rm -f conftest*
18822
18823         LIBS="$ol_LIBS"
18824
18825 fi
18826
18827 echo "$ac_t""$ol_cv_db_db3" 1>&6
18828
18829         if test $ol_cv_db_db3 = yes ; then
18830                 ol_cv_lib_db=-ldb3
18831         fi
18832 fi
18833
18834 if test $ol_cv_lib_db = no ; then
18835         echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6
18836 echo "configure:18837: checking for Berkeley DB link (-ldb-3)" >&5
18837 if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then
18838   echo $ac_n "(cached) $ac_c" 1>&6
18839 else
18840   
18841         ol_DB_LIB=-ldb-3
18842         ol_LIBS=$LIBS
18843         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18844
18845         cat > conftest.$ac_ext <<EOF
18846 #line 18847 "configure"
18847 #include "confdefs.h"
18848
18849 #ifdef HAVE_DB_185_H
18850 # include <db_185.h>
18851 #else
18852 # include <db.h>
18853 #endif
18854
18855 #ifndef DB_VERSION_MAJOR
18856 # define DB_VERSION_MAJOR 1
18857 #endif
18858
18859 #ifndef NULL
18860 #define NULL ((void*)0)
18861 #endif
18862
18863 int main() {
18864
18865 #if DB_VERSION_MAJOR > 1
18866         {
18867                 char *version;
18868                 int major, minor, patch;
18869
18870                 version = db_version( &major, &minor, &patch );
18871
18872                 if( major != DB_VERSION_MAJOR ||
18873                         minor < DB_VERSION_MINOR )
18874                 {
18875                         printf("Berkeley DB version mismatch\n"
18876                                 "\texpected: %s\n\tgot: %s\n",
18877                                 DB_VERSION_STRING, version);
18878                         return 1;
18879                 }
18880         }
18881 #endif
18882
18883 #if DB_VERSION_MAJOR > 2
18884         db_env_create( NULL, 0 );
18885 #elif DB_VERSION_MAJOR > 1
18886         db_appexit( NULL );
18887 #else
18888         (void) dbopen( NULL, 0, 0, 0, NULL);
18889 #endif
18890
18891 ; return 0; }
18892 EOF
18893 if { (eval echo configure:18894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18894   rm -rf conftest*
18895   ol_cv_db_db_3=yes
18896 else
18897   echo "configure: failed program was:" >&5
18898   cat conftest.$ac_ext >&5
18899   rm -rf conftest*
18900   ol_cv_db_db_3=no
18901 fi
18902 rm -f conftest*
18903
18904         LIBS="$ol_LIBS"
18905
18906 fi
18907
18908 echo "$ac_t""$ol_cv_db_db_3" 1>&6
18909
18910         if test $ol_cv_db_db_3 = yes ; then
18911                 ol_cv_lib_db=-ldb-3
18912         fi
18913 fi
18914
18915 if test $ol_cv_lib_db = no ; then
18916         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
18917 echo "configure:18918: checking for Berkeley DB link (-ldb2)" >&5
18918 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
18919   echo $ac_n "(cached) $ac_c" 1>&6
18920 else
18921   
18922         ol_DB_LIB=-ldb2
18923         ol_LIBS=$LIBS
18924         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18925
18926         cat > conftest.$ac_ext <<EOF
18927 #line 18928 "configure"
18928 #include "confdefs.h"
18929
18930 #ifdef HAVE_DB_185_H
18931 # include <db_185.h>
18932 #else
18933 # include <db.h>
18934 #endif
18935
18936 #ifndef DB_VERSION_MAJOR
18937 # define DB_VERSION_MAJOR 1
18938 #endif
18939
18940 #ifndef NULL
18941 #define NULL ((void*)0)
18942 #endif
18943
18944 int main() {
18945
18946 #if DB_VERSION_MAJOR > 1
18947         {
18948                 char *version;
18949                 int major, minor, patch;
18950
18951                 version = db_version( &major, &minor, &patch );
18952
18953                 if( major != DB_VERSION_MAJOR ||
18954                         minor < DB_VERSION_MINOR )
18955                 {
18956                         printf("Berkeley DB version mismatch\n"
18957                                 "\texpected: %s\n\tgot: %s\n",
18958                                 DB_VERSION_STRING, version);
18959                         return 1;
18960                 }
18961         }
18962 #endif
18963
18964 #if DB_VERSION_MAJOR > 2
18965         db_env_create( NULL, 0 );
18966 #elif DB_VERSION_MAJOR > 1
18967         db_appexit( NULL );
18968 #else
18969         (void) dbopen( NULL, 0, 0, 0, NULL);
18970 #endif
18971
18972 ; return 0; }
18973 EOF
18974 if { (eval echo configure:18975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18975   rm -rf conftest*
18976   ol_cv_db_db2=yes
18977 else
18978   echo "configure: failed program was:" >&5
18979   cat conftest.$ac_ext >&5
18980   rm -rf conftest*
18981   ol_cv_db_db2=no
18982 fi
18983 rm -f conftest*
18984
18985         LIBS="$ol_LIBS"
18986
18987 fi
18988
18989 echo "$ac_t""$ol_cv_db_db2" 1>&6
18990
18991         if test $ol_cv_db_db2 = yes ; then
18992                 ol_cv_lib_db=-ldb2
18993         fi
18994 fi
18995
18996 if test $ol_cv_lib_db = no ; then
18997         echo $ac_n "checking for Berkeley DB link (-ldb-2)""... $ac_c" 1>&6
18998 echo "configure:18999: checking for Berkeley DB link (-ldb-2)" >&5
18999 if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then
19000   echo $ac_n "(cached) $ac_c" 1>&6
19001 else
19002   
19003         ol_DB_LIB=-ldb-2
19004         ol_LIBS=$LIBS
19005         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
19006
19007         cat > conftest.$ac_ext <<EOF
19008 #line 19009 "configure"
19009 #include "confdefs.h"
19010
19011 #ifdef HAVE_DB_185_H
19012 # include <db_185.h>
19013 #else
19014 # include <db.h>
19015 #endif
19016
19017 #ifndef DB_VERSION_MAJOR
19018 # define DB_VERSION_MAJOR 1
19019 #endif
19020
19021 #ifndef NULL
19022 #define NULL ((void*)0)
19023 #endif
19024
19025 int main() {
19026
19027 #if DB_VERSION_MAJOR > 1
19028         {
19029                 char *version;
19030                 int major, minor, patch;
19031
19032                 version = db_version( &major, &minor, &patch );
19033
19034                 if( major != DB_VERSION_MAJOR ||
19035                         minor < DB_VERSION_MINOR )
19036                 {
19037                         printf("Berkeley DB version mismatch\n"
19038                                 "\texpected: %s\n\tgot: %s\n",
19039                                 DB_VERSION_STRING, version);
19040                         return 1;
19041                 }
19042         }
19043 #endif
19044
19045 #if DB_VERSION_MAJOR > 2
19046         db_env_create( NULL, 0 );
19047 #elif DB_VERSION_MAJOR > 1
19048         db_appexit( NULL );
19049 #else
19050         (void) dbopen( NULL, 0, 0, 0, NULL);
19051 #endif
19052
19053 ; return 0; }
19054 EOF
19055 if { (eval echo configure:19056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19056   rm -rf conftest*
19057   ol_cv_db_db_2=yes
19058 else
19059   echo "configure: failed program was:" >&5
19060   cat conftest.$ac_ext >&5
19061   rm -rf conftest*
19062   ol_cv_db_db_2=no
19063 fi
19064 rm -f conftest*
19065
19066         LIBS="$ol_LIBS"
19067
19068 fi
19069
19070 echo "$ac_t""$ol_cv_db_db_2" 1>&6
19071
19072         if test $ol_cv_db_db_2 = yes ; then
19073                 ol_cv_lib_db=-ldb-2
19074         fi
19075 fi
19076
19077 if test $ol_cv_lib_db = no ; then
19078         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
19079 echo "configure:19080: checking for Berkeley DB link (-ldb1)" >&5
19080 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
19081   echo $ac_n "(cached) $ac_c" 1>&6
19082 else
19083   
19084         ol_DB_LIB=-ldb1
19085         ol_LIBS=$LIBS
19086         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
19087
19088         cat > conftest.$ac_ext <<EOF
19089 #line 19090 "configure"
19090 #include "confdefs.h"
19091
19092 #ifdef HAVE_DB_185_H
19093 # include <db_185.h>
19094 #else
19095 # include <db.h>
19096 #endif
19097
19098 #ifndef DB_VERSION_MAJOR
19099 # define DB_VERSION_MAJOR 1
19100 #endif
19101
19102 #ifndef NULL
19103 #define NULL ((void*)0)
19104 #endif
19105
19106 int main() {
19107
19108 #if DB_VERSION_MAJOR > 1
19109         {
19110                 char *version;
19111                 int major, minor, patch;
19112
19113                 version = db_version( &major, &minor, &patch );
19114
19115                 if( major != DB_VERSION_MAJOR ||
19116                         minor < DB_VERSION_MINOR )
19117                 {
19118                         printf("Berkeley DB version mismatch\n"
19119                                 "\texpected: %s\n\tgot: %s\n",
19120                                 DB_VERSION_STRING, version);
19121                         return 1;
19122                 }
19123         }
19124 #endif
19125
19126 #if DB_VERSION_MAJOR > 2
19127         db_env_create( NULL, 0 );
19128 #elif DB_VERSION_MAJOR > 1
19129         db_appexit( NULL );
19130 #else
19131         (void) dbopen( NULL, 0, 0, 0, NULL);
19132 #endif
19133
19134 ; return 0; }
19135 EOF
19136 if { (eval echo configure:19137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19137   rm -rf conftest*
19138   ol_cv_db_db1=yes
19139 else
19140   echo "configure: failed program was:" >&5
19141   cat conftest.$ac_ext >&5
19142   rm -rf conftest*
19143   ol_cv_db_db1=no
19144 fi
19145 rm -f conftest*
19146
19147         LIBS="$ol_LIBS"
19148
19149 fi
19150
19151 echo "$ac_t""$ol_cv_db_db1" 1>&6
19152
19153         if test $ol_cv_db_db1 = yes ; then
19154                 ol_cv_lib_db=-ldb1
19155         fi
19156 fi
19157
19158 if test $ol_cv_lib_db = no ; then
19159         echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6
19160 echo "configure:19161: checking for Berkeley DB link (-ldb-1)" >&5
19161 if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then
19162   echo $ac_n "(cached) $ac_c" 1>&6
19163 else
19164   
19165         ol_DB_LIB=-ldb-1
19166         ol_LIBS=$LIBS
19167         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
19168
19169         cat > conftest.$ac_ext <<EOF
19170 #line 19171 "configure"
19171 #include "confdefs.h"
19172
19173 #ifdef HAVE_DB_185_H
19174 # include <db_185.h>
19175 #else
19176 # include <db.h>
19177 #endif
19178
19179 #ifndef DB_VERSION_MAJOR
19180 # define DB_VERSION_MAJOR 1
19181 #endif
19182
19183 #ifndef NULL
19184 #define NULL ((void*)0)
19185 #endif
19186
19187 int main() {
19188
19189 #if DB_VERSION_MAJOR > 1
19190         {
19191                 char *version;
19192                 int major, minor, patch;
19193
19194                 version = db_version( &major, &minor, &patch );
19195
19196                 if( major != DB_VERSION_MAJOR ||
19197                         minor < DB_VERSION_MINOR )
19198                 {
19199                         printf("Berkeley DB version mismatch\n"
19200                                 "\texpected: %s\n\tgot: %s\n",
19201                                 DB_VERSION_STRING, version);
19202                         return 1;
19203                 }
19204         }
19205 #endif
19206
19207 #if DB_VERSION_MAJOR > 2
19208         db_env_create( NULL, 0 );
19209 #elif DB_VERSION_MAJOR > 1
19210         db_appexit( NULL );
19211 #else
19212         (void) dbopen( NULL, 0, 0, 0, NULL);
19213 #endif
19214
19215 ; return 0; }
19216 EOF
19217 if { (eval echo configure:19218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19218   rm -rf conftest*
19219   ol_cv_db_db_1=yes
19220 else
19221   echo "configure: failed program was:" >&5
19222   cat conftest.$ac_ext >&5
19223   rm -rf conftest*
19224   ol_cv_db_db_1=no
19225 fi
19226 rm -f conftest*
19227
19228         LIBS="$ol_LIBS"
19229
19230 fi
19231
19232 echo "$ac_t""$ol_cv_db_db_1" 1>&6
19233
19234         if test $ol_cv_db_db_1 = yes ; then
19235                 ol_cv_lib_db=-ldb-1
19236         fi
19237 fi
19238
19239
19240         if test "$ol_cv_lib_db" != no ; then
19241                 ol_cv_berkeley_db=yes
19242                 echo $ac_n "checking for Berkeley DB version match""... $ac_c" 1>&6
19243 echo "configure:19244: checking for Berkeley DB version match" >&5
19244 if eval "test \"\${ol_cv_berkeley_db_version+set}\" = set"; then
19245   echo $ac_n "(cached) $ac_c" 1>&6
19246 else
19247   
19248         ol_LIBS="$LIBS"
19249         LIBS="$LTHREAD_LIBS $LIBS"
19250         if test $ol_cv_lib_db != yes ; then
19251                 LIBS="$ol_cv_lib_db $LIBS"
19252         fi
19253
19254         if test "$cross_compiling" = yes; then
19255   ol_cv_berkeley_db_version=cross
19256 else
19257   cat > conftest.$ac_ext <<EOF
19258 #line 19259 "configure"
19259 #include "confdefs.h"
19260
19261 #ifdef HAVE_DB_185_H
19262         choke me;
19263 #else
19264 #include <db.h>
19265 #endif
19266 #ifndef DB_VERSION_MAJOR
19267 # define DB_VERSION_MAJOR 1
19268 #endif
19269 #ifndef NULL
19270 #define NULL ((void *)0)
19271 #endif
19272 main()
19273 {
19274 #if DB_VERSION_MAJOR > 1
19275         char *version;
19276         int major, minor, patch;
19277
19278         version = db_version( &major, &minor, &patch );
19279
19280         if( major != DB_VERSION_MAJOR || minor < DB_VERSION_MINOR ) {
19281                 printf("Berkeley DB version mismatch\n"
19282                         "\texpected: %s\n\tgot: %s\n",
19283                         DB_VERSION_STRING, version);
19284                 return 1;
19285         }
19286 #endif
19287
19288         return 0;
19289 }
19290 EOF
19291 if { (eval echo configure:19292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
19292 then
19293   ol_cv_berkeley_db_version=yes
19294 else
19295   echo "configure: failed program was:" >&5
19296   cat conftest.$ac_ext >&5
19297   rm -fr conftest*
19298   ol_cv_berkeley_db_version=no
19299 fi
19300 rm -fr conftest*
19301 fi
19302
19303
19304         LIBS="$ol_LIBS"
19305
19306 fi
19307
19308 echo "$ac_t""$ol_cv_berkeley_db_version" 1>&6
19309
19310         if test $ol_cv_berkeley_db_version = no ; then
19311                 { echo "configure: error: Berkeley DB version mismatch" 1>&2; exit 1; }
19312         fi
19313
19314                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
19315 echo "configure:19316: checking for Berkeley DB thread support" >&5
19316 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
19317   echo $ac_n "(cached) $ac_c" 1>&6
19318 else
19319   
19320         ol_LIBS="$LIBS"
19321         LIBS="$LTHREAD_LIBS $LIBS"
19322         if test $ol_cv_lib_db != yes ; then
19323                 LIBS="$ol_cv_lib_db $LIBS"
19324         fi
19325
19326         if test "$cross_compiling" = yes; then
19327   ol_cv_berkeley_db_thread=cross
19328 else
19329   cat > conftest.$ac_ext <<EOF
19330 #line 19331 "configure"
19331 #include "confdefs.h"
19332
19333 #ifdef HAVE_DB_185_H
19334         choke me;
19335 #else
19336 #include <db.h>
19337 #endif
19338 #ifndef NULL
19339 #define NULL ((void *)0)
19340 #endif
19341 main()
19342 {
19343         int rc;
19344         u_int32_t flags = DB_CREATE |
19345 #ifdef DB_PRIVATE
19346                 DB_PRIVATE |
19347 #endif
19348                 DB_THREAD;
19349
19350 #if DB_VERSION_MAJOR > 2
19351         DB_ENV *env = NULL;
19352
19353         rc = db_env_create( &env, 0 );
19354
19355         flags |= DB_INIT_MPOOL;
19356 #ifdef DB_MPOOL_PRIVATE
19357         flags |= DB_MPOOL_PRIVATE;
19358 #endif
19359
19360         if( rc ) {
19361                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
19362                 return rc;
19363         }
19364
19365 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
19366         rc = env->open( env, NULL, flags, 0 );
19367 #else
19368         rc = env->open( env, NULL, NULL, flags, 0 );
19369 #endif
19370
19371         if ( rc == 0 ) {
19372                 rc = env->close( env, 0 );
19373         }
19374
19375         if( rc ) {
19376                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
19377                 return rc;
19378         }
19379
19380 #else
19381         DB_ENV env;
19382         memset( &env, '\0', sizeof(env) );
19383
19384         rc = db_appinit( NULL, NULL, &env, flags );
19385
19386         if( rc == 0 ) {
19387                 db_appexit( &env );
19388         }
19389
19390         unlink("__db_mpool.share");
19391         unlink("__db_lock.share");
19392 #endif
19393
19394         return rc;
19395 }
19396 EOF
19397 if { (eval echo configure:19398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
19398 then
19399   ol_cv_berkeley_db_thread=yes
19400 else
19401   echo "configure: failed program was:" >&5
19402   cat conftest.$ac_ext >&5
19403   rm -fr conftest*
19404   ol_cv_berkeley_db_thread=no
19405 fi
19406 rm -fr conftest*
19407 fi
19408
19409
19410         LIBS="$ol_LIBS"
19411
19412 fi
19413
19414 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
19415
19416         if test $ol_cv_berkeley_db_thread != no ; then
19417                 cat >> confdefs.h <<\EOF
19418 #define HAVE_BERKELEY_DB_THREAD 1
19419 EOF
19420
19421         fi
19422
19423         fi
19424 fi
19425
19426         fi
19427
19428         if test $ol_cv_berkeley_db != no ; then
19429                 cat >> confdefs.h <<\EOF
19430 #define HAVE_BERKELEY_DB 1
19431 EOF
19432
19433
19434                 ol_link_ldbm=berkeley
19435                 ol_with_ldbm_api=berkeley
19436
19437                 if test $ol_with_ldbm_type = hash ; then
19438                         cat >> confdefs.h <<\EOF
19439 #define LDBM_USE_DBHASH 1
19440 EOF
19441
19442                 else
19443                         cat >> confdefs.h <<\EOF
19444 #define LDBM_USE_DBBTREE 1
19445 EOF
19446
19447                 fi
19448
19449                                                 if test $ol_cv_lib_db != yes ; then
19450                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
19451                 fi
19452         fi
19453 fi
19454
19455 if test $ol_enable_bdb = yes -a $ol_link_ldbm != berkeley ; then
19456         { echo "configure: error: BDB: BerkeleyDB not available" 1>&2; exit 1; }
19457 elif test $ol_enable_bdb != no -a $ol_link_ldbm = berkeley ; then
19458         echo $ac_n "checking Berkeley DB version for BDB backend""... $ac_c" 1>&6
19459 echo "configure:19460: checking Berkeley DB version for BDB backend" >&5
19460 if eval "test \"\${ol_cv_bdb_compat+set}\" = set"; then
19461   echo $ac_n "(cached) $ac_c" 1>&6
19462 else
19463   
19464         cat > conftest.$ac_ext <<EOF
19465 #line 19466 "configure"
19466 #include "confdefs.h"
19467
19468 #include <db.h>
19469
19470  /* this check could be improved */
19471 #ifndef DB_VERSION_MAJOR
19472 #       define DB_VERSION_MAJOR 1
19473 #endif
19474 #ifndef DB_VERSION_MINOR
19475 #       define DB_VERSION_MINOR 0
19476 #endif
19477
19478 /* require 4.2 or later */
19479 #if (DB_VERSION_MAJOR >= 4) && (DB_VERSION_MINOR >= 2)
19480         __db_version_compat
19481 #endif
19482         
19483 EOF
19484 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
19485   egrep "__db_version_compat" >/dev/null 2>&1; then
19486   rm -rf conftest*
19487   ol_cv_bdb_compat=yes
19488 else
19489   rm -rf conftest*
19490   ol_cv_bdb_compat=no
19491 fi
19492 rm -f conftest*
19493
19494 fi
19495
19496 echo "$ac_t""$ol_cv_bdb_compat" 1>&6
19497
19498
19499         if test $ol_cv_bdb_compat = yes ; then
19500                 ol_enable_bdb=yes
19501         elif test $ol_enable_bdb = yes ; then
19502                 { echo "configure: error: BDB: BerkeleyDB version incompatible" 1>&2; exit 1; }
19503         else
19504                 ol_enable_bdb=no
19505         fi
19506 fi
19507 if test $ol_enable_hdb = yes -a $ol_link_ldbm != berkeley ; then
19508         { echo "configure: error: HDB: BerkeleyDB not available" 1>&2; exit 1; }
19509 fi
19510
19511 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
19512         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
19513         ol_with_ldbm_api=none
19514 fi
19515
19516 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
19517         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
19518 echo "configure:19519: checking for MDBM library" >&5
19519 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
19520   echo $ac_n "(cached) $ac_c" 1>&6
19521 else
19522         ol_LIBS="$LIBS"
19523         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
19524 echo "configure:19525: checking for mdbm_set_chain" >&5
19525 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
19526   echo $ac_n "(cached) $ac_c" 1>&6
19527 else
19528   cat > conftest.$ac_ext <<EOF
19529 #line 19530 "configure"
19530 #include "confdefs.h"
19531 /* System header to define __stub macros and hopefully few prototypes,
19532     which can conflict with char mdbm_set_chain(); below.  */
19533 #include <assert.h>
19534 /* Override any gcc2 internal prototype to avoid an error.  */
19535 /* We use char because int might match the return type of a gcc2
19536     builtin and then its argument prototype would still apply.  */
19537 char mdbm_set_chain();
19538 char (*f)();
19539
19540 int main() {
19541
19542 /* The GNU C library defines this for functions which it implements
19543     to always fail with ENOSYS.  Some functions are actually named
19544     something starting with __ and the normal name is an alias.  */
19545 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
19546 choke me
19547 #else
19548 f = mdbm_set_chain;
19549 #endif
19550
19551 ; return 0; }
19552 EOF
19553 if { (eval echo configure:19554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19554   rm -rf conftest*
19555   eval "ac_cv_func_mdbm_set_chain=yes"
19556 else
19557   echo "configure: failed program was:" >&5
19558   cat conftest.$ac_ext >&5
19559   rm -rf conftest*
19560   eval "ac_cv_func_mdbm_set_chain=no"
19561 fi
19562 rm -f conftest*
19563 fi
19564
19565 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
19566   echo "$ac_t""yes" 1>&6
19567   ol_cv_lib_mdbm=yes
19568 else
19569   echo "$ac_t""no" 1>&6
19570
19571                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
19572 echo "configure:19573: checking for mdbm_set_chain in -lmdbm" >&5
19573 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
19574 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19575   echo $ac_n "(cached) $ac_c" 1>&6
19576 else
19577   ac_save_LIBS="$LIBS"
19578 LIBS="-lmdbm  $LIBS"
19579 cat > conftest.$ac_ext <<EOF
19580 #line 19581 "configure"
19581 #include "confdefs.h"
19582 /* Override any gcc2 internal prototype to avoid an error.  */
19583 /* We use char because int might match the return type of a gcc2
19584     builtin and then its argument prototype would still apply.  */
19585 char mdbm_set_chain();
19586
19587 int main() {
19588 mdbm_set_chain()
19589 ; return 0; }
19590 EOF
19591 if { (eval echo configure:19592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19592   rm -rf conftest*
19593   eval "ac_cv_lib_$ac_lib_var=yes"
19594 else
19595   echo "configure: failed program was:" >&5
19596   cat conftest.$ac_ext >&5
19597   rm -rf conftest*
19598   eval "ac_cv_lib_$ac_lib_var=no"
19599 fi
19600 rm -f conftest*
19601 LIBS="$ac_save_LIBS"
19602
19603 fi
19604 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19605   echo "$ac_t""yes" 1>&6
19606   ol_cv_lib_mdbm=-lmdbm
19607 else
19608   echo "$ac_t""no" 1>&6
19609 ol_cv_lib_mdbm=no
19610 fi
19611
19612         
19613 fi
19614
19615         LIBS="$ol_LIBS"
19616
19617 fi
19618
19619 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
19620
19621
19622  for ac_hdr in mdbm.h
19623 do
19624 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19625 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19626 echo "configure:19627: checking for $ac_hdr" >&5
19627 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19628   echo $ac_n "(cached) $ac_c" 1>&6
19629 else
19630   cat > conftest.$ac_ext <<EOF
19631 #line 19632 "configure"
19632 #include "confdefs.h"
19633 #include <$ac_hdr>
19634 EOF
19635 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19636 { (eval echo configure:19637: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19637 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19638 if test -z "$ac_err"; then
19639   rm -rf conftest*
19640   eval "ac_cv_header_$ac_safe=yes"
19641 else
19642   echo "$ac_err" >&5
19643   echo "configure: failed program was:" >&5
19644   cat conftest.$ac_ext >&5
19645   rm -rf conftest*
19646   eval "ac_cv_header_$ac_safe=no"
19647 fi
19648 rm -f conftest*
19649 fi
19650 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19651   echo "$ac_t""yes" 1>&6
19652     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19653   cat >> confdefs.h <<EOF
19654 #define $ac_tr_hdr 1
19655 EOF
19656  
19657 else
19658   echo "$ac_t""no" 1>&6
19659 fi
19660 done
19661
19662  echo $ac_n "checking for db""... $ac_c" 1>&6
19663 echo "configure:19664: checking for db" >&5
19664 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
19665   echo $ac_n "(cached) $ac_c" 1>&6
19666 else
19667   
19668         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
19669                 ol_cv_mdbm=no
19670         else
19671                 ol_cv_mdbm=yes
19672         fi
19673
19674 fi
19675
19676 echo "$ac_t""$ol_cv_mdbm" 1>&6
19677  if test $ol_cv_mdbm = yes ; then
19678         cat >> confdefs.h <<\EOF
19679 #define HAVE_MDBM 1
19680 EOF
19681
19682  fi
19683
19684
19685         if test $ol_cv_mdbm = yes ; then
19686                 ol_link_ldbm=mdbm
19687                 ol_with_ldbm_api=mdbm
19688                 if test $ol_cv_lib_mdbm != yes ; then
19689                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
19690                 fi
19691         fi
19692 fi
19693
19694 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
19695         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
19696 echo "configure:19697: checking for GDBM library" >&5
19697 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
19698   echo $ac_n "(cached) $ac_c" 1>&6
19699 else
19700         ol_LIBS="$LIBS"
19701         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
19702 echo "configure:19703: checking for gdbm_open" >&5
19703 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
19704   echo $ac_n "(cached) $ac_c" 1>&6
19705 else
19706   cat > conftest.$ac_ext <<EOF
19707 #line 19708 "configure"
19708 #include "confdefs.h"
19709 /* System header to define __stub macros and hopefully few prototypes,
19710     which can conflict with char gdbm_open(); below.  */
19711 #include <assert.h>
19712 /* Override any gcc2 internal prototype to avoid an error.  */
19713 /* We use char because int might match the return type of a gcc2
19714     builtin and then its argument prototype would still apply.  */
19715 char gdbm_open();
19716 char (*f)();
19717
19718 int main() {
19719
19720 /* The GNU C library defines this for functions which it implements
19721     to always fail with ENOSYS.  Some functions are actually named
19722     something starting with __ and the normal name is an alias.  */
19723 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
19724 choke me
19725 #else
19726 f = gdbm_open;
19727 #endif
19728
19729 ; return 0; }
19730 EOF
19731 if { (eval echo configure:19732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19732   rm -rf conftest*
19733   eval "ac_cv_func_gdbm_open=yes"
19734 else
19735   echo "configure: failed program was:" >&5
19736   cat conftest.$ac_ext >&5
19737   rm -rf conftest*
19738   eval "ac_cv_func_gdbm_open=no"
19739 fi
19740 rm -f conftest*
19741 fi
19742
19743 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
19744   echo "$ac_t""yes" 1>&6
19745   ol_cv_lib_gdbm=yes
19746 else
19747   echo "$ac_t""no" 1>&6
19748
19749                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
19750 echo "configure:19751: checking for gdbm_open in -lgdbm" >&5
19751 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
19752 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19753   echo $ac_n "(cached) $ac_c" 1>&6
19754 else
19755   ac_save_LIBS="$LIBS"
19756 LIBS="-lgdbm  $LIBS"
19757 cat > conftest.$ac_ext <<EOF
19758 #line 19759 "configure"
19759 #include "confdefs.h"
19760 /* Override any gcc2 internal prototype to avoid an error.  */
19761 /* We use char because int might match the return type of a gcc2
19762     builtin and then its argument prototype would still apply.  */
19763 char gdbm_open();
19764
19765 int main() {
19766 gdbm_open()
19767 ; return 0; }
19768 EOF
19769 if { (eval echo configure:19770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19770   rm -rf conftest*
19771   eval "ac_cv_lib_$ac_lib_var=yes"
19772 else
19773   echo "configure: failed program was:" >&5
19774   cat conftest.$ac_ext >&5
19775   rm -rf conftest*
19776   eval "ac_cv_lib_$ac_lib_var=no"
19777 fi
19778 rm -f conftest*
19779 LIBS="$ac_save_LIBS"
19780
19781 fi
19782 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19783   echo "$ac_t""yes" 1>&6
19784   ol_cv_lib_gdbm=-lgdbm
19785 else
19786   echo "$ac_t""no" 1>&6
19787 ol_cv_lib_gdbm=no
19788 fi
19789
19790         
19791 fi
19792
19793         LIBS="$ol_LIBS"
19794
19795 fi
19796
19797 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
19798
19799
19800  for ac_hdr in gdbm.h
19801 do
19802 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19803 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19804 echo "configure:19805: checking for $ac_hdr" >&5
19805 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19806   echo $ac_n "(cached) $ac_c" 1>&6
19807 else
19808   cat > conftest.$ac_ext <<EOF
19809 #line 19810 "configure"
19810 #include "confdefs.h"
19811 #include <$ac_hdr>
19812 EOF
19813 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19814 { (eval echo configure:19815: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19815 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19816 if test -z "$ac_err"; then
19817   rm -rf conftest*
19818   eval "ac_cv_header_$ac_safe=yes"
19819 else
19820   echo "$ac_err" >&5
19821   echo "configure: failed program was:" >&5
19822   cat conftest.$ac_ext >&5
19823   rm -rf conftest*
19824   eval "ac_cv_header_$ac_safe=no"
19825 fi
19826 rm -f conftest*
19827 fi
19828 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19829   echo "$ac_t""yes" 1>&6
19830     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19831   cat >> confdefs.h <<EOF
19832 #define $ac_tr_hdr 1
19833 EOF
19834  
19835 else
19836   echo "$ac_t""no" 1>&6
19837 fi
19838 done
19839
19840  echo $ac_n "checking for db""... $ac_c" 1>&6
19841 echo "configure:19842: checking for db" >&5
19842 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
19843   echo $ac_n "(cached) $ac_c" 1>&6
19844 else
19845   
19846         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
19847                 ol_cv_gdbm=no
19848         else
19849                 ol_cv_gdbm=yes
19850         fi
19851
19852 fi
19853
19854 echo "$ac_t""$ol_cv_gdbm" 1>&6
19855  if test $ol_cv_gdbm = yes ; then
19856         cat >> confdefs.h <<\EOF
19857 #define HAVE_GDBM 1
19858 EOF
19859
19860  fi
19861
19862
19863         if test $ol_cv_gdbm = yes ; then
19864                 ol_link_ldbm=gdbm
19865                 ol_with_ldbm_api=gdbm
19866
19867                 if test $ol_cv_lib_gdbm != yes ; then
19868                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
19869                 fi
19870         fi
19871 fi
19872
19873 if test $ol_with_ldbm_api = ndbm ; then
19874         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
19875 echo "configure:19876: checking for NDBM library" >&5
19876 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
19877   echo $ac_n "(cached) $ac_c" 1>&6
19878 else
19879         ol_LIBS="$LIBS"
19880         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
19881 echo "configure:19882: checking for dbm_open" >&5
19882 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
19883   echo $ac_n "(cached) $ac_c" 1>&6
19884 else
19885   cat > conftest.$ac_ext <<EOF
19886 #line 19887 "configure"
19887 #include "confdefs.h"
19888 /* System header to define __stub macros and hopefully few prototypes,
19889     which can conflict with char dbm_open(); below.  */
19890 #include <assert.h>
19891 /* Override any gcc2 internal prototype to avoid an error.  */
19892 /* We use char because int might match the return type of a gcc2
19893     builtin and then its argument prototype would still apply.  */
19894 char dbm_open();
19895 char (*f)();
19896
19897 int main() {
19898
19899 /* The GNU C library defines this for functions which it implements
19900     to always fail with ENOSYS.  Some functions are actually named
19901     something starting with __ and the normal name is an alias.  */
19902 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
19903 choke me
19904 #else
19905 f = dbm_open;
19906 #endif
19907
19908 ; return 0; }
19909 EOF
19910 if { (eval echo configure:19911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19911   rm -rf conftest*
19912   eval "ac_cv_func_dbm_open=yes"
19913 else
19914   echo "configure: failed program was:" >&5
19915   cat conftest.$ac_ext >&5
19916   rm -rf conftest*
19917   eval "ac_cv_func_dbm_open=no"
19918 fi
19919 rm -f conftest*
19920 fi
19921
19922 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
19923   echo "$ac_t""yes" 1>&6
19924   ol_cv_lib_ndbm=yes
19925 else
19926   echo "$ac_t""no" 1>&6
19927
19928                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
19929 echo "configure:19930: checking for dbm_open in -lndbm" >&5
19930 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
19931 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19932   echo $ac_n "(cached) $ac_c" 1>&6
19933 else
19934   ac_save_LIBS="$LIBS"
19935 LIBS="-lndbm  $LIBS"
19936 cat > conftest.$ac_ext <<EOF
19937 #line 19938 "configure"
19938 #include "confdefs.h"
19939 /* Override any gcc2 internal prototype to avoid an error.  */
19940 /* We use char because int might match the return type of a gcc2
19941     builtin and then its argument prototype would still apply.  */
19942 char dbm_open();
19943
19944 int main() {
19945 dbm_open()
19946 ; return 0; }
19947 EOF
19948 if { (eval echo configure:19949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19949   rm -rf conftest*
19950   eval "ac_cv_lib_$ac_lib_var=yes"
19951 else
19952   echo "configure: failed program was:" >&5
19953   cat conftest.$ac_ext >&5
19954   rm -rf conftest*
19955   eval "ac_cv_lib_$ac_lib_var=no"
19956 fi
19957 rm -f conftest*
19958 LIBS="$ac_save_LIBS"
19959
19960 fi
19961 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19962   echo "$ac_t""yes" 1>&6
19963   ol_cv_lib_ndbm=-lndbm
19964 else
19965   echo "$ac_t""no" 1>&6
19966
19967                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
19968 echo "configure:19969: checking for dbm_open in -ldbm" >&5
19969 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
19970 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19971   echo $ac_n "(cached) $ac_c" 1>&6
19972 else
19973   ac_save_LIBS="$LIBS"
19974 LIBS="-ldbm  $LIBS"
19975 cat > conftest.$ac_ext <<EOF
19976 #line 19977 "configure"
19977 #include "confdefs.h"
19978 /* Override any gcc2 internal prototype to avoid an error.  */
19979 /* We use char because int might match the return type of a gcc2
19980     builtin and then its argument prototype would still apply.  */
19981 char dbm_open();
19982
19983 int main() {
19984 dbm_open()
19985 ; return 0; }
19986 EOF
19987 if { (eval echo configure:19988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19988   rm -rf conftest*
19989   eval "ac_cv_lib_$ac_lib_var=yes"
19990 else
19991   echo "configure: failed program was:" >&5
19992   cat conftest.$ac_ext >&5
19993   rm -rf conftest*
19994   eval "ac_cv_lib_$ac_lib_var=no"
19995 fi
19996 rm -f conftest*
19997 LIBS="$ac_save_LIBS"
19998
19999 fi
20000 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20001   echo "$ac_t""yes" 1>&6
20002   ol_cv_lib_ndbm=-ldbm
20003 else
20004   echo "$ac_t""no" 1>&6
20005 ol_cv_lib_ndbm=no
20006 fi
20007                 
20008 fi
20009
20010         
20011 fi
20012
20013         LIBS="$ol_LIBS"
20014
20015 fi
20016
20017 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
20018
20019
20020  for ac_hdr in ndbm.h
20021 do
20022 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20023 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20024 echo "configure:20025: checking for $ac_hdr" >&5
20025 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20026   echo $ac_n "(cached) $ac_c" 1>&6
20027 else
20028   cat > conftest.$ac_ext <<EOF
20029 #line 20030 "configure"
20030 #include "confdefs.h"
20031 #include <$ac_hdr>
20032 EOF
20033 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20034 { (eval echo configure:20035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20035 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20036 if test -z "$ac_err"; then
20037   rm -rf conftest*
20038   eval "ac_cv_header_$ac_safe=yes"
20039 else
20040   echo "$ac_err" >&5
20041   echo "configure: failed program was:" >&5
20042   cat conftest.$ac_ext >&5
20043   rm -rf conftest*
20044   eval "ac_cv_header_$ac_safe=no"
20045 fi
20046 rm -f conftest*
20047 fi
20048 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20049   echo "$ac_t""yes" 1>&6
20050     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20051   cat >> confdefs.h <<EOF
20052 #define $ac_tr_hdr 1
20053 EOF
20054  
20055 else
20056   echo "$ac_t""no" 1>&6
20057 fi
20058 done
20059
20060  echo $ac_n "checking for db""... $ac_c" 1>&6
20061 echo "configure:20062: checking for db" >&5
20062 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
20063   echo $ac_n "(cached) $ac_c" 1>&6
20064 else
20065   
20066         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
20067                 ol_cv_ndbm=no
20068         else
20069                 ol_cv_ndbm=yes
20070         fi
20071
20072 fi
20073
20074 echo "$ac_t""$ol_cv_ndbm" 1>&6
20075  if test $ol_cv_ndbm = yes ; then
20076         cat >> confdefs.h <<\EOF
20077 #define HAVE_NDBM 1
20078 EOF
20079
20080  fi
20081
20082
20083         if test $ol_cv_ndbm = yes ; then
20084                 ol_link_ldbm=ndbm
20085                 ol_with_ldbm_api=ndbm
20086
20087                 if test $ol_cv_lib_ndbm != yes ; then
20088                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
20089                 fi
20090         fi
20091 fi
20092
20093 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
20094         echo "configure: warning: could not find suitable LDBM backend" 1>&2
20095         if test $ol_enable_ldbm = yes ; then
20096                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
20097         fi
20098
20099         echo "configure: warning: disabling LDBM" 1>&2
20100         ol_enable_ldbm=no
20101 fi
20102
20103 if test $ol_enable_bdb = yes -o \
20104         $ol_enable_hdb = yes -o \
20105         $ol_enable_ldbm = yes ; then
20106         SLAPD_LIBS="$SLAPD_LIBS \$(LDBM_LIBS)"
20107 fi
20108
20109
20110 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
20111         BUILD_LIBS_DYNAMIC=shared
20112         cat >> confdefs.h <<\EOF
20113 #define LDAP_LIBS_DYNAMIC 1
20114 EOF
20115
20116         LTSTATIC=""
20117 else
20118         BUILD_LIBS_DYNAMIC=static
20119         LTSTATIC="-static"
20120 fi
20121
20122 if test $ol_enable_wrappers != no ; then
20123         for ac_hdr in tcpd.h
20124 do
20125 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20126 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20127 echo "configure:20128: checking for $ac_hdr" >&5
20128 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20129   echo $ac_n "(cached) $ac_c" 1>&6
20130 else
20131   cat > conftest.$ac_ext <<EOF
20132 #line 20133 "configure"
20133 #include "confdefs.h"
20134 #include <$ac_hdr>
20135 EOF
20136 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20137 { (eval echo configure:20138: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20138 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20139 if test -z "$ac_err"; then
20140   rm -rf conftest*
20141   eval "ac_cv_header_$ac_safe=yes"
20142 else
20143   echo "$ac_err" >&5
20144   echo "configure: failed program was:" >&5
20145   cat conftest.$ac_ext >&5
20146   rm -rf conftest*
20147   eval "ac_cv_header_$ac_safe=no"
20148 fi
20149 rm -f conftest*
20150 fi
20151 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20152   echo "$ac_t""yes" 1>&6
20153     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20154   cat >> confdefs.h <<EOF
20155 #define $ac_tr_hdr 1
20156 EOF
20157  
20158                 echo $ac_n "checking for TCP wrappers library""... $ac_c" 1>&6
20159 echo "configure:20160: checking for TCP wrappers library" >&5
20160                 save_LIBS="$LIBS"
20161                 LIBS="$LIBS -lwrap"
20162                 cat > conftest.$ac_ext <<EOF
20163 #line 20164 "configure"
20164 #include "confdefs.h"
20165
20166 #include <tcpd.h>
20167 int allow_severity = 0;
20168 int deny_severity  = 0;
20169
20170 struct request_info *req;
20171                 
20172 int main() {
20173
20174 hosts_access(req)
20175                 
20176 ; return 0; }
20177 EOF
20178 if { (eval echo configure:20179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20179   rm -rf conftest*
20180   echo "$ac_t""-lwrap" 1>&6
20181                 have_wrappers=yes
20182                 LIBS="$save_LIBS"
20183 else
20184   echo "configure: failed program was:" >&5
20185   cat conftest.$ac_ext >&5
20186   rm -rf conftest*
20187   
20188                                 LIBS="$LIBS -lnsl"
20189                 cat > conftest.$ac_ext <<EOF
20190 #line 20191 "configure"
20191 #include "confdefs.h"
20192
20193 #include <tcpd.h>
20194 int allow_severity = 0;
20195 int deny_severity  = 0;
20196
20197 struct request_info *req;
20198                 
20199 int main() {
20200
20201 hosts_access(req)
20202                 
20203 ; return 0; }
20204 EOF
20205 if { (eval echo configure:20206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20206   rm -rf conftest*
20207   echo "$ac_t""-lwrap -lnsl" 1>&6
20208                 have_wrappers=yes
20209                 LIBS="$save_LIBS -lnsl"
20210 else
20211   echo "configure: failed program was:" >&5
20212   cat conftest.$ac_ext >&5
20213   rm -rf conftest*
20214   
20215                 echo "$ac_t""no" 1>&6
20216                 have_wrappers=no
20217                 LIBS=$save_LIBS
20218 fi
20219 rm -f conftest*
20220 fi
20221 rm -f conftest*
20222 else
20223   echo "$ac_t""no" 1>&6
20224 have_wrappers=no
20225 fi
20226 done
20227
20228
20229         if test $have_wrappers = yes ; then
20230                 cat >> confdefs.h <<\EOF
20231 #define HAVE_TCPD 1
20232 EOF
20233
20234                 WRAP_LIBS="-lwrap"
20235         elif test $ol_enable_wrappers = yes ; then
20236                 { echo "configure: error: could not find TCP wrappers, select apppropriate options or disable" 1>&2; exit 1; }
20237         else
20238                 echo "configure: warning: could not find TCP wrappers, support disabled" 1>&2
20239                 WRAP_LIBS=""
20240         fi
20241 fi
20242
20243 if test $ol_enable_syslog != no ; then
20244         echo $ac_n "checking for openlog""... $ac_c" 1>&6
20245 echo "configure:20246: checking for openlog" >&5
20246 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
20247   echo $ac_n "(cached) $ac_c" 1>&6
20248 else
20249   cat > conftest.$ac_ext <<EOF
20250 #line 20251 "configure"
20251 #include "confdefs.h"
20252 /* System header to define __stub macros and hopefully few prototypes,
20253     which can conflict with char openlog(); below.  */
20254 #include <assert.h>
20255 /* Override any gcc2 internal prototype to avoid an error.  */
20256 /* We use char because int might match the return type of a gcc2
20257     builtin and then its argument prototype would still apply.  */
20258 char openlog();
20259 char (*f)();
20260
20261 int main() {
20262
20263 /* The GNU C library defines this for functions which it implements
20264     to always fail with ENOSYS.  Some functions are actually named
20265     something starting with __ and the normal name is an alias.  */
20266 #if defined (__stub_openlog) || defined (__stub___openlog)
20267 choke me
20268 #else
20269 f = openlog;
20270 #endif
20271
20272 ; return 0; }
20273 EOF
20274 if { (eval echo configure:20275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20275   rm -rf conftest*
20276   eval "ac_cv_func_openlog=yes"
20277 else
20278   echo "configure: failed program was:" >&5
20279   cat conftest.$ac_ext >&5
20280   rm -rf conftest*
20281   eval "ac_cv_func_openlog=no"
20282 fi
20283 rm -f conftest*
20284 fi
20285
20286 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
20287   echo "$ac_t""yes" 1>&6
20288   :
20289 else
20290   echo "$ac_t""no" 1>&6
20291 fi
20292
20293         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
20294                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
20295         fi
20296         ol_enable_syslog=$ac_cv_func_openlog
20297 fi
20298
20299
20300 ol_link_sql=no
20301 if test $ol_enable_sql != no ; then
20302         for ac_hdr in sql.h sqlext.h
20303 do
20304 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20305 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20306 echo "configure:20307: checking for $ac_hdr" >&5
20307 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20308   echo $ac_n "(cached) $ac_c" 1>&6
20309 else
20310   cat > conftest.$ac_ext <<EOF
20311 #line 20312 "configure"
20312 #include "confdefs.h"
20313 #include <$ac_hdr>
20314 EOF
20315 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20316 { (eval echo configure:20317: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20317 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20318 if test -z "$ac_err"; then
20319   rm -rf conftest*
20320   eval "ac_cv_header_$ac_safe=yes"
20321 else
20322   echo "$ac_err" >&5
20323   echo "configure: failed program was:" >&5
20324   cat conftest.$ac_ext >&5
20325   rm -rf conftest*
20326   eval "ac_cv_header_$ac_safe=no"
20327 fi
20328 rm -f conftest*
20329 fi
20330 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20331   echo "$ac_t""yes" 1>&6
20332     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20333   cat >> confdefs.h <<EOF
20334 #define $ac_tr_hdr 1
20335 EOF
20336  
20337 else
20338   echo "$ac_t""no" 1>&6
20339 { echo "configure: error: could not locate SQL headers" 1>&2; exit 1; }
20340         
20341 fi
20342 done
20343
20344
20345         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
20346 echo "configure:20347: checking for SQLDriverConnect in -liodbc" >&5
20347 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
20348 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20349   echo $ac_n "(cached) $ac_c" 1>&6
20350 else
20351   ac_save_LIBS="$LIBS"
20352 LIBS="-liodbc  $LIBS"
20353 cat > conftest.$ac_ext <<EOF
20354 #line 20355 "configure"
20355 #include "confdefs.h"
20356 /* Override any gcc2 internal prototype to avoid an error.  */
20357 /* We use char because int might match the return type of a gcc2
20358     builtin and then its argument prototype would still apply.  */
20359 char SQLDriverConnect();
20360
20361 int main() {
20362 SQLDriverConnect()
20363 ; return 0; }
20364 EOF
20365 if { (eval echo configure:20366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20366   rm -rf conftest*
20367   eval "ac_cv_lib_$ac_lib_var=yes"
20368 else
20369   echo "configure: failed program was:" >&5
20370   cat conftest.$ac_ext >&5
20371   rm -rf conftest*
20372   eval "ac_cv_lib_$ac_lib_var=no"
20373 fi
20374 rm -f conftest*
20375 LIBS="$ac_save_LIBS"
20376
20377 fi
20378 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20379   echo "$ac_t""yes" 1>&6
20380   have_iodbc=yes
20381 else
20382   echo "$ac_t""no" 1>&6
20383 have_iodbc=no
20384 fi
20385
20386         if test $have_iodbc = yes ; then
20387                 ol_link_sql="-liodbc"
20388         else
20389                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
20390 echo "configure:20391: checking for SQLDriverConnect in -lodbc" >&5
20391 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
20392 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20393   echo $ac_n "(cached) $ac_c" 1>&6
20394 else
20395   ac_save_LIBS="$LIBS"
20396 LIBS="-lodbc  $LIBS"
20397 cat > conftest.$ac_ext <<EOF
20398 #line 20399 "configure"
20399 #include "confdefs.h"
20400 /* Override any gcc2 internal prototype to avoid an error.  */
20401 /* We use char because int might match the return type of a gcc2
20402     builtin and then its argument prototype would still apply.  */
20403 char SQLDriverConnect();
20404
20405 int main() {
20406 SQLDriverConnect()
20407 ; return 0; }
20408 EOF
20409 if { (eval echo configure:20410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20410   rm -rf conftest*
20411   eval "ac_cv_lib_$ac_lib_var=yes"
20412 else
20413   echo "configure: failed program was:" >&5
20414   cat conftest.$ac_ext >&5
20415   rm -rf conftest*
20416   eval "ac_cv_lib_$ac_lib_var=no"
20417 fi
20418 rm -f conftest*
20419 LIBS="$ac_save_LIBS"
20420
20421 fi
20422 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20423   echo "$ac_t""yes" 1>&6
20424   have_odbc=yes
20425 else
20426   echo "$ac_t""no" 1>&6
20427 have_odbc=no
20428 fi
20429
20430                 if test $have_odbc = yes ; then
20431                         ol_link_sql="-lodbc"
20432                 fi
20433         fi
20434
20435         if test $ol_link_sql != no ; then
20436                 SLAPD_SQL_LIBS="$ol_link_sql"
20437
20438         elif test $ol_enable_sql != auto ; then
20439                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
20440         fi
20441 fi
20442
20443 ol_link_sasl=no
20444 ol_link_spasswd=no
20445 if test $ol_with_cyrus_sasl != no ; then
20446         for ac_hdr in sasl/sasl.h sasl.h
20447 do
20448 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20449 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20450 echo "configure:20451: checking for $ac_hdr" >&5
20451 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20452   echo $ac_n "(cached) $ac_c" 1>&6
20453 else
20454   cat > conftest.$ac_ext <<EOF
20455 #line 20456 "configure"
20456 #include "confdefs.h"
20457 #include <$ac_hdr>
20458 EOF
20459 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20460 { (eval echo configure:20461: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20461 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20462 if test -z "$ac_err"; then
20463   rm -rf conftest*
20464   eval "ac_cv_header_$ac_safe=yes"
20465 else
20466   echo "$ac_err" >&5
20467   echo "configure: failed program was:" >&5
20468   cat conftest.$ac_ext >&5
20469   rm -rf conftest*
20470   eval "ac_cv_header_$ac_safe=no"
20471 fi
20472 rm -f conftest*
20473 fi
20474 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20475   echo "$ac_t""yes" 1>&6
20476     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20477   cat >> confdefs.h <<EOF
20478 #define $ac_tr_hdr 1
20479 EOF
20480  
20481 else
20482   echo "$ac_t""no" 1>&6
20483 fi
20484 done
20485
20486
20487         if test $ac_cv_header_sasl_sasl_h = yes -o $ac_cv_header_sasl_h = yes; then
20488                 echo $ac_n "checking for sasl_client_init in -lsasl2""... $ac_c" 1>&6
20489 echo "configure:20490: checking for sasl_client_init in -lsasl2" >&5
20490 ac_lib_var=`echo sasl2'_'sasl_client_init | sed 'y%./+-:%__p__%'`
20491 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20492   echo $ac_n "(cached) $ac_c" 1>&6
20493 else
20494   ac_save_LIBS="$LIBS"
20495 LIBS="-lsasl2  $LIBS"
20496 cat > conftest.$ac_ext <<EOF
20497 #line 20498 "configure"
20498 #include "confdefs.h"
20499 /* Override any gcc2 internal prototype to avoid an error.  */
20500 /* We use char because int might match the return type of a gcc2
20501     builtin and then its argument prototype would still apply.  */
20502 char sasl_client_init();
20503
20504 int main() {
20505 sasl_client_init()
20506 ; return 0; }
20507 EOF
20508 if { (eval echo configure:20509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20509   rm -rf conftest*
20510   eval "ac_cv_lib_$ac_lib_var=yes"
20511 else
20512   echo "configure: failed program was:" >&5
20513   cat conftest.$ac_ext >&5
20514   rm -rf conftest*
20515   eval "ac_cv_lib_$ac_lib_var=no"
20516 fi
20517 rm -f conftest*
20518 LIBS="$ac_save_LIBS"
20519
20520 fi
20521 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20522   echo "$ac_t""yes" 1>&6
20523   ol_link_sasl="-lsasl2"
20524 else
20525   echo "$ac_t""no" 1>&6
20526 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
20527 echo "configure:20528: checking for sasl_client_init in -lsasl" >&5
20528 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
20529 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20530   echo $ac_n "(cached) $ac_c" 1>&6
20531 else
20532   ac_save_LIBS="$LIBS"
20533 LIBS="-lsasl  $LIBS"
20534 cat > conftest.$ac_ext <<EOF
20535 #line 20536 "configure"
20536 #include "confdefs.h"
20537 /* Override any gcc2 internal prototype to avoid an error.  */
20538 /* We use char because int might match the return type of a gcc2
20539     builtin and then its argument prototype would still apply.  */
20540 char sasl_client_init();
20541
20542 int main() {
20543 sasl_client_init()
20544 ; return 0; }
20545 EOF
20546 if { (eval echo configure:20547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20547   rm -rf conftest*
20548   eval "ac_cv_lib_$ac_lib_var=yes"
20549 else
20550   echo "configure: failed program was:" >&5
20551   cat conftest.$ac_ext >&5
20552   rm -rf conftest*
20553   eval "ac_cv_lib_$ac_lib_var=no"
20554 fi
20555 rm -f conftest*
20556 LIBS="$ac_save_LIBS"
20557
20558 fi
20559 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20560   echo "$ac_t""yes" 1>&6
20561   ol_link_sasl="-lsasl"
20562 else
20563   echo "$ac_t""no" 1>&6
20564 fi
20565
20566 fi
20567
20568         fi
20569
20570         if test $ol_link_sasl = no ; then
20571                 if test $ol_with_cyrus_sasl != auto ; then
20572                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
20573                 else
20574                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
20575                         echo "configure: warning: SASL authentication not supported!" 1>&2
20576                         if test $ol_link_tls = no ; then
20577                                 echo "configure: warning: Strong authentication not supported!" 1>&2
20578                         fi
20579                 fi
20580         else
20581                 echo $ac_n "checking Cyrus SASL library version""... $ac_c" 1>&6
20582 echo "configure:20583: checking Cyrus SASL library version" >&5
20583 if eval "test \"\${ol_cv_sasl_compat+set}\" = set"; then
20584   echo $ac_n "(cached) $ac_c" 1>&6
20585 else
20586   
20587         cat > conftest.$ac_ext <<EOF
20588 #line 20589 "configure"
20589 #include "confdefs.h"
20590
20591 #ifdef HAVE_SASL_SASL_H
20592 #include <sasl/sasl.h>
20593 #else
20594 #include <sasl.h>
20595 #endif
20596
20597 /* Require 2.1.15+ */
20598 #if SASL_VERSION_MAJOR == 2  && SASL_VERSION_MINOR > 1
20599         char *__sasl_compat = "2.2+ or better okay (we guess)";
20600 #elif SASL_VERSION_MAJOR == 2  && SASL_VERSION_MINOR == 1 \
20601         && SASL_VERSION_STEP >=15
20602         char *__sasl_compat = "2.1.15+ or better okay";
20603 #endif
20604         
20605 EOF
20606 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20607   egrep "__sasl_compat" >/dev/null 2>&1; then
20608   rm -rf conftest*
20609   ol_cv_sasl_compat=yes
20610 else
20611   rm -rf conftest*
20612   ol_cv_sasl_compat=no
20613 fi
20614 rm -f conftest*
20615
20616 fi
20617
20618 echo "$ac_t""$ol_cv_sasl_compat" 1>&6
20619
20620                 if test $ol_cv_sasl_compat = no ; then
20621                         ol_link_sasl=no
20622                         { echo "configure: error: Cyrus SASL library located but is incompatible" 1>&2; exit 1; }
20623                 fi
20624
20625                 cat >> confdefs.h <<\EOF
20626 #define HAVE_CYRUS_SASL 1
20627 EOF
20628
20629                 SASL_LIBS="$ol_link_sasl"
20630                 if test $ol_enable_spasswd != no ; then
20631                         ol_link_spasswd=yes
20632                 fi
20633
20634                 ac_save_LIBS="$LIBS"
20635                 LIBS="$LIBS $ol_link_sasl"
20636                 echo $ac_n "checking for sasl_version""... $ac_c" 1>&6
20637 echo "configure:20638: checking for sasl_version" >&5
20638 if eval "test \"\${ac_cv_func_sasl_version+set}\" = set"; then
20639   echo $ac_n "(cached) $ac_c" 1>&6
20640 else
20641   cat > conftest.$ac_ext <<EOF
20642 #line 20643 "configure"
20643 #include "confdefs.h"
20644 /* System header to define __stub macros and hopefully few prototypes,
20645     which can conflict with char sasl_version(); below.  */
20646 #include <assert.h>
20647 /* Override any gcc2 internal prototype to avoid an error.  */
20648 /* We use char because int might match the return type of a gcc2
20649     builtin and then its argument prototype would still apply.  */
20650 char sasl_version();
20651 char (*f)();
20652
20653 int main() {
20654
20655 /* The GNU C library defines this for functions which it implements
20656     to always fail with ENOSYS.  Some functions are actually named
20657     something starting with __ and the normal name is an alias.  */
20658 #if defined (__stub_sasl_version) || defined (__stub___sasl_version)
20659 choke me
20660 #else
20661 f = sasl_version;
20662 #endif
20663
20664 ; return 0; }
20665 EOF
20666 if { (eval echo configure:20667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20667   rm -rf conftest*
20668   eval "ac_cv_func_sasl_version=yes"
20669 else
20670   echo "configure: failed program was:" >&5
20671   cat conftest.$ac_ext >&5
20672   rm -rf conftest*
20673   eval "ac_cv_func_sasl_version=no"
20674 fi
20675 rm -f conftest*
20676 fi
20677
20678 if eval "test \"`echo '$ac_cv_func_'sasl_version`\" = yes"; then
20679   echo "$ac_t""yes" 1>&6
20680   cat >> confdefs.h <<\EOF
20681 #define HAVE_SASL_VERSION 1
20682 EOF
20683
20684 else
20685   echo "$ac_t""no" 1>&6
20686 fi
20687
20688                 LIBS="$ac_save_LIBS"
20689         fi
20690
20691 else
20692         echo "configure: warning: SASL authentication not supported!" 1>&2
20693         if test $ol_link_tls = no ; then
20694                 echo "configure: warning: Strong authentication not supported!" 1>&2
20695         fi
20696 fi
20697
20698 if test $cross_compiling != yes -a "$ac_cv_mingw32" != yes ; then
20699         dev=no
20700         if test -r /dev/urandom ; then
20701                 dev="/dev/urandom";
20702         elif test -r /idev/urandom ; then
20703                 dev="/idev/urandom";
20704         elif test -r /dev/srandom ; then
20705                 dev="/dev/srandom";
20706         elif test -r /dev/random ; then
20707                 dev="/dev/random";
20708         elif test -r /idev/random ; then
20709                 dev="/idev/random";
20710         fi
20711
20712         if test $dev != no ; then
20713                 cat >> confdefs.h <<EOF
20714 #define URANDOM_DEVICE "$dev"
20715 EOF
20716
20717         fi
20718 fi
20719
20720 ol_link_fetch=no
20721 if test $ol_with_fetch != no ; then
20722         ol_LIBS=$LIBS
20723 LIBS="-lfetch -lcom_err $LIBS"
20724 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
20725 echo "configure:20726: checking fetch(3) library" >&5
20726 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
20727   echo $ac_n "(cached) $ac_c" 1>&6
20728 else
20729   
20730         cat > conftest.$ac_ext <<EOF
20731 #line 20732 "configure"
20732 #include "confdefs.h"
20733
20734 #include <sys/param.h>
20735 #include <stdio.h>
20736 #include <fetch.h>
20737 int main() {
20738 struct url *u = fetchParseURL("file:///"); 
20739 ; return 0; }
20740 EOF
20741 if { (eval echo configure:20742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20742   rm -rf conftest*
20743   ol_cv_lib_fetch=yes
20744 else
20745   echo "configure: failed program was:" >&5
20746   cat conftest.$ac_ext >&5
20747   rm -rf conftest*
20748   ol_cv_lib_fetch=no
20749 fi
20750 rm -f conftest*
20751 fi
20752
20753 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
20754 LIBS=$ol_LIBS
20755 if test $ol_cv_lib_fetch != no ; then
20756         ol_link_fetch="-lfetch -lcom_err"
20757         cat >> confdefs.h <<\EOF
20758 #define HAVE_FETCH 1
20759 EOF
20760
20761 fi
20762
20763
20764         if test $ol_cv_lib_fetch != no ; then
20765                 LUTIL_LIBS="$LUTIL_LIBS $ol_link_fetch"
20766                 ol_link_fetch=freebsd
20767
20768         elif test $ol_with_fetch != auto ; then
20769                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
20770         fi 
20771 fi
20772
20773 if test $ol_enable_crypt != no ; then
20774         save_LIBS="$LIBS"
20775         LIBS="$TLS_LIBS $LIBS"
20776
20777         echo $ac_n "checking for crypt""... $ac_c" 1>&6
20778 echo "configure:20779: checking for crypt" >&5
20779 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
20780   echo $ac_n "(cached) $ac_c" 1>&6
20781 else
20782   cat > conftest.$ac_ext <<EOF
20783 #line 20784 "configure"
20784 #include "confdefs.h"
20785 /* System header to define __stub macros and hopefully few prototypes,
20786     which can conflict with char crypt(); below.  */
20787 #include <assert.h>
20788 /* Override any gcc2 internal prototype to avoid an error.  */
20789 /* We use char because int might match the return type of a gcc2
20790     builtin and then its argument prototype would still apply.  */
20791 char crypt();
20792 char (*f)();
20793
20794 int main() {
20795
20796 /* The GNU C library defines this for functions which it implements
20797     to always fail with ENOSYS.  Some functions are actually named
20798     something starting with __ and the normal name is an alias.  */
20799 #if defined (__stub_crypt) || defined (__stub___crypt)
20800 choke me
20801 #else
20802 f = crypt;
20803 #endif
20804
20805 ; return 0; }
20806 EOF
20807 if { (eval echo configure:20808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20808   rm -rf conftest*
20809   eval "ac_cv_func_crypt=yes"
20810 else
20811   echo "configure: failed program was:" >&5
20812   cat conftest.$ac_ext >&5
20813   rm -rf conftest*
20814   eval "ac_cv_func_crypt=no"
20815 fi
20816 rm -f conftest*
20817 fi
20818
20819 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
20820   echo "$ac_t""yes" 1>&6
20821   have_crypt=yes
20822 else
20823   echo "$ac_t""no" 1>&6
20824
20825                 LIBS="$save_LIBS"
20826                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
20827 echo "configure:20828: checking for crypt in -lcrypt" >&5
20828 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
20829 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20830   echo $ac_n "(cached) $ac_c" 1>&6
20831 else
20832   ac_save_LIBS="$LIBS"
20833 LIBS="-lcrypt  $LIBS"
20834 cat > conftest.$ac_ext <<EOF
20835 #line 20836 "configure"
20836 #include "confdefs.h"
20837 /* Override any gcc2 internal prototype to avoid an error.  */
20838 /* We use char because int might match the return type of a gcc2
20839     builtin and then its argument prototype would still apply.  */
20840 char crypt();
20841
20842 int main() {
20843 crypt()
20844 ; return 0; }
20845 EOF
20846 if { (eval echo configure:20847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20847   rm -rf conftest*
20848   eval "ac_cv_lib_$ac_lib_var=yes"
20849 else
20850   echo "configure: failed program was:" >&5
20851   cat conftest.$ac_ext >&5
20852   rm -rf conftest*
20853   eval "ac_cv_lib_$ac_lib_var=no"
20854 fi
20855 rm -f conftest*
20856 LIBS="$ac_save_LIBS"
20857
20858 fi
20859 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20860   echo "$ac_t""yes" 1>&6
20861   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
20862                         have_crypt=yes
20863 else
20864   echo "$ac_t""no" 1>&6
20865 have_crypt=no
20866 fi
20867
20868 fi
20869
20870
20871         LIBS="$save_LIBS"
20872
20873         if test $have_crypt = yes ; then
20874                 cat >> confdefs.h <<\EOF
20875 #define HAVE_CRYPT 1
20876 EOF
20877
20878         else
20879                 echo "configure: warning: could not find crypt" 1>&2
20880                 if test $ol_enable_crypt = yes ; then
20881                         { echo "configure: error: could not find crypt, select appropriate options or disable" 1>&2; exit 1; }
20882                 fi
20883
20884                 echo "configure: warning: disabling crypt support" 1>&2
20885                 ol_enable_crypt=no
20886         fi
20887 fi
20888
20889 if test $ol_enable_proctitle != no ; then
20890         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
20891 echo "configure:20892: checking for setproctitle" >&5
20892 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
20893   echo $ac_n "(cached) $ac_c" 1>&6
20894 else
20895   cat > conftest.$ac_ext <<EOF
20896 #line 20897 "configure"
20897 #include "confdefs.h"
20898 /* System header to define __stub macros and hopefully few prototypes,
20899     which can conflict with char setproctitle(); below.  */
20900 #include <assert.h>
20901 /* Override any gcc2 internal prototype to avoid an error.  */
20902 /* We use char because int might match the return type of a gcc2
20903     builtin and then its argument prototype would still apply.  */
20904 char setproctitle();
20905 char (*f)();
20906
20907 int main() {
20908
20909 /* The GNU C library defines this for functions which it implements
20910     to always fail with ENOSYS.  Some functions are actually named
20911     something starting with __ and the normal name is an alias.  */
20912 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
20913 choke me
20914 #else
20915 f = setproctitle;
20916 #endif
20917
20918 ; return 0; }
20919 EOF
20920 if { (eval echo configure:20921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20921   rm -rf conftest*
20922   eval "ac_cv_func_setproctitle=yes"
20923 else
20924   echo "configure: failed program was:" >&5
20925   cat conftest.$ac_ext >&5
20926   rm -rf conftest*
20927   eval "ac_cv_func_setproctitle=no"
20928 fi
20929 rm -f conftest*
20930 fi
20931
20932 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
20933   echo "$ac_t""yes" 1>&6
20934   have_setproctitle=yes
20935 else
20936   echo "$ac_t""no" 1>&6
20937
20938                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
20939 echo "configure:20940: checking for setproctitle in -lutil" >&5
20940 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
20941 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20942   echo $ac_n "(cached) $ac_c" 1>&6
20943 else
20944   ac_save_LIBS="$LIBS"
20945 LIBS="-lutil  $LIBS"
20946 cat > conftest.$ac_ext <<EOF
20947 #line 20948 "configure"
20948 #include "confdefs.h"
20949 /* Override any gcc2 internal prototype to avoid an error.  */
20950 /* We use char because int might match the return type of a gcc2
20951     builtin and then its argument prototype would still apply.  */
20952 char setproctitle();
20953
20954 int main() {
20955 setproctitle()
20956 ; return 0; }
20957 EOF
20958 if { (eval echo configure:20959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20959   rm -rf conftest*
20960   eval "ac_cv_lib_$ac_lib_var=yes"
20961 else
20962   echo "configure: failed program was:" >&5
20963   cat conftest.$ac_ext >&5
20964   rm -rf conftest*
20965   eval "ac_cv_lib_$ac_lib_var=no"
20966 fi
20967 rm -f conftest*
20968 LIBS="$ac_save_LIBS"
20969
20970 fi
20971 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20972   echo "$ac_t""yes" 1>&6
20973   have_setproctitle=yes
20974                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
20975 else
20976   echo "$ac_t""no" 1>&6
20977 have_setproctitle=no
20978                         LIBOBJS="$LIBOBJS setproctitle.o"
20979                         LIBSRCS="$LIBSRCS setproctitle.c"
20980 fi
20981
20982 fi
20983
20984
20985         if test $have_setproctitle = yes ; then
20986                 cat >> confdefs.h <<\EOF
20987 #define HAVE_SETPROCTITLE 1
20988 EOF
20989
20990         fi
20991 fi
20992
20993 if test $ol_enable_slp != no ; then
20994         for ac_hdr in slp.h 
20995 do
20996 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20997 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20998 echo "configure:20999: checking for $ac_hdr" >&5
20999 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
21000   echo $ac_n "(cached) $ac_c" 1>&6
21001 else
21002   cat > conftest.$ac_ext <<EOF
21003 #line 21004 "configure"
21004 #include "confdefs.h"
21005 #include <$ac_hdr>
21006 EOF
21007 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
21008 { (eval echo configure:21009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
21009 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
21010 if test -z "$ac_err"; then
21011   rm -rf conftest*
21012   eval "ac_cv_header_$ac_safe=yes"
21013 else
21014   echo "$ac_err" >&5
21015   echo "configure: failed program was:" >&5
21016   cat conftest.$ac_ext >&5
21017   rm -rf conftest*
21018   eval "ac_cv_header_$ac_safe=no"
21019 fi
21020 rm -f conftest*
21021 fi
21022 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
21023   echo "$ac_t""yes" 1>&6
21024     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
21025   cat >> confdefs.h <<EOF
21026 #define $ac_tr_hdr 1
21027 EOF
21028  
21029 else
21030   echo "$ac_t""no" 1>&6
21031 fi
21032 done
21033
21034
21035         if test $ac_cv_header_slp_h = yes ; then
21036                 echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
21037 echo "configure:21038: checking for SLPOpen in -lslp" >&5
21038 ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-:%__p__%'`
21039 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
21040   echo $ac_n "(cached) $ac_c" 1>&6
21041 else
21042   ac_save_LIBS="$LIBS"
21043 LIBS="-lslp  $LIBS"
21044 cat > conftest.$ac_ext <<EOF
21045 #line 21046 "configure"
21046 #include "confdefs.h"
21047 /* Override any gcc2 internal prototype to avoid an error.  */
21048 /* We use char because int might match the return type of a gcc2
21049     builtin and then its argument prototype would still apply.  */
21050 char SLPOpen();
21051
21052 int main() {
21053 SLPOpen()
21054 ; return 0; }
21055 EOF
21056 if { (eval echo configure:21057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21057   rm -rf conftest*
21058   eval "ac_cv_lib_$ac_lib_var=yes"
21059 else
21060   echo "configure: failed program was:" >&5
21061   cat conftest.$ac_ext >&5
21062   rm -rf conftest*
21063   eval "ac_cv_lib_$ac_lib_var=no"
21064 fi
21065 rm -f conftest*
21066 LIBS="$ac_save_LIBS"
21067
21068 fi
21069 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
21070   echo "$ac_t""yes" 1>&6
21071   have_slp=yes
21072 else
21073   echo "$ac_t""no" 1>&6
21074 have_slp=no
21075 fi
21076
21077                 if test $have_slp = yes ; then
21078                         cat >> confdefs.h <<\EOF
21079 #define HAVE_SLP 1
21080 EOF
21081
21082                         SLAPD_SLP_LIBS=-lslp
21083                 fi
21084
21085         elif test $ol_enable_slp = yes ; then
21086                 { echo "configure: error: SLP not found" 1>&2; exit 1; }
21087         fi
21088 fi
21089
21090
21091 echo $ac_n "checking long long""... $ac_c" 1>&6
21092 echo "configure:21093: checking long long" >&5
21093 if eval "test \"\${ol_cv_type_long_long+set}\" = set"; then
21094   echo $ac_n "(cached) $ac_c" 1>&6
21095 else
21096   
21097         cat > conftest.$ac_ext <<EOF
21098 #line 21099 "configure"
21099 #include "confdefs.h"
21100
21101 int main() {
21102 long long x;
21103 ; return 0; }
21104 EOF
21105 if { (eval echo configure:21106: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21106   rm -rf conftest*
21107   ol_cv_type_long_long=yes
21108 else
21109   echo "configure: failed program was:" >&5
21110   cat conftest.$ac_ext >&5
21111   rm -rf conftest*
21112   ol_cv_type_long_long=no
21113 fi
21114 rm -f conftest*
21115 fi
21116
21117 echo "$ac_t""$ol_cv_type_long_long" 1>&6
21118 if test $ol_cv_type_long_long = yes; then
21119         cat >> confdefs.h <<\EOF
21120 #define HAVE_LONG_LONG 1
21121 EOF
21122
21123 fi
21124
21125 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
21126 echo "configure:21127: checking for ANSI C header files" >&5
21127 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
21128   echo $ac_n "(cached) $ac_c" 1>&6
21129 else
21130   cat > conftest.$ac_ext <<EOF
21131 #line 21132 "configure"
21132 #include "confdefs.h"
21133 #include <stdlib.h>
21134 #include <stdarg.h>
21135 #include <string.h>
21136 #include <float.h>
21137 EOF
21138 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
21139 { (eval echo configure:21140: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
21140 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
21141 if test -z "$ac_err"; then
21142   rm -rf conftest*
21143   ac_cv_header_stdc=yes
21144 else
21145   echo "$ac_err" >&5
21146   echo "configure: failed program was:" >&5
21147   cat conftest.$ac_ext >&5
21148   rm -rf conftest*
21149   ac_cv_header_stdc=no
21150 fi
21151 rm -f conftest*
21152
21153 if test $ac_cv_header_stdc = yes; then
21154   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
21155 cat > conftest.$ac_ext <<EOF
21156 #line 21157 "configure"
21157 #include "confdefs.h"
21158 #include <string.h>
21159 EOF
21160 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21161   egrep "memchr" >/dev/null 2>&1; then
21162   :
21163 else
21164   rm -rf conftest*
21165   ac_cv_header_stdc=no
21166 fi
21167 rm -f conftest*
21168
21169 fi
21170
21171 if test $ac_cv_header_stdc = yes; then
21172   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
21173 cat > conftest.$ac_ext <<EOF
21174 #line 21175 "configure"
21175 #include "confdefs.h"
21176 #include <stdlib.h>
21177 EOF
21178 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21179   egrep "free" >/dev/null 2>&1; then
21180   :
21181 else
21182   rm -rf conftest*
21183   ac_cv_header_stdc=no
21184 fi
21185 rm -f conftest*
21186
21187 fi
21188
21189 if test $ac_cv_header_stdc = yes; then
21190   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
21191 if test "$cross_compiling" = yes; then
21192   :
21193 else
21194   cat > conftest.$ac_ext <<EOF
21195 #line 21196 "configure"
21196 #include "confdefs.h"
21197 #include <ctype.h>
21198 #if ((' ' & 0x0FF) == 0x020)
21199 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
21200 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
21201 #else
21202 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
21203  || ('j' <= (c) && (c) <= 'r') \
21204  || ('s' <= (c) && (c) <= 'z'))
21205 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
21206 #endif
21207 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
21208 int main () { int i; for (i = 0; i < 256; i++)
21209 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
21210 exit (0); }
21211
21212 EOF
21213 if { (eval echo configure:21214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
21214 then
21215   :
21216 else
21217   echo "configure: failed program was:" >&5
21218   cat conftest.$ac_ext >&5
21219   rm -fr conftest*
21220   ac_cv_header_stdc=no
21221 fi
21222 rm -fr conftest*
21223 fi
21224
21225 fi
21226 fi
21227
21228 echo "$ac_t""$ac_cv_header_stdc" 1>&6
21229 if test $ac_cv_header_stdc = yes; then
21230   cat >> confdefs.h <<\EOF
21231 #define STDC_HEADERS 1
21232 EOF
21233
21234 fi
21235
21236 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
21237 echo "configure:21238: checking for mode_t" >&5
21238 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
21239   echo $ac_n "(cached) $ac_c" 1>&6
21240 else
21241   cat > conftest.$ac_ext <<EOF
21242 #line 21243 "configure"
21243 #include "confdefs.h"
21244 #include <sys/types.h>
21245 #if STDC_HEADERS
21246 #include <stdlib.h>
21247 #include <stddef.h>
21248 #endif
21249
21250 EOF
21251 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21252   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21253   rm -rf conftest*
21254   eval "ac_cv_type_mode_t=yes"
21255 else
21256   rm -rf conftest*
21257   eval "ac_cv_type_mode_t=no"
21258 fi
21259 rm -f conftest*
21260
21261 fi
21262 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
21263   echo "$ac_t""yes" 1>&6
21264 else
21265   echo "$ac_t""no" 1>&6
21266   cat >> confdefs.h <<EOF
21267 #define mode_t int
21268 EOF
21269
21270 fi
21271
21272 echo $ac_n "checking for off_t""... $ac_c" 1>&6
21273 echo "configure:21274: checking for off_t" >&5
21274 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
21275   echo $ac_n "(cached) $ac_c" 1>&6
21276 else
21277   cat > conftest.$ac_ext <<EOF
21278 #line 21279 "configure"
21279 #include "confdefs.h"
21280 #include <sys/types.h>
21281 #if STDC_HEADERS
21282 #include <stdlib.h>
21283 #include <stddef.h>
21284 #endif
21285
21286 EOF
21287 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21288   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21289   rm -rf conftest*
21290   eval "ac_cv_type_off_t=yes"
21291 else
21292   rm -rf conftest*
21293   eval "ac_cv_type_off_t=no"
21294 fi
21295 rm -f conftest*
21296
21297 fi
21298 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
21299   echo "$ac_t""yes" 1>&6
21300 else
21301   echo "$ac_t""no" 1>&6
21302   cat >> confdefs.h <<EOF
21303 #define off_t long
21304 EOF
21305
21306 fi
21307
21308 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
21309 echo "configure:21310: checking for pid_t" >&5
21310 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
21311   echo $ac_n "(cached) $ac_c" 1>&6
21312 else
21313   cat > conftest.$ac_ext <<EOF
21314 #line 21315 "configure"
21315 #include "confdefs.h"
21316 #include <sys/types.h>
21317 #if STDC_HEADERS
21318 #include <stdlib.h>
21319 #include <stddef.h>
21320 #endif
21321
21322 EOF
21323 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21324   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21325   rm -rf conftest*
21326   eval "ac_cv_type_pid_t=yes"
21327 else
21328   rm -rf conftest*
21329   eval "ac_cv_type_pid_t=no"
21330 fi
21331 rm -f conftest*
21332
21333 fi
21334 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
21335   echo "$ac_t""yes" 1>&6
21336 else
21337   echo "$ac_t""no" 1>&6
21338   cat >> confdefs.h <<EOF
21339 #define pid_t int
21340 EOF
21341
21342 fi
21343
21344 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
21345 echo "configure:21346: checking for ptrdiff_t" >&5
21346 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
21347   echo $ac_n "(cached) $ac_c" 1>&6
21348 else
21349   cat > conftest.$ac_ext <<EOF
21350 #line 21351 "configure"
21351 #include "confdefs.h"
21352 #include <stddef.h>
21353 int main() {
21354 ptrdiff_t p
21355 ; return 0; }
21356 EOF
21357 if { (eval echo configure:21358: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21358   rm -rf conftest*
21359   am_cv_type_ptrdiff_t=yes
21360 else
21361   echo "configure: failed program was:" >&5
21362   cat conftest.$ac_ext >&5
21363   rm -rf conftest*
21364   am_cv_type_ptrdiff_t=no
21365 fi
21366 rm -f conftest*
21367 fi
21368
21369 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
21370    if test $am_cv_type_ptrdiff_t = yes; then
21371      cat >> confdefs.h <<\EOF
21372 #define HAVE_PTRDIFF_T 1
21373 EOF
21374
21375    fi
21376
21377 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
21378 echo "configure:21379: checking return type of signal handlers" >&5
21379 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
21380   echo $ac_n "(cached) $ac_c" 1>&6
21381 else
21382   cat > conftest.$ac_ext <<EOF
21383 #line 21384 "configure"
21384 #include "confdefs.h"
21385 #include <sys/types.h>
21386 #include <signal.h>
21387 #ifdef signal
21388 #undef signal
21389 #endif
21390 #ifdef __cplusplus
21391 extern "C" void (*signal (int, void (*)(int)))(int);
21392 #else
21393 void (*signal ()) ();
21394 #endif
21395
21396 int main() {
21397 int i;
21398 ; return 0; }
21399 EOF
21400 if { (eval echo configure:21401: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21401   rm -rf conftest*
21402   ac_cv_type_signal=void
21403 else
21404   echo "configure: failed program was:" >&5
21405   cat conftest.$ac_ext >&5
21406   rm -rf conftest*
21407   ac_cv_type_signal=int
21408 fi
21409 rm -f conftest*
21410 fi
21411
21412 echo "$ac_t""$ac_cv_type_signal" 1>&6
21413 cat >> confdefs.h <<EOF
21414 #define RETSIGTYPE $ac_cv_type_signal
21415 EOF
21416
21417
21418 echo $ac_n "checking for size_t""... $ac_c" 1>&6
21419 echo "configure:21420: checking for size_t" >&5
21420 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
21421   echo $ac_n "(cached) $ac_c" 1>&6
21422 else
21423   cat > conftest.$ac_ext <<EOF
21424 #line 21425 "configure"
21425 #include "confdefs.h"
21426 #include <sys/types.h>
21427 #if STDC_HEADERS
21428 #include <stdlib.h>
21429 #include <stddef.h>
21430 #endif
21431
21432 EOF
21433 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21434   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21435   rm -rf conftest*
21436   eval "ac_cv_type_size_t=yes"
21437 else
21438   rm -rf conftest*
21439   eval "ac_cv_type_size_t=no"
21440 fi
21441 rm -f conftest*
21442
21443 fi
21444 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
21445   echo "$ac_t""yes" 1>&6
21446 else
21447   echo "$ac_t""no" 1>&6
21448   cat >> confdefs.h <<EOF
21449 #define size_t unsigned
21450 EOF
21451
21452 fi
21453
21454
21455 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
21456 echo "configure:21457: checking for ssize_t" >&5
21457 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
21458   echo $ac_n "(cached) $ac_c" 1>&6
21459 else
21460   cat > conftest.$ac_ext <<EOF
21461 #line 21462 "configure"
21462 #include "confdefs.h"
21463 #include <sys/types.h>
21464 #if STDC_HEADERS
21465 #include <stdlib.h>
21466 #include <stddef.h>
21467 #endif
21468
21469 EOF
21470 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21471   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21472   rm -rf conftest*
21473   eval "ac_cv_type_ssize_t=yes"
21474 else
21475   rm -rf conftest*
21476   eval "ac_cv_type_ssize_t=no"
21477 fi
21478 rm -f conftest*
21479
21480 fi
21481 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
21482   echo "$ac_t""yes" 1>&6
21483 else
21484   echo "$ac_t""no" 1>&6
21485   cat >> confdefs.h <<EOF
21486 #define ssize_t signed int
21487 EOF
21488
21489 fi
21490
21491 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
21492 echo "configure:21493: checking for caddr_t" >&5
21493 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
21494   echo $ac_n "(cached) $ac_c" 1>&6
21495 else
21496   cat > conftest.$ac_ext <<EOF
21497 #line 21498 "configure"
21498 #include "confdefs.h"
21499 #include <sys/types.h>
21500 #if STDC_HEADERS
21501 #include <stdlib.h>
21502 #include <stddef.h>
21503 #endif
21504
21505 EOF
21506 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21507   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21508   rm -rf conftest*
21509   eval "ac_cv_type_caddr_t=yes"
21510 else
21511   rm -rf conftest*
21512   eval "ac_cv_type_caddr_t=no"
21513 fi
21514 rm -f conftest*
21515
21516 fi
21517 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
21518   echo "$ac_t""yes" 1>&6
21519 else
21520   echo "$ac_t""no" 1>&6
21521   cat >> confdefs.h <<EOF
21522 #define caddr_t char *
21523 EOF
21524
21525 fi
21526
21527
21528 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
21529 echo "configure:21530: checking for socklen_t" >&5
21530 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
21531   echo $ac_n "(cached) $ac_c" 1>&6
21532 else
21533   cat > conftest.$ac_ext <<EOF
21534 #line 21535 "configure"
21535 #include "confdefs.h"
21536
21537 #ifdef HAVE_SYS_TYPES_H
21538 #include <sys/types.h>
21539 #endif
21540 #ifdef HAVE_SYS_SOCKET_H
21541 #include <sys/socket.h>
21542 #endif
21543
21544 int main() {
21545 socklen_t len;
21546 ; return 0; }
21547 EOF
21548 if { (eval echo configure:21549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21549   rm -rf conftest*
21550   ol_cv_type_socklen_t=yes
21551 else
21552   echo "configure: failed program was:" >&5
21553   cat conftest.$ac_ext >&5
21554   rm -rf conftest*
21555   ol_cv_type_socklen_t=no
21556 fi
21557 rm -f conftest*
21558 fi
21559
21560 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
21561   if test $ol_cv_type_socklen_t = no; then
21562     cat >> confdefs.h <<\EOF
21563 #define socklen_t int
21564 EOF
21565
21566   fi
21567  
21568 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
21569 echo "configure:21570: checking for member st_blksize in aggregate type struct stat" >&5
21570 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
21571   echo $ac_n "(cached) $ac_c" 1>&6
21572 else
21573   cat > conftest.$ac_ext <<EOF
21574 #line 21575 "configure"
21575 #include "confdefs.h"
21576 #include <sys/types.h>
21577 #include <sys/stat.h>
21578 int main() {
21579 struct stat foo; foo.st_blksize;
21580 ; return 0; }
21581 EOF
21582 if { (eval echo configure:21583: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21583   rm -rf conftest*
21584   ac_cv_c_struct_member_st_blksize=yes
21585 else
21586   echo "configure: failed program was:" >&5
21587   cat conftest.$ac_ext >&5
21588   rm -rf conftest*
21589   ac_cv_c_struct_member_st_blksize=no
21590 fi
21591 rm -f conftest*
21592 fi
21593
21594 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
21595 st_blksize="$ac_cv_c_struct_member_st_blksize"
21596 if test $ac_cv_c_struct_member_st_blksize = yes; then
21597   cat >> confdefs.h <<\EOF
21598 #define HAVE_ST_BLKSIZE 1
21599 EOF
21600
21601 fi
21602
21603 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
21604 echo "configure:21605: checking whether time.h and sys/time.h may both be included" >&5
21605 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
21606   echo $ac_n "(cached) $ac_c" 1>&6
21607 else
21608   cat > conftest.$ac_ext <<EOF
21609 #line 21610 "configure"
21610 #include "confdefs.h"
21611 #include <sys/types.h>
21612 #include <sys/time.h>
21613 #include <time.h>
21614 int main() {
21615 struct tm *tp;
21616 ; return 0; }
21617 EOF
21618 if { (eval echo configure:21619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21619   rm -rf conftest*
21620   ac_cv_header_time=yes
21621 else
21622   echo "configure: failed program was:" >&5
21623   cat conftest.$ac_ext >&5
21624   rm -rf conftest*
21625   ac_cv_header_time=no
21626 fi
21627 rm -f conftest*
21628 fi
21629
21630 echo "$ac_t""$ac_cv_header_time" 1>&6
21631 if test $ac_cv_header_time = yes; then
21632   cat >> confdefs.h <<\EOF
21633 #define TIME_WITH_SYS_TIME 1
21634 EOF
21635
21636 fi
21637
21638 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
21639 echo "configure:21640: checking whether struct tm is in sys/time.h or time.h" >&5
21640 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
21641   echo $ac_n "(cached) $ac_c" 1>&6
21642 else
21643   cat > conftest.$ac_ext <<EOF
21644 #line 21645 "configure"
21645 #include "confdefs.h"
21646 #include <sys/types.h>
21647 #include <time.h>
21648 int main() {
21649 struct tm *tp; tp->tm_sec;
21650 ; return 0; }
21651 EOF
21652 if { (eval echo configure:21653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21653   rm -rf conftest*
21654   ac_cv_struct_tm=time.h
21655 else
21656   echo "configure: failed program was:" >&5
21657   cat conftest.$ac_ext >&5
21658   rm -rf conftest*
21659   ac_cv_struct_tm=sys/time.h
21660 fi
21661 rm -f conftest*
21662 fi
21663
21664 echo "$ac_t""$ac_cv_struct_tm" 1>&6
21665 if test $ac_cv_struct_tm = sys/time.h; then
21666   cat >> confdefs.h <<\EOF
21667 #define TM_IN_SYS_TIME 1
21668 EOF
21669
21670 fi
21671
21672 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
21673 echo "configure:21674: checking for uid_t in sys/types.h" >&5
21674 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
21675   echo $ac_n "(cached) $ac_c" 1>&6
21676 else
21677   cat > conftest.$ac_ext <<EOF
21678 #line 21679 "configure"
21679 #include "confdefs.h"
21680 #include <sys/types.h>
21681 EOF
21682 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21683   egrep "uid_t" >/dev/null 2>&1; then
21684   rm -rf conftest*
21685   ac_cv_type_uid_t=yes
21686 else
21687   rm -rf conftest*
21688   ac_cv_type_uid_t=no
21689 fi
21690 rm -f conftest*
21691
21692 fi
21693
21694 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
21695 if test $ac_cv_type_uid_t = no; then
21696   cat >> confdefs.h <<\EOF
21697 #define uid_t int
21698 EOF
21699
21700   cat >> confdefs.h <<\EOF
21701 #define gid_t int
21702 EOF
21703
21704 fi
21705
21706 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
21707 echo "configure:21708: checking for sig_atomic_t" >&5
21708 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
21709   echo $ac_n "(cached) $ac_c" 1>&6
21710 else
21711   cat > conftest.$ac_ext <<EOF
21712 #line 21713 "configure"
21713 #include "confdefs.h"
21714 #include <signal.h>
21715 int main() {
21716 sig_atomic_t atomic;
21717 ; return 0; }
21718 EOF
21719 if { (eval echo configure:21720: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21720   rm -rf conftest*
21721   ol_cv_type_sig_atomic_t=yes
21722 else
21723   echo "configure: failed program was:" >&5
21724   cat conftest.$ac_ext >&5
21725   rm -rf conftest*
21726   ol_cv_type_sig_atomic_t=no
21727 fi
21728 rm -f conftest*
21729 fi
21730
21731 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
21732   if test $ol_cv_type_sig_atomic_t = no; then
21733     cat >> confdefs.h <<\EOF
21734 #define sig_atomic_t int
21735 EOF
21736
21737   fi
21738  
21739
21740
21741 # test for pw_gecos in struct passwd
21742 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
21743 echo "configure:21744: checking struct passwd for pw_gecos" >&5
21744 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
21745   echo $ac_n "(cached) $ac_c" 1>&6
21746 else
21747   
21748         cat > conftest.$ac_ext <<EOF
21749 #line 21750 "configure"
21750 #include "confdefs.h"
21751 #include <pwd.h>
21752 int main() {
21753
21754         struct passwd pwd;
21755         pwd.pw_gecos = pwd.pw_name;
21756
21757 ; return 0; }
21758 EOF
21759 if { (eval echo configure:21760: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21760   rm -rf conftest*
21761   ol_cv_struct_passwd_pw_gecos=yes
21762 else
21763   echo "configure: failed program was:" >&5
21764   cat conftest.$ac_ext >&5
21765   rm -rf conftest*
21766   ol_cv_struct_passwd_pw_gecos=no
21767 fi
21768 rm -f conftest*
21769 fi
21770
21771 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
21772 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
21773         cat >> confdefs.h <<\EOF
21774 #define HAVE_PW_GECOS 1
21775 EOF
21776
21777 fi
21778
21779 # test for pw_passwd in struct passwd
21780 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
21781 echo "configure:21782: checking struct passwd for pw_passwd" >&5
21782 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
21783   echo $ac_n "(cached) $ac_c" 1>&6
21784 else
21785   
21786         cat > conftest.$ac_ext <<EOF
21787 #line 21788 "configure"
21788 #include "confdefs.h"
21789 #include <pwd.h>
21790 int main() {
21791
21792         struct passwd pwd;
21793         pwd.pw_passwd = pwd.pw_name;
21794
21795 ; return 0; }
21796 EOF
21797 if { (eval echo configure:21798: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21798   rm -rf conftest*
21799   ol_cv_struct_passwd_pw_passwd=yes
21800 else
21801   echo "configure: failed program was:" >&5
21802   cat conftest.$ac_ext >&5
21803   rm -rf conftest*
21804   ol_cv_struct_passwd_pw_passwd=no
21805 fi
21806 rm -f conftest*
21807 fi
21808
21809 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
21810 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
21811         cat >> confdefs.h <<\EOF
21812 #define HAVE_PW_PASSWD 1
21813 EOF
21814
21815 fi
21816
21817
21818 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
21819 echo "configure:21820: checking if toupper() requires islower()" >&5
21820 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
21821   echo $ac_n "(cached) $ac_c" 1>&6
21822 else
21823   
21824         if test "$cross_compiling" = yes; then
21825   ol_cv_c_upper_lower=safe
21826 else
21827   cat > conftest.$ac_ext <<EOF
21828 #line 21829 "configure"
21829 #include "confdefs.h"
21830
21831 #include <ctype.h>
21832 main()
21833 {
21834         if ('C' == toupper('C'))
21835                 exit(0);
21836         else
21837                 exit(1);
21838 }
21839 EOF
21840 if { (eval echo configure:21841: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
21841 then
21842   ol_cv_c_upper_lower=no
21843 else
21844   echo "configure: failed program was:" >&5
21845   cat conftest.$ac_ext >&5
21846   rm -fr conftest*
21847   ol_cv_c_upper_lower=yes
21848 fi
21849 rm -fr conftest*
21850 fi
21851
21852 fi
21853
21854 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
21855 if test $ol_cv_c_upper_lower != no ; then
21856         cat >> confdefs.h <<\EOF
21857 #define C_UPPER_LOWER 1
21858 EOF
21859
21860 fi
21861
21862 echo $ac_n "checking for working const""... $ac_c" 1>&6
21863 echo "configure:21864: checking for working const" >&5
21864 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
21865   echo $ac_n "(cached) $ac_c" 1>&6
21866 else
21867   cat > conftest.$ac_ext <<EOF
21868 #line 21869 "configure"
21869 #include "confdefs.h"
21870
21871 int main() {
21872
21873 /* Ultrix mips cc rejects this.  */
21874 typedef int charset[2]; const charset x;
21875 /* SunOS 4.1.1 cc rejects this.  */
21876 char const *const *ccp;
21877 char **p;
21878 /* NEC SVR4.0.2 mips cc rejects this.  */
21879 struct point {int x, y;};
21880 static struct point const zero = {0,0};
21881 /* AIX XL C 1.02.0.0 rejects this.
21882    It does not let you subtract one const X* pointer from another in an arm
21883    of an if-expression whose if-part is not a constant expression */
21884 const char *g = "string";
21885 ccp = &g + (g ? g-g : 0);
21886 /* HPUX 7.0 cc rejects these. */
21887 ++ccp;
21888 p = (char**) ccp;
21889 ccp = (char const *const *) p;
21890 { /* SCO 3.2v4 cc rejects this.  */
21891   char *t;
21892   char const *s = 0 ? (char *) 0 : (char const *) 0;
21893
21894   *t++ = 0;
21895 }
21896 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
21897   int x[] = {25, 17};
21898   const int *foo = &x[0];
21899   ++foo;
21900 }
21901 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
21902   typedef const int *iptr;
21903   iptr p = 0;
21904   ++p;
21905 }
21906 { /* AIX XL C 1.02.0.0 rejects this saying
21907      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
21908   struct s { int j; const int *ap[3]; };
21909   struct s *b; b->j = 5;
21910 }
21911 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
21912   const int foo = 10;
21913 }
21914
21915 ; return 0; }
21916 EOF
21917 if { (eval echo configure:21918: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21918   rm -rf conftest*
21919   ac_cv_c_const=yes
21920 else
21921   echo "configure: failed program was:" >&5
21922   cat conftest.$ac_ext >&5
21923   rm -rf conftest*
21924   ac_cv_c_const=no
21925 fi
21926 rm -f conftest*
21927 fi
21928
21929 echo "$ac_t""$ac_cv_c_const" 1>&6
21930 if test $ac_cv_c_const = no; then
21931   cat >> confdefs.h <<\EOF
21932 #define const 
21933 EOF
21934
21935 fi
21936
21937 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
21938 echo "configure:21939: checking if compiler understands volatile" >&5
21939 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
21940   echo $ac_n "(cached) $ac_c" 1>&6
21941 else
21942   cat > conftest.$ac_ext <<EOF
21943 #line 21944 "configure"
21944 #include "confdefs.h"
21945 int x, y, z;
21946 int main() {
21947 volatile int a; int * volatile b = x ? &y : &z;
21948       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
21949       *b = 0;
21950 ; return 0; }
21951 EOF
21952 if { (eval echo configure:21953: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21953   rm -rf conftest*
21954   ol_cv_c_volatile=yes
21955 else
21956   echo "configure: failed program was:" >&5
21957   cat conftest.$ac_ext >&5
21958   rm -rf conftest*
21959   ol_cv_c_volatile=no
21960 fi
21961 rm -f conftest*
21962 fi
21963
21964 echo "$ac_t""$ol_cv_c_volatile" 1>&6
21965   if test $ol_cv_c_volatile = yes; then
21966     : 
21967   else
21968     cat >> confdefs.h <<\EOF
21969 #define volatile 
21970 EOF
21971
21972   fi
21973  
21974
21975 if test $cross_compiling = yes ; then
21976         echo "configure: warning: Crossing compiling... all bets are off!" 1>&2
21977         cat >> confdefs.h <<\EOF
21978 #define CROSS_COMPILING 1
21979 EOF
21980
21981 else
21982         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
21983 echo "configure:21984: checking whether byte ordering is bigendian" >&5
21984 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
21985   echo $ac_n "(cached) $ac_c" 1>&6
21986 else
21987   ac_cv_c_bigendian=unknown
21988 # See if sys/param.h defines the BYTE_ORDER macro.
21989 cat > conftest.$ac_ext <<EOF
21990 #line 21991 "configure"
21991 #include "confdefs.h"
21992 #include <sys/types.h>
21993 #include <sys/param.h>
21994 int main() {
21995
21996 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
21997  bogus endian macros
21998 #endif
21999 ; return 0; }
22000 EOF
22001 if { (eval echo configure:22002: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22002   rm -rf conftest*
22003   # It does; now see whether it defined to BIG_ENDIAN or not.
22004 cat > conftest.$ac_ext <<EOF
22005 #line 22006 "configure"
22006 #include "confdefs.h"
22007 #include <sys/types.h>
22008 #include <sys/param.h>
22009 int main() {
22010
22011 #if BYTE_ORDER != BIG_ENDIAN
22012  not big endian
22013 #endif
22014 ; return 0; }
22015 EOF
22016 if { (eval echo configure:22017: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22017   rm -rf conftest*
22018   ac_cv_c_bigendian=yes
22019 else
22020   echo "configure: failed program was:" >&5
22021   cat conftest.$ac_ext >&5
22022   rm -rf conftest*
22023   ac_cv_c_bigendian=no
22024 fi
22025 rm -f conftest*
22026 else
22027   echo "configure: failed program was:" >&5
22028   cat conftest.$ac_ext >&5
22029 fi
22030 rm -f conftest*
22031 if test $ac_cv_c_bigendian = unknown; then
22032 if test "$cross_compiling" = yes; then
22033     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
22034 else
22035   cat > conftest.$ac_ext <<EOF
22036 #line 22037 "configure"
22037 #include "confdefs.h"
22038 main () {
22039   /* Are we little or big endian?  From Harbison&Steele.  */
22040   union
22041   {
22042     long l;
22043     char c[sizeof (long)];
22044   } u;
22045   u.l = 1;
22046   exit (u.c[sizeof (long) - 1] == 1);
22047 }
22048 EOF
22049 if { (eval echo configure:22050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
22050 then
22051   ac_cv_c_bigendian=no
22052 else
22053   echo "configure: failed program was:" >&5
22054   cat conftest.$ac_ext >&5
22055   rm -fr conftest*
22056   ac_cv_c_bigendian=yes
22057 fi
22058 rm -fr conftest*
22059 fi
22060
22061 fi
22062 fi
22063
22064 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
22065 if test $ac_cv_c_bigendian = yes; then
22066   cat >> confdefs.h <<\EOF
22067 #define WORDS_BIGENDIAN 1
22068 EOF
22069
22070 fi
22071
22072 fi
22073
22074 echo $ac_n "checking size of short""... $ac_c" 1>&6
22075 echo "configure:22076: checking size of short" >&5 
22076 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
22077   echo $ac_n "(cached) $ac_c" 1>&6
22078 else
22079   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
22080   cat > conftest.$ac_ext <<EOF
22081 #line 22082 "configure"
22082 #include "confdefs.h"
22083 #include "confdefs.h" 
22084 #include <stdlib.h>
22085 #include <sys/types.h> 
22086  
22087
22088 int main() {
22089 switch (0) case 0: case (sizeof (short) == $ac_size):;
22090 ; return 0; }
22091 EOF
22092 if { (eval echo configure:22093: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22093   rm -rf conftest*
22094   ac_cv_sizeof_short=$ac_size
22095 else
22096   echo "configure: failed program was:" >&5
22097   cat conftest.$ac_ext >&5
22098 fi
22099 rm -f conftest* 
22100   if test x$ac_cv_sizeof_short != x ; then break; fi 
22101 done 
22102
22103 fi
22104  
22105 if test x$ac_cv_sizeof_short = x ; then 
22106   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
22107 fi 
22108 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
22109 cat >> confdefs.h <<EOF
22110 #define SIZEOF_SHORT $ac_cv_sizeof_short
22111 EOF
22112  
22113  
22114 echo $ac_n "checking size of int""... $ac_c" 1>&6
22115 echo "configure:22116: checking size of int" >&5 
22116 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
22117   echo $ac_n "(cached) $ac_c" 1>&6
22118 else
22119   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
22120   cat > conftest.$ac_ext <<EOF
22121 #line 22122 "configure"
22122 #include "confdefs.h"
22123 #include "confdefs.h" 
22124 #include <stdlib.h>
22125 #include <sys/types.h> 
22126  
22127
22128 int main() {
22129 switch (0) case 0: case (sizeof (int) == $ac_size):;
22130 ; return 0; }
22131 EOF
22132 if { (eval echo configure:22133: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22133   rm -rf conftest*
22134   ac_cv_sizeof_int=$ac_size
22135 else
22136   echo "configure: failed program was:" >&5
22137   cat conftest.$ac_ext >&5
22138 fi
22139 rm -f conftest* 
22140   if test x$ac_cv_sizeof_int != x ; then break; fi 
22141 done 
22142
22143 fi
22144  
22145 if test x$ac_cv_sizeof_int = x ; then 
22146   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
22147 fi 
22148 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
22149 cat >> confdefs.h <<EOF
22150 #define SIZEOF_INT $ac_cv_sizeof_int
22151 EOF
22152  
22153  
22154 echo $ac_n "checking size of long""... $ac_c" 1>&6
22155 echo "configure:22156: checking size of long" >&5 
22156 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
22157   echo $ac_n "(cached) $ac_c" 1>&6
22158 else
22159   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
22160   cat > conftest.$ac_ext <<EOF
22161 #line 22162 "configure"
22162 #include "confdefs.h"
22163 #include "confdefs.h" 
22164 #include <stdlib.h>
22165 #include <sys/types.h> 
22166  
22167
22168 int main() {
22169 switch (0) case 0: case (sizeof (long) == $ac_size):;
22170 ; return 0; }
22171 EOF
22172 if { (eval echo configure:22173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22173   rm -rf conftest*
22174   ac_cv_sizeof_long=$ac_size
22175 else
22176   echo "configure: failed program was:" >&5
22177   cat conftest.$ac_ext >&5
22178 fi
22179 rm -f conftest* 
22180   if test x$ac_cv_sizeof_long != x ; then break; fi 
22181 done 
22182
22183 fi
22184  
22185 if test x$ac_cv_sizeof_long = x ; then 
22186   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
22187 fi 
22188 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
22189 cat >> confdefs.h <<EOF
22190 #define SIZEOF_LONG $ac_cv_sizeof_long
22191 EOF
22192  
22193
22194 echo $ac_n "checking size of wchar_t""... $ac_c" 1>&6
22195 echo "configure:22196: checking size of wchar_t" >&5 
22196 if eval "test \"\${ac_cv_sizeof_wchar_t+set}\" = set"; then
22197   echo $ac_n "(cached) $ac_c" 1>&6
22198 else
22199   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
22200   cat > conftest.$ac_ext <<EOF
22201 #line 22202 "configure"
22202 #include "confdefs.h"
22203 #include "confdefs.h" 
22204 #include <stdlib.h>
22205 #include <sys/types.h> 
22206  
22207
22208 int main() {
22209 switch (0) case 0: case (sizeof (wchar_t) == $ac_size):;
22210 ; return 0; }
22211 EOF
22212 if { (eval echo configure:22213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22213   rm -rf conftest*
22214   ac_cv_sizeof_wchar_t=$ac_size
22215 else
22216   echo "configure: failed program was:" >&5
22217   cat conftest.$ac_ext >&5
22218 fi
22219 rm -f conftest* 
22220   if test x$ac_cv_sizeof_wchar_t != x ; then break; fi 
22221 done 
22222
22223 fi
22224  
22225 if test x$ac_cv_sizeof_wchar_t = x ; then 
22226   { echo "configure: error: cannot determine a size for wchar_t" 1>&2; exit 1; } 
22227 fi 
22228 echo "$ac_t""$ac_cv_sizeof_wchar_t" 1>&6 
22229 cat >> confdefs.h <<EOF
22230 #define SIZEOF_WCHAR_T $ac_cv_sizeof_wchar_t
22231 EOF
22232  
22233
22234
22235 if test "$ac_cv_sizeof_int" -lt 4 ; then
22236         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
22237
22238         cat >> confdefs.h <<\EOF
22239 #define LBER_INT_T long
22240 EOF
22241
22242 else
22243         cat >> confdefs.h <<\EOF
22244 #define LBER_INT_T int
22245 EOF
22246
22247 fi
22248
22249 cat >> confdefs.h <<\EOF
22250 #define LBER_LEN_T long
22251 EOF
22252
22253 cat >> confdefs.h <<\EOF
22254 #define LBER_SOCKET_T int
22255 EOF
22256
22257 cat >> confdefs.h <<\EOF
22258 #define LBER_TAG_T long
22259 EOF
22260
22261
22262 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
22263 echo "configure:22264: checking for 8-bit clean memcmp" >&5
22264 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
22265   echo $ac_n "(cached) $ac_c" 1>&6
22266 else
22267   if test "$cross_compiling" = yes; then
22268   ac_cv_func_memcmp_clean=no
22269 else
22270   cat > conftest.$ac_ext <<EOF
22271 #line 22272 "configure"
22272 #include "confdefs.h"
22273
22274 main()
22275 {
22276   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
22277   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
22278 }
22279
22280 EOF
22281 if { (eval echo configure:22282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
22282 then
22283   ac_cv_func_memcmp_clean=yes
22284 else
22285   echo "configure: failed program was:" >&5
22286   cat conftest.$ac_ext >&5
22287   rm -fr conftest*
22288   ac_cv_func_memcmp_clean=no
22289 fi
22290 rm -fr conftest*
22291 fi
22292
22293 fi
22294
22295 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
22296 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
22297
22298 echo $ac_n "checking for strftime""... $ac_c" 1>&6
22299 echo "configure:22300: checking for strftime" >&5
22300 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
22301   echo $ac_n "(cached) $ac_c" 1>&6
22302 else
22303   cat > conftest.$ac_ext <<EOF
22304 #line 22305 "configure"
22305 #include "confdefs.h"
22306 /* System header to define __stub macros and hopefully few prototypes,
22307     which can conflict with char strftime(); below.  */
22308 #include <assert.h>
22309 /* Override any gcc2 internal prototype to avoid an error.  */
22310 /* We use char because int might match the return type of a gcc2
22311     builtin and then its argument prototype would still apply.  */
22312 char strftime();
22313 char (*f)();
22314
22315 int main() {
22316
22317 /* The GNU C library defines this for functions which it implements
22318     to always fail with ENOSYS.  Some functions are actually named
22319     something starting with __ and the normal name is an alias.  */
22320 #if defined (__stub_strftime) || defined (__stub___strftime)
22321 choke me
22322 #else
22323 f = strftime;
22324 #endif
22325
22326 ; return 0; }
22327 EOF
22328 if { (eval echo configure:22329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22329   rm -rf conftest*
22330   eval "ac_cv_func_strftime=yes"
22331 else
22332   echo "configure: failed program was:" >&5
22333   cat conftest.$ac_ext >&5
22334   rm -rf conftest*
22335   eval "ac_cv_func_strftime=no"
22336 fi
22337 rm -f conftest*
22338 fi
22339
22340 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
22341   echo "$ac_t""yes" 1>&6
22342   cat >> confdefs.h <<\EOF
22343 #define HAVE_STRFTIME 1
22344 EOF
22345
22346 else
22347   echo "$ac_t""no" 1>&6
22348 # strftime is in -lintl on SCO UNIX.
22349 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
22350 echo "configure:22351: checking for strftime in -lintl" >&5
22351 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
22352 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
22353   echo $ac_n "(cached) $ac_c" 1>&6
22354 else
22355   ac_save_LIBS="$LIBS"
22356 LIBS="-lintl  $LIBS"
22357 cat > conftest.$ac_ext <<EOF
22358 #line 22359 "configure"
22359 #include "confdefs.h"
22360 /* Override any gcc2 internal prototype to avoid an error.  */
22361 /* We use char because int might match the return type of a gcc2
22362     builtin and then its argument prototype would still apply.  */
22363 char strftime();
22364
22365 int main() {
22366 strftime()
22367 ; return 0; }
22368 EOF
22369 if { (eval echo configure:22370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22370   rm -rf conftest*
22371   eval "ac_cv_lib_$ac_lib_var=yes"
22372 else
22373   echo "configure: failed program was:" >&5
22374   cat conftest.$ac_ext >&5
22375   rm -rf conftest*
22376   eval "ac_cv_lib_$ac_lib_var=no"
22377 fi
22378 rm -f conftest*
22379 LIBS="$ac_save_LIBS"
22380
22381 fi
22382 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
22383   echo "$ac_t""yes" 1>&6
22384   cat >> confdefs.h <<\EOF
22385 #define HAVE_STRFTIME 1
22386 EOF
22387
22388 LIBS="-lintl $LIBS"
22389 else
22390   echo "$ac_t""no" 1>&6
22391 fi
22392
22393 fi
22394
22395
22396 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
22397 echo "configure:22398: checking for inet_aton()" >&5
22398 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
22399   echo $ac_n "(cached) $ac_c" 1>&6
22400 else
22401   cat > conftest.$ac_ext <<EOF
22402 #line 22403 "configure"
22403 #include "confdefs.h"
22404
22405 #ifdef HAVE_SYS_TYPES_H
22406 #       include <sys/types.h>
22407 #endif
22408 #ifdef HAVE_SYS_SOCKET_H
22409 #       include <sys/socket.h>
22410 #       ifdef HAVE_SYS_SELECT_H
22411 #               include <sys/select.h>
22412 #       endif
22413 #       include <netinet/in.h>
22414 #       ifdef HAVE_ARPA_INET_H
22415 #               include <arpa/inet.h>
22416 #       endif
22417 #endif
22418
22419 int main() {
22420 struct in_addr in;
22421 int rc = inet_aton( "255.255.255.255", &in );
22422 ; return 0; }
22423 EOF
22424 if { (eval echo configure:22425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22425   rm -rf conftest*
22426   ol_cv_func_inet_aton=yes
22427 else
22428   echo "configure: failed program was:" >&5
22429   cat conftest.$ac_ext >&5
22430   rm -rf conftest*
22431   ol_cv_func_inet_aton=no
22432 fi
22433 rm -f conftest*
22434 fi
22435
22436 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
22437   if test $ol_cv_func_inet_aton != no; then
22438     cat >> confdefs.h <<\EOF
22439 #define HAVE_INET_ATON 1
22440 EOF
22441
22442   fi
22443  
22444
22445 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
22446 echo "configure:22447: checking for _spawnlp" >&5
22447 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
22448   echo $ac_n "(cached) $ac_c" 1>&6
22449 else
22450   cat > conftest.$ac_ext <<EOF
22451 #line 22452 "configure"
22452 #include "confdefs.h"
22453 /* System header to define __stub macros and hopefully few prototypes,
22454     which can conflict with char _spawnlp(); below.  */
22455 #include <assert.h>
22456 /* Override any gcc2 internal prototype to avoid an error.  */
22457 /* We use char because int might match the return type of a gcc2
22458     builtin and then its argument prototype would still apply.  */
22459 char _spawnlp();
22460 char (*f)();
22461
22462 int main() {
22463
22464 /* The GNU C library defines this for functions which it implements
22465     to always fail with ENOSYS.  Some functions are actually named
22466     something starting with __ and the normal name is an alias.  */
22467 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
22468 choke me
22469 #else
22470 f = _spawnlp;
22471 #endif
22472
22473 ; return 0; }
22474 EOF
22475 if { (eval echo configure:22476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22476   rm -rf conftest*
22477   eval "ac_cv_func__spawnlp=yes"
22478 else
22479   echo "configure: failed program was:" >&5
22480   cat conftest.$ac_ext >&5
22481   rm -rf conftest*
22482   eval "ac_cv_func__spawnlp=no"
22483 fi
22484 rm -f conftest*
22485 fi
22486
22487 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
22488   echo "$ac_t""yes" 1>&6
22489   cat >> confdefs.h <<\EOF
22490 #define HAVE_SPAWNLP 1
22491 EOF
22492
22493 else
22494   echo "$ac_t""no" 1>&6
22495 fi
22496
22497
22498 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
22499 echo "configure:22500: checking for _snprintf" >&5
22500 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
22501   echo $ac_n "(cached) $ac_c" 1>&6
22502 else
22503   cat > conftest.$ac_ext <<EOF
22504 #line 22505 "configure"
22505 #include "confdefs.h"
22506 /* System header to define __stub macros and hopefully few prototypes,
22507     which can conflict with char _snprintf(); below.  */
22508 #include <assert.h>
22509 /* Override any gcc2 internal prototype to avoid an error.  */
22510 /* We use char because int might match the return type of a gcc2
22511     builtin and then its argument prototype would still apply.  */
22512 char _snprintf();
22513 char (*f)();
22514
22515 int main() {
22516
22517 /* The GNU C library defines this for functions which it implements
22518     to always fail with ENOSYS.  Some functions are actually named
22519     something starting with __ and the normal name is an alias.  */
22520 #if defined (__stub__snprintf) || defined (__stub____snprintf)
22521 choke me
22522 #else
22523 f = _snprintf;
22524 #endif
22525
22526 ; return 0; }
22527 EOF
22528 if { (eval echo configure:22529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22529   rm -rf conftest*
22530   eval "ac_cv_func__snprintf=yes"
22531 else
22532   echo "configure: failed program was:" >&5
22533   cat conftest.$ac_ext >&5
22534   rm -rf conftest*
22535   eval "ac_cv_func__snprintf=no"
22536 fi
22537 rm -f conftest*
22538 fi
22539
22540 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
22541   echo "$ac_t""yes" 1>&6
22542   ac_cv_func_snprintf=yes
22543         cat >> confdefs.h <<\EOF
22544 #define snprintf _snprintf
22545 EOF
22546
22547
22548 else
22549   echo "$ac_t""no" 1>&6
22550 fi
22551
22552
22553 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
22554 echo "configure:22555: checking for _vsnprintf" >&5
22555 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
22556   echo $ac_n "(cached) $ac_c" 1>&6
22557 else
22558   cat > conftest.$ac_ext <<EOF
22559 #line 22560 "configure"
22560 #include "confdefs.h"
22561 /* System header to define __stub macros and hopefully few prototypes,
22562     which can conflict with char _vsnprintf(); below.  */
22563 #include <assert.h>
22564 /* Override any gcc2 internal prototype to avoid an error.  */
22565 /* We use char because int might match the return type of a gcc2
22566     builtin and then its argument prototype would still apply.  */
22567 char _vsnprintf();
22568 char (*f)();
22569
22570 int main() {
22571
22572 /* The GNU C library defines this for functions which it implements
22573     to always fail with ENOSYS.  Some functions are actually named
22574     something starting with __ and the normal name is an alias.  */
22575 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
22576 choke me
22577 #else
22578 f = _vsnprintf;
22579 #endif
22580
22581 ; return 0; }
22582 EOF
22583 if { (eval echo configure:22584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22584   rm -rf conftest*
22585   eval "ac_cv_func__vsnprintf=yes"
22586 else
22587   echo "configure: failed program was:" >&5
22588   cat conftest.$ac_ext >&5
22589   rm -rf conftest*
22590   eval "ac_cv_func__vsnprintf=no"
22591 fi
22592 rm -f conftest*
22593 fi
22594
22595 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
22596   echo "$ac_t""yes" 1>&6
22597   ac_cv_func_vsnprintf=yes
22598         cat >> confdefs.h <<\EOF
22599 #define vsnprintf _vsnprintf
22600 EOF
22601
22602
22603 else
22604   echo "$ac_t""no" 1>&6
22605 fi
22606
22607
22608 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
22609 echo "configure:22610: checking for vprintf" >&5
22610 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
22611   echo $ac_n "(cached) $ac_c" 1>&6
22612 else
22613   cat > conftest.$ac_ext <<EOF
22614 #line 22615 "configure"
22615 #include "confdefs.h"
22616 /* System header to define __stub macros and hopefully few prototypes,
22617     which can conflict with char vprintf(); below.  */
22618 #include <assert.h>
22619 /* Override any gcc2 internal prototype to avoid an error.  */
22620 /* We use char because int might match the return type of a gcc2
22621     builtin and then its argument prototype would still apply.  */
22622 char vprintf();
22623 char (*f)();
22624
22625 int main() {
22626
22627 /* The GNU C library defines this for functions which it implements
22628     to always fail with ENOSYS.  Some functions are actually named
22629     something starting with __ and the normal name is an alias.  */
22630 #if defined (__stub_vprintf) || defined (__stub___vprintf)
22631 choke me
22632 #else
22633 f = vprintf;
22634 #endif
22635
22636 ; return 0; }
22637 EOF
22638 if { (eval echo configure:22639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22639   rm -rf conftest*
22640   eval "ac_cv_func_vprintf=yes"
22641 else
22642   echo "configure: failed program was:" >&5
22643   cat conftest.$ac_ext >&5
22644   rm -rf conftest*
22645   eval "ac_cv_func_vprintf=no"
22646 fi
22647 rm -f conftest*
22648 fi
22649
22650 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
22651   echo "$ac_t""yes" 1>&6
22652   cat >> confdefs.h <<\EOF
22653 #define HAVE_VPRINTF 1
22654 EOF
22655
22656 else
22657   echo "$ac_t""no" 1>&6
22658 fi
22659
22660 if test "$ac_cv_func_vprintf" != yes; then
22661 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
22662 echo "configure:22663: checking for _doprnt" >&5
22663 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
22664   echo $ac_n "(cached) $ac_c" 1>&6
22665 else
22666   cat > conftest.$ac_ext <<EOF
22667 #line 22668 "configure"
22668 #include "confdefs.h"
22669 /* System header to define __stub macros and hopefully few prototypes,
22670     which can conflict with char _doprnt(); below.  */
22671 #include <assert.h>
22672 /* Override any gcc2 internal prototype to avoid an error.  */
22673 /* We use char because int might match the return type of a gcc2
22674     builtin and then its argument prototype would still apply.  */
22675 char _doprnt();
22676 char (*f)();
22677
22678 int main() {
22679
22680 /* The GNU C library defines this for functions which it implements
22681     to always fail with ENOSYS.  Some functions are actually named
22682     something starting with __ and the normal name is an alias.  */
22683 #if defined (__stub__doprnt) || defined (__stub____doprnt)
22684 choke me
22685 #else
22686 f = _doprnt;
22687 #endif
22688
22689 ; return 0; }
22690 EOF
22691 if { (eval echo configure:22692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22692   rm -rf conftest*
22693   eval "ac_cv_func__doprnt=yes"
22694 else
22695   echo "configure: failed program was:" >&5
22696   cat conftest.$ac_ext >&5
22697   rm -rf conftest*
22698   eval "ac_cv_func__doprnt=no"
22699 fi
22700 rm -f conftest*
22701 fi
22702
22703 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
22704   echo "$ac_t""yes" 1>&6
22705   cat >> confdefs.h <<\EOF
22706 #define HAVE_DOPRNT 1
22707 EOF
22708
22709 else
22710   echo "$ac_t""no" 1>&6
22711 fi
22712
22713 fi
22714
22715
22716 if test $ac_cv_func_vprintf = yes ; then
22717                 for ac_func in snprintf vsnprintf
22718 do
22719 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
22720 echo "configure:22721: checking for $ac_func" >&5
22721 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
22722   echo $ac_n "(cached) $ac_c" 1>&6
22723 else
22724   cat > conftest.$ac_ext <<EOF
22725 #line 22726 "configure"
22726 #include "confdefs.h"
22727 /* System header to define __stub macros and hopefully few prototypes,
22728     which can conflict with char $ac_func(); below.  */
22729 #include <assert.h>
22730 /* Override any gcc2 internal prototype to avoid an error.  */
22731 /* We use char because int might match the return type of a gcc2
22732     builtin and then its argument prototype would still apply.  */
22733 char $ac_func();
22734 char (*f)();
22735
22736 int main() {
22737
22738 /* The GNU C library defines this for functions which it implements
22739     to always fail with ENOSYS.  Some functions are actually named
22740     something starting with __ and the normal name is an alias.  */
22741 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
22742 choke me
22743 #else
22744 f = $ac_func;
22745 #endif
22746
22747 ; return 0; }
22748 EOF
22749 if { (eval echo configure:22750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22750   rm -rf conftest*
22751   eval "ac_cv_func_$ac_func=yes"
22752 else
22753   echo "configure: failed program was:" >&5
22754   cat conftest.$ac_ext >&5
22755   rm -rf conftest*
22756   eval "ac_cv_func_$ac_func=no"
22757 fi
22758 rm -f conftest*
22759 fi
22760
22761 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
22762   echo "$ac_t""yes" 1>&6
22763     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
22764   cat >> confdefs.h <<EOF
22765 #define $ac_tr_func 1
22766 EOF
22767  
22768 else
22769   echo "$ac_t""no" 1>&6
22770 fi
22771 done
22772
22773 fi
22774
22775 for ac_func in \
22776         bcopy                   \
22777         closesocket             \
22778         chroot                  \
22779         endgrent                \
22780         endpwent                \
22781         fcntl                   \
22782         flock                   \
22783         fstat                   \
22784         getdtablesize   \
22785         getgrgid                \
22786         gethostname             \
22787         getpass                 \
22788         getpassphrase   \
22789         getpwuid                \
22790         getpwnam                \
22791         getspnam                \
22792         gettimeofday    \
22793         initgroups              \
22794         lockf                   \
22795         memcpy                  \
22796         memmove                 \
22797         mkstemp                 \
22798         mktemp                  \
22799         pipe                    \
22800         read                    \
22801         recv                    \
22802         recvfrom                \
22803         setpwfile               \
22804         setgid                  \
22805         setegid                 \
22806         setsid                  \
22807         setuid                  \
22808         seteuid                 \
22809         sigaction               \
22810         signal                  \
22811         sigset                  \
22812         strdup                  \
22813         strerror                \
22814         strpbrk                 \
22815         strrchr                 \
22816         strsep                  \
22817         strstr                  \
22818         strtol                  \
22819         strtoul                 \
22820         strtoq                  \
22821         strtouq                 \
22822         strtoll                 \
22823         strspn                  \
22824         sysconf                 \
22825         usleep                  \
22826         waitpid                 \
22827         wait4                   \
22828         write                   \
22829         send                    \
22830         sendmsg                 \
22831         sendto                  \
22832
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 fi
22886 done
22887
22888
22889 for ac_func in getopt getpeereid
22890 do
22891 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
22892 echo "configure:22893: checking for $ac_func" >&5
22893 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
22894   echo $ac_n "(cached) $ac_c" 1>&6
22895 else
22896   cat > conftest.$ac_ext <<EOF
22897 #line 22898 "configure"
22898 #include "confdefs.h"
22899 /* System header to define __stub macros and hopefully few prototypes,
22900     which can conflict with char $ac_func(); below.  */
22901 #include <assert.h>
22902 /* Override any gcc2 internal prototype to avoid an error.  */
22903 /* We use char because int might match the return type of a gcc2
22904     builtin and then its argument prototype would still apply.  */
22905 char $ac_func();
22906 char (*f)();
22907
22908 int main() {
22909
22910 /* The GNU C library defines this for functions which it implements
22911     to always fail with ENOSYS.  Some functions are actually named
22912     something starting with __ and the normal name is an alias.  */
22913 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
22914 choke me
22915 #else
22916 f = $ac_func;
22917 #endif
22918
22919 ; return 0; }
22920 EOF
22921 if { (eval echo configure:22922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22922   rm -rf conftest*
22923   eval "ac_cv_func_$ac_func=yes"
22924 else
22925   echo "configure: failed program was:" >&5
22926   cat conftest.$ac_ext >&5
22927   rm -rf conftest*
22928   eval "ac_cv_func_$ac_func=no"
22929 fi
22930 rm -f conftest*
22931 fi
22932
22933 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
22934   echo "$ac_t""yes" 1>&6
22935     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
22936   cat >> confdefs.h <<EOF
22937 #define $ac_tr_func 1
22938 EOF
22939  
22940 else
22941   echo "$ac_t""no" 1>&6
22942 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
22943 fi
22944 done
22945
22946
22947
22948 if test "$ac_cv_func_getopt" != yes; then
22949         LIBSRCS="$LIBSRCS getopt.c"
22950 fi
22951 if test "$ac_cv_func_getpeereid" != yes; then
22952         echo $ac_n "checking for msg_accrights in msghdr""... $ac_c" 1>&6
22953 echo "configure:22954: checking for msg_accrights in msghdr" >&5
22954 if eval "test \"\${ol_cv_msghdr_msg_accrights+set}\" = set"; then
22955   echo $ac_n "(cached) $ac_c" 1>&6
22956 else
22957   cat > conftest.$ac_ext <<EOF
22958 #line 22959 "configure"
22959 #include "confdefs.h"
22960 #include <sys/socket.h>
22961 int main() {
22962 struct msghdr m; m.msg_accrightslen=0
22963 ; return 0; }
22964 EOF
22965 if { (eval echo configure:22966: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22966   rm -rf conftest*
22967   ol_cv_msghdr_msg_accrights=yes
22968 else
22969   echo "configure: failed program was:" >&5
22970   cat conftest.$ac_ext >&5
22971   rm -rf conftest*
22972   ol_cv_msghdr_msg_accrights=no
22973 fi
22974 rm -f conftest*
22975         
22976 fi
22977
22978 echo "$ac_t""$ol_cv_msghdr_msg_accrights" 1>&6
22979   if test $ol_cv_msghdr_msg_accrights = "yes" ; then
22980         cat >> confdefs.h <<\EOF
22981 #define HAVE_MSGHDR_MSG_ACCRIGHTS 1
22982 EOF
22983
22984   fi
22985
22986         LIBSRCS="$LIBSRCS getpeereid.c"
22987 fi
22988 if test "$ac_cv_func_snprintf" != yes -o "$ac_cv_func_vsnprintf" != yes; then
22989         if test "$ac_cv_func_snprintf" != yes; then
22990                 cat >> confdefs.h <<\EOF
22991 #define snprintf ber_pvt_snprintf
22992 EOF
22993
22994         fi
22995         if test "$ac_cv_func_vsnprintf" != yes; then
22996                 cat >> confdefs.h <<\EOF
22997 #define vsnprintf ber_pvt_vsnprintf
22998 EOF
22999
23000         fi
23001 fi
23002
23003 # Check Configuration
23004 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
23005 echo "configure:23006: checking declaration of sys_errlist" >&5
23006 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
23007   echo $ac_n "(cached) $ac_c" 1>&6
23008 else
23009   
23010         cat > conftest.$ac_ext <<EOF
23011 #line 23012 "configure"
23012 #include "confdefs.h"
23013
23014 #include <stdio.h>
23015 #include <sys/types.h>
23016 #include <errno.h>
23017 #ifdef WINNT
23018 #include <stdlib.h>
23019 #endif 
23020 int main() {
23021 char *c = (char *) *sys_errlist
23022 ; return 0; }
23023 EOF
23024 if { (eval echo configure:23025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
23025   rm -rf conftest*
23026   ol_cv_dcl_sys_errlist=yes
23027         ol_cv_have_sys_errlist=yes
23028 else
23029   echo "configure: failed program was:" >&5
23030   cat conftest.$ac_ext >&5
23031   rm -rf conftest*
23032   ol_cv_dcl_sys_errlist=no
23033 fi
23034 rm -f conftest*
23035 fi
23036
23037 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
23038 #
23039 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
23040 if test $ol_cv_dcl_sys_errlist = no ; then
23041         cat >> confdefs.h <<\EOF
23042 #define DECL_SYS_ERRLIST 1
23043 EOF
23044
23045
23046         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
23047 echo "configure:23048: checking existence of sys_errlist" >&5
23048 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
23049   echo $ac_n "(cached) $ac_c" 1>&6
23050 else
23051   
23052                 cat > conftest.$ac_ext <<EOF
23053 #line 23054 "configure"
23054 #include "confdefs.h"
23055 #include <errno.h>
23056 int main() {
23057 char *c = (char *) *sys_errlist
23058 ; return 0; }
23059 EOF
23060 if { (eval echo configure:23061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
23061   rm -rf conftest*
23062   ol_cv_have_sys_errlist=yes
23063 else
23064   echo "configure: failed program was:" >&5
23065   cat conftest.$ac_ext >&5
23066   rm -rf conftest*
23067   ol_cv_have_sys_errlist=no
23068 fi
23069 rm -f conftest*
23070 fi
23071
23072 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
23073 fi
23074 if test $ol_cv_have_sys_errlist = yes ; then
23075         cat >> confdefs.h <<\EOF
23076 #define HAVE_SYS_ERRLIST 1
23077 EOF
23078
23079 fi
23080
23081
23082
23083 if test "$ol_enable_slapi" != no ; then
23084                         for ac_hdr in ltdl.h
23085 do
23086 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
23087 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
23088 echo "configure:23089: checking for $ac_hdr" >&5
23089 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
23090   echo $ac_n "(cached) $ac_c" 1>&6
23091 else
23092   cat > conftest.$ac_ext <<EOF
23093 #line 23094 "configure"
23094 #include "confdefs.h"
23095 #include <$ac_hdr>
23096 EOF
23097 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
23098 { (eval echo configure:23099: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
23099 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
23100 if test -z "$ac_err"; then
23101   rm -rf conftest*
23102   eval "ac_cv_header_$ac_safe=yes"
23103 else
23104   echo "$ac_err" >&5
23105   echo "configure: failed program was:" >&5
23106   cat conftest.$ac_ext >&5
23107   rm -rf conftest*
23108   eval "ac_cv_header_$ac_safe=no"
23109 fi
23110 rm -f conftest*
23111 fi
23112 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
23113   echo "$ac_t""yes" 1>&6
23114     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
23115   cat >> confdefs.h <<EOF
23116 #define $ac_tr_hdr 1
23117 EOF
23118  
23119 else
23120   echo "$ac_t""no" 1>&6
23121 fi
23122 done
23123
23124
23125         if test $ac_cv_header_ltdl_h != yes ; then
23126                 { echo "configure: error: could not locate <ltdl.h>" 1>&2; exit 1; }
23127         fi
23128         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
23129 echo "configure:23130: checking for lt_dlinit in -lltdl" >&5
23130 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
23131 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
23132   echo $ac_n "(cached) $ac_c" 1>&6
23133 else
23134   ac_save_LIBS="$LIBS"
23135 LIBS="-lltdl  $LIBS"
23136 cat > conftest.$ac_ext <<EOF
23137 #line 23138 "configure"
23138 #include "confdefs.h"
23139 /* Override any gcc2 internal prototype to avoid an error.  */
23140 /* We use char because int might match the return type of a gcc2
23141     builtin and then its argument prototype would still apply.  */
23142 char lt_dlinit();
23143
23144 int main() {
23145 lt_dlinit()
23146 ; return 0; }
23147 EOF
23148 if { (eval echo configure:23149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
23149   rm -rf conftest*
23150   eval "ac_cv_lib_$ac_lib_var=yes"
23151 else
23152   echo "configure: failed program was:" >&5
23153   cat conftest.$ac_ext >&5
23154   rm -rf conftest*
23155   eval "ac_cv_lib_$ac_lib_var=no"
23156 fi
23157 rm -f conftest*
23158 LIBS="$ac_save_LIBS"
23159
23160 fi
23161 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
23162   echo "$ac_t""yes" 1>&6
23163   
23164                 SLAPI_LIBS=-lltdl
23165                 LIBSLAPI=libslapi.a
23166                 LIBSLAPITOOLS=../libslapi.a
23167                 cat >> confdefs.h <<\EOF
23168 #define HAVE_LIBLTDL 1
23169 EOF
23170
23171         
23172 else
23173   echo "$ac_t""no" 1>&6
23174 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
23175 fi
23176
23177
23178         cat >> confdefs.h <<\EOF
23179 #define LDAP_SLAPI 1
23180 EOF
23181
23182 fi
23183
23184 if test "$ol_enable_debug" != no ; then
23185         cat >> confdefs.h <<\EOF
23186 #define LDAP_DEBUG 1
23187 EOF
23188
23189 fi
23190 if test "$ol_enable_syslog" = yes ; then
23191         cat >> confdefs.h <<\EOF
23192 #define LDAP_SYSLOG 1
23193 EOF
23194
23195 fi
23196 if test "$ol_link_kbind" != no ; then
23197         cat >> confdefs.h <<\EOF
23198 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
23199 EOF
23200
23201 fi
23202 if test "$ol_enable_proctitle" != no ; then
23203         cat >> confdefs.h <<\EOF
23204 #define LDAP_PROCTITLE 1
23205 EOF
23206
23207 fi
23208 if test "$ol_enable_referrals" != no ; then
23209         cat >> confdefs.h <<\EOF
23210 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
23211 EOF
23212
23213 fi
23214 if test "$ol_enable_local" != no; then
23215         cat >> confdefs.h <<\EOF
23216 #define LDAP_PF_LOCAL 1
23217 EOF
23218
23219 fi
23220 if test "$ol_link_ipv6" != no; then
23221         cat >> confdefs.h <<\EOF
23222 #define LDAP_PF_INET6 1
23223 EOF
23224
23225 fi
23226 if test "$ol_enable_cleartext" != no ; then
23227         cat >> confdefs.h <<\EOF
23228 #define SLAPD_CLEARTEXT 1
23229 EOF
23230
23231 fi
23232 if test "$ol_enable_crypt" != no ; then
23233         cat >> confdefs.h <<\EOF
23234 #define SLAPD_CRYPT 1
23235 EOF
23236
23237 fi
23238 if test "$ol_link_spasswd" != no ; then
23239         cat >> confdefs.h <<\EOF
23240 #define SLAPD_SPASSWD 1
23241 EOF
23242
23243 fi
23244 if test "$ol_enable_multimaster" != no ; then
23245         cat >> confdefs.h <<\EOF
23246 #define SLAPD_MULTIMASTER 1
23247 EOF
23248
23249 fi
23250 if test "$ol_enable_rlookups" != no ; then
23251         cat >> confdefs.h <<\EOF
23252 #define SLAPD_RLOOKUPS 1
23253 EOF
23254
23255 fi
23256 if test "$ol_enable_aci" != no ; then
23257         cat >> confdefs.h <<\EOF
23258 #define SLAPD_ACI_ENABLED 1
23259 EOF
23260
23261 fi
23262
23263 if test "$ol_link_modules" != no ; then
23264         cat >> confdefs.h <<\EOF
23265 #define SLAPD_MODULES 1
23266 EOF
23267
23268         BUILD_SLAPD=yes
23269         SLAPD_MODULES_LDFLAGS="-dlopen self"
23270 fi
23271
23272 cat >> confdefs.h <<\EOF
23273 #define SLAPD_MOD_STATIC 1
23274 EOF
23275
23276 cat >> confdefs.h <<\EOF
23277 #define SLAPD_MOD_DYNAMIC 2
23278 EOF
23279
23280
23281 if test "$ol_enable_bdb" != no ; then
23282         BUILD_SLAPD=yes
23283         BUILD_BDB=$ol_enable_bdb
23284         if test "$ol_enable_bdb" = mod ; then
23285                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-bdb"
23286                 MFLAG=SLAPD_MOD_DYNAMIC
23287         else
23288                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-bdb"
23289                 MFLAG=SLAPD_MOD_STATIC
23290         fi
23291         cat >> confdefs.h <<EOF
23292 #define SLAPD_BDB $MFLAG
23293 EOF
23294
23295 fi
23296
23297 if test "$ol_enable_dnssrv" != no ; then
23298         BUILD_SLAPD=yes
23299         BUILD_DNSSRV=$ol_enable_dnssrv
23300         if test "$ol_enable_dnssrv" = mod ; then
23301                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-dnssrv"
23302                 MFLAG=SLAPD_MOD_DYNAMIC
23303         else
23304                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-dnssrv"
23305                 MFLAG=SLAPD_MOD_STATIC
23306         fi
23307         cat >> confdefs.h <<EOF
23308 #define SLAPD_DNSSRV $MFLAG
23309 EOF
23310
23311 fi
23312
23313 if test "$ol_enable_hdb" != no ; then
23314         BUILD_SLAPD=yes
23315         BUILD_HDB=$ol_enable_hdb
23316         if test "$ol_enable_hdb" = mod ; then
23317                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-hdb"
23318                 MFLAG=SLAPD_MOD_DYNAMIC
23319         else
23320                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-hdb"
23321                 MFLAG=SLAPD_MOD_STATIC
23322         fi
23323         cat >> confdefs.h <<EOF
23324 #define SLAPD_HDB $MFLAG
23325 EOF
23326
23327 fi
23328
23329 if test "$ol_enable_ldap" != no ; then
23330         BUILD_SLAPD=yes
23331         BUILD_LDAP=$ol_enable_ldap
23332         if test "$ol_enable_ldap" = mod ; then
23333                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldap"
23334                 MFLAG=SLAPD_MOD_DYNAMIC
23335         else
23336                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldap"
23337                 MFLAG=SLAPD_MOD_STATIC
23338         fi
23339         cat >> confdefs.h <<EOF
23340 #define SLAPD_LDAP $MFLAG
23341 EOF
23342
23343 fi
23344
23345 if test "$ol_link_ldbm" != no -a $ol_enable_ldbm != no; then
23346         BUILD_SLAPD=yes
23347         BUILD_LDBM=$ol_enable_ldbm
23348         if test "$ol_enable_ldbm" = mod ; then
23349                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldbm"
23350                 MFLAG=SLAPD_MOD_DYNAMIC
23351         else
23352                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldbm"
23353                 MFLAG=SLAPD_MOD_STATIC
23354         fi
23355         cat >> confdefs.h <<EOF
23356 #define SLAPD_LDBM $MFLAG
23357 EOF
23358
23359 fi
23360
23361 if test "$ol_enable_meta" != no ; then
23362         BUILD_SLAPD=yes
23363         BUILD_META=$ol_enable_meta
23364         BUILD_REWRITE=yes
23365         if test "$ol_enable_meta" = mod ; then
23366                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-meta"
23367                 MFLAG=SLAPD_MOD_DYNAMIC
23368         else
23369                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-meta"
23370                 MFLAG=SLAPD_MOD_STATIC
23371         fi
23372         cat >> confdefs.h <<EOF
23373 #define SLAPD_META $MFLAG
23374 EOF
23375
23376 fi
23377
23378 if test "$ol_enable_monitor" != no ; then
23379         BUILD_SLAPD=yes
23380         BUILD_MONITOR=$ol_enable_monitor
23381         if test "$ol_enable_monitor" = mod ; then
23382                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-monitor"
23383                 MFLAG=SLAPD_MOD_DYNAMIC
23384         else
23385                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-monitor"
23386                 MFLAG=SLAPD_MOD_STATIC
23387         fi
23388         cat >> confdefs.h <<EOF
23389 #define SLAPD_MONITOR $MFLAG
23390 EOF
23391
23392 fi
23393
23394 if test "$ol_enable_null" != no ; then
23395         BUILD_SLAPD=yes
23396         BUILD_NULL=$ol_enable_null
23397         if test "$ol_enable_null" = mod ; then
23398                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-null"
23399                 MFLAG=SLAPD_MOD_DYNAMIC
23400         else
23401                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-null"
23402                 MFLAG=SLAPD_MOD_STATIC
23403         fi
23404         cat >> confdefs.h <<EOF
23405 #define SLAPD_NULL $MFLAG
23406 EOF
23407
23408 fi
23409
23410 if test "$ol_enable_passwd" != no ; then
23411         BUILD_SLAPD=yes
23412         BUILD_PASSWD=$ol_enable_passwd
23413         if test "$ol_enable_passwd" = mod ; then
23414                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-passwd"
23415                 MFLAG=SLAPD_MOD_DYNAMIC
23416         else
23417                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-passwd"
23418                 MFLAG=SLAPD_MOD_STATIC
23419         fi
23420         cat >> confdefs.h <<EOF
23421 #define SLAPD_PASSWD $MFLAG
23422 EOF
23423
23424 fi
23425
23426 if test "$ol_link_perl" != no ; then
23427         BUILD_SLAPD=yes
23428         BUILD_PERL=$ol_enable_perl
23429         if test "$ol_enable_perl" = mod ; then
23430                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-perl"
23431                 MFLAG=SLAPD_MOD_DYNAMIC
23432         else
23433                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-perl"
23434                 MFLAG=SLAPD_MOD_STATIC
23435         fi
23436         cat >> confdefs.h <<EOF
23437 #define SLAPD_PERL $MFLAG
23438 EOF
23439
23440 fi
23441
23442 if test "$ol_enable_shell" != no ; then
23443         if test "$ol_link_thread" != no ; then
23444                 echo "configure: warning: Use of --without-threads is recommended with back-shell" 1>&2
23445         fi
23446         BUILD_SLAPD=yes
23447         BUILD_SHELL=$ol_enable_shell
23448         if test "$ol_enable_shell" = mod ; then
23449                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-shell"
23450                 MFLAG=SLAPD_MOD_DYNAMIC
23451         else
23452                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-shell"
23453                 MFLAG=SLAPD_MOD_STATIC
23454         fi
23455         cat >> confdefs.h <<EOF
23456 #define SLAPD_SHELL $MFLAG
23457 EOF
23458
23459 fi
23460
23461 if test "$ol_link_sql" != no ; then
23462         BUILD_SLAPD=yes
23463         BUILD_SQL=$ol_enable_sql
23464         if test "$ol_enable_sql" = mod; then
23465                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-sql"
23466                 MFLAG=SLAPD_MOD_DYNAMIC
23467         else
23468                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-sql"
23469                 MFLAG=SLAPD_MOD_STATIC
23470         fi
23471         cat >> confdefs.h <<EOF
23472 #define SLAPD_SQL $MFLAG
23473 EOF
23474
23475 fi
23476
23477 if test "$ol_enable_dyngroup" != no ; then
23478         BUILD_DYNGROUP=$ol_enable_dyngroup
23479         if test "$ol_enable_dyngroup" = mod ; then
23480                 MFLAG=SLAPD_MOD_DYNAMIC
23481                 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS dyngroup.la"
23482         else
23483                 MFLAG=SLAPD_MOD_STATIC
23484         fi
23485         cat >> confdefs.h <<EOF
23486 #define SLAPD_OVER_DYNGROUP $MFLAG
23487 EOF
23488
23489 fi
23490
23491 if test "$ol_enable_proxycache" != no ; then
23492         BUILD_PROXYCACHE=$ol_enable_proxycache
23493         if test "$ol_enable_proxycache" = mod ; then
23494                 MFLAG=SLAPD_MOD_DYNAMIC
23495                 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS pcache.la"
23496         else
23497                 MFLAG=SLAPD_MOD_STATIC
23498         fi
23499         cat >> confdefs.h <<EOF
23500 #define SLAPD_OVER_PROXYCACHE $MFLAG
23501 EOF
23502
23503 fi
23504
23505 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
23506         $BUILD_SLAPD = yes ; then
23507         BUILD_SLURPD=yes
23508 fi
23509
23510 if test "$ol_enable_rewrite" != no ; then
23511         cat >> confdefs.h <<\EOF
23512 #define ENABLE_REWRITE 1
23513 EOF
23514
23515         BUILD_REWRITE=yes
23516 fi
23517
23518 if test "$ol_enable_slapi" != no ; then
23519         cat >> confdefs.h <<\EOF
23520 #define ENABLE_SLAPI 1
23521 EOF
23522
23523         BUILD_SLAPI=yes
23524         SLAPD_SLAPI_DEPEND=libslapi.a
23525 fi
23526
23527
23528
23529 if test "$ac_cv_mingw32" = yes ; then
23530         PLAT=NT
23531         SLAPD_MODULES_LDFLAGS=
23532 else
23533         PLAT=UNIX
23534 fi
23535
23536 if test -z "$SLAPD_STATIC_BACKENDS"; then
23537         SLAPD_NO_STATIC='#'
23538 else
23539         SLAPD_NO_STATIC=
23540 fi
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
23588
23589
23590
23591
23592
23593
23594
23595
23596
23597
23598
23599
23600
23601
23602 # Check whether --with-xxinstall or --without-xxinstall was given.
23603 if test "${with_xxinstall+set}" = set; then
23604   withval="$with_xxinstall"
23605   :
23606 fi
23607
23608
23609
23610 trap '' 1 2 15
23611
23612 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
23613
23614 test "x$prefix" = xNONE && prefix=$ac_default_prefix
23615 # Let make expand exec_prefix.
23616 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
23617
23618 # Any assignment to VPATH causes Sun make to only execute
23619 # the first set of double-colon rules, so remove it if not needed.
23620 # If there is a colon in the path, we need to keep it.
23621 if test "x$srcdir" = x.; then
23622   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
23623 fi
23624
23625 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
23626
23627 DEFS=-DHAVE_CONFIG_H
23628
23629 # Without the "./", some shells look in PATH for config.status.
23630 : ${CONFIG_STATUS=./config.status}
23631
23632 echo creating $CONFIG_STATUS
23633 rm -f $CONFIG_STATUS
23634 cat > $CONFIG_STATUS <<EOF
23635 #! /bin/sh
23636 # Generated automatically by configure.
23637 # Run this file to recreate the current configuration.
23638 # This directory was configured as follows,
23639 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
23640 #
23641 # $0 $ac_configure_args
23642 #
23643 # Compiler output produced by configure, useful for debugging
23644 # configure, is in ./config.log if it exists.
23645
23646 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
23647 for ac_option
23648 do
23649   case "\$ac_option" in
23650   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
23651     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
23652     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
23653   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
23654     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
23655     exit 0 ;;
23656   -help | --help | --hel | --he | --h)
23657     echo "\$ac_cs_usage"; exit 0 ;;
23658   *) echo "\$ac_cs_usage"; exit 1 ;;
23659   esac
23660 done
23661
23662 ac_given_srcdir=$srcdir
23663 ac_given_INSTALL="$INSTALL"
23664
23665 trap 'rm -fr `echo "\
23666 Makefile:build/top.mk:Makefile.in:build/dir.mk \
23667 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
23668 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
23669 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
23670 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
23671 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
23672 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
23673 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
23674 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
23675 include/Makefile:build/top.mk:include/Makefile.in \
23676 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
23677 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23678 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23679 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
23680 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
23681 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
23682 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
23683 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
23684 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
23685 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
23686 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
23687 servers/slapd/back-hdb/Makefile:build/top.mk:servers/slapd/back-hdb/Makefile.in:build/mod.mk \
23688 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
23689 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
23690 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
23691 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
23692 servers/slapd/back-null/Makefile:build/top.mk:servers/slapd/back-null/Makefile.in:build/mod.mk \
23693 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
23694 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
23695 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
23696 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
23697 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
23698 servers/slapd/slapi/Makefile:build/top.mk:servers/slapd/slapi/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23699 servers/slapd/overlays/Makefile:build/top.mk:servers/slapd/overlays/Makefile.in:build/lib.mk \
23700 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
23701 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
23702 tests/run \
23703 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
23704  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
23705 EOF
23706 cat >> $CONFIG_STATUS <<EOF
23707
23708 # Protect against being on the right side of a sed subst in config.status.
23709 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
23710  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
23711 $ac_vpsub
23712 $extrasub
23713 s%@SHELL@%$SHELL%g
23714 s%@CFLAGS@%$CFLAGS%g
23715 s%@CPPFLAGS@%$CPPFLAGS%g
23716 s%@CXXFLAGS@%$CXXFLAGS%g
23717 s%@FFLAGS@%$FFLAGS%g
23718 s%@DEFS@%$DEFS%g
23719 s%@LDFLAGS@%$LDFLAGS%g
23720 s%@LIBS@%$LIBS%g
23721 s%@exec_prefix@%$exec_prefix%g
23722 s%@prefix@%$prefix%g
23723 s%@program_transform_name@%$program_transform_name%g
23724 s%@bindir@%$bindir%g
23725 s%@sbindir@%$sbindir%g
23726 s%@libexecdir@%$libexecdir%g
23727 s%@datadir@%$datadir%g
23728 s%@sysconfdir@%$sysconfdir%g
23729 s%@sharedstatedir@%$sharedstatedir%g
23730 s%@localstatedir@%$localstatedir%g
23731 s%@libdir@%$libdir%g
23732 s%@includedir@%$includedir%g
23733 s%@oldincludedir@%$oldincludedir%g
23734 s%@infodir@%$infodir%g
23735 s%@mandir@%$mandir%g
23736 s%@host@%$host%g
23737 s%@host_alias@%$host_alias%g
23738 s%@host_cpu@%$host_cpu%g
23739 s%@host_vendor@%$host_vendor%g
23740 s%@host_os@%$host_os%g
23741 s%@target@%$target%g
23742 s%@target_alias@%$target_alias%g
23743 s%@target_cpu@%$target_cpu%g
23744 s%@target_vendor@%$target_vendor%g
23745 s%@target_os@%$target_os%g
23746 s%@build@%$build%g
23747 s%@build_alias@%$build_alias%g
23748 s%@build_cpu@%$build_cpu%g
23749 s%@build_vendor@%$build_vendor%g
23750 s%@build_os@%$build_os%g
23751 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
23752 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
23753 s%@INSTALL_DATA@%$INSTALL_DATA%g
23754 s%@PACKAGE@%$PACKAGE%g
23755 s%@VERSION@%$VERSION%g
23756 s%@ACLOCAL@%$ACLOCAL%g
23757 s%@AUTOCONF@%$AUTOCONF%g
23758 s%@AUTOMAKE@%$AUTOMAKE%g
23759 s%@AUTOHEADER@%$AUTOHEADER%g
23760 s%@MAKEINFO@%$MAKEINFO%g
23761 s%@install_sh@%$install_sh%g
23762 s%@AMTAR@%$AMTAR%g
23763 s%@AWK@%$AWK%g
23764 s%@AMTARFLAGS@%$AMTARFLAGS%g
23765 s%@SET_MAKE@%$SET_MAKE%g
23766 s%@OPENLDAP_LIBRELEASE@%$OPENLDAP_LIBRELEASE%g
23767 s%@OPENLDAP_LIBVERSION@%$OPENLDAP_LIBVERSION%g
23768 s%@OPENLDAP_RELEASE_DATE@%$OPENLDAP_RELEASE_DATE%g
23769 s%@top_builddir@%$top_builddir%g
23770 s%@ldap_subdir@%$ldap_subdir%g
23771 s%@CC@%$CC%g
23772 s%@AR@%$AR%g
23773 s%@LN_S@%$LN_S%g
23774 s%@OBJEXT@%$OBJEXT%g
23775 s%@EXEEXT@%$EXEEXT%g
23776 s%@ECHO@%$ECHO%g
23777 s%@RANLIB@%$RANLIB%g
23778 s%@STRIP@%$STRIP%g
23779 s%@DLLTOOL@%$DLLTOOL%g
23780 s%@AS@%$AS%g
23781 s%@OBJDUMP@%$OBJDUMP%g
23782 s%@CPP@%$CPP%g
23783 s%@LIBTOOL@%$LIBTOOL%g
23784 s%@LN_H@%$LN_H%g
23785 s%@PERLBIN@%$PERLBIN%g
23786 s%@OL_MKDEP@%$OL_MKDEP%g
23787 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
23788 s%@LTSTATIC@%$LTSTATIC%g
23789 s%@LIBOBJS@%$LIBOBJS%g
23790 s%@LIBSRCS@%$LIBSRCS%g
23791 s%@PLAT@%$PLAT%g
23792 s%@WITH_TLS@%$WITH_TLS%g
23793 s%@BUILD_LIBS_DYNAMIC@%$BUILD_LIBS_DYNAMIC%g
23794 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
23795 s%@BUILD_SLAPI@%$BUILD_SLAPI%g
23796 s%@SLAPD_SLAPI_DEPEND@%$SLAPD_SLAPI_DEPEND%g
23797 s%@BUILD_BDB@%$BUILD_BDB%g
23798 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
23799 s%@BUILD_HDB@%$BUILD_HDB%g
23800 s%@BUILD_LDAP@%$BUILD_LDAP%g
23801 s%@BUILD_LDBM@%$BUILD_LDBM%g
23802 s%@BUILD_META@%$BUILD_META%g
23803 s%@BUILD_MONITOR@%$BUILD_MONITOR%g
23804 s%@BUILD_NULL@%$BUILD_NULL%g
23805 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
23806 s%@BUILD_PERL@%$BUILD_PERL%g
23807 s%@BUILD_SHELL@%$BUILD_SHELL%g
23808 s%@BUILD_SQL@%$BUILD_SQL%g
23809 s%@BUILD_DYNGROUP@%$BUILD_DYNGROUP%g
23810 s%@BUILD_PROXYCACHE@%$BUILD_PROXYCACHE%g
23811 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
23812 s%@LDAP_LIBS@%$LDAP_LIBS%g
23813 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
23814 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
23815 s%@LDBM_LIBS@%$LDBM_LIBS%g
23816 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
23817 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
23818 s%@WRAP_LIBS@%$WRAP_LIBS%g
23819 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
23820 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
23821 s%@SLAPD_NO_STATIC@%$SLAPD_NO_STATIC%g
23822 s%@SLAPD_STATIC_BACKENDS@%$SLAPD_STATIC_BACKENDS%g
23823 s%@SLAPD_DYNAMIC_BACKENDS@%$SLAPD_DYNAMIC_BACKENDS%g
23824 s%@SLAPD_DYNAMIC_OVERLAYS@%$SLAPD_DYNAMIC_OVERLAYS%g
23825 s%@PERL_CPPFLAGS@%$PERL_CPPFLAGS%g
23826 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
23827 s%@MOD_PERL_LDFLAGS@%$MOD_PERL_LDFLAGS%g
23828 s%@KRB4_LIBS@%$KRB4_LIBS%g
23829 s%@KRB5_LIBS@%$KRB5_LIBS%g
23830 s%@SASL_LIBS@%$SASL_LIBS%g
23831 s%@TLS_LIBS@%$TLS_LIBS%g
23832 s%@MODULES_LIBS@%$MODULES_LIBS%g
23833 s%@SLAPI_LIBS@%$SLAPI_LIBS%g
23834 s%@LIBSLAPI@%$LIBSLAPI%g
23835 s%@LIBSLAPITOOLS@%$LIBSLAPITOOLS%g
23836 s%@AUTH_LIBS@%$AUTH_LIBS%g
23837 s%@SLAPD_SLP_LIBS@%$SLAPD_SLP_LIBS%g
23838 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
23839 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
23840 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
23841
23842 CEOF
23843 EOF
23844
23845 cat >> $CONFIG_STATUS <<\EOF
23846
23847 # Split the substitutions into bite-sized pieces for seds with
23848 # small command number limits, like on Digital OSF/1 and HP-UX.
23849 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
23850 ac_file=1 # Number of current file.
23851 ac_beg=1 # First line for current file.
23852 ac_end=$ac_max_sed_cmds # Line after last line for current file.
23853 ac_more_lines=:
23854 ac_sed_cmds=""
23855 while $ac_more_lines; do
23856   if test $ac_beg -gt 1; then
23857     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
23858   else
23859     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
23860   fi
23861   if test ! -s conftest.s$ac_file; then
23862     ac_more_lines=false
23863     rm -f conftest.s$ac_file
23864   else
23865     if test -z "$ac_sed_cmds"; then
23866       ac_sed_cmds="sed -f conftest.s$ac_file"
23867     else
23868       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
23869     fi
23870     ac_file=`expr $ac_file + 1`
23871     ac_beg=$ac_end
23872     ac_end=`expr $ac_end + $ac_max_sed_cmds`
23873   fi
23874 done
23875 if test -z "$ac_sed_cmds"; then
23876   ac_sed_cmds=cat
23877 fi
23878 EOF
23879
23880 cat >> $CONFIG_STATUS <<EOF
23881
23882 CONFIG_FILES=\${CONFIG_FILES-"\
23883 Makefile:build/top.mk:Makefile.in:build/dir.mk \
23884 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
23885 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
23886 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
23887 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
23888 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
23889 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
23890 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
23891 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
23892 include/Makefile:build/top.mk:include/Makefile.in \
23893 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
23894 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23895 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23896 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
23897 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
23898 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
23899 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
23900 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
23901 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
23902 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
23903 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
23904 servers/slapd/back-hdb/Makefile:build/top.mk:servers/slapd/back-hdb/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/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
23915 servers/slapd/slapi/Makefile:build/top.mk:servers/slapd/slapi/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23916 servers/slapd/overlays/Makefile:build/top.mk:servers/slapd/overlays/Makefile.in:build/lib.mk \
23917 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
23918 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
23919 tests/run \
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 chmod +x tests/run
24094 date > stamp-h
24095 echo Please run \"make depend\" to build dependencies
24096
24097 exit 0
24098 EOF
24099 chmod +x $CONFIG_STATUS
24100 rm -fr confdefs* $ac_clean_files
24101 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
24102