]> git.sur5r.net Git - openldap/blob - configure
Rebuild with new libtool.m4
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.451 2002/12/07 18:19:26 ando Exp  
4
5 # Copyright 1998-2002 The OpenLDAP Foundation.  All Rights Reserved.
6
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted only as authorized by the OpenLDAP
9 # Public License.  A copy of this license is available at
10 # http://www.OpenLDAP.org/license.html or in file LICENSE in the
11 # top-level directory of the distribution.
12
13 echo "Copyright 1998-2002 The OpenLDAP Foundation,  All Rights Reserved."
14 echo "  Restrictions apply, see COPYRIGHT and LICENSE files."
15
16 # Guess values for system-dependent variables and create Makefiles.
17 # Generated automatically using autoconf version 2.13.1 
18 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
19 #
20 # This configure script is free software; the Free Software Foundation
21 # gives unlimited permission to copy, distribute and modify it.
22
23 # Defaults:
24 ac_help=
25 ac_default_prefix=/usr/local
26 # Any additions from configure.in:
27 ac_default_prefix=/usr/local
28 ac_help="$ac_help
29   --with-subdir=DIR       change default subdirectory used for installs"
30 ac_help="$ac_help
31   --enable-debug          enable debugging [yes]"
32 ac_help="$ac_help
33   --enable-syslog         enable syslog support [auto]"
34 ac_help="$ac_help
35   --enable-proctitle      enable proctitle support [yes]"
36 ac_help="$ac_help
37   --enable-cache          enable caching (experimental) [no]"
38 ac_help="$ac_help
39   --enable-referrals      enable LDAPv2+ Referrals (experimental) [no]"
40 ac_help="$ac_help
41   --enable-ipv6           enable IPv6 support [auto]"
42 ac_help="$ac_help
43   --enable-local          enable AF_LOCAL (AF_UNIX) socket support [auto]"
44 ac_help="$ac_help
45   --enable-x-compile      enable cross compiling [no]"
46 ac_help="$ac_help
47   --with-cyrus-sasl       with Cyrus SASL support [auto]"
48 ac_help="$ac_help
49   --with-fetch            with freeBSD fetch URL support [auto]"
50 ac_help="$ac_help
51   --with-kerberos         with Kerberos support [auto]"
52 ac_help="$ac_help
53   --with-readline         with readline support [auto]"
54 ac_help="$ac_help
55   --with-threads          with threads [auto]"
56 ac_help="$ac_help
57   --with-tls              with TLS/SSL support [auto]"
58 ac_help="$ac_help
59   --with-yielding-select  with implicitly yielding select [auto]"
60 ac_help="$ac_help
61
62 SLAPD (Standalone LDAP Daemon) Options:"
63 ac_help="$ac_help
64   --enable-slapd          enable building slapd [yes]"
65 ac_help="$ac_help
66     --enable-aci          enable per-object ACIs (experimental) [no]"
67 ac_help="$ac_help
68     --enable-cleartext    enable cleartext passwords [yes]"
69 ac_help="$ac_help
70     --enable-crypt        enable crypt(3) passwords [no]"
71 ac_help="$ac_help
72     --enable-dynamic      enable linking built binaries with dynamic libs [no]"
73 ac_help="$ac_help
74     --enable-kpasswd      enable Kerberos password verification [no]"
75 ac_help="$ac_help
76     --enable-lmpasswd     enable LAN Manager passwords [no]"
77 ac_help="$ac_help
78     --enable-spasswd      enable (Cyrus) SASL password verification [no]"
79 ac_help="$ac_help
80     --enable-modules      enable dynamic module support [no]"
81 ac_help="$ac_help
82     --enable-phonetic     enable phonetic/soundex [no]"
83 ac_help="$ac_help
84     --enable-rewrite      enable DN rewriting in back-ldap and back-meta [no]"
85 ac_help="$ac_help
86     --enable-rlookups     enable reverse lookups of client hostnames [no]"
87 ac_help="$ac_help
88     --enable-slp          enable SLPv2 support [no]"
89 ac_help="$ac_help
90     --enable-wrappers     enable tcp wrapper support [no]"
91 ac_help="$ac_help
92     --enable-slapi   enable installation of slapi library [no]"
93 ac_help="$ac_help
94     --enable-bdb          enable Berkeley DB backend [yes]"
95 ac_help="$ac_help
96     --with-bdb-module     module type static|dynamic [static]"
97 ac_help="$ac_help
98     --enable-dnssrv       enable dnssrv backend [no]"
99 ac_help="$ac_help
100     --with-dnssrv-module  module type static|dynamic [static]"
101 ac_help="$ac_help
102     --enable-ldap         enable ldap backend [no]"
103 ac_help="$ac_help
104     --with-ldap-module    module type static|dynamic [static]"
105 ac_help="$ac_help
106     --enable-ldbm         enable ldbm backend [no]"
107 ac_help="$ac_help
108     --with-ldbm-api       with LDBM API auto|berkeley|bcompat|mdbm|gdbm [auto]"
109 ac_help="$ac_help
110     --with-ldbm-module    module type static|dynamic [static]"
111 ac_help="$ac_help
112     --with-ldbm-type      use LDBM type auto|btree|hash [auto]"
113 ac_help="$ac_help
114     --enable-meta         enable metadirectory backend [no]"
115 ac_help="$ac_help
116     --with-meta-module    module type static|dynamic [static]"
117 ac_help="$ac_help
118     --enable-monitor      enable monitor backend [no]"
119 ac_help="$ac_help
120     --with-monitor-module module type static|dynamic [static]"
121 ac_help="$ac_help
122     --enable-null         enable null backend [no]"
123 ac_help="$ac_help
124     --with-null-module    module type static|dynamic [static]"
125 ac_help="$ac_help
126     --enable-passwd       enable passwd backend [no]"
127 ac_help="$ac_help
128     --with-passwd-module  module type static|dynamic [static]"
129 ac_help="$ac_help
130     --enable-perl         enable perl backend [no]"
131 ac_help="$ac_help
132     --with-perl-module    module type static|dynamic [static]"
133 ac_help="$ac_help
134     --enable-shell        enable shell backend [no]"
135 ac_help="$ac_help
136     --with-shell-module   module type static|dynamic [static]"
137 ac_help="$ac_help
138     --enable-sql          enable sql backend [no]"
139 ac_help="$ac_help
140     --with-sql-module     module type static|dynamic [static]"
141 ac_help="$ac_help
142     --enable-tcl          enable tcl backend [no]"
143 ac_help="$ac_help
144     --with-tcl-module     module type static|dynamic [static]"
145 ac_help="$ac_help
146
147 SLURPD (Replication Daemon) Options:"
148 ac_help="$ac_help
149   --enable-slurpd         enable building slurpd [auto]"
150 ac_help="$ac_help
151
152 Library Generation & Linking Options"
153 ac_help="$ac_help
154   --enable-static[=PKGS]  build static libraries [default=yes]"
155 ac_help="$ac_help
156   --enable-shared[=PKGS]  build shared libraries [default=yes]"
157 ac_help="$ac_help
158   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
159 ac_help="$ac_help
160   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
161
162 # Find the correct PATH separator.  Usually this is `:', but
163 # DJGPP uses `;' like DOS.
164 if test "X${PATH_SEPARATOR+set}" != Xset; then
165   UNAME=${UNAME-`uname 2>/dev/null`}
166   case X$UNAME in
167     *-DOS) lt_cv_sys_path_separator=';' ;;
168     *)     lt_cv_sys_path_separator=':' ;;
169   esac
170   PATH_SEPARATOR=$lt_cv_sys_path_separator
171 fi
172
173
174 # Check that we are running under the correct shell.
175 SHELL=${CONFIG_SHELL-/bin/sh}
176
177 case X$ECHO in
178 X*--fallback-echo)
179   # Remove one level of quotation (which was required for Make).
180   ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
181   ;;
182 esac
183
184 echo=${ECHO-echo}
185 if test "X$1" = X--no-reexec; then
186   # Discard the --no-reexec flag, and continue.
187   shift
188 elif test "X$1" = X--fallback-echo; then
189   # Avoid inline document here, it may be left over
190   :
191 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
192   # Yippee, $echo works!
193   :
194 else
195   # Restart under the correct shell.
196   exec $SHELL "$0" --no-reexec ${1+"$@"}
197 fi
198
199 if test "X$1" = X--fallback-echo; then
200   # used as fallback echo
201   shift
202   cat <<EOF
203
204 EOF
205   exit 0
206 fi
207
208 # The HP-UX ksh and POSIX shell print the target directory to stdout
209 # if CDPATH is set.
210 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
211
212 if test -z "$ECHO"; then
213 if test "X${echo_test_string+set}" != Xset; then
214 # find a string as large as possible, as long as the shell can cope with it
215   for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
216     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
217     if (echo_test_string="`eval $cmd`") 2>/dev/null &&
218        echo_test_string="`eval $cmd`" &&
219        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
220     then
221       break
222     fi
223   done
224 fi
225
226 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
227    echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
228    test "X$echo_testing_string" = "X$echo_test_string"; then
229   :
230 else
231   # The Solaris, AIX, and Digital Unix default echo programs unquote
232   # backslashes.  This makes it impossible to quote backslashes using
233   #   echo "$something" | sed 's/\\/\\\\/g'
234   #
235   # So, first we look for a working echo in the user's PATH.
236
237   IFS="${IFS=   }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
238   for dir in $PATH /usr/ucb; do
239     if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
240        test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
241        echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
242        test "X$echo_testing_string" = "X$echo_test_string"; then
243       echo="$dir/echo"
244       break
245     fi
246   done
247   IFS="$save_ifs"
248
249   if test "X$echo" = Xecho; then
250     # We didn't find a better echo, so look for alternatives.
251     if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
252        echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
253        test "X$echo_testing_string" = "X$echo_test_string"; then
254       # This shell has a builtin print -r that does the trick.
255       echo='print -r'
256     elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
257          test "X$CONFIG_SHELL" != X/bin/ksh; then
258       # If we have ksh, try running configure again with it.
259       ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
260       export ORIGINAL_CONFIG_SHELL
261       CONFIG_SHELL=/bin/ksh
262       export CONFIG_SHELL
263       exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
264     else
265       # Try using printf.
266       echo='printf %s\n'
267       if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
268          echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
269          test "X$echo_testing_string" = "X$echo_test_string"; then
270         # Cool, printf works
271         :
272       elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
273            test "X$echo_testing_string" = 'X\t' &&
274            echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
275            test "X$echo_testing_string" = "X$echo_test_string"; then
276         CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
277         export CONFIG_SHELL
278         SHELL="$CONFIG_SHELL"
279         export SHELL
280         echo="$CONFIG_SHELL $0 --fallback-echo"
281       elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
282            test "X$echo_testing_string" = 'X\t' &&
283            echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
284            test "X$echo_testing_string" = "X$echo_test_string"; then
285         echo="$CONFIG_SHELL $0 --fallback-echo"
286       else
287         # maybe with a smaller string...
288         prev=:
289
290         for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
291           if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
292           then
293             break
294           fi
295           prev="$cmd"
296         done
297
298         if test "$prev" != 'sed 50q "$0"'; then
299           echo_test_string=`eval $prev`
300           export echo_test_string
301           exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
302         else
303           # Oops.  We lost completely, so just stick with echo.
304           echo=echo
305         fi
306       fi
307     fi
308   fi
309 fi
310 fi
311
312 # Copy echo and quote the copy suitably for passing to libtool from
313 # the Makefile, instead of quoting the original, which is used later.
314 ECHO=$echo
315 if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
316    ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
317 fi
318
319
320 ac_help="$ac_help
321   --disable-libtool-lock  avoid locking (might break parallel builds)"
322 ac_help="$ac_help
323   --with-pic              try to use only PIC/non-PIC objects [default=use both]"
324 ac_help="$ac_help
325
326 See INSTALL file for further details."
327
328 # Initialize some variables set by options.
329 # The variables have the same names as the options, with
330 # dashes changed to underlines.
331 build=NONE
332 cache_file=./config.cache
333 exec_prefix=NONE
334 host=NONE
335 no_create=
336 nonopt=NONE
337 no_recursion=
338 prefix=NONE
339 program_prefix=NONE
340 program_suffix=NONE
341 program_transform_name=s,x,x,
342 silent=
343 site=
344 srcdir=
345 target=NONE
346 verbose=
347 x_includes=NONE
348 x_libraries=NONE
349 bindir='${exec_prefix}/bin'
350 sbindir='${exec_prefix}/sbin'
351 libexecdir='${exec_prefix}/libexec'
352 datadir='${prefix}/share'
353 sysconfdir='${prefix}/etc'
354 sharedstatedir='${prefix}/com'
355 localstatedir='${prefix}/var'
356 libdir='${exec_prefix}/lib'
357 includedir='${prefix}/include'
358 oldincludedir='/usr/include'
359 infodir='${prefix}/info'
360 mandir='${prefix}/man'
361
362 # Initialize some other variables.
363 subdirs=
364 MFLAGS= MAKEFLAGS=
365 SHELL=${CONFIG_SHELL-/bin/sh}
366 # Maximum number of lines to put in a shell here document.
367 ac_max_here_lines=12
368
369 ac_prev=
370 for ac_option
371 do
372
373   # If the previous option needs an argument, assign it.
374   if test -n "$ac_prev"; then
375     eval "$ac_prev=\$ac_option"
376     ac_prev=
377     continue
378   fi
379
380   case "$ac_option" in
381   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
382   *) ac_optarg= ;;
383   esac
384
385   # Accept the important Cygnus configure options, so we can diagnose typos.
386
387   case "$ac_option" in
388
389   -bindir | --bindir | --bindi | --bind | --bin | --bi)
390     ac_prev=bindir ;;
391   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
392     bindir="$ac_optarg" ;;
393
394   -build | --build | --buil | --bui | --bu)
395     ac_prev=build ;;
396   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
397     build="$ac_optarg" ;;
398
399   -cache-file | --cache-file | --cache-fil | --cache-fi \
400   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
401     ac_prev=cache_file ;;
402   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
403   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
404     cache_file="$ac_optarg" ;;
405
406   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
407     ac_prev=datadir ;;
408   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
409   | --da=*)
410     datadir="$ac_optarg" ;;
411
412   -disable-* | --disable-*)
413     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
414     # Reject names that are not valid shell variable names.
415     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
416       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
417     fi
418     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
419     eval "enable_${ac_feature}=no" ;;
420
421   -enable-* | --enable-*)
422     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
423     # Reject names that are not valid shell variable names.
424     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
425       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
426     fi
427     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
428     case "$ac_option" in
429       *=*) ;;
430       *) ac_optarg=yes ;;
431     esac
432     eval "enable_${ac_feature}='$ac_optarg'" ;;
433
434   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
435   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
436   | --exec | --exe | --ex)
437     ac_prev=exec_prefix ;;
438   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
439   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
440   | --exec=* | --exe=* | --ex=*)
441     exec_prefix="$ac_optarg" ;;
442
443   -gas | --gas | --ga | --g)
444     # Obsolete; use --with-gas.
445     with_gas=yes ;;
446
447   -help | --help | --hel | --he)
448     # Omit some internal or obsolete options to make the list less imposing.
449     # This message is too long to be a string in the A/UX 3.1 sh.
450     cat << EOF
451 Usage: configure [options] [host]
452 Options: [defaults in brackets after descriptions]
453 Configuration:
454   --cache-file=FILE       cache test results in FILE
455   --help                  print this message
456   --no-create             do not create output files
457   --quiet, --silent       do not print \`checking...' messages
458   --version               print the version of autoconf that created configure
459 Directory and file names:
460   --prefix=PREFIX         install architecture-independent files in PREFIX
461                           [$ac_default_prefix]
462   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
463                           [same as prefix]
464   --bindir=DIR            user executables in DIR [EPREFIX/bin]
465   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
466   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
467   --datadir=DIR           read-only architecture-independent data in DIR
468                           [PREFIX/share]
469   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
470   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
471                           [PREFIX/com]
472   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
473   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
474   --includedir=DIR        C header files in DIR [PREFIX/include]
475   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
476   --infodir=DIR           info documentation in DIR [PREFIX/info]
477   --mandir=DIR            man documentation in DIR [PREFIX/man]
478   --srcdir=DIR            find the sources in DIR [configure dir or ..]
479   --program-prefix=PREFIX prepend PREFIX to installed program names
480   --program-suffix=SUFFIX append SUFFIX to installed program names
481   --program-transform-name=PROGRAM
482                           run sed PROGRAM on installed program names
483 EOF
484     cat << EOF
485 Host type:
486   --build=BUILD           configure for building on BUILD [BUILD=HOST]
487   --host=HOST             configure for HOST [guessed]
488   --target=TARGET         configure for TARGET [TARGET=HOST]
489 Features and packages:
490   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
491   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
492   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
493   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
494   --x-includes=DIR        X include files are in DIR
495   --x-libraries=DIR       X library files are in DIR
496 EOF
497     if test -n "$ac_help"; then
498       echo "--enable and --with options recognized:$ac_help"
499     fi
500     exit 0 ;;
501
502   -host | --host | --hos | --ho)
503     ac_prev=host ;;
504   -host=* | --host=* | --hos=* | --ho=*)
505     host="$ac_optarg" ;;
506
507   -includedir | --includedir | --includedi | --included | --include \
508   | --includ | --inclu | --incl | --inc)
509     ac_prev=includedir ;;
510   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
511   | --includ=* | --inclu=* | --incl=* | --inc=*)
512     includedir="$ac_optarg" ;;
513
514   -infodir | --infodir | --infodi | --infod | --info | --inf)
515     ac_prev=infodir ;;
516   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
517     infodir="$ac_optarg" ;;
518
519   -libdir | --libdir | --libdi | --libd)
520     ac_prev=libdir ;;
521   -libdir=* | --libdir=* | --libdi=* | --libd=*)
522     libdir="$ac_optarg" ;;
523
524   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
525   | --libexe | --libex | --libe)
526     ac_prev=libexecdir ;;
527   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
528   | --libexe=* | --libex=* | --libe=*)
529     libexecdir="$ac_optarg" ;;
530
531   -localstatedir | --localstatedir | --localstatedi | --localstated \
532   | --localstate | --localstat | --localsta | --localst \
533   | --locals | --local | --loca | --loc | --lo)
534     ac_prev=localstatedir ;;
535   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
536   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
537   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
538     localstatedir="$ac_optarg" ;;
539
540   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
541     ac_prev=mandir ;;
542   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
543     mandir="$ac_optarg" ;;
544
545   -nfp | --nfp | --nf)
546     # Obsolete; use --without-fp.
547     with_fp=no ;;
548
549   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
550   | --no-cr | --no-c)
551     no_create=yes ;;
552
553   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
554   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
555     no_recursion=yes ;;
556
557   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
558   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
559   | --oldin | --oldi | --old | --ol | --o)
560     ac_prev=oldincludedir ;;
561   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
562   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
563   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
564     oldincludedir="$ac_optarg" ;;
565
566   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
567     ac_prev=prefix ;;
568   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
569     prefix="$ac_optarg" ;;
570
571   -program-prefix | --program-prefix | --program-prefi | --program-pref \
572   | --program-pre | --program-pr | --program-p)
573     ac_prev=program_prefix ;;
574   -program-prefix=* | --program-prefix=* | --program-prefi=* \
575   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
576     program_prefix="$ac_optarg" ;;
577
578   -program-suffix | --program-suffix | --program-suffi | --program-suff \
579   | --program-suf | --program-su | --program-s)
580     ac_prev=program_suffix ;;
581   -program-suffix=* | --program-suffix=* | --program-suffi=* \
582   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
583     program_suffix="$ac_optarg" ;;
584
585   -program-transform-name | --program-transform-name \
586   | --program-transform-nam | --program-transform-na \
587   | --program-transform-n | --program-transform- \
588   | --program-transform | --program-transfor \
589   | --program-transfo | --program-transf \
590   | --program-trans | --program-tran \
591   | --progr-tra | --program-tr | --program-t)
592     ac_prev=program_transform_name ;;
593   -program-transform-name=* | --program-transform-name=* \
594   | --program-transform-nam=* | --program-transform-na=* \
595   | --program-transform-n=* | --program-transform-=* \
596   | --program-transform=* | --program-transfor=* \
597   | --program-transfo=* | --program-transf=* \
598   | --program-trans=* | --program-tran=* \
599   | --progr-tra=* | --program-tr=* | --program-t=*)
600     program_transform_name="$ac_optarg" ;;
601
602   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
603   | -silent | --silent | --silen | --sile | --sil)
604     silent=yes ;;
605
606   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
607     ac_prev=sbindir ;;
608   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
609   | --sbi=* | --sb=*)
610     sbindir="$ac_optarg" ;;
611
612   -sharedstatedir | --sharedstatedir | --sharedstatedi \
613   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
614   | --sharedst | --shareds | --shared | --share | --shar \
615   | --sha | --sh)
616     ac_prev=sharedstatedir ;;
617   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
618   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
619   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
620   | --sha=* | --sh=*)
621     sharedstatedir="$ac_optarg" ;;
622
623   -site | --site | --sit)
624     ac_prev=site ;;
625   -site=* | --site=* | --sit=*)
626     site="$ac_optarg" ;;
627
628   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
629     ac_prev=srcdir ;;
630   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
631     srcdir="$ac_optarg" ;;
632
633   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
634   | --syscon | --sysco | --sysc | --sys | --sy)
635     ac_prev=sysconfdir ;;
636   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
637   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
638     sysconfdir="$ac_optarg" ;;
639
640   -target | --target | --targe | --targ | --tar | --ta | --t)
641     ac_prev=target ;;
642   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
643     target="$ac_optarg" ;;
644
645   -v | -verbose | --verbose | --verbos | --verbo | --verb)
646     verbose=yes ;;
647
648   -version | --version | --versio | --versi | --vers)
649     echo "configure generated by autoconf version 2.13.1"
650     exit 0 ;;
651
652   -with-* | --with-*)
653     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
654     # Reject names that are not valid shell variable names.
655     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
656       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
657     fi
658     ac_package=`echo $ac_package| sed 's/-/_/g'`
659     case "$ac_option" in
660       *=*) ;;
661       *) ac_optarg=yes ;;
662     esac
663     eval "with_${ac_package}='$ac_optarg'" ;;
664
665   -without-* | --without-*)
666     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
667     # Reject names that are not valid shell variable names.
668     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
669       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
670     fi
671     ac_package=`echo $ac_package| sed 's/-/_/g'`
672     eval "with_${ac_package}=no" ;;
673
674   --x)
675     # Obsolete; use --with-x.
676     with_x=yes ;;
677
678   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
679   | --x-incl | --x-inc | --x-in | --x-i)
680     ac_prev=x_includes ;;
681   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
682   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
683     x_includes="$ac_optarg" ;;
684
685   -x-libraries | --x-libraries | --x-librarie | --x-librari \
686   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
687     ac_prev=x_libraries ;;
688   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
689   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
690     x_libraries="$ac_optarg" ;;
691
692   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
693     ;;
694
695   *)
696     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
697       echo "configure: warning: $ac_option: invalid host type" 1>&2
698     fi
699     if test "x$nonopt" != xNONE; then
700       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
701     fi
702     nonopt="$ac_option"
703     ;;
704
705   esac
706 done
707
708 if test -n "$ac_prev"; then
709   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
710 fi
711
712 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
713
714 # File descriptor usage:
715 # 0 standard input
716 # 1 file creation
717 # 2 errors and warnings
718 # 3 some systems may open it to /dev/tty
719 # 4 used on the Kubota Titan
720 # 6 checking for... messages and results
721 # 5 compiler messages saved in config.log
722 if test "$silent" = yes; then
723   exec 6>/dev/null
724 else
725   exec 6>&1
726 fi
727 exec 5>./config.log
728
729 echo "\
730 This file contains any messages produced by compilers while
731 running configure, to aid debugging if configure makes a mistake.
732 " 1>&5
733
734 # Strip out --no-create and --no-recursion so they do not pile up.
735 # Also quote any args containing shell metacharacters.
736 ac_configure_args=
737 for ac_arg
738 do
739   case "$ac_arg" in
740   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
741   | --no-cr | --no-c) ;;
742   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
743   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
744   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
745   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
746   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
747   esac
748 done
749
750 # NLS nuisances.
751 # Only set these to C if already set.  These must not be set unconditionally
752 # because not all systems understand e.g. LANG=C (notably SCO).
753 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
754 # Non-C LC_CTYPE values break the ctype check.
755 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
756 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
757 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
758 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
759
760 # confdefs.h avoids OS command line length limits that DEFS can exceed.
761 rm -rf conftest* confdefs.h
762 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
763 echo > confdefs.h
764
765 # A filename unique to this package, relative to the directory that
766 # configure is in, which we can look for to find out if srcdir is correct.
767 ac_unique_file=build/version.sh
768
769 # Find the source files, if location was not specified.
770 if test -z "$srcdir"; then
771   ac_srcdir_defaulted=yes
772   # Try the directory containing this script, then its parent.
773   ac_prog=$0
774   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
775   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
776   srcdir=$ac_confdir
777   if test ! -r $srcdir/$ac_unique_file; then
778     srcdir=..
779   fi
780 else
781   ac_srcdir_defaulted=no
782 fi
783 if test ! -r $srcdir/$ac_unique_file; then
784   if test "$ac_srcdir_defaulted" = yes; then
785     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
786   else
787     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
788   fi
789 fi
790 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
791
792 # Prefer explicitly selected file to automatically selected ones.
793 if test -z "$CONFIG_SITE"; then
794   if test "x$prefix" != xNONE; then
795     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
796   else
797     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
798   fi
799 fi
800 for ac_site_file in $CONFIG_SITE; do
801   if test -r "$ac_site_file"; then
802     echo "loading site script $ac_site_file"
803     . "$ac_site_file"
804   fi
805 done
806
807
808 ac_ext=c
809 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
810 ac_cpp='$CPP $CPPFLAGS'
811 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
812 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
813 cross_compiling=$ac_cv_prog_cc_cross
814
815 ac_exeext=
816 ac_objext=o
817 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
818   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
819   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
820     ac_n= ac_c='
821 ' ac_t='        '
822   else
823     ac_n=-n ac_c= ac_t=
824   fi
825 else
826   ac_n= ac_c='\c' ac_t=
827 fi
828
829
830 # set unset (borrowed from autoconf 2.49c)
831 if (OL_FOO=OL_FOO; unset OL_FOO) >/dev/null 2>&1; then
832   ol_unset=unset
833 else
834   ol_unset=false
835 fi
836 # unset CDPATH
837 $ol_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
838
839 ac_aux_dir=
840 for ac_dir in build $srcdir/build; do
841   if test -f $ac_dir/install-sh; then
842     ac_aux_dir=$ac_dir
843     ac_install_sh="$ac_aux_dir/install-sh -c"
844     break
845   elif test -f $ac_dir/install.sh; then
846     ac_aux_dir=$ac_dir
847     ac_install_sh="$ac_aux_dir/install.sh -c"
848     break
849   elif test -f $ac_dir/shtool; then
850     ac_aux_dir=$ac_dir
851     ac_install_sh="$ac_aux_dir/shtool install -c"
852     break
853   fi
854 done
855 if test -z "$ac_aux_dir"; then
856   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
857 fi
858 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
859 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
860 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
861
862 eval `$ac_aux_dir/version.sh`
863 if test -z "$OL_STRING"; then
864         { echo "configure: error: could not determine version" 1>&2; exit 1; }
865 fi
866
867 if test -f "$ac_aux_dir/shtool" -a ! -d $ac_aux_dir/shtool; then
868         ac_cv_shtool="$ac_aux_dir/shtool"
869 else
870         { echo "configure: error: no shtool found in $ac_aux_dir" 1>&2; exit 1; }
871 fi
872
873 SHTOOL="$ac_cv_shtool"
874
875 TB="`$SHTOOL echo -e '%B' 2>/dev/null`"
876 TN="`$SHTOOL echo -e '%b' 2>/dev/null`"
877
878 OPENLDAP_CVS=""
879 if test -d $ac_aux_dir/CVS; then
880         OPENLDAP_CVS="(from CVS sources) "
881 fi
882
883 echo "Configuring ${TB}${OL_STRING}${TN} ${OPENLDAP_CVS}..."
884
885
886 echo $ac_n "checking host system type""... $ac_c" 1>&6
887 echo "configure:888: checking host system type" >&5
888 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
889
890 # Make sure we can run config.sub.
891   if $ac_config_sub sun4 >/dev/null 2>&1; then :
892     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
893   fi
894
895   ac_cv_host_alias=$host
896   case "$ac_cv_host_alias" in
897   NONE)
898     case $nonopt in
899     NONE)
900       if ac_cv_host_alias=`$ac_config_guess`; then :
901       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
902       fi ;;
903     *) ac_cv_host_alias=$nonopt ;;
904     esac ;;
905   esac
906
907   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
908   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
909   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
910   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
911 else
912   echo $ac_n "(cached) $ac_c" 1>&6
913 fi
914
915 echo "$ac_t""$ac_cv_host" 1>&6
916
917 host=$ac_cv_host
918 host_alias=$ac_cv_host_alias
919 host_cpu=$ac_cv_host_cpu
920 host_vendor=$ac_cv_host_vendor
921 host_os=$ac_cv_host_os
922
923
924
925
926
927 echo $ac_n "checking target system type""... $ac_c" 1>&6
928 echo "configure:929: checking target system type" >&5
929 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
930
931 # Make sure we can run config.sub.
932   if $ac_config_sub sun4 >/dev/null 2>&1; then :
933     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
934   fi
935
936   ac_cv_target_alias=$target
937   case "$ac_cv_target_alias" in
938   NONE)
939     case $nonopt in
940     NONE)
941       ac_cv_target_alias=$host_alias ;;
942
943     *) ac_cv_target_alias=$nonopt ;;
944     esac ;;
945   esac
946
947   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
948   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
949   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
950   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
951 else
952   echo $ac_n "(cached) $ac_c" 1>&6
953 fi
954
955 echo "$ac_t""$ac_cv_target" 1>&6
956
957 target=$ac_cv_target
958 target_alias=$ac_cv_target_alias
959 target_cpu=$ac_cv_target_cpu
960 target_vendor=$ac_cv_target_vendor
961 target_os=$ac_cv_target_os
962
963
964
965
966
967 echo $ac_n "checking build system type""... $ac_c" 1>&6
968 echo "configure:969: checking build system type" >&5
969 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
970
971 # Make sure we can run config.sub.
972   if $ac_config_sub sun4 >/dev/null 2>&1; then :
973     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
974   fi
975
976   ac_cv_build_alias=$build
977   case "$ac_cv_build_alias" in
978   NONE)
979     case $nonopt in
980     NONE)
981       ac_cv_build_alias=$host_alias ;;
982
983     *) ac_cv_build_alias=$nonopt ;;
984     esac ;;
985   esac
986
987   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
988   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
989   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
990   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
991 else
992   echo $ac_n "(cached) $ac_c" 1>&6
993 fi
994
995 echo "$ac_t""$ac_cv_build" 1>&6
996
997 build=$ac_cv_build
998 build_alias=$ac_cv_build_alias
999 build_cpu=$ac_cv_build_cpu
1000 build_vendor=$ac_cv_build_vendor
1001 build_os=$ac_cv_build_os
1002
1003
1004
1005
1006
1007 # Do some error checking and defaulting for the host and target type.
1008 # The inputs are:
1009 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
1010 #
1011 # The rules are:
1012 # 1. You are not allowed to specify --host, --target, and nonopt at the
1013 #    same time.
1014 # 2. Host defaults to nonopt.
1015 # 3. If nonopt is not specified, then host defaults to the current host,
1016 #    as determined by config.guess.
1017 # 4. Target and build default to nonopt.
1018 # 5. If nonopt is not specified, then target and build default to host.
1019
1020 # The aliases save the names the user supplied, while $host etc.
1021 # will get canonicalized.
1022 case $host---$target---$nonopt in
1023 NONE---*---* | *---NONE---* | *---*---NONE) ;;
1024 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
1025 esac
1026
1027 test "$host_alias" != "$target_alias" &&
1028   test "$program_prefix$program_suffix$program_transform_name" = \
1029     NONENONEs,x,x, &&
1030   program_prefix=${target_alias}-
1031
1032
1033 # Find a good install program.  We prefer a C program (faster),
1034 # so one script is as good as another.  But avoid the broken or
1035 # incompatible versions:
1036 # SysV /etc/install, /usr/sbin/install
1037 # SunOS /usr/etc/install
1038 # IRIX /sbin/install
1039 # AIX /bin/install
1040 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1041 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1042 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1043 # ./install, which can be erroneously created by make from ./install.sh.
1044 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1045 echo "configure:1046: checking for a BSD compatible install" >&5
1046 if test -z "$INSTALL"; then
1047 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
1048   echo $ac_n "(cached) $ac_c" 1>&6
1049 else
1050     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1051   for ac_dir in $PATH; do
1052     # Account for people who put trailing slashes in PATH elements.
1053     case "$ac_dir/" in
1054     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1055     *)
1056       # OSF1 and SCO ODT 3.0 have their own names for install.
1057       # Don't use installbsd from OSF since it installs stuff as root
1058       # by default.
1059       for ac_prog in ginstall scoinst install; do
1060         if test -f $ac_dir/$ac_prog; then
1061           if test $ac_prog = install &&
1062             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1063             # AIX install.  It has an incompatible calling convention.
1064             :
1065           elif test $ac_prog = install &&
1066             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
1067             # program-specific install script used by HP pwplus--don't use.
1068             :
1069           else
1070             ac_cv_path_install="$ac_dir/$ac_prog -c"
1071             break 2
1072           fi
1073         fi
1074       done
1075       ;;
1076     esac
1077   done
1078   IFS="$ac_save_IFS"
1079
1080 fi
1081   if test "${ac_cv_path_install+set}" = set; then
1082     INSTALL="$ac_cv_path_install"
1083   else
1084     # As a last resort, use the slow shell script.  We don't cache a
1085     # path for INSTALL within a source directory, because that will
1086     # break other packages using the cache if that directory is
1087     # removed, or if the path is relative.
1088     INSTALL="$ac_install_sh"
1089   fi
1090 fi
1091 echo "$ac_t""$INSTALL" 1>&6
1092
1093 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1094 # It thinks the first close brace ends the variable substitution.
1095 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1096
1097 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
1098
1099 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1100
1101 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
1102 echo "configure:1103: checking whether build environment is sane" >&5
1103 # Just in case
1104 sleep 1
1105 echo timestamp > conftestfile
1106 # Do `set' in a subshell so we don't clobber the current shell's
1107 # arguments.  Must try -L first in case configure is actually a
1108 # symlink; some systems play weird games with the mod time of symlinks
1109 # (eg FreeBSD returns the mod time of the symlink's containing
1110 # directory).
1111 if (
1112    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1113    if test "$*" = "X"; then
1114       # -L didn't work.
1115       set X `ls -t $srcdir/configure conftestfile`
1116    fi
1117    if test "$*" != "X $srcdir/configure conftestfile" \
1118       && test "$*" != "X conftestfile $srcdir/configure"; then
1119
1120       # If neither matched, then we have a broken ls.  This can happen
1121       # if, for instance, CONFIG_SHELL is bash and it inherits a
1122       # broken ls alias from the environment.  This has actually
1123       # happened.  Such a system could not be considered "sane".
1124       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
1125 alias in your environment" 1>&2; exit 1; }
1126    fi
1127
1128    test "$2" = conftestfile
1129    )
1130 then
1131    # Ok.
1132    :
1133 else
1134    { echo "configure: error: newly created file is older than distributed files!
1135 Check your system clock" 1>&2; exit 1; }
1136 fi
1137 rm -f conftest*
1138 echo "$ac_t""yes" 1>&6
1139 if test "$program_transform_name" = s,x,x,; then
1140   program_transform_name=
1141 else
1142   # Double any \ or $.  echo might interpret backslashes.
1143   cat <<\EOF_SED > conftestsed
1144 s,\\,\\\\,g; s,\$,$$,g
1145 EOF_SED
1146   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
1147   rm -f conftestsed
1148 fi
1149 test "$program_prefix" != NONE &&
1150   program_transform_name="s,^,${program_prefix},;$program_transform_name"
1151 # Use a double $ so make ignores it.
1152 test "$program_suffix" != NONE &&
1153   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
1154
1155 # sed with no file args requires a program.
1156 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
1157
1158 for ac_prog in mawk gawk nawk awk
1159 do
1160 # Extract the first word of "$ac_prog", so it can be a program name with args.
1161 set dummy $ac_prog; ac_word=$2
1162 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1163 echo "configure:1164: checking for $ac_word" >&5
1164 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
1165   echo $ac_n "(cached) $ac_c" 1>&6
1166 else
1167   if test -n "$AWK"; then
1168   ac_cv_prog_AWK="$AWK" # Let the user override the test.
1169 else
1170   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1171   ac_dummy="$PATH"
1172   for ac_dir in $ac_dummy; do
1173     test -z "$ac_dir" && ac_dir=.
1174     if test -f $ac_dir/$ac_word; then
1175       ac_cv_prog_AWK="$ac_prog"
1176       break
1177     fi
1178   done
1179   IFS="$ac_save_ifs"
1180 fi
1181 fi
1182 AWK="$ac_cv_prog_AWK"
1183 if test -n "$AWK"; then
1184   echo "$ac_t""$AWK" 1>&6
1185 else
1186   echo "$ac_t""no" 1>&6
1187 fi
1188
1189 test -n "$AWK" && break
1190 done
1191
1192 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1193 echo "configure:1194: checking whether ${MAKE-make} sets \${MAKE}" >&5
1194 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1195 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1196   echo $ac_n "(cached) $ac_c" 1>&6
1197 else
1198   cat > conftestmake <<\EOF
1199 all:
1200         @echo 'ac_maketemp="${MAKE}"'
1201 EOF
1202 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1203 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1204 if test -n "$ac_maketemp"; then
1205   eval ac_cv_prog_make_${ac_make}_set=yes
1206 else
1207   eval ac_cv_prog_make_${ac_make}_set=no
1208 fi
1209 rm -f conftestmake
1210 fi
1211 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1212   echo "$ac_t""yes" 1>&6
1213   SET_MAKE=
1214 else
1215   echo "$ac_t""no" 1>&6
1216   SET_MAKE="MAKE=${MAKE-make}"
1217 fi
1218
1219
1220
1221 PACKAGE=$OL_PACKAGE
1222
1223 VERSION=$OL_VERSION
1224
1225 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1226   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
1227 fi
1228
1229
1230
1231 missing_dir=`cd $ac_aux_dir && pwd`
1232 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1233 echo "configure:1234: checking for working aclocal" >&5
1234 # Run test in a subshell; some versions of sh will print an error if
1235 # an executable is not found, even if stderr is redirected.
1236 # Redirect stdin to placate older versions of autoconf.  Sigh.
1237 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1238    ACLOCAL=aclocal
1239    echo "$ac_t""found" 1>&6
1240 else
1241    ACLOCAL="$missing_dir/missing aclocal"
1242    echo "$ac_t""missing" 1>&6
1243 fi
1244
1245 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1246 echo "configure:1247: checking for working autoconf" >&5
1247 # Run test in a subshell; some versions of sh will print an error if
1248 # an executable is not found, even if stderr is redirected.
1249 # Redirect stdin to placate older versions of autoconf.  Sigh.
1250 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1251    AUTOCONF=autoconf
1252    echo "$ac_t""found" 1>&6
1253 else
1254    AUTOCONF="$missing_dir/missing autoconf"
1255    echo "$ac_t""missing" 1>&6
1256 fi
1257
1258 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1259 echo "configure:1260: checking for working automake" >&5
1260 # Run test in a subshell; some versions of sh will print an error if
1261 # an executable is not found, even if stderr is redirected.
1262 # Redirect stdin to placate older versions of autoconf.  Sigh.
1263 if (automake --version) < /dev/null > /dev/null 2>&1; then
1264    AUTOMAKE=automake
1265    echo "$ac_t""found" 1>&6
1266 else
1267    AUTOMAKE="$missing_dir/missing automake"
1268    echo "$ac_t""missing" 1>&6
1269 fi
1270
1271 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1272 echo "configure:1273: checking for working autoheader" >&5
1273 # Run test in a subshell; some versions of sh will print an error if
1274 # an executable is not found, even if stderr is redirected.
1275 # Redirect stdin to placate older versions of autoconf.  Sigh.
1276 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1277    AUTOHEADER=autoheader
1278    echo "$ac_t""found" 1>&6
1279 else
1280    AUTOHEADER="$missing_dir/missing autoheader"
1281    echo "$ac_t""missing" 1>&6
1282 fi
1283
1284 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1285 echo "configure:1286: checking for working makeinfo" >&5
1286 # Run test in a subshell; some versions of sh will print an error if
1287 # an executable is not found, even if stderr is redirected.
1288 # Redirect stdin to placate older versions of autoconf.  Sigh.
1289 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1290    MAKEINFO=makeinfo
1291    echo "$ac_t""found" 1>&6
1292 else
1293    MAKEINFO="$missing_dir/missing makeinfo"
1294    echo "$ac_t""missing" 1>&6
1295 fi
1296
1297 install_sh="$missing_dir/install-sh"
1298 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1299
1300 for ac_prog in gnutar gtar tar
1301 do
1302 # Extract the first word of "$ac_prog", so it can be a program name with args.
1303 set dummy $ac_prog; ac_word=$2
1304 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1305 echo "configure:1306: checking for $ac_word" >&5
1306 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1307   echo $ac_n "(cached) $ac_c" 1>&6
1308 else
1309   if test -n "$AMTAR"; then
1310   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1311 else
1312   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1313   ac_dummy="$PATH"
1314   for ac_dir in $ac_dummy; do
1315     test -z "$ac_dir" && ac_dir=.
1316     if test -f $ac_dir/$ac_word; then
1317       ac_cv_prog_AMTAR="$ac_prog"
1318       break
1319     fi
1320   done
1321   IFS="$ac_save_ifs"
1322 fi
1323 fi
1324 AMTAR="$ac_cv_prog_AMTAR"
1325 if test -n "$AMTAR"; then
1326   echo "$ac_t""$AMTAR" 1>&6
1327 else
1328   echo "$ac_t""no" 1>&6
1329 fi
1330
1331 test -n "$AMTAR" && break
1332 done
1333
1334
1335 AMTARFLAGS=
1336 if test -n "$AMTAR"; then
1337   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1338         AMTARFLAGS=o
1339   fi
1340 fi
1341
1342 cat >> confdefs.h <<EOF
1343 #define OPENLDAP_PACKAGE "$PACKAGE"
1344 EOF
1345
1346 cat >> confdefs.h <<EOF
1347 #define OPENLDAP_VERSION "$VERSION"
1348 EOF
1349
1350
1351 cat >> confdefs.h <<EOF
1352 #define LDAP_VENDOR_VERSION $OL_API_INC
1353 EOF
1354
1355 cat >> confdefs.h <<EOF
1356 #define LDAP_VENDOR_VERSION_MAJOR $OL_MAJOR
1357 EOF
1358
1359 cat >> confdefs.h <<EOF
1360 #define LDAP_VENDOR_VERSION_MINOR $OL_MINOR
1361 EOF
1362
1363 cat >> confdefs.h <<EOF
1364 #define LDAP_VENDOR_VERSION_PATCH $OL_PATCH
1365 EOF
1366
1367
1368 OPENLDAP_LIBVERSION=$OL_API_LIB
1369
1370 OPENLDAP_RELEASE_DATE="$OL_RELEASE_DATE"
1371
1372
1373
1374 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1375 echo "configure:1376: checking configure arguments" >&5
1376
1377
1378 top_builddir=`pwd`
1379
1380 ldap_subdir="/openldap"
1381
1382 # Check whether --with-subdir or --without-subdir was given.
1383 if test "${with_subdir+set}" = set; then
1384   withval="$with_subdir"
1385   case "$withval" in
1386         no) ldap_subdir=""
1387                 ;;
1388         yes)
1389                 ;;
1390         /*|\\*)
1391                 ldap_subdir="$withval"
1392                 ;;
1393         *)
1394                 ldap_subdir="/$withval"
1395                 ;;
1396 esac
1397
1398 fi
1399
1400
1401 # OpenLDAP --enable-debug
1402         # Check whether --enable-debug or --disable-debug was given.
1403 if test "${enable_debug+set}" = set; then
1404   enableval="$enable_debug"
1405   
1406         ol_arg=invalid
1407         for ol_val in auto yes no ; do
1408                 if test "$enableval" = "$ol_val" ; then
1409                         ol_arg="$ol_val"
1410                 fi
1411         done
1412         if test "$ol_arg" = "invalid" ; then
1413                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1414         fi
1415         ol_enable_debug="$ol_arg"
1416
1417 else
1418         ol_enable_debug="yes"
1419 fi
1420 # end --enable-debug
1421 # OpenLDAP --enable-syslog
1422         # Check whether --enable-syslog or --disable-syslog was given.
1423 if test "${enable_syslog+set}" = set; then
1424   enableval="$enable_syslog"
1425   
1426         ol_arg=invalid
1427         for ol_val in auto yes no ; do
1428                 if test "$enableval" = "$ol_val" ; then
1429                         ol_arg="$ol_val"
1430                 fi
1431         done
1432         if test "$ol_arg" = "invalid" ; then
1433                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1434         fi
1435         ol_enable_syslog="$ol_arg"
1436
1437 else
1438         ol_enable_syslog="auto"
1439 fi
1440 # end --enable-syslog
1441 # OpenLDAP --enable-proctitle
1442         # Check whether --enable-proctitle or --disable-proctitle was given.
1443 if test "${enable_proctitle+set}" = set; then
1444   enableval="$enable_proctitle"
1445   
1446         ol_arg=invalid
1447         for ol_val in auto yes no ; do
1448                 if test "$enableval" = "$ol_val" ; then
1449                         ol_arg="$ol_val"
1450                 fi
1451         done
1452         if test "$ol_arg" = "invalid" ; then
1453                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1454         fi
1455         ol_enable_proctitle="$ol_arg"
1456
1457 else
1458         ol_enable_proctitle="yes"
1459 fi
1460 # end --enable-proctitle
1461 # OpenLDAP --enable-cache
1462         # Check whether --enable-cache or --disable-cache was given.
1463 if test "${enable_cache+set}" = set; then
1464   enableval="$enable_cache"
1465   
1466         ol_arg=invalid
1467         for ol_val in auto yes no ; do
1468                 if test "$enableval" = "$ol_val" ; then
1469                         ol_arg="$ol_val"
1470                 fi
1471         done
1472         if test "$ol_arg" = "invalid" ; then
1473                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
1474         fi
1475         ol_enable_cache="$ol_arg"
1476
1477 else
1478         ol_enable_cache="no"
1479 fi
1480 # end --enable-cache
1481 # OpenLDAP --enable-referrals
1482         # Check whether --enable-referrals or --disable-referrals was given.
1483 if test "${enable_referrals+set}" = set; then
1484   enableval="$enable_referrals"
1485   
1486         ol_arg=invalid
1487         for ol_val in auto yes no ; do
1488                 if test "$enableval" = "$ol_val" ; then
1489                         ol_arg="$ol_val"
1490                 fi
1491         done
1492         if test "$ol_arg" = "invalid" ; then
1493                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1494         fi
1495         ol_enable_referrals="$ol_arg"
1496
1497 else
1498         ol_enable_referrals="no"
1499 fi
1500 # end --enable-referrals
1501 ol_enable_kbind=${ol_enable_kbind-no}
1502 # OpenLDAP --enable-ipv6
1503         # Check whether --enable-ipv6 or --disable-ipv6 was given.
1504 if test "${enable_ipv6+set}" = set; then
1505   enableval="$enable_ipv6"
1506   
1507         ol_arg=invalid
1508         for ol_val in auto yes no ; do
1509                 if test "$enableval" = "$ol_val" ; then
1510                         ol_arg="$ol_val"
1511                 fi
1512         done
1513         if test "$ol_arg" = "invalid" ; then
1514                 { echo "configure: error: bad value $enableval for --enable-ipv6" 1>&2; exit 1; }
1515         fi
1516         ol_enable_ipv6="$ol_arg"
1517
1518 else
1519         ol_enable_ipv6="auto"
1520 fi
1521 # end --enable-ipv6
1522 # OpenLDAP --enable-local
1523         # Check whether --enable-local or --disable-local was given.
1524 if test "${enable_local+set}" = set; then
1525   enableval="$enable_local"
1526   
1527         ol_arg=invalid
1528         for ol_val in auto yes no ; do
1529                 if test "$enableval" = "$ol_val" ; then
1530                         ol_arg="$ol_val"
1531                 fi
1532         done
1533         if test "$ol_arg" = "invalid" ; then
1534                 { echo "configure: error: bad value $enableval for --enable-local" 1>&2; exit 1; }
1535         fi
1536         ol_enable_local="$ol_arg"
1537
1538 else
1539         ol_enable_local="auto"
1540 fi
1541 # end --enable-local
1542 # OpenLDAP --enable-x_compile
1543         # Check whether --enable-x_compile or --disable-x_compile was given.
1544 if test "${enable_x_compile+set}" = set; then
1545   enableval="$enable_x_compile"
1546   
1547         ol_arg=invalid
1548         for ol_val in yes no ; do
1549                 if test "$enableval" = "$ol_val" ; then
1550                         ol_arg="$ol_val"
1551                 fi
1552         done
1553         if test "$ol_arg" = "invalid" ; then
1554                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1555         fi
1556         ol_enable_x_compile="$ol_arg"
1557
1558 else
1559         ol_enable_x_compile="no"
1560 fi
1561 # end --enable-x_compile
1562
1563
1564 # OpenLDAP --with-cyrus_sasl
1565         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1566 if test "${with_cyrus_sasl+set}" = set; then
1567   withval="$with_cyrus_sasl"
1568   
1569         ol_arg=invalid
1570         for ol_val in auto yes no  ; do
1571                 if test "$withval" = "$ol_val" ; then
1572                         ol_arg="$ol_val"
1573                 fi
1574         done
1575         if test "$ol_arg" = "invalid" ; then
1576                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1577         fi
1578         ol_with_cyrus_sasl="$ol_arg"
1579
1580 else
1581         ol_with_cyrus_sasl="auto"
1582 fi
1583 # end --with-cyrus_sasl
1584
1585 # OpenLDAP --with-fetch
1586         # Check whether --with-fetch or --without-fetch was given.
1587 if test "${with_fetch+set}" = set; then
1588   withval="$with_fetch"
1589   
1590         ol_arg=invalid
1591         for ol_val in auto yes no  ; do
1592                 if test "$withval" = "$ol_val" ; then
1593                         ol_arg="$ol_val"
1594                 fi
1595         done
1596         if test "$ol_arg" = "invalid" ; then
1597                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1598         fi
1599         ol_with_fetch="$ol_arg"
1600
1601 else
1602         ol_with_fetch="auto"
1603 fi
1604 # end --with-fetch
1605
1606 # OpenLDAP --with-kerberos
1607         # Check whether --with-kerberos or --without-kerberos was given.
1608 if test "${with_kerberos+set}" = set; then
1609   withval="$with_kerberos"
1610   
1611         ol_arg=invalid
1612         for ol_val in auto k5 k5only k425 kth k4 afs yes no ; do
1613                 if test "$withval" = "$ol_val" ; then
1614                         ol_arg="$ol_val"
1615                 fi
1616         done
1617         if test "$ol_arg" = "invalid" ; then
1618                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1619         fi
1620         ol_with_kerberos="$ol_arg"
1621
1622 else
1623         ol_with_kerberos="auto"
1624 fi
1625 # end --with-kerberos
1626
1627 # OpenLDAP --with-readline
1628         # Check whether --with-readline or --without-readline was given.
1629 if test "${with_readline+set}" = set; then
1630   withval="$with_readline"
1631   
1632         ol_arg=invalid
1633         for ol_val in auto yes no  ; do
1634                 if test "$withval" = "$ol_val" ; then
1635                         ol_arg="$ol_val"
1636                 fi
1637         done
1638         if test "$ol_arg" = "invalid" ; then
1639                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1640         fi
1641         ol_with_readline="$ol_arg"
1642
1643 else
1644         ol_with_readline="auto"
1645 fi
1646 # end --with-readline
1647
1648 # OpenLDAP --with-threads
1649         # Check whether --with-threads or --without-threads was given.
1650 if test "${with_threads+set}" = set; then
1651   withval="$with_threads"
1652   
1653         ol_arg=invalid
1654         for ol_val in auto nt posix mach pth lwp yes no manual  ; do
1655                 if test "$withval" = "$ol_val" ; then
1656                         ol_arg="$ol_val"
1657                 fi
1658         done
1659         if test "$ol_arg" = "invalid" ; then
1660                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1661         fi
1662         ol_with_threads="$ol_arg"
1663
1664 else
1665         ol_with_threads="auto"
1666 fi
1667 # end --with-threads
1668
1669 # OpenLDAP --with-tls
1670         # Check whether --with-tls or --without-tls was given.
1671 if test "${with_tls+set}" = set; then
1672   withval="$with_tls"
1673   
1674         ol_arg=invalid
1675         for ol_val in auto ssleay openssl yes no  ; do
1676                 if test "$withval" = "$ol_val" ; then
1677                         ol_arg="$ol_val"
1678                 fi
1679         done
1680         if test "$ol_arg" = "invalid" ; then
1681                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1682         fi
1683         ol_with_tls="$ol_arg"
1684
1685 else
1686         ol_with_tls="auto"
1687 fi
1688 # end --with-tls
1689
1690 # OpenLDAP --with-yielding_select
1691         # Check whether --with-yielding_select or --without-yielding_select was given.
1692 if test "${with_yielding_select+set}" = set; then
1693   withval="$with_yielding_select"
1694   
1695         ol_arg=invalid
1696         for ol_val in auto yes no manual  ; do
1697                 if test "$withval" = "$ol_val" ; then
1698                         ol_arg="$ol_val"
1699                 fi
1700         done
1701         if test "$ol_arg" = "invalid" ; then
1702                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1703         fi
1704         ol_with_yielding_select="$ol_arg"
1705
1706 else
1707         ol_with_yielding_select="auto"
1708 fi
1709 # end --with-yielding_select
1710
1711
1712
1713 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1714 if test "${with_xxslapdoptions+set}" = set; then
1715   withval="$with_xxslapdoptions"
1716   :
1717 fi
1718
1719 # OpenLDAP --enable-slapd
1720         # Check whether --enable-slapd or --disable-slapd was given.
1721 if test "${enable_slapd+set}" = set; then
1722   enableval="$enable_slapd"
1723   
1724         ol_arg=invalid
1725         for ol_val in auto yes no ; do
1726                 if test "$enableval" = "$ol_val" ; then
1727                         ol_arg="$ol_val"
1728                 fi
1729         done
1730         if test "$ol_arg" = "invalid" ; then
1731                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1732         fi
1733         ol_enable_slapd="$ol_arg"
1734
1735 else
1736         ol_enable_slapd="yes"
1737 fi
1738 # end --enable-slapd
1739 # OpenLDAP --enable-aci
1740         # Check whether --enable-aci or --disable-aci was given.
1741 if test "${enable_aci+set}" = set; then
1742   enableval="$enable_aci"
1743   
1744         ol_arg=invalid
1745         for ol_val in auto yes no ; do
1746                 if test "$enableval" = "$ol_val" ; then
1747                         ol_arg="$ol_val"
1748                 fi
1749         done
1750         if test "$ol_arg" = "invalid" ; then
1751                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1752         fi
1753         ol_enable_aci="$ol_arg"
1754
1755 else
1756         ol_enable_aci="no"
1757 fi
1758 # end --enable-aci
1759 # OpenLDAP --enable-cleartext
1760         # Check whether --enable-cleartext or --disable-cleartext was given.
1761 if test "${enable_cleartext+set}" = set; then
1762   enableval="$enable_cleartext"
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-cleartext" 1>&2; exit 1; }
1772         fi
1773         ol_enable_cleartext="$ol_arg"
1774
1775 else
1776         ol_enable_cleartext="yes"
1777 fi
1778 # end --enable-cleartext
1779 # OpenLDAP --enable-crypt
1780         # Check whether --enable-crypt or --disable-crypt was given.
1781 if test "${enable_crypt+set}" = set; then
1782   enableval="$enable_crypt"
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-crypt" 1>&2; exit 1; }
1792         fi
1793         ol_enable_crypt="$ol_arg"
1794
1795 else
1796         ol_enable_crypt="no"
1797 fi
1798 # end --enable-crypt
1799 # OpenLDAP --enable-dynamic
1800         # Check whether --enable-dynamic or --disable-dynamic was given.
1801 if test "${enable_dynamic+set}" = set; then
1802   enableval="$enable_dynamic"
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-dynamic" 1>&2; exit 1; }
1812         fi
1813         ol_enable_dynamic="$ol_arg"
1814
1815 else
1816         ol_enable_dynamic="no"
1817 fi
1818 # end --enable-dynamic
1819 # OpenLDAP --enable-kpasswd
1820         # Check whether --enable-kpasswd or --disable-kpasswd was given.
1821 if test "${enable_kpasswd+set}" = set; then
1822   enableval="$enable_kpasswd"
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-kpasswd" 1>&2; exit 1; }
1832         fi
1833         ol_enable_kpasswd="$ol_arg"
1834
1835 else
1836         ol_enable_kpasswd="no"
1837 fi
1838 # end --enable-kpasswd
1839 # OpenLDAP --enable-lmpasswd
1840         # Check whether --enable-lmpasswd or --disable-lmpasswd was given.
1841 if test "${enable_lmpasswd+set}" = set; then
1842   enableval="$enable_lmpasswd"
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-lmpasswd" 1>&2; exit 1; }
1852         fi
1853         ol_enable_lmpasswd="$ol_arg"
1854
1855 else
1856         ol_enable_lmpasswd="no"
1857 fi
1858 # end --enable-lmpasswd
1859 # OpenLDAP --enable-spasswd
1860         # Check whether --enable-spasswd or --disable-spasswd was given.
1861 if test "${enable_spasswd+set}" = set; then
1862   enableval="$enable_spasswd"
1863   
1864         ol_arg=invalid
1865         for ol_val in auto yes no ; do
1866                 if test "$enableval" = "$ol_val" ; then
1867                         ol_arg="$ol_val"
1868                 fi
1869         done
1870         if test "$ol_arg" = "invalid" ; then
1871                 { echo "configure: error: bad value $enableval for --enable-spasswd" 1>&2; exit 1; }
1872         fi
1873         ol_enable_spasswd="$ol_arg"
1874
1875 else
1876         ol_enable_spasswd="no"
1877 fi
1878 # end --enable-spasswd
1879 # OpenLDAP --enable-modules
1880         # Check whether --enable-modules or --disable-modules was given.
1881 if test "${enable_modules+set}" = set; then
1882   enableval="$enable_modules"
1883   
1884         ol_arg=invalid
1885         for ol_val in auto yes no ; do
1886                 if test "$enableval" = "$ol_val" ; then
1887                         ol_arg="$ol_val"
1888                 fi
1889         done
1890         if test "$ol_arg" = "invalid" ; then
1891                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1892         fi
1893         ol_enable_modules="$ol_arg"
1894
1895 else
1896         ol_enable_modules="no"
1897 fi
1898 # end --enable-modules
1899 ol_enable_multimaster=${ol_enable_multimaster-no}
1900 # OpenLDAP --enable-phonetic
1901         # Check whether --enable-phonetic or --disable-phonetic was given.
1902 if test "${enable_phonetic+set}" = set; then
1903   enableval="$enable_phonetic"
1904   
1905         ol_arg=invalid
1906         for ol_val in auto yes no ; do
1907                 if test "$enableval" = "$ol_val" ; then
1908                         ol_arg="$ol_val"
1909                 fi
1910         done
1911         if test "$ol_arg" = "invalid" ; then
1912                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1913         fi
1914         ol_enable_phonetic="$ol_arg"
1915
1916 else
1917         ol_enable_phonetic="no"
1918 fi
1919 # end --enable-phonetic
1920 # OpenLDAP --enable-rewrite
1921         # Check whether --enable-rewrite or --disable-rewrite was given.
1922 if test "${enable_rewrite+set}" = set; then
1923   enableval="$enable_rewrite"
1924   
1925         ol_arg=invalid
1926         for ol_val in auto yes no ; do
1927                 if test "$enableval" = "$ol_val" ; then
1928                         ol_arg="$ol_val"
1929                 fi
1930         done
1931         if test "$ol_arg" = "invalid" ; then
1932                 { echo "configure: error: bad value $enableval for --enable-rewrite" 1>&2; exit 1; }
1933         fi
1934         ol_enable_rewrite="$ol_arg"
1935
1936 else
1937         ol_enable_rewrite="no"
1938 fi
1939 # end --enable-rewrite
1940 # OpenLDAP --enable-rlookups
1941         # Check whether --enable-rlookups or --disable-rlookups was given.
1942 if test "${enable_rlookups+set}" = set; then
1943   enableval="$enable_rlookups"
1944   
1945         ol_arg=invalid
1946         for ol_val in auto yes no ; do
1947                 if test "$enableval" = "$ol_val" ; then
1948                         ol_arg="$ol_val"
1949                 fi
1950         done
1951         if test "$ol_arg" = "invalid" ; then
1952                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1953         fi
1954         ol_enable_rlookups="$ol_arg"
1955
1956 else
1957         ol_enable_rlookups="no"
1958 fi
1959 # end --enable-rlookups
1960 # OpenLDAP --enable-slp
1961         # Check whether --enable-slp or --disable-slp was given.
1962 if test "${enable_slp+set}" = set; then
1963   enableval="$enable_slp"
1964   
1965         ol_arg=invalid
1966         for ol_val in auto yes no ; do
1967                 if test "$enableval" = "$ol_val" ; then
1968                         ol_arg="$ol_val"
1969                 fi
1970         done
1971         if test "$ol_arg" = "invalid" ; then
1972                 { echo "configure: error: bad value $enableval for --enable-slp" 1>&2; exit 1; }
1973         fi
1974         ol_enable_slp="$ol_arg"
1975
1976 else
1977         ol_enable_slp="no"
1978 fi
1979 # end --enable-slp
1980 # OpenLDAP --enable-wrappers
1981         # Check whether --enable-wrappers or --disable-wrappers was given.
1982 if test "${enable_wrappers+set}" = set; then
1983   enableval="$enable_wrappers"
1984   
1985         ol_arg=invalid
1986         for ol_val in auto yes no ; do
1987                 if test "$enableval" = "$ol_val" ; then
1988                         ol_arg="$ol_val"
1989                 fi
1990         done
1991         if test "$ol_arg" = "invalid" ; then
1992                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1993         fi
1994         ol_enable_wrappers="$ol_arg"
1995
1996 else
1997         ol_enable_wrappers="no"
1998 fi
1999 # end --enable-wrappers
2000
2001 # OpenLDAP --enable-slapi
2002         # Check whether --enable-slapi or --disable-slapi was given.
2003 if test "${enable_slapi+set}" = set; then
2004   enableval="$enable_slapi"
2005   
2006         ol_arg=invalid
2007         for ol_val in auto yes no ; do
2008                 if test "$enableval" = "$ol_val" ; then
2009                         ol_arg="$ol_val"
2010                 fi
2011         done
2012         if test "$ol_arg" = "invalid" ; then
2013                 { echo "configure: error: bad value $enableval for --enable-slapi" 1>&2; exit 1; }
2014         fi
2015         ol_enable_slapi="$ol_arg"
2016
2017 else
2018         ol_enable_slapi="no"
2019 fi
2020 # end --enable-slapi
2021
2022 # OpenLDAP --enable-bdb
2023         # Check whether --enable-bdb or --disable-bdb was given.
2024 if test "${enable_bdb+set}" = set; then
2025   enableval="$enable_bdb"
2026   
2027         ol_arg=invalid
2028         for ol_val in auto yes no ; do
2029                 if test "$enableval" = "$ol_val" ; then
2030                         ol_arg="$ol_val"
2031                 fi
2032         done
2033         if test "$ol_arg" = "invalid" ; then
2034                 { echo "configure: error: bad value $enableval for --enable-bdb" 1>&2; exit 1; }
2035         fi
2036         ol_enable_bdb="$ol_arg"
2037
2038 else
2039         ol_enable_bdb="yes"
2040 fi
2041 # end --enable-bdb
2042 # OpenLDAP --with-bdb_module
2043         # Check whether --with-bdb_module or --without-bdb_module was given.
2044 if test "${with_bdb_module+set}" = set; then
2045   withval="$with_bdb_module"
2046   
2047         ol_arg=invalid
2048         for ol_val in static dynamic ; do
2049                 if test "$withval" = "$ol_val" ; then
2050                         ol_arg="$ol_val"
2051                 fi
2052         done
2053         if test "$ol_arg" = "invalid" ; then
2054                 { echo "configure: error: bad value $withval for --with-bdb_module" 1>&2; exit 1; }
2055         fi
2056         ol_with_bdb_module="$ol_arg"
2057
2058 else
2059         ol_with_bdb_module="static"
2060 fi
2061 # end --with-bdb_module
2062
2063 # OpenLDAP --enable-dnssrv
2064         # Check whether --enable-dnssrv or --disable-dnssrv was given.
2065 if test "${enable_dnssrv+set}" = set; then
2066   enableval="$enable_dnssrv"
2067   
2068         ol_arg=invalid
2069         for ol_val in auto yes no ; do
2070                 if test "$enableval" = "$ol_val" ; then
2071                         ol_arg="$ol_val"
2072                 fi
2073         done
2074         if test "$ol_arg" = "invalid" ; then
2075                 { echo "configure: error: bad value $enableval for --enable-dnssrv" 1>&2; exit 1; }
2076         fi
2077         ol_enable_dnssrv="$ol_arg"
2078
2079 else
2080         ol_enable_dnssrv="no"
2081 fi
2082 # end --enable-dnssrv
2083 # OpenLDAP --with-dnssrv_module
2084         # Check whether --with-dnssrv_module or --without-dnssrv_module was given.
2085 if test "${with_dnssrv_module+set}" = set; then
2086   withval="$with_dnssrv_module"
2087   
2088         ol_arg=invalid
2089         for ol_val in static dynamic ; do
2090                 if test "$withval" = "$ol_val" ; then
2091                         ol_arg="$ol_val"
2092                 fi
2093         done
2094         if test "$ol_arg" = "invalid" ; then
2095                 { echo "configure: error: bad value $withval for --with-dnssrv_module" 1>&2; exit 1; }
2096         fi
2097         ol_with_dnssrv_module="$ol_arg"
2098
2099 else
2100         ol_with_dnssrv_module="static"
2101 fi
2102 # end --with-dnssrv_module
2103
2104 # OpenLDAP --enable-ldap
2105         # Check whether --enable-ldap or --disable-ldap was given.
2106 if test "${enable_ldap+set}" = set; then
2107   enableval="$enable_ldap"
2108   
2109         ol_arg=invalid
2110         for ol_val in auto yes no ; do
2111                 if test "$enableval" = "$ol_val" ; then
2112                         ol_arg="$ol_val"
2113                 fi
2114         done
2115         if test "$ol_arg" = "invalid" ; then
2116                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
2117         fi
2118         ol_enable_ldap="$ol_arg"
2119
2120 else
2121         ol_enable_ldap="no"
2122 fi
2123 # end --enable-ldap
2124 # OpenLDAP --with-ldap_module
2125         # Check whether --with-ldap_module or --without-ldap_module was given.
2126 if test "${with_ldap_module+set}" = set; then
2127   withval="$with_ldap_module"
2128   
2129         ol_arg=invalid
2130         for ol_val in static dynamic ; do
2131                 if test "$withval" = "$ol_val" ; then
2132                         ol_arg="$ol_val"
2133                 fi
2134         done
2135         if test "$ol_arg" = "invalid" ; then
2136                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
2137         fi
2138         ol_with_ldap_module="$ol_arg"
2139
2140 else
2141         ol_with_ldap_module="static"
2142 fi
2143 # end --with-ldap_module
2144
2145 # OpenLDAP --enable-ldbm
2146         # Check whether --enable-ldbm or --disable-ldbm was given.
2147 if test "${enable_ldbm+set}" = set; then
2148   enableval="$enable_ldbm"
2149   
2150         ol_arg=invalid
2151         for ol_val in auto yes no ; do
2152                 if test "$enableval" = "$ol_val" ; then
2153                         ol_arg="$ol_val"
2154                 fi
2155         done
2156         if test "$ol_arg" = "invalid" ; then
2157                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
2158         fi
2159         ol_enable_ldbm="$ol_arg"
2160
2161 else
2162         ol_enable_ldbm="no"
2163 fi
2164 # end --enable-ldbm
2165 # OpenLDAP --with-ldbm_api
2166         # Check whether --with-ldbm_api or --without-ldbm_api was given.
2167 if test "${with_ldbm_api+set}" = set; then
2168   withval="$with_ldbm_api"
2169   
2170         ol_arg=invalid
2171         for ol_val in auto berkeley bcompat mdbm gdbm ; do
2172                 if test "$withval" = "$ol_val" ; then
2173                         ol_arg="$ol_val"
2174                 fi
2175         done
2176         if test "$ol_arg" = "invalid" ; then
2177                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
2178         fi
2179         ol_with_ldbm_api="$ol_arg"
2180
2181 else
2182         ol_with_ldbm_api="auto"
2183 fi
2184 # end --with-ldbm_api
2185
2186 # OpenLDAP --with-ldbm_module
2187         # Check whether --with-ldbm_module or --without-ldbm_module was given.
2188 if test "${with_ldbm_module+set}" = set; then
2189   withval="$with_ldbm_module"
2190   
2191         ol_arg=invalid
2192         for ol_val in static dynamic ; do
2193                 if test "$withval" = "$ol_val" ; then
2194                         ol_arg="$ol_val"
2195                 fi
2196         done
2197         if test "$ol_arg" = "invalid" ; then
2198                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
2199         fi
2200         ol_with_ldbm_module="$ol_arg"
2201
2202 else
2203         ol_with_ldbm_module="static"
2204 fi
2205 # end --with-ldbm_module
2206
2207 # OpenLDAP --with-ldbm_type
2208         # Check whether --with-ldbm_type or --without-ldbm_type was given.
2209 if test "${with_ldbm_type+set}" = set; then
2210   withval="$with_ldbm_type"
2211   
2212         ol_arg=invalid
2213         for ol_val in auto btree hash ; do
2214                 if test "$withval" = "$ol_val" ; then
2215                         ol_arg="$ol_val"
2216                 fi
2217         done
2218         if test "$ol_arg" = "invalid" ; then
2219                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
2220         fi
2221         ol_with_ldbm_type="$ol_arg"
2222
2223 else
2224         ol_with_ldbm_type="auto"
2225 fi
2226 # end --with-ldbm_type
2227
2228 # OpenLDAP --enable-meta
2229         # Check whether --enable-meta or --disable-meta was given.
2230 if test "${enable_meta+set}" = set; then
2231   enableval="$enable_meta"
2232   
2233         ol_arg=invalid
2234         for ol_val in auto yes no ; do
2235                 if test "$enableval" = "$ol_val" ; then
2236                         ol_arg="$ol_val"
2237                 fi
2238         done
2239         if test "$ol_arg" = "invalid" ; then
2240                 { echo "configure: error: bad value $enableval for --enable-meta" 1>&2; exit 1; }
2241         fi
2242         ol_enable_meta="$ol_arg"
2243
2244 else
2245         ol_enable_meta="no"
2246 fi
2247 # end --enable-meta
2248 # OpenLDAP --with-meta_module
2249         # Check whether --with-meta_module or --without-meta_module was given.
2250 if test "${with_meta_module+set}" = set; then
2251   withval="$with_meta_module"
2252   
2253         ol_arg=invalid
2254         for ol_val in static dynamic ; do
2255                 if test "$withval" = "$ol_val" ; then
2256                         ol_arg="$ol_val"
2257                 fi
2258         done
2259         if test "$ol_arg" = "invalid" ; then
2260                 { echo "configure: error: bad value $withval for --with-meta_module" 1>&2; exit 1; }
2261         fi
2262         ol_with_meta_module="$ol_arg"
2263
2264 else
2265         ol_with_meta_module="static"
2266 fi
2267 # end --with-meta_module
2268
2269 # OpenLDAP --enable-monitor
2270         # Check whether --enable-monitor or --disable-monitor was given.
2271 if test "${enable_monitor+set}" = set; then
2272   enableval="$enable_monitor"
2273   
2274         ol_arg=invalid
2275         for ol_val in auto yes no ; do
2276                 if test "$enableval" = "$ol_val" ; then
2277                         ol_arg="$ol_val"
2278                 fi
2279         done
2280         if test "$ol_arg" = "invalid" ; then
2281                 { echo "configure: error: bad value $enableval for --enable-monitor" 1>&2; exit 1; }
2282         fi
2283         ol_enable_monitor="$ol_arg"
2284
2285 else
2286         ol_enable_monitor="no"
2287 fi
2288 # end --enable-monitor
2289 # OpenLDAP --with-monitor_module
2290         # Check whether --with-monitor_module or --without-monitor_module was given.
2291 if test "${with_monitor_module+set}" = set; then
2292   withval="$with_monitor_module"
2293   
2294         ol_arg=invalid
2295         for ol_val in static dynamic ; do
2296                 if test "$withval" = "$ol_val" ; then
2297                         ol_arg="$ol_val"
2298                 fi
2299         done
2300         if test "$ol_arg" = "invalid" ; then
2301                 { echo "configure: error: bad value $withval for --with-monitor_module" 1>&2; exit 1; }
2302         fi
2303         ol_with_monitor_module="$ol_arg"
2304
2305 else
2306         ol_with_monitor_module="static"
2307 fi
2308 # end --with-monitor_module
2309
2310 # OpenLDAP --enable-null
2311         # Check whether --enable-null or --disable-null was given.
2312 if test "${enable_null+set}" = set; then
2313   enableval="$enable_null"
2314   
2315         ol_arg=invalid
2316         for ol_val in auto yes no ; do
2317                 if test "$enableval" = "$ol_val" ; then
2318                         ol_arg="$ol_val"
2319                 fi
2320         done
2321         if test "$ol_arg" = "invalid" ; then
2322                 { echo "configure: error: bad value $enableval for --enable-null" 1>&2; exit 1; }
2323         fi
2324         ol_enable_null="$ol_arg"
2325
2326 else
2327         ol_enable_null="no"
2328 fi
2329 # end --enable-null
2330 # OpenLDAP --with-null_module
2331         # Check whether --with-null_module or --without-null_module was given.
2332 if test "${with_null_module+set}" = set; then
2333   withval="$with_null_module"
2334   
2335         ol_arg=invalid
2336         for ol_val in static dynamic ; do
2337                 if test "$withval" = "$ol_val" ; then
2338                         ol_arg="$ol_val"
2339                 fi
2340         done
2341         if test "$ol_arg" = "invalid" ; then
2342                 { echo "configure: error: bad value $withval for --with-null_module" 1>&2; exit 1; }
2343         fi
2344         ol_with_null_module="$ol_arg"
2345
2346 else
2347         ol_with_null_module="static"
2348 fi
2349 # end --with-null_module
2350
2351 # OpenLDAP --enable-passwd
2352         # Check whether --enable-passwd or --disable-passwd was given.
2353 if test "${enable_passwd+set}" = set; then
2354   enableval="$enable_passwd"
2355   
2356         ol_arg=invalid
2357         for ol_val in auto yes no ; do
2358                 if test "$enableval" = "$ol_val" ; then
2359                         ol_arg="$ol_val"
2360                 fi
2361         done
2362         if test "$ol_arg" = "invalid" ; then
2363                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
2364         fi
2365         ol_enable_passwd="$ol_arg"
2366
2367 else
2368         ol_enable_passwd="no"
2369 fi
2370 # end --enable-passwd
2371 # OpenLDAP --with-passwd_module
2372         # Check whether --with-passwd_module or --without-passwd_module was given.
2373 if test "${with_passwd_module+set}" = set; then
2374   withval="$with_passwd_module"
2375   
2376         ol_arg=invalid
2377         for ol_val in static dynamic ; do
2378                 if test "$withval" = "$ol_val" ; then
2379                         ol_arg="$ol_val"
2380                 fi
2381         done
2382         if test "$ol_arg" = "invalid" ; then
2383                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
2384         fi
2385         ol_with_passwd_module="$ol_arg"
2386
2387 else
2388         ol_with_passwd_module="static"
2389 fi
2390 # end --with-passwd_module
2391
2392 # OpenLDAP --enable-perl
2393         # Check whether --enable-perl or --disable-perl was given.
2394 if test "${enable_perl+set}" = set; then
2395   enableval="$enable_perl"
2396   
2397         ol_arg=invalid
2398         for ol_val in auto yes no ; do
2399                 if test "$enableval" = "$ol_val" ; then
2400                         ol_arg="$ol_val"
2401                 fi
2402         done
2403         if test "$ol_arg" = "invalid" ; then
2404                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
2405         fi
2406         ol_enable_perl="$ol_arg"
2407
2408 else
2409         ol_enable_perl="no"
2410 fi
2411 # end --enable-perl
2412 # OpenLDAP --with-perl_module
2413         # Check whether --with-perl_module or --without-perl_module was given.
2414 if test "${with_perl_module+set}" = set; then
2415   withval="$with_perl_module"
2416   
2417         ol_arg=invalid
2418         for ol_val in static dynamic ; do
2419                 if test "$withval" = "$ol_val" ; then
2420                         ol_arg="$ol_val"
2421                 fi
2422         done
2423         if test "$ol_arg" = "invalid" ; then
2424                 { echo "configure: error: bad value $withval for --with-perl_module" 1>&2; exit 1; }
2425         fi
2426         ol_with_perl_module="$ol_arg"
2427
2428 else
2429         ol_with_perl_module="static"
2430 fi
2431 # end --with-perl_module
2432
2433 # OpenLDAP --enable-shell
2434         # Check whether --enable-shell or --disable-shell was given.
2435 if test "${enable_shell+set}" = set; then
2436   enableval="$enable_shell"
2437   
2438         ol_arg=invalid
2439         for ol_val in auto yes no ; do
2440                 if test "$enableval" = "$ol_val" ; then
2441                         ol_arg="$ol_val"
2442                 fi
2443         done
2444         if test "$ol_arg" = "invalid" ; then
2445                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
2446         fi
2447         ol_enable_shell="$ol_arg"
2448
2449 else
2450         ol_enable_shell="no"
2451 fi
2452 # end --enable-shell
2453 # OpenLDAP --with-shell_module
2454         # Check whether --with-shell_module or --without-shell_module was given.
2455 if test "${with_shell_module+set}" = set; then
2456   withval="$with_shell_module"
2457   
2458         ol_arg=invalid
2459         for ol_val in static dynamic ; do
2460                 if test "$withval" = "$ol_val" ; then
2461                         ol_arg="$ol_val"
2462                 fi
2463         done
2464         if test "$ol_arg" = "invalid" ; then
2465                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
2466         fi
2467         ol_with_shell_module="$ol_arg"
2468
2469 else
2470         ol_with_shell_module="static"
2471 fi
2472 # end --with-shell_module
2473
2474 # OpenLDAP --enable-sql
2475         # Check whether --enable-sql or --disable-sql was given.
2476 if test "${enable_sql+set}" = set; then
2477   enableval="$enable_sql"
2478   
2479         ol_arg=invalid
2480         for ol_val in auto yes no ; do
2481                 if test "$enableval" = "$ol_val" ; then
2482                         ol_arg="$ol_val"
2483                 fi
2484         done
2485         if test "$ol_arg" = "invalid" ; then
2486                 { echo "configure: error: bad value $enableval for --enable-sql" 1>&2; exit 1; }
2487         fi
2488         ol_enable_sql="$ol_arg"
2489
2490 else
2491         ol_enable_sql="no"
2492 fi
2493 # end --enable-sql
2494 # OpenLDAP --with-sql_module
2495         # Check whether --with-sql_module or --without-sql_module was given.
2496 if test "${with_sql_module+set}" = set; then
2497   withval="$with_sql_module"
2498   
2499         ol_arg=invalid
2500         for ol_val in static dynamic ; do
2501                 if test "$withval" = "$ol_val" ; then
2502                         ol_arg="$ol_val"
2503                 fi
2504         done
2505         if test "$ol_arg" = "invalid" ; then
2506                 { echo "configure: error: bad value $withval for --with-sql_module" 1>&2; exit 1; }
2507         fi
2508         ol_with_sql_module="$ol_arg"
2509
2510 else
2511         ol_with_sql_module="static"
2512 fi
2513 # end --with-sql_module
2514
2515 # OpenLDAP --enable-tcl
2516         # Check whether --enable-tcl or --disable-tcl was given.
2517 if test "${enable_tcl+set}" = set; then
2518   enableval="$enable_tcl"
2519   
2520         ol_arg=invalid
2521         for ol_val in auto yes no ; do
2522                 if test "$enableval" = "$ol_val" ; then
2523                         ol_arg="$ol_val"
2524                 fi
2525         done
2526         if test "$ol_arg" = "invalid" ; then
2527                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
2528         fi
2529         ol_enable_tcl="$ol_arg"
2530
2531 else
2532         ol_enable_tcl="no"
2533 fi
2534 # end --enable-tcl
2535 # OpenLDAP --with-tcl_module
2536         # Check whether --with-tcl_module or --without-tcl_module was given.
2537 if test "${with_tcl_module+set}" = set; then
2538   withval="$with_tcl_module"
2539   
2540         ol_arg=invalid
2541         for ol_val in static dynamic ; do
2542                 if test "$withval" = "$ol_val" ; then
2543                         ol_arg="$ol_val"
2544                 fi
2545         done
2546         if test "$ol_arg" = "invalid" ; then
2547                 { echo "configure: error: bad value $withval for --with-tcl_module" 1>&2; exit 1; }
2548         fi
2549         ol_with_tcl_module="$ol_arg"
2550
2551 else
2552         ol_with_tcl_module="static"
2553 fi
2554 # end --with-tcl_module
2555
2556
2557 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2558 if test "${with_xxslurpdoptions+set}" = set; then
2559   withval="$with_xxslurpdoptions"
2560   :
2561 fi
2562
2563 # OpenLDAP --enable-slurpd
2564         # Check whether --enable-slurpd or --disable-slurpd was given.
2565 if test "${enable_slurpd+set}" = set; then
2566   enableval="$enable_slurpd"
2567   
2568         ol_arg=invalid
2569         for ol_val in auto yes no ; do
2570                 if test "$enableval" = "$ol_val" ; then
2571                         ol_arg="$ol_val"
2572                 fi
2573         done
2574         if test "$ol_arg" = "invalid" ; then
2575                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2576         fi
2577         ol_enable_slurpd="$ol_arg"
2578
2579 else
2580         ol_enable_slurpd="auto"
2581 fi
2582 # end --enable-slurpd
2583
2584 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2585 if test "${with_xxliboptions+set}" = set; then
2586   withval="$with_xxliboptions"
2587   :
2588 fi
2589
2590 # Check whether --enable-static or --disable-static was given.
2591 if test "${enable_static+set}" = set; then
2592   enableval="$enable_static"
2593   p=${PACKAGE-default}
2594 case $enableval in
2595 yes) enable_static=yes ;;
2596 no) enable_static=no ;;
2597 *)
2598   enable_static=no
2599   # Look at the argument we got.  We use all the common list separators.
2600   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2601   for pkg in $enableval; do
2602     if test "X$pkg" = "X$p"; then
2603       enable_static=yes
2604     fi
2605   done
2606   IFS="$ac_save_ifs"
2607   ;;
2608 esac
2609 else
2610   enable_static=yes
2611 fi
2612
2613 # Check whether --enable-shared or --disable-shared was given.
2614 if test "${enable_shared+set}" = set; then
2615   enableval="$enable_shared"
2616   p=${PACKAGE-default}
2617 case $enableval in
2618 yes) enable_shared=yes ;;
2619 no) enable_shared=no ;;
2620 *)
2621   enable_shared=no
2622   # Look at the argument we got.  We use all the common list separators.
2623   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2624   for pkg in $enableval; do
2625     if test "X$pkg" = "X$p"; then
2626       enable_shared=yes
2627     fi
2628   done
2629   IFS="$ac_save_ifs"
2630   ;;
2631 esac
2632 else
2633   enable_shared=yes
2634 fi
2635
2636
2637
2638 # validate options
2639 if test $ol_enable_slapd = no ; then
2640                 if test $ol_enable_slapi = yes ; then
2641                 echo "configure: warning: slapd disabled, ignoring --enable-slapi argument" 1>&2
2642         fi
2643         if test $ol_enable_bdb = yes ; then
2644                 echo "configure: warning: slapd disabled, ignoring --enable-bdb argument" 1>&2
2645         fi
2646         if test $ol_enable_dnssrv = yes ; then
2647                 echo "configure: warning: slapd disabled, ignoring --enable-dnssrv argument" 1>&2
2648         fi
2649         if test $ol_enable_ldap = yes ; then
2650                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2651         fi
2652         if test $ol_enable_ldbm = yes ; then
2653                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2654         fi
2655         if test $ol_enable_meta = yes ; then
2656                 echo "configure: warning: slapd disabled, ignoring --enable-meta argument" 1>&2
2657         fi
2658         if test $ol_enable_monitor = yes ; then
2659                 echo "configure: warning: slapd disabled, ignoring --enable-monitor argument" 1>&2
2660         fi
2661         if test $ol_enable_null = yes ; then
2662                 echo "configure: warning: slapd disabled, ignoring --enable-null argument" 1>&2
2663         fi
2664         if test $ol_enable_passwd = yes ; then
2665                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2666         fi
2667         if test $ol_enable_perl = yes ; then
2668                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
2669         fi
2670         if test $ol_enable_shell = yes ; then
2671                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2672         fi
2673         if test $ol_enable_tcl = yes ; then
2674                 echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
2675         fi
2676         if test $ol_enable_sql = yes ; then
2677                 echo "configure: warning: slapd disabled, ignoring --enable-sql argument" 1>&2
2678         fi
2679         if test $ol_enable_modules = yes ; then
2680                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2681         fi
2682         if test $ol_enable_multimaster = yes ; then
2683                 echo "configure: warning: slapd disabled, ignoring --enable-multimaster argument" 1>&2
2684         fi
2685         if test $ol_enable_wrappers = yes ; then
2686                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2687         fi
2688         if test $ol_enable_phonetic = yes ; then
2689                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2690         fi
2691         if test $ol_enable_rlookups = yes ; then
2692                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2693         fi
2694         if test $ol_enable_aci = yes ; then
2695                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2696         fi
2697         if test $ol_with_ldbm_api != auto ; then
2698                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2699         fi
2700         if test $ol_with_ldbm_type != auto ; then
2701                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2702         fi
2703         if test $ol_with_bdb_module != static ; then
2704                 echo "configure: warning: slapd disabled, ignoring --with-bdb-module argument" 1>&2
2705         fi
2706         if test $ol_with_dnssrv_module != static ; then
2707                 echo "configure: warning: slapd disabled, ignoring --with-dnssrv-module argument" 1>&2
2708         fi
2709         if test $ol_with_ldap_module != static ; then
2710                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2711         fi
2712         if test $ol_with_ldbm_module != static ; then
2713                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2714         fi
2715         if test $ol_with_meta_module != static ; then
2716                 echo "configure: warning: slapd disabled, ignoring --with-meta-module argument" 1>&2
2717         fi
2718         if test $ol_with_monitor_module != static ; then
2719                 echo "configure: warning: slapd disabled, ignoring --with-monitor-module argument" 1>&2
2720         fi
2721         if test $ol_with_null_module != static ; then
2722                 echo "configure: warning: slapd disabled, ignoring --with-null-module argument" 1>&2
2723         fi
2724         if test $ol_with_passwd_module != static ; then
2725                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2726         fi
2727         if test $ol_with_perl_module != static ; then
2728                 echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2
2729         fi
2730         if test $ol_with_shell_module != static ; then
2731                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2732         fi
2733         if test $ol_with_tcl_module != static ; then
2734                 echo "configure: warning: slapd disabled, ignoring --with-tcl-module argument" 1>&2
2735         fi
2736         if test $ol_with_sql_module != static ; then
2737                 echo "configure: warning: slapd disabled, ignoring --with-sql-module argument" 1>&2
2738         fi
2739         if test $ol_enable_slurpd = yes ; then
2740                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2741         fi
2742         if test $ol_enable_rewrite = yes ; then
2743                 echo "configure: warning: slapd disabled, ignoring --enable-rewrite argument" 1>&2
2744         fi
2745
2746         # force settings to no
2747         ol_enable_slapi=no
2748         ol_enable_bdb=no
2749         ol_enable_dnssrv=no
2750         ol_enable_ldap=no
2751         ol_enable_ldbm=no
2752         ol_enable_meta=no
2753         ol_enable_monitor=no
2754         ol_enable_null=no
2755         ol_enable_passwd=no
2756         ol_enable_perl=no
2757         ol_enable_shell=no
2758         ol_enable_tcl=no
2759         ol_enable_sql=no
2760
2761         ol_enable_modules=no
2762         ol_enable_multimaster=no
2763         ol_enable_phonetic=no
2764         ol_enable_rlookups=no
2765         ol_enable_aci=no
2766         ol_enable_wrappers=no
2767         ol_enable_dynamic=no
2768
2769         ol_with_ldbm_api=no
2770         ol_with_ldbm_type=no
2771
2772         ol_with_bdb_module=static
2773         ol_with_dnssrv_module=static
2774         ol_with_ldap_module=static
2775         ol_with_ldbm_module=static
2776         ol_with_meta_module=static
2777         ol_with_monitor_module=static
2778         ol_with_null_module=static
2779         ol_with_passwd_module=static
2780         ol_with_perl_module=static
2781         ol_with_shell_module=static
2782         ol_with_tcl_module=static
2783         ol_with_sql_module=static
2784
2785         ol_enable_slurpd=no
2786
2787         ol_enable_rewrite=no
2788
2789 elif test $ol_enable_ldbm = no ; then
2790         
2791         if test $ol_with_ldbm_api != auto ; then
2792                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2793         fi
2794
2795         if test $ol_with_ldbm_type != auto ; then
2796                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2797         fi
2798
2799         if test $ol_with_ldbm_module != static ; then
2800                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2801         fi
2802
2803         if test $ol_enable_modules != yes -a \
2804                 $ol_enable_bdb = no -a \
2805                 $ol_enable_dnssrv = no -a \
2806                 $ol_enable_ldap = no -a \
2807                 $ol_enable_meta = no -a \
2808                 $ol_enable_monitor = no -a \
2809                 $ol_enable_null = no -a \
2810                 $ol_enable_passwd = no -a \
2811                 $ol_enable_perl = no -a \
2812                 $ol_enable_shell = no -a \
2813                 $ol_enable_sql = no -a \
2814                 $ol_enable_tcl = no ; then
2815
2816                 if test $ol_enable_slapd = yes ; then
2817                         { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2818                 else
2819                         echo "configure: warning: skipping slapd, no backend specified" 1>&2
2820                         ol_enable_slapd=no
2821                 fi
2822         fi
2823
2824         ol_with_ldbm_api=no
2825         ol_with_ldbm_type=no
2826         ol_with_ldbm_module=static
2827
2828         if test $ol_enable_bdb != no ; then
2829                 ol_with_ldbm_api=berkeley
2830         fi
2831
2832 else
2833                 if test $ol_with_ldbm_api = gdbm -a \
2834                 $ol_with_ldbm_type = btree ; then
2835                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2836         fi
2837         if test $ol_with_ldbm_api = mdbm -a \
2838                 $ol_with_ldbm_type = btree ; then
2839                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2840         fi
2841         if test $ol_with_ldbm_api = ndbm -a \
2842                 $ol_with_ldbm_type = btree ; then
2843                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2844         fi
2845
2846         if test $ol_enable_bdb = yes ; then
2847                 if test $ol_with_ldbm_api = auto ; then
2848                         ol_with_ldbm_api=berkeley
2849                 elif test $ol_with_ldbm_api != berkeley ; then
2850                         { echo "configure: error: LDBM API not compatible with BDB" 1>&2; exit 1; }
2851                 fi
2852
2853         elif test $ol_enable_bdb = auto ; then
2854                 if test $ol_with_ldbm_api != berkeley \
2855                         -o $ol_with_ldbm_api != auto ; then
2856                         echo "configure: warning: LDBM API not compatible with BDB, disabling BDB" 1>&2
2857                         ol_enable_bdb=no
2858                 fi
2859         fi
2860 fi
2861
2862 if test $ol_enable_slurpd = yes ; then
2863                 if test $ol_with_threads = no ; then
2864                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2865         fi
2866 fi
2867
2868 if test $ol_enable_lmpasswd = yes ; then
2869         if test $ol_with_tls = no ; then
2870                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
2871         fi
2872 fi
2873
2874 if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
2875         if test $ol_with_kerberos = no ; then
2876                 { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
2877         elif test $ol_with_kerberos = auto ; then
2878                 ol_with_kerberos=yes
2879         fi
2880
2881 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
2882         if test $ol_with_kerberos = auto ; then
2883                 ol_with_kerberos=no
2884         elif test $ol_with_kerberos != no ; then
2885                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2886                 ol_with_kerberos=no
2887         fi
2888 fi
2889
2890 if test $ol_enable_spasswd = yes ; then
2891         if test $ol_with_cyrus_sasl = no ; then
2892                 { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
2893         fi
2894         ol_with_cyrus_sasl=yes
2895 fi
2896
2897 echo "$ac_t""done" 1>&6
2898
2899 LDAP_LIBS=
2900 LDIF_LIBS=
2901 LDBM_LIBS=
2902 LTHREAD_LIBS=
2903 LUTIL_LIBS=
2904
2905 SLAPD_LIBS=
2906 SLURPD_LIBS=
2907
2908 BUILD_SLAPD=no
2909 BUILD_SLURPD=no
2910
2911 BUILD_THREAD=no
2912
2913 BUILD_SLAPI=no
2914 SLAPD_SLAPI_DEPEND=
2915
2916 BUILD_BDB=no
2917 BUILD_DNSSRV=no
2918 BUILD_LDAP=no
2919 BUILD_LDBM=no
2920 BUILD_META=no
2921 BUILD_MONITOR=no
2922 BUILD_NULL=no
2923 BUILD_PASSWD=no
2924 BUILD_PERL=no
2925 BUILD_SHELL=no
2926 BUILD_SQL=no
2927 BUILD_TCL=no
2928
2929 BUILD_BDB_DYNAMIC=static
2930 BUILD_DNSSRV_DYNAMIC=static
2931 BUILD_LDAP_DYNAMIC=static
2932 BUILD_LDBM_DYNAMIC=static
2933 BUILD_META_DYNAMIC=static
2934 BUILD_MONITOR_DYNAMIC=static
2935 BUILD_NULL_DYNAMIC=static
2936 BUILD_PASSWD_DYNAMIC=static
2937 BUILD_PERL_DYNAMIC=static
2938 BUILD_SHELL_DYNAMIC=static
2939 BUILD_TCL_DYNAMIC=static
2940 BUILD_SQL_DYNAMIC=static
2941
2942 SLAPD_MODULES_LDFLAGS=
2943 SLAPD_MODULES_CPPFLAGS=
2944
2945 SLAPD_STATIC_BACKENDS=
2946 SLAPD_DYNAMIC_BACKENDS=
2947
2948 SLAPD_PERL_LDFLAGS=
2949 MOD_PERL_LDFLAGS=
2950 PERL_CPPFLAGS=
2951
2952 SLAPD_SQL_LDFLAGS=
2953 SLAPD_SQL_LIBS=
2954 SLAPD_SQL_INCLUDES=
2955
2956 MOD_TCL_LIB=
2957 KRB4_LIBS=
2958 KRB5_LIBS=
2959 READLINE_LIBS=
2960 SASL_LIBS=
2961 TERMCAP_LIBS=
2962 TLS_LIBS=
2963 MODULES_LIBS=
2964 SLAPI_LIBS=
2965 LIBSLAPI=
2966 LIBSLAPITOOLS=
2967 AUTH_LIBS=
2968
2969 SLAPD_SLP_LIBS=
2970
2971
2972 # Find a good install program.  We prefer a C program (faster),
2973 # so one script is as good as another.  But avoid the broken or
2974 # incompatible versions:
2975 # SysV /etc/install, /usr/sbin/install
2976 # SunOS /usr/etc/install
2977 # IRIX /sbin/install
2978 # AIX /bin/install
2979 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2980 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2981 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2982 # ./install, which can be erroneously created by make from ./install.sh.
2983 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
2984 echo "configure:2985: checking for a BSD compatible install" >&5
2985 if test -z "$INSTALL"; then
2986 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
2987   echo $ac_n "(cached) $ac_c" 1>&6
2988 else
2989     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
2990   for ac_dir in $PATH; do
2991     # Account for people who put trailing slashes in PATH elements.
2992     case "$ac_dir/" in
2993     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
2994     *)
2995       # OSF1 and SCO ODT 3.0 have their own names for install.
2996       # Don't use installbsd from OSF since it installs stuff as root
2997       # by default.
2998       for ac_prog in ginstall scoinst install; do
2999         if test -f $ac_dir/$ac_prog; then
3000           if test $ac_prog = install &&
3001             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
3002             # AIX install.  It has an incompatible calling convention.
3003             :
3004           elif test $ac_prog = install &&
3005             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
3006             # program-specific install script used by HP pwplus--don't use.
3007             :
3008           else
3009             ac_cv_path_install="$ac_dir/$ac_prog -c"
3010             break 2
3011           fi
3012         fi
3013       done
3014       ;;
3015     esac
3016   done
3017   IFS="$ac_save_IFS"
3018
3019 fi
3020   if test "${ac_cv_path_install+set}" = set; then
3021     INSTALL="$ac_cv_path_install"
3022   else
3023     # As a last resort, use the slow shell script.  We don't cache a
3024     # path for INSTALL within a source directory, because that will
3025     # break other packages using the cache if that directory is
3026     # removed, or if the path is relative.
3027     INSTALL="$ac_install_sh"
3028   fi
3029 fi
3030 echo "$ac_t""$INSTALL" 1>&6
3031
3032 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
3033 # It thinks the first close brace ends the variable substitution.
3034 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
3035
3036 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
3037
3038 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
3039
3040
3041 cat >> confdefs.h <<\EOF
3042 #define HAVE_MKVERSION 1
3043 EOF
3044
3045
3046
3047
3048 ol_aix_threads=no
3049 case "$target" in
3050 *-*-aix*)       if test -z "$CC" ; then
3051                 case "$ol_with_threads" in
3052                 auto | yes |  posix) ol_aix_threads=yes ;;
3053                 esac
3054         fi
3055 ;;
3056 esac
3057
3058 if test $ol_aix_threads = yes ; then
3059         if test -z "${CC}" ; then
3060                 for ac_prog in cc_r xlc_r cc
3061 do
3062 # Extract the first word of "$ac_prog", so it can be a program name with args.
3063 set dummy $ac_prog; ac_word=$2
3064 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3065 echo "configure:3066: checking for $ac_word" >&5
3066 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3067   echo $ac_n "(cached) $ac_c" 1>&6
3068 else
3069   if test -n "$CC"; then
3070   ac_cv_prog_CC="$CC" # Let the user override the test.
3071 else
3072   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3073   ac_dummy="$PATH"
3074   for ac_dir in $ac_dummy; do
3075     test -z "$ac_dir" && ac_dir=.
3076     if test -f $ac_dir/$ac_word; then
3077       ac_cv_prog_CC="$ac_prog"
3078       break
3079     fi
3080   done
3081   IFS="$ac_save_ifs"
3082 fi
3083 fi
3084 CC="$ac_cv_prog_CC"
3085 if test -n "$CC"; then
3086   echo "$ac_t""$CC" 1>&6
3087 else
3088   echo "$ac_t""no" 1>&6
3089 fi
3090
3091 test -n "$CC" && break
3092 done
3093
3094
3095                 if test "$CC" = cc ; then
3096                                                 if test $ol_with_threads != auto ; then
3097                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
3098                         else
3099                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
3100                         fi
3101                         ol_with_threads=no
3102                 fi
3103         fi
3104
3105         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
3106                 ol_with_threads=posix
3107                 ol_cv_pthread_create=yes
3108         fi
3109 fi
3110
3111 if test -z "${CC}"; then
3112         for ac_prog in cc gcc
3113 do
3114 # Extract the first word of "$ac_prog", so it can be a program name with args.
3115 set dummy $ac_prog; ac_word=$2
3116 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3117 echo "configure:3118: checking for $ac_word" >&5
3118 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3119   echo $ac_n "(cached) $ac_c" 1>&6
3120 else
3121   if test -n "$CC"; then
3122   ac_cv_prog_CC="$CC" # Let the user override the test.
3123 else
3124   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3125   ac_dummy="$PATH"
3126   for ac_dir in $ac_dummy; do
3127     test -z "$ac_dir" && ac_dir=.
3128     if test -f $ac_dir/$ac_word; then
3129       ac_cv_prog_CC="$ac_prog"
3130       break
3131     fi
3132   done
3133   IFS="$ac_save_ifs"
3134 fi
3135 fi
3136 CC="$ac_cv_prog_CC"
3137 if test -n "$CC"; then
3138   echo "$ac_t""$CC" 1>&6
3139 else
3140   echo "$ac_t""no" 1>&6
3141 fi
3142
3143 test -n "$CC" && break
3144 done
3145 test -n "$CC" || CC="missing"
3146
3147
3148         if test "${CC}" = "missing" ; then
3149                 { echo "configure: error: Unable to locate cc(1) or suitable replacement.  Check PATH or set CC." 1>&2; exit 1; }
3150         fi
3151 fi
3152
3153 if test -z "${AR}"; then
3154         for ac_prog in ar gar
3155 do
3156 # Extract the first word of "$ac_prog", so it can be a program name with args.
3157 set dummy $ac_prog; ac_word=$2
3158 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3159 echo "configure:3160: checking for $ac_word" >&5
3160 if eval "test \"\${ac_cv_prog_AR+set}\" = set"; then
3161   echo $ac_n "(cached) $ac_c" 1>&6
3162 else
3163   if test -n "$AR"; then
3164   ac_cv_prog_AR="$AR" # Let the user override the test.
3165 else
3166   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3167   ac_dummy="$PATH"
3168   for ac_dir in $ac_dummy; do
3169     test -z "$ac_dir" && ac_dir=.
3170     if test -f $ac_dir/$ac_word; then
3171       ac_cv_prog_AR="$ac_prog"
3172       break
3173     fi
3174   done
3175   IFS="$ac_save_ifs"
3176 fi
3177 fi
3178 AR="$ac_cv_prog_AR"
3179 if test -n "$AR"; then
3180   echo "$ac_t""$AR" 1>&6
3181 else
3182   echo "$ac_t""no" 1>&6
3183 fi
3184
3185 test -n "$AR" && break
3186 done
3187 test -n "$AR" || AR="missing"
3188
3189
3190         if test "${AR}" = "missing" ; then
3191                 { echo "configure: error: Unable to locate ar(1) or suitable replacement.  Check PATH or set AR." 1>&2; exit 1; }
3192         fi
3193 fi
3194
3195
3196
3197 # Find the correct PATH separator.  Usually this is `:', but
3198 # DJGPP uses `;' like DOS.
3199 if test "X${PATH_SEPARATOR+set}" != Xset; then
3200   UNAME=${UNAME-`uname 2>/dev/null`}
3201   case X$UNAME in
3202     *-DOS) lt_cv_sys_path_separator=';' ;;
3203     *)     lt_cv_sys_path_separator=':' ;;
3204   esac
3205   PATH_SEPARATOR=$lt_cv_sys_path_separator
3206 fi
3207
3208 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3209 echo "configure:3210: checking for Cygwin environment" >&5
3210 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
3211   echo $ac_n "(cached) $ac_c" 1>&6
3212 else
3213   cat > conftest.$ac_ext <<EOF
3214 #line 3215 "configure"
3215 #include "confdefs.h"
3216
3217 int main() {
3218
3219 #ifndef __CYGWIN__
3220 #define __CYGWIN__ __CYGWIN32__
3221 #endif
3222 return __CYGWIN__;
3223 ; return 0; }
3224 EOF
3225 if { (eval echo configure:3226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3226   rm -rf conftest*
3227   ac_cv_cygwin=yes
3228 else
3229   echo "configure: failed program was:" >&5
3230   cat conftest.$ac_ext >&5
3231   rm -rf conftest*
3232   ac_cv_cygwin=no
3233 fi
3234 rm -f conftest*
3235 fi
3236
3237 echo "$ac_t""$ac_cv_cygwin" 1>&6
3238 CYGWIN=
3239 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3240 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3241 echo "configure:3242: checking for mingw32 environment" >&5
3242 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
3243   echo $ac_n "(cached) $ac_c" 1>&6
3244 else
3245   cat > conftest.$ac_ext <<EOF
3246 #line 3247 "configure"
3247 #include "confdefs.h"
3248
3249 int main() {
3250 return __MINGW32__;
3251 ; return 0; }
3252 EOF
3253 if { (eval echo configure:3254: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3254   rm -rf conftest*
3255   ac_cv_mingw32=yes
3256 else
3257   echo "configure: failed program was:" >&5
3258   cat conftest.$ac_ext >&5
3259   rm -rf conftest*
3260   ac_cv_mingw32=no
3261 fi
3262 rm -f conftest*
3263 fi
3264
3265 echo "$ac_t""$ac_cv_mingw32" 1>&6
3266 MINGW32=
3267 test "$ac_cv_mingw32" = yes && MINGW32=yes
3268 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
3269 echo "configure:3270: checking for EMX OS/2 environment" >&5
3270 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
3271   echo $ac_n "(cached) $ac_c" 1>&6
3272 else
3273   cat > conftest.$ac_ext <<EOF
3274 #line 3275 "configure"
3275 #include "confdefs.h"
3276
3277 int main() {
3278 return __EMX__;
3279 ; return 0; }
3280 EOF
3281 if { (eval echo configure:3282: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3282   rm -rf conftest*
3283   ac_cv_emxos2=yes
3284 else
3285   echo "configure: failed program was:" >&5
3286   cat conftest.$ac_ext >&5
3287   rm -rf conftest*
3288   ac_cv_emxos2=no
3289 fi
3290 rm -f conftest*
3291 fi
3292
3293 echo "$ac_t""$ac_cv_emxos2" 1>&6
3294 EMXOS2=
3295 test "$ac_cv_emxos2" = yes && EMXOS2=yes
3296 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3297 echo "configure:3298: checking how to run the C preprocessor" >&5
3298 # On Suns, sometimes $CPP names a directory.
3299 if test -n "$CPP" && test -d "$CPP"; then
3300   CPP=
3301 fi
3302 if test -z "$CPP"; then
3303 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3304   echo $ac_n "(cached) $ac_c" 1>&6
3305 else
3306     # This must be in double quotes, not single quotes, because CPP may get
3307   # substituted into the Makefile and "${CC-cc}" will confuse make.
3308   CPP="${CC-cc} -E"
3309   # On the NeXT, cc -E runs the code through the compiler's parser,
3310   # not just through cpp.
3311   cat > conftest.$ac_ext <<EOF
3312 #line 3313 "configure"
3313 #include "confdefs.h"
3314 #include <assert.h>
3315 Syntax Error
3316 EOF
3317 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3318 { (eval echo configure:3319: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3319 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3320 if test -z "$ac_err"; then
3321   :
3322 else
3323   echo "$ac_err" >&5
3324   echo "configure: failed program was:" >&5
3325   cat conftest.$ac_ext >&5
3326   rm -rf conftest*
3327   CPP="${CC-cc} -E -traditional-cpp"
3328   cat > conftest.$ac_ext <<EOF
3329 #line 3330 "configure"
3330 #include "confdefs.h"
3331 #include <assert.h>
3332 Syntax Error
3333 EOF
3334 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3335 { (eval echo configure:3336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3336 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3337 if test -z "$ac_err"; then
3338   :
3339 else
3340   echo "$ac_err" >&5
3341   echo "configure: failed program was:" >&5
3342   cat conftest.$ac_ext >&5
3343   rm -rf conftest*
3344   CPP="${CC-cc} -nologo -E"
3345   cat > conftest.$ac_ext <<EOF
3346 #line 3347 "configure"
3347 #include "confdefs.h"
3348 #include <assert.h>
3349 Syntax Error
3350 EOF
3351 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3352 { (eval echo configure:3353: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3353 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3354 if test -z "$ac_err"; then
3355   :
3356 else
3357   echo "$ac_err" >&5
3358   echo "configure: failed program was:" >&5
3359   cat conftest.$ac_ext >&5
3360   rm -rf conftest*
3361   CPP=/lib/cpp
3362 fi
3363 rm -f conftest*
3364 fi
3365 rm -f conftest*
3366 fi
3367 rm -f conftest*
3368   ac_cv_prog_CPP="$CPP"
3369 fi
3370   CPP="$ac_cv_prog_CPP"
3371 else
3372   ac_cv_prog_CPP="$CPP"
3373 fi
3374 echo "$ac_t""$CPP" 1>&6
3375
3376 # Check whether --enable-fast-install or --disable-fast-install was given.
3377 if test "${enable_fast_install+set}" = set; then
3378   enableval="$enable_fast_install"
3379   p=${PACKAGE-default}
3380 case $enableval in
3381 yes) enable_fast_install=yes ;;
3382 no) enable_fast_install=no ;;
3383 *)
3384   enable_fast_install=no
3385   # Look at the argument we got.  We use all the common list separators.
3386   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3387   for pkg in $enableval; do
3388     if test "X$pkg" = "X$p"; then
3389       enable_fast_install=yes
3390     fi
3391   done
3392   IFS="$ac_save_ifs"
3393   ;;
3394 esac
3395 else
3396   enable_fast_install=yes
3397 fi
3398
3399 # Extract the first word of "gcc", so it can be a program name with args.
3400 set dummy gcc; ac_word=$2
3401 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3402 echo "configure:3403: checking for $ac_word" >&5
3403 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3404   echo $ac_n "(cached) $ac_c" 1>&6
3405 else
3406   if test -n "$CC"; then
3407   ac_cv_prog_CC="$CC" # Let the user override the test.
3408 else
3409   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3410   ac_dummy="$PATH"
3411   for ac_dir in $ac_dummy; do
3412     test -z "$ac_dir" && ac_dir=.
3413     if test -f $ac_dir/$ac_word; then
3414       ac_cv_prog_CC="gcc"
3415       break
3416     fi
3417   done
3418   IFS="$ac_save_ifs"
3419 fi
3420 fi
3421 CC="$ac_cv_prog_CC"
3422 if test -n "$CC"; then
3423   echo "$ac_t""$CC" 1>&6
3424 else
3425   echo "$ac_t""no" 1>&6
3426 fi
3427
3428 if test -z "$CC"; then
3429   # Extract the first word of "cc", so it can be a program name with args.
3430 set dummy cc; ac_word=$2
3431 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3432 echo "configure:3433: checking for $ac_word" >&5
3433 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3434   echo $ac_n "(cached) $ac_c" 1>&6
3435 else
3436   if test -n "$CC"; then
3437   ac_cv_prog_CC="$CC" # Let the user override the test.
3438 else
3439   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3440   ac_prog_rejected=no
3441   ac_dummy="$PATH"
3442   for ac_dir in $ac_dummy; do
3443     test -z "$ac_dir" && ac_dir=.
3444     if test -f $ac_dir/$ac_word; then
3445       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
3446         ac_prog_rejected=yes
3447         continue
3448       fi
3449       ac_cv_prog_CC="cc"
3450       break
3451     fi
3452   done
3453   IFS="$ac_save_ifs"
3454 if test $ac_prog_rejected = yes; then
3455   # We found a bogon in the path, so make sure we never use it.
3456   set dummy $ac_cv_prog_CC
3457   shift
3458   if test $# -gt 0; then
3459     # We chose a different compiler from the bogus one.
3460     # However, it has the same basename, so the bogon will be chosen
3461     # first if we set CC to just the basename; use the full file name.
3462     shift
3463     set dummy "$ac_dir/$ac_word" "$@"
3464     shift
3465     ac_cv_prog_CC="$@"
3466   fi
3467 fi
3468 fi
3469 fi
3470 CC="$ac_cv_prog_CC"
3471 if test -n "$CC"; then
3472   echo "$ac_t""$CC" 1>&6
3473 else
3474   echo "$ac_t""no" 1>&6
3475 fi
3476
3477   if test -z "$CC"; then
3478     case "`uname -s`" in
3479     *win32* | *WIN32* | *CYGWIN*)
3480       # Extract the first word of "cl", so it can be a program name with args.
3481 set dummy cl; ac_word=$2
3482 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3483 echo "configure:3484: checking for $ac_word" >&5
3484 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3485   echo $ac_n "(cached) $ac_c" 1>&6
3486 else
3487   if test -n "$CC"; then
3488   ac_cv_prog_CC="$CC" # Let the user override the test.
3489 else
3490   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3491   ac_dummy="$PATH"
3492   for ac_dir in $ac_dummy; do
3493     test -z "$ac_dir" && ac_dir=.
3494     if test -f $ac_dir/$ac_word; then
3495       ac_cv_prog_CC="cl"
3496       break
3497     fi
3498   done
3499   IFS="$ac_save_ifs"
3500 fi
3501 fi
3502 CC="$ac_cv_prog_CC"
3503 if test -n "$CC"; then
3504   echo "$ac_t""$CC" 1>&6
3505 else
3506   echo "$ac_t""no" 1>&6
3507 fi
3508  ;;
3509     esac
3510   fi
3511   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
3512 fi
3513
3514 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
3515 echo "configure:3516: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
3516
3517 ac_ext=c
3518 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3519 ac_cpp='$CPP $CPPFLAGS'
3520 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3521 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3522 cross_compiling=$ac_cv_prog_cc_cross
3523
3524 cat > conftest.$ac_ext << EOF
3525
3526 #line 3527 "configure"
3527 #include "confdefs.h"
3528
3529 main(){return(0);}
3530 EOF
3531 if { (eval echo configure:3532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3532   ac_cv_prog_cc_works=yes
3533   # If we can't run a trivial program, we are probably using a cross compiler.
3534   if (./conftest; exit) 2>/dev/null; then
3535     ac_cv_prog_cc_cross=no
3536   else
3537     ac_cv_prog_cc_cross=yes
3538   fi
3539 else
3540   echo "configure: failed program was:" >&5
3541   cat conftest.$ac_ext >&5
3542   ac_cv_prog_cc_works=no
3543 fi
3544 rm -fr conftest*
3545 ac_ext=c
3546 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3547 ac_cpp='$CPP $CPPFLAGS'
3548 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3549 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3550 cross_compiling=$ac_cv_prog_cc_cross
3551
3552 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
3553 if test $ac_cv_prog_cc_works = no; then
3554   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
3555 fi
3556 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
3557 echo "configure:3558: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
3558 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
3559 cross_compiling=$ac_cv_prog_cc_cross
3560
3561 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
3562 echo "configure:3563: checking whether we are using GNU C" >&5
3563 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
3564   echo $ac_n "(cached) $ac_c" 1>&6
3565 else
3566   cat > conftest.c <<EOF
3567 #ifdef __GNUC__
3568   yes;
3569 #endif
3570 EOF
3571 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3572: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
3572   ac_cv_prog_gcc=yes
3573 else
3574   ac_cv_prog_gcc=no
3575 fi
3576 fi
3577
3578 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
3579
3580 if test $ac_cv_prog_gcc = yes; then
3581   GCC=yes
3582 else
3583   GCC=
3584 fi
3585
3586 ac_test_CFLAGS="${CFLAGS+set}"
3587 ac_save_CFLAGS="$CFLAGS"
3588 CFLAGS=
3589 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
3590 echo "configure:3591: checking whether ${CC-cc} accepts -g" >&5
3591 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
3592   echo $ac_n "(cached) $ac_c" 1>&6
3593 else
3594   echo 'void f(){}' > conftest.c
3595 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
3596   ac_cv_prog_cc_g=yes
3597 else
3598   ac_cv_prog_cc_g=no
3599 fi
3600 rm -f conftest*
3601
3602 fi
3603
3604 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
3605 if test "$ac_test_CFLAGS" = set; then
3606   CFLAGS="$ac_save_CFLAGS"
3607 elif test $ac_cv_prog_cc_g = yes; then
3608   if test "$GCC" = yes; then
3609     CFLAGS="-g -O2"
3610   else
3611     CFLAGS="-g"
3612   fi
3613 else
3614   if test "$GCC" = yes; then
3615     CFLAGS="-O2"
3616   else
3617     CFLAGS=
3618   fi
3619 fi
3620
3621 # Check whether --with-gnu-ld or --without-gnu-ld was given.
3622 if test "${with_gnu_ld+set}" = set; then
3623   withval="$with_gnu_ld"
3624   test "$withval" = no || with_gnu_ld=yes
3625 else
3626   with_gnu_ld=no
3627 fi
3628
3629 ac_prog=ld
3630 if test "$GCC" = yes; then
3631   # Check if gcc -print-prog-name=ld gives a path.
3632   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
3633 echo "configure:3634: checking for ld used by GCC" >&5
3634   case $host in
3635   *-*-mingw*)
3636     # gcc leaves a trailing carriage return which upsets mingw
3637     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3638   *)
3639     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3640   esac
3641   case $ac_prog in
3642     # Accept absolute paths.
3643     [\\/]* | [A-Za-z]:[\\/]*)
3644       re_direlt='/[^/][^/]*/\.\./'
3645       # Canonicalize the path of ld
3646       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3647       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3648         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3649       done
3650       test -z "$LD" && LD="$ac_prog"
3651       ;;
3652   "")
3653     # If it fails, then pretend we aren't using GCC.
3654     ac_prog=ld
3655     ;;
3656   *)
3657     # If it is relative, then search for the first ld in PATH.
3658     with_gnu_ld=unknown
3659     ;;
3660   esac
3661 elif test "$with_gnu_ld" = yes; then
3662   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
3663 echo "configure:3664: checking for GNU ld" >&5
3664 else
3665   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
3666 echo "configure:3667: checking for non-GNU ld" >&5
3667 fi
3668 if eval "test \"\${lt_cv_path_LD+set}\" = set"; then
3669   echo $ac_n "(cached) $ac_c" 1>&6
3670 else
3671   if test -z "$LD"; then
3672   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3673   for ac_dir in $PATH; do
3674     test -z "$ac_dir" && ac_dir=.
3675     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3676       lt_cv_path_LD="$ac_dir/$ac_prog"
3677       # Check to see if the program is GNU ld.  I'd rather use --version,
3678       # but apparently some GNU ld's only accept -v.
3679       # Break only if it was the GNU/non-GNU ld that we prefer.
3680       if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3681         test "$with_gnu_ld" != no && break
3682       else
3683         test "$with_gnu_ld" != yes && break
3684       fi
3685     fi
3686   done
3687   IFS="$ac_save_ifs"
3688 else
3689   lt_cv_path_LD="$LD" # Let the user override the test with a path.
3690 fi
3691 fi
3692
3693 LD="$lt_cv_path_LD"
3694 if test -n "$LD"; then
3695   echo "$ac_t""$LD" 1>&6
3696 else
3697   echo "$ac_t""no" 1>&6
3698 fi
3699 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
3700 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
3701 echo "configure:3702: checking if the linker ($LD) is GNU ld" >&5
3702 if eval "test \"\${lt_cv_prog_gnu_ld+set}\" = set"; then
3703   echo $ac_n "(cached) $ac_c" 1>&6
3704 else
3705   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
3706 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3707   lt_cv_prog_gnu_ld=yes
3708 else
3709   lt_cv_prog_gnu_ld=no
3710 fi
3711 fi
3712
3713 echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
3714 with_gnu_ld=$lt_cv_prog_gnu_ld
3715
3716
3717 echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
3718 echo "configure:3719: checking for $LD option to reload object files" >&5
3719 if eval "test \"\${lt_cv_ld_reload_flag+set}\" = set"; then
3720   echo $ac_n "(cached) $ac_c" 1>&6
3721 else
3722   lt_cv_ld_reload_flag='-r'
3723 fi
3724
3725 echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6
3726 reload_flag=$lt_cv_ld_reload_flag
3727 test -n "$reload_flag" && reload_flag=" $reload_flag"
3728
3729 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
3730 echo "configure:3731: checking for BSD-compatible nm" >&5
3731 if eval "test \"\${lt_cv_path_NM+set}\" = set"; then
3732   echo $ac_n "(cached) $ac_c" 1>&6
3733 else
3734   if test -n "$NM"; then
3735   # Let the user override the test.
3736   lt_cv_path_NM="$NM"
3737 else
3738   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3739   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3740     test -z "$ac_dir" && ac_dir=.
3741     tmp_nm=$ac_dir/${ac_tool_prefix}nm
3742     if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
3743       # Check to see if the nm accepts a BSD-compat flag.
3744       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3745       #   nm: unknown option "B" ignored
3746       # Tru64's nm complains that /dev/null is an invalid object file
3747       if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
3748         lt_cv_path_NM="$tmp_nm -B"
3749         break
3750       elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3751         lt_cv_path_NM="$tmp_nm -p"
3752         break
3753       else
3754         lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3755         continue # so that we can try to find one that supports BSD flags
3756       fi
3757     fi
3758   done
3759   IFS="$ac_save_ifs"
3760   test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
3761 fi
3762 fi
3763
3764 NM="$lt_cv_path_NM"
3765 echo "$ac_t""$NM" 1>&6
3766
3767 echo $ac_n "checking for a sed that does not truncate output""... $ac_c" 1>&6
3768 echo "configure:3769: checking for a sed that does not truncate output" >&5
3769 if eval "test \"\${lt_cv_path_SED+set}\" = set"; then
3770   echo $ac_n "(cached) $ac_c" 1>&6
3771 else
3772   # Loop through the user's path and test for sed and gsed.
3773 # Then use that list of sed's as ones to test for truncation.
3774 as_executable_p="test -f"
3775 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3776 for as_dir in $PATH
3777 do
3778   IFS=$as_save_IFS
3779   test -z "$as_dir" && as_dir=.
3780   for ac_prog in sed gsed; do
3781     for ac_exec_ext in '' $ac_executable_extensions; do
3782       if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
3783         _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
3784       fi
3785     done
3786   done
3787 done
3788
3789   # Create a temporary directory, and hook for its removal unless debugging.
3790 $debug ||
3791 {
3792   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
3793   trap '{ (exit 1); exit 1; }' 1 2 13 15
3794 }
3795
3796 # Create a (secure) tmp directory for tmp files.
3797 : ${TMPDIR=/tmp}
3798 {
3799   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
3800   test -n "$tmp" && test -d "$tmp"
3801 }  ||
3802 {
3803   tmp=$TMPDIR/sed$$-$RANDOM
3804   (umask 077 && mkdir $tmp)
3805 } ||
3806 {
3807    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
3808    { (exit 1); exit 1; }
3809 }
3810   _max=0
3811   _count=0
3812   # Add /usr/xpg4/bin/sed as it is typically found on Solaris
3813   # along with /bin/sed that truncates output.
3814   for _sed in $_sed_list /usr/xpg4/bin/sed; do
3815     test ! -f ${_sed} && break
3816     cat /dev/null > "$tmp/sed.in"
3817     _count=0
3818     echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
3819     # Check for GNU sed and select it if it is found.
3820     if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
3821       lt_cv_path_SED=${_sed}
3822       break
3823     fi
3824     while true; do
3825       cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
3826       mv "$tmp/sed.tmp" "$tmp/sed.in"
3827       cp "$tmp/sed.in" "$tmp/sed.nl"
3828       echo >>"$tmp/sed.nl"
3829       ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
3830       cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
3831       # 40000 chars as input seems more than enough
3832       test $_count -gt 10 && break
3833       _count=`expr $_count + 1`
3834       if test $_count -gt $_max; then
3835         _max=$_count
3836         lt_cv_path_SED=$_sed
3837       fi
3838     done
3839   done
3840   rm -rf "$tmp"
3841
3842 fi
3843
3844 if test "X$SED" != "X"; then
3845   lt_cv_path_SED=$SED
3846 else
3847   SED=$lt_cv_path_SED
3848 fi
3849 echo "$ac_t""$SED" 1>&6
3850
3851 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3852 echo "configure:3853: checking whether ln -s works" >&5
3853 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3854   echo $ac_n "(cached) $ac_c" 1>&6
3855 else
3856   rm -f conftestdata
3857 if ln -s X conftestdata 2>/dev/null
3858 then
3859   rm -f conftestdata
3860   ac_cv_prog_LN_S="ln -s"
3861 else
3862   ac_cv_prog_LN_S=ln
3863 fi
3864 fi
3865 LN_S="$ac_cv_prog_LN_S"
3866 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3867   echo "$ac_t""yes" 1>&6
3868 else
3869   echo "$ac_t""no" 1>&6
3870 fi
3871
3872 echo $ac_n "checking how to recognise dependent libraries""... $ac_c" 1>&6
3873 echo "configure:3874: checking how to recognise dependent libraries" >&5
3874 if eval "test \"\${lt_cv_deplibs_check_method+set}\" = set"; then
3875   echo $ac_n "(cached) $ac_c" 1>&6
3876 else
3877   lt_cv_file_magic_cmd='$MAGIC_CMD'
3878 lt_cv_file_magic_test_file=
3879 lt_cv_deplibs_check_method='unknown'
3880 # Need to set the preceding variable on all platforms that support
3881 # interlibrary dependencies.
3882 # 'none' -- dependencies not supported.
3883 # `unknown' -- same as none, but documents that we really don't know.
3884 # 'pass_all' -- all dependencies passed with no checks.
3885 # 'test_compile' -- check by making test program.
3886 # 'file_magic [[regex]]' -- check by looking for files in library path
3887 # which responds to the $file_magic_cmd with a given egrep regex.
3888 # If you have `file' or equivalent on your system and you're not sure
3889 # whether `pass_all' will *always* work, you probably want this one.
3890
3891 case $host_os in
3892 aix4* | aix5*)
3893   lt_cv_deplibs_check_method=pass_all
3894   ;;
3895
3896 beos*)
3897   lt_cv_deplibs_check_method=pass_all
3898   ;;
3899
3900 bsdi4*)
3901   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
3902   lt_cv_file_magic_cmd='/usr/bin/file -L'
3903   lt_cv_file_magic_test_file=/shlib/libc.so
3904   ;;
3905
3906 cygwin* | mingw* | pw32*)
3907   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3908   lt_cv_file_magic_cmd='$OBJDUMP -f'
3909   ;;
3910
3911 darwin* | rhapsody*)
3912   lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
3913   lt_cv_file_magic_cmd='/usr/bin/file -L'
3914   case "$host_os" in
3915   rhapsody* | darwin1.[012])
3916     lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
3917     ;;
3918   *) # Darwin 1.3 on
3919     lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
3920     ;;
3921   esac
3922   ;;
3923
3924 freebsd*)
3925   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3926     case $host_cpu in
3927     i*86 )
3928       # Not sure whether the presence of OpenBSD here was a mistake.
3929       # Let's accept both of them until this is cleared up.
3930       lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
3931       lt_cv_file_magic_cmd=/usr/bin/file
3932       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3933       ;;
3934     esac
3935   else
3936     lt_cv_deplibs_check_method=pass_all
3937   fi
3938   ;;
3939
3940 gnu*)
3941   lt_cv_deplibs_check_method=pass_all
3942   ;;
3943
3944 hpux10.20*|hpux11*)
3945   lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
3946   lt_cv_file_magic_cmd=/usr/bin/file
3947   lt_cv_file_magic_test_file=/usr/lib/libc.sl
3948   ;;
3949
3950 irix5* | irix6* | nonstopux*)
3951   case $host_os in
3952   irix5* | nonstopux*)
3953     # this will be overridden with pass_all, but let us keep it just in case
3954     lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
3955     ;;
3956   *)
3957     case $LD in
3958     *-32|*"-32 ") libmagic=32-bit;;
3959     *-n32|*"-n32 ") libmagic=N32;;
3960     *-64|*"-64 ") libmagic=64-bit;;
3961     *) libmagic=never-match;;
3962     esac
3963     # this will be overridden with pass_all, but let us keep it just in case
3964     lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
3965     ;;
3966   esac
3967   lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
3968   lt_cv_deplibs_check_method=pass_all
3969   ;;
3970
3971 # This must be Linux ELF.
3972 linux-gnu*)
3973   case $host_cpu in
3974   alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64*)
3975     lt_cv_deplibs_check_method=pass_all ;;
3976   *)
3977     # glibc up to 2.1.1 does not perform some relocations on ARM
3978     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
3979   esac
3980   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
3981   ;;
3982
3983 netbsd*)
3984   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3985     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
3986   else
3987     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
3988   fi
3989   ;;
3990
3991 newos6*)
3992   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
3993   lt_cv_file_magic_cmd=/usr/bin/file
3994   lt_cv_file_magic_test_file=/usr/lib/libnls.so
3995   ;;
3996
3997 openbsd*)
3998   lt_cv_file_magic_cmd=/usr/bin/file
3999   lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4000   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4001     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
4002   else
4003     lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
4004   fi
4005   ;;
4006
4007 osf3* | osf4* | osf5*)
4008   # this will be overridden with pass_all, but let us keep it just in case
4009   lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
4010   lt_cv_file_magic_test_file=/shlib/libc.so
4011   lt_cv_deplibs_check_method=pass_all
4012   ;;
4013
4014 sco3.2v5*)
4015   lt_cv_deplibs_check_method=pass_all
4016   ;;
4017
4018 solaris*)
4019   lt_cv_deplibs_check_method=pass_all
4020   lt_cv_file_magic_test_file=/lib/libc.so
4021   ;;
4022
4023 sysv5uw[78]* | sysv4*uw2*)
4024   lt_cv_deplibs_check_method=pass_all
4025   ;;
4026
4027 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
4028   case $host_vendor in
4029   motorola)
4030     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]'
4031     lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
4032     ;;
4033   ncr)
4034     lt_cv_deplibs_check_method=pass_all
4035     ;;
4036   sequent)
4037     lt_cv_file_magic_cmd='/bin/file'
4038     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
4039     ;;
4040   sni)
4041     lt_cv_file_magic_cmd='/bin/file'
4042     lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
4043     lt_cv_file_magic_test_file=/lib/libc.so
4044     ;;
4045   siemens)
4046     lt_cv_deplibs_check_method=pass_all
4047     ;;
4048   esac
4049   ;;
4050 esac
4051
4052 fi
4053
4054 echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6
4055 file_magic_cmd=$lt_cv_file_magic_cmd
4056 deplibs_check_method=$lt_cv_deplibs_check_method
4057
4058 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
4059 echo "configure:4060: checking for object suffix" >&5
4060 if eval "test \"\${ac_cv_objext+set}\" = set"; then
4061   echo $ac_n "(cached) $ac_c" 1>&6
4062 else
4063   rm -f conftest*
4064 echo 'int i = 1;' > conftest.$ac_ext
4065 if { (eval echo configure:4066: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4066   for ac_file in conftest.*; do
4067     case $ac_file in
4068     *.c) ;;
4069     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
4070     esac
4071   done
4072 else
4073   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
4074 fi
4075 rm -f conftest*
4076 fi
4077
4078 echo "$ac_t""$ac_cv_objext" 1>&6
4079 OBJEXT=$ac_cv_objext
4080 ac_objext=$ac_cv_objext
4081
4082
4083
4084
4085 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
4086 echo "configure:4087: checking for executable suffix" >&5
4087 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
4088   echo $ac_n "(cached) $ac_c" 1>&6
4089 else
4090   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
4091   ac_cv_exeext=.exe
4092 else
4093   rm -f conftest*
4094   echo 'int main () { return 0; }' > conftest.$ac_ext
4095   ac_cv_exeext=
4096   if { (eval echo configure:4097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
4097     for file in conftest.*; do
4098       case $file in
4099       *.c | *.C | *.o | *.obj | *.xcoff) ;;
4100       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
4101       esac
4102     done
4103   else
4104     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
4105   fi
4106   rm -f conftest*
4107   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
4108 fi
4109 fi
4110
4111 EXEEXT=""
4112 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
4113 echo "$ac_t""${ac_cv_exeext}" 1>&6
4114 ac_exeext=$EXEEXT
4115
4116 if test $host != $build; then
4117   ac_tool_prefix=${host_alias}-
4118 else
4119   ac_tool_prefix=
4120 fi
4121
4122
4123
4124
4125 # Check for command to grab the raw symbol name followed by C symbol from nm.
4126 echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
4127 echo "configure:4128: checking command to parse $NM output" >&5
4128 if eval "test \"\${lt_cv_sys_global_symbol_pipe+set}\" = set"; then
4129   echo $ac_n "(cached) $ac_c" 1>&6
4130 else
4131   
4132 # These are sane defaults that work on at least a few old systems.
4133 # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4134
4135 # Character class describing NM global symbol codes.
4136 symcode='[BCDEGRST]'
4137
4138 # Regexp to match symbols that can be accessed directly from C.
4139 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
4140
4141 # Transform the above into a raw symbol and a C symbol.
4142 symxfrm='\1 \2\3 \3'
4143
4144 # Transform an extracted symbol line into a proper C declaration
4145 lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
4146
4147 # Transform an extracted symbol line into symbol name and symbol address
4148 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'"
4149
4150 # Define system-specific variables.
4151 case $host_os in
4152 aix*)
4153   symcode='[BCDT]'
4154   ;;
4155 cygwin* | mingw* | pw32*)
4156   symcode='[ABCDGISTW]'
4157   ;;
4158 hpux*) # Its linker distinguishes data from code symbols
4159   lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4160   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'"
4161   ;;
4162 irix* | nonstopux*)
4163   symcode='[BCDEGRST]'
4164   ;;
4165 osf*)
4166   symcode='[BCDEGQRST]'
4167   ;;
4168 solaris* | sysv5*)
4169   symcode='[BDT]'
4170   ;;
4171 sysv4)
4172   symcode='[DFNSTU]'
4173   ;;
4174 esac
4175
4176 # Handle CRLF in mingw tool chain
4177 opt_cr=
4178 case $host_os in
4179 mingw*)
4180   opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4181   ;;
4182 esac
4183
4184 # If we're using GNU nm, then use its standard symbol codes.
4185 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
4186   symcode='[ABCDGISTW]'
4187 fi
4188
4189 # Try without a prefix undercore, then with it.
4190 for ac_symprfx in "" "_"; do
4191
4192   # Write the raw and C identifiers.
4193 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[         ]\($symcode$symcode*\)[         ][      ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
4194
4195   # Check to see that the pipe works correctly.
4196   pipe_works=no
4197   rm -f conftest*
4198   cat > conftest.$ac_ext <<EOF
4199 #ifdef __cplusplus
4200 extern "C" {
4201 #endif
4202 char nm_test_var;
4203 void nm_test_func(){}
4204 #ifdef __cplusplus
4205 }
4206 #endif
4207 int main(){nm_test_var='a';nm_test_func();return(0);}
4208 EOF
4209
4210   if { (eval echo configure:4211: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4211     # Now try to grab the symbols.
4212     nlist=conftest.nm
4213     if { (eval echo configure:4214: \"$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
4214       # Try sorting and uniquifying the output.
4215       if sort "$nlist" | uniq > "$nlist"T; then
4216         mv -f "$nlist"T "$nlist"
4217       else
4218         rm -f "$nlist"T
4219       fi
4220
4221       # Make sure that we snagged all the symbols we need.
4222       if egrep ' nm_test_var$' "$nlist" >/dev/null; then
4223         if egrep ' nm_test_func$' "$nlist" >/dev/null; then
4224           cat <<EOF > conftest.$ac_ext
4225 #ifdef __cplusplus
4226 extern "C" {
4227 #endif
4228
4229 EOF
4230           # Now generate the symbol file.
4231           eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
4232
4233           cat <<EOF >> conftest.$ac_ext
4234 #if defined (__STDC__) && __STDC__
4235 # define lt_ptr void *
4236 #else
4237 # define lt_ptr char *
4238 # define const
4239 #endif
4240
4241 /* The mapping between symbol names and symbols. */
4242 const struct {
4243   const char *name;
4244   lt_ptr address;
4245 }
4246 lt_preloaded_symbols[] =
4247 {
4248 EOF
4249           sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
4250           cat <<\EOF >> conftest.$ac_ext
4251   {0, (lt_ptr) 0}
4252 };
4253
4254 #ifdef __cplusplus
4255 }
4256 #endif
4257 EOF
4258           # Now try linking the two files.
4259           mv conftest.$ac_objext conftstm.$ac_objext
4260           save_LIBS="$LIBS"
4261           save_CFLAGS="$CFLAGS"
4262           LIBS="conftstm.$ac_objext"
4263           CFLAGS="$CFLAGS$no_builtin_flag"
4264           if { (eval echo configure:4265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest$ac_exeext; then
4265             pipe_works=yes
4266           fi
4267           LIBS="$save_LIBS"
4268           CFLAGS="$save_CFLAGS"
4269         else
4270           echo "cannot find nm_test_func in $nlist" >&5
4271         fi
4272       else
4273         echo "cannot find nm_test_var in $nlist" >&5
4274       fi
4275     else
4276       echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
4277     fi
4278   else
4279     echo "$progname: failed program was:" >&5
4280     cat conftest.$ac_ext >&5
4281   fi
4282   rm -f conftest* conftst*
4283
4284   # Do not use the global_symbol_pipe unless it works.
4285   if test "$pipe_works" = yes; then
4286     break
4287   else
4288     lt_cv_sys_global_symbol_pipe=
4289   fi
4290 done
4291
4292 fi
4293
4294 global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
4295 if test -z "$lt_cv_sys_global_symbol_pipe"; then
4296   global_symbol_to_cdecl=
4297   global_symbol_to_c_name_address=
4298 else
4299   global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
4300   global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
4301 fi
4302 if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
4303 then
4304   echo "$ac_t""failed" 1>&6
4305 else
4306   echo "$ac_t""ok" 1>&6
4307 fi
4308
4309 for ac_hdr in dlfcn.h
4310 do
4311 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4312 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4313 echo "configure:4314: checking for $ac_hdr" >&5
4314 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4315   echo $ac_n "(cached) $ac_c" 1>&6
4316 else
4317   cat > conftest.$ac_ext <<EOF
4318 #line 4319 "configure"
4319 #include "confdefs.h"
4320 #include <$ac_hdr>
4321 EOF
4322 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4323 { (eval echo configure:4324: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4324 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4325 if test -z "$ac_err"; then
4326   rm -rf conftest*
4327   eval "ac_cv_header_$ac_safe=yes"
4328 else
4329   echo "$ac_err" >&5
4330   echo "configure: failed program was:" >&5
4331   cat conftest.$ac_ext >&5
4332   rm -rf conftest*
4333   eval "ac_cv_header_$ac_safe=no"
4334 fi
4335 rm -f conftest*
4336 fi
4337 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4338   echo "$ac_t""yes" 1>&6
4339     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4340   cat >> confdefs.h <<EOF
4341 #define $ac_tr_hdr 1
4342 EOF
4343  
4344 else
4345   echo "$ac_t""no" 1>&6
4346 fi
4347 done
4348
4349
4350
4351
4352
4353
4354 # Only perform the check for file, if the check method requires it
4355 case $deplibs_check_method in
4356 file_magic*)
4357   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
4358     echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
4359 echo "configure:4360: checking for ${ac_tool_prefix}file" >&5
4360 if eval "test \"\${lt_cv_path_MAGIC_CMD+set}\" = set"; then
4361   echo $ac_n "(cached) $ac_c" 1>&6
4362 else
4363   case $MAGIC_CMD in
4364   /*)
4365   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4366   ;;
4367   ?:/*)
4368   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
4369   ;;
4370   *)
4371   ac_save_MAGIC_CMD="$MAGIC_CMD"
4372   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4373   ac_dummy="/usr/bin:$PATH"
4374   for ac_dir in $ac_dummy; do
4375     test -z "$ac_dir" && ac_dir=.
4376     if test -f $ac_dir/${ac_tool_prefix}file; then
4377       lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
4378       if test -n "$file_magic_test_file"; then
4379         case $deplibs_check_method in
4380         "file_magic "*)
4381           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
4382           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4383           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4384             egrep "$file_magic_regex" > /dev/null; then
4385             :
4386           else
4387             cat <<EOF 1>&2
4388
4389 *** Warning: the command libtool uses to detect shared libraries,
4390 *** $file_magic_cmd, produces output that libtool cannot recognize.
4391 *** The result is that libtool may fail to recognize shared libraries
4392 *** as such.  This will affect the creation of libtool libraries that
4393 *** depend on shared libraries, but programs linked with such libtool
4394 *** libraries will work regardless of this problem.  Nevertheless, you
4395 *** may want to report the problem to your system manager and/or to
4396 *** bug-libtool@gnu.org
4397
4398 EOF
4399           fi ;;
4400         esac
4401       fi
4402       break
4403     fi
4404   done
4405   IFS="$ac_save_ifs"
4406   MAGIC_CMD="$ac_save_MAGIC_CMD"
4407   ;;
4408 esac
4409 fi
4410
4411 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4412 if test -n "$MAGIC_CMD"; then
4413   echo "$ac_t""$MAGIC_CMD" 1>&6
4414 else
4415   echo "$ac_t""no" 1>&6
4416 fi
4417
4418 if test -z "$lt_cv_path_MAGIC_CMD"; then
4419   if test -n "$ac_tool_prefix"; then
4420     echo $ac_n "checking for file""... $ac_c" 1>&6
4421 echo "configure:4422: checking for file" >&5
4422 if eval "test \"\${lt_cv_path_MAGIC_CMD+set}\" = set"; then
4423   echo $ac_n "(cached) $ac_c" 1>&6
4424 else
4425   case $MAGIC_CMD in
4426   /*)
4427   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4428   ;;
4429   ?:/*)
4430   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
4431   ;;
4432   *)
4433   ac_save_MAGIC_CMD="$MAGIC_CMD"
4434   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4435   ac_dummy="/usr/bin:$PATH"
4436   for ac_dir in $ac_dummy; do
4437     test -z "$ac_dir" && ac_dir=.
4438     if test -f $ac_dir/file; then
4439       lt_cv_path_MAGIC_CMD="$ac_dir/file"
4440       if test -n "$file_magic_test_file"; then
4441         case $deplibs_check_method in
4442         "file_magic "*)
4443           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
4444           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4445           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4446             egrep "$file_magic_regex" > /dev/null; then
4447             :
4448           else
4449             cat <<EOF 1>&2
4450
4451 *** Warning: the command libtool uses to detect shared libraries,
4452 *** $file_magic_cmd, produces output that libtool cannot recognize.
4453 *** The result is that libtool may fail to recognize shared libraries
4454 *** as such.  This will affect the creation of libtool libraries that
4455 *** depend on shared libraries, but programs linked with such libtool
4456 *** libraries will work regardless of this problem.  Nevertheless, you
4457 *** may want to report the problem to your system manager and/or to
4458 *** bug-libtool@gnu.org
4459
4460 EOF
4461           fi ;;
4462         esac
4463       fi
4464       break
4465     fi
4466   done
4467   IFS="$ac_save_ifs"
4468   MAGIC_CMD="$ac_save_MAGIC_CMD"
4469   ;;
4470 esac
4471 fi
4472
4473 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4474 if test -n "$MAGIC_CMD"; then
4475   echo "$ac_t""$MAGIC_CMD" 1>&6
4476 else
4477   echo "$ac_t""no" 1>&6
4478 fi
4479
4480   else
4481     MAGIC_CMD=:
4482   fi
4483 fi
4484
4485   fi
4486   ;;
4487 esac
4488
4489 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
4490 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
4491 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4492 echo "configure:4493: checking for $ac_word" >&5
4493 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
4494   echo $ac_n "(cached) $ac_c" 1>&6
4495 else
4496   if test -n "$RANLIB"; then
4497   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
4498 else
4499   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4500   ac_dummy="$PATH"
4501   for ac_dir in $ac_dummy; do
4502     test -z "$ac_dir" && ac_dir=.
4503     if test -f $ac_dir/$ac_word; then
4504       ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
4505       break
4506     fi
4507   done
4508   IFS="$ac_save_ifs"
4509 fi
4510 fi
4511 RANLIB="$ac_cv_prog_RANLIB"
4512 if test -n "$RANLIB"; then
4513   echo "$ac_t""$RANLIB" 1>&6
4514 else
4515   echo "$ac_t""no" 1>&6
4516 fi
4517
4518
4519 if test -z "$ac_cv_prog_RANLIB"; then
4520 if test -n "$ac_tool_prefix"; then
4521   # Extract the first word of "ranlib", so it can be a program name with args.
4522 set dummy ranlib; ac_word=$2
4523 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4524 echo "configure:4525: checking for $ac_word" >&5
4525 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
4526   echo $ac_n "(cached) $ac_c" 1>&6
4527 else
4528   if test -n "$RANLIB"; then
4529   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
4530 else
4531   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4532   ac_dummy="$PATH"
4533   for ac_dir in $ac_dummy; do
4534     test -z "$ac_dir" && ac_dir=.
4535     if test -f $ac_dir/$ac_word; then
4536       ac_cv_prog_RANLIB="ranlib"
4537       break
4538     fi
4539   done
4540   IFS="$ac_save_ifs"
4541   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
4542 fi
4543 fi
4544 RANLIB="$ac_cv_prog_RANLIB"
4545 if test -n "$RANLIB"; then
4546   echo "$ac_t""$RANLIB" 1>&6
4547 else
4548   echo "$ac_t""no" 1>&6
4549 fi
4550
4551 else
4552   RANLIB=":"
4553 fi
4554 fi
4555
4556 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
4557 set dummy ${ac_tool_prefix}strip; ac_word=$2
4558 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4559 echo "configure:4560: checking for $ac_word" >&5
4560 if eval "test \"\${ac_cv_prog_STRIP+set}\" = set"; then
4561   echo $ac_n "(cached) $ac_c" 1>&6
4562 else
4563   if test -n "$STRIP"; then
4564   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
4565 else
4566   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4567   ac_dummy="$PATH"
4568   for ac_dir in $ac_dummy; do
4569     test -z "$ac_dir" && ac_dir=.
4570     if test -f $ac_dir/$ac_word; then
4571       ac_cv_prog_STRIP="${ac_tool_prefix}strip"
4572       break
4573     fi
4574   done
4575   IFS="$ac_save_ifs"
4576 fi
4577 fi
4578 STRIP="$ac_cv_prog_STRIP"
4579 if test -n "$STRIP"; then
4580   echo "$ac_t""$STRIP" 1>&6
4581 else
4582   echo "$ac_t""no" 1>&6
4583 fi
4584
4585
4586 if test -z "$ac_cv_prog_STRIP"; then
4587 if test -n "$ac_tool_prefix"; then
4588   # Extract the first word of "strip", so it can be a program name with args.
4589 set dummy strip; ac_word=$2
4590 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4591 echo "configure:4592: checking for $ac_word" >&5
4592 if eval "test \"\${ac_cv_prog_STRIP+set}\" = set"; then
4593   echo $ac_n "(cached) $ac_c" 1>&6
4594 else
4595   if test -n "$STRIP"; then
4596   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
4597 else
4598   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4599   ac_dummy="$PATH"
4600   for ac_dir in $ac_dummy; do
4601     test -z "$ac_dir" && ac_dir=.
4602     if test -f $ac_dir/$ac_word; then
4603       ac_cv_prog_STRIP="strip"
4604       break
4605     fi
4606   done
4607   IFS="$ac_save_ifs"
4608   test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
4609 fi
4610 fi
4611 STRIP="$ac_cv_prog_STRIP"
4612 if test -n "$STRIP"; then
4613   echo "$ac_t""$STRIP" 1>&6
4614 else
4615   echo "$ac_t""no" 1>&6
4616 fi
4617
4618 else
4619   STRIP=":"
4620 fi
4621 fi
4622
4623
4624 enable_dlopen=yes
4625 enable_win32_dll=yes
4626
4627 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
4628 if test "${enable_libtool_lock+set}" = set; then
4629   enableval="$enable_libtool_lock"
4630   :
4631 fi
4632
4633 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
4634
4635 # Some flags need to be propagated to the compiler or linker for good
4636 # libtool support.
4637 case $host in
4638 *-*-irix6*)
4639   # Find out which ABI we are using.
4640   echo '#line 4641 "configure"' > conftest.$ac_ext
4641   if { (eval echo configure:4642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4642     case `/usr/bin/file conftest.$ac_objext` in
4643     *32-bit*)
4644       LD="${LD-ld} -32"
4645       ;;
4646     *N32*)
4647       LD="${LD-ld} -n32"
4648       ;;
4649     *64-bit*)
4650       LD="${LD-ld} -64"
4651       ;;
4652     esac
4653   fi
4654   rm -rf conftest*
4655   ;;
4656
4657 *-*-sco3.2v5*)
4658   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
4659   SAVE_CFLAGS="$CFLAGS"
4660   CFLAGS="$CFLAGS -belf"
4661   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
4662 echo "configure:4663: checking whether the C compiler needs -belf" >&5
4663 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
4664   echo $ac_n "(cached) $ac_c" 1>&6
4665 else
4666   
4667      ac_ext=c
4668 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
4669 ac_cpp='$CPP $CPPFLAGS'
4670 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
4671 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
4672 cross_compiling=$ac_cv_prog_cc_cross
4673
4674      cat > conftest.$ac_ext <<EOF
4675 #line 4676 "configure"
4676 #include "confdefs.h"
4677
4678 int main() {
4679
4680 ; return 0; }
4681 EOF
4682 if { (eval echo configure:4683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4683   rm -rf conftest*
4684   lt_cv_cc_needs_belf=yes
4685 else
4686   echo "configure: failed program was:" >&5
4687   cat conftest.$ac_ext >&5
4688   rm -rf conftest*
4689   lt_cv_cc_needs_belf=no
4690 fi
4691 rm -f conftest*
4692      ac_ext=c
4693 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
4694 ac_cpp='$CPP $CPPFLAGS'
4695 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
4696 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
4697 cross_compiling=$ac_cv_prog_cc_cross
4698
4699 fi
4700
4701 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
4702   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
4703     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
4704     CFLAGS="$SAVE_CFLAGS"
4705   fi
4706   ;;
4707
4708 *-*-cygwin* | *-*-mingw* | *-*-pw32*)
4709   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
4710 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
4711 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4712 echo "configure:4713: checking for $ac_word" >&5
4713 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
4714   echo $ac_n "(cached) $ac_c" 1>&6
4715 else
4716   if test -n "$DLLTOOL"; then
4717   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
4718 else
4719   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4720   ac_dummy="$PATH"
4721   for ac_dir in $ac_dummy; do
4722     test -z "$ac_dir" && ac_dir=.
4723     if test -f $ac_dir/$ac_word; then
4724       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
4725       break
4726     fi
4727   done
4728   IFS="$ac_save_ifs"
4729 fi
4730 fi
4731 DLLTOOL="$ac_cv_prog_DLLTOOL"
4732 if test -n "$DLLTOOL"; then
4733   echo "$ac_t""$DLLTOOL" 1>&6
4734 else
4735   echo "$ac_t""no" 1>&6
4736 fi
4737
4738
4739 if test -z "$ac_cv_prog_DLLTOOL"; then
4740 if test -n "$ac_tool_prefix"; then
4741   # Extract the first word of "dlltool", so it can be a program name with args.
4742 set dummy dlltool; ac_word=$2
4743 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4744 echo "configure:4745: checking for $ac_word" >&5
4745 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
4746   echo $ac_n "(cached) $ac_c" 1>&6
4747 else
4748   if test -n "$DLLTOOL"; then
4749   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
4750 else
4751   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4752   ac_dummy="$PATH"
4753   for ac_dir in $ac_dummy; do
4754     test -z "$ac_dir" && ac_dir=.
4755     if test -f $ac_dir/$ac_word; then
4756       ac_cv_prog_DLLTOOL="dlltool"
4757       break
4758     fi
4759   done
4760   IFS="$ac_save_ifs"
4761   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
4762 fi
4763 fi
4764 DLLTOOL="$ac_cv_prog_DLLTOOL"
4765 if test -n "$DLLTOOL"; then
4766   echo "$ac_t""$DLLTOOL" 1>&6
4767 else
4768   echo "$ac_t""no" 1>&6
4769 fi
4770
4771 else
4772   DLLTOOL="false"
4773 fi
4774 fi
4775
4776   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
4777 set dummy ${ac_tool_prefix}as; ac_word=$2
4778 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4779 echo "configure:4780: checking for $ac_word" >&5
4780 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
4781   echo $ac_n "(cached) $ac_c" 1>&6
4782 else
4783   if test -n "$AS"; then
4784   ac_cv_prog_AS="$AS" # Let the user override the test.
4785 else
4786   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4787   ac_dummy="$PATH"
4788   for ac_dir in $ac_dummy; do
4789     test -z "$ac_dir" && ac_dir=.
4790     if test -f $ac_dir/$ac_word; then
4791       ac_cv_prog_AS="${ac_tool_prefix}as"
4792       break
4793     fi
4794   done
4795   IFS="$ac_save_ifs"
4796 fi
4797 fi
4798 AS="$ac_cv_prog_AS"
4799 if test -n "$AS"; then
4800   echo "$ac_t""$AS" 1>&6
4801 else
4802   echo "$ac_t""no" 1>&6
4803 fi
4804
4805
4806 if test -z "$ac_cv_prog_AS"; then
4807 if test -n "$ac_tool_prefix"; then
4808   # Extract the first word of "as", so it can be a program name with args.
4809 set dummy as; ac_word=$2
4810 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4811 echo "configure:4812: checking for $ac_word" >&5
4812 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
4813   echo $ac_n "(cached) $ac_c" 1>&6
4814 else
4815   if test -n "$AS"; then
4816   ac_cv_prog_AS="$AS" # Let the user override the test.
4817 else
4818   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4819   ac_dummy="$PATH"
4820   for ac_dir in $ac_dummy; do
4821     test -z "$ac_dir" && ac_dir=.
4822     if test -f $ac_dir/$ac_word; then
4823       ac_cv_prog_AS="as"
4824       break
4825     fi
4826   done
4827   IFS="$ac_save_ifs"
4828   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
4829 fi
4830 fi
4831 AS="$ac_cv_prog_AS"
4832 if test -n "$AS"; then
4833   echo "$ac_t""$AS" 1>&6
4834 else
4835   echo "$ac_t""no" 1>&6
4836 fi
4837
4838 else
4839   AS="false"
4840 fi
4841 fi
4842
4843   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
4844 set dummy ${ac_tool_prefix}objdump; ac_word=$2
4845 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4846 echo "configure:4847: checking for $ac_word" >&5
4847 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
4848   echo $ac_n "(cached) $ac_c" 1>&6
4849 else
4850   if test -n "$OBJDUMP"; then
4851   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
4852 else
4853   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4854   ac_dummy="$PATH"
4855   for ac_dir in $ac_dummy; do
4856     test -z "$ac_dir" && ac_dir=.
4857     if test -f $ac_dir/$ac_word; then
4858       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
4859       break
4860     fi
4861   done
4862   IFS="$ac_save_ifs"
4863 fi
4864 fi
4865 OBJDUMP="$ac_cv_prog_OBJDUMP"
4866 if test -n "$OBJDUMP"; then
4867   echo "$ac_t""$OBJDUMP" 1>&6
4868 else
4869   echo "$ac_t""no" 1>&6
4870 fi
4871
4872
4873 if test -z "$ac_cv_prog_OBJDUMP"; then
4874 if test -n "$ac_tool_prefix"; then
4875   # Extract the first word of "objdump", so it can be a program name with args.
4876 set dummy objdump; ac_word=$2
4877 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4878 echo "configure:4879: checking for $ac_word" >&5
4879 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
4880   echo $ac_n "(cached) $ac_c" 1>&6
4881 else
4882   if test -n "$OBJDUMP"; then
4883   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
4884 else
4885   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4886   ac_dummy="$PATH"
4887   for ac_dir in $ac_dummy; do
4888     test -z "$ac_dir" && ac_dir=.
4889     if test -f $ac_dir/$ac_word; then
4890       ac_cv_prog_OBJDUMP="objdump"
4891       break
4892     fi
4893   done
4894   IFS="$ac_save_ifs"
4895   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
4896 fi
4897 fi
4898 OBJDUMP="$ac_cv_prog_OBJDUMP"
4899 if test -n "$OBJDUMP"; then
4900   echo "$ac_t""$OBJDUMP" 1>&6
4901 else
4902   echo "$ac_t""no" 1>&6
4903 fi
4904
4905 else
4906   OBJDUMP="false"
4907 fi
4908 fi
4909
4910
4911   # recent cygwin and mingw systems supply a stub DllMain which the user
4912   # can override, but on older systems we have to supply one
4913   echo $ac_n "checking if libtool should supply DllMain function""... $ac_c" 1>&6
4914 echo "configure:4915: checking if libtool should supply DllMain function" >&5
4915 if eval "test \"\${lt_cv_need_dllmain+set}\" = set"; then
4916   echo $ac_n "(cached) $ac_c" 1>&6
4917 else
4918   cat > conftest.$ac_ext <<EOF
4919 #line 4920 "configure"
4920 #include "confdefs.h"
4921
4922 int main() {
4923 extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
4924       DllMain (0, 0, 0);
4925 ; return 0; }
4926 EOF
4927 if { (eval echo configure:4928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4928   rm -rf conftest*
4929   lt_cv_need_dllmain=no
4930 else
4931   echo "configure: failed program was:" >&5
4932   cat conftest.$ac_ext >&5
4933   rm -rf conftest*
4934   lt_cv_need_dllmain=yes
4935 fi
4936 rm -f conftest*
4937 fi
4938
4939 echo "$ac_t""$lt_cv_need_dllmain" 1>&6
4940
4941   case $host/$CC in
4942   *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
4943     # old mingw systems require "-dll" to link a DLL, while more recent ones
4944     # require "-mdll"
4945     SAVE_CFLAGS="$CFLAGS"
4946     CFLAGS="$CFLAGS -mdll"
4947     echo $ac_n "checking how to link DLLs""... $ac_c" 1>&6
4948 echo "configure:4949: checking how to link DLLs" >&5
4949 if eval "test \"\${lt_cv_cc_dll_switch+set}\" = set"; then
4950   echo $ac_n "(cached) $ac_c" 1>&6
4951 else
4952   cat > conftest.$ac_ext <<EOF
4953 #line 4954 "configure"
4954 #include "confdefs.h"
4955
4956 int main() {
4957
4958 ; return 0; }
4959 EOF
4960 if { (eval echo configure:4961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4961   rm -rf conftest*
4962   lt_cv_cc_dll_switch=-mdll
4963 else
4964   echo "configure: failed program was:" >&5
4965   cat conftest.$ac_ext >&5
4966   rm -rf conftest*
4967   lt_cv_cc_dll_switch=-dll
4968 fi
4969 rm -f conftest*
4970 fi
4971
4972 echo "$ac_t""$lt_cv_cc_dll_switch" 1>&6
4973     CFLAGS="$SAVE_CFLAGS" ;;
4974   *-*-cygwin* | *-*-pw32*)
4975     # cygwin systems need to pass --dll to the linker, and not link
4976     # crt.o which will require a WinMain@16 definition.
4977     lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
4978   esac
4979   ;;
4980   
4981 esac
4982
4983 # Sed substitution that helps us do robust quoting.  It backslashifies
4984 # metacharacters that are still active within double-quoted strings.
4985 Xsed='sed -e s/^X//'
4986 sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
4987
4988 # Same as above, but do not quote variable references.
4989 double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
4990
4991 # Sed substitution to delay expansion of an escaped shell variable in a
4992 # double_quote_subst'ed string.
4993 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
4994
4995 # Constants:
4996 rm="rm -f"
4997
4998 # Global variables:
4999 default_ofile=libtool
5000 can_build_shared=yes
5001
5002 # All known linkers require a `.a' archive for static linking (except M$VC,
5003 # which needs '.lib').
5004 libext=a
5005 ltmain="$ac_aux_dir/ltmain.sh"
5006 ofile="$default_ofile"
5007 with_gnu_ld="$lt_cv_prog_gnu_ld"
5008 need_locks="$enable_libtool_lock"
5009
5010 old_CC="$CC"
5011 old_CFLAGS="$CFLAGS"
5012
5013 # Set sane defaults for various variables
5014 test -z "$AR" && AR=ar
5015 test -z "$AR_FLAGS" && AR_FLAGS=cru
5016 test -z "$AS" && AS=as
5017 test -z "$CC" && CC=cc
5018 test -z "$DLLTOOL" && DLLTOOL=dlltool
5019 test -z "$LD" && LD=ld
5020 test -z "$LN_S" && LN_S="ln -s"
5021 test -z "$MAGIC_CMD" && MAGIC_CMD=file
5022 test -z "$NM" && NM=nm
5023 test -z "$OBJDUMP" && OBJDUMP=objdump
5024 test -z "$RANLIB" && RANLIB=:
5025 test -z "$STRIP" && STRIP=:
5026 test -z "$ac_objext" && ac_objext=o
5027
5028 if test x"$host" != x"$build"; then
5029   ac_tool_prefix=${host_alias}-
5030 else
5031   ac_tool_prefix=
5032 fi
5033
5034 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
5035 case $host_os in
5036 linux-gnu*) ;;
5037 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
5038 esac
5039
5040 case $host_os in
5041 aix3*)
5042   # AIX sometimes has problems with the GCC collect2 program.  For some
5043   # reason, if we set the COLLECT_NAMES environment variable, the problems
5044   # vanish in a puff of smoke.
5045   if test "X${COLLECT_NAMES+set}" != Xset; then
5046     COLLECT_NAMES=
5047     export COLLECT_NAMES
5048   fi
5049   ;;
5050 esac
5051
5052 # Determine commands to create old-style static archives.
5053 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
5054 old_postinstall_cmds='chmod 644 $oldlib'
5055 old_postuninstall_cmds=
5056
5057 if test -n "$RANLIB"; then
5058   case $host_os in
5059   openbsd*)
5060     old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
5061     ;;
5062   *)
5063     old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
5064     ;;
5065   esac
5066   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
5067 fi
5068
5069 # Allow CC to be a program name with arguments.
5070 set dummy $CC
5071 compiler="$2"
5072
5073 ## FIXME: this should be a separate macro
5074 ##
5075 echo $ac_n "checking for objdir""... $ac_c" 1>&6
5076 echo "configure:5077: checking for objdir" >&5
5077 rm -f .libs 2>/dev/null
5078 mkdir .libs 2>/dev/null
5079 if test -d .libs; then
5080   objdir=.libs
5081 else
5082   # MS-DOS does not allow filenames that begin with a dot.
5083   objdir=_libs
5084 fi
5085 rmdir .libs 2>/dev/null
5086 echo "$ac_t""$objdir" 1>&6
5087 ##
5088 ## END FIXME
5089
5090
5091 ## FIXME: this should be a separate macro
5092 ##
5093 # Check whether --with-pic or --without-pic was given.
5094 if test "${with_pic+set}" = set; then
5095   withval="$with_pic"
5096   pic_mode="$withval"
5097 else
5098   pic_mode=default
5099 fi
5100
5101 test -z "$pic_mode" && pic_mode=default
5102
5103 # We assume here that the value for lt_cv_prog_cc_pic will not be cached
5104 # in isolation, and that seeing it set (from the cache) indicates that
5105 # the associated values are set (in the cache) correctly too.
5106 echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6
5107 echo "configure:5108: checking for $compiler option to produce PIC" >&5
5108 if eval "test \"\${lt_cv_prog_cc_pic+set}\" = set"; then
5109   echo $ac_n "(cached) $ac_c" 1>&6
5110 else
5111    lt_cv_prog_cc_pic=
5112   lt_cv_prog_cc_shlib=
5113   lt_cv_prog_cc_wl=
5114   lt_cv_prog_cc_static=
5115   lt_cv_prog_cc_no_builtin=
5116   lt_cv_prog_cc_can_build_shared=$can_build_shared
5117
5118   if test "$GCC" = yes; then
5119     lt_cv_prog_cc_wl='-Wl,'
5120     lt_cv_prog_cc_static='-static'
5121
5122     case $host_os in
5123     aix*)
5124       # Below there is a dirty hack to force normal static linking with -ldl
5125       # The problem is because libdl dynamically linked with both libc and
5126       # libC (AIX C++ library), which obviously doesn't included in libraries
5127       # list by gcc. This cause undefined symbols with -static flags.
5128       # This hack allows C programs to be linked with "-static -ldl", but
5129       # not sure about C++ programs.
5130       lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
5131       ;;
5132     amigaos*)
5133       # FIXME: we need at least 68020 code to build shared libraries, but
5134       # adding the `-m68020' flag to GCC prevents building anything better,
5135       # like `-m68040'.
5136       lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
5137       ;;
5138     beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5139       # PIC is the default for these OSes.
5140       ;;
5141     darwin* | rhapsody*)
5142       # PIC is the default on this platform
5143       # Common symbols not allowed in MH_DYLIB files
5144       lt_cv_prog_cc_pic='-fno-common'
5145       ;;
5146     cygwin* | mingw* | pw32* | os2*)
5147       # This hack is so that the source file can tell whether it is being
5148       # built for inclusion in a dll (and should export symbols for example).
5149       lt_cv_prog_cc_pic='-DDLL_EXPORT'
5150       ;;
5151     sysv4*MP*)
5152       if test -d /usr/nec; then
5153          lt_cv_prog_cc_pic=-Kconform_pic
5154       fi
5155       ;;
5156     *)
5157       lt_cv_prog_cc_pic='-fPIC'
5158       ;;
5159     esac
5160   else
5161     # PORTME Check for PIC flags for the system compiler.
5162     case $host_os in
5163     aix3* | aix4* | aix5*)
5164       lt_cv_prog_cc_wl='-Wl,'
5165       # All AIX code is PIC.
5166       if test "$host_cpu" = ia64; then
5167         # AIX 5 now supports IA64 processor
5168         lt_cv_prog_cc_static='-Bstatic'
5169       else
5170         lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
5171       fi
5172       ;;
5173
5174     hpux9* | hpux10* | hpux11*)
5175       # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
5176       lt_cv_prog_cc_wl='-Wl,'
5177       lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
5178       lt_cv_prog_cc_pic='+Z'
5179       ;;
5180
5181     irix5* | irix6* | nonstopux*)
5182       lt_cv_prog_cc_wl='-Wl,'
5183       lt_cv_prog_cc_static='-non_shared'
5184       # PIC (with -KPIC) is the default.
5185       ;;
5186
5187     cygwin* | mingw* | pw32* | os2*)
5188       # This hack is so that the source file can tell whether it is being
5189       # built for inclusion in a dll (and should export symbols for example).
5190       lt_cv_prog_cc_pic='-DDLL_EXPORT'
5191       ;;
5192
5193     newsos6)
5194       lt_cv_prog_cc_pic='-KPIC'
5195       lt_cv_prog_cc_static='-Bstatic'
5196       ;;
5197
5198     osf3* | osf4* | osf5*)
5199       # All OSF/1 code is PIC.
5200       lt_cv_prog_cc_wl='-Wl,'
5201       lt_cv_prog_cc_static='-non_shared'
5202       ;;
5203
5204     sco3.2v5*)
5205       lt_cv_prog_cc_pic='-Kpic'
5206       lt_cv_prog_cc_static='-dn'
5207       lt_cv_prog_cc_shlib='-belf'
5208       ;;
5209
5210     solaris*)
5211       lt_cv_prog_cc_pic='-KPIC'
5212       lt_cv_prog_cc_static='-Bstatic'
5213       lt_cv_prog_cc_wl='-Wl,'
5214       ;;
5215
5216     sunos4*)
5217       lt_cv_prog_cc_pic='-PIC'
5218       lt_cv_prog_cc_static='-Bstatic'
5219       lt_cv_prog_cc_wl='-Qoption ld '
5220       ;;
5221
5222     sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5223       lt_cv_prog_cc_pic='-KPIC'
5224       lt_cv_prog_cc_static='-Bstatic'
5225       lt_cv_prog_cc_wl='-Wl,'
5226       ;;
5227
5228     uts4*)
5229       lt_cv_prog_cc_pic='-pic'
5230       lt_cv_prog_cc_static='-Bstatic'
5231       ;;
5232
5233     sysv4*MP*)
5234       if test -d /usr/nec ;then
5235         lt_cv_prog_cc_pic='-Kconform_pic'
5236         lt_cv_prog_cc_static='-Bstatic'
5237       fi
5238       ;;
5239
5240     *)
5241       lt_cv_prog_cc_can_build_shared=no
5242       ;;
5243     esac
5244   fi
5245
5246 fi
5247
5248 if test -z "$lt_cv_prog_cc_pic"; then
5249   echo "$ac_t""none" 1>&6
5250 else
5251   echo "$ac_t""$lt_cv_prog_cc_pic" 1>&6
5252
5253   # Check to make sure the pic_flag actually works.
5254   echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6
5255 echo "configure:5256: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
5256   if eval "test \"\${lt_cv_prog_cc_pic_works+set}\" = set"; then
5257   echo $ac_n "(cached) $ac_c" 1>&6
5258 else
5259       save_CFLAGS="$CFLAGS"
5260     CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
5261     cat > conftest.$ac_ext <<EOF
5262 #line 5263 "configure"
5263 #include "confdefs.h"
5264
5265 int main() {
5266
5267 ; return 0; }
5268 EOF
5269 if { (eval echo configure:5270: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5270   rm -rf conftest*
5271         case $host_os in
5272       hpux9* | hpux10* | hpux11*)
5273         # On HP-UX, both CC and GCC only warn that PIC is supported... then
5274         # they create non-PIC objects.  So, if there were any warnings, we
5275         # assume that PIC is not supported.
5276         if test -s conftest.err; then
5277           lt_cv_prog_cc_pic_works=no
5278         else
5279           lt_cv_prog_cc_pic_works=yes
5280         fi
5281         ;;
5282       *)
5283         lt_cv_prog_cc_pic_works=yes
5284         ;;
5285       esac
5286     
5287 else
5288   echo "configure: failed program was:" >&5
5289   cat conftest.$ac_ext >&5
5290   rm -rf conftest*
5291         lt_cv_prog_cc_pic_works=no
5292     
5293 fi
5294 rm -f conftest*
5295     CFLAGS="$save_CFLAGS"
5296   
5297 fi
5298
5299
5300   if test "X$lt_cv_prog_cc_pic_works" = Xno; then
5301     lt_cv_prog_cc_pic=
5302     lt_cv_prog_cc_can_build_shared=no
5303   else
5304     lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
5305   fi
5306
5307   echo "$ac_t""$lt_cv_prog_cc_pic_works" 1>&6
5308 fi
5309 ##
5310 ## END FIXME
5311
5312 # Check for any special shared library compilation flags.
5313 if test -n "$lt_cv_prog_cc_shlib"; then
5314   echo "configure: warning: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" 1>&2
5315   if echo "$old_CC $old_CFLAGS " | egrep -e "[  ]$lt_cv_prog_cc_shlib[  ]" >/dev/null; then :
5316   else
5317    echo "configure: warning: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2
5318     lt_cv_prog_cc_can_build_shared=no
5319   fi
5320 fi
5321
5322 ## FIXME: this should be a separate macro
5323 ##
5324 echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6
5325 echo "configure:5326: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
5326 if eval "test \"\${lt_cv_prog_cc_static_works+set}\" = set"; then
5327   echo $ac_n "(cached) $ac_c" 1>&6
5328 else
5329     lt_cv_prog_cc_static_works=no
5330   save_LDFLAGS="$LDFLAGS"
5331   LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
5332   cat > conftest.$ac_ext <<EOF
5333 #line 5334 "configure"
5334 #include "confdefs.h"
5335
5336 int main() {
5337
5338 ; return 0; }
5339 EOF
5340 if { (eval echo configure:5341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5341   rm -rf conftest*
5342   lt_cv_prog_cc_static_works=yes
5343 else
5344   echo "configure: failed program was:" >&5
5345   cat conftest.$ac_ext >&5
5346 fi
5347 rm -f conftest*
5348   LDFLAGS="$save_LDFLAGS"
5349
5350 fi
5351
5352
5353 # Belt *and* braces to stop my trousers falling down:
5354 test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
5355 echo "$ac_t""$lt_cv_prog_cc_static_works" 1>&6
5356
5357 pic_flag="$lt_cv_prog_cc_pic"
5358 special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
5359 wl="$lt_cv_prog_cc_wl"
5360 link_static_flag="$lt_cv_prog_cc_static"
5361 no_builtin_flag="$lt_cv_prog_cc_no_builtin"
5362 can_build_shared="$lt_cv_prog_cc_can_build_shared"
5363 ##
5364 ## END FIXME
5365
5366
5367 ## FIXME: this should be a separate macro
5368 ##
5369 # Check to see if options -o and -c are simultaneously supported by compiler
5370 echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6
5371 echo "configure:5372: checking if $compiler supports -c -o file.$ac_objext" >&5
5372 if eval "test \"\${lt_cv_compiler_c_o+set}\" = set"; then
5373   echo $ac_n "(cached) $ac_c" 1>&6
5374 else
5375   
5376 $rm -r conftest 2>/dev/null
5377 mkdir conftest
5378 cd conftest
5379 echo "int some_variable = 0;" > conftest.$ac_ext
5380 mkdir out
5381 # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
5382 # that will create temporary files in the current directory regardless of
5383 # the output directory.  Thus, making CWD read-only will cause this test
5384 # to fail, enabling locking or at least warning the user not to do parallel
5385 # builds.
5386 chmod -w .
5387 save_CFLAGS="$CFLAGS"
5388 CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
5389 compiler_c_o=no
5390 if { (eval echo configure:5391: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
5391   # The compiler can only warn and ignore the option if not recognized
5392   # So say no if there are warnings
5393   if test -s out/conftest.err; then
5394     lt_cv_compiler_c_o=no
5395   else
5396     lt_cv_compiler_c_o=yes
5397   fi
5398 else
5399   # Append any errors to the config.log.
5400   cat out/conftest.err 1>&5
5401   lt_cv_compiler_c_o=no
5402 fi
5403 CFLAGS="$save_CFLAGS"
5404 chmod u+w .
5405 $rm conftest* out/*
5406 rmdir out
5407 cd ..
5408 rmdir conftest
5409 $rm -r conftest 2>/dev/null
5410
5411 fi
5412
5413 compiler_c_o=$lt_cv_compiler_c_o
5414 echo "$ac_t""$compiler_c_o" 1>&6
5415
5416 if test x"$compiler_c_o" = x"yes"; then
5417   # Check to see if we can write to a .lo
5418   echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6
5419 echo "configure:5420: checking if $compiler supports -c -o file.lo" >&5
5420   if eval "test \"\${lt_cv_compiler_o_lo+set}\" = set"; then
5421   echo $ac_n "(cached) $ac_c" 1>&6
5422 else
5423   
5424   lt_cv_compiler_o_lo=no
5425   save_CFLAGS="$CFLAGS"
5426   CFLAGS="$CFLAGS -c -o conftest.lo"
5427   save_objext="$ac_objext"
5428   ac_objext=lo
5429   cat > conftest.$ac_ext <<EOF
5430 #line 5431 "configure"
5431 #include "confdefs.h"
5432
5433 int main() {
5434 int some_variable = 0;
5435 ; return 0; }
5436 EOF
5437 if { (eval echo configure:5438: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5438   rm -rf conftest*
5439       # The compiler can only warn and ignore the option if not recognized
5440     # So say no if there are warnings
5441     if test -s conftest.err; then
5442       lt_cv_compiler_o_lo=no
5443     else
5444       lt_cv_compiler_o_lo=yes
5445     fi
5446   
5447 else
5448   echo "configure: failed program was:" >&5
5449   cat conftest.$ac_ext >&5
5450 fi
5451 rm -f conftest*
5452   ac_objext="$save_objext"
5453   CFLAGS="$save_CFLAGS"
5454   
5455 fi
5456
5457   compiler_o_lo=$lt_cv_compiler_o_lo
5458   echo "$ac_t""$compiler_o_lo" 1>&6
5459 else
5460   compiler_o_lo=no
5461 fi
5462 ##
5463 ## END FIXME
5464
5465 ## FIXME: this should be a separate macro
5466 ##
5467 # Check to see if we can do hard links to lock some files if needed
5468 hard_links="nottested"
5469 if test "$compiler_c_o" = no && test "$need_locks" != no; then
5470   # do not overwrite the value of need_locks provided by the user
5471   echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6
5472 echo "configure:5473: checking if we can lock with hard links" >&5
5473   hard_links=yes
5474   $rm conftest*
5475   ln conftest.a conftest.b 2>/dev/null && hard_links=no
5476   touch conftest.a
5477   ln conftest.a conftest.b 2>&5 || hard_links=no
5478   ln conftest.a conftest.b 2>/dev/null && hard_links=no
5479   echo "$ac_t""$hard_links" 1>&6
5480   if test "$hard_links" = no; then
5481     echo "configure: warning: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" 1>&2
5482     need_locks=warn
5483   fi
5484 else
5485   need_locks=no
5486 fi
5487 ##
5488 ## END FIXME
5489
5490 ## FIXME: this should be a separate macro
5491 ##
5492 if test "$GCC" = yes; then
5493   # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
5494   echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6
5495 echo "configure:5496: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
5496   echo "int some_variable = 0;" > conftest.$ac_ext
5497   save_CFLAGS="$CFLAGS"
5498   CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
5499   compiler_rtti_exceptions=no
5500   cat > conftest.$ac_ext <<EOF
5501 #line 5502 "configure"
5502 #include "confdefs.h"
5503
5504 int main() {
5505 int some_variable = 0;
5506 ; return 0; }
5507 EOF
5508 if { (eval echo configure:5509: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5509   rm -rf conftest*
5510       # The compiler can only warn and ignore the option if not recognized
5511     # So say no if there are warnings
5512     if test -s conftest.err; then
5513       compiler_rtti_exceptions=no
5514     else
5515       compiler_rtti_exceptions=yes
5516     fi
5517   
5518 else
5519   echo "configure: failed program was:" >&5
5520   cat conftest.$ac_ext >&5
5521 fi
5522 rm -f conftest*
5523   CFLAGS="$save_CFLAGS"
5524   echo "$ac_t""$compiler_rtti_exceptions" 1>&6
5525
5526   if test "$compiler_rtti_exceptions" = "yes"; then
5527     no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
5528   else
5529     no_builtin_flag=' -fno-builtin'
5530   fi
5531 fi
5532 ##
5533 ## END FIXME
5534
5535 ## FIXME: this should be a separate macro
5536 ##
5537 # See if the linker supports building shared libraries.
5538 echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6
5539 echo "configure:5540: checking whether the linker ($LD) supports shared libraries" >&5
5540
5541 allow_undefined_flag=
5542 no_undefined_flag=
5543 need_lib_prefix=unknown
5544 need_version=unknown
5545 # when you set need_version to no, make sure it does not cause -set_version
5546 # flags to be left without arguments
5547 archive_cmds=
5548 archive_expsym_cmds=
5549 old_archive_from_new_cmds=
5550 old_archive_from_expsyms_cmds=
5551 export_dynamic_flag_spec=
5552 whole_archive_flag_spec=
5553 thread_safe_flag_spec=
5554 hardcode_into_libs=no
5555 hardcode_libdir_flag_spec=
5556 hardcode_libdir_separator=
5557 hardcode_direct=no
5558 hardcode_minus_L=no
5559 hardcode_shlibpath_var=unsupported
5560 runpath_var=
5561 link_all_deplibs=unknown
5562 always_export_symbols=no
5563 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
5564 # include_expsyms should be a list of space-separated symbols to be *always*
5565 # included in the symbol list
5566 include_expsyms=
5567 # exclude_expsyms can be an egrep regular expression of symbols to exclude
5568 # it will be wrapped by ` (' and `)$', so one must not match beginning or
5569 # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5570 # as well as any symbol that contains `d'.
5571 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
5572 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5573 # platforms (ab)use it in PIC code, but their linkers get confused if
5574 # the symbol is explicitly referenced.  Since portable code cannot
5575 # rely on this symbol name, it's probably fine to never include it in
5576 # preloaded symbol tables.
5577 extract_expsyms_cmds=
5578
5579 case $host_os in
5580 cygwin* | mingw* | pw32*)
5581   # FIXME: the MSVC++ port hasn't been tested in a loooong time
5582   # When not using gcc, we currently assume that we are using
5583   # Microsoft Visual C++.
5584   if test "$GCC" != yes; then
5585     with_gnu_ld=no
5586   fi
5587   ;;
5588 openbsd*)
5589   with_gnu_ld=no
5590   ;;
5591 esac
5592
5593 ld_shlibs=yes
5594 if test "$with_gnu_ld" = yes; then
5595   # If archive_cmds runs LD, not CC, wlarc should be empty
5596   wlarc='${wl}'
5597
5598   # See if GNU ld supports shared libraries.
5599   case $host_os in
5600   aix3* | aix4* | aix5*)
5601     # On AIX, the GNU linker is very broken
5602     # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
5603     ld_shlibs=no
5604     cat <<EOF 1>&2
5605
5606 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
5607 *** to be unable to reliably create shared libraries on AIX.
5608 *** Therefore, libtool is disabling shared libraries support.  If you
5609 *** really care for shared libraries, you may want to modify your PATH
5610 *** so that a non-GNU linker is found, and then restart.
5611
5612 EOF
5613     ;;
5614
5615   amigaos*)
5616     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)'
5617     hardcode_libdir_flag_spec='-L$libdir'
5618     hardcode_minus_L=yes
5619
5620     # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
5621     # that the semantics of dynamic libraries on AmigaOS, at least up
5622     # to version 4, is to share data among multiple programs linked
5623     # with the same dynamic library.  Since this doesn't match the
5624     # behavior of shared libraries on other platforms, we can use
5625     # them.
5626     ld_shlibs=no
5627     ;;
5628
5629   beos*)
5630     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5631       allow_undefined_flag=unsupported
5632       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5633       # support --undefined.  This deserves some investigation.  FIXME
5634       archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5635     else
5636       ld_shlibs=no
5637     fi
5638     ;;
5639
5640   cygwin* | mingw* | pw32*)
5641     # hardcode_libdir_flag_spec is actually meaningless, as there is
5642     # no search path for DLLs.
5643     hardcode_libdir_flag_spec='-L$libdir'
5644     allow_undefined_flag=unsupported
5645     always_export_symbols=yes
5646
5647     extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
5648       sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
5649       test -f $output_objdir/impgen.exe || (cd $output_objdir && \
5650       if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
5651       else $CC -o impgen impgen.c ; fi)~
5652       $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
5653
5654     old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
5655
5656     # cygwin and mingw dlls have different entry points and sets of symbols
5657     # to exclude.
5658     # FIXME: what about values for MSVC?
5659     dll_entry=__cygwin_dll_entry@12
5660     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
5661     case $host_os in
5662     mingw*)
5663       # mingw values
5664       dll_entry=_DllMainCRTStartup@12
5665       dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
5666       ;;
5667     esac
5668
5669     # mingw and cygwin differ, and it's simplest to just exclude the union
5670     # of the two symbol sets.
5671     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
5672
5673     # recent cygwin and mingw systems supply a stub DllMain which the user
5674     # can override, but on older systems we have to supply one (in ltdll.c)
5675     if test "x$lt_cv_need_dllmain" = "xyes"; then
5676       ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
5677       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~
5678         test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
5679     else
5680       ltdll_obj=
5681       ltdll_cmds=
5682     fi
5683
5684     # Extract the symbol export list from an `--export-all' def file,
5685     # then regenerate the def file from the symbol export list, so that
5686     # the compiled dll only exports the symbol export list.
5687     # Be careful not to strip the DATA tag left be newer dlltools.
5688     export_symbols_cmds="$ltdll_cmds"'
5689       $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
5690       sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
5691
5692     # If the export-symbols file already is a .def file (1st line
5693     # is EXPORTS), use it as is.
5694     # If DATA tags from a recent dlltool are present, honour them!
5695     archive_expsym_cmds='if test "x`sed 1q $export_symbols`" = xEXPORTS; then
5696         cp $export_symbols $output_objdir/$soname-def;
5697       else
5698         echo EXPORTS > $output_objdir/$soname-def;
5699         _lt_hint=1;
5700         cat $export_symbols | while read symbol; do
5701          set dummy \$symbol;
5702          case \$# in
5703            2) echo "   \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
5704            4) echo "   \$2 \$3 \$4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
5705            *) echo "     \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
5706          esac;
5707          _lt_hint=`expr 1 + \$_lt_hint`;
5708         done;
5709       fi~
5710       '"$ltdll_cmds"'
5711       $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~
5712       $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~
5713       $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~
5714       $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~
5715       $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
5716     ;;
5717
5718   netbsd*)
5719     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5720       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5721       wlarc=
5722     else
5723       archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5724       archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5725     fi
5726     ;;
5727
5728   solaris* | sysv5*)
5729     if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
5730       ld_shlibs=no
5731       cat <<EOF 1>&2
5732
5733 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
5734 *** create shared libraries on Solaris systems.  Therefore, libtool
5735 *** is disabling shared libraries support.  We urge you to upgrade GNU
5736 *** binutils to release 2.9.1 or newer.  Another option is to modify
5737 *** your PATH or compiler configuration so that the native linker is
5738 *** used, and then restart.
5739
5740 EOF
5741     elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5742       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5743       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5744     else
5745       ld_shlibs=no
5746     fi
5747     ;;
5748
5749   sunos4*)
5750     archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5751     wlarc=
5752     hardcode_direct=yes
5753     hardcode_shlibpath_var=no
5754     ;;
5755
5756   *)
5757     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5758       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5759       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5760     else
5761       ld_shlibs=no
5762     fi
5763     ;;
5764   esac
5765
5766   if test "$ld_shlibs" = yes; then
5767     runpath_var=LD_RUN_PATH
5768     hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
5769     export_dynamic_flag_spec='${wl}--export-dynamic'
5770     case $host_os in
5771     cygwin* | mingw* | pw32*)
5772       # dlltool doesn't understand --whole-archive et. al.
5773       whole_archive_flag_spec=
5774       ;;
5775     *)
5776       # ancient GNU ld didn't support --whole-archive et. al.
5777       if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
5778         whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5779       else
5780         whole_archive_flag_spec=
5781       fi
5782       ;;
5783     esac
5784   fi
5785 else
5786   # PORTME fill in a description of your system's linker (not GNU ld)
5787   case $host_os in
5788   aix3*)
5789     allow_undefined_flag=unsupported
5790     always_export_symbols=yes
5791     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'
5792     # Note: this linker hardcodes the directories in LIBPATH if there
5793     # are no directories specified by -L.
5794     hardcode_minus_L=yes
5795     if test "$GCC" = yes && test -z "$link_static_flag"; then
5796       # Neither direct hardcoding nor static linking is supported with a
5797       # broken collect2.
5798       hardcode_direct=unsupported
5799     fi
5800     ;;
5801
5802   aix4* | aix5*)
5803     if test "$host_cpu" = ia64; then
5804       # On IA64, the linker does run time linking by default, so we don't
5805       # have to do anything special.
5806       aix_use_runtimelinking=no
5807       exp_sym_flag='-Bexport'
5808       no_entry_flag=""
5809     else
5810       aix_use_runtimelinking=no
5811
5812       # Test if we are trying to use run time linking or normal
5813       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5814       # need to do runtime linking.
5815       case $host_os in aix4.[23]|aix4.[23].*|aix5*)
5816         for ld_flag in $LDFLAGS; do
5817           case $ld_flag in
5818           *-brtl*)
5819             aix_use_runtimelinking=yes
5820             break
5821           ;;
5822           esac
5823         done
5824       esac
5825
5826       exp_sym_flag='-bexport'
5827       no_entry_flag='-bnoentry'
5828     fi
5829
5830     # When large executables or shared objects are built, AIX ld can
5831     # have problems creating the table of contents.  If linking a library
5832     # or program results in "error TOC overflow" add -mminimal-toc to
5833     # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5834     # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5835
5836     hardcode_direct=yes
5837     archive_cmds=''
5838     hardcode_libdir_separator=':'
5839     if test "$GCC" = yes; then
5840       case $host_os in aix4.[012]|aix4.[012].*)
5841         collect2name=`${CC} -print-prog-name=collect2`
5842         if test -f "$collect2name" && \
5843           strings "$collect2name" | grep resolve_lib_name >/dev/null
5844         then
5845           # We have reworked collect2
5846           hardcode_direct=yes
5847         else
5848           # We have old collect2
5849           hardcode_direct=unsupported
5850           # It fails to find uninstalled libraries when the uninstalled
5851           # path is not listed in the libpath.  Setting hardcode_minus_L
5852           # to unsupported forces relinking
5853           hardcode_minus_L=yes
5854           hardcode_libdir_flag_spec='-L$libdir'
5855           hardcode_libdir_separator=
5856         fi
5857       esac
5858
5859       shared_flag='-shared'
5860     else
5861       # not using gcc
5862       if test "$host_cpu" = ia64; then
5863         shared_flag='${wl}-G'
5864       else
5865         if test "$aix_use_runtimelinking" = yes; then
5866           shared_flag='${wl}-G'
5867         else
5868           shared_flag='${wl}-bM:SRE'
5869         fi
5870       fi
5871     fi
5872
5873     # It seems that -bexpall can do strange things, so it is better to
5874     # generate a list of symbols to export.
5875     always_export_symbols=yes
5876     if test "$aix_use_runtimelinking" = yes; then
5877       # Warning - without using the other runtime loading flags (-brtl),
5878       # -berok will link without error, but may produce a broken library.
5879       allow_undefined_flag='-berok'
5880       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
5881       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"
5882     else
5883       if test "$host_cpu" = ia64; then
5884         hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
5885         allow_undefined_flag="-z nodefs"
5886         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"
5887       else
5888         hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
5889         # Warning - without using the other run time loading flags,
5890         # -berok will link without error, but may produce a broken library.
5891         allow_undefined_flag='${wl}-berok'
5892         # This is a bit strange, but is similar to how AIX traditionally builds
5893         # it's shared libraries.
5894         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'
5895       fi
5896     fi
5897     ;;
5898
5899   amigaos*)
5900     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)'
5901     hardcode_libdir_flag_spec='-L$libdir'
5902     hardcode_minus_L=yes
5903     # see comment about different semantics on the GNU ld section
5904     ld_shlibs=no
5905     ;;
5906
5907   cygwin* | mingw* | pw32*)
5908     # When not using gcc, we currently assume that we are using
5909     # Microsoft Visual C++.
5910     # hardcode_libdir_flag_spec is actually meaningless, as there is
5911     # no search path for DLLs.
5912     hardcode_libdir_flag_spec=' '
5913     allow_undefined_flag=unsupported
5914     # Tell ltmain to make .lib files, not .a files.
5915     libext=lib
5916     # FIXME: Setting linknames here is a bad hack.
5917     archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
5918     # The linker will automatically build a .lib file if we build a DLL.
5919     old_archive_from_new_cmds='true'
5920     # FIXME: Should let the user specify the lib program.
5921     old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
5922     fix_srcfile_path='`cygpath -w "$srcfile"`'
5923     ;;
5924
5925   darwin* | rhapsody*)
5926     case "$host_os" in
5927     rhapsody* | darwin1.[012])
5928       allow_undefined_flag='-undefined suppress'
5929       ;;
5930     *) # Darwin 1.3 on
5931       allow_undefined_flag='-flat_namespace -undefined suppress'
5932       ;;
5933     esac
5934     # FIXME: Relying on posixy $() will cause problems for
5935     #        cross-compilation, but unfortunately the echo tests do not
5936     #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
5937     #        `"' quotes if we put them in here... so don't!
5938     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)'
5939     # We need to add '_' to the symbols in $export_symbols first
5940     #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
5941     hardcode_direct=yes
5942     hardcode_shlibpath_var=no
5943     whole_archive_flag_spec='-all_load $convenience'
5944     ;;
5945
5946   freebsd1*)
5947     ld_shlibs=no
5948     ;;
5949
5950   # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5951   # support.  Future versions do this automatically, but an explicit c++rt0.o
5952   # does not break anything, and helps significantly (at the cost of a little
5953   # extra space).
5954   freebsd2.2*)
5955     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5956     hardcode_libdir_flag_spec='-R$libdir'
5957     hardcode_direct=yes
5958     hardcode_shlibpath_var=no
5959     ;;
5960
5961   # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5962   freebsd2*)
5963     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5964     hardcode_direct=yes
5965     hardcode_minus_L=yes
5966     hardcode_shlibpath_var=no
5967     ;;
5968
5969   # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5970   freebsd*)
5971     archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
5972     hardcode_libdir_flag_spec='-R$libdir'
5973     hardcode_direct=yes
5974     hardcode_shlibpath_var=no
5975     ;;
5976
5977   hpux9* | hpux10* | hpux11*)
5978     case $host_os in
5979     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' ;;
5980     *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
5981     esac
5982     hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
5983     hardcode_libdir_separator=:
5984     hardcode_direct=yes
5985     hardcode_minus_L=yes # Not in the search PATH, but as the default
5986                          # location of the library.
5987     export_dynamic_flag_spec='${wl}-E'
5988     ;;
5989
5990   irix5* | irix6* | nonstopux*)
5991     if test "$GCC" = yes; then
5992       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'
5993       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5994     else
5995       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'
5996       hardcode_libdir_flag_spec='-rpath $libdir'
5997     fi
5998     hardcode_libdir_separator=:
5999     link_all_deplibs=yes
6000     ;;
6001
6002   netbsd*)
6003     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6004       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
6005     else
6006       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
6007     fi
6008     hardcode_libdir_flag_spec='-R$libdir'
6009     hardcode_direct=yes
6010     hardcode_shlibpath_var=no
6011     ;;
6012
6013   newsos6)
6014     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6015     hardcode_direct=yes
6016     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
6017     hardcode_libdir_separator=:
6018     hardcode_shlibpath_var=no
6019     ;;
6020
6021   openbsd*)
6022     hardcode_direct=yes
6023     hardcode_shlibpath_var=no
6024     if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6025       archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6026       hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
6027       export_dynamic_flag_spec='${wl}-E'
6028     else
6029       case "$host_os" in
6030       openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
6031         archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6032         hardcode_libdir_flag_spec='-R$libdir'
6033         ;;
6034       *)
6035         archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6036         hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
6037         ;;
6038       esac
6039     fi
6040     ;;
6041
6042   os2*)
6043     hardcode_libdir_flag_spec='-L$libdir'
6044     hardcode_minus_L=yes
6045     allow_undefined_flag=unsupported
6046     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'
6047     old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
6048     ;;
6049
6050   osf3*)
6051     if test "$GCC" = yes; then
6052       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
6053       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'
6054     else
6055       allow_undefined_flag=' -expect_unresolved \*'
6056       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'
6057     fi
6058     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
6059     hardcode_libdir_separator=:
6060     ;;
6061
6062   osf4* | osf5*)        # as osf3* with the addition of -msym flag
6063     if test "$GCC" = yes; then
6064       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
6065       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'
6066       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
6067     else
6068       allow_undefined_flag=' -expect_unresolved \*'
6069       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'
6070       archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
6071       $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'
6072
6073       #Both c and cxx compiler support -rpath directly
6074       hardcode_libdir_flag_spec='-rpath $libdir'
6075     fi
6076     hardcode_libdir_separator=:
6077     ;;
6078
6079   sco3.2v5*)
6080     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6081     hardcode_shlibpath_var=no
6082     runpath_var=LD_RUN_PATH
6083     hardcode_runpath_var=yes
6084     export_dynamic_flag_spec='${wl}-Bexport'
6085     ;;
6086
6087   solaris*)
6088     # gcc --version < 3.0 without binutils cannot create self contained
6089     # shared libraries reliably, requiring libgcc.a to resolve some of
6090     # the object symbols generated in some cases.  Libraries that use
6091     # assert need libgcc.a to resolve __eprintf, for example.  Linking
6092     # a copy of libgcc.a into every shared library to guarantee resolving
6093     # such symbols causes other problems:  According to Tim Van Holder
6094     # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
6095     # (to the application) exception stack for one thing.
6096     no_undefined_flag=' -z defs'
6097     if test "$GCC" = yes; then
6098       case `$CC --version 2>/dev/null` in
6099       [12].*)
6100         cat <<EOF 1>&2
6101
6102 *** Warning: Releases of GCC earlier than version 3.0 cannot reliably
6103 *** create self contained shared libraries on Solaris systems, without
6104 *** introducing a dependency on libgcc.a.  Therefore, libtool is disabling
6105 *** -no-undefined support, which will at least allow you to build shared
6106 *** libraries.  However, you may find that when you link such libraries
6107 *** into an application without using GCC, you have to manually add
6108 *** \`gcc --print-libgcc-file-name\` to the link command.  We urge you to
6109 *** upgrade to a newer version of GCC.  Another option is to rebuild your
6110 *** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
6111
6112 EOF
6113         no_undefined_flag=
6114         ;;
6115       esac
6116     fi
6117     # $CC -shared without GNU ld will not create a library from C++
6118     # object files and a static libstdc++, better avoid it by now
6119     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6120     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6121                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
6122     hardcode_libdir_flag_spec='-R$libdir'
6123     hardcode_shlibpath_var=no
6124     case $host_os in
6125     solaris2.[0-5] | solaris2.[0-5].*) ;;
6126     *) # Supported since Solaris 2.6 (maybe 2.5.1?)
6127       whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
6128     esac
6129     link_all_deplibs=yes
6130     ;;
6131
6132   sunos4*)
6133     if test "x$host_vendor" = xsequent; then
6134       # Use $CC to link under sequent, because it throws in some extra .o
6135       # files that make .init and .fini sections work.
6136       archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
6137     else
6138       archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
6139     fi
6140     hardcode_libdir_flag_spec='-L$libdir'
6141     hardcode_direct=yes
6142     hardcode_minus_L=yes
6143     hardcode_shlibpath_var=no
6144     ;;
6145
6146   sysv4)
6147     case $host_vendor in
6148       sni)
6149         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6150         hardcode_direct=yes # is this really true???
6151         ;;
6152       siemens)
6153         ## LD is ld it makes a PLAMLIB
6154         ## CC just makes a GrossModule.
6155         archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6156         reload_cmds='$CC -r -o $output$reload_objs'
6157         hardcode_direct=no
6158         ;;
6159       motorola)
6160         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6161         hardcode_direct=no #Motorola manual says yes, but my tests say they lie
6162         ;;
6163     esac
6164     runpath_var='LD_RUN_PATH'
6165     hardcode_shlibpath_var=no
6166     ;;
6167
6168   sysv4.3*)
6169     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6170     hardcode_shlibpath_var=no
6171     export_dynamic_flag_spec='-Bexport'
6172     ;;
6173
6174   sysv5*)
6175     no_undefined_flag=' -z text'
6176     # $CC -shared without GNU ld will not create a library from C++
6177     # object files and a static libstdc++, better avoid it by now
6178     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6179     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6180                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
6181     hardcode_libdir_flag_spec=
6182     hardcode_shlibpath_var=no
6183     runpath_var='LD_RUN_PATH'
6184     ;;
6185
6186   uts4*)
6187     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6188     hardcode_libdir_flag_spec='-L$libdir'
6189     hardcode_shlibpath_var=no
6190     ;;
6191
6192   dgux*)
6193     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6194     hardcode_libdir_flag_spec='-L$libdir'
6195     hardcode_shlibpath_var=no
6196     ;;
6197
6198   sysv4*MP*)
6199     if test -d /usr/nec; then
6200       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6201       hardcode_shlibpath_var=no
6202       runpath_var=LD_RUN_PATH
6203       hardcode_runpath_var=yes
6204       ld_shlibs=yes
6205     fi
6206     ;;
6207
6208   sysv4.2uw2*)
6209     archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6210     hardcode_direct=yes
6211     hardcode_minus_L=no
6212     hardcode_shlibpath_var=no
6213     hardcode_runpath_var=yes
6214     runpath_var=LD_RUN_PATH
6215     ;;
6216
6217   sysv5uw7* | unixware7*)
6218     no_undefined_flag='${wl}-z ${wl}text'
6219     if test "$GCC" = yes; then
6220       archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6221     else
6222       archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6223     fi
6224     runpath_var='LD_RUN_PATH'
6225     hardcode_shlibpath_var=no
6226     ;;
6227
6228   *)
6229     ld_shlibs=no
6230     ;;
6231   esac
6232 fi
6233 echo "$ac_t""$ld_shlibs" 1>&6
6234 test "$ld_shlibs" = no && can_build_shared=no
6235 ##
6236 ## END FIXME
6237
6238 ## FIXME: this should be a separate macro
6239 ##
6240 # Check hardcoding attributes.
6241 echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6
6242 echo "configure:6243: checking how to hardcode library paths into programs" >&5
6243 hardcode_action=
6244 if test -n "$hardcode_libdir_flag_spec" || \
6245    test -n "$runpath_var"; then
6246
6247   # We can hardcode non-existant directories.
6248   if test "$hardcode_direct" != no &&
6249      # If the only mechanism to avoid hardcoding is shlibpath_var, we
6250      # have to relink, otherwise we might link with an installed library
6251      # when we should be linking with a yet-to-be-installed one
6252      ## test "$hardcode_shlibpath_var" != no &&
6253      test "$hardcode_minus_L" != no; then
6254     # Linking always hardcodes the temporary library directory.
6255     hardcode_action=relink
6256   else
6257     # We can link without hardcoding, and we can hardcode nonexisting dirs.
6258     hardcode_action=immediate
6259   fi
6260 else
6261   # We cannot hardcode anything, or else we can only hardcode existing
6262   # directories.
6263   hardcode_action=unsupported
6264 fi
6265 echo "$ac_t""$hardcode_action" 1>&6
6266 ##
6267 ## END FIXME
6268
6269 ## FIXME: this should be a separate macro
6270 ##
6271 striplib=
6272 old_striplib=
6273 echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6
6274 echo "configure:6275: checking whether stripping libraries is possible" >&5
6275 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
6276   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
6277   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
6278   echo "$ac_t""yes" 1>&6
6279 else
6280   echo "$ac_t""no" 1>&6
6281 fi
6282 ##
6283 ## END FIXME
6284
6285 reload_cmds='$LD$reload_flag -o $output$reload_objs'
6286 test -z "$deplibs_check_method" && deplibs_check_method=unknown
6287
6288 ## FIXME: this should be a separate macro
6289 ##
6290 # PORTME Fill in your ld.so characteristics
6291 echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6
6292 echo "configure:6293: checking dynamic linker characteristics" >&5
6293 library_names_spec=
6294 libname_spec='lib$name'
6295 soname_spec=
6296 postinstall_cmds=
6297 postuninstall_cmds=
6298 finish_cmds=
6299 finish_eval=
6300 shlibpath_var=
6301 shlibpath_overrides_runpath=unknown
6302 version_type=none
6303 dynamic_linker="$host_os ld.so"
6304 sys_lib_dlsearch_path_spec="/lib /usr/lib"
6305 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
6306
6307 case $host_os in
6308 aix3*)
6309   version_type=linux
6310   library_names_spec='${libname}${release}.so$versuffix $libname.a'
6311   shlibpath_var=LIBPATH
6312
6313   # AIX has no versioning support, so we append a major version to the name.
6314   soname_spec='${libname}${release}.so$major'
6315   ;;
6316
6317 aix4* | aix5*)
6318   version_type=linux
6319   need_lib_prefix=no
6320   need_version=no
6321   hardcode_into_libs=yes
6322   if test "$host_cpu" = ia64; then
6323     # AIX 5 supports IA64
6324     library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
6325     shlibpath_var=LD_LIBRARY_PATH
6326   else
6327     # With GCC up to 2.95.x, collect2 would create an import file
6328     # for dependence libraries.  The import file would start with
6329     # the line `#! .'.  This would cause the generated library to
6330     # depend on `.', always an invalid library.  This was fixed in
6331     # development snapshots of GCC prior to 3.0.
6332     case $host_os in
6333       aix4 | aix4.[01] | aix4.[01].*)
6334         if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
6335              echo ' yes '
6336              echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
6337           :
6338         else
6339           can_build_shared=no
6340         fi
6341         ;;
6342     esac
6343     # AIX (on Power*) has no versioning support, so currently we can
6344     # not hardcode correct soname into executable. Probably we can
6345     # add versioning support to collect2, so additional links can
6346     # be useful in future.
6347     if test "$aix_use_runtimelinking" = yes; then
6348       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
6349       # instead of lib<name>.a to let people know that these are not
6350       # typical AIX shared libraries.
6351       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6352     else
6353       # We preserve .a as extension for shared libraries through AIX4.2
6354       # and later when we are not doing run time linking.
6355       library_names_spec='${libname}${release}.a $libname.a'
6356       soname_spec='${libname}${release}.so$major'
6357     fi
6358     shlibpath_var=LIBPATH
6359   fi
6360   hardcode_into_libs=yes
6361   ;;
6362
6363 amigaos*)
6364   library_names_spec='$libname.ixlibrary $libname.a'
6365   # Create ${libname}_ixlibrary.a entries in /sys/libs.
6366   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'
6367   ;;
6368
6369 beos*)
6370   library_names_spec='${libname}.so'
6371   dynamic_linker="$host_os ld.so"
6372   shlibpath_var=LIBRARY_PATH
6373   ;;
6374
6375 bsdi4*)
6376   version_type=linux
6377   need_version=no
6378   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6379   soname_spec='${libname}${release}.so$major'
6380   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
6381   shlibpath_var=LD_LIBRARY_PATH
6382   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
6383   sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
6384   export_dynamic_flag_spec=-rdynamic
6385   # the default ld.so.conf also contains /usr/contrib/lib and
6386   # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
6387   # libtool to hard-code these into programs
6388   ;;
6389
6390 cygwin* | mingw* | pw32*)
6391   version_type=windows
6392   need_version=no
6393   need_lib_prefix=no
6394   case $GCC,$host_os in
6395   yes,cygwin*)
6396     library_names_spec='$libname.dll.a'
6397     soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
6398     postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
6399       dldir=$destdir/`dirname \$dlpath`~
6400       test -d \$dldir || mkdir -p \$dldir~
6401       $install_prog .libs/$dlname \$dldir/$dlname'
6402     postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
6403       dlpath=$dir/\$dldll~
6404        $rm \$dlpath'
6405     ;;
6406   yes,mingw*)
6407     library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
6408     sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
6409     ;;
6410   yes,pw32*)
6411     library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll'
6412     ;;
6413   *)
6414     library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
6415     ;;
6416   esac
6417   dynamic_linker='Win32 ld.exe'
6418   # FIXME: first we should search . and the directory the executable is in
6419   shlibpath_var=PATH
6420   ;;
6421
6422 darwin* | rhapsody*)
6423   dynamic_linker="$host_os dyld"
6424   version_type=darwin
6425   need_lib_prefix=no
6426   need_version=no
6427   # FIXME: Relying on posixy $() will cause problems for
6428   #        cross-compilation, but unfortunately the echo tests do not
6429   #        yet detect zsh echo's removal of \ escapes.
6430   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)'
6431   soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
6432   shlibpath_overrides_runpath=yes
6433   shlibpath_var=DYLD_LIBRARY_PATH
6434   ;;
6435
6436 freebsd1*)
6437   dynamic_linker=no
6438   ;;
6439
6440 freebsd*)
6441   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
6442   version_type=freebsd-$objformat
6443   case $version_type in
6444     freebsd-elf*)
6445       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
6446       need_version=no
6447       need_lib_prefix=no
6448       ;;
6449     freebsd-*)
6450       library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
6451       need_version=yes
6452       ;;
6453   esac
6454   shlibpath_var=LD_LIBRARY_PATH
6455   case $host_os in
6456   freebsd2*)
6457     shlibpath_overrides_runpath=yes
6458     ;;
6459   *)
6460     shlibpath_overrides_runpath=no
6461     hardcode_into_libs=yes
6462     ;;
6463   esac
6464   ;;
6465
6466 gnu*)
6467   version_type=linux
6468   need_lib_prefix=no
6469   need_version=no
6470   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
6471   soname_spec='${libname}${release}.so$major'
6472   shlibpath_var=LD_LIBRARY_PATH
6473   hardcode_into_libs=yes
6474   ;;
6475
6476 hpux9* | hpux10* | hpux11*)
6477   # Give a soname corresponding to the major version so that dld.sl refuses to
6478   # link against other versions.
6479   dynamic_linker="$host_os dld.sl"
6480   version_type=sunos
6481   need_lib_prefix=no
6482   need_version=no
6483   shlibpath_var=SHLIB_PATH
6484   shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
6485   library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
6486   soname_spec='${libname}${release}.sl$major'
6487   # HP-UX runs *really* slowly unless shared libraries are mode 555.
6488   postinstall_cmds='chmod 555 $lib'
6489   ;;
6490
6491 irix5* | irix6* | nonstopux*)
6492   case $host_os in
6493     nonstopux*) version_type=nonstopux ;;
6494     *)          version_type=irix ;;
6495   esac
6496   need_lib_prefix=no
6497   need_version=no
6498   soname_spec='${libname}${release}.so$major'
6499   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
6500   case $host_os in
6501   irix5* | nonstopux*)
6502     libsuff= shlibsuff=
6503     ;;
6504   *)
6505     case $LD in # libtool.m4 will add one of these switches to LD
6506     *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
6507     *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
6508     *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
6509     *) libsuff= shlibsuff= libmagic=never-match;;
6510     esac
6511     ;;
6512   esac
6513   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
6514   shlibpath_overrides_runpath=no
6515   sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
6516   sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
6517   ;;
6518
6519 # No shared lib support for Linux oldld, aout, or coff.
6520 linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
6521   dynamic_linker=no
6522   ;;
6523
6524 # This must be Linux ELF.
6525 linux-gnu*)
6526   version_type=linux
6527   need_lib_prefix=no
6528   need_version=no
6529   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6530   soname_spec='${libname}${release}.so$major'
6531   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
6532   shlibpath_var=LD_LIBRARY_PATH
6533   shlibpath_overrides_runpath=no
6534   # This implies no fast_install, which is unacceptable.
6535   # Some rework will be needed to allow for fast_install
6536   # before this can be enabled.
6537   hardcode_into_libs=yes
6538
6539   # We used to test for /lib/ld.so.1 and disable shared libraries on
6540   # powerpc, because MkLinux only supported shared libraries with the
6541   # GNU dynamic linker.  Since this was broken with cross compilers,
6542   # most powerpc-linux boxes support dynamic linking these days and
6543   # people can always --disable-shared, the test was removed, and we
6544   # assume the GNU/Linux dynamic linker is in use.
6545   dynamic_linker='GNU/Linux ld.so'
6546   ;;
6547
6548 netbsd*)
6549   version_type=sunos
6550   need_lib_prefix=no
6551   need_version=no
6552   if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6553     library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6554     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6555     dynamic_linker='NetBSD (a.out) ld.so'
6556   else
6557     library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
6558     soname_spec='${libname}${release}.so$major'
6559     dynamic_linker='NetBSD ld.elf_so'
6560   fi
6561   shlibpath_var=LD_LIBRARY_PATH
6562   shlibpath_overrides_runpath=yes
6563   hardcode_into_libs=yes
6564   ;;
6565
6566 newsos6)
6567   version_type=linux
6568   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6569   shlibpath_var=LD_LIBRARY_PATH
6570   shlibpath_overrides_runpath=yes
6571   ;;
6572
6573 openbsd*)
6574   version_type=sunos
6575   need_lib_prefix=no
6576   need_version=no
6577   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6578     case "$host_os" in
6579     openbsd2.[89] | openbsd2.[89].*)
6580       shlibpath_overrides_runpath=no
6581       ;;
6582     *)
6583       shlibpath_overrides_runpath=yes
6584       ;;
6585     esac
6586   else
6587     shlibpath_overrides_runpath=yes
6588   fi
6589   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6590   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6591   shlibpath_var=LD_LIBRARY_PATH
6592   ;;
6593
6594 os2*)
6595   libname_spec='$name'
6596   need_lib_prefix=no
6597   library_names_spec='$libname.dll $libname.a'
6598   dynamic_linker='OS/2 ld.exe'
6599   shlibpath_var=LIBPATH
6600   ;;
6601
6602 osf3* | osf4* | osf5*)
6603   version_type=osf
6604   need_version=no
6605   soname_spec='${libname}${release}.so$major'
6606   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6607   shlibpath_var=LD_LIBRARY_PATH
6608   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
6609   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
6610   hardcode_into_libs=yes
6611   ;;
6612
6613 sco3.2v5*)
6614   version_type=osf
6615   soname_spec='${libname}${release}.so$major'
6616   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6617   shlibpath_var=LD_LIBRARY_PATH
6618   ;;
6619
6620 solaris*)
6621   version_type=linux
6622   need_lib_prefix=no
6623   need_version=no
6624   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6625   soname_spec='${libname}${release}.so$major'
6626   shlibpath_var=LD_LIBRARY_PATH
6627   shlibpath_overrides_runpath=yes
6628   hardcode_into_libs=yes
6629   # ldd complains unless libraries are executable
6630   postinstall_cmds='chmod +x $lib'
6631   ;;
6632
6633 sunos4*)
6634   version_type=sunos
6635   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6636   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
6637   shlibpath_var=LD_LIBRARY_PATH
6638   shlibpath_overrides_runpath=yes
6639   if test "$with_gnu_ld" = yes; then
6640     need_lib_prefix=no
6641   fi
6642   need_version=yes
6643   ;;
6644
6645 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6646   version_type=linux
6647   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6648   soname_spec='${libname}${release}.so$major'
6649   shlibpath_var=LD_LIBRARY_PATH
6650   case $host_vendor in
6651     sni)
6652       shlibpath_overrides_runpath=no
6653       need_lib_prefix=no
6654       export_dynamic_flag_spec='${wl}-Blargedynsym'
6655       runpath_var=LD_RUN_PATH
6656       ;;
6657     siemens)
6658       need_lib_prefix=no
6659       ;;
6660     motorola)
6661       need_lib_prefix=no
6662       need_version=no
6663       shlibpath_overrides_runpath=no
6664       sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
6665       ;;
6666   esac
6667   ;;
6668
6669 uts4*)
6670   version_type=linux
6671   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6672   soname_spec='${libname}${release}.so$major'
6673   shlibpath_var=LD_LIBRARY_PATH
6674   ;;
6675
6676 dgux*)
6677   version_type=linux
6678   need_lib_prefix=no
6679   need_version=no
6680   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6681   soname_spec='${libname}${release}.so$major'
6682   shlibpath_var=LD_LIBRARY_PATH
6683   ;;
6684
6685 sysv4*MP*)
6686   if test -d /usr/nec ;then
6687     version_type=linux
6688     library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
6689     soname_spec='$libname.so.$major'
6690     shlibpath_var=LD_LIBRARY_PATH
6691   fi
6692   ;;
6693
6694 *)
6695   dynamic_linker=no
6696   ;;
6697 esac
6698 echo "$ac_t""$dynamic_linker" 1>&6
6699 test "$dynamic_linker" = no && can_build_shared=no
6700 ##
6701 ## END FIXME
6702
6703 ## FIXME: this should be a separate macro
6704 ##
6705 # Report the final consequences.
6706 echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6
6707 echo "configure:6708: checking if libtool supports shared libraries" >&5
6708 echo "$ac_t""$can_build_shared" 1>&6
6709 ##
6710 ## END FIXME
6711
6712 ## FIXME: this should be a separate macro
6713 ##
6714 echo $ac_n "checking whether to build shared libraries""... $ac_c" 1>&6
6715 echo "configure:6716: checking whether to build shared libraries" >&5
6716 test "$can_build_shared" = "no" && enable_shared=no
6717
6718 # On AIX, shared libraries and static libraries use the same namespace, and
6719 # are all built from PIC.
6720 case "$host_os" in
6721 aix3*)
6722   test "$enable_shared" = yes && enable_static=no
6723   if test -n "$RANLIB"; then
6724     archive_cmds="$archive_cmds~\$RANLIB \$lib"
6725     postinstall_cmds='$RANLIB $lib'
6726   fi
6727   ;;
6728
6729 aix4*)
6730   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6731     test "$enable_shared" = yes && enable_static=no
6732   fi
6733   ;;
6734 esac
6735 echo "$ac_t""$enable_shared" 1>&6
6736 ##
6737 ## END FIXME
6738
6739 ## FIXME: this should be a separate macro
6740 ##
6741 echo $ac_n "checking whether to build static libraries""... $ac_c" 1>&6
6742 echo "configure:6743: checking whether to build static libraries" >&5
6743 # Make sure either enable_shared or enable_static is yes.
6744 test "$enable_shared" = yes || enable_static=yes
6745 echo "$ac_t""$enable_static" 1>&6
6746 ##
6747 ## END FIXME
6748
6749 if test "$hardcode_action" = relink; then
6750   # Fast installation is not supported
6751   enable_fast_install=no
6752 elif test "$shlibpath_overrides_runpath" = yes ||
6753      test "$enable_shared" = no; then
6754   # Fast installation is not necessary
6755   enable_fast_install=needless
6756 fi
6757
6758 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
6759 if test "$GCC" = yes; then
6760   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
6761 fi
6762
6763 if test "x$enable_dlopen" != xyes; then
6764   enable_dlopen=unknown
6765   enable_dlopen_self=unknown
6766   enable_dlopen_self_static=unknown
6767 else
6768   lt_cv_dlopen=no
6769   lt_cv_dlopen_libs=
6770
6771   case $host_os in
6772   beos*)
6773     lt_cv_dlopen="load_add_on"
6774     lt_cv_dlopen_libs=
6775     lt_cv_dlopen_self=yes
6776     ;;
6777
6778   cygwin* | mingw* | pw32*)
6779     lt_cv_dlopen="LoadLibrary"
6780     lt_cv_dlopen_libs=
6781    ;;
6782
6783   *)
6784     echo $ac_n "checking for shl_load""... $ac_c" 1>&6
6785 echo "configure:6786: checking for shl_load" >&5
6786 if eval "test \"\${ac_cv_func_shl_load+set}\" = set"; then
6787   echo $ac_n "(cached) $ac_c" 1>&6
6788 else
6789   cat > conftest.$ac_ext <<EOF
6790 #line 6791 "configure"
6791 #include "confdefs.h"
6792 /* System header to define __stub macros and hopefully few prototypes,
6793     which can conflict with char shl_load(); below.  */
6794 #include <assert.h>
6795 /* Override any gcc2 internal prototype to avoid an error.  */
6796 /* We use char because int might match the return type of a gcc2
6797     builtin and then its argument prototype would still apply.  */
6798 char shl_load();
6799 char (*f)();
6800
6801 int main() {
6802
6803 /* The GNU C library defines this for functions which it implements
6804     to always fail with ENOSYS.  Some functions are actually named
6805     something starting with __ and the normal name is an alias.  */
6806 #if defined (__stub_shl_load) || defined (__stub___shl_load)
6807 choke me
6808 #else
6809 f = shl_load;
6810 #endif
6811
6812 ; return 0; }
6813 EOF
6814 if { (eval echo configure:6815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6815   rm -rf conftest*
6816   eval "ac_cv_func_shl_load=yes"
6817 else
6818   echo "configure: failed program was:" >&5
6819   cat conftest.$ac_ext >&5
6820   rm -rf conftest*
6821   eval "ac_cv_func_shl_load=no"
6822 fi
6823 rm -f conftest*
6824 fi
6825
6826 if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
6827   echo "$ac_t""yes" 1>&6
6828   lt_cv_dlopen="shl_load"
6829 else
6830   echo "$ac_t""no" 1>&6
6831 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
6832 echo "configure:6833: checking for shl_load in -ldld" >&5
6833 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-:%__p__%'`
6834 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6835   echo $ac_n "(cached) $ac_c" 1>&6
6836 else
6837   ac_save_LIBS="$LIBS"
6838 LIBS="-ldld  $LIBS"
6839 cat > conftest.$ac_ext <<EOF
6840 #line 6841 "configure"
6841 #include "confdefs.h"
6842 /* Override any gcc2 internal prototype to avoid an error.  */
6843 /* We use char because int might match the return type of a gcc2
6844     builtin and then its argument prototype would still apply.  */
6845 char shl_load();
6846
6847 int main() {
6848 shl_load()
6849 ; return 0; }
6850 EOF
6851 if { (eval echo configure:6852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6852   rm -rf conftest*
6853   eval "ac_cv_lib_$ac_lib_var=yes"
6854 else
6855   echo "configure: failed program was:" >&5
6856   cat conftest.$ac_ext >&5
6857   rm -rf conftest*
6858   eval "ac_cv_lib_$ac_lib_var=no"
6859 fi
6860 rm -f conftest*
6861 LIBS="$ac_save_LIBS"
6862
6863 fi
6864 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6865   echo "$ac_t""yes" 1>&6
6866   lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
6867 else
6868   echo "$ac_t""no" 1>&6
6869 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
6870 echo "configure:6871: checking for dlopen" >&5
6871 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
6872   echo $ac_n "(cached) $ac_c" 1>&6
6873 else
6874   cat > conftest.$ac_ext <<EOF
6875 #line 6876 "configure"
6876 #include "confdefs.h"
6877 /* System header to define __stub macros and hopefully few prototypes,
6878     which can conflict with char dlopen(); below.  */
6879 #include <assert.h>
6880 /* Override any gcc2 internal prototype to avoid an error.  */
6881 /* We use char because int might match the return type of a gcc2
6882     builtin and then its argument prototype would still apply.  */
6883 char dlopen();
6884 char (*f)();
6885
6886 int main() {
6887
6888 /* The GNU C library defines this for functions which it implements
6889     to always fail with ENOSYS.  Some functions are actually named
6890     something starting with __ and the normal name is an alias.  */
6891 #if defined (__stub_dlopen) || defined (__stub___dlopen)
6892 choke me
6893 #else
6894 f = dlopen;
6895 #endif
6896
6897 ; return 0; }
6898 EOF
6899 if { (eval echo configure:6900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6900   rm -rf conftest*
6901   eval "ac_cv_func_dlopen=yes"
6902 else
6903   echo "configure: failed program was:" >&5
6904   cat conftest.$ac_ext >&5
6905   rm -rf conftest*
6906   eval "ac_cv_func_dlopen=no"
6907 fi
6908 rm -f conftest*
6909 fi
6910
6911 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
6912   echo "$ac_t""yes" 1>&6
6913   lt_cv_dlopen="dlopen"
6914 else
6915   echo "$ac_t""no" 1>&6
6916 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
6917 echo "configure:6918: checking for dlopen in -ldl" >&5
6918 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
6919 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6920   echo $ac_n "(cached) $ac_c" 1>&6
6921 else
6922   ac_save_LIBS="$LIBS"
6923 LIBS="-ldl  $LIBS"
6924 cat > conftest.$ac_ext <<EOF
6925 #line 6926 "configure"
6926 #include "confdefs.h"
6927 /* Override any gcc2 internal prototype to avoid an error.  */
6928 /* We use char because int might match the return type of a gcc2
6929     builtin and then its argument prototype would still apply.  */
6930 char dlopen();
6931
6932 int main() {
6933 dlopen()
6934 ; return 0; }
6935 EOF
6936 if { (eval echo configure:6937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6937   rm -rf conftest*
6938   eval "ac_cv_lib_$ac_lib_var=yes"
6939 else
6940   echo "configure: failed program was:" >&5
6941   cat conftest.$ac_ext >&5
6942   rm -rf conftest*
6943   eval "ac_cv_lib_$ac_lib_var=no"
6944 fi
6945 rm -f conftest*
6946 LIBS="$ac_save_LIBS"
6947
6948 fi
6949 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6950   echo "$ac_t""yes" 1>&6
6951   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
6952 else
6953   echo "$ac_t""no" 1>&6
6954 echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
6955 echo "configure:6956: checking for dlopen in -lsvld" >&5
6956 ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-:%__p__%'`
6957 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6958   echo $ac_n "(cached) $ac_c" 1>&6
6959 else
6960   ac_save_LIBS="$LIBS"
6961 LIBS="-lsvld  $LIBS"
6962 cat > conftest.$ac_ext <<EOF
6963 #line 6964 "configure"
6964 #include "confdefs.h"
6965 /* Override any gcc2 internal prototype to avoid an error.  */
6966 /* We use char because int might match the return type of a gcc2
6967     builtin and then its argument prototype would still apply.  */
6968 char dlopen();
6969
6970 int main() {
6971 dlopen()
6972 ; return 0; }
6973 EOF
6974 if { (eval echo configure:6975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6975   rm -rf conftest*
6976   eval "ac_cv_lib_$ac_lib_var=yes"
6977 else
6978   echo "configure: failed program was:" >&5
6979   cat conftest.$ac_ext >&5
6980   rm -rf conftest*
6981   eval "ac_cv_lib_$ac_lib_var=no"
6982 fi
6983 rm -f conftest*
6984 LIBS="$ac_save_LIBS"
6985
6986 fi
6987 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6988   echo "$ac_t""yes" 1>&6
6989   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
6990 else
6991   echo "$ac_t""no" 1>&6
6992 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
6993 echo "configure:6994: checking for dld_link in -ldld" >&5
6994 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-:%__p__%'`
6995 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6996   echo $ac_n "(cached) $ac_c" 1>&6
6997 else
6998   ac_save_LIBS="$LIBS"
6999 LIBS="-ldld  $LIBS"
7000 cat > conftest.$ac_ext <<EOF
7001 #line 7002 "configure"
7002 #include "confdefs.h"
7003 /* Override any gcc2 internal prototype to avoid an error.  */
7004 /* We use char because int might match the return type of a gcc2
7005     builtin and then its argument prototype would still apply.  */
7006 char dld_link();
7007
7008 int main() {
7009 dld_link()
7010 ; return 0; }
7011 EOF
7012 if { (eval echo configure:7013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7013   rm -rf conftest*
7014   eval "ac_cv_lib_$ac_lib_var=yes"
7015 else
7016   echo "configure: failed program was:" >&5
7017   cat conftest.$ac_ext >&5
7018   rm -rf conftest*
7019   eval "ac_cv_lib_$ac_lib_var=no"
7020 fi
7021 rm -f conftest*
7022 LIBS="$ac_save_LIBS"
7023
7024 fi
7025 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7026   echo "$ac_t""yes" 1>&6
7027   lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
7028 else
7029   echo "$ac_t""no" 1>&6
7030 fi
7031
7032               
7033 fi
7034
7035             
7036 fi
7037
7038           
7039 fi
7040
7041         
7042 fi
7043
7044       
7045 fi
7046
7047     ;;
7048   esac
7049
7050   if test "x$lt_cv_dlopen" != xno; then
7051     enable_dlopen=yes
7052   else
7053     enable_dlopen=no
7054   fi
7055
7056   case $lt_cv_dlopen in
7057   dlopen)
7058     save_CPPFLAGS="$CPPFLAGS"
7059         test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
7060
7061     save_LDFLAGS="$LDFLAGS"
7062     eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
7063
7064     save_LIBS="$LIBS"
7065     LIBS="$lt_cv_dlopen_libs $LIBS"
7066
7067     echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
7068 echo "configure:7069: checking whether a program can dlopen itself" >&5
7069 if eval "test \"\${lt_cv_dlopen_self+set}\" = set"; then
7070   echo $ac_n "(cached) $ac_c" 1>&6
7071 else
7072           if test "$cross_compiling" = yes; then :
7073   lt_cv_dlopen_self=cross
7074 else
7075     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
7076   lt_status=$lt_dlunknown
7077   cat > conftest.$ac_ext <<EOF
7078 #line 7079 "configure"
7079 #include "confdefs.h"
7080
7081 #if HAVE_DLFCN_H
7082 #include <dlfcn.h>
7083 #endif
7084
7085 #include <stdio.h>
7086
7087 #ifdef RTLD_GLOBAL
7088 #  define LT_DLGLOBAL           RTLD_GLOBAL
7089 #else
7090 #  ifdef DL_GLOBAL
7091 #    define LT_DLGLOBAL         DL_GLOBAL
7092 #  else
7093 #    define LT_DLGLOBAL         0
7094 #  endif
7095 #endif
7096
7097 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
7098    find out it does not work in some platform. */
7099 #ifndef LT_DLLAZY_OR_NOW
7100 #  ifdef RTLD_LAZY
7101 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
7102 #  else
7103 #    ifdef DL_LAZY
7104 #      define LT_DLLAZY_OR_NOW          DL_LAZY
7105 #    else
7106 #      ifdef RTLD_NOW
7107 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
7108 #      else
7109 #        ifdef DL_NOW
7110 #          define LT_DLLAZY_OR_NOW      DL_NOW
7111 #        else
7112 #          define LT_DLLAZY_OR_NOW      0
7113 #        endif
7114 #      endif
7115 #    endif
7116 #  endif
7117 #endif
7118
7119 #ifdef __cplusplus
7120 extern "C" void exit (int);
7121 #endif
7122
7123 void fnord() { int i=42;}
7124 int main ()
7125 {
7126   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
7127   int status = $lt_dlunknown;
7128
7129   if (self)
7130     {
7131       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
7132       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
7133       /* dlclose (self); */
7134     }
7135
7136     exit (status);
7137 }
7138 EOF
7139   if { (eval echo configure:7140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
7140     (./conftest; exit; ) 2>/dev/null
7141     lt_status=$?
7142     case x$lt_status in
7143       x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
7144       x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
7145       x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
7146     esac
7147   else :
7148     # compilation failed
7149     lt_cv_dlopen_self=no
7150   fi
7151 fi
7152 rm -fr conftest*
7153
7154     
7155 fi
7156
7157 echo "$ac_t""$lt_cv_dlopen_self" 1>&6
7158
7159     if test "x$lt_cv_dlopen_self" = xyes; then
7160       LDFLAGS="$LDFLAGS $link_static_flag"
7161       echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
7162 echo "configure:7163: checking whether a statically linked program can dlopen itself" >&5
7163 if eval "test \"\${lt_cv_dlopen_self_static+set}\" = set"; then
7164   echo $ac_n "(cached) $ac_c" 1>&6
7165 else
7166           if test "$cross_compiling" = yes; then :
7167   lt_cv_dlopen_self_static=cross
7168 else
7169     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
7170   lt_status=$lt_dlunknown
7171   cat > conftest.$ac_ext <<EOF
7172 #line 7173 "configure"
7173 #include "confdefs.h"
7174
7175 #if HAVE_DLFCN_H
7176 #include <dlfcn.h>
7177 #endif
7178
7179 #include <stdio.h>
7180
7181 #ifdef RTLD_GLOBAL
7182 #  define LT_DLGLOBAL           RTLD_GLOBAL
7183 #else
7184 #  ifdef DL_GLOBAL
7185 #    define LT_DLGLOBAL         DL_GLOBAL
7186 #  else
7187 #    define LT_DLGLOBAL         0
7188 #  endif
7189 #endif
7190
7191 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
7192    find out it does not work in some platform. */
7193 #ifndef LT_DLLAZY_OR_NOW
7194 #  ifdef RTLD_LAZY
7195 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
7196 #  else
7197 #    ifdef DL_LAZY
7198 #      define LT_DLLAZY_OR_NOW          DL_LAZY
7199 #    else
7200 #      ifdef RTLD_NOW
7201 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
7202 #      else
7203 #        ifdef DL_NOW
7204 #          define LT_DLLAZY_OR_NOW      DL_NOW
7205 #        else
7206 #          define LT_DLLAZY_OR_NOW      0
7207 #        endif
7208 #      endif
7209 #    endif
7210 #  endif
7211 #endif
7212
7213 #ifdef __cplusplus
7214 extern "C" void exit (int);
7215 #endif
7216
7217 void fnord() { int i=42;}
7218 int main ()
7219 {
7220   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
7221   int status = $lt_dlunknown;
7222
7223   if (self)
7224     {
7225       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
7226       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
7227       /* dlclose (self); */
7228     }
7229
7230     exit (status);
7231 }
7232 EOF
7233   if { (eval echo configure:7234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
7234     (./conftest; exit; ) 2>/dev/null
7235     lt_status=$?
7236     case x$lt_status in
7237       x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
7238       x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
7239       x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
7240     esac
7241   else :
7242     # compilation failed
7243     lt_cv_dlopen_self_static=no
7244   fi
7245 fi
7246 rm -fr conftest*
7247
7248       
7249 fi
7250
7251 echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
7252     fi
7253
7254     CPPFLAGS="$save_CPPFLAGS"
7255     LDFLAGS="$save_LDFLAGS"
7256     LIBS="$save_LIBS"
7257     ;;
7258   esac
7259
7260   case $lt_cv_dlopen_self in
7261   yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
7262   *) enable_dlopen_self=unknown ;;
7263   esac
7264
7265   case $lt_cv_dlopen_self_static in
7266   yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
7267   *) enable_dlopen_self_static=unknown ;;
7268   esac
7269 fi
7270
7271
7272 ## FIXME: this should be a separate macro
7273 ##
7274 if test "$enable_shared" = yes && test "$GCC" = yes; then
7275   case $archive_cmds in
7276   *'~'*)
7277     # FIXME: we may have to deal with multi-command sequences.
7278     ;;
7279   '$CC '*)
7280     # Test whether the compiler implicitly links with -lc since on some
7281     # systems, -lgcc has to come before -lc. If gcc already passes -lc
7282     # to ld, don't add -lc before -lgcc.
7283     echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6
7284 echo "configure:7285: checking whether -lc should be explicitly linked in" >&5
7285     if eval "test \"\${lt_cv_archive_cmds_need_lc+set}\" = set"; then
7286   echo $ac_n "(cached) $ac_c" 1>&6
7287 else
7288   $rm conftest*
7289     echo 'static int dummy;' > conftest.$ac_ext
7290
7291     if { (eval echo configure:7292: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7292       soname=conftest
7293       lib=conftest
7294       libobjs=conftest.$ac_objext
7295       deplibs=
7296       wl=$lt_cv_prog_cc_wl
7297       compiler_flags=-v
7298       linker_flags=-v
7299       verstring=
7300       output_objdir=.
7301       libname=conftest
7302       save_allow_undefined_flag=$allow_undefined_flag
7303       allow_undefined_flag=
7304       if { (eval echo configure:7305: \"$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; }
7305       then
7306         lt_cv_archive_cmds_need_lc=no
7307       else
7308         lt_cv_archive_cmds_need_lc=yes
7309       fi
7310       allow_undefined_flag=$save_allow_undefined_flag
7311     else
7312       cat conftest.err 1>&5
7313     fi
7314 fi
7315
7316     echo "$ac_t""$lt_cv_archive_cmds_need_lc" 1>&6
7317     ;;
7318   esac
7319 fi
7320 need_lc=${lt_cv_archive_cmds_need_lc-yes}
7321 ##
7322 ## END FIXME
7323
7324 ## FIXME: this should be a separate macro
7325 ##
7326 # The second clause should only fire when bootstrapping the
7327 # libtool distribution, otherwise you forgot to ship ltmain.sh
7328 # with your package, and you will get complaints that there are
7329 # no rules to generate ltmain.sh.
7330 if test -f "$ltmain"; then
7331   :
7332 else
7333   # If there is no Makefile yet, we rely on a make rule to execute
7334   # `config.status --recheck' to rerun these tests and create the
7335   # libtool script then.
7336   test -f Makefile && make "$ltmain"
7337 fi
7338
7339 if test -f "$ltmain"; then
7340   trap "$rm \"${ofile}T\"; exit 1" 1 2 15
7341   $rm -f "${ofile}T"
7342
7343   echo creating $ofile
7344
7345   # Now quote all the things that may contain metacharacters while being
7346   # careful not to overquote the AC_SUBSTed values.  We take copies of the
7347   # variables and quote the copies for generation of the libtool script.
7348   for var in echo old_CC old_CFLAGS SED \
7349     AR AR_FLAGS CC LD LN_S NM SHELL \
7350     reload_flag reload_cmds wl \
7351     pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
7352     thread_safe_flag_spec whole_archive_flag_spec libname_spec \
7353     library_names_spec soname_spec \
7354     RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
7355     old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
7356     postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
7357     old_striplib striplib file_magic_cmd export_symbols_cmds \
7358     deplibs_check_method allow_undefined_flag no_undefined_flag \
7359     finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
7360     global_symbol_to_c_name_address \
7361     hardcode_libdir_flag_spec hardcode_libdir_separator  \
7362     sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
7363     compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
7364
7365     case $var in
7366     reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
7367     old_postinstall_cmds | old_postuninstall_cmds | \
7368     export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
7369     extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
7370     postinstall_cmds | postuninstall_cmds | \
7371     finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
7372       # Double-quote double-evaled strings.
7373       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
7374       ;;
7375     *)
7376       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
7377       ;;
7378     esac
7379   done
7380
7381   cat <<__EOF__ > "${ofile}T"
7382 #! $SHELL
7383
7384 # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
7385 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
7386 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
7387 #
7388 # Copyright (C) 1996-2000 Free Software Foundation, Inc.
7389 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7390 #
7391 # This program is free software; you can redistribute it and/or modify
7392 # it under the terms of the GNU General Public License as published by
7393 # the Free Software Foundation; either version 2 of the License, or
7394 # (at your option) any later version.
7395 #
7396 # This program is distributed in the hope that it will be useful, but
7397 # WITHOUT ANY WARRANTY; without even the implied warranty of
7398 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
7399 # General Public License for more details.
7400 #
7401 # You should have received a copy of the GNU General Public License
7402 # along with this program; if not, write to the Free Software
7403 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
7404 #
7405 # As a special exception to the GNU General Public License, if you
7406 # distribute this file as part of a program that contains a
7407 # configuration script generated by Autoconf, you may include it under
7408 # the same distribution terms that you use for the rest of that program.
7409
7410 # A sed that does not truncate output.
7411 SED=$lt_SED
7412
7413 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
7414 Xsed="${SED} -e s/^X//"
7415
7416 # The HP-UX ksh and POSIX shell print the target directory to stdout
7417 # if CDPATH is set.
7418 if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
7419
7420 # ### BEGIN LIBTOOL CONFIG
7421
7422 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
7423
7424 # Shell to use when invoking shell scripts.
7425 SHELL=$lt_SHELL
7426
7427 # Whether or not to build shared libraries.
7428 build_libtool_libs=$enable_shared
7429
7430 # Whether or not to build static libraries.
7431 build_old_libs=$enable_static
7432
7433 # Whether or not to add -lc for building shared libraries.
7434 build_libtool_need_lc=$need_lc
7435
7436 # Whether or not to optimize for fast installation.
7437 fast_install=$enable_fast_install
7438
7439 # The host system.
7440 host_alias=$host_alias
7441 host=$host
7442
7443 # An echo program that does not interpret backslashes.
7444 echo=$lt_echo
7445
7446 # The archiver.
7447 AR=$lt_AR
7448 AR_FLAGS=$lt_AR_FLAGS
7449
7450 # The default C compiler.
7451 CC=$lt_CC
7452
7453 # Is the compiler the GNU C compiler?
7454 with_gcc=$GCC
7455
7456 # The linker used to build libraries.
7457 LD=$lt_LD
7458
7459 # Whether we need hard or soft links.
7460 LN_S=$lt_LN_S
7461
7462 # A BSD-compatible nm program.
7463 NM=$lt_NM
7464
7465 # A symbol stripping program
7466 STRIP=$STRIP
7467
7468 # Used to examine libraries when file_magic_cmd begins "file"
7469 MAGIC_CMD=$MAGIC_CMD
7470
7471 # Used on cygwin: DLL creation program.
7472 DLLTOOL="$DLLTOOL"
7473
7474 # Used on cygwin: object dumper.
7475 OBJDUMP="$OBJDUMP"
7476
7477 # Used on cygwin: assembler.
7478 AS="$AS"
7479
7480 # The name of the directory that contains temporary libtool files.
7481 objdir=$objdir
7482
7483 # How to create reloadable object files.
7484 reload_flag=$lt_reload_flag
7485 reload_cmds=$lt_reload_cmds
7486
7487 # How to pass a linker flag through the compiler.
7488 wl=$lt_wl
7489
7490 # Object file suffix (normally "o").
7491 objext="$ac_objext"
7492
7493 # Old archive suffix (normally "a").
7494 libext="$libext"
7495
7496 # Executable file suffix (normally "").
7497 exeext="$exeext"
7498
7499 # Additional compiler flags for building library objects.
7500 pic_flag=$lt_pic_flag
7501 pic_mode=$pic_mode
7502
7503 # Does compiler simultaneously support -c and -o options?
7504 compiler_c_o=$lt_compiler_c_o
7505
7506 # Can we write directly to a .lo ?
7507 compiler_o_lo=$lt_compiler_o_lo
7508
7509 # Must we lock files when doing compilation ?
7510 need_locks=$lt_need_locks
7511
7512 # Do we need the lib prefix for modules?
7513 need_lib_prefix=$need_lib_prefix
7514
7515 # Do we need a version for libraries?
7516 need_version=$need_version
7517
7518 # Whether dlopen is supported.
7519 dlopen_support=$enable_dlopen
7520
7521 # Whether dlopen of programs is supported.
7522 dlopen_self=$enable_dlopen_self
7523
7524 # Whether dlopen of statically linked programs is supported.
7525 dlopen_self_static=$enable_dlopen_self_static
7526
7527 # Compiler flag to prevent dynamic linking.
7528 link_static_flag=$lt_link_static_flag
7529
7530 # Compiler flag to turn off builtin functions.
7531 no_builtin_flag=$lt_no_builtin_flag
7532
7533 # Compiler flag to allow reflexive dlopens.
7534 export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
7535
7536 # Compiler flag to generate shared objects directly from archives.
7537 whole_archive_flag_spec=$lt_whole_archive_flag_spec
7538
7539 # Compiler flag to generate thread-safe objects.
7540 thread_safe_flag_spec=$lt_thread_safe_flag_spec
7541
7542 # Library versioning type.
7543 version_type=$version_type
7544
7545 # Format of library name prefix.
7546 libname_spec=$lt_libname_spec
7547
7548 # List of archive names.  First name is the real one, the rest are links.
7549 # The last name is the one that the linker finds with -lNAME.
7550 library_names_spec=$lt_library_names_spec
7551
7552 # The coded name of the library, if different from the real name.
7553 soname_spec=$lt_soname_spec
7554
7555 # Commands used to build and install an old-style archive.
7556 RANLIB=$lt_RANLIB
7557 old_archive_cmds=$lt_old_archive_cmds
7558 old_postinstall_cmds=$lt_old_postinstall_cmds
7559 old_postuninstall_cmds=$lt_old_postuninstall_cmds
7560
7561 # Create an old-style archive from a shared archive.
7562 old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
7563
7564 # Create a temporary old-style archive to link instead of a shared archive.
7565 old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
7566
7567 # Commands used to build and install a shared archive.
7568 archive_cmds=$lt_archive_cmds
7569 archive_expsym_cmds=$lt_archive_expsym_cmds
7570 postinstall_cmds=$lt_postinstall_cmds
7571 postuninstall_cmds=$lt_postuninstall_cmds
7572
7573 # Commands to strip libraries.
7574 old_striplib=$lt_old_striplib
7575 striplib=$lt_striplib
7576
7577 # Method to check whether dependent libraries are shared objects.
7578 deplibs_check_method=$lt_deplibs_check_method
7579
7580 # Command to use when deplibs_check_method == file_magic.
7581 file_magic_cmd=$lt_file_magic_cmd
7582
7583 # Flag that allows shared libraries with undefined symbols to be built.
7584 allow_undefined_flag=$lt_allow_undefined_flag
7585
7586 # Flag that forces no undefined symbols.
7587 no_undefined_flag=$lt_no_undefined_flag
7588
7589 # Commands used to finish a libtool library installation in a directory.
7590 finish_cmds=$lt_finish_cmds
7591
7592 # Same as above, but a single script fragment to be evaled but not shown.
7593 finish_eval=$lt_finish_eval
7594
7595 # Take the output of nm and produce a listing of raw symbols and C names.
7596 global_symbol_pipe=$lt_global_symbol_pipe
7597
7598 # Transform the output of nm in a proper C declaration
7599 global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
7600
7601 # Transform the output of nm in a C name address pair
7602 global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
7603
7604 # This is the shared library runtime path variable.
7605 runpath_var=$runpath_var
7606
7607 # This is the shared library path variable.
7608 shlibpath_var=$shlibpath_var
7609
7610 # Is shlibpath searched before the hard-coded library search path?
7611 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
7612
7613 # How to hardcode a shared library path into an executable.
7614 hardcode_action=$hardcode_action
7615
7616 # Whether we should hardcode library paths into libraries.
7617 hardcode_into_libs=$hardcode_into_libs
7618
7619 # Flag to hardcode \$libdir into a binary during linking.
7620 # This must work even if \$libdir does not exist.
7621 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
7622
7623 # Whether we need a single -rpath flag with a separated argument.
7624 hardcode_libdir_separator=$lt_hardcode_libdir_separator
7625
7626 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
7627 # resulting binary.
7628 hardcode_direct=$hardcode_direct
7629
7630 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7631 # resulting binary.
7632 hardcode_minus_L=$hardcode_minus_L
7633
7634 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7635 # the resulting binary.
7636 hardcode_shlibpath_var=$hardcode_shlibpath_var
7637
7638 # Variables whose values should be saved in libtool wrapper scripts and
7639 # restored at relink time.
7640 variables_saved_for_relink="$variables_saved_for_relink"
7641
7642 # Whether libtool must link a program against all its dependency libraries.
7643 link_all_deplibs=$link_all_deplibs
7644
7645 # Compile-time system search path for libraries
7646 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
7647
7648 # Run-time system search path for libraries
7649 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
7650
7651 # Fix the shell variable \$srcfile for the compiler.
7652 fix_srcfile_path="$fix_srcfile_path"
7653
7654 # Set to yes if exported symbols are required.
7655 always_export_symbols=$always_export_symbols
7656
7657 # The commands to list exported symbols.
7658 export_symbols_cmds=$lt_export_symbols_cmds
7659
7660 # The commands to extract the exported symbol list from a shared archive.
7661 extract_expsyms_cmds=$lt_extract_expsyms_cmds
7662
7663 # Symbols that should not be listed in the preloaded symbols.
7664 exclude_expsyms=$lt_exclude_expsyms
7665
7666 # Symbols that must always be exported.
7667 include_expsyms=$lt_include_expsyms
7668
7669 # ### END LIBTOOL CONFIG
7670
7671 __EOF__
7672
7673   case $host_os in
7674   aix3*)
7675     cat <<\EOF >> "${ofile}T"
7676
7677 # AIX sometimes has problems with the GCC collect2 program.  For some
7678 # reason, if we set the COLLECT_NAMES environment variable, the problems
7679 # vanish in a puff of smoke.
7680 if test "X${COLLECT_NAMES+set}" != Xset; then
7681   COLLECT_NAMES=
7682   export COLLECT_NAMES
7683 fi
7684 EOF
7685     ;;
7686   esac
7687
7688   case $host_os in
7689   cygwin* | mingw* | pw32* | os2*)
7690     cat <<'EOF' >> "${ofile}T"
7691       # This is a source program that is used to create dlls on Windows
7692       # Don't remove nor modify the starting and closing comments
7693 # /* ltdll.c starts here */
7694 # #define WIN32_LEAN_AND_MEAN
7695 # #include <windows.h>
7696 # #undef WIN32_LEAN_AND_MEAN
7697 # #include <stdio.h>
7698 #
7699 # #ifndef __CYGWIN__
7700 # #  ifdef __CYGWIN32__
7701 # #    define __CYGWIN__ __CYGWIN32__
7702 # #  endif
7703 # #endif
7704 #
7705 # #ifdef __cplusplus
7706 # extern "C" {
7707 # #endif
7708 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
7709 # #ifdef __cplusplus
7710 # }
7711 # #endif
7712 #
7713 # #ifdef __CYGWIN__
7714 # #include <cygwin/cygwin_dll.h>
7715 # DECLARE_CYGWIN_DLL( DllMain );
7716 # #endif
7717 # HINSTANCE __hDllInstance_base;
7718 #
7719 # BOOL APIENTRY
7720 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
7721 # {
7722 #   __hDllInstance_base = hInst;
7723 #   return TRUE;
7724 # }
7725 # /* ltdll.c ends here */
7726         # This is a source program that is used to create import libraries
7727         # on Windows for dlls which lack them. Don't remove nor modify the
7728         # starting and closing comments
7729 # /* impgen.c starts here */
7730 # /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
7731 #
7732 #  This file is part of GNU libtool.
7733 #
7734 #  This program is free software; you can redistribute it and/or modify
7735 #  it under the terms of the GNU General Public License as published by
7736 #  the Free Software Foundation; either version 2 of the License, or
7737 #  (at your option) any later version.
7738 #
7739 #  This program is distributed in the hope that it will be useful,
7740 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
7741 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
7742 #  GNU General Public License for more details.
7743 #
7744 #  You should have received a copy of the GNU General Public License
7745 #  along with this program; if not, write to the Free Software
7746 #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
7747 #  */
7748 #
7749 # #include <stdio.h>            /* for printf() */
7750 # #include <unistd.h>           /* for open(), lseek(), read() */
7751 # #include <fcntl.h>            /* for O_RDONLY, O_BINARY */
7752 # #include <string.h>           /* for strdup() */
7753 #
7754 # /* O_BINARY isn't required (or even defined sometimes) under Unix */
7755 # #ifndef O_BINARY
7756 # #define O_BINARY 0
7757 # #endif
7758 #
7759 # static unsigned int
7760 # pe_get16 (fd, offset)
7761 #      int fd;
7762 #      int offset;
7763 # {
7764 #   unsigned char b[2];
7765 #   lseek (fd, offset, SEEK_SET);
7766 #   read (fd, b, 2);
7767 #   return b[0] + (b[1]<<8);
7768 # }
7769 #
7770 # static unsigned int
7771 # pe_get32 (fd, offset)
7772 #     int fd;
7773 #     int offset;
7774 # {
7775 #   unsigned char b[4];
7776 #   lseek (fd, offset, SEEK_SET);
7777 #   read (fd, b, 4);
7778 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
7779 # }
7780 #
7781 # static unsigned int
7782 # pe_as32 (ptr)
7783 #      void *ptr;
7784 # {
7785 #   unsigned char *b = ptr;
7786 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
7787 # }
7788 #
7789 # int
7790 # main (argc, argv)
7791 #     int argc;
7792 #     char *argv[];
7793 # {
7794 #     int dll;
7795 #     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
7796 #     unsigned long export_rva, export_size, nsections, secptr, expptr;
7797 #     unsigned long name_rvas, nexp;
7798 #     unsigned char *expdata, *erva;
7799 #     char *filename, *dll_name;
7800 #
7801 #     filename = argv[1];
7802 #
7803 #     dll = open(filename, O_RDONLY|O_BINARY);
7804 #     if (dll < 1)
7805 #       return 1;
7806 #
7807 #     dll_name = filename;
7808 #
7809 #     for (i=0; filename[i]; i++)
7810 #       if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
7811 #           dll_name = filename + i +1;
7812 #
7813 #     pe_header_offset = pe_get32 (dll, 0x3c);
7814 #     opthdr_ofs = pe_header_offset + 4 + 20;
7815 #     num_entries = pe_get32 (dll, opthdr_ofs + 92);
7816 #
7817 #     if (num_entries < 1) /* no exports */
7818 #       return 1;
7819 #
7820 #     export_rva = pe_get32 (dll, opthdr_ofs + 96);
7821 #     export_size = pe_get32 (dll, opthdr_ofs + 100);
7822 #     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
7823 #     secptr = (pe_header_offset + 4 + 20 +
7824 #             pe_get16 (dll, pe_header_offset + 4 + 16));
7825 #
7826 #     expptr = 0;
7827 #     for (i = 0; i < nsections; i++)
7828 #     {
7829 #       char sname[8];
7830 #       unsigned long secptr1 = secptr + 40 * i;
7831 #       unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
7832 #       unsigned long vsize = pe_get32 (dll, secptr1 + 16);
7833 #       unsigned long fptr = pe_get32 (dll, secptr1 + 20);
7834 #       lseek(dll, secptr1, SEEK_SET);
7835 #       read(dll, sname, 8);
7836 #       if (vaddr <= export_rva && vaddr+vsize > export_rva)
7837 #       {
7838 #           expptr = fptr + (export_rva - vaddr);
7839 #           if (export_rva + export_size > vaddr + vsize)
7840 #               export_size = vsize - (export_rva - vaddr);
7841 #           break;
7842 #       }
7843 #     }
7844 #
7845 #     expdata = (unsigned char*)malloc(export_size);
7846 #     lseek (dll, expptr, SEEK_SET);
7847 #     read (dll, expdata, export_size);
7848 #     erva = expdata - export_rva;
7849 #
7850 #     nexp = pe_as32 (expdata+24);
7851 #     name_rvas = pe_as32 (expdata+32);
7852 #
7853 #     printf ("EXPORTS\n");
7854 #     for (i = 0; i<nexp; i++)
7855 #     {
7856 #       unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
7857 #       printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
7858 #     }
7859 #
7860 #     return 0;
7861 # }
7862 # /* impgen.c ends here */
7863
7864 EOF
7865     ;;
7866   esac
7867
7868   # We use sed instead of cat because bash on DJGPP gets confused if
7869   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
7870   # text mode, it properly converts lines to CR/LF.  This bash problem
7871   # is reportedly fixed, but why not run on old versions too?
7872   sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
7873
7874   mv -f "${ofile}T" "$ofile" || \
7875     (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
7876   chmod +x "$ofile"
7877 fi
7878 ##
7879 ## END FIXME
7880
7881
7882
7883
7884
7885 # This can be used to rebuild libtool when needed
7886 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
7887
7888 # Always use our own libtool.
7889 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
7890
7891 # Prevent multiple expansion
7892
7893
7894
7895 LTSTATIC=""
7896 if test "${OPENLDAP_CVS}"; then
7897         LTSTATIC="-static"
7898 fi
7899
7900 # test for ln hardlink support
7901 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
7902 echo "configure:7903: checking whether ln works" >&5
7903 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
7904   echo $ac_n "(cached) $ac_c" 1>&6
7905 else
7906   rm -f conftest.src conftest.dst
7907 echo "conftest" > conftest.src
7908 if ln conftest.src conftest.dst 2>/dev/null
7909 then
7910   ol_cv_prog_LN_H="ln"
7911 else
7912   ol_cv_prog_LN_H="cp"
7913 fi
7914 rm -f conftest.src conftest.dst
7915
7916 fi
7917 LN_H="$ol_cv_prog_LN_H"
7918 if test "$ol_cv_prog_LN_H" = "ln"; then
7919         echo "$ac_t""yes" 1>&6
7920 else
7921         echo "$ac_t""no" 1>&6
7922 fi
7923
7924 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
7925 echo "configure:7926: checking whether ln -s works" >&5
7926 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
7927   echo $ac_n "(cached) $ac_c" 1>&6
7928 else
7929   rm -f conftestdata
7930 if ln -s X conftestdata 2>/dev/null
7931 then
7932   rm -f conftestdata
7933   ac_cv_prog_LN_S="ln -s"
7934 else
7935   ac_cv_prog_LN_S=ln
7936 fi
7937 fi
7938 LN_S="$ac_cv_prog_LN_S"
7939 if test "$ac_cv_prog_LN_S" = "ln -s"; then
7940   echo "$ac_t""yes" 1>&6
7941 else
7942   echo "$ac_t""no" 1>&6
7943 fi
7944
7945
7946 ol_link_perl=no
7947 if test $ol_enable_perl != no ; then
7948         # Extract the first word of "perl", so it can be a program name with args.
7949 set dummy perl; ac_word=$2
7950 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7951 echo "configure:7952: checking for $ac_word" >&5
7952 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
7953   echo $ac_n "(cached) $ac_c" 1>&6
7954 else
7955   case "$PERLBIN" in
7956   /*)
7957   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
7958   ;;
7959   ?:/*)
7960   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
7961   ;;
7962   *)
7963   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7964   ac_dummy="$PATH"
7965   for ac_dir in $ac_dummy; do 
7966     test -z "$ac_dir" && ac_dir=.
7967     if test -f $ac_dir/$ac_word; then
7968       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
7969       break
7970     fi
7971   done
7972   IFS="$ac_save_ifs"
7973   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
7974   ;;
7975 esac
7976 fi
7977 PERLBIN="$ac_cv_path_PERLBIN"
7978 if test -n "$PERLBIN"; then
7979   echo "$ac_t""$PERLBIN" 1>&6
7980 else
7981   echo "$ac_t""no" 1>&6
7982 fi
7983
7984
7985         if test "no$PERLBIN" = "no" ; then
7986                 if test $ol_enable_perl = yes ; then
7987                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
7988                 fi
7989
7990         else
7991                 PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
7992                 if test x"$ol_with_perl_module" = "xstatic" ; then
7993                         SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
7994                 else
7995                         MOD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
7996                 fi
7997                                 ol_link_perl=yes
7998         fi
7999 fi
8000
8001 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
8002 echo "configure:8003: checking how to run the C preprocessor" >&5
8003 # On Suns, sometimes $CPP names a directory.
8004 if test -n "$CPP" && test -d "$CPP"; then
8005   CPP=
8006 fi
8007 if test -z "$CPP"; then
8008 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
8009   echo $ac_n "(cached) $ac_c" 1>&6
8010 else
8011     # This must be in double quotes, not single quotes, because CPP may get
8012   # substituted into the Makefile and "${CC-cc}" will confuse make.
8013   CPP="${CC-cc} -E"
8014   # On the NeXT, cc -E runs the code through the compiler's parser,
8015   # not just through cpp.
8016   cat > conftest.$ac_ext <<EOF
8017 #line 8018 "configure"
8018 #include "confdefs.h"
8019 #include <assert.h>
8020 Syntax Error
8021 EOF
8022 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8023 { (eval echo configure:8024: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8024 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8025 if test -z "$ac_err"; then
8026   :
8027 else
8028   echo "$ac_err" >&5
8029   echo "configure: failed program was:" >&5
8030   cat conftest.$ac_ext >&5
8031   rm -rf conftest*
8032   CPP="${CC-cc} -E -traditional-cpp"
8033   cat > conftest.$ac_ext <<EOF
8034 #line 8035 "configure"
8035 #include "confdefs.h"
8036 #include <assert.h>
8037 Syntax Error
8038 EOF
8039 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8040 { (eval echo configure:8041: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8041 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8042 if test -z "$ac_err"; then
8043   :
8044 else
8045   echo "$ac_err" >&5
8046   echo "configure: failed program was:" >&5
8047   cat conftest.$ac_ext >&5
8048   rm -rf conftest*
8049   CPP="${CC-cc} -nologo -E"
8050   cat > conftest.$ac_ext <<EOF
8051 #line 8052 "configure"
8052 #include "confdefs.h"
8053 #include <assert.h>
8054 Syntax Error
8055 EOF
8056 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8057 { (eval echo configure:8058: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8058 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8059 if test -z "$ac_err"; then
8060   :
8061 else
8062   echo "$ac_err" >&5
8063   echo "configure: failed program was:" >&5
8064   cat conftest.$ac_ext >&5
8065   rm -rf conftest*
8066   CPP=/lib/cpp
8067 fi
8068 rm -f conftest*
8069 fi
8070 rm -f conftest*
8071 fi
8072 rm -f conftest*
8073   ac_cv_prog_CPP="$CPP"
8074 fi
8075   CPP="$ac_cv_prog_CPP"
8076 else
8077   ac_cv_prog_CPP="$CPP"
8078 fi
8079 echo "$ac_t""$CPP" 1>&6
8080
8081
8082 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
8083         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
8084
8085 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
8086         echo "configure: warning: programs compiled here do run here..." 1>&2
8087         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
8088
8089 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
8090         echo "configure: warning: programs compiled here do not run here..." 1>&2
8091         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
8092 fi
8093
8094
8095 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
8096 echo "configure:8097: checking for Cygwin environment" >&5
8097 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
8098   echo $ac_n "(cached) $ac_c" 1>&6
8099 else
8100   cat > conftest.$ac_ext <<EOF
8101 #line 8102 "configure"
8102 #include "confdefs.h"
8103
8104 int main() {
8105
8106 #ifndef __CYGWIN__
8107 #define __CYGWIN__ __CYGWIN32__
8108 #endif
8109 return __CYGWIN__;
8110 ; return 0; }
8111 EOF
8112 if { (eval echo configure:8113: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8113   rm -rf conftest*
8114   ac_cv_cygwin=yes
8115 else
8116   echo "configure: failed program was:" >&5
8117   cat conftest.$ac_ext >&5
8118   rm -rf conftest*
8119   ac_cv_cygwin=no
8120 fi
8121 rm -f conftest*
8122 fi
8123
8124 echo "$ac_t""$ac_cv_cygwin" 1>&6
8125 CYGWIN=
8126 test "$ac_cv_cygwin" = yes && CYGWIN=yes
8127 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
8128 echo "configure:8129: checking for mingw32 environment" >&5
8129 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
8130   echo $ac_n "(cached) $ac_c" 1>&6
8131 else
8132   cat > conftest.$ac_ext <<EOF
8133 #line 8134 "configure"
8134 #include "confdefs.h"
8135
8136 int main() {
8137 return __MINGW32__;
8138 ; return 0; }
8139 EOF
8140 if { (eval echo configure:8141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8141   rm -rf conftest*
8142   ac_cv_mingw32=yes
8143 else
8144   echo "configure: failed program was:" >&5
8145   cat conftest.$ac_ext >&5
8146   rm -rf conftest*
8147   ac_cv_mingw32=no
8148 fi
8149 rm -f conftest*
8150 fi
8151
8152 echo "$ac_t""$ac_cv_mingw32" 1>&6
8153 MINGW32=
8154 test "$ac_cv_mingw32" = yes && MINGW32=yes
8155
8156
8157
8158 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
8159 echo "configure:8160: checking for executable suffix" >&5
8160 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
8161   echo $ac_n "(cached) $ac_c" 1>&6
8162 else
8163   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
8164   ac_cv_exeext=.exe
8165 else
8166   rm -f conftest*
8167   echo 'int main () { return 0; }' > conftest.$ac_ext
8168   ac_cv_exeext=
8169   if { (eval echo configure:8170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
8170     for file in conftest.*; do
8171       case $file in
8172       *.c | *.C | *.o | *.obj | *.xcoff) ;;
8173       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
8174       esac
8175     done
8176   else
8177     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
8178   fi
8179   rm -f conftest*
8180   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
8181 fi
8182 fi
8183
8184 EXEEXT=""
8185 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
8186 echo "$ac_t""${ac_cv_exeext}" 1>&6
8187 ac_exeext=$EXEEXT
8188
8189 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
8190 echo "configure:8191: checking for object suffix" >&5
8191 if eval "test \"\${ac_cv_objext+set}\" = set"; then
8192   echo $ac_n "(cached) $ac_c" 1>&6
8193 else
8194   rm -f conftest*
8195 echo 'int i = 1;' > conftest.$ac_ext
8196 if { (eval echo configure:8197: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8197   for ac_file in conftest.*; do
8198     case $ac_file in
8199     *.c) ;;
8200     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
8201     esac
8202   done
8203 else
8204   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
8205 fi
8206 rm -f conftest*
8207 fi
8208
8209 echo "$ac_t""$ac_cv_objext" 1>&6
8210 OBJEXT=$ac_cv_objext
8211 ac_objext=$ac_cv_objext
8212
8213
8214 cat >> confdefs.h <<EOF
8215 #define EXEEXT "${EXEEXT}"
8216 EOF
8217
8218
8219 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
8220 echo "configure:8221: checking for be_app in -lbe" >&5
8221 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
8222 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8223   echo $ac_n "(cached) $ac_c" 1>&6
8224 else
8225   ac_save_LIBS="$LIBS"
8226 LIBS="-lbe -lroot -lnet $LIBS"
8227 cat > conftest.$ac_ext <<EOF
8228 #line 8229 "configure"
8229 #include "confdefs.h"
8230 /* Override any gcc2 internal prototype to avoid an error.  */
8231 /* We use char because int might match the return type of a gcc2
8232     builtin and then its argument prototype would still apply.  */
8233 char be_app();
8234
8235 int main() {
8236 be_app()
8237 ; return 0; }
8238 EOF
8239 if { (eval echo configure:8240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8240   rm -rf conftest*
8241   eval "ac_cv_lib_$ac_lib_var=yes"
8242 else
8243   echo "configure: failed program was:" >&5
8244   cat conftest.$ac_ext >&5
8245   rm -rf conftest*
8246   eval "ac_cv_lib_$ac_lib_var=no"
8247 fi
8248 rm -f conftest*
8249 LIBS="$ac_save_LIBS"
8250
8251 fi
8252 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8253   echo "$ac_t""yes" 1>&6
8254   LIBS="$LIBS -lbe -lroot -lnet"
8255 else
8256   echo "$ac_t""no" 1>&6
8257 :
8258 fi
8259
8260
8261
8262
8263
8264 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
8265 echo "configure:8266: checking for ${CC-cc} option to accept ANSI C" >&5
8266 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
8267   echo $ac_n "(cached) $ac_c" 1>&6
8268 else
8269   am_cv_prog_cc_stdc=no
8270 ac_save_CC="$CC"
8271 # Don't try gcc -ansi; that turns off useful extensions and
8272 # breaks some systems' header files.
8273 # AIX                   -qlanglvl=ansi
8274 # Ultrix and OSF/1      -std1
8275 # HP-UX 10.20 and later -Ae
8276 # HP-UX older versions  -Aa -D_HPUX_SOURCE
8277 # SVR4                  -Xc -D__EXTENSIONS__
8278 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
8279 do
8280   CC="$ac_save_CC $ac_arg"
8281   cat > conftest.$ac_ext <<EOF
8282 #line 8283 "configure"
8283 #include "confdefs.h"
8284 #include <stdarg.h>
8285 #include <stdio.h>
8286 #include <sys/types.h>
8287 #include <sys/stat.h>
8288 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
8289 struct buf { int x; };
8290 FILE * (*rcsopen) (struct buf *, struct stat *, int);
8291 static char *e (p, i)
8292      char **p;
8293      int i;
8294 {
8295   return p[i];
8296 }
8297 static char *f (char * (*g) (char **, int), char **p, ...)
8298 {
8299   char *s;
8300   va_list v;
8301   va_start (v,p);
8302   s = g (p, va_arg (v,int));
8303   va_end (v);
8304   return s;
8305 }
8306 int test (int i, double x);
8307 struct s1 {int (*f) (int a);};
8308 struct s2 {int (*f) (double a);};
8309 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
8310 int argc;
8311 char **argv;
8312
8313 int main() {
8314
8315 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
8316
8317 ; return 0; }
8318 EOF
8319 if { (eval echo configure:8320: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8320   rm -rf conftest*
8321   am_cv_prog_cc_stdc="$ac_arg"; break
8322 else
8323   echo "configure: failed program was:" >&5
8324   cat conftest.$ac_ext >&5
8325 fi
8326 rm -f conftest*
8327 done
8328 CC="$ac_save_CC"
8329
8330 fi
8331
8332 if test -z "$am_cv_prog_cc_stdc"; then
8333   echo "$ac_t""none needed" 1>&6
8334 else
8335   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
8336 fi
8337 case "x$am_cv_prog_cc_stdc" in
8338   x|xno) ;;
8339   *) CC="$CC $am_cv_prog_cc_stdc" ;;
8340 esac
8341
8342 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
8343         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
8344 fi
8345
8346 # test for make depend flag
8347 OL_MKDEP=
8348 OL_MKDEP_FLAGS=
8349 if test -z "${MKDEP}"; then
8350         OL_MKDEP="${CC-cc}"
8351         if test -z "${MKDEP_FLAGS}"; then
8352                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
8353 echo "configure:8354: checking for ${OL_MKDEP} depend flag" >&5
8354 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
8355   echo $ac_n "(cached) $ac_c" 1>&6
8356 else
8357   
8358                         ol_cv_mkdep=no
8359                         for flag in "-M" "-xM"; do
8360                                 cat > conftest.c <<EOF
8361  noCode;
8362 EOF
8363                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:8364: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
8364                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
8365                                 then
8366                                         if test ! -f conftest."${ac_object}" ; then
8367                                                 ol_cv_mkdep=$flag
8368                                                 OL_MKDEP_FLAGS="$flag"
8369                                                 break
8370                                         fi
8371                                 fi
8372                         done
8373                         rm -f conftest*
8374                 
8375 fi
8376
8377 echo "$ac_t""$ol_cv_mkdep" 1>&6
8378         else
8379                 cc_cv_mkdep=yes
8380                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
8381         fi
8382 else
8383         cc_cv_mkdep=yes
8384         OL_MKDEP="${MKDEP}"
8385         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
8386 fi
8387
8388
8389
8390 if test "${ol_cv_mkdep}" = no ; then
8391         # this will soon become an error
8392         echo "configure: warning: do not know how to generate dependencies" 1>&2
8393 fi
8394
8395 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
8396 echo "configure:8397: checking for afopen in -ls" >&5
8397 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
8398 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8399   echo $ac_n "(cached) $ac_c" 1>&6
8400 else
8401   ac_save_LIBS="$LIBS"
8402 LIBS="-ls  $LIBS"
8403 cat > conftest.$ac_ext <<EOF
8404 #line 8405 "configure"
8405 #include "confdefs.h"
8406 /* Override any gcc2 internal prototype to avoid an error.  */
8407 /* We use char because int might match the return type of a gcc2
8408     builtin and then its argument prototype would still apply.  */
8409 char afopen();
8410
8411 int main() {
8412 afopen()
8413 ; return 0; }
8414 EOF
8415 if { (eval echo configure:8416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8416   rm -rf conftest*
8417   eval "ac_cv_lib_$ac_lib_var=yes"
8418 else
8419   echo "configure: failed program was:" >&5
8420   cat conftest.$ac_ext >&5
8421   rm -rf conftest*
8422   eval "ac_cv_lib_$ac_lib_var=no"
8423 fi
8424 rm -f conftest*
8425 LIBS="$ac_save_LIBS"
8426
8427 fi
8428 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8429   echo "$ac_t""yes" 1>&6
8430   
8431         AUTH_LIBS=-ls
8432         cat >> confdefs.h <<\EOF
8433 #define HAVE_AIX_SECURITY 1
8434 EOF
8435
8436
8437 else
8438   echo "$ac_t""no" 1>&6
8439 fi
8440
8441
8442 case "$target" in
8443 *-ibm-openedition)
8444         ac_cv_func_getopt=no
8445         cat >> confdefs.h <<\EOF
8446 #define BOTH_STRINGS_H 1
8447 EOF
8448
8449         ;;
8450 esac
8451
8452 ol_link_modules=no
8453 if test $ol_enable_modules != no ; then
8454         for ac_hdr in ltdl.h
8455 do
8456 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8457 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8458 echo "configure:8459: checking for $ac_hdr" >&5
8459 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8460   echo $ac_n "(cached) $ac_c" 1>&6
8461 else
8462   cat > conftest.$ac_ext <<EOF
8463 #line 8464 "configure"
8464 #include "confdefs.h"
8465 #include <$ac_hdr>
8466 EOF
8467 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8468 { (eval echo configure:8469: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8469 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8470 if test -z "$ac_err"; then
8471   rm -rf conftest*
8472   eval "ac_cv_header_$ac_safe=yes"
8473 else
8474   echo "$ac_err" >&5
8475   echo "configure: failed program was:" >&5
8476   cat conftest.$ac_ext >&5
8477   rm -rf conftest*
8478   eval "ac_cv_header_$ac_safe=no"
8479 fi
8480 rm -f conftest*
8481 fi
8482 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8483   echo "$ac_t""yes" 1>&6
8484     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8485   cat >> confdefs.h <<EOF
8486 #define $ac_tr_hdr 1
8487 EOF
8488  
8489 else
8490   echo "$ac_t""no" 1>&6
8491 fi
8492 done
8493
8494
8495         if test $ac_cv_header_ltdl_h = no ; then
8496                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
8497         fi
8498
8499         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
8500 echo "configure:8501: checking for lt_dlinit in -lltdl" >&5
8501 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
8502 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8503   echo $ac_n "(cached) $ac_c" 1>&6
8504 else
8505   ac_save_LIBS="$LIBS"
8506 LIBS="-lltdl  $LIBS"
8507 cat > conftest.$ac_ext <<EOF
8508 #line 8509 "configure"
8509 #include "confdefs.h"
8510 /* Override any gcc2 internal prototype to avoid an error.  */
8511 /* We use char because int might match the return type of a gcc2
8512     builtin and then its argument prototype would still apply.  */
8513 char lt_dlinit();
8514
8515 int main() {
8516 lt_dlinit()
8517 ; return 0; }
8518 EOF
8519 if { (eval echo configure:8520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8520   rm -rf conftest*
8521   eval "ac_cv_lib_$ac_lib_var=yes"
8522 else
8523   echo "configure: failed program was:" >&5
8524   cat conftest.$ac_ext >&5
8525   rm -rf conftest*
8526   eval "ac_cv_lib_$ac_lib_var=no"
8527 fi
8528 rm -f conftest*
8529 LIBS="$ac_save_LIBS"
8530
8531 fi
8532 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8533   echo "$ac_t""yes" 1>&6
8534   
8535                 MODULES_LIBS=-lltdl
8536                 cat >> confdefs.h <<\EOF
8537 #define HAVE_LIBLTDL 1
8538 EOF
8539
8540         
8541 else
8542   echo "$ac_t""no" 1>&6
8543 fi
8544
8545
8546         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
8547                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
8548         fi
8549         ol_link_modules=yes
8550 else
8551         ol_with_bdb_module=static
8552         ol_with_dnssrv_module=static
8553         ol_with_ldap_module=static
8554         ol_with_ldbm_module=static
8555         ol_with_meta_module=static
8556         ol_with_monitor_module=static
8557         ol_with_null_module=static
8558         ol_with_passwd_module=static
8559         ol_with_perl_module=static
8560         ol_with_shell_module=static
8561         ol_with_tcl_module=static
8562         ol_with_sql_module=static
8563 fi
8564
8565 # test for EBCDIC
8566 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
8567 echo "configure:8568: checking for EBCDIC" >&5
8568 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
8569   echo $ac_n "(cached) $ac_c" 1>&6
8570 else
8571   
8572         cat > conftest.$ac_ext <<EOF
8573 #line 8574 "configure"
8574 #include "confdefs.h"
8575
8576 #if !('M' == 0xd4)
8577 #include <__ASCII__/generate_error.h>
8578 #endif
8579
8580 EOF
8581 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8582 { (eval echo configure:8583: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8583 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8584 if test -z "$ac_err"; then
8585   rm -rf conftest*
8586   ol_cv_cpp_ebcdic=yes
8587 else
8588   echo "$ac_err" >&5
8589   echo "configure: failed program was:" >&5
8590   cat conftest.$ac_ext >&5
8591   rm -rf conftest*
8592   ol_cv_cpp_ebcdic=no
8593 fi
8594 rm -f conftest*
8595 fi
8596
8597 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
8598 if test $ol_cv_cpp_ebcdic = yes ; then
8599         cat >> confdefs.h <<\EOF
8600 #define HAVE_EBCDIC 1
8601 EOF
8602
8603 fi
8604
8605 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
8606 echo "configure:8607: checking for ANSI C header files" >&5
8607 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
8608   echo $ac_n "(cached) $ac_c" 1>&6
8609 else
8610   cat > conftest.$ac_ext <<EOF
8611 #line 8612 "configure"
8612 #include "confdefs.h"
8613 #include <stdlib.h>
8614 #include <stdarg.h>
8615 #include <string.h>
8616 #include <float.h>
8617 EOF
8618 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8619 { (eval echo configure:8620: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8620 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8621 if test -z "$ac_err"; then
8622   rm -rf conftest*
8623   ol_cv_header_stdc=yes
8624 else
8625   echo "$ac_err" >&5
8626   echo "configure: failed program was:" >&5
8627   cat conftest.$ac_ext >&5
8628   rm -rf conftest*
8629   ol_cv_header_stdc=no
8630 fi
8631 rm -f conftest*
8632
8633 if test $ol_cv_header_stdc = yes; then
8634   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
8635 cat > conftest.$ac_ext <<EOF
8636 #line 8637 "configure"
8637 #include "confdefs.h"
8638 #include <string.h>
8639 EOF
8640 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8641   egrep "memchr" >/dev/null 2>&1; then
8642   :
8643 else
8644   rm -rf conftest*
8645   ol_cv_header_stdc=no
8646 fi
8647 rm -f conftest*
8648
8649 fi
8650
8651 if test $ol_cv_header_stdc = yes; then
8652   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
8653 cat > conftest.$ac_ext <<EOF
8654 #line 8655 "configure"
8655 #include "confdefs.h"
8656 #include <stdlib.h>
8657 EOF
8658 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8659   egrep "free" >/dev/null 2>&1; then
8660   :
8661 else
8662   rm -rf conftest*
8663   ol_cv_header_stdc=no
8664 fi
8665 rm -f conftest*
8666
8667 fi
8668
8669 if test $ol_cv_header_stdc = yes; then
8670   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
8671 if test "$cross_compiling" = yes; then
8672   :
8673 else
8674   cat > conftest.$ac_ext <<EOF
8675 #line 8676 "configure"
8676 #include "confdefs.h"
8677 #include <ctype.h>
8678 #ifndef HAVE_EBCDIC
8679 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
8680 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
8681 #else
8682 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
8683                 || ('j' <= (c) && (c) <= 'r') \
8684                 || ('s' <= (c) && (c) <= 'z'))
8685 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
8686 #endif
8687 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
8688 int main () { int i; for (i = 0; i < 256; i++)
8689 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
8690 exit (0); }
8691
8692 EOF
8693 if { (eval echo configure:8694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8694 then
8695   :
8696 else
8697   echo "configure: failed program was:" >&5
8698   cat conftest.$ac_ext >&5
8699   rm -fr conftest*
8700   ol_cv_header_stdc=no
8701 fi
8702 rm -fr conftest*
8703 fi
8704
8705 fi
8706 fi
8707
8708 echo "$ac_t""$ol_cv_header_stdc" 1>&6
8709 if test $ol_cv_header_stdc = yes; then
8710   cat >> confdefs.h <<\EOF
8711 #define STDC_HEADERS 1
8712 EOF
8713
8714 fi
8715 ac_cv_header_stdc=disable
8716
8717
8718 if test $ol_cv_header_stdc != yes; then
8719         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
8720 fi
8721
8722 ac_header_dirent=no
8723 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
8724 do
8725 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8726 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
8727 echo "configure:8728: checking for $ac_hdr that defines DIR" >&5
8728 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
8729   echo $ac_n "(cached) $ac_c" 1>&6
8730 else
8731   cat > conftest.$ac_ext <<EOF
8732 #line 8733 "configure"
8733 #include "confdefs.h"
8734 #include <sys/types.h>
8735 #include <$ac_hdr>
8736 int main() {
8737 DIR *dirp = 0;
8738 ; return 0; }
8739 EOF
8740 if { (eval echo configure:8741: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8741   rm -rf conftest*
8742   eval "ac_cv_header_dirent_$ac_safe=yes"
8743 else
8744   echo "configure: failed program was:" >&5
8745   cat conftest.$ac_ext >&5
8746   rm -rf conftest*
8747   eval "ac_cv_header_dirent_$ac_safe=no"
8748 fi
8749 rm -f conftest*
8750 fi
8751 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
8752   echo "$ac_t""yes" 1>&6
8753     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8754   cat >> confdefs.h <<EOF
8755 #define $ac_tr_hdr 1
8756 EOF
8757  ac_header_dirent=$ac_hdr; break
8758 else
8759   echo "$ac_t""no" 1>&6
8760 fi
8761 done
8762 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
8763 if test $ac_header_dirent = dirent.h; then
8764 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
8765 echo "configure:8766: checking for opendir in -ldir" >&5
8766 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
8767 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8768   echo $ac_n "(cached) $ac_c" 1>&6
8769 else
8770   ac_save_LIBS="$LIBS"
8771 LIBS="-ldir  $LIBS"
8772 cat > conftest.$ac_ext <<EOF
8773 #line 8774 "configure"
8774 #include "confdefs.h"
8775 /* Override any gcc2 internal prototype to avoid an error.  */
8776 /* We use char because int might match the return type of a gcc2
8777     builtin and then its argument prototype would still apply.  */
8778 char opendir();
8779
8780 int main() {
8781 opendir()
8782 ; return 0; }
8783 EOF
8784 if { (eval echo configure:8785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8785   rm -rf conftest*
8786   eval "ac_cv_lib_$ac_lib_var=yes"
8787 else
8788   echo "configure: failed program was:" >&5
8789   cat conftest.$ac_ext >&5
8790   rm -rf conftest*
8791   eval "ac_cv_lib_$ac_lib_var=no"
8792 fi
8793 rm -f conftest*
8794 LIBS="$ac_save_LIBS"
8795
8796 fi
8797 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8798   echo "$ac_t""yes" 1>&6
8799   LIBS="$LIBS -ldir"
8800 else
8801   echo "$ac_t""no" 1>&6
8802 fi
8803
8804 else
8805 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
8806 echo "configure:8807: checking for opendir in -lx" >&5
8807 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
8808 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8809   echo $ac_n "(cached) $ac_c" 1>&6
8810 else
8811   ac_save_LIBS="$LIBS"
8812 LIBS="-lx  $LIBS"
8813 cat > conftest.$ac_ext <<EOF
8814 #line 8815 "configure"
8815 #include "confdefs.h"
8816 /* Override any gcc2 internal prototype to avoid an error.  */
8817 /* We use char because int might match the return type of a gcc2
8818     builtin and then its argument prototype would still apply.  */
8819 char opendir();
8820
8821 int main() {
8822 opendir()
8823 ; return 0; }
8824 EOF
8825 if { (eval echo configure:8826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8826   rm -rf conftest*
8827   eval "ac_cv_lib_$ac_lib_var=yes"
8828 else
8829   echo "configure: failed program was:" >&5
8830   cat conftest.$ac_ext >&5
8831   rm -rf conftest*
8832   eval "ac_cv_lib_$ac_lib_var=no"
8833 fi
8834 rm -f conftest*
8835 LIBS="$ac_save_LIBS"
8836
8837 fi
8838 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8839   echo "$ac_t""yes" 1>&6
8840   LIBS="$LIBS -lx"
8841 else
8842   echo "$ac_t""no" 1>&6
8843 fi
8844
8845 fi
8846
8847 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
8848 echo "configure:8849: checking for sys/wait.h that is POSIX.1 compatible" >&5
8849 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
8850   echo $ac_n "(cached) $ac_c" 1>&6
8851 else
8852   cat > conftest.$ac_ext <<EOF
8853 #line 8854 "configure"
8854 #include "confdefs.h"
8855 #include <sys/types.h>
8856 #include <sys/wait.h>
8857 #ifndef WEXITSTATUS
8858 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
8859 #endif
8860 #ifndef WIFEXITED
8861 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
8862 #endif
8863 int main() {
8864 int s;
8865 wait (&s);
8866 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
8867 ; return 0; }
8868 EOF
8869 if { (eval echo configure:8870: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8870   rm -rf conftest*
8871   ac_cv_header_sys_wait_h=yes
8872 else
8873   echo "configure: failed program was:" >&5
8874   cat conftest.$ac_ext >&5
8875   rm -rf conftest*
8876   ac_cv_header_sys_wait_h=no
8877 fi
8878 rm -f conftest*
8879 fi
8880
8881 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
8882 if test $ac_cv_header_sys_wait_h = yes; then
8883   cat >> confdefs.h <<\EOF
8884 #define HAVE_SYS_WAIT_H 1
8885 EOF
8886
8887 fi
8888
8889 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
8890 echo "configure:8891: checking POSIX termios" >&5
8891 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
8892   echo $ac_n "(cached) $ac_c" 1>&6
8893 else
8894   cat > conftest.$ac_ext <<EOF
8895 #line 8896 "configure"
8896 #include "confdefs.h"
8897 #include <sys/types.h>
8898 #include <unistd.h>
8899 #include <termios.h>
8900 int main() {
8901 /* SunOS 4.0.3 has termios.h but not the library calls.  */
8902    tcgetattr(0, 0);
8903 ; return 0; }
8904 EOF
8905 if { (eval echo configure:8906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8906   rm -rf conftest*
8907   am_cv_sys_posix_termios=yes
8908 else
8909   echo "configure: failed program was:" >&5
8910   cat conftest.$ac_ext >&5
8911   rm -rf conftest*
8912   am_cv_sys_posix_termios=no
8913 fi
8914 rm -f conftest*
8915 fi
8916
8917 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
8918
8919
8920  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
8921 echo "configure:8922: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
8922 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
8923   echo $ac_n "(cached) $ac_c" 1>&6
8924 else
8925   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
8926
8927   gwinsz_in_termios_h=no
8928   if test $am_cv_sys_posix_termios = yes; then
8929     cat > conftest.$ac_ext <<EOF
8930 #line 8931 "configure"
8931 #include "confdefs.h"
8932 #include <sys/types.h>
8933 #     include <termios.h>
8934 #     ifdef TIOCGWINSZ
8935         yes
8936 #     endif
8937     
8938 EOF
8939 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8940   egrep "yes" >/dev/null 2>&1; then
8941   rm -rf conftest*
8942   gwinsz_in_termios_h=yes
8943 fi
8944 rm -f conftest*
8945
8946   fi
8947
8948   if test $gwinsz_in_termios_h = no; then
8949     cat > conftest.$ac_ext <<EOF
8950 #line 8951 "configure"
8951 #include "confdefs.h"
8952 #include <sys/types.h>
8953 #     include <sys/ioctl.h>
8954 #     ifdef TIOCGWINSZ
8955         yes
8956 #     endif
8957     
8958 EOF
8959 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8960   egrep "yes" >/dev/null 2>&1; then
8961   rm -rf conftest*
8962   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
8963 fi
8964 rm -f conftest*
8965
8966   fi
8967   
8968 fi
8969
8970 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
8971   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
8972     cat >> confdefs.h <<\EOF
8973 #define GWINSZ_IN_SYS_IOCTL 1
8974 EOF
8975
8976   fi
8977
8978 if test $am_cv_sys_posix_termios = yes ; then
8979         cat >> confdefs.h <<\EOF
8980 #define HAVE_POSIX_TERMIOS 1
8981 EOF
8982
8983 fi
8984
8985 for ac_hdr in \
8986         arpa/inet.h             \
8987         arpa/nameser.h  \
8988         assert.h                \
8989         conio.h                 \
8990         crypt.h                 \
8991         direct.h                \
8992         errno.h                 \
8993         fcntl.h                 \
8994         filio.h                 \
8995         getopt.h                \
8996         grp.h                   \
8997         io.h                    \
8998         libutil.h               \
8999         limits.h                \
9000         locale.h                \
9001         netinet/tcp.h   \
9002         malloc.h                \
9003         memory.h                \
9004         psap.h                  \
9005         pwd.h                   \
9006         process.h               \
9007         resolv.h                \
9008         sgtty.h                 \
9009         shadow.h                \
9010         stddef.h                \
9011         string.h                \
9012         strings.h               \
9013         sysexits.h              \
9014         sys/file.h              \
9015         sys/filio.h             \
9016         sys/errno.h             \
9017         sys/ioctl.h             \
9018         sys/param.h             \
9019         sys/resource.h  \
9020         sys/select.h    \
9021         sys/socket.h    \
9022         sys/syslog.h    \
9023         sys/time.h              \
9024         sys/types.h             \
9025         sys/ucred.h             \
9026         syslog.h                \
9027         termios.h               \
9028         unistd.h                \
9029         winsock.h               \
9030         winsock2.h              \
9031
9032 do
9033 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9034 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9035 echo "configure:9036: checking for $ac_hdr" >&5
9036 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9037   echo $ac_n "(cached) $ac_c" 1>&6
9038 else
9039   cat > conftest.$ac_ext <<EOF
9040 #line 9041 "configure"
9041 #include "confdefs.h"
9042 #include <$ac_hdr>
9043 EOF
9044 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9045 { (eval echo configure:9046: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9046 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9047 if test -z "$ac_err"; then
9048   rm -rf conftest*
9049   eval "ac_cv_header_$ac_safe=yes"
9050 else
9051   echo "$ac_err" >&5
9052   echo "configure: failed program was:" >&5
9053   cat conftest.$ac_ext >&5
9054   rm -rf conftest*
9055   eval "ac_cv_header_$ac_safe=no"
9056 fi
9057 rm -f conftest*
9058 fi
9059 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9060   echo "$ac_t""yes" 1>&6
9061     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9062   cat >> confdefs.h <<EOF
9063 #define $ac_tr_hdr 1
9064 EOF
9065  
9066 else
9067   echo "$ac_t""no" 1>&6
9068 fi
9069 done
9070
9071
9072
9073
9074 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
9075 echo "configure:9076: checking for dlopen" >&5
9076 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
9077   echo $ac_n "(cached) $ac_c" 1>&6
9078 else
9079   cat > conftest.$ac_ext <<EOF
9080 #line 9081 "configure"
9081 #include "confdefs.h"
9082 /* System header to define __stub macros and hopefully few prototypes,
9083     which can conflict with char dlopen(); below.  */
9084 #include <assert.h>
9085 /* Override any gcc2 internal prototype to avoid an error.  */
9086 /* We use char because int might match the return type of a gcc2
9087     builtin and then its argument prototype would still apply.  */
9088 char dlopen();
9089 char (*f)();
9090
9091 int main() {
9092
9093 /* The GNU C library defines this for functions which it implements
9094     to always fail with ENOSYS.  Some functions are actually named
9095     something starting with __ and the normal name is an alias.  */
9096 #if defined (__stub_dlopen) || defined (__stub___dlopen)
9097 choke me
9098 #else
9099 f = dlopen;
9100 #endif
9101
9102 ; return 0; }
9103 EOF
9104 if { (eval echo configure:9105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9105   rm -rf conftest*
9106   eval "ac_cv_func_dlopen=yes"
9107 else
9108   echo "configure: failed program was:" >&5
9109   cat conftest.$ac_ext >&5
9110   rm -rf conftest*
9111   eval "ac_cv_func_dlopen=no"
9112 fi
9113 rm -f conftest*
9114 fi
9115
9116 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
9117   echo "$ac_t""yes" 1>&6
9118   :
9119 else
9120   echo "$ac_t""no" 1>&6
9121 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
9122 echo "configure:9123: checking for dlopen in -ldl" >&5
9123 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
9124 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9125   echo $ac_n "(cached) $ac_c" 1>&6
9126 else
9127   ac_save_LIBS="$LIBS"
9128 LIBS="-ldl  $LIBS"
9129 cat > conftest.$ac_ext <<EOF
9130 #line 9131 "configure"
9131 #include "confdefs.h"
9132 /* Override any gcc2 internal prototype to avoid an error.  */
9133 /* We use char because int might match the return type of a gcc2
9134     builtin and then its argument prototype would still apply.  */
9135 char dlopen();
9136
9137 int main() {
9138 dlopen()
9139 ; return 0; }
9140 EOF
9141 if { (eval echo configure:9142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9142   rm -rf conftest*
9143   eval "ac_cv_lib_$ac_lib_var=yes"
9144 else
9145   echo "configure: failed program was:" >&5
9146   cat conftest.$ac_ext >&5
9147   rm -rf conftest*
9148   eval "ac_cv_lib_$ac_lib_var=no"
9149 fi
9150 rm -f conftest*
9151 LIBS="$ac_save_LIBS"
9152
9153 fi
9154 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9155   echo "$ac_t""yes" 1>&6
9156     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9157     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9158   cat >> confdefs.h <<EOF
9159 #define $ac_tr_lib 1
9160 EOF
9161
9162   LIBS="-ldl $LIBS"
9163
9164 else
9165   echo "$ac_t""no" 1>&6
9166 fi
9167
9168 fi
9169
9170
9171 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
9172 echo "configure:9173: checking for sigset in -lV3" >&5
9173 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
9174 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9175   echo $ac_n "(cached) $ac_c" 1>&6
9176 else
9177   ac_save_LIBS="$LIBS"
9178 LIBS="-lV3  $LIBS"
9179 cat > conftest.$ac_ext <<EOF
9180 #line 9181 "configure"
9181 #include "confdefs.h"
9182 /* Override any gcc2 internal prototype to avoid an error.  */
9183 /* We use char because int might match the return type of a gcc2
9184     builtin and then its argument prototype would still apply.  */
9185 char sigset();
9186
9187 int main() {
9188 sigset()
9189 ; return 0; }
9190 EOF
9191 if { (eval echo configure:9192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9192   rm -rf conftest*
9193   eval "ac_cv_lib_$ac_lib_var=yes"
9194 else
9195   echo "configure: failed program was:" >&5
9196   cat conftest.$ac_ext >&5
9197   rm -rf conftest*
9198   eval "ac_cv_lib_$ac_lib_var=no"
9199 fi
9200 rm -f conftest*
9201 LIBS="$ac_save_LIBS"
9202
9203 fi
9204 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9205   echo "$ac_t""yes" 1>&6
9206     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9207     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9208   cat >> confdefs.h <<EOF
9209 #define $ac_tr_lib 1
9210 EOF
9211
9212   LIBS="-lV3 $LIBS"
9213
9214 else
9215   echo "$ac_t""no" 1>&6
9216 fi
9217
9218
9219 echo $ac_n "checking for winsock""... $ac_c" 1>&6
9220 echo "configure:9221: checking for winsock" >&5
9221 save_LIBS="$LIBS"
9222 for curlib in ws2_32 wsock32; do
9223         LIBS="$LIBS -l$curlib"
9224         cat > conftest.$ac_ext <<EOF
9225 #line 9226 "configure"
9226 #include "confdefs.h"
9227
9228                         char socket@12();
9229                         char select@20();
9230                         char closesocket@4();
9231                         char gethostname@8();
9232                         
9233 int main() {
9234
9235                         socket@12();
9236                         select@20();
9237                         closesocket@4();
9238                         gethostname@8();
9239                         
9240 ; return 0; }
9241 EOF
9242 if { (eval echo configure:9243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9243   rm -rf conftest*
9244   have_winsock=yes
9245 else
9246   echo "configure: failed program was:" >&5
9247   cat conftest.$ac_ext >&5
9248   rm -rf conftest*
9249   have_winsock=no
9250 fi
9251 rm -f conftest*
9252
9253         if test $have_winsock = yes; then
9254                 cat >> confdefs.h <<\EOF
9255 #define HAVE_WINSOCK 1
9256 EOF
9257
9258                 ac_cv_func_socket=yes
9259                 ac_cv_func_select=yes
9260                 ac_cv_func_closesocket=yes
9261                 ac_cv_func_gethostname=yes
9262                 if test $curlib = ws2_32; then
9263                         have_winsock=winsock2
9264                         cat >> confdefs.h <<\EOF
9265 #define HAVE_WINSOCK2 1
9266 EOF
9267
9268                 fi
9269                 break
9270         fi
9271         LIBS="$save_LIBS"
9272 done
9273 echo "$ac_t""$have_winsock" 1>&6
9274
9275
9276 echo $ac_n "checking for socket""... $ac_c" 1>&6
9277 echo "configure:9278: checking for socket" >&5
9278 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
9279   echo $ac_n "(cached) $ac_c" 1>&6
9280 else
9281   cat > conftest.$ac_ext <<EOF
9282 #line 9283 "configure"
9283 #include "confdefs.h"
9284 /* System header to define __stub macros and hopefully few prototypes,
9285     which can conflict with char socket(); below.  */
9286 #include <assert.h>
9287 /* Override any gcc2 internal prototype to avoid an error.  */
9288 /* We use char because int might match the return type of a gcc2
9289     builtin and then its argument prototype would still apply.  */
9290 char socket();
9291 char (*f)();
9292
9293 int main() {
9294
9295 /* The GNU C library defines this for functions which it implements
9296     to always fail with ENOSYS.  Some functions are actually named
9297     something starting with __ and the normal name is an alias.  */
9298 #if defined (__stub_socket) || defined (__stub___socket)
9299 choke me
9300 #else
9301 f = socket;
9302 #endif
9303
9304 ; return 0; }
9305 EOF
9306 if { (eval echo configure:9307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9307   rm -rf conftest*
9308   eval "ac_cv_func_socket=yes"
9309 else
9310   echo "configure: failed program was:" >&5
9311   cat conftest.$ac_ext >&5
9312   rm -rf conftest*
9313   eval "ac_cv_func_socket=no"
9314 fi
9315 rm -f conftest*
9316 fi
9317
9318 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
9319   echo "$ac_t""yes" 1>&6
9320   :
9321 else
9322   echo "$ac_t""no" 1>&6
9323         
9324         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
9325 echo "configure:9326: checking for main in -lsocket" >&5
9326 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
9327 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9328   echo $ac_n "(cached) $ac_c" 1>&6
9329 else
9330   ac_save_LIBS="$LIBS"
9331 LIBS="-lsocket  $LIBS"
9332 cat > conftest.$ac_ext <<EOF
9333 #line 9334 "configure"
9334 #include "confdefs.h"
9335
9336 int main() {
9337 main()
9338 ; return 0; }
9339 EOF
9340 if { (eval echo configure:9341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9341   rm -rf conftest*
9342   eval "ac_cv_lib_$ac_lib_var=yes"
9343 else
9344   echo "configure: failed program was:" >&5
9345   cat conftest.$ac_ext >&5
9346   rm -rf conftest*
9347   eval "ac_cv_lib_$ac_lib_var=no"
9348 fi
9349 rm -f conftest*
9350 LIBS="$ac_save_LIBS"
9351
9352 fi
9353 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9354   echo "$ac_t""yes" 1>&6
9355     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9356     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9357   cat >> confdefs.h <<EOF
9358 #define $ac_tr_lib 1
9359 EOF
9360
9361   LIBS="-lsocket $LIBS"
9362
9363 else
9364   echo "$ac_t""no" 1>&6
9365 fi
9366
9367         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
9368 echo "configure:9369: checking for main in -lnet" >&5
9369 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
9370 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9371   echo $ac_n "(cached) $ac_c" 1>&6
9372 else
9373   ac_save_LIBS="$LIBS"
9374 LIBS="-lnet  $LIBS"
9375 cat > conftest.$ac_ext <<EOF
9376 #line 9377 "configure"
9377 #include "confdefs.h"
9378
9379 int main() {
9380 main()
9381 ; return 0; }
9382 EOF
9383 if { (eval echo configure:9384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9384   rm -rf conftest*
9385   eval "ac_cv_lib_$ac_lib_var=yes"
9386 else
9387   echo "configure: failed program was:" >&5
9388   cat conftest.$ac_ext >&5
9389   rm -rf conftest*
9390   eval "ac_cv_lib_$ac_lib_var=no"
9391 fi
9392 rm -f conftest*
9393 LIBS="$ac_save_LIBS"
9394
9395 fi
9396 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9397   echo "$ac_t""yes" 1>&6
9398     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9399     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9400   cat >> confdefs.h <<EOF
9401 #define $ac_tr_lib 1
9402 EOF
9403
9404   LIBS="-lnet $LIBS"
9405
9406 else
9407   echo "$ac_t""no" 1>&6
9408 fi
9409
9410         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
9411 echo "configure:9412: checking for main in -lnsl_s" >&5
9412 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
9413 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9414   echo $ac_n "(cached) $ac_c" 1>&6
9415 else
9416   ac_save_LIBS="$LIBS"
9417 LIBS="-lnsl_s  $LIBS"
9418 cat > conftest.$ac_ext <<EOF
9419 #line 9420 "configure"
9420 #include "confdefs.h"
9421
9422 int main() {
9423 main()
9424 ; return 0; }
9425 EOF
9426 if { (eval echo configure:9427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9427   rm -rf conftest*
9428   eval "ac_cv_lib_$ac_lib_var=yes"
9429 else
9430   echo "configure: failed program was:" >&5
9431   cat conftest.$ac_ext >&5
9432   rm -rf conftest*
9433   eval "ac_cv_lib_$ac_lib_var=no"
9434 fi
9435 rm -f conftest*
9436 LIBS="$ac_save_LIBS"
9437
9438 fi
9439 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9440   echo "$ac_t""yes" 1>&6
9441     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9442     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9443   cat >> confdefs.h <<EOF
9444 #define $ac_tr_lib 1
9445 EOF
9446
9447   LIBS="-lnsl_s $LIBS"
9448
9449 else
9450   echo "$ac_t""no" 1>&6
9451 fi
9452
9453         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
9454 echo "configure:9455: checking for main in -lnsl" >&5
9455 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
9456 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9457   echo $ac_n "(cached) $ac_c" 1>&6
9458 else
9459   ac_save_LIBS="$LIBS"
9460 LIBS="-lnsl  $LIBS"
9461 cat > conftest.$ac_ext <<EOF
9462 #line 9463 "configure"
9463 #include "confdefs.h"
9464
9465 int main() {
9466 main()
9467 ; return 0; }
9468 EOF
9469 if { (eval echo configure:9470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9470   rm -rf conftest*
9471   eval "ac_cv_lib_$ac_lib_var=yes"
9472 else
9473   echo "configure: failed program was:" >&5
9474   cat conftest.$ac_ext >&5
9475   rm -rf conftest*
9476   eval "ac_cv_lib_$ac_lib_var=no"
9477 fi
9478 rm -f conftest*
9479 LIBS="$ac_save_LIBS"
9480
9481 fi
9482 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9483   echo "$ac_t""yes" 1>&6
9484     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9485     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9486   cat >> confdefs.h <<EOF
9487 #define $ac_tr_lib 1
9488 EOF
9489
9490   LIBS="-lnsl $LIBS"
9491
9492 else
9493   echo "$ac_t""no" 1>&6
9494 fi
9495
9496         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
9497 echo "configure:9498: checking for socket in -linet" >&5
9498 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
9499 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9500   echo $ac_n "(cached) $ac_c" 1>&6
9501 else
9502   ac_save_LIBS="$LIBS"
9503 LIBS="-linet  $LIBS"
9504 cat > conftest.$ac_ext <<EOF
9505 #line 9506 "configure"
9506 #include "confdefs.h"
9507 /* Override any gcc2 internal prototype to avoid an error.  */
9508 /* We use char because int might match the return type of a gcc2
9509     builtin and then its argument prototype would still apply.  */
9510 char socket();
9511
9512 int main() {
9513 socket()
9514 ; return 0; }
9515 EOF
9516 if { (eval echo configure:9517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9517   rm -rf conftest*
9518   eval "ac_cv_lib_$ac_lib_var=yes"
9519 else
9520   echo "configure: failed program was:" >&5
9521   cat conftest.$ac_ext >&5
9522   rm -rf conftest*
9523   eval "ac_cv_lib_$ac_lib_var=no"
9524 fi
9525 rm -f conftest*
9526 LIBS="$ac_save_LIBS"
9527
9528 fi
9529 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9530   echo "$ac_t""yes" 1>&6
9531     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9532     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9533   cat >> confdefs.h <<EOF
9534 #define $ac_tr_lib 1
9535 EOF
9536
9537   LIBS="-linet $LIBS"
9538
9539 else
9540   echo "$ac_t""no" 1>&6
9541 fi
9542
9543         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
9544 echo "configure:9545: checking for main in -lgen" >&5
9545 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
9546 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9547   echo $ac_n "(cached) $ac_c" 1>&6
9548 else
9549   ac_save_LIBS="$LIBS"
9550 LIBS="-lgen  $LIBS"
9551 cat > conftest.$ac_ext <<EOF
9552 #line 9553 "configure"
9553 #include "confdefs.h"
9554
9555 int main() {
9556 main()
9557 ; return 0; }
9558 EOF
9559 if { (eval echo configure:9560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9560   rm -rf conftest*
9561   eval "ac_cv_lib_$ac_lib_var=yes"
9562 else
9563   echo "configure: failed program was:" >&5
9564   cat conftest.$ac_ext >&5
9565   rm -rf conftest*
9566   eval "ac_cv_lib_$ac_lib_var=no"
9567 fi
9568 rm -f conftest*
9569 LIBS="$ac_save_LIBS"
9570
9571 fi
9572 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9573   echo "$ac_t""yes" 1>&6
9574     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9575     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9576   cat >> confdefs.h <<EOF
9577 #define $ac_tr_lib 1
9578 EOF
9579
9580   LIBS="-lgen $LIBS"
9581
9582 else
9583   echo "$ac_t""no" 1>&6
9584 fi
9585
9586
9587 fi
9588
9589
9590 echo $ac_n "checking for select""... $ac_c" 1>&6
9591 echo "configure:9592: checking for select" >&5
9592 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
9593   echo $ac_n "(cached) $ac_c" 1>&6
9594 else
9595   cat > conftest.$ac_ext <<EOF
9596 #line 9597 "configure"
9597 #include "confdefs.h"
9598 /* System header to define __stub macros and hopefully few prototypes,
9599     which can conflict with char select(); below.  */
9600 #include <assert.h>
9601 /* Override any gcc2 internal prototype to avoid an error.  */
9602 /* We use char because int might match the return type of a gcc2
9603     builtin and then its argument prototype would still apply.  */
9604 char select();
9605 char (*f)();
9606
9607 int main() {
9608
9609 /* The GNU C library defines this for functions which it implements
9610     to always fail with ENOSYS.  Some functions are actually named
9611     something starting with __ and the normal name is an alias.  */
9612 #if defined (__stub_select) || defined (__stub___select)
9613 choke me
9614 #else
9615 f = select;
9616 #endif
9617
9618 ; return 0; }
9619 EOF
9620 if { (eval echo configure:9621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9621   rm -rf conftest*
9622   eval "ac_cv_func_select=yes"
9623 else
9624   echo "configure: failed program was:" >&5
9625   cat conftest.$ac_ext >&5
9626   rm -rf conftest*
9627   eval "ac_cv_func_select=no"
9628 fi
9629 rm -f conftest*
9630 fi
9631
9632 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
9633   echo "$ac_t""yes" 1>&6
9634   :
9635 else
9636   echo "$ac_t""no" 1>&6
9637 { echo "configure: error: select() required." 1>&2; exit 1; }
9638 fi
9639
9640
9641 if test "${ac_cv_header_winsock_h}" != yes; then
9642                                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
9643 echo "configure:9644: checking types of arguments for select()" >&5
9644  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
9645   echo $ac_n "(cached) $ac_c" 1>&6
9646 else
9647    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
9648   echo $ac_n "(cached) $ac_c" 1>&6
9649 else
9650     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
9651   echo $ac_n "(cached) $ac_c" 1>&6
9652 else
9653      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
9654      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
9655       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
9656        cat > conftest.$ac_ext <<EOF
9657 #line 9658 "configure"
9658 #include "confdefs.h"
9659 #ifdef HAVE_SYS_TYPES_H
9660 #include <sys/types.h>
9661 #endif
9662 #ifdef HAVE_SYS_TIME_H
9663 #include <sys/time.h>
9664 #endif
9665 #ifdef HAVE_SYS_SELECT_H
9666 #include <sys/select.h>
9667 #endif
9668 #ifdef HAVE_SYS_SOCKET_H
9669 #include <sys/socket.h>
9670 #endif
9671 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);
9672 int main() {
9673
9674 ; return 0; }
9675 EOF
9676 if { (eval echo configure:9677: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9677   rm -rf conftest*
9678           ac_not_found=no ; break 3
9679 else
9680   echo "configure: failed program was:" >&5
9681   cat conftest.$ac_ext >&5
9682   rm -rf conftest*
9683   ac_not_found=yes
9684 fi
9685 rm -f conftest*
9686       done
9687      done
9688     done
9689    
9690 fi
9691   
9692 fi
9693  
9694 fi
9695  if test "$ac_not_found" = yes; then
9696   ac_cv_func_select_arg1=int 
9697   ac_cv_func_select_arg234='int *' 
9698   ac_cv_func_select_arg5='struct timeval *'
9699  fi
9700  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
9701  cat >> confdefs.h <<EOF
9702 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
9703 EOF
9704
9705  cat >> confdefs.h <<EOF
9706 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
9707 EOF
9708
9709  cat >> confdefs.h <<EOF
9710 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
9711 EOF
9712
9713
9714 fi
9715
9716
9717 for ac_hdr in regex.h 
9718 do
9719 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9720 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9721 echo "configure:9722: checking for $ac_hdr" >&5
9722 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9723   echo $ac_n "(cached) $ac_c" 1>&6
9724 else
9725   cat > conftest.$ac_ext <<EOF
9726 #line 9727 "configure"
9727 #include "confdefs.h"
9728 #include <$ac_hdr>
9729 EOF
9730 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9731 { (eval echo configure:9732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9732 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9733 if test -z "$ac_err"; then
9734   rm -rf conftest*
9735   eval "ac_cv_header_$ac_safe=yes"
9736 else
9737   echo "$ac_err" >&5
9738   echo "configure: failed program was:" >&5
9739   cat conftest.$ac_ext >&5
9740   rm -rf conftest*
9741   eval "ac_cv_header_$ac_safe=no"
9742 fi
9743 rm -f conftest*
9744 fi
9745 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9746   echo "$ac_t""yes" 1>&6
9747     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9748   cat >> confdefs.h <<EOF
9749 #define $ac_tr_hdr 1
9750 EOF
9751  
9752 else
9753   echo "$ac_t""no" 1>&6
9754 fi
9755 done
9756
9757 if test "$ac_cv_header_regex_h" != yes ; then
9758         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
9759 fi
9760
9761 echo $ac_n "checking for library containing regfree""... $ac_c" 1>&6
9762 echo "configure:9763: checking for library containing regfree" >&5
9763 if eval "test \"\${ac_cv_search_regfree+set}\" = set"; then
9764   echo $ac_n "(cached) $ac_c" 1>&6
9765 else
9766   ac_func_search_save_LIBS="$LIBS"
9767 ac_cv_search_regfree="no"
9768 cat > conftest.$ac_ext <<EOF
9769 #line 9770 "configure"
9770 #include "confdefs.h"
9771 /* Override any gcc2 internal prototype to avoid an error.  */
9772 /* We use char because int might match the return type of a gcc2
9773     builtin and then its argument prototype would still apply.  */
9774 char regfree();
9775
9776 int main() {
9777 regfree()
9778 ; return 0; }
9779 EOF
9780 if { (eval echo configure:9781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9781   rm -rf conftest*
9782   ac_cv_search_regfree="none required"
9783 else
9784   echo "configure: failed program was:" >&5
9785   cat conftest.$ac_ext >&5
9786 fi
9787 rm -f conftest*
9788 test "$ac_cv_search_regfree" = "no" && for ac_lib in regex gnuregex; do
9789 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9790 cat > conftest.$ac_ext <<EOF
9791 #line 9792 "configure"
9792 #include "confdefs.h"
9793 /* Override any gcc2 internal prototype to avoid an error.  */
9794 /* We use char because int might match the return type of a gcc2
9795     builtin and then its argument prototype would still apply.  */
9796 char regfree();
9797
9798 int main() {
9799 regfree()
9800 ; return 0; }
9801 EOF
9802 if { (eval echo configure:9803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9803   rm -rf conftest*
9804   ac_cv_search_regfree="-l$ac_lib"
9805 break
9806 else
9807   echo "configure: failed program was:" >&5
9808   cat conftest.$ac_ext >&5
9809 fi
9810 rm -f conftest*
9811 done
9812 LIBS="$ac_func_search_save_LIBS"
9813 fi
9814
9815 echo "$ac_t""$ac_cv_search_regfree" 1>&6
9816 if test "$ac_cv_search_regfree" != "no"; then
9817   test "$ac_cv_search_regfree" = "none required" || LIBS="$ac_cv_search_regfree $LIBS"
9818   :
9819 else :
9820   { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
9821 fi
9822
9823
9824 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
9825 echo "configure:9826: checking for compatible POSIX regex" >&5
9826 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
9827   echo $ac_n "(cached) $ac_c" 1>&6
9828 else
9829   
9830         if test "$cross_compiling" = yes; then
9831   ol_cv_c_posix_regex=cross
9832 else
9833   cat > conftest.$ac_ext <<EOF
9834 #line 9835 "configure"
9835 #include "confdefs.h"
9836
9837 #include <sys/types.h>
9838 #include <regex.h>
9839 static char *pattern, *string;
9840 main()
9841 {
9842         int rc;
9843         regex_t re;
9844
9845         pattern = "^A";
9846
9847         if(regcomp(&re, pattern, 0)) {
9848                 return -1;
9849         }
9850         
9851         string = "ALL MATCH";
9852         
9853         rc = regexec(&re, string, 0, (void*)0, 0);
9854
9855         regfree(&re);
9856
9857         return rc;
9858 }
9859 EOF
9860 if { (eval echo configure:9861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9861 then
9862   ol_cv_c_posix_regex=yes
9863 else
9864   echo "configure: failed program was:" >&5
9865   cat conftest.$ac_ext >&5
9866   rm -fr conftest*
9867   ol_cv_c_posix_regex=no
9868 fi
9869 rm -fr conftest*
9870 fi
9871
9872 fi
9873
9874 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
9875
9876 if test "$ol_cv_c_posix_regex" = no ; then
9877         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
9878 fi
9879
9880
9881 have_uuid=no
9882 for ac_hdr in sys/uuid.h
9883 do
9884 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9885 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9886 echo "configure:9887: checking for $ac_hdr" >&5
9887 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9888   echo $ac_n "(cached) $ac_c" 1>&6
9889 else
9890   cat > conftest.$ac_ext <<EOF
9891 #line 9892 "configure"
9892 #include "confdefs.h"
9893 #include <$ac_hdr>
9894 EOF
9895 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9896 { (eval echo configure:9897: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9897 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9898 if test -z "$ac_err"; then
9899   rm -rf conftest*
9900   eval "ac_cv_header_$ac_safe=yes"
9901 else
9902   echo "$ac_err" >&5
9903   echo "configure: failed program was:" >&5
9904   cat conftest.$ac_ext >&5
9905   rm -rf conftest*
9906   eval "ac_cv_header_$ac_safe=no"
9907 fi
9908 rm -f conftest*
9909 fi
9910 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9911   echo "$ac_t""yes" 1>&6
9912     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9913   cat >> confdefs.h <<EOF
9914 #define $ac_tr_hdr 1
9915 EOF
9916  
9917 else
9918   echo "$ac_t""no" 1>&6
9919 fi
9920 done
9921
9922 if test $ac_cv_header_sys_uuid_h = yes ; then
9923         save_LIBS="$LIBS"
9924         
9925 echo $ac_n "checking for library containing uuid_to_str""... $ac_c" 1>&6
9926 echo "configure:9927: checking for library containing uuid_to_str" >&5
9927 if eval "test \"\${ac_cv_search_uuid_to_str+set}\" = set"; then
9928   echo $ac_n "(cached) $ac_c" 1>&6
9929 else
9930   ac_func_search_save_LIBS="$LIBS"
9931 ac_cv_search_uuid_to_str="no"
9932 cat > conftest.$ac_ext <<EOF
9933 #line 9934 "configure"
9934 #include "confdefs.h"
9935 /* Override any gcc2 internal prototype to avoid an error.  */
9936 /* We use char because int might match the return type of a gcc2
9937     builtin and then its argument prototype would still apply.  */
9938 char uuid_to_str();
9939
9940 int main() {
9941 uuid_to_str()
9942 ; return 0; }
9943 EOF
9944 if { (eval echo configure:9945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9945   rm -rf conftest*
9946   ac_cv_search_uuid_to_str="none required"
9947 else
9948   echo "configure: failed program was:" >&5
9949   cat conftest.$ac_ext >&5
9950 fi
9951 rm -f conftest*
9952 test "$ac_cv_search_uuid_to_str" = "no" && for ac_lib in uuid; do
9953 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9954 cat > conftest.$ac_ext <<EOF
9955 #line 9956 "configure"
9956 #include "confdefs.h"
9957 /* Override any gcc2 internal prototype to avoid an error.  */
9958 /* We use char because int might match the return type of a gcc2
9959     builtin and then its argument prototype would still apply.  */
9960 char uuid_to_str();
9961
9962 int main() {
9963 uuid_to_str()
9964 ; return 0; }
9965 EOF
9966 if { (eval echo configure:9967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9967   rm -rf conftest*
9968   ac_cv_search_uuid_to_str="-l$ac_lib"
9969 break
9970 else
9971   echo "configure: failed program was:" >&5
9972   cat conftest.$ac_ext >&5
9973 fi
9974 rm -f conftest*
9975 done
9976 LIBS="$ac_func_search_save_LIBS"
9977 fi
9978
9979 echo "$ac_t""$ac_cv_search_uuid_to_str" 1>&6
9980 if test "$ac_cv_search_uuid_to_str" != "no"; then
9981   test "$ac_cv_search_uuid_to_str" = "none required" || LIBS="$ac_cv_search_uuid_to_str $LIBS"
9982   have_uuid=yes
9983 else :
9984   :
9985 fi
9986         LIBS="$save_LIBS"
9987
9988         if test have_uuid = yes ; then
9989                 cat >> confdefs.h <<\EOF
9990 #define HAVE_UUID_TO_STR 1
9991 EOF
9992
9993
9994                 test "$ac_cv_search_uuid_to_str" = "none required" || \
9995                         SLAPD_LIBS="$SLAPD_LIBS $ac_cv_search_uuid_to_str"
9996         fi
9997 fi
9998
9999 if test $have_uuid = no ; then
10000         echo $ac_n "checking to see if -lrpcrt4 is needed for win32 UUID support""... $ac_c" 1>&6
10001 echo "configure:10002: checking to see if -lrpcrt4 is needed for win32 UUID support" >&5
10002         save_LIBS="$LIBS"
10003         LIBS="$LIBS -lrpcrt4"
10004         cat > conftest.$ac_ext <<EOF
10005 #line 10006 "configure"
10006 #include "confdefs.h"
10007
10008                 char UuidCreate@4();
10009                 char UuidToStringA@8();
10010                 
10011 int main() {
10012
10013                 UuidCreate@4();
10014                 UuidToStringA@8();
10015                 
10016 ; return 0; }
10017 EOF
10018 if { (eval echo configure:10019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10019   rm -rf conftest*
10020   need_rpcrt=yes
10021 else
10022   echo "configure: failed program was:" >&5
10023   cat conftest.$ac_ext >&5
10024   rm -rf conftest*
10025   need_rpcrt=no
10026 fi
10027 rm -f conftest*
10028         if test $need_rpcrt = yes; then
10029                 SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
10030         fi
10031         LIBS="$save_LIBS"
10032         echo "$ac_t""$need_rpcrt" 1>&6
10033 fi
10034
10035 ol_link_dnssrv=no
10036 echo $ac_n "checking for res_query""... $ac_c" 1>&6
10037 echo "configure:10038: checking for res_query" >&5
10038 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
10039   echo $ac_n "(cached) $ac_c" 1>&6
10040 else
10041   cat > conftest.$ac_ext <<EOF
10042 #line 10043 "configure"
10043 #include "confdefs.h"
10044 /* System header to define __stub macros and hopefully few prototypes,
10045     which can conflict with char res_query(); below.  */
10046 #include <assert.h>
10047 /* Override any gcc2 internal prototype to avoid an error.  */
10048 /* We use char because int might match the return type of a gcc2
10049     builtin and then its argument prototype would still apply.  */
10050 char res_query();
10051 char (*f)();
10052
10053 int main() {
10054
10055 /* The GNU C library defines this for functions which it implements
10056     to always fail with ENOSYS.  Some functions are actually named
10057     something starting with __ and the normal name is an alias.  */
10058 #if defined (__stub_res_query) || defined (__stub___res_query)
10059 choke me
10060 #else
10061 f = res_query;
10062 #endif
10063
10064 ; return 0; }
10065 EOF
10066 if { (eval echo configure:10067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10067   rm -rf conftest*
10068   eval "ac_cv_func_res_query=yes"
10069 else
10070   echo "configure: failed program was:" >&5
10071   cat conftest.$ac_ext >&5
10072   rm -rf conftest*
10073   eval "ac_cv_func_res_query=no"
10074 fi
10075 rm -f conftest*
10076 fi
10077
10078 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
10079   echo "$ac_t""yes" 1>&6
10080   :
10081 else
10082   echo "$ac_t""no" 1>&6
10083 fi
10084
10085 if test $ac_cv_func_res_query = no ; then 
10086         echo $ac_n "checking for __res_query""... $ac_c" 1>&6
10087 echo "configure:10088: checking for __res_query" >&5
10088 if eval "test \"\${ac_cv_func___res_query+set}\" = set"; then
10089   echo $ac_n "(cached) $ac_c" 1>&6
10090 else
10091   cat > conftest.$ac_ext <<EOF
10092 #line 10093 "configure"
10093 #include "confdefs.h"
10094 /* System header to define __stub macros and hopefully few prototypes,
10095     which can conflict with char __res_query(); below.  */
10096 #include <assert.h>
10097 /* Override any gcc2 internal prototype to avoid an error.  */
10098 /* We use char because int might match the return type of a gcc2
10099     builtin and then its argument prototype would still apply.  */
10100 char __res_query();
10101 char (*f)();
10102
10103 int main() {
10104
10105 /* The GNU C library defines this for functions which it implements
10106     to always fail with ENOSYS.  Some functions are actually named
10107     something starting with __ and the normal name is an alias.  */
10108 #if defined (__stub___res_query) || defined (__stub_____res_query)
10109 choke me
10110 #else
10111 f = __res_query;
10112 #endif
10113
10114 ; return 0; }
10115 EOF
10116 if { (eval echo configure:10117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10117   rm -rf conftest*
10118   eval "ac_cv_func___res_query=yes"
10119 else
10120   echo "configure: failed program was:" >&5
10121   cat conftest.$ac_ext >&5
10122   rm -rf conftest*
10123   eval "ac_cv_func___res_query=no"
10124 fi
10125 rm -f conftest*
10126 fi
10127
10128 if eval "test \"`echo '$ac_cv_func_'__res_query`\" = yes"; then
10129   echo "$ac_t""yes" 1>&6
10130   :
10131 else
10132   echo "$ac_t""no" 1>&6
10133 fi
10134
10135         ac_cv_func_res_query=$ac_cv_func___res_query
10136 fi
10137
10138 if test $ac_cv_func_res_query = no ; then 
10139         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
10140 echo "configure:10141: checking for res_query in -lbind" >&5
10141 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
10142 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10143   echo $ac_n "(cached) $ac_c" 1>&6
10144 else
10145   ac_save_LIBS="$LIBS"
10146 LIBS="-lbind  $LIBS"
10147 cat > conftest.$ac_ext <<EOF
10148 #line 10149 "configure"
10149 #include "confdefs.h"
10150 /* Override any gcc2 internal prototype to avoid an error.  */
10151 /* We use char because int might match the return type of a gcc2
10152     builtin and then its argument prototype would still apply.  */
10153 char res_query();
10154
10155 int main() {
10156 res_query()
10157 ; return 0; }
10158 EOF
10159 if { (eval echo configure:10160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10160   rm -rf conftest*
10161   eval "ac_cv_lib_$ac_lib_var=yes"
10162 else
10163   echo "configure: failed program was:" >&5
10164   cat conftest.$ac_ext >&5
10165   rm -rf conftest*
10166   eval "ac_cv_lib_$ac_lib_var=no"
10167 fi
10168 rm -f conftest*
10169 LIBS="$ac_save_LIBS"
10170
10171 fi
10172 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10173   echo "$ac_t""yes" 1>&6
10174     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10175     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10176   cat >> confdefs.h <<EOF
10177 #define $ac_tr_lib 1
10178 EOF
10179
10180   LIBS="-lbind $LIBS"
10181
10182 else
10183   echo "$ac_t""no" 1>&6
10184 fi
10185
10186         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
10187 fi
10188
10189 if test $ac_cv_func_res_query = no ; then 
10190         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
10191 echo "configure:10192: checking for __res_query in -lbind" >&5
10192 ac_lib_var=`echo bind'_'__res_query | 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="-lbind  $LIBS"
10198 cat > conftest.$ac_ext <<EOF
10199 #line 10200 "configure"
10200 #include "confdefs.h"
10201 /* Override any gcc2 internal prototype to avoid an error.  */
10202 /* We use char because int might match the return type of a gcc2
10203     builtin and then its argument prototype would still apply.  */
10204 char __res_query();
10205
10206 int main() {
10207 __res_query()
10208 ; return 0; }
10209 EOF
10210 if { (eval echo configure:10211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10211   rm -rf conftest*
10212   eval "ac_cv_lib_$ac_lib_var=yes"
10213 else
10214   echo "configure: failed program was:" >&5
10215   cat conftest.$ac_ext >&5
10216   rm -rf conftest*
10217   eval "ac_cv_lib_$ac_lib_var=no"
10218 fi
10219 rm -f conftest*
10220 LIBS="$ac_save_LIBS"
10221
10222 fi
10223 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10224   echo "$ac_t""yes" 1>&6
10225     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10226     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10227   cat >> confdefs.h <<EOF
10228 #define $ac_tr_lib 1
10229 EOF
10230
10231   LIBS="-lbind $LIBS"
10232
10233 else
10234   echo "$ac_t""no" 1>&6
10235 fi
10236
10237         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
10238 fi
10239
10240 if test $ac_cv_func_res_query = no ; then 
10241         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
10242 echo "configure:10243: checking for res_query in -lresolv" >&5
10243 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
10244 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10245   echo $ac_n "(cached) $ac_c" 1>&6
10246 else
10247   ac_save_LIBS="$LIBS"
10248 LIBS="-lresolv  $LIBS"
10249 cat > conftest.$ac_ext <<EOF
10250 #line 10251 "configure"
10251 #include "confdefs.h"
10252 /* Override any gcc2 internal prototype to avoid an error.  */
10253 /* We use char because int might match the return type of a gcc2
10254     builtin and then its argument prototype would still apply.  */
10255 char res_query();
10256
10257 int main() {
10258 res_query()
10259 ; return 0; }
10260 EOF
10261 if { (eval echo configure:10262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10262   rm -rf conftest*
10263   eval "ac_cv_lib_$ac_lib_var=yes"
10264 else
10265   echo "configure: failed program was:" >&5
10266   cat conftest.$ac_ext >&5
10267   rm -rf conftest*
10268   eval "ac_cv_lib_$ac_lib_var=no"
10269 fi
10270 rm -f conftest*
10271 LIBS="$ac_save_LIBS"
10272
10273 fi
10274 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10275   echo "$ac_t""yes" 1>&6
10276     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10277     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10278   cat >> confdefs.h <<EOF
10279 #define $ac_tr_lib 1
10280 EOF
10281
10282   LIBS="-lresolv $LIBS"
10283
10284 else
10285   echo "$ac_t""no" 1>&6
10286 fi
10287
10288         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
10289 fi
10290
10291 if test $ac_cv_func_res_query = no ; then 
10292         echo $ac_n "checking for __res_query in -lresolv""... $ac_c" 1>&6
10293 echo "configure:10294: checking for __res_query in -lresolv" >&5
10294 ac_lib_var=`echo resolv'_'__res_query | sed 'y%./+-:%__p__%'`
10295 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10296   echo $ac_n "(cached) $ac_c" 1>&6
10297 else
10298   ac_save_LIBS="$LIBS"
10299 LIBS="-lresolv  $LIBS"
10300 cat > conftest.$ac_ext <<EOF
10301 #line 10302 "configure"
10302 #include "confdefs.h"
10303 /* Override any gcc2 internal prototype to avoid an error.  */
10304 /* We use char because int might match the return type of a gcc2
10305     builtin and then its argument prototype would still apply.  */
10306 char __res_query();
10307
10308 int main() {
10309 __res_query()
10310 ; return 0; }
10311 EOF
10312 if { (eval echo configure:10313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10313   rm -rf conftest*
10314   eval "ac_cv_lib_$ac_lib_var=yes"
10315 else
10316   echo "configure: failed program was:" >&5
10317   cat conftest.$ac_ext >&5
10318   rm -rf conftest*
10319   eval "ac_cv_lib_$ac_lib_var=no"
10320 fi
10321 rm -f conftest*
10322 LIBS="$ac_save_LIBS"
10323
10324 fi
10325 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10326   echo "$ac_t""yes" 1>&6
10327     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10328     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10329   cat >> confdefs.h <<EOF
10330 #define $ac_tr_lib 1
10331 EOF
10332
10333   LIBS="-lresolv $LIBS"
10334
10335 else
10336   echo "$ac_t""no" 1>&6
10337 fi
10338
10339         ac_cv_func_res_query=$ac_cv_lib_resolv___res_query
10340 fi
10341
10342 if test "$ac_cv_func_res_query" = yes ; then
10343         cat >> confdefs.h <<\EOF
10344 #define HAVE_RES_QUERY 1
10345 EOF
10346
10347
10348         if test $ol_enable_dnssrv != no ; then
10349                 ol_link_dnssrv=yes
10350         fi
10351 fi
10352
10353 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
10354         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
10355 fi
10356
10357 for ac_func in getaddrinfo gai_strerror inet_ntop 
10358 do
10359 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10360 echo "configure:10361: checking for $ac_func" >&5
10361 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10362   echo $ac_n "(cached) $ac_c" 1>&6
10363 else
10364   cat > conftest.$ac_ext <<EOF
10365 #line 10366 "configure"
10366 #include "confdefs.h"
10367 /* System header to define __stub macros and hopefully few prototypes,
10368     which can conflict with char $ac_func(); below.  */
10369 #include <assert.h>
10370 /* Override any gcc2 internal prototype to avoid an error.  */
10371 /* We use char because int might match the return type of a gcc2
10372     builtin and then its argument prototype would still apply.  */
10373 char $ac_func();
10374 char (*f)();
10375
10376 int main() {
10377
10378 /* The GNU C library defines this for functions which it implements
10379     to always fail with ENOSYS.  Some functions are actually named
10380     something starting with __ and the normal name is an alias.  */
10381 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10382 choke me
10383 #else
10384 f = $ac_func;
10385 #endif
10386
10387 ; return 0; }
10388 EOF
10389 if { (eval echo configure:10390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10390   rm -rf conftest*
10391   eval "ac_cv_func_$ac_func=yes"
10392 else
10393   echo "configure: failed program was:" >&5
10394   cat conftest.$ac_ext >&5
10395   rm -rf conftest*
10396   eval "ac_cv_func_$ac_func=no"
10397 fi
10398 rm -f conftest*
10399 fi
10400
10401 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10402   echo "$ac_t""yes" 1>&6
10403     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10404   cat >> confdefs.h <<EOF
10405 #define $ac_tr_func 1
10406 EOF
10407  
10408 else
10409   echo "$ac_t""no" 1>&6
10410 fi
10411 done
10412
10413
10414 ol_link_ipv6=no
10415 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
10416         if test $ol_enable_ipv6 = yes ; then
10417                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
10418         fi
10419 elif test $ol_enable_ipv6 != no ; then
10420         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
10421 echo "configure:10422: checking INET6_ADDRSTRLEN" >&5
10422 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
10423   echo $ac_n "(cached) $ac_c" 1>&6
10424 else
10425   
10426                 cat > conftest.$ac_ext <<EOF
10427 #line 10428 "configure"
10428 #include "confdefs.h"
10429
10430 #                       include <netinet/in.h>
10431 #                       ifdef INET6_ADDRSTRLEN
10432                                 __has_inet6_addrstrlen__;
10433 #                       endif
10434                 
10435 EOF
10436 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10437   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
10438   rm -rf conftest*
10439   ol_cv_inet6_addrstrlen=yes
10440 else
10441   rm -rf conftest*
10442   ol_cv_inet6_addrstrlen=no
10443 fi
10444 rm -f conftest*
10445
10446 fi
10447
10448 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
10449
10450
10451         echo $ac_n "checking struct sockaddr_storage""... $ac_c" 1>&6
10452 echo "configure:10453: checking struct sockaddr_storage" >&5
10453 if eval "test \"\${ol_cv_struct_sockaddr_storage+set}\" = set"; then
10454   echo $ac_n "(cached) $ac_c" 1>&6
10455 else
10456   
10457                 cat > conftest.$ac_ext <<EOF
10458 #line 10459 "configure"
10459 #include "confdefs.h"
10460
10461 #include <sys/types.h>
10462 #include <sys/socket.h>
10463
10464 int main() {
10465
10466                         struct sockaddr_storage ss;
10467
10468 ; return 0; }
10469 EOF
10470 if { (eval echo configure:10471: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10471   rm -rf conftest*
10472   ol_cv_struct_sockaddr_storage=yes
10473 else
10474   echo "configure: failed program was:" >&5
10475   cat conftest.$ac_ext >&5
10476   rm -rf conftest*
10477   ol_cv_struct_sockaddr_storage=no
10478 fi
10479 rm -f conftest*
10480 fi
10481
10482 echo "$ac_t""$ol_cv_struct_sockaddr_storage" 1>&6
10483
10484         if test $ol_cv_inet6_addrstrlen = yes \
10485                 -a $ol_cv_struct_sockaddr_storage = yes ; then
10486                 ol_link_ipv6=yes
10487         elif test $ol_enable_ipv6 = yes \
10488                         -a $ol_cv_inet6_addrstrlen = no ; then
10489                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
10490         elif test $ol_enable_ipv6 = yes \
10491                         -a $ol_cv_struct_sockaddr_storage = no ; then
10492                 { echo "configure: error: IPv6 support requires struct sockaddr_storage" 1>&2; exit 1; }
10493         fi
10494 fi
10495
10496 if test $ol_enable_local != no ; then
10497         for ac_hdr in sys/un.h 
10498 do
10499 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10500 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10501 echo "configure:10502: checking for $ac_hdr" >&5
10502 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10503   echo $ac_n "(cached) $ac_c" 1>&6
10504 else
10505   cat > conftest.$ac_ext <<EOF
10506 #line 10507 "configure"
10507 #include "confdefs.h"
10508 #include <$ac_hdr>
10509 EOF
10510 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10511 { (eval echo configure:10512: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10512 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10513 if test -z "$ac_err"; then
10514   rm -rf conftest*
10515   eval "ac_cv_header_$ac_safe=yes"
10516 else
10517   echo "$ac_err" >&5
10518   echo "configure: failed program was:" >&5
10519   cat conftest.$ac_ext >&5
10520   rm -rf conftest*
10521   eval "ac_cv_header_$ac_safe=no"
10522 fi
10523 rm -f conftest*
10524 fi
10525 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10526   echo "$ac_t""yes" 1>&6
10527     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10528   cat >> confdefs.h <<EOF
10529 #define $ac_tr_hdr 1
10530 EOF
10531  
10532 else
10533   echo "$ac_t""no" 1>&6
10534 fi
10535 done
10536
10537
10538         if test $ol_enable_local = auto ; then
10539                 ol_enable_local=$ac_cv_header_sys_un_h
10540         elif test $ac_cv_header_sys_un_h = no ; then
10541                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
10542         fi
10543 fi
10544
10545 ol_link_kbind=no
10546 ol_link_kpasswd=no
10547 ol_link_krb5=no
10548 ol_link_krb4=no
10549
10550 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
10551         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
10552         -o $ol_with_kerberos = k425 ; then
10553
10554         for ac_hdr in krb5.h
10555 do
10556 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10557 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10558 echo "configure:10559: checking for $ac_hdr" >&5
10559 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10560   echo $ac_n "(cached) $ac_c" 1>&6
10561 else
10562   cat > conftest.$ac_ext <<EOF
10563 #line 10564 "configure"
10564 #include "confdefs.h"
10565 #include <$ac_hdr>
10566 EOF
10567 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10568 { (eval echo configure:10569: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10569 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10570 if test -z "$ac_err"; then
10571   rm -rf conftest*
10572   eval "ac_cv_header_$ac_safe=yes"
10573 else
10574   echo "$ac_err" >&5
10575   echo "configure: failed program was:" >&5
10576   cat conftest.$ac_ext >&5
10577   rm -rf conftest*
10578   eval "ac_cv_header_$ac_safe=no"
10579 fi
10580 rm -f conftest*
10581 fi
10582 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10583   echo "$ac_t""yes" 1>&6
10584     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10585   cat >> confdefs.h <<EOF
10586 #define $ac_tr_hdr 1
10587 EOF
10588  
10589 else
10590   echo "$ac_t""no" 1>&6
10591 fi
10592 done
10593
10594
10595         if test $ac_cv_header_krb5_h = yes ; then
10596                                 for ac_hdr in heim_err.h
10597 do
10598 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10599 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10600 echo "configure:10601: checking for $ac_hdr" >&5
10601 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10602   echo $ac_n "(cached) $ac_c" 1>&6
10603 else
10604   cat > conftest.$ac_ext <<EOF
10605 #line 10606 "configure"
10606 #include "confdefs.h"
10607 #include <$ac_hdr>
10608 EOF
10609 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10610 { (eval echo configure:10611: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10611 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10612 if test -z "$ac_err"; then
10613   rm -rf conftest*
10614   eval "ac_cv_header_$ac_safe=yes"
10615 else
10616   echo "$ac_err" >&5
10617   echo "configure: failed program was:" >&5
10618   cat conftest.$ac_ext >&5
10619   rm -rf conftest*
10620   eval "ac_cv_header_$ac_safe=no"
10621 fi
10622 rm -f conftest*
10623 fi
10624 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10625   echo "$ac_t""yes" 1>&6
10626     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10627   cat >> confdefs.h <<EOF
10628 #define $ac_tr_hdr 1
10629 EOF
10630  
10631 else
10632   echo "$ac_t""no" 1>&6
10633 fi
10634 done
10635
10636                 if test $ac_cv_header_heim_err_h = yes ; then
10637                         krb5_impl=heimdal
10638                 else
10639                         krb5_impl=mit
10640                 fi
10641
10642                 if test $krb5_impl = mit; then
10643                         echo $ac_n "checking for main in -lk5crypto""... $ac_c" 1>&6
10644 echo "configure:10645: checking for main in -lk5crypto" >&5
10645 ac_lib_var=`echo k5crypto'_'main | sed 'y%./+-:%__p__%'`
10646 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10647   echo $ac_n "(cached) $ac_c" 1>&6
10648 else
10649   ac_save_LIBS="$LIBS"
10650 LIBS="-lk5crypto  $LIBS"
10651 cat > conftest.$ac_ext <<EOF
10652 #line 10653 "configure"
10653 #include "confdefs.h"
10654
10655 int main() {
10656 main()
10657 ; return 0; }
10658 EOF
10659 if { (eval echo configure:10660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10660   rm -rf conftest*
10661   eval "ac_cv_lib_$ac_lib_var=yes"
10662 else
10663   echo "configure: failed program was:" >&5
10664   cat conftest.$ac_ext >&5
10665   rm -rf conftest*
10666   eval "ac_cv_lib_$ac_lib_var=no"
10667 fi
10668 rm -f conftest*
10669 LIBS="$ac_save_LIBS"
10670
10671 fi
10672 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10673   echo "$ac_t""yes" 1>&6
10674   krb5crypto=k5crypto
10675 else
10676   echo "$ac_t""no" 1>&6
10677 krb5crypto=crypto
10678 fi
10679
10680
10681                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
10682 echo "configure:10683: checking for main in -lkrb5" >&5
10683 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
10684 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10685   echo $ac_n "(cached) $ac_c" 1>&6
10686 else
10687   ac_save_LIBS="$LIBS"
10688 LIBS="-lkrb5 -l$krb5crypto -lcom_err $LIBS"
10689 cat > conftest.$ac_ext <<EOF
10690 #line 10691 "configure"
10691 #include "confdefs.h"
10692
10693 int main() {
10694 main()
10695 ; return 0; }
10696 EOF
10697 if { (eval echo configure:10698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10698   rm -rf conftest*
10699   eval "ac_cv_lib_$ac_lib_var=yes"
10700 else
10701   echo "configure: failed program was:" >&5
10702   cat conftest.$ac_ext >&5
10703   rm -rf conftest*
10704   eval "ac_cv_lib_$ac_lib_var=no"
10705 fi
10706 rm -f conftest*
10707 LIBS="$ac_save_LIBS"
10708
10709 fi
10710 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10711   echo "$ac_t""yes" 1>&6
10712   have_krb5=yes
10713                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lcom_err"
10714 else
10715   echo "$ac_t""no" 1>&6
10716 have_krb5=no
10717 fi
10718
10719
10720                 elif test $krb5_impl = heimdal; then
10721                         echo $ac_n "checking for main in -ldes""... $ac_c" 1>&6
10722 echo "configure:10723: checking for main in -ldes" >&5
10723 ac_lib_var=`echo des'_'main | sed 'y%./+-:%__p__%'`
10724 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10725   echo $ac_n "(cached) $ac_c" 1>&6
10726 else
10727   ac_save_LIBS="$LIBS"
10728 LIBS="-ldes  $LIBS"
10729 cat > conftest.$ac_ext <<EOF
10730 #line 10731 "configure"
10731 #include "confdefs.h"
10732
10733 int main() {
10734 main()
10735 ; return 0; }
10736 EOF
10737 if { (eval echo configure:10738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10738   rm -rf conftest*
10739   eval "ac_cv_lib_$ac_lib_var=yes"
10740 else
10741   echo "configure: failed program was:" >&5
10742   cat conftest.$ac_ext >&5
10743   rm -rf conftest*
10744   eval "ac_cv_lib_$ac_lib_var=no"
10745 fi
10746 rm -f conftest*
10747 LIBS="$ac_save_LIBS"
10748
10749 fi
10750 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10751   echo "$ac_t""yes" 1>&6
10752   krb5crypto=des
10753 else
10754   echo "$ac_t""no" 1>&6
10755 krb5crypto=crypto
10756 fi
10757
10758
10759                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
10760 echo "configure:10761: checking for main in -lkrb5" >&5
10761 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
10762 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10763   echo $ac_n "(cached) $ac_c" 1>&6
10764 else
10765   ac_save_LIBS="$LIBS"
10766 LIBS="-lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err $LIBS"
10767 cat > conftest.$ac_ext <<EOF
10768 #line 10769 "configure"
10769 #include "confdefs.h"
10770
10771 int main() {
10772 main()
10773 ; return 0; }
10774 EOF
10775 if { (eval echo configure:10776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10776   rm -rf conftest*
10777   eval "ac_cv_lib_$ac_lib_var=yes"
10778 else
10779   echo "configure: failed program was:" >&5
10780   cat conftest.$ac_ext >&5
10781   rm -rf conftest*
10782   eval "ac_cv_lib_$ac_lib_var=no"
10783 fi
10784 rm -f conftest*
10785 LIBS="$ac_save_LIBS"
10786
10787 fi
10788 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10789   echo "$ac_t""yes" 1>&6
10790   have_krb5=yes
10791                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err"
10792 else
10793   echo "$ac_t""no" 1>&6
10794 have_krb5=no
10795 fi
10796
10797
10798                         cat >> confdefs.h <<\EOF
10799 #define HAVE_HEIMDAL_KERBEROS 1
10800 EOF
10801
10802
10803                 else
10804                         have_krb5=no
10805                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
10806                 fi
10807
10808                 if test $have_krb5 = yes ; then
10809                         ol_link_krb5=yes
10810
10811                         cat >> confdefs.h <<\EOF
10812 #define HAVE_KRB5 1
10813 EOF
10814
10815
10816                         if test $ol_enable_kpasswd != no ; then
10817                                 ol_link_kpasswd=yes;
10818                         fi
10819
10820                         if test $ol_with_kerberos = k5only ; then
10821                                 ol_with_kerberos=found
10822                         fi
10823
10824                 elif test $ol_with_kerberos != auto ; then
10825                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
10826                 fi
10827
10828         fi
10829 fi
10830
10831 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
10832         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
10833
10834         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
10835 do
10836 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10837 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10838 echo "configure:10839: checking for $ac_hdr" >&5
10839 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10840   echo $ac_n "(cached) $ac_c" 1>&6
10841 else
10842   cat > conftest.$ac_ext <<EOF
10843 #line 10844 "configure"
10844 #include "confdefs.h"
10845 #include <$ac_hdr>
10846 EOF
10847 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10848 { (eval echo configure:10849: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10849 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10850 if test -z "$ac_err"; then
10851   rm -rf conftest*
10852   eval "ac_cv_header_$ac_safe=yes"
10853 else
10854   echo "$ac_err" >&5
10855   echo "configure: failed program was:" >&5
10856   cat conftest.$ac_ext >&5
10857   rm -rf conftest*
10858   eval "ac_cv_header_$ac_safe=no"
10859 fi
10860 rm -f conftest*
10861 fi
10862 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10863   echo "$ac_t""yes" 1>&6
10864     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10865   cat >> confdefs.h <<EOF
10866 #define $ac_tr_hdr 1
10867 EOF
10868  
10869 else
10870   echo "$ac_t""no" 1>&6
10871 fi
10872 done
10873
10874
10875         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
10876                 if test $krb5_impl = mit; then
10877                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
10878 echo "configure:10879: checking for main in -lkrb4" >&5
10879 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
10880 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10881   echo $ac_n "(cached) $ac_c" 1>&6
10882 else
10883   ac_save_LIBS="$LIBS"
10884 LIBS="-lkrb4 -ldes425 -lkrb5 -l$krb5crypto -lcom_err $LIBS"
10885 cat > conftest.$ac_ext <<EOF
10886 #line 10887 "configure"
10887 #include "confdefs.h"
10888
10889 int main() {
10890 main()
10891 ; return 0; }
10892 EOF
10893 if { (eval echo configure:10894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10894   rm -rf conftest*
10895   eval "ac_cv_lib_$ac_lib_var=yes"
10896 else
10897   echo "configure: failed program was:" >&5
10898   cat conftest.$ac_ext >&5
10899   rm -rf conftest*
10900   eval "ac_cv_lib_$ac_lib_var=no"
10901 fi
10902 rm -f conftest*
10903 LIBS="$ac_save_LIBS"
10904
10905 fi
10906 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10907   echo "$ac_t""yes" 1>&6
10908   have_k425=yes
10909                                 KRB4_LIBS="-lkrb4 -ldes425"
10910 else
10911   echo "$ac_t""no" 1>&6
10912 have_k425=no
10913 fi
10914
10915
10916                 elif test $krb5_impl = heimdal; then
10917                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
10918 echo "configure:10919: checking for main in -lkrb4" >&5
10919 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
10920 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10921   echo $ac_n "(cached) $ac_c" 1>&6
10922 else
10923   ac_save_LIBS="$LIBS"
10924 LIBS="-lkrb4 -lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err $LIBS"
10925 cat > conftest.$ac_ext <<EOF
10926 #line 10927 "configure"
10927 #include "confdefs.h"
10928
10929 int main() {
10930 main()
10931 ; return 0; }
10932 EOF
10933 if { (eval echo configure:10934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10934   rm -rf conftest*
10935   eval "ac_cv_lib_$ac_lib_var=yes"
10936 else
10937   echo "configure: failed program was:" >&5
10938   cat conftest.$ac_ext >&5
10939   rm -rf conftest*
10940   eval "ac_cv_lib_$ac_lib_var=no"
10941 fi
10942 rm -f conftest*
10943 LIBS="$ac_save_LIBS"
10944
10945 fi
10946 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10947   echo "$ac_t""yes" 1>&6
10948   have_k425=yes
10949                                 KRB4_LIBS="-lkrb4"
10950 else
10951   echo "$ac_t""no" 1>&6
10952 have_k425=no
10953 fi
10954
10955
10956                 else
10957                         have_425=no
10958                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
10959                 fi
10960
10961                 if test $have_k425 = yes ; then
10962                         ol_with_kerberos=found
10963                         ol_link_krb4=yes
10964
10965                         cat >> confdefs.h <<\EOF
10966 #define HAVE_KRB425 1
10967 EOF
10968
10969                         cat >> confdefs.h <<\EOF
10970 #define HAVE_KRB4 1
10971 EOF
10972
10973
10974                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
10975 echo "configure:10976: checking for des_debug in Kerberos libraries" >&5
10976 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
10977   echo $ac_n "(cached) $ac_c" 1>&6
10978 else
10979   
10980                                                                 save_LIBS="$LIBS"
10981                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
10982                                 cat > conftest.$ac_ext <<EOF
10983 #line 10984 "configure"
10984 #include "confdefs.h"
10985
10986 #include <kerberosIV/krb.h>
10987 #include <kerberosIV/des.h>
10988 extern int des_debug;
10989
10990 int main() {
10991
10992 des_debug = 1;
10993
10994 ; return 0; }
10995 EOF
10996 if { (eval echo configure:10997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10997   rm -rf conftest*
10998   ol_cv_var_des_debug=yes
10999 else
11000   echo "configure: failed program was:" >&5
11001   cat conftest.$ac_ext >&5
11002   rm -rf conftest*
11003   ol_cv_var_des_debug=no
11004 fi
11005 rm -f conftest*
11006                                                                 LIBS="$save_LIBS"
11007                         
11008 fi
11009
11010 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
11011
11012                         if test $ol_cv_var_des_debug = yes ; then
11013                                 cat >> confdefs.h <<\EOF
11014 #define HAVE_DES_DEBUG 1
11015 EOF
11016
11017                         fi
11018
11019                         LIBS="$save_LIBS"
11020                 fi
11021         fi
11022 fi
11023
11024 if test $ol_link_krb5 = yes ; then
11025         ol_with_kerberos=found
11026 fi
11027
11028 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
11029         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
11030
11031         for ac_hdr in krb.h des.h krb-archaeology.h 
11032 do
11033 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11034 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11035 echo "configure:11036: checking for $ac_hdr" >&5
11036 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11037   echo $ac_n "(cached) $ac_c" 1>&6
11038 else
11039   cat > conftest.$ac_ext <<EOF
11040 #line 11041 "configure"
11041 #include "confdefs.h"
11042 #include <$ac_hdr>
11043 EOF
11044 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11045 { (eval echo configure:11046: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11046 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11047 if test -z "$ac_err"; then
11048   rm -rf conftest*
11049   eval "ac_cv_header_$ac_safe=yes"
11050 else
11051   echo "$ac_err" >&5
11052   echo "configure: failed program was:" >&5
11053   cat conftest.$ac_ext >&5
11054   rm -rf conftest*
11055   eval "ac_cv_header_$ac_safe=no"
11056 fi
11057 rm -f conftest*
11058 fi
11059 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11060   echo "$ac_t""yes" 1>&6
11061     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11062   cat >> confdefs.h <<EOF
11063 #define $ac_tr_hdr 1
11064 EOF
11065  
11066 else
11067   echo "$ac_t""no" 1>&6
11068 fi
11069 done
11070
11071
11072         if test $ac_cv_header_krb_h = yes ; then
11073                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
11074 echo "configure:11075: checking for main in -lkrb" >&5
11075 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
11076 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11077   echo $ac_n "(cached) $ac_c" 1>&6
11078 else
11079   ac_save_LIBS="$LIBS"
11080 LIBS="-lkrb -ldes $LIBS"
11081 cat > conftest.$ac_ext <<EOF
11082 #line 11083 "configure"
11083 #include "confdefs.h"
11084
11085 int main() {
11086 main()
11087 ; return 0; }
11088 EOF
11089 if { (eval echo configure:11090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11090   rm -rf conftest*
11091   eval "ac_cv_lib_$ac_lib_var=yes"
11092 else
11093   echo "configure: failed program was:" >&5
11094   cat conftest.$ac_ext >&5
11095   rm -rf conftest*
11096   eval "ac_cv_lib_$ac_lib_var=no"
11097 fi
11098 rm -f conftest*
11099 LIBS="$ac_save_LIBS"
11100
11101 fi
11102 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11103   echo "$ac_t""yes" 1>&6
11104   have_k4=yes
11105 else
11106   echo "$ac_t""no" 1>&6
11107 have_k4=no
11108 fi
11109
11110
11111                 if test $have_k4 = yes ; then
11112                         ol_with_kerberos=found
11113                         ol_link_krb4=yes
11114
11115                         cat >> confdefs.h <<\EOF
11116 #define HAVE_KRB4 1
11117 EOF
11118
11119
11120                         KRB4_LIBS="-lkrb -ldes"
11121
11122                         if test $ac_cv_header_krb_archaeology_h = yes ; then
11123                                 cat >> confdefs.h <<\EOF
11124 #define HAVE_KTH_KERBEROS 1
11125 EOF
11126
11127                         fi
11128                 fi
11129         fi
11130 fi
11131
11132 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
11133         ol_link_kpasswd=yes
11134 fi
11135
11136 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
11137         ol_link_kbind=yes
11138
11139 elif test $ol_enable_kbind = yes ; then
11140         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
11141 fi
11142
11143 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
11144         cat >> confdefs.h <<\EOF
11145 #define HAVE_KERBEROS 1
11146 EOF
11147
11148
11149 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
11150         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
11151 fi
11152
11153 ol_link_tls=no
11154 if test $ol_with_tls != no ; then
11155         for ac_hdr in openssl/ssl.h ssl.h
11156 do
11157 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11158 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11159 echo "configure:11160: checking for $ac_hdr" >&5
11160 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11161   echo $ac_n "(cached) $ac_c" 1>&6
11162 else
11163   cat > conftest.$ac_ext <<EOF
11164 #line 11165 "configure"
11165 #include "confdefs.h"
11166 #include <$ac_hdr>
11167 EOF
11168 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11169 { (eval echo configure:11170: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11170 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11171 if test -z "$ac_err"; then
11172   rm -rf conftest*
11173   eval "ac_cv_header_$ac_safe=yes"
11174 else
11175   echo "$ac_err" >&5
11176   echo "configure: failed program was:" >&5
11177   cat conftest.$ac_ext >&5
11178   rm -rf conftest*
11179   eval "ac_cv_header_$ac_safe=no"
11180 fi
11181 rm -f conftest*
11182 fi
11183 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11184   echo "$ac_t""yes" 1>&6
11185     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11186   cat >> confdefs.h <<EOF
11187 #define $ac_tr_hdr 1
11188 EOF
11189  
11190 else
11191   echo "$ac_t""no" 1>&6
11192 fi
11193 done
11194
11195         
11196         if test $ac_cv_header_openssl_ssl_h = yes \
11197                 -o $ac_cv_header_ssl_h = yes ; then
11198                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
11199 echo "configure:11200: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
11200 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
11201 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11202   echo $ac_n "(cached) $ac_c" 1>&6
11203 else
11204   ac_save_LIBS="$LIBS"
11205 LIBS="-lssl -lcrypto $LIBS"
11206 cat > conftest.$ac_ext <<EOF
11207 #line 11208 "configure"
11208 #include "confdefs.h"
11209 /* Override any gcc2 internal prototype to avoid an error.  */
11210 /* We use char because int might match the return type of a gcc2
11211     builtin and then its argument prototype would still apply.  */
11212 char SSLeay_add_ssl_algorithms();
11213
11214 int main() {
11215 SSLeay_add_ssl_algorithms()
11216 ; return 0; }
11217 EOF
11218 if { (eval echo configure:11219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11219   rm -rf conftest*
11220   eval "ac_cv_lib_$ac_lib_var=yes"
11221 else
11222   echo "configure: failed program was:" >&5
11223   cat conftest.$ac_ext >&5
11224   rm -rf conftest*
11225   eval "ac_cv_lib_$ac_lib_var=no"
11226 fi
11227 rm -f conftest*
11228 LIBS="$ac_save_LIBS"
11229
11230 fi
11231 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11232   echo "$ac_t""yes" 1>&6
11233   have_ssleay=yes
11234                         need_rsaref=no
11235 else
11236   echo "$ac_t""no" 1>&6
11237 have_ssleay=no
11238 fi
11239
11240                         
11241                 if test $have_ssleay = no ; then
11242                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
11243 echo "configure:11244: checking for SSL_library_init in -lssl" >&5
11244 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
11245 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11246   echo $ac_n "(cached) $ac_c" 1>&6
11247 else
11248   ac_save_LIBS="$LIBS"
11249 LIBS="-lssl -lcrypto $LIBS"
11250 cat > conftest.$ac_ext <<EOF
11251 #line 11252 "configure"
11252 #include "confdefs.h"
11253 /* Override any gcc2 internal prototype to avoid an error.  */
11254 /* We use char because int might match the return type of a gcc2
11255     builtin and then its argument prototype would still apply.  */
11256 char SSL_library_init();
11257
11258 int main() {
11259 SSL_library_init()
11260 ; return 0; }
11261 EOF
11262 if { (eval echo configure:11263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11263   rm -rf conftest*
11264   eval "ac_cv_lib_$ac_lib_var=yes"
11265 else
11266   echo "configure: failed program was:" >&5
11267   cat conftest.$ac_ext >&5
11268   rm -rf conftest*
11269   eval "ac_cv_lib_$ac_lib_var=no"
11270 fi
11271 rm -f conftest*
11272 LIBS="$ac_save_LIBS"
11273
11274 fi
11275 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11276   echo "$ac_t""yes" 1>&6
11277   have_ssleay=yes
11278                                 need_rsaref=no
11279 else
11280   echo "$ac_t""no" 1>&6
11281 have_ssleay=no
11282 fi
11283
11284                 fi
11285
11286                 if test $have_ssleay = no ; then
11287                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
11288 echo "configure:11289: checking for ssl3_accept in -lssl" >&5
11289 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
11290 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11291   echo $ac_n "(cached) $ac_c" 1>&6
11292 else
11293   ac_save_LIBS="$LIBS"
11294 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
11295 cat > conftest.$ac_ext <<EOF
11296 #line 11297 "configure"
11297 #include "confdefs.h"
11298 /* Override any gcc2 internal prototype to avoid an error.  */
11299 /* We use char because int might match the return type of a gcc2
11300     builtin and then its argument prototype would still apply.  */
11301 char ssl3_accept();
11302
11303 int main() {
11304 ssl3_accept()
11305 ; return 0; }
11306 EOF
11307 if { (eval echo configure:11308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11308   rm -rf conftest*
11309   eval "ac_cv_lib_$ac_lib_var=yes"
11310 else
11311   echo "configure: failed program was:" >&5
11312   cat conftest.$ac_ext >&5
11313   rm -rf conftest*
11314   eval "ac_cv_lib_$ac_lib_var=no"
11315 fi
11316 rm -f conftest*
11317 LIBS="$ac_save_LIBS"
11318
11319 fi
11320 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11321   echo "$ac_t""yes" 1>&6
11322   have_ssleay=yes
11323                                 need_rsaref=yes
11324 else
11325   echo "$ac_t""no" 1>&6
11326 have_ssleay=no
11327 fi
11328
11329                 fi
11330
11331                 if test $have_ssleay = yes ; then
11332                         ol_with_tls=found
11333                         ol_link_tls=yes
11334
11335                         cat >> confdefs.h <<\EOF
11336 #define HAVE_SSLEAY 1
11337 EOF
11338
11339
11340                         if test $need_rsaref = yes; then
11341                                 cat >> confdefs.h <<\EOF
11342 #define HAVE_RSAREF 1
11343 EOF
11344
11345
11346                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
11347                         else
11348                                 TLS_LIBS="-lssl -lcrypto"
11349                         fi
11350                 fi
11351         fi
11352
11353 else
11354         echo "configure: warning: TLS data protection not supported!" 1>&2
11355 fi
11356
11357 if test $ol_link_tls = yes ; then
11358         cat >> confdefs.h <<\EOF
11359 #define HAVE_TLS 1
11360 EOF
11361
11362
11363 elif test $ol_with_tls = auto ; then
11364         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
11365         echo "configure: warning: TLS data protection not supported!" 1>&2
11366
11367 elif test $ol_with_tls != no ; then
11368         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
11369 fi
11370
11371 if test $ol_enable_lmpasswd != no; then
11372         if test $ol_link_tls != yes ; then
11373                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
11374         fi
11375
11376         cat >> confdefs.h <<\EOF
11377 #define SLAPD_LMHASH 1
11378 EOF
11379
11380 fi
11381
11382 ol_link_threads=no
11383
11384 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11385         -o $ol_with_threads = nt ; then
11386
11387         
11388         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
11389 echo "configure:11390: checking for _beginthread" >&5
11390 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
11391   echo $ac_n "(cached) $ac_c" 1>&6
11392 else
11393   cat > conftest.$ac_ext <<EOF
11394 #line 11395 "configure"
11395 #include "confdefs.h"
11396 /* System header to define __stub macros and hopefully few prototypes,
11397     which can conflict with char _beginthread(); below.  */
11398 #include <assert.h>
11399 /* Override any gcc2 internal prototype to avoid an error.  */
11400 /* We use char because int might match the return type of a gcc2
11401     builtin and then its argument prototype would still apply.  */
11402 char _beginthread();
11403 char (*f)();
11404
11405 int main() {
11406
11407 /* The GNU C library defines this for functions which it implements
11408     to always fail with ENOSYS.  Some functions are actually named
11409     something starting with __ and the normal name is an alias.  */
11410 #if defined (__stub__beginthread) || defined (__stub____beginthread)
11411 choke me
11412 #else
11413 f = _beginthread;
11414 #endif
11415
11416 ; return 0; }
11417 EOF
11418 if { (eval echo configure:11419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11419   rm -rf conftest*
11420   eval "ac_cv_func__beginthread=yes"
11421 else
11422   echo "configure: failed program was:" >&5
11423   cat conftest.$ac_ext >&5
11424   rm -rf conftest*
11425   eval "ac_cv_func__beginthread=no"
11426 fi
11427 rm -f conftest*
11428 fi
11429
11430 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
11431   echo "$ac_t""yes" 1>&6
11432   :
11433 else
11434   echo "$ac_t""no" 1>&6
11435 fi
11436
11437
11438         if test $ac_cv_func__beginthread = yes ; then
11439                 cat >> confdefs.h <<\EOF
11440 #define HAVE_NT_THREADS 1
11441 EOF
11442
11443                 ol_cv_nt_threads=yes
11444         fi
11445
11446
11447         if test "$ol_cv_nt_threads" = yes ; then
11448                 ol_link_threads=nt
11449                 ol_with_threads=found
11450                 ol_with_yielding_select=yes
11451
11452                 cat >> confdefs.h <<\EOF
11453 #define HAVE_NT_SERVICE_MANAGER 1
11454 EOF
11455
11456                 cat >> confdefs.h <<\EOF
11457 #define HAVE_NT_EVENT_LOG 1
11458 EOF
11459
11460         fi
11461
11462         if test $ol_with_threads = nt ; then
11463                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
11464         fi
11465 fi
11466
11467 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11468         -o $ol_with_threads = posix ; then
11469
11470         for ac_hdr in pthread.h
11471 do
11472 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11473 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11474 echo "configure:11475: checking for $ac_hdr" >&5
11475 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11476   echo $ac_n "(cached) $ac_c" 1>&6
11477 else
11478   cat > conftest.$ac_ext <<EOF
11479 #line 11480 "configure"
11480 #include "confdefs.h"
11481 #include <$ac_hdr>
11482 EOF
11483 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11484 { (eval echo configure:11485: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11485 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11486 if test -z "$ac_err"; then
11487   rm -rf conftest*
11488   eval "ac_cv_header_$ac_safe=yes"
11489 else
11490   echo "$ac_err" >&5
11491   echo "configure: failed program was:" >&5
11492   cat conftest.$ac_ext >&5
11493   rm -rf conftest*
11494   eval "ac_cv_header_$ac_safe=no"
11495 fi
11496 rm -f conftest*
11497 fi
11498 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11499   echo "$ac_t""yes" 1>&6
11500     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11501   cat >> confdefs.h <<EOF
11502 #define $ac_tr_hdr 1
11503 EOF
11504  
11505 else
11506   echo "$ac_t""no" 1>&6
11507 fi
11508 done
11509
11510
11511         if test $ac_cv_header_pthread_h = yes ; then
11512                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
11513 echo "configure:11514: checking POSIX thread version" >&5
11514 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
11515   echo $ac_n "(cached) $ac_c" 1>&6
11516 else
11517   
11518         cat > conftest.$ac_ext <<EOF
11519 #line 11520 "configure"
11520 #include "confdefs.h"
11521
11522 #               include <pthread.h>
11523         
11524 int main() {
11525
11526                 int i = PTHREAD_CREATE_JOINABLE;
11527         
11528 ; return 0; }
11529 EOF
11530 if { (eval echo configure:11531: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11531   rm -rf conftest*
11532   
11533         cat > conftest.$ac_ext <<EOF
11534 #line 11535 "configure"
11535 #include "confdefs.h"
11536 #include <pthread.h>
11537 EOF
11538 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11539   egrep "pthread_detach" >/dev/null 2>&1; then
11540   rm -rf conftest*
11541   ol_cv_pthread_version=10
11542 else
11543   rm -rf conftest*
11544   ol_cv_pthread_version=8
11545 fi
11546 rm -f conftest*
11547
11548 else
11549   echo "configure: failed program was:" >&5
11550   cat conftest.$ac_ext >&5
11551   rm -rf conftest*
11552   
11553         cat > conftest.$ac_ext <<EOF
11554 #line 11555 "configure"
11555 #include "confdefs.h"
11556
11557 #               include <pthread.h>
11558 #               ifdef PTHREAD_CREATE_UNDETACHED
11559                 draft7
11560 #               endif
11561         
11562 EOF
11563 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11564   egrep "draft7" >/dev/null 2>&1; then
11565   rm -rf conftest*
11566   ol_cv_pthread_version=7
11567 else
11568   rm -rf conftest*
11569   
11570         cat > conftest.$ac_ext <<EOF
11571 #line 11572 "configure"
11572 #include "confdefs.h"
11573 #include <pthread.h>
11574 EOF
11575 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11576   egrep "pthread_attr_init" >/dev/null 2>&1; then
11577   rm -rf conftest*
11578   ol_cv_pthread_version=6
11579 else
11580   rm -rf conftest*
11581   
11582         cat > conftest.$ac_ext <<EOF
11583 #line 11584 "configure"
11584 #include "confdefs.h"
11585
11586 #               include <pthread.h>
11587 #ifdef          PTHREAD_MUTEX_INITIALIZER
11588                 draft5
11589 #endif
11590         
11591 EOF
11592 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11593   egrep "draft5" >/dev/null 2>&1; then
11594   rm -rf conftest*
11595   ol_cv_pthread_version=5
11596 else
11597   rm -rf conftest*
11598   ol_cv_pthread_version=4
11599 fi
11600 rm -f conftest*
11601  
11602 fi
11603 rm -f conftest*
11604  
11605 fi
11606 rm -f conftest*
11607  
11608 fi
11609 rm -f conftest*
11610
11611 fi
11612
11613 echo "$ac_t""$ol_cv_pthread_version" 1>&6
11614
11615
11616                 if test $ol_cv_pthread_version != 0 ; then
11617                         cat >> confdefs.h <<EOF
11618 #define HAVE_PTHREADS $ol_cv_pthread_version
11619 EOF
11620
11621                 else
11622                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
11623                 fi
11624
11625                 # consider threads found
11626                 ol_with_threads=found
11627
11628                 
11629         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
11630 echo "configure:11631: checking for LinuxThreads pthread.h" >&5
11631 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
11632   echo $ac_n "(cached) $ac_c" 1>&6
11633 else
11634   cat > conftest.$ac_ext <<EOF
11635 #line 11636 "configure"
11636 #include "confdefs.h"
11637 #include <pthread.h>
11638 EOF
11639 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11640   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
11641   rm -rf conftest*
11642   ol_cv_header_linux_threads=yes
11643 else
11644   rm -rf conftest*
11645   ol_cv_header_linux_threads=no
11646 fi
11647 rm -f conftest*
11648
11649                 
11650 fi
11651
11652 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
11653         if test $ol_cv_header_linux_threads = yes; then
11654                 cat >> confdefs.h <<\EOF
11655 #define HAVE_LINUX_THREADS 1
11656 EOF
11657
11658         fi
11659
11660                 
11661         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
11662 echo "configure:11663: checking for GNU Pth pthread.h" >&5
11663 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
11664   echo $ac_n "(cached) $ac_c" 1>&6
11665 else
11666   cat > conftest.$ac_ext <<EOF
11667 #line 11668 "configure"
11668 #include "confdefs.h"
11669 #include <pthread.h>
11670 #ifdef _POSIX_THREAD_IS_GNU_PTH
11671         __gnu_pth__;
11672 #endif
11673
11674 EOF
11675 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11676   egrep "__gnu_pth__" >/dev/null 2>&1; then
11677   rm -rf conftest*
11678   ol_cv_header_gnu_pth_pthread_h=yes
11679 else
11680   rm -rf conftest*
11681   ol_cv_header_gnu_pth_pthread_h=no
11682 fi
11683 rm -f conftest*
11684
11685                 
11686 fi
11687
11688 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
11689
11690
11691                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
11692                         for ac_hdr in sched.h
11693 do
11694 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11695 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11696 echo "configure:11697: checking for $ac_hdr" >&5
11697 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11698   echo $ac_n "(cached) $ac_c" 1>&6
11699 else
11700   cat > conftest.$ac_ext <<EOF
11701 #line 11702 "configure"
11702 #include "confdefs.h"
11703 #include <$ac_hdr>
11704 EOF
11705 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11706 { (eval echo configure:11707: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11707 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11708 if test -z "$ac_err"; then
11709   rm -rf conftest*
11710   eval "ac_cv_header_$ac_safe=yes"
11711 else
11712   echo "$ac_err" >&5
11713   echo "configure: failed program was:" >&5
11714   cat conftest.$ac_ext >&5
11715   rm -rf conftest*
11716   eval "ac_cv_header_$ac_safe=no"
11717 fi
11718 rm -f conftest*
11719 fi
11720 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11721   echo "$ac_t""yes" 1>&6
11722     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11723   cat >> confdefs.h <<EOF
11724 #define $ac_tr_hdr 1
11725 EOF
11726  
11727 else
11728   echo "$ac_t""no" 1>&6
11729 fi
11730 done
11731
11732                 fi
11733
11734                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
11735                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
11736 echo "configure:11737: checking for pthread_create in default libraries" >&5
11737 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
11738   echo $ac_n "(cached) $ac_c" 1>&6
11739 else
11740   
11741                 if test "$cross_compiling" = yes; then
11742   cat > conftest.$ac_ext <<EOF
11743 #line 11744 "configure"
11744 #include "confdefs.h"
11745 /* pthread test headers */
11746 #include <pthread.h>
11747 #if HAVE_PTHREADS < 7
11748 #include <errno.h>
11749 #endif
11750 #ifndef NULL
11751 #define NULL (void*)0
11752 #endif
11753
11754 static void *task(p)
11755         void *p;
11756 {
11757         return (void *) (p == NULL);
11758 }
11759
11760 int main() {
11761
11762         /* pthread test function */
11763 #ifndef PTHREAD_CREATE_DETACHED
11764 #define PTHREAD_CREATE_DETACHED 1
11765 #endif
11766         pthread_t t;
11767         int status;
11768         int detach = PTHREAD_CREATE_DETACHED;
11769
11770 #if HAVE_PTHREADS > 4
11771         /* Final pthreads */
11772         pthread_attr_t attr;
11773
11774         status = pthread_attr_init(&attr);
11775         if( status ) return status;
11776
11777 #if HAVE_PTHREADS < 7
11778         status = pthread_attr_setdetachstate(&attr, &detach);
11779         if( status < 0 ) status = errno;
11780 #else
11781         status = pthread_attr_setdetachstate(&attr, detach);
11782 #endif
11783         if( status ) return status;
11784         status = pthread_create( &t, &attr, task, NULL );
11785 #if HAVE_PTHREADS < 7
11786         if( status < 0 ) status = errno;
11787 #endif
11788         if( status ) return status;
11789 #else
11790         /* Draft 4 pthreads */
11791         status = pthread_create( &t, pthread_attr_default, task, NULL );
11792         if( status ) return errno;
11793
11794         /* give thread a chance to complete */
11795         /* it should remain joinable and hence detachable */
11796         sleep( 1 );
11797
11798         status = pthread_detach( &t );
11799         if( status ) return errno;
11800 #endif
11801
11802 #ifdef HAVE_LINUX_THREADS
11803         pthread_kill_other_threads_np();
11804 #endif
11805
11806         return 0;
11807
11808 ; return 0; }
11809 EOF
11810 if { (eval echo configure:11811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11811   rm -rf conftest*
11812   ol_cv_pthread_create=yes
11813 else
11814   echo "configure: failed program was:" >&5
11815   cat conftest.$ac_ext >&5
11816   rm -rf conftest*
11817   ol_cv_pthread_create=no
11818 fi
11819 rm -f conftest*
11820 else
11821   cat > conftest.$ac_ext <<EOF
11822 #line 11823 "configure"
11823 #include "confdefs.h"
11824 /* pthread test headers */
11825 #include <pthread.h>
11826 #if HAVE_PTHREADS < 7
11827 #include <errno.h>
11828 #endif
11829 #ifndef NULL
11830 #define NULL (void*)0
11831 #endif
11832
11833 static void *task(p)
11834         void *p;
11835 {
11836         return (void *) (p == NULL);
11837 }
11838
11839
11840 int main(argc, argv)
11841         int argc;
11842         char **argv;
11843 {
11844
11845         /* pthread test function */
11846 #ifndef PTHREAD_CREATE_DETACHED
11847 #define PTHREAD_CREATE_DETACHED 1
11848 #endif
11849         pthread_t t;
11850         int status;
11851         int detach = PTHREAD_CREATE_DETACHED;
11852
11853 #if HAVE_PTHREADS > 4
11854         /* Final pthreads */
11855         pthread_attr_t attr;
11856
11857         status = pthread_attr_init(&attr);
11858         if( status ) return status;
11859
11860 #if HAVE_PTHREADS < 7
11861         status = pthread_attr_setdetachstate(&attr, &detach);
11862         if( status < 0 ) status = errno;
11863 #else
11864         status = pthread_attr_setdetachstate(&attr, detach);
11865 #endif
11866         if( status ) return status;
11867         status = pthread_create( &t, &attr, task, NULL );
11868 #if HAVE_PTHREADS < 7
11869         if( status < 0 ) status = errno;
11870 #endif
11871         if( status ) return status;
11872 #else
11873         /* Draft 4 pthreads */
11874         status = pthread_create( &t, pthread_attr_default, task, NULL );
11875         if( status ) return errno;
11876
11877         /* give thread a chance to complete */
11878         /* it should remain joinable and hence detachable */
11879         sleep( 1 );
11880
11881         status = pthread_detach( &t );
11882         if( status ) return errno;
11883 #endif
11884
11885 #ifdef HAVE_LINUX_THREADS
11886         pthread_kill_other_threads_np();
11887 #endif
11888
11889         return 0;
11890
11891 }
11892
11893 EOF
11894 if { (eval echo configure:11895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11895 then
11896   ol_cv_pthread_create=yes
11897 else
11898   echo "configure: failed program was:" >&5
11899   cat conftest.$ac_ext >&5
11900   rm -fr conftest*
11901   ol_cv_pthread_create=no
11902 fi
11903 rm -fr conftest*
11904 fi
11905
11906 fi
11907
11908 echo "$ac_t""$ol_cv_pthread_create" 1>&6
11909
11910                 if test $ol_cv_pthread_create != no ; then
11911                         ol_link_threads=posix
11912                         ol_link_pthreads=""
11913                 fi
11914                 
11915                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
11916 if test "$ol_link_threads" = no ; then
11917         # try -kthread
11918         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
11919 echo "configure:11920: checking for pthread link with -kthread" >&5
11920 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
11921   echo $ac_n "(cached) $ac_c" 1>&6
11922 else
11923   
11924                 # save the flags
11925                 ol_LIBS="$LIBS"
11926                 LIBS="-kthread $LIBS"
11927
11928                 if test "$cross_compiling" = yes; then
11929   cat > conftest.$ac_ext <<EOF
11930 #line 11931 "configure"
11931 #include "confdefs.h"
11932 /* pthread test headers */
11933 #include <pthread.h>
11934 #if HAVE_PTHREADS < 7
11935 #include <errno.h>
11936 #endif
11937 #ifndef NULL
11938 #define NULL (void*)0
11939 #endif
11940
11941 static void *task(p)
11942         void *p;
11943 {
11944         return (void *) (p == NULL);
11945 }
11946
11947 int main() {
11948
11949         /* pthread test function */
11950 #ifndef PTHREAD_CREATE_DETACHED
11951 #define PTHREAD_CREATE_DETACHED 1
11952 #endif
11953         pthread_t t;
11954         int status;
11955         int detach = PTHREAD_CREATE_DETACHED;
11956
11957 #if HAVE_PTHREADS > 4
11958         /* Final pthreads */
11959         pthread_attr_t attr;
11960
11961         status = pthread_attr_init(&attr);
11962         if( status ) return status;
11963
11964 #if HAVE_PTHREADS < 7
11965         status = pthread_attr_setdetachstate(&attr, &detach);
11966         if( status < 0 ) status = errno;
11967 #else
11968         status = pthread_attr_setdetachstate(&attr, detach);
11969 #endif
11970         if( status ) return status;
11971         status = pthread_create( &t, &attr, task, NULL );
11972 #if HAVE_PTHREADS < 7
11973         if( status < 0 ) status = errno;
11974 #endif
11975         if( status ) return status;
11976 #else
11977         /* Draft 4 pthreads */
11978         status = pthread_create( &t, pthread_attr_default, task, NULL );
11979         if( status ) return errno;
11980
11981         /* give thread a chance to complete */
11982         /* it should remain joinable and hence detachable */
11983         sleep( 1 );
11984
11985         status = pthread_detach( &t );
11986         if( status ) return errno;
11987 #endif
11988
11989 #ifdef HAVE_LINUX_THREADS
11990         pthread_kill_other_threads_np();
11991 #endif
11992
11993         return 0;
11994
11995 ; return 0; }
11996 EOF
11997 if { (eval echo configure:11998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11998   rm -rf conftest*
11999   ol_cv_pthread_kthread=yes
12000 else
12001   echo "configure: failed program was:" >&5
12002   cat conftest.$ac_ext >&5
12003   rm -rf conftest*
12004   ol_cv_pthread_kthread=no
12005 fi
12006 rm -f conftest*
12007 else
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
12027 int main(argc, argv)
12028         int argc;
12029         char **argv;
12030 {
12031
12032         /* pthread test function */
12033 #ifndef PTHREAD_CREATE_DETACHED
12034 #define PTHREAD_CREATE_DETACHED 1
12035 #endif
12036         pthread_t t;
12037         int status;
12038         int detach = PTHREAD_CREATE_DETACHED;
12039
12040 #if HAVE_PTHREADS > 4
12041         /* Final pthreads */
12042         pthread_attr_t attr;
12043
12044         status = pthread_attr_init(&attr);
12045         if( status ) return status;
12046
12047 #if HAVE_PTHREADS < 7
12048         status = pthread_attr_setdetachstate(&attr, &detach);
12049         if( status < 0 ) status = errno;
12050 #else
12051         status = pthread_attr_setdetachstate(&attr, detach);
12052 #endif
12053         if( status ) return status;
12054         status = pthread_create( &t, &attr, task, NULL );
12055 #if HAVE_PTHREADS < 7
12056         if( status < 0 ) status = errno;
12057 #endif
12058         if( status ) return status;
12059 #else
12060         /* Draft 4 pthreads */
12061         status = pthread_create( &t, pthread_attr_default, task, NULL );
12062         if( status ) return errno;
12063
12064         /* give thread a chance to complete */
12065         /* it should remain joinable and hence detachable */
12066         sleep( 1 );
12067
12068         status = pthread_detach( &t );
12069         if( status ) return errno;
12070 #endif
12071
12072 #ifdef HAVE_LINUX_THREADS
12073         pthread_kill_other_threads_np();
12074 #endif
12075
12076         return 0;
12077
12078 }
12079
12080 EOF
12081 if { (eval echo configure:12082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12082 then
12083   ol_cv_pthread_kthread=yes
12084 else
12085   echo "configure: failed program was:" >&5
12086   cat conftest.$ac_ext >&5
12087   rm -fr conftest*
12088   ol_cv_pthread_kthread=no
12089 fi
12090 rm -fr conftest*
12091 fi
12092
12093
12094                 # restore the LIBS
12095                 LIBS="$ol_LIBS"
12096         
12097 fi
12098
12099 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
12100
12101         if test $ol_cv_pthread_kthread = yes ; then
12102                 ol_link_pthreads="-kthread"
12103                 ol_link_threads=posix
12104         fi
12105 fi
12106
12107                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
12108 if test "$ol_link_threads" = no ; then
12109         # try -pthread
12110         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
12111 echo "configure:12112: checking for pthread link with -pthread" >&5
12112 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
12113   echo $ac_n "(cached) $ac_c" 1>&6
12114 else
12115   
12116                 # save the flags
12117                 ol_LIBS="$LIBS"
12118                 LIBS="-pthread $LIBS"
12119
12120                 if test "$cross_compiling" = yes; then
12121   cat > conftest.$ac_ext <<EOF
12122 #line 12123 "configure"
12123 #include "confdefs.h"
12124 /* pthread test headers */
12125 #include <pthread.h>
12126 #if HAVE_PTHREADS < 7
12127 #include <errno.h>
12128 #endif
12129 #ifndef NULL
12130 #define NULL (void*)0
12131 #endif
12132
12133 static void *task(p)
12134         void *p;
12135 {
12136         return (void *) (p == NULL);
12137 }
12138
12139 int main() {
12140
12141         /* pthread test function */
12142 #ifndef PTHREAD_CREATE_DETACHED
12143 #define PTHREAD_CREATE_DETACHED 1
12144 #endif
12145         pthread_t t;
12146         int status;
12147         int detach = PTHREAD_CREATE_DETACHED;
12148
12149 #if HAVE_PTHREADS > 4
12150         /* Final pthreads */
12151         pthread_attr_t attr;
12152
12153         status = pthread_attr_init(&attr);
12154         if( status ) return status;
12155
12156 #if HAVE_PTHREADS < 7
12157         status = pthread_attr_setdetachstate(&attr, &detach);
12158         if( status < 0 ) status = errno;
12159 #else
12160         status = pthread_attr_setdetachstate(&attr, detach);
12161 #endif
12162         if( status ) return status;
12163         status = pthread_create( &t, &attr, task, NULL );
12164 #if HAVE_PTHREADS < 7
12165         if( status < 0 ) status = errno;
12166 #endif
12167         if( status ) return status;
12168 #else
12169         /* Draft 4 pthreads */
12170         status = pthread_create( &t, pthread_attr_default, task, NULL );
12171         if( status ) return errno;
12172
12173         /* give thread a chance to complete */
12174         /* it should remain joinable and hence detachable */
12175         sleep( 1 );
12176
12177         status = pthread_detach( &t );
12178         if( status ) return errno;
12179 #endif
12180
12181 #ifdef HAVE_LINUX_THREADS
12182         pthread_kill_other_threads_np();
12183 #endif
12184
12185         return 0;
12186
12187 ; return 0; }
12188 EOF
12189 if { (eval echo configure:12190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12190   rm -rf conftest*
12191   ol_cv_pthread_pthread=yes
12192 else
12193   echo "configure: failed program was:" >&5
12194   cat conftest.$ac_ext >&5
12195   rm -rf conftest*
12196   ol_cv_pthread_pthread=no
12197 fi
12198 rm -f conftest*
12199 else
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
12219 int main(argc, argv)
12220         int argc;
12221         char **argv;
12222 {
12223
12224         /* pthread test function */
12225 #ifndef PTHREAD_CREATE_DETACHED
12226 #define PTHREAD_CREATE_DETACHED 1
12227 #endif
12228         pthread_t t;
12229         int status;
12230         int detach = PTHREAD_CREATE_DETACHED;
12231
12232 #if HAVE_PTHREADS > 4
12233         /* Final pthreads */
12234         pthread_attr_t attr;
12235
12236         status = pthread_attr_init(&attr);
12237         if( status ) return status;
12238
12239 #if HAVE_PTHREADS < 7
12240         status = pthread_attr_setdetachstate(&attr, &detach);
12241         if( status < 0 ) status = errno;
12242 #else
12243         status = pthread_attr_setdetachstate(&attr, detach);
12244 #endif
12245         if( status ) return status;
12246         status = pthread_create( &t, &attr, task, NULL );
12247 #if HAVE_PTHREADS < 7
12248         if( status < 0 ) status = errno;
12249 #endif
12250         if( status ) return status;
12251 #else
12252         /* Draft 4 pthreads */
12253         status = pthread_create( &t, pthread_attr_default, task, NULL );
12254         if( status ) return errno;
12255
12256         /* give thread a chance to complete */
12257         /* it should remain joinable and hence detachable */
12258         sleep( 1 );
12259
12260         status = pthread_detach( &t );
12261         if( status ) return errno;
12262 #endif
12263
12264 #ifdef HAVE_LINUX_THREADS
12265         pthread_kill_other_threads_np();
12266 #endif
12267
12268         return 0;
12269
12270 }
12271
12272 EOF
12273 if { (eval echo configure:12274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12274 then
12275   ol_cv_pthread_pthread=yes
12276 else
12277   echo "configure: failed program was:" >&5
12278   cat conftest.$ac_ext >&5
12279   rm -fr conftest*
12280   ol_cv_pthread_pthread=no
12281 fi
12282 rm -fr conftest*
12283 fi
12284
12285
12286                 # restore the LIBS
12287                 LIBS="$ol_LIBS"
12288         
12289 fi
12290
12291 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
12292
12293         if test $ol_cv_pthread_pthread = yes ; then
12294                 ol_link_pthreads="-pthread"
12295                 ol_link_threads=posix
12296         fi
12297 fi
12298
12299                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
12300 if test "$ol_link_threads" = no ; then
12301         # try -pthreads
12302         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
12303 echo "configure:12304: checking for pthread link with -pthreads" >&5
12304 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
12305   echo $ac_n "(cached) $ac_c" 1>&6
12306 else
12307   
12308                 # save the flags
12309                 ol_LIBS="$LIBS"
12310                 LIBS="-pthreads $LIBS"
12311
12312                 if test "$cross_compiling" = yes; then
12313   cat > conftest.$ac_ext <<EOF
12314 #line 12315 "configure"
12315 #include "confdefs.h"
12316 /* pthread test headers */
12317 #include <pthread.h>
12318 #if HAVE_PTHREADS < 7
12319 #include <errno.h>
12320 #endif
12321 #ifndef NULL
12322 #define NULL (void*)0
12323 #endif
12324
12325 static void *task(p)
12326         void *p;
12327 {
12328         return (void *) (p == NULL);
12329 }
12330
12331 int main() {
12332
12333         /* pthread test function */
12334 #ifndef PTHREAD_CREATE_DETACHED
12335 #define PTHREAD_CREATE_DETACHED 1
12336 #endif
12337         pthread_t t;
12338         int status;
12339         int detach = PTHREAD_CREATE_DETACHED;
12340
12341 #if HAVE_PTHREADS > 4
12342         /* Final pthreads */
12343         pthread_attr_t attr;
12344
12345         status = pthread_attr_init(&attr);
12346         if( status ) return status;
12347
12348 #if HAVE_PTHREADS < 7
12349         status = pthread_attr_setdetachstate(&attr, &detach);
12350         if( status < 0 ) status = errno;
12351 #else
12352         status = pthread_attr_setdetachstate(&attr, detach);
12353 #endif
12354         if( status ) return status;
12355         status = pthread_create( &t, &attr, task, NULL );
12356 #if HAVE_PTHREADS < 7
12357         if( status < 0 ) status = errno;
12358 #endif
12359         if( status ) return status;
12360 #else
12361         /* Draft 4 pthreads */
12362         status = pthread_create( &t, pthread_attr_default, task, NULL );
12363         if( status ) return errno;
12364
12365         /* give thread a chance to complete */
12366         /* it should remain joinable and hence detachable */
12367         sleep( 1 );
12368
12369         status = pthread_detach( &t );
12370         if( status ) return errno;
12371 #endif
12372
12373 #ifdef HAVE_LINUX_THREADS
12374         pthread_kill_other_threads_np();
12375 #endif
12376
12377         return 0;
12378
12379 ; return 0; }
12380 EOF
12381 if { (eval echo configure:12382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12382   rm -rf conftest*
12383   ol_cv_pthread_pthreads=yes
12384 else
12385   echo "configure: failed program was:" >&5
12386   cat conftest.$ac_ext >&5
12387   rm -rf conftest*
12388   ol_cv_pthread_pthreads=no
12389 fi
12390 rm -f conftest*
12391 else
12392   cat > conftest.$ac_ext <<EOF
12393 #line 12394 "configure"
12394 #include "confdefs.h"
12395 /* pthread test headers */
12396 #include <pthread.h>
12397 #if HAVE_PTHREADS < 7
12398 #include <errno.h>
12399 #endif
12400 #ifndef NULL
12401 #define NULL (void*)0
12402 #endif
12403
12404 static void *task(p)
12405         void *p;
12406 {
12407         return (void *) (p == NULL);
12408 }
12409
12410
12411 int main(argc, argv)
12412         int argc;
12413         char **argv;
12414 {
12415
12416         /* pthread test function */
12417 #ifndef PTHREAD_CREATE_DETACHED
12418 #define PTHREAD_CREATE_DETACHED 1
12419 #endif
12420         pthread_t t;
12421         int status;
12422         int detach = PTHREAD_CREATE_DETACHED;
12423
12424 #if HAVE_PTHREADS > 4
12425         /* Final pthreads */
12426         pthread_attr_t attr;
12427
12428         status = pthread_attr_init(&attr);
12429         if( status ) return status;
12430
12431 #if HAVE_PTHREADS < 7
12432         status = pthread_attr_setdetachstate(&attr, &detach);
12433         if( status < 0 ) status = errno;
12434 #else
12435         status = pthread_attr_setdetachstate(&attr, detach);
12436 #endif
12437         if( status ) return status;
12438         status = pthread_create( &t, &attr, task, NULL );
12439 #if HAVE_PTHREADS < 7
12440         if( status < 0 ) status = errno;
12441 #endif
12442         if( status ) return status;
12443 #else
12444         /* Draft 4 pthreads */
12445         status = pthread_create( &t, pthread_attr_default, task, NULL );
12446         if( status ) return errno;
12447
12448         /* give thread a chance to complete */
12449         /* it should remain joinable and hence detachable */
12450         sleep( 1 );
12451
12452         status = pthread_detach( &t );
12453         if( status ) return errno;
12454 #endif
12455
12456 #ifdef HAVE_LINUX_THREADS
12457         pthread_kill_other_threads_np();
12458 #endif
12459
12460         return 0;
12461
12462 }
12463
12464 EOF
12465 if { (eval echo configure:12466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12466 then
12467   ol_cv_pthread_pthreads=yes
12468 else
12469   echo "configure: failed program was:" >&5
12470   cat conftest.$ac_ext >&5
12471   rm -fr conftest*
12472   ol_cv_pthread_pthreads=no
12473 fi
12474 rm -fr conftest*
12475 fi
12476
12477
12478                 # restore the LIBS
12479                 LIBS="$ol_LIBS"
12480         
12481 fi
12482
12483 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
12484
12485         if test $ol_cv_pthread_pthreads = yes ; then
12486                 ol_link_pthreads="-pthreads"
12487                 ol_link_threads=posix
12488         fi
12489 fi
12490
12491                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
12492 if test "$ol_link_threads" = no ; then
12493         # try -mthreads
12494         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
12495 echo "configure:12496: checking for pthread link with -mthreads" >&5
12496 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
12497   echo $ac_n "(cached) $ac_c" 1>&6
12498 else
12499   
12500                 # save the flags
12501                 ol_LIBS="$LIBS"
12502                 LIBS="-mthreads $LIBS"
12503
12504                 if test "$cross_compiling" = yes; then
12505   cat > conftest.$ac_ext <<EOF
12506 #line 12507 "configure"
12507 #include "confdefs.h"
12508 /* pthread test headers */
12509 #include <pthread.h>
12510 #if HAVE_PTHREADS < 7
12511 #include <errno.h>
12512 #endif
12513 #ifndef NULL
12514 #define NULL (void*)0
12515 #endif
12516
12517 static void *task(p)
12518         void *p;
12519 {
12520         return (void *) (p == NULL);
12521 }
12522
12523 int main() {
12524
12525         /* pthread test function */
12526 #ifndef PTHREAD_CREATE_DETACHED
12527 #define PTHREAD_CREATE_DETACHED 1
12528 #endif
12529         pthread_t t;
12530         int status;
12531         int detach = PTHREAD_CREATE_DETACHED;
12532
12533 #if HAVE_PTHREADS > 4
12534         /* Final pthreads */
12535         pthread_attr_t attr;
12536
12537         status = pthread_attr_init(&attr);
12538         if( status ) return status;
12539
12540 #if HAVE_PTHREADS < 7
12541         status = pthread_attr_setdetachstate(&attr, &detach);
12542         if( status < 0 ) status = errno;
12543 #else
12544         status = pthread_attr_setdetachstate(&attr, detach);
12545 #endif
12546         if( status ) return status;
12547         status = pthread_create( &t, &attr, task, NULL );
12548 #if HAVE_PTHREADS < 7
12549         if( status < 0 ) status = errno;
12550 #endif
12551         if( status ) return status;
12552 #else
12553         /* Draft 4 pthreads */
12554         status = pthread_create( &t, pthread_attr_default, task, NULL );
12555         if( status ) return errno;
12556
12557         /* give thread a chance to complete */
12558         /* it should remain joinable and hence detachable */
12559         sleep( 1 );
12560
12561         status = pthread_detach( &t );
12562         if( status ) return errno;
12563 #endif
12564
12565 #ifdef HAVE_LINUX_THREADS
12566         pthread_kill_other_threads_np();
12567 #endif
12568
12569         return 0;
12570
12571 ; return 0; }
12572 EOF
12573 if { (eval echo configure:12574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12574   rm -rf conftest*
12575   ol_cv_pthread_mthreads=yes
12576 else
12577   echo "configure: failed program was:" >&5
12578   cat conftest.$ac_ext >&5
12579   rm -rf conftest*
12580   ol_cv_pthread_mthreads=no
12581 fi
12582 rm -f conftest*
12583 else
12584   cat > conftest.$ac_ext <<EOF
12585 #line 12586 "configure"
12586 #include "confdefs.h"
12587 /* pthread test headers */
12588 #include <pthread.h>
12589 #if HAVE_PTHREADS < 7
12590 #include <errno.h>
12591 #endif
12592 #ifndef NULL
12593 #define NULL (void*)0
12594 #endif
12595
12596 static void *task(p)
12597         void *p;
12598 {
12599         return (void *) (p == NULL);
12600 }
12601
12602
12603 int main(argc, argv)
12604         int argc;
12605         char **argv;
12606 {
12607
12608         /* pthread test function */
12609 #ifndef PTHREAD_CREATE_DETACHED
12610 #define PTHREAD_CREATE_DETACHED 1
12611 #endif
12612         pthread_t t;
12613         int status;
12614         int detach = PTHREAD_CREATE_DETACHED;
12615
12616 #if HAVE_PTHREADS > 4
12617         /* Final pthreads */
12618         pthread_attr_t attr;
12619
12620         status = pthread_attr_init(&attr);
12621         if( status ) return status;
12622
12623 #if HAVE_PTHREADS < 7
12624         status = pthread_attr_setdetachstate(&attr, &detach);
12625         if( status < 0 ) status = errno;
12626 #else
12627         status = pthread_attr_setdetachstate(&attr, detach);
12628 #endif
12629         if( status ) return status;
12630         status = pthread_create( &t, &attr, task, NULL );
12631 #if HAVE_PTHREADS < 7
12632         if( status < 0 ) status = errno;
12633 #endif
12634         if( status ) return status;
12635 #else
12636         /* Draft 4 pthreads */
12637         status = pthread_create( &t, pthread_attr_default, task, NULL );
12638         if( status ) return errno;
12639
12640         /* give thread a chance to complete */
12641         /* it should remain joinable and hence detachable */
12642         sleep( 1 );
12643
12644         status = pthread_detach( &t );
12645         if( status ) return errno;
12646 #endif
12647
12648 #ifdef HAVE_LINUX_THREADS
12649         pthread_kill_other_threads_np();
12650 #endif
12651
12652         return 0;
12653
12654 }
12655
12656 EOF
12657 if { (eval echo configure:12658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12658 then
12659   ol_cv_pthread_mthreads=yes
12660 else
12661   echo "configure: failed program was:" >&5
12662   cat conftest.$ac_ext >&5
12663   rm -fr conftest*
12664   ol_cv_pthread_mthreads=no
12665 fi
12666 rm -fr conftest*
12667 fi
12668
12669
12670                 # restore the LIBS
12671                 LIBS="$ol_LIBS"
12672         
12673 fi
12674
12675 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
12676
12677         if test $ol_cv_pthread_mthreads = yes ; then
12678                 ol_link_pthreads="-mthreads"
12679                 ol_link_threads=posix
12680         fi
12681 fi
12682
12683                 # Pthread try link: -thread (ol_cv_pthread_thread)
12684 if test "$ol_link_threads" = no ; then
12685         # try -thread
12686         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
12687 echo "configure:12688: checking for pthread link with -thread" >&5
12688 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
12689   echo $ac_n "(cached) $ac_c" 1>&6
12690 else
12691   
12692                 # save the flags
12693                 ol_LIBS="$LIBS"
12694                 LIBS="-thread $LIBS"
12695
12696                 if test "$cross_compiling" = yes; then
12697   cat > conftest.$ac_ext <<EOF
12698 #line 12699 "configure"
12699 #include "confdefs.h"
12700 /* pthread test headers */
12701 #include <pthread.h>
12702 #if HAVE_PTHREADS < 7
12703 #include <errno.h>
12704 #endif
12705 #ifndef NULL
12706 #define NULL (void*)0
12707 #endif
12708
12709 static void *task(p)
12710         void *p;
12711 {
12712         return (void *) (p == NULL);
12713 }
12714
12715 int main() {
12716
12717         /* pthread test function */
12718 #ifndef PTHREAD_CREATE_DETACHED
12719 #define PTHREAD_CREATE_DETACHED 1
12720 #endif
12721         pthread_t t;
12722         int status;
12723         int detach = PTHREAD_CREATE_DETACHED;
12724
12725 #if HAVE_PTHREADS > 4
12726         /* Final pthreads */
12727         pthread_attr_t attr;
12728
12729         status = pthread_attr_init(&attr);
12730         if( status ) return status;
12731
12732 #if HAVE_PTHREADS < 7
12733         status = pthread_attr_setdetachstate(&attr, &detach);
12734         if( status < 0 ) status = errno;
12735 #else
12736         status = pthread_attr_setdetachstate(&attr, detach);
12737 #endif
12738         if( status ) return status;
12739         status = pthread_create( &t, &attr, task, NULL );
12740 #if HAVE_PTHREADS < 7
12741         if( status < 0 ) status = errno;
12742 #endif
12743         if( status ) return status;
12744 #else
12745         /* Draft 4 pthreads */
12746         status = pthread_create( &t, pthread_attr_default, task, NULL );
12747         if( status ) return errno;
12748
12749         /* give thread a chance to complete */
12750         /* it should remain joinable and hence detachable */
12751         sleep( 1 );
12752
12753         status = pthread_detach( &t );
12754         if( status ) return errno;
12755 #endif
12756
12757 #ifdef HAVE_LINUX_THREADS
12758         pthread_kill_other_threads_np();
12759 #endif
12760
12761         return 0;
12762
12763 ; return 0; }
12764 EOF
12765 if { (eval echo configure:12766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12766   rm -rf conftest*
12767   ol_cv_pthread_thread=yes
12768 else
12769   echo "configure: failed program was:" >&5
12770   cat conftest.$ac_ext >&5
12771   rm -rf conftest*
12772   ol_cv_pthread_thread=no
12773 fi
12774 rm -f conftest*
12775 else
12776   cat > conftest.$ac_ext <<EOF
12777 #line 12778 "configure"
12778 #include "confdefs.h"
12779 /* pthread test headers */
12780 #include <pthread.h>
12781 #if HAVE_PTHREADS < 7
12782 #include <errno.h>
12783 #endif
12784 #ifndef NULL
12785 #define NULL (void*)0
12786 #endif
12787
12788 static void *task(p)
12789         void *p;
12790 {
12791         return (void *) (p == NULL);
12792 }
12793
12794
12795 int main(argc, argv)
12796         int argc;
12797         char **argv;
12798 {
12799
12800         /* pthread test function */
12801 #ifndef PTHREAD_CREATE_DETACHED
12802 #define PTHREAD_CREATE_DETACHED 1
12803 #endif
12804         pthread_t t;
12805         int status;
12806         int detach = PTHREAD_CREATE_DETACHED;
12807
12808 #if HAVE_PTHREADS > 4
12809         /* Final pthreads */
12810         pthread_attr_t attr;
12811
12812         status = pthread_attr_init(&attr);
12813         if( status ) return status;
12814
12815 #if HAVE_PTHREADS < 7
12816         status = pthread_attr_setdetachstate(&attr, &detach);
12817         if( status < 0 ) status = errno;
12818 #else
12819         status = pthread_attr_setdetachstate(&attr, detach);
12820 #endif
12821         if( status ) return status;
12822         status = pthread_create( &t, &attr, task, NULL );
12823 #if HAVE_PTHREADS < 7
12824         if( status < 0 ) status = errno;
12825 #endif
12826         if( status ) return status;
12827 #else
12828         /* Draft 4 pthreads */
12829         status = pthread_create( &t, pthread_attr_default, task, NULL );
12830         if( status ) return errno;
12831
12832         /* give thread a chance to complete */
12833         /* it should remain joinable and hence detachable */
12834         sleep( 1 );
12835
12836         status = pthread_detach( &t );
12837         if( status ) return errno;
12838 #endif
12839
12840 #ifdef HAVE_LINUX_THREADS
12841         pthread_kill_other_threads_np();
12842 #endif
12843
12844         return 0;
12845
12846 }
12847
12848 EOF
12849 if { (eval echo configure:12850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12850 then
12851   ol_cv_pthread_thread=yes
12852 else
12853   echo "configure: failed program was:" >&5
12854   cat conftest.$ac_ext >&5
12855   rm -fr conftest*
12856   ol_cv_pthread_thread=no
12857 fi
12858 rm -fr conftest*
12859 fi
12860
12861
12862                 # restore the LIBS
12863                 LIBS="$ol_LIBS"
12864         
12865 fi
12866
12867 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
12868
12869         if test $ol_cv_pthread_thread = yes ; then
12870                 ol_link_pthreads="-thread"
12871                 ol_link_threads=posix
12872         fi
12873 fi
12874
12875
12876                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
12877 if test "$ol_link_threads" = no ; then
12878         # try -lpthread -lmach -lexc -lc_r
12879         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
12880 echo "configure:12881: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
12881 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
12882   echo $ac_n "(cached) $ac_c" 1>&6
12883 else
12884   
12885                 # save the flags
12886                 ol_LIBS="$LIBS"
12887                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
12888
12889                 if test "$cross_compiling" = yes; then
12890   cat > conftest.$ac_ext <<EOF
12891 #line 12892 "configure"
12892 #include "confdefs.h"
12893 /* pthread test headers */
12894 #include <pthread.h>
12895 #if HAVE_PTHREADS < 7
12896 #include <errno.h>
12897 #endif
12898 #ifndef NULL
12899 #define NULL (void*)0
12900 #endif
12901
12902 static void *task(p)
12903         void *p;
12904 {
12905         return (void *) (p == NULL);
12906 }
12907
12908 int main() {
12909
12910         /* pthread test function */
12911 #ifndef PTHREAD_CREATE_DETACHED
12912 #define PTHREAD_CREATE_DETACHED 1
12913 #endif
12914         pthread_t t;
12915         int status;
12916         int detach = PTHREAD_CREATE_DETACHED;
12917
12918 #if HAVE_PTHREADS > 4
12919         /* Final pthreads */
12920         pthread_attr_t attr;
12921
12922         status = pthread_attr_init(&attr);
12923         if( status ) return status;
12924
12925 #if HAVE_PTHREADS < 7
12926         status = pthread_attr_setdetachstate(&attr, &detach);
12927         if( status < 0 ) status = errno;
12928 #else
12929         status = pthread_attr_setdetachstate(&attr, detach);
12930 #endif
12931         if( status ) return status;
12932         status = pthread_create( &t, &attr, task, NULL );
12933 #if HAVE_PTHREADS < 7
12934         if( status < 0 ) status = errno;
12935 #endif
12936         if( status ) return status;
12937 #else
12938         /* Draft 4 pthreads */
12939         status = pthread_create( &t, pthread_attr_default, task, NULL );
12940         if( status ) return errno;
12941
12942         /* give thread a chance to complete */
12943         /* it should remain joinable and hence detachable */
12944         sleep( 1 );
12945
12946         status = pthread_detach( &t );
12947         if( status ) return errno;
12948 #endif
12949
12950 #ifdef HAVE_LINUX_THREADS
12951         pthread_kill_other_threads_np();
12952 #endif
12953
12954         return 0;
12955
12956 ; return 0; }
12957 EOF
12958 if { (eval echo configure:12959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12959   rm -rf conftest*
12960   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
12961 else
12962   echo "configure: failed program was:" >&5
12963   cat conftest.$ac_ext >&5
12964   rm -rf conftest*
12965   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
12966 fi
12967 rm -f conftest*
12968 else
12969   cat > conftest.$ac_ext <<EOF
12970 #line 12971 "configure"
12971 #include "confdefs.h"
12972 /* pthread test headers */
12973 #include <pthread.h>
12974 #if HAVE_PTHREADS < 7
12975 #include <errno.h>
12976 #endif
12977 #ifndef NULL
12978 #define NULL (void*)0
12979 #endif
12980
12981 static void *task(p)
12982         void *p;
12983 {
12984         return (void *) (p == NULL);
12985 }
12986
12987
12988 int main(argc, argv)
12989         int argc;
12990         char **argv;
12991 {
12992
12993         /* pthread test function */
12994 #ifndef PTHREAD_CREATE_DETACHED
12995 #define PTHREAD_CREATE_DETACHED 1
12996 #endif
12997         pthread_t t;
12998         int status;
12999         int detach = PTHREAD_CREATE_DETACHED;
13000
13001 #if HAVE_PTHREADS > 4
13002         /* Final pthreads */
13003         pthread_attr_t attr;
13004
13005         status = pthread_attr_init(&attr);
13006         if( status ) return status;
13007
13008 #if HAVE_PTHREADS < 7
13009         status = pthread_attr_setdetachstate(&attr, &detach);
13010         if( status < 0 ) status = errno;
13011 #else
13012         status = pthread_attr_setdetachstate(&attr, detach);
13013 #endif
13014         if( status ) return status;
13015         status = pthread_create( &t, &attr, task, NULL );
13016 #if HAVE_PTHREADS < 7
13017         if( status < 0 ) status = errno;
13018 #endif
13019         if( status ) return status;
13020 #else
13021         /* Draft 4 pthreads */
13022         status = pthread_create( &t, pthread_attr_default, task, NULL );
13023         if( status ) return errno;
13024
13025         /* give thread a chance to complete */
13026         /* it should remain joinable and hence detachable */
13027         sleep( 1 );
13028
13029         status = pthread_detach( &t );
13030         if( status ) return errno;
13031 #endif
13032
13033 #ifdef HAVE_LINUX_THREADS
13034         pthread_kill_other_threads_np();
13035 #endif
13036
13037         return 0;
13038
13039 }
13040
13041 EOF
13042 if { (eval echo configure:13043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13043 then
13044   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
13045 else
13046   echo "configure: failed program was:" >&5
13047   cat conftest.$ac_ext >&5
13048   rm -fr conftest*
13049   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
13050 fi
13051 rm -fr conftest*
13052 fi
13053
13054
13055                 # restore the LIBS
13056                 LIBS="$ol_LIBS"
13057         
13058 fi
13059
13060 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
13061
13062         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
13063                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
13064                 ol_link_threads=posix
13065         fi
13066 fi
13067
13068                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
13069 if test "$ol_link_threads" = no ; then
13070         # try -lpthread -lmach -lexc
13071         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
13072 echo "configure:13073: checking for pthread link with -lpthread -lmach -lexc" >&5
13073 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
13074   echo $ac_n "(cached) $ac_c" 1>&6
13075 else
13076   
13077                 # save the flags
13078                 ol_LIBS="$LIBS"
13079                 LIBS="-lpthread -lmach -lexc $LIBS"
13080
13081                 if test "$cross_compiling" = yes; then
13082   cat > conftest.$ac_ext <<EOF
13083 #line 13084 "configure"
13084 #include "confdefs.h"
13085 /* pthread test headers */
13086 #include <pthread.h>
13087 #if HAVE_PTHREADS < 7
13088 #include <errno.h>
13089 #endif
13090 #ifndef NULL
13091 #define NULL (void*)0
13092 #endif
13093
13094 static void *task(p)
13095         void *p;
13096 {
13097         return (void *) (p == NULL);
13098 }
13099
13100 int main() {
13101
13102         /* pthread test function */
13103 #ifndef PTHREAD_CREATE_DETACHED
13104 #define PTHREAD_CREATE_DETACHED 1
13105 #endif
13106         pthread_t t;
13107         int status;
13108         int detach = PTHREAD_CREATE_DETACHED;
13109
13110 #if HAVE_PTHREADS > 4
13111         /* Final pthreads */
13112         pthread_attr_t attr;
13113
13114         status = pthread_attr_init(&attr);
13115         if( status ) return status;
13116
13117 #if HAVE_PTHREADS < 7
13118         status = pthread_attr_setdetachstate(&attr, &detach);
13119         if( status < 0 ) status = errno;
13120 #else
13121         status = pthread_attr_setdetachstate(&attr, detach);
13122 #endif
13123         if( status ) return status;
13124         status = pthread_create( &t, &attr, task, NULL );
13125 #if HAVE_PTHREADS < 7
13126         if( status < 0 ) status = errno;
13127 #endif
13128         if( status ) return status;
13129 #else
13130         /* Draft 4 pthreads */
13131         status = pthread_create( &t, pthread_attr_default, task, NULL );
13132         if( status ) return errno;
13133
13134         /* give thread a chance to complete */
13135         /* it should remain joinable and hence detachable */
13136         sleep( 1 );
13137
13138         status = pthread_detach( &t );
13139         if( status ) return errno;
13140 #endif
13141
13142 #ifdef HAVE_LINUX_THREADS
13143         pthread_kill_other_threads_np();
13144 #endif
13145
13146         return 0;
13147
13148 ; return 0; }
13149 EOF
13150 if { (eval echo configure:13151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13151   rm -rf conftest*
13152   ol_cv_pthread_lpthread_lmach_lexc=yes
13153 else
13154   echo "configure: failed program was:" >&5
13155   cat conftest.$ac_ext >&5
13156   rm -rf conftest*
13157   ol_cv_pthread_lpthread_lmach_lexc=no
13158 fi
13159 rm -f conftest*
13160 else
13161   cat > conftest.$ac_ext <<EOF
13162 #line 13163 "configure"
13163 #include "confdefs.h"
13164 /* pthread test headers */
13165 #include <pthread.h>
13166 #if HAVE_PTHREADS < 7
13167 #include <errno.h>
13168 #endif
13169 #ifndef NULL
13170 #define NULL (void*)0
13171 #endif
13172
13173 static void *task(p)
13174         void *p;
13175 {
13176         return (void *) (p == NULL);
13177 }
13178
13179
13180 int main(argc, argv)
13181         int argc;
13182         char **argv;
13183 {
13184
13185         /* pthread test function */
13186 #ifndef PTHREAD_CREATE_DETACHED
13187 #define PTHREAD_CREATE_DETACHED 1
13188 #endif
13189         pthread_t t;
13190         int status;
13191         int detach = PTHREAD_CREATE_DETACHED;
13192
13193 #if HAVE_PTHREADS > 4
13194         /* Final pthreads */
13195         pthread_attr_t attr;
13196
13197         status = pthread_attr_init(&attr);
13198         if( status ) return status;
13199
13200 #if HAVE_PTHREADS < 7
13201         status = pthread_attr_setdetachstate(&attr, &detach);
13202         if( status < 0 ) status = errno;
13203 #else
13204         status = pthread_attr_setdetachstate(&attr, detach);
13205 #endif
13206         if( status ) return status;
13207         status = pthread_create( &t, &attr, task, NULL );
13208 #if HAVE_PTHREADS < 7
13209         if( status < 0 ) status = errno;
13210 #endif
13211         if( status ) return status;
13212 #else
13213         /* Draft 4 pthreads */
13214         status = pthread_create( &t, pthread_attr_default, task, NULL );
13215         if( status ) return errno;
13216
13217         /* give thread a chance to complete */
13218         /* it should remain joinable and hence detachable */
13219         sleep( 1 );
13220
13221         status = pthread_detach( &t );
13222         if( status ) return errno;
13223 #endif
13224
13225 #ifdef HAVE_LINUX_THREADS
13226         pthread_kill_other_threads_np();
13227 #endif
13228
13229         return 0;
13230
13231 }
13232
13233 EOF
13234 if { (eval echo configure:13235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13235 then
13236   ol_cv_pthread_lpthread_lmach_lexc=yes
13237 else
13238   echo "configure: failed program was:" >&5
13239   cat conftest.$ac_ext >&5
13240   rm -fr conftest*
13241   ol_cv_pthread_lpthread_lmach_lexc=no
13242 fi
13243 rm -fr conftest*
13244 fi
13245
13246
13247                 # restore the LIBS
13248                 LIBS="$ol_LIBS"
13249         
13250 fi
13251
13252 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
13253
13254         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
13255                 ol_link_pthreads="-lpthread -lmach -lexc"
13256                 ol_link_threads=posix
13257         fi
13258 fi
13259
13260
13261                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
13262 if test "$ol_link_threads" = no ; then
13263         # try -lpthread -Wl,-woff,85
13264         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
13265 echo "configure:13266: checking for pthread link with -lpthread -Wl,-woff,85" >&5
13266 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
13267   echo $ac_n "(cached) $ac_c" 1>&6
13268 else
13269   
13270                 # save the flags
13271                 ol_LIBS="$LIBS"
13272                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
13273
13274                 if test "$cross_compiling" = yes; then
13275   cat > conftest.$ac_ext <<EOF
13276 #line 13277 "configure"
13277 #include "confdefs.h"
13278 /* pthread test headers */
13279 #include <pthread.h>
13280 #if HAVE_PTHREADS < 7
13281 #include <errno.h>
13282 #endif
13283 #ifndef NULL
13284 #define NULL (void*)0
13285 #endif
13286
13287 static void *task(p)
13288         void *p;
13289 {
13290         return (void *) (p == NULL);
13291 }
13292
13293 int main() {
13294
13295         /* pthread test function */
13296 #ifndef PTHREAD_CREATE_DETACHED
13297 #define PTHREAD_CREATE_DETACHED 1
13298 #endif
13299         pthread_t t;
13300         int status;
13301         int detach = PTHREAD_CREATE_DETACHED;
13302
13303 #if HAVE_PTHREADS > 4
13304         /* Final pthreads */
13305         pthread_attr_t attr;
13306
13307         status = pthread_attr_init(&attr);
13308         if( status ) return status;
13309
13310 #if HAVE_PTHREADS < 7
13311         status = pthread_attr_setdetachstate(&attr, &detach);
13312         if( status < 0 ) status = errno;
13313 #else
13314         status = pthread_attr_setdetachstate(&attr, detach);
13315 #endif
13316         if( status ) return status;
13317         status = pthread_create( &t, &attr, task, NULL );
13318 #if HAVE_PTHREADS < 7
13319         if( status < 0 ) status = errno;
13320 #endif
13321         if( status ) return status;
13322 #else
13323         /* Draft 4 pthreads */
13324         status = pthread_create( &t, pthread_attr_default, task, NULL );
13325         if( status ) return errno;
13326
13327         /* give thread a chance to complete */
13328         /* it should remain joinable and hence detachable */
13329         sleep( 1 );
13330
13331         status = pthread_detach( &t );
13332         if( status ) return errno;
13333 #endif
13334
13335 #ifdef HAVE_LINUX_THREADS
13336         pthread_kill_other_threads_np();
13337 #endif
13338
13339         return 0;
13340
13341 ; return 0; }
13342 EOF
13343 if { (eval echo configure:13344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13344   rm -rf conftest*
13345   ol_cv_pthread_lib_lpthread_woff=yes
13346 else
13347   echo "configure: failed program was:" >&5
13348   cat conftest.$ac_ext >&5
13349   rm -rf conftest*
13350   ol_cv_pthread_lib_lpthread_woff=no
13351 fi
13352 rm -f conftest*
13353 else
13354   cat > conftest.$ac_ext <<EOF
13355 #line 13356 "configure"
13356 #include "confdefs.h"
13357 /* pthread test headers */
13358 #include <pthread.h>
13359 #if HAVE_PTHREADS < 7
13360 #include <errno.h>
13361 #endif
13362 #ifndef NULL
13363 #define NULL (void*)0
13364 #endif
13365
13366 static void *task(p)
13367         void *p;
13368 {
13369         return (void *) (p == NULL);
13370 }
13371
13372
13373 int main(argc, argv)
13374         int argc;
13375         char **argv;
13376 {
13377
13378         /* pthread test function */
13379 #ifndef PTHREAD_CREATE_DETACHED
13380 #define PTHREAD_CREATE_DETACHED 1
13381 #endif
13382         pthread_t t;
13383         int status;
13384         int detach = PTHREAD_CREATE_DETACHED;
13385
13386 #if HAVE_PTHREADS > 4
13387         /* Final pthreads */
13388         pthread_attr_t attr;
13389
13390         status = pthread_attr_init(&attr);
13391         if( status ) return status;
13392
13393 #if HAVE_PTHREADS < 7
13394         status = pthread_attr_setdetachstate(&attr, &detach);
13395         if( status < 0 ) status = errno;
13396 #else
13397         status = pthread_attr_setdetachstate(&attr, detach);
13398 #endif
13399         if( status ) return status;
13400         status = pthread_create( &t, &attr, task, NULL );
13401 #if HAVE_PTHREADS < 7
13402         if( status < 0 ) status = errno;
13403 #endif
13404         if( status ) return status;
13405 #else
13406         /* Draft 4 pthreads */
13407         status = pthread_create( &t, pthread_attr_default, task, NULL );
13408         if( status ) return errno;
13409
13410         /* give thread a chance to complete */
13411         /* it should remain joinable and hence detachable */
13412         sleep( 1 );
13413
13414         status = pthread_detach( &t );
13415         if( status ) return errno;
13416 #endif
13417
13418 #ifdef HAVE_LINUX_THREADS
13419         pthread_kill_other_threads_np();
13420 #endif
13421
13422         return 0;
13423
13424 }
13425
13426 EOF
13427 if { (eval echo configure:13428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13428 then
13429   ol_cv_pthread_lib_lpthread_woff=yes
13430 else
13431   echo "configure: failed program was:" >&5
13432   cat conftest.$ac_ext >&5
13433   rm -fr conftest*
13434   ol_cv_pthread_lib_lpthread_woff=no
13435 fi
13436 rm -fr conftest*
13437 fi
13438
13439
13440                 # restore the LIBS
13441                 LIBS="$ol_LIBS"
13442         
13443 fi
13444
13445 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
13446
13447         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
13448                 ol_link_pthreads="-lpthread -Wl,-woff,85"
13449                 ol_link_threads=posix
13450         fi
13451 fi
13452
13453
13454                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
13455 if test "$ol_link_threads" = no ; then
13456         # try -lpthread
13457         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
13458 echo "configure:13459: checking for pthread link with -lpthread" >&5
13459 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
13460   echo $ac_n "(cached) $ac_c" 1>&6
13461 else
13462   
13463                 # save the flags
13464                 ol_LIBS="$LIBS"
13465                 LIBS="-lpthread $LIBS"
13466
13467                 if test "$cross_compiling" = yes; then
13468   cat > conftest.$ac_ext <<EOF
13469 #line 13470 "configure"
13470 #include "confdefs.h"
13471 /* pthread test headers */
13472 #include <pthread.h>
13473 #if HAVE_PTHREADS < 7
13474 #include <errno.h>
13475 #endif
13476 #ifndef NULL
13477 #define NULL (void*)0
13478 #endif
13479
13480 static void *task(p)
13481         void *p;
13482 {
13483         return (void *) (p == NULL);
13484 }
13485
13486 int main() {
13487
13488         /* pthread test function */
13489 #ifndef PTHREAD_CREATE_DETACHED
13490 #define PTHREAD_CREATE_DETACHED 1
13491 #endif
13492         pthread_t t;
13493         int status;
13494         int detach = PTHREAD_CREATE_DETACHED;
13495
13496 #if HAVE_PTHREADS > 4
13497         /* Final pthreads */
13498         pthread_attr_t attr;
13499
13500         status = pthread_attr_init(&attr);
13501         if( status ) return status;
13502
13503 #if HAVE_PTHREADS < 7
13504         status = pthread_attr_setdetachstate(&attr, &detach);
13505         if( status < 0 ) status = errno;
13506 #else
13507         status = pthread_attr_setdetachstate(&attr, detach);
13508 #endif
13509         if( status ) return status;
13510         status = pthread_create( &t, &attr, task, NULL );
13511 #if HAVE_PTHREADS < 7
13512         if( status < 0 ) status = errno;
13513 #endif
13514         if( status ) return status;
13515 #else
13516         /* Draft 4 pthreads */
13517         status = pthread_create( &t, pthread_attr_default, task, NULL );
13518         if( status ) return errno;
13519
13520         /* give thread a chance to complete */
13521         /* it should remain joinable and hence detachable */
13522         sleep( 1 );
13523
13524         status = pthread_detach( &t );
13525         if( status ) return errno;
13526 #endif
13527
13528 #ifdef HAVE_LINUX_THREADS
13529         pthread_kill_other_threads_np();
13530 #endif
13531
13532         return 0;
13533
13534 ; return 0; }
13535 EOF
13536 if { (eval echo configure:13537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13537   rm -rf conftest*
13538   ol_cv_pthread_lpthread=yes
13539 else
13540   echo "configure: failed program was:" >&5
13541   cat conftest.$ac_ext >&5
13542   rm -rf conftest*
13543   ol_cv_pthread_lpthread=no
13544 fi
13545 rm -f conftest*
13546 else
13547   cat > conftest.$ac_ext <<EOF
13548 #line 13549 "configure"
13549 #include "confdefs.h"
13550 /* pthread test headers */
13551 #include <pthread.h>
13552 #if HAVE_PTHREADS < 7
13553 #include <errno.h>
13554 #endif
13555 #ifndef NULL
13556 #define NULL (void*)0
13557 #endif
13558
13559 static void *task(p)
13560         void *p;
13561 {
13562         return (void *) (p == NULL);
13563 }
13564
13565
13566 int main(argc, argv)
13567         int argc;
13568         char **argv;
13569 {
13570
13571         /* pthread test function */
13572 #ifndef PTHREAD_CREATE_DETACHED
13573 #define PTHREAD_CREATE_DETACHED 1
13574 #endif
13575         pthread_t t;
13576         int status;
13577         int detach = PTHREAD_CREATE_DETACHED;
13578
13579 #if HAVE_PTHREADS > 4
13580         /* Final pthreads */
13581         pthread_attr_t attr;
13582
13583         status = pthread_attr_init(&attr);
13584         if( status ) return status;
13585
13586 #if HAVE_PTHREADS < 7
13587         status = pthread_attr_setdetachstate(&attr, &detach);
13588         if( status < 0 ) status = errno;
13589 #else
13590         status = pthread_attr_setdetachstate(&attr, detach);
13591 #endif
13592         if( status ) return status;
13593         status = pthread_create( &t, &attr, task, NULL );
13594 #if HAVE_PTHREADS < 7
13595         if( status < 0 ) status = errno;
13596 #endif
13597         if( status ) return status;
13598 #else
13599         /* Draft 4 pthreads */
13600         status = pthread_create( &t, pthread_attr_default, task, NULL );
13601         if( status ) return errno;
13602
13603         /* give thread a chance to complete */
13604         /* it should remain joinable and hence detachable */
13605         sleep( 1 );
13606
13607         status = pthread_detach( &t );
13608         if( status ) return errno;
13609 #endif
13610
13611 #ifdef HAVE_LINUX_THREADS
13612         pthread_kill_other_threads_np();
13613 #endif
13614
13615         return 0;
13616
13617 }
13618
13619 EOF
13620 if { (eval echo configure:13621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13621 then
13622   ol_cv_pthread_lpthread=yes
13623 else
13624   echo "configure: failed program was:" >&5
13625   cat conftest.$ac_ext >&5
13626   rm -fr conftest*
13627   ol_cv_pthread_lpthread=no
13628 fi
13629 rm -fr conftest*
13630 fi
13631
13632
13633                 # restore the LIBS
13634                 LIBS="$ol_LIBS"
13635         
13636 fi
13637
13638 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
13639
13640         if test $ol_cv_pthread_lpthread = yes ; then
13641                 ol_link_pthreads="-lpthread"
13642                 ol_link_threads=posix
13643         fi
13644 fi
13645
13646                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
13647 if test "$ol_link_threads" = no ; then
13648         # try -lc_r
13649         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
13650 echo "configure:13651: checking for pthread link with -lc_r" >&5
13651 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
13652   echo $ac_n "(cached) $ac_c" 1>&6
13653 else
13654   
13655                 # save the flags
13656                 ol_LIBS="$LIBS"
13657                 LIBS="-lc_r $LIBS"
13658
13659                 if test "$cross_compiling" = yes; then
13660   cat > conftest.$ac_ext <<EOF
13661 #line 13662 "configure"
13662 #include "confdefs.h"
13663 /* pthread test headers */
13664 #include <pthread.h>
13665 #if HAVE_PTHREADS < 7
13666 #include <errno.h>
13667 #endif
13668 #ifndef NULL
13669 #define NULL (void*)0
13670 #endif
13671
13672 static void *task(p)
13673         void *p;
13674 {
13675         return (void *) (p == NULL);
13676 }
13677
13678 int main() {
13679
13680         /* pthread test function */
13681 #ifndef PTHREAD_CREATE_DETACHED
13682 #define PTHREAD_CREATE_DETACHED 1
13683 #endif
13684         pthread_t t;
13685         int status;
13686         int detach = PTHREAD_CREATE_DETACHED;
13687
13688 #if HAVE_PTHREADS > 4
13689         /* Final pthreads */
13690         pthread_attr_t attr;
13691
13692         status = pthread_attr_init(&attr);
13693         if( status ) return status;
13694
13695 #if HAVE_PTHREADS < 7
13696         status = pthread_attr_setdetachstate(&attr, &detach);
13697         if( status < 0 ) status = errno;
13698 #else
13699         status = pthread_attr_setdetachstate(&attr, detach);
13700 #endif
13701         if( status ) return status;
13702         status = pthread_create( &t, &attr, task, NULL );
13703 #if HAVE_PTHREADS < 7
13704         if( status < 0 ) status = errno;
13705 #endif
13706         if( status ) return status;
13707 #else
13708         /* Draft 4 pthreads */
13709         status = pthread_create( &t, pthread_attr_default, task, NULL );
13710         if( status ) return errno;
13711
13712         /* give thread a chance to complete */
13713         /* it should remain joinable and hence detachable */
13714         sleep( 1 );
13715
13716         status = pthread_detach( &t );
13717         if( status ) return errno;
13718 #endif
13719
13720 #ifdef HAVE_LINUX_THREADS
13721         pthread_kill_other_threads_np();
13722 #endif
13723
13724         return 0;
13725
13726 ; return 0; }
13727 EOF
13728 if { (eval echo configure:13729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13729   rm -rf conftest*
13730   ol_cv_pthread_lc_r=yes
13731 else
13732   echo "configure: failed program was:" >&5
13733   cat conftest.$ac_ext >&5
13734   rm -rf conftest*
13735   ol_cv_pthread_lc_r=no
13736 fi
13737 rm -f conftest*
13738 else
13739   cat > conftest.$ac_ext <<EOF
13740 #line 13741 "configure"
13741 #include "confdefs.h"
13742 /* pthread test headers */
13743 #include <pthread.h>
13744 #if HAVE_PTHREADS < 7
13745 #include <errno.h>
13746 #endif
13747 #ifndef NULL
13748 #define NULL (void*)0
13749 #endif
13750
13751 static void *task(p)
13752         void *p;
13753 {
13754         return (void *) (p == NULL);
13755 }
13756
13757
13758 int main(argc, argv)
13759         int argc;
13760         char **argv;
13761 {
13762
13763         /* pthread test function */
13764 #ifndef PTHREAD_CREATE_DETACHED
13765 #define PTHREAD_CREATE_DETACHED 1
13766 #endif
13767         pthread_t t;
13768         int status;
13769         int detach = PTHREAD_CREATE_DETACHED;
13770
13771 #if HAVE_PTHREADS > 4
13772         /* Final pthreads */
13773         pthread_attr_t attr;
13774
13775         status = pthread_attr_init(&attr);
13776         if( status ) return status;
13777
13778 #if HAVE_PTHREADS < 7
13779         status = pthread_attr_setdetachstate(&attr, &detach);
13780         if( status < 0 ) status = errno;
13781 #else
13782         status = pthread_attr_setdetachstate(&attr, detach);
13783 #endif
13784         if( status ) return status;
13785         status = pthread_create( &t, &attr, task, NULL );
13786 #if HAVE_PTHREADS < 7
13787         if( status < 0 ) status = errno;
13788 #endif
13789         if( status ) return status;
13790 #else
13791         /* Draft 4 pthreads */
13792         status = pthread_create( &t, pthread_attr_default, task, NULL );
13793         if( status ) return errno;
13794
13795         /* give thread a chance to complete */
13796         /* it should remain joinable and hence detachable */
13797         sleep( 1 );
13798
13799         status = pthread_detach( &t );
13800         if( status ) return errno;
13801 #endif
13802
13803 #ifdef HAVE_LINUX_THREADS
13804         pthread_kill_other_threads_np();
13805 #endif
13806
13807         return 0;
13808
13809 }
13810
13811 EOF
13812 if { (eval echo configure:13813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13813 then
13814   ol_cv_pthread_lc_r=yes
13815 else
13816   echo "configure: failed program was:" >&5
13817   cat conftest.$ac_ext >&5
13818   rm -fr conftest*
13819   ol_cv_pthread_lc_r=no
13820 fi
13821 rm -fr conftest*
13822 fi
13823
13824
13825                 # restore the LIBS
13826                 LIBS="$ol_LIBS"
13827         
13828 fi
13829
13830 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
13831
13832         if test $ol_cv_pthread_lc_r = yes ; then
13833                 ol_link_pthreads="-lc_r"
13834                 ol_link_threads=posix
13835         fi
13836 fi
13837
13838
13839                 # Pthread try link: -threads (ol_cv_pthread_threads)
13840 if test "$ol_link_threads" = no ; then
13841         # try -threads
13842         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
13843 echo "configure:13844: checking for pthread link with -threads" >&5
13844 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
13845   echo $ac_n "(cached) $ac_c" 1>&6
13846 else
13847   
13848                 # save the flags
13849                 ol_LIBS="$LIBS"
13850                 LIBS="-threads $LIBS"
13851
13852                 if test "$cross_compiling" = yes; then
13853   cat > conftest.$ac_ext <<EOF
13854 #line 13855 "configure"
13855 #include "confdefs.h"
13856 /* pthread test headers */
13857 #include <pthread.h>
13858 #if HAVE_PTHREADS < 7
13859 #include <errno.h>
13860 #endif
13861 #ifndef NULL
13862 #define NULL (void*)0
13863 #endif
13864
13865 static void *task(p)
13866         void *p;
13867 {
13868         return (void *) (p == NULL);
13869 }
13870
13871 int main() {
13872
13873         /* pthread test function */
13874 #ifndef PTHREAD_CREATE_DETACHED
13875 #define PTHREAD_CREATE_DETACHED 1
13876 #endif
13877         pthread_t t;
13878         int status;
13879         int detach = PTHREAD_CREATE_DETACHED;
13880
13881 #if HAVE_PTHREADS > 4
13882         /* Final pthreads */
13883         pthread_attr_t attr;
13884
13885         status = pthread_attr_init(&attr);
13886         if( status ) return status;
13887
13888 #if HAVE_PTHREADS < 7
13889         status = pthread_attr_setdetachstate(&attr, &detach);
13890         if( status < 0 ) status = errno;
13891 #else
13892         status = pthread_attr_setdetachstate(&attr, detach);
13893 #endif
13894         if( status ) return status;
13895         status = pthread_create( &t, &attr, task, NULL );
13896 #if HAVE_PTHREADS < 7
13897         if( status < 0 ) status = errno;
13898 #endif
13899         if( status ) return status;
13900 #else
13901         /* Draft 4 pthreads */
13902         status = pthread_create( &t, pthread_attr_default, task, NULL );
13903         if( status ) return errno;
13904
13905         /* give thread a chance to complete */
13906         /* it should remain joinable and hence detachable */
13907         sleep( 1 );
13908
13909         status = pthread_detach( &t );
13910         if( status ) return errno;
13911 #endif
13912
13913 #ifdef HAVE_LINUX_THREADS
13914         pthread_kill_other_threads_np();
13915 #endif
13916
13917         return 0;
13918
13919 ; return 0; }
13920 EOF
13921 if { (eval echo configure:13922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13922   rm -rf conftest*
13923   ol_cv_pthread_threads=yes
13924 else
13925   echo "configure: failed program was:" >&5
13926   cat conftest.$ac_ext >&5
13927   rm -rf conftest*
13928   ol_cv_pthread_threads=no
13929 fi
13930 rm -f conftest*
13931 else
13932   cat > conftest.$ac_ext <<EOF
13933 #line 13934 "configure"
13934 #include "confdefs.h"
13935 /* pthread test headers */
13936 #include <pthread.h>
13937 #if HAVE_PTHREADS < 7
13938 #include <errno.h>
13939 #endif
13940 #ifndef NULL
13941 #define NULL (void*)0
13942 #endif
13943
13944 static void *task(p)
13945         void *p;
13946 {
13947         return (void *) (p == NULL);
13948 }
13949
13950
13951 int main(argc, argv)
13952         int argc;
13953         char **argv;
13954 {
13955
13956         /* pthread test function */
13957 #ifndef PTHREAD_CREATE_DETACHED
13958 #define PTHREAD_CREATE_DETACHED 1
13959 #endif
13960         pthread_t t;
13961         int status;
13962         int detach = PTHREAD_CREATE_DETACHED;
13963
13964 #if HAVE_PTHREADS > 4
13965         /* Final pthreads */
13966         pthread_attr_t attr;
13967
13968         status = pthread_attr_init(&attr);
13969         if( status ) return status;
13970
13971 #if HAVE_PTHREADS < 7
13972         status = pthread_attr_setdetachstate(&attr, &detach);
13973         if( status < 0 ) status = errno;
13974 #else
13975         status = pthread_attr_setdetachstate(&attr, detach);
13976 #endif
13977         if( status ) return status;
13978         status = pthread_create( &t, &attr, task, NULL );
13979 #if HAVE_PTHREADS < 7
13980         if( status < 0 ) status = errno;
13981 #endif
13982         if( status ) return status;
13983 #else
13984         /* Draft 4 pthreads */
13985         status = pthread_create( &t, pthread_attr_default, task, NULL );
13986         if( status ) return errno;
13987
13988         /* give thread a chance to complete */
13989         /* it should remain joinable and hence detachable */
13990         sleep( 1 );
13991
13992         status = pthread_detach( &t );
13993         if( status ) return errno;
13994 #endif
13995
13996 #ifdef HAVE_LINUX_THREADS
13997         pthread_kill_other_threads_np();
13998 #endif
13999
14000         return 0;
14001
14002 }
14003
14004 EOF
14005 if { (eval echo configure:14006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14006 then
14007   ol_cv_pthread_threads=yes
14008 else
14009   echo "configure: failed program was:" >&5
14010   cat conftest.$ac_ext >&5
14011   rm -fr conftest*
14012   ol_cv_pthread_threads=no
14013 fi
14014 rm -fr conftest*
14015 fi
14016
14017
14018                 # restore the LIBS
14019                 LIBS="$ol_LIBS"
14020         
14021 fi
14022
14023 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
14024
14025         if test $ol_cv_pthread_threads = yes ; then
14026                 ol_link_pthreads="-threads"
14027                 ol_link_threads=posix
14028         fi
14029 fi
14030
14031
14032                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
14033 if test "$ol_link_threads" = no ; then
14034         # try -lpthreads -lmach -lexc -lc_r
14035         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
14036 echo "configure:14037: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
14037 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
14038   echo $ac_n "(cached) $ac_c" 1>&6
14039 else
14040   
14041                 # save the flags
14042                 ol_LIBS="$LIBS"
14043                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
14044
14045                 if test "$cross_compiling" = yes; then
14046   cat > conftest.$ac_ext <<EOF
14047 #line 14048 "configure"
14048 #include "confdefs.h"
14049 /* pthread test headers */
14050 #include <pthread.h>
14051 #if HAVE_PTHREADS < 7
14052 #include <errno.h>
14053 #endif
14054 #ifndef NULL
14055 #define NULL (void*)0
14056 #endif
14057
14058 static void *task(p)
14059         void *p;
14060 {
14061         return (void *) (p == NULL);
14062 }
14063
14064 int main() {
14065
14066         /* pthread test function */
14067 #ifndef PTHREAD_CREATE_DETACHED
14068 #define PTHREAD_CREATE_DETACHED 1
14069 #endif
14070         pthread_t t;
14071         int status;
14072         int detach = PTHREAD_CREATE_DETACHED;
14073
14074 #if HAVE_PTHREADS > 4
14075         /* Final pthreads */
14076         pthread_attr_t attr;
14077
14078         status = pthread_attr_init(&attr);
14079         if( status ) return status;
14080
14081 #if HAVE_PTHREADS < 7
14082         status = pthread_attr_setdetachstate(&attr, &detach);
14083         if( status < 0 ) status = errno;
14084 #else
14085         status = pthread_attr_setdetachstate(&attr, detach);
14086 #endif
14087         if( status ) return status;
14088         status = pthread_create( &t, &attr, task, NULL );
14089 #if HAVE_PTHREADS < 7
14090         if( status < 0 ) status = errno;
14091 #endif
14092         if( status ) return status;
14093 #else
14094         /* Draft 4 pthreads */
14095         status = pthread_create( &t, pthread_attr_default, task, NULL );
14096         if( status ) return errno;
14097
14098         /* give thread a chance to complete */
14099         /* it should remain joinable and hence detachable */
14100         sleep( 1 );
14101
14102         status = pthread_detach( &t );
14103         if( status ) return errno;
14104 #endif
14105
14106 #ifdef HAVE_LINUX_THREADS
14107         pthread_kill_other_threads_np();
14108 #endif
14109
14110         return 0;
14111
14112 ; return 0; }
14113 EOF
14114 if { (eval echo configure:14115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14115   rm -rf conftest*
14116   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
14117 else
14118   echo "configure: failed program was:" >&5
14119   cat conftest.$ac_ext >&5
14120   rm -rf conftest*
14121   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
14122 fi
14123 rm -f conftest*
14124 else
14125   cat > conftest.$ac_ext <<EOF
14126 #line 14127 "configure"
14127 #include "confdefs.h"
14128 /* pthread test headers */
14129 #include <pthread.h>
14130 #if HAVE_PTHREADS < 7
14131 #include <errno.h>
14132 #endif
14133 #ifndef NULL
14134 #define NULL (void*)0
14135 #endif
14136
14137 static void *task(p)
14138         void *p;
14139 {
14140         return (void *) (p == NULL);
14141 }
14142
14143
14144 int main(argc, argv)
14145         int argc;
14146         char **argv;
14147 {
14148
14149         /* pthread test function */
14150 #ifndef PTHREAD_CREATE_DETACHED
14151 #define PTHREAD_CREATE_DETACHED 1
14152 #endif
14153         pthread_t t;
14154         int status;
14155         int detach = PTHREAD_CREATE_DETACHED;
14156
14157 #if HAVE_PTHREADS > 4
14158         /* Final pthreads */
14159         pthread_attr_t attr;
14160
14161         status = pthread_attr_init(&attr);
14162         if( status ) return status;
14163
14164 #if HAVE_PTHREADS < 7
14165         status = pthread_attr_setdetachstate(&attr, &detach);
14166         if( status < 0 ) status = errno;
14167 #else
14168         status = pthread_attr_setdetachstate(&attr, detach);
14169 #endif
14170         if( status ) return status;
14171         status = pthread_create( &t, &attr, task, NULL );
14172 #if HAVE_PTHREADS < 7
14173         if( status < 0 ) status = errno;
14174 #endif
14175         if( status ) return status;
14176 #else
14177         /* Draft 4 pthreads */
14178         status = pthread_create( &t, pthread_attr_default, task, NULL );
14179         if( status ) return errno;
14180
14181         /* give thread a chance to complete */
14182         /* it should remain joinable and hence detachable */
14183         sleep( 1 );
14184
14185         status = pthread_detach( &t );
14186         if( status ) return errno;
14187 #endif
14188
14189 #ifdef HAVE_LINUX_THREADS
14190         pthread_kill_other_threads_np();
14191 #endif
14192
14193         return 0;
14194
14195 }
14196
14197 EOF
14198 if { (eval echo configure:14199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14199 then
14200   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
14201 else
14202   echo "configure: failed program was:" >&5
14203   cat conftest.$ac_ext >&5
14204   rm -fr conftest*
14205   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
14206 fi
14207 rm -fr conftest*
14208 fi
14209
14210
14211                 # restore the LIBS
14212                 LIBS="$ol_LIBS"
14213         
14214 fi
14215
14216 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
14217
14218         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
14219                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
14220                 ol_link_threads=posix
14221         fi
14222 fi
14223
14224                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
14225 if test "$ol_link_threads" = no ; then
14226         # try -lpthreads -lmach -lexc
14227         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
14228 echo "configure:14229: checking for pthread link with -lpthreads -lmach -lexc" >&5
14229 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
14230   echo $ac_n "(cached) $ac_c" 1>&6
14231 else
14232   
14233                 # save the flags
14234                 ol_LIBS="$LIBS"
14235                 LIBS="-lpthreads -lmach -lexc $LIBS"
14236
14237                 if test "$cross_compiling" = yes; then
14238   cat > conftest.$ac_ext <<EOF
14239 #line 14240 "configure"
14240 #include "confdefs.h"
14241 /* pthread test headers */
14242 #include <pthread.h>
14243 #if HAVE_PTHREADS < 7
14244 #include <errno.h>
14245 #endif
14246 #ifndef NULL
14247 #define NULL (void*)0
14248 #endif
14249
14250 static void *task(p)
14251         void *p;
14252 {
14253         return (void *) (p == NULL);
14254 }
14255
14256 int main() {
14257
14258         /* pthread test function */
14259 #ifndef PTHREAD_CREATE_DETACHED
14260 #define PTHREAD_CREATE_DETACHED 1
14261 #endif
14262         pthread_t t;
14263         int status;
14264         int detach = PTHREAD_CREATE_DETACHED;
14265
14266 #if HAVE_PTHREADS > 4
14267         /* Final pthreads */
14268         pthread_attr_t attr;
14269
14270         status = pthread_attr_init(&attr);
14271         if( status ) return status;
14272
14273 #if HAVE_PTHREADS < 7
14274         status = pthread_attr_setdetachstate(&attr, &detach);
14275         if( status < 0 ) status = errno;
14276 #else
14277         status = pthread_attr_setdetachstate(&attr, detach);
14278 #endif
14279         if( status ) return status;
14280         status = pthread_create( &t, &attr, task, NULL );
14281 #if HAVE_PTHREADS < 7
14282         if( status < 0 ) status = errno;
14283 #endif
14284         if( status ) return status;
14285 #else
14286         /* Draft 4 pthreads */
14287         status = pthread_create( &t, pthread_attr_default, task, NULL );
14288         if( status ) return errno;
14289
14290         /* give thread a chance to complete */
14291         /* it should remain joinable and hence detachable */
14292         sleep( 1 );
14293
14294         status = pthread_detach( &t );
14295         if( status ) return errno;
14296 #endif
14297
14298 #ifdef HAVE_LINUX_THREADS
14299         pthread_kill_other_threads_np();
14300 #endif
14301
14302         return 0;
14303
14304 ; return 0; }
14305 EOF
14306 if { (eval echo configure:14307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14307   rm -rf conftest*
14308   ol_cv_pthread_lpthreads_lmach_lexc=yes
14309 else
14310   echo "configure: failed program was:" >&5
14311   cat conftest.$ac_ext >&5
14312   rm -rf conftest*
14313   ol_cv_pthread_lpthreads_lmach_lexc=no
14314 fi
14315 rm -f conftest*
14316 else
14317   cat > conftest.$ac_ext <<EOF
14318 #line 14319 "configure"
14319 #include "confdefs.h"
14320 /* pthread test headers */
14321 #include <pthread.h>
14322 #if HAVE_PTHREADS < 7
14323 #include <errno.h>
14324 #endif
14325 #ifndef NULL
14326 #define NULL (void*)0
14327 #endif
14328
14329 static void *task(p)
14330         void *p;
14331 {
14332         return (void *) (p == NULL);
14333 }
14334
14335
14336 int main(argc, argv)
14337         int argc;
14338         char **argv;
14339 {
14340
14341         /* pthread test function */
14342 #ifndef PTHREAD_CREATE_DETACHED
14343 #define PTHREAD_CREATE_DETACHED 1
14344 #endif
14345         pthread_t t;
14346         int status;
14347         int detach = PTHREAD_CREATE_DETACHED;
14348
14349 #if HAVE_PTHREADS > 4
14350         /* Final pthreads */
14351         pthread_attr_t attr;
14352
14353         status = pthread_attr_init(&attr);
14354         if( status ) return status;
14355
14356 #if HAVE_PTHREADS < 7
14357         status = pthread_attr_setdetachstate(&attr, &detach);
14358         if( status < 0 ) status = errno;
14359 #else
14360         status = pthread_attr_setdetachstate(&attr, detach);
14361 #endif
14362         if( status ) return status;
14363         status = pthread_create( &t, &attr, task, NULL );
14364 #if HAVE_PTHREADS < 7
14365         if( status < 0 ) status = errno;
14366 #endif
14367         if( status ) return status;
14368 #else
14369         /* Draft 4 pthreads */
14370         status = pthread_create( &t, pthread_attr_default, task, NULL );
14371         if( status ) return errno;
14372
14373         /* give thread a chance to complete */
14374         /* it should remain joinable and hence detachable */
14375         sleep( 1 );
14376
14377         status = pthread_detach( &t );
14378         if( status ) return errno;
14379 #endif
14380
14381 #ifdef HAVE_LINUX_THREADS
14382         pthread_kill_other_threads_np();
14383 #endif
14384
14385         return 0;
14386
14387 }
14388
14389 EOF
14390 if { (eval echo configure:14391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14391 then
14392   ol_cv_pthread_lpthreads_lmach_lexc=yes
14393 else
14394   echo "configure: failed program was:" >&5
14395   cat conftest.$ac_ext >&5
14396   rm -fr conftest*
14397   ol_cv_pthread_lpthreads_lmach_lexc=no
14398 fi
14399 rm -fr conftest*
14400 fi
14401
14402
14403                 # restore the LIBS
14404                 LIBS="$ol_LIBS"
14405         
14406 fi
14407
14408 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
14409
14410         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
14411                 ol_link_pthreads="-lpthreads -lmach -lexc"
14412                 ol_link_threads=posix
14413         fi
14414 fi
14415
14416                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
14417 if test "$ol_link_threads" = no ; then
14418         # try -lpthreads -lexc
14419         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
14420 echo "configure:14421: checking for pthread link with -lpthreads -lexc" >&5
14421 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
14422   echo $ac_n "(cached) $ac_c" 1>&6
14423 else
14424   
14425                 # save the flags
14426                 ol_LIBS="$LIBS"
14427                 LIBS="-lpthreads -lexc $LIBS"
14428
14429                 if test "$cross_compiling" = yes; then
14430   cat > conftest.$ac_ext <<EOF
14431 #line 14432 "configure"
14432 #include "confdefs.h"
14433 /* pthread test headers */
14434 #include <pthread.h>
14435 #if HAVE_PTHREADS < 7
14436 #include <errno.h>
14437 #endif
14438 #ifndef NULL
14439 #define NULL (void*)0
14440 #endif
14441
14442 static void *task(p)
14443         void *p;
14444 {
14445         return (void *) (p == NULL);
14446 }
14447
14448 int main() {
14449
14450         /* pthread test function */
14451 #ifndef PTHREAD_CREATE_DETACHED
14452 #define PTHREAD_CREATE_DETACHED 1
14453 #endif
14454         pthread_t t;
14455         int status;
14456         int detach = PTHREAD_CREATE_DETACHED;
14457
14458 #if HAVE_PTHREADS > 4
14459         /* Final pthreads */
14460         pthread_attr_t attr;
14461
14462         status = pthread_attr_init(&attr);
14463         if( status ) return status;
14464
14465 #if HAVE_PTHREADS < 7
14466         status = pthread_attr_setdetachstate(&attr, &detach);
14467         if( status < 0 ) status = errno;
14468 #else
14469         status = pthread_attr_setdetachstate(&attr, detach);
14470 #endif
14471         if( status ) return status;
14472         status = pthread_create( &t, &attr, task, NULL );
14473 #if HAVE_PTHREADS < 7
14474         if( status < 0 ) status = errno;
14475 #endif
14476         if( status ) return status;
14477 #else
14478         /* Draft 4 pthreads */
14479         status = pthread_create( &t, pthread_attr_default, task, NULL );
14480         if( status ) return errno;
14481
14482         /* give thread a chance to complete */
14483         /* it should remain joinable and hence detachable */
14484         sleep( 1 );
14485
14486         status = pthread_detach( &t );
14487         if( status ) return errno;
14488 #endif
14489
14490 #ifdef HAVE_LINUX_THREADS
14491         pthread_kill_other_threads_np();
14492 #endif
14493
14494         return 0;
14495
14496 ; return 0; }
14497 EOF
14498 if { (eval echo configure:14499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14499   rm -rf conftest*
14500   ol_cv_pthread_lpthreads_lexc=yes
14501 else
14502   echo "configure: failed program was:" >&5
14503   cat conftest.$ac_ext >&5
14504   rm -rf conftest*
14505   ol_cv_pthread_lpthreads_lexc=no
14506 fi
14507 rm -f conftest*
14508 else
14509   cat > conftest.$ac_ext <<EOF
14510 #line 14511 "configure"
14511 #include "confdefs.h"
14512 /* pthread test headers */
14513 #include <pthread.h>
14514 #if HAVE_PTHREADS < 7
14515 #include <errno.h>
14516 #endif
14517 #ifndef NULL
14518 #define NULL (void*)0
14519 #endif
14520
14521 static void *task(p)
14522         void *p;
14523 {
14524         return (void *) (p == NULL);
14525 }
14526
14527
14528 int main(argc, argv)
14529         int argc;
14530         char **argv;
14531 {
14532
14533         /* pthread test function */
14534 #ifndef PTHREAD_CREATE_DETACHED
14535 #define PTHREAD_CREATE_DETACHED 1
14536 #endif
14537         pthread_t t;
14538         int status;
14539         int detach = PTHREAD_CREATE_DETACHED;
14540
14541 #if HAVE_PTHREADS > 4
14542         /* Final pthreads */
14543         pthread_attr_t attr;
14544
14545         status = pthread_attr_init(&attr);
14546         if( status ) return status;
14547
14548 #if HAVE_PTHREADS < 7
14549         status = pthread_attr_setdetachstate(&attr, &detach);
14550         if( status < 0 ) status = errno;
14551 #else
14552         status = pthread_attr_setdetachstate(&attr, detach);
14553 #endif
14554         if( status ) return status;
14555         status = pthread_create( &t, &attr, task, NULL );
14556 #if HAVE_PTHREADS < 7
14557         if( status < 0 ) status = errno;
14558 #endif
14559         if( status ) return status;
14560 #else
14561         /* Draft 4 pthreads */
14562         status = pthread_create( &t, pthread_attr_default, task, NULL );
14563         if( status ) return errno;
14564
14565         /* give thread a chance to complete */
14566         /* it should remain joinable and hence detachable */
14567         sleep( 1 );
14568
14569         status = pthread_detach( &t );
14570         if( status ) return errno;
14571 #endif
14572
14573 #ifdef HAVE_LINUX_THREADS
14574         pthread_kill_other_threads_np();
14575 #endif
14576
14577         return 0;
14578
14579 }
14580
14581 EOF
14582 if { (eval echo configure:14583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14583 then
14584   ol_cv_pthread_lpthreads_lexc=yes
14585 else
14586   echo "configure: failed program was:" >&5
14587   cat conftest.$ac_ext >&5
14588   rm -fr conftest*
14589   ol_cv_pthread_lpthreads_lexc=no
14590 fi
14591 rm -fr conftest*
14592 fi
14593
14594
14595                 # restore the LIBS
14596                 LIBS="$ol_LIBS"
14597         
14598 fi
14599
14600 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
14601
14602         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
14603                 ol_link_pthreads="-lpthreads -lexc"
14604                 ol_link_threads=posix
14605         fi
14606 fi
14607
14608
14609                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
14610 if test "$ol_link_threads" = no ; then
14611         # try -lpthreads
14612         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
14613 echo "configure:14614: checking for pthread link with -lpthreads" >&5
14614 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
14615   echo $ac_n "(cached) $ac_c" 1>&6
14616 else
14617   
14618                 # save the flags
14619                 ol_LIBS="$LIBS"
14620                 LIBS="-lpthreads $LIBS"
14621
14622                 if test "$cross_compiling" = yes; then
14623   cat > conftest.$ac_ext <<EOF
14624 #line 14625 "configure"
14625 #include "confdefs.h"
14626 /* pthread test headers */
14627 #include <pthread.h>
14628 #if HAVE_PTHREADS < 7
14629 #include <errno.h>
14630 #endif
14631 #ifndef NULL
14632 #define NULL (void*)0
14633 #endif
14634
14635 static void *task(p)
14636         void *p;
14637 {
14638         return (void *) (p == NULL);
14639 }
14640
14641 int main() {
14642
14643         /* pthread test function */
14644 #ifndef PTHREAD_CREATE_DETACHED
14645 #define PTHREAD_CREATE_DETACHED 1
14646 #endif
14647         pthread_t t;
14648         int status;
14649         int detach = PTHREAD_CREATE_DETACHED;
14650
14651 #if HAVE_PTHREADS > 4
14652         /* Final pthreads */
14653         pthread_attr_t attr;
14654
14655         status = pthread_attr_init(&attr);
14656         if( status ) return status;
14657
14658 #if HAVE_PTHREADS < 7
14659         status = pthread_attr_setdetachstate(&attr, &detach);
14660         if( status < 0 ) status = errno;
14661 #else
14662         status = pthread_attr_setdetachstate(&attr, detach);
14663 #endif
14664         if( status ) return status;
14665         status = pthread_create( &t, &attr, task, NULL );
14666 #if HAVE_PTHREADS < 7
14667         if( status < 0 ) status = errno;
14668 #endif
14669         if( status ) return status;
14670 #else
14671         /* Draft 4 pthreads */
14672         status = pthread_create( &t, pthread_attr_default, task, NULL );
14673         if( status ) return errno;
14674
14675         /* give thread a chance to complete */
14676         /* it should remain joinable and hence detachable */
14677         sleep( 1 );
14678
14679         status = pthread_detach( &t );
14680         if( status ) return errno;
14681 #endif
14682
14683 #ifdef HAVE_LINUX_THREADS
14684         pthread_kill_other_threads_np();
14685 #endif
14686
14687         return 0;
14688
14689 ; return 0; }
14690 EOF
14691 if { (eval echo configure:14692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14692   rm -rf conftest*
14693   ol_cv_pthread_lib_lpthreads=yes
14694 else
14695   echo "configure: failed program was:" >&5
14696   cat conftest.$ac_ext >&5
14697   rm -rf conftest*
14698   ol_cv_pthread_lib_lpthreads=no
14699 fi
14700 rm -f conftest*
14701 else
14702   cat > conftest.$ac_ext <<EOF
14703 #line 14704 "configure"
14704 #include "confdefs.h"
14705 /* pthread test headers */
14706 #include <pthread.h>
14707 #if HAVE_PTHREADS < 7
14708 #include <errno.h>
14709 #endif
14710 #ifndef NULL
14711 #define NULL (void*)0
14712 #endif
14713
14714 static void *task(p)
14715         void *p;
14716 {
14717         return (void *) (p == NULL);
14718 }
14719
14720
14721 int main(argc, argv)
14722         int argc;
14723         char **argv;
14724 {
14725
14726         /* pthread test function */
14727 #ifndef PTHREAD_CREATE_DETACHED
14728 #define PTHREAD_CREATE_DETACHED 1
14729 #endif
14730         pthread_t t;
14731         int status;
14732         int detach = PTHREAD_CREATE_DETACHED;
14733
14734 #if HAVE_PTHREADS > 4
14735         /* Final pthreads */
14736         pthread_attr_t attr;
14737
14738         status = pthread_attr_init(&attr);
14739         if( status ) return status;
14740
14741 #if HAVE_PTHREADS < 7
14742         status = pthread_attr_setdetachstate(&attr, &detach);
14743         if( status < 0 ) status = errno;
14744 #else
14745         status = pthread_attr_setdetachstate(&attr, detach);
14746 #endif
14747         if( status ) return status;
14748         status = pthread_create( &t, &attr, task, NULL );
14749 #if HAVE_PTHREADS < 7
14750         if( status < 0 ) status = errno;
14751 #endif
14752         if( status ) return status;
14753 #else
14754         /* Draft 4 pthreads */
14755         status = pthread_create( &t, pthread_attr_default, task, NULL );
14756         if( status ) return errno;
14757
14758         /* give thread a chance to complete */
14759         /* it should remain joinable and hence detachable */
14760         sleep( 1 );
14761
14762         status = pthread_detach( &t );
14763         if( status ) return errno;
14764 #endif
14765
14766 #ifdef HAVE_LINUX_THREADS
14767         pthread_kill_other_threads_np();
14768 #endif
14769
14770         return 0;
14771
14772 }
14773
14774 EOF
14775 if { (eval echo configure:14776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14776 then
14777   ol_cv_pthread_lib_lpthreads=yes
14778 else
14779   echo "configure: failed program was:" >&5
14780   cat conftest.$ac_ext >&5
14781   rm -fr conftest*
14782   ol_cv_pthread_lib_lpthreads=no
14783 fi
14784 rm -fr conftest*
14785 fi
14786
14787
14788                 # restore the LIBS
14789                 LIBS="$ol_LIBS"
14790         
14791 fi
14792
14793 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
14794
14795         if test $ol_cv_pthread_lib_lpthreads = yes ; then
14796                 ol_link_pthreads="-lpthreads"
14797                 ol_link_threads=posix
14798         fi
14799 fi
14800
14801
14802                 if test $ol_link_threads != no ; then
14803                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
14804
14805                                                 save_CPPFLAGS="$CPPFLAGS"
14806                         save_LIBS="$LIBS"
14807                         LIBS="$LTHREAD_LIBS $LIBS"
14808
14809                                                                                                 for ac_func in sched_yield pthread_yield thr_yield
14810 do
14811 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14812 echo "configure:14813: checking for $ac_func" >&5
14813 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14814   echo $ac_n "(cached) $ac_c" 1>&6
14815 else
14816   cat > conftest.$ac_ext <<EOF
14817 #line 14818 "configure"
14818 #include "confdefs.h"
14819 /* System header to define __stub macros and hopefully few prototypes,
14820     which can conflict with char $ac_func(); below.  */
14821 #include <assert.h>
14822 /* Override any gcc2 internal prototype to avoid an error.  */
14823 /* We use char because int might match the return type of a gcc2
14824     builtin and then its argument prototype would still apply.  */
14825 char $ac_func();
14826 char (*f)();
14827
14828 int main() {
14829
14830 /* The GNU C library defines this for functions which it implements
14831     to always fail with ENOSYS.  Some functions are actually named
14832     something starting with __ and the normal name is an alias.  */
14833 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14834 choke me
14835 #else
14836 f = $ac_func;
14837 #endif
14838
14839 ; return 0; }
14840 EOF
14841 if { (eval echo configure:14842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14842   rm -rf conftest*
14843   eval "ac_cv_func_$ac_func=yes"
14844 else
14845   echo "configure: failed program was:" >&5
14846   cat conftest.$ac_ext >&5
14847   rm -rf conftest*
14848   eval "ac_cv_func_$ac_func=no"
14849 fi
14850 rm -f conftest*
14851 fi
14852
14853 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14854   echo "$ac_t""yes" 1>&6
14855     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14856   cat >> confdefs.h <<EOF
14857 #define $ac_tr_func 1
14858 EOF
14859  
14860 else
14861   echo "$ac_t""no" 1>&6
14862 fi
14863 done
14864
14865
14866                         if test $ac_cv_func_sched_yield = no -a \
14867                                 $ac_cv_func_pthread_yield = no -a \
14868                                 $ac_cv_func_thr_yield = no ; then
14869                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
14870 echo "configure:14871: checking for sched_yield in -lrt" >&5
14871 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
14872 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14873   echo $ac_n "(cached) $ac_c" 1>&6
14874 else
14875   ac_save_LIBS="$LIBS"
14876 LIBS="-lrt  $LIBS"
14877 cat > conftest.$ac_ext <<EOF
14878 #line 14879 "configure"
14879 #include "confdefs.h"
14880 /* Override any gcc2 internal prototype to avoid an error.  */
14881 /* We use char because int might match the return type of a gcc2
14882     builtin and then its argument prototype would still apply.  */
14883 char sched_yield();
14884
14885 int main() {
14886 sched_yield()
14887 ; return 0; }
14888 EOF
14889 if { (eval echo configure:14890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14890   rm -rf conftest*
14891   eval "ac_cv_lib_$ac_lib_var=yes"
14892 else
14893   echo "configure: failed program was:" >&5
14894   cat conftest.$ac_ext >&5
14895   rm -rf conftest*
14896   eval "ac_cv_lib_$ac_lib_var=no"
14897 fi
14898 rm -f conftest*
14899 LIBS="$ac_save_LIBS"
14900
14901 fi
14902 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14903   echo "$ac_t""yes" 1>&6
14904   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
14905                                         cat >> confdefs.h <<\EOF
14906 #define HAVE_SCHED_YIELD 1
14907 EOF
14908
14909                                         ac_cv_func_sched_yield=yes
14910 else
14911   echo "$ac_t""no" 1>&6
14912 ac_cv_func_sched_yield=no
14913 fi
14914
14915                         fi
14916                         if test $ac_cv_func_sched_yield = no -a \
14917                                 $ac_cv_func_pthread_yield = no -a \
14918                                 "$ac_cv_func_thr_yield" = no ; then
14919                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
14920                         fi
14921
14922                                                 for ac_func in pthread_kill pthread_rwlock_destroy
14923 do
14924 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14925 echo "configure:14926: checking for $ac_func" >&5
14926 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14927   echo $ac_n "(cached) $ac_c" 1>&6
14928 else
14929   cat > conftest.$ac_ext <<EOF
14930 #line 14931 "configure"
14931 #include "confdefs.h"
14932 /* System header to define __stub macros and hopefully few prototypes,
14933     which can conflict with char $ac_func(); below.  */
14934 #include <assert.h>
14935 /* Override any gcc2 internal prototype to avoid an error.  */
14936 /* We use char because int might match the return type of a gcc2
14937     builtin and then its argument prototype would still apply.  */
14938 char $ac_func();
14939 char (*f)();
14940
14941 int main() {
14942
14943 /* The GNU C library defines this for functions which it implements
14944     to always fail with ENOSYS.  Some functions are actually named
14945     something starting with __ and the normal name is an alias.  */
14946 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14947 choke me
14948 #else
14949 f = $ac_func;
14950 #endif
14951
14952 ; return 0; }
14953 EOF
14954 if { (eval echo configure:14955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14955   rm -rf conftest*
14956   eval "ac_cv_func_$ac_func=yes"
14957 else
14958   echo "configure: failed program was:" >&5
14959   cat conftest.$ac_ext >&5
14960   rm -rf conftest*
14961   eval "ac_cv_func_$ac_func=no"
14962 fi
14963 rm -f conftest*
14964 fi
14965
14966 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14967   echo "$ac_t""yes" 1>&6
14968     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14969   cat >> confdefs.h <<EOF
14970 #define $ac_tr_func 1
14971 EOF
14972  
14973 else
14974   echo "$ac_t""no" 1>&6
14975 fi
14976 done
14977
14978
14979                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
14980 echo "configure:14981: checking for pthread_detach with <pthread.h>" >&5
14981 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
14982   echo $ac_n "(cached) $ac_c" 1>&6
14983 else
14984   
14985                                                                 cat > conftest.$ac_ext <<EOF
14986 #line 14987 "configure"
14987 #include "confdefs.h"
14988
14989 #include <pthread.h>
14990 #ifndef NULL
14991 #define NULL (void*)0
14992 #endif
14993
14994 int main() {
14995 pthread_detach(NULL);
14996 ; return 0; }
14997 EOF
14998 if { (eval echo configure:14999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14999   rm -rf conftest*
15000   ol_cv_func_pthread_detach=yes
15001 else
15002   echo "configure: failed program was:" >&5
15003   cat conftest.$ac_ext >&5
15004   rm -rf conftest*
15005   ol_cv_func_pthread_detach=no
15006 fi
15007 rm -f conftest*
15008                         
15009 fi
15010
15011 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
15012
15013                         if test $ol_cv_func_pthread_detach = no ; then
15014                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
15015                         fi
15016
15017                         cat >> confdefs.h <<\EOF
15018 #define HAVE_PTHREAD_DETACH 1
15019 EOF
15020
15021
15022                                                 for ac_func in \
15023                                 pthread_setconcurrency \
15024                                 pthread_getconcurrency \
15025                                 thr_setconcurrency \
15026                                 thr_getconcurrency \
15027                         
15028 do
15029 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15030 echo "configure:15031: checking for $ac_func" >&5
15031 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15032   echo $ac_n "(cached) $ac_c" 1>&6
15033 else
15034   cat > conftest.$ac_ext <<EOF
15035 #line 15036 "configure"
15036 #include "confdefs.h"
15037 /* System header to define __stub macros and hopefully few prototypes,
15038     which can conflict with char $ac_func(); below.  */
15039 #include <assert.h>
15040 /* Override any gcc2 internal prototype to avoid an error.  */
15041 /* We use char because int might match the return type of a gcc2
15042     builtin and then its argument prototype would still apply.  */
15043 char $ac_func();
15044 char (*f)();
15045
15046 int main() {
15047
15048 /* The GNU C library defines this for functions which it implements
15049     to always fail with ENOSYS.  Some functions are actually named
15050     something starting with __ and the normal name is an alias.  */
15051 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15052 choke me
15053 #else
15054 f = $ac_func;
15055 #endif
15056
15057 ; return 0; }
15058 EOF
15059 if { (eval echo configure:15060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15060   rm -rf conftest*
15061   eval "ac_cv_func_$ac_func=yes"
15062 else
15063   echo "configure: failed program was:" >&5
15064   cat conftest.$ac_ext >&5
15065   rm -rf conftest*
15066   eval "ac_cv_func_$ac_func=no"
15067 fi
15068 rm -f conftest*
15069 fi
15070
15071 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15072   echo "$ac_t""yes" 1>&6
15073     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15074   cat >> confdefs.h <<EOF
15075 #define $ac_tr_func 1
15076 EOF
15077  
15078 else
15079   echo "$ac_t""no" 1>&6
15080 fi
15081 done
15082
15083
15084                         
15085         for ac_func in pthread_kill_other_threads_np
15086 do
15087 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15088 echo "configure:15089: checking for $ac_func" >&5
15089 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15090   echo $ac_n "(cached) $ac_c" 1>&6
15091 else
15092   cat > conftest.$ac_ext <<EOF
15093 #line 15094 "configure"
15094 #include "confdefs.h"
15095 /* System header to define __stub macros and hopefully few prototypes,
15096     which can conflict with char $ac_func(); below.  */
15097 #include <assert.h>
15098 /* Override any gcc2 internal prototype to avoid an error.  */
15099 /* We use char because int might match the return type of a gcc2
15100     builtin and then its argument prototype would still apply.  */
15101 char $ac_func();
15102 char (*f)();
15103
15104 int main() {
15105
15106 /* The GNU C library defines this for functions which it implements
15107     to always fail with ENOSYS.  Some functions are actually named
15108     something starting with __ and the normal name is an alias.  */
15109 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15110 choke me
15111 #else
15112 f = $ac_func;
15113 #endif
15114
15115 ; return 0; }
15116 EOF
15117 if { (eval echo configure:15118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15118   rm -rf conftest*
15119   eval "ac_cv_func_$ac_func=yes"
15120 else
15121   echo "configure: failed program was:" >&5
15122   cat conftest.$ac_ext >&5
15123   rm -rf conftest*
15124   eval "ac_cv_func_$ac_func=no"
15125 fi
15126 rm -f conftest*
15127 fi
15128
15129 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15130   echo "$ac_t""yes" 1>&6
15131     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15132   cat >> confdefs.h <<EOF
15133 #define $ac_tr_func 1
15134 EOF
15135  
15136 else
15137   echo "$ac_t""no" 1>&6
15138 fi
15139 done
15140
15141         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
15142 echo "configure:15143: checking for LinuxThreads implementation" >&5
15143 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
15144   echo $ac_n "(cached) $ac_c" 1>&6
15145 else
15146   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
15147 fi
15148
15149 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
15150
15151                         
15152         
15153         
15154         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
15155 echo "configure:15156: checking for LinuxThreads consistency" >&5
15156 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
15157   echo $ac_n "(cached) $ac_c" 1>&6
15158 else
15159   
15160                 if test $ol_cv_header_linux_threads = yes -a \
15161                         $ol_cv_sys_linux_threads = yes; then
15162                         ol_cv_linux_threads=yes
15163                 elif test $ol_cv_header_linux_threads = no -a \
15164                         $ol_cv_sys_linux_threads = no; then
15165                         ol_cv_linux_threads=no
15166                 else
15167                         ol_cv_linux_threads=error
15168                 fi
15169         
15170 fi
15171
15172 echo "$ac_t""$ol_cv_linux_threads" 1>&6
15173
15174
15175                         if test $ol_cv_linux_threads = error; then
15176                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
15177                         fi
15178
15179                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
15180 echo "configure:15181: checking if pthread_create() works" >&5
15181 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
15182   echo $ac_n "(cached) $ac_c" 1>&6
15183 else
15184   
15185                         if test "$cross_compiling" = yes; then
15186                                 ol_cv_pthread_create_works=yes
15187 else
15188   cat > conftest.$ac_ext <<EOF
15189 #line 15190 "configure"
15190 #include "confdefs.h"
15191 /* pthread test headers */
15192 #include <pthread.h>
15193 #if HAVE_PTHREADS < 7
15194 #include <errno.h>
15195 #endif
15196 #ifndef NULL
15197 #define NULL (void*)0
15198 #endif
15199
15200 static void *task(p)
15201         void *p;
15202 {
15203         return (void *) (p == NULL);
15204 }
15205
15206
15207 int main(argc, argv)
15208         int argc;
15209         char **argv;
15210 {
15211
15212         /* pthread test function */
15213 #ifndef PTHREAD_CREATE_DETACHED
15214 #define PTHREAD_CREATE_DETACHED 1
15215 #endif
15216         pthread_t t;
15217         int status;
15218         int detach = PTHREAD_CREATE_DETACHED;
15219
15220 #if HAVE_PTHREADS > 4
15221         /* Final pthreads */
15222         pthread_attr_t attr;
15223
15224         status = pthread_attr_init(&attr);
15225         if( status ) return status;
15226
15227 #if HAVE_PTHREADS < 7
15228         status = pthread_attr_setdetachstate(&attr, &detach);
15229         if( status < 0 ) status = errno;
15230 #else
15231         status = pthread_attr_setdetachstate(&attr, detach);
15232 #endif
15233         if( status ) return status;
15234         status = pthread_create( &t, &attr, task, NULL );
15235 #if HAVE_PTHREADS < 7
15236         if( status < 0 ) status = errno;
15237 #endif
15238         if( status ) return status;
15239 #else
15240         /* Draft 4 pthreads */
15241         status = pthread_create( &t, pthread_attr_default, task, NULL );
15242         if( status ) return errno;
15243
15244         /* give thread a chance to complete */
15245         /* it should remain joinable and hence detachable */
15246         sleep( 1 );
15247
15248         status = pthread_detach( &t );
15249         if( status ) return errno;
15250 #endif
15251
15252 #ifdef HAVE_LINUX_THREADS
15253         pthread_kill_other_threads_np();
15254 #endif
15255
15256         return 0;
15257
15258 }
15259
15260 EOF
15261 if { (eval echo configure:15262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15262 then
15263   ol_cv_pthread_create_works=yes
15264 else
15265   echo "configure: failed program was:" >&5
15266   cat conftest.$ac_ext >&5
15267   rm -fr conftest*
15268   ol_cv_pthread_create_works=no
15269 fi
15270 rm -fr conftest*
15271 fi
15272
15273 fi
15274
15275 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
15276
15277                         if test $ol_cv_pthread_create_works = no ; then
15278                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
15279                         fi
15280
15281                                                 if test $ol_with_yielding_select = auto ; then
15282                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
15283 echo "configure:15284: checking if select yields when using pthreads" >&5
15284 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
15285   echo $ac_n "(cached) $ac_c" 1>&6
15286 else
15287   
15288                                 if test "$cross_compiling" = yes; then
15289   ol_cv_pthread_select_yields=cross
15290 else
15291   cat > conftest.$ac_ext <<EOF
15292 #line 15293 "configure"
15293 #include "confdefs.h"
15294
15295 #include <sys/types.h>
15296 #include <sys/time.h>
15297 #include <unistd.h>
15298 #include <pthread.h>
15299 #ifndef NULL
15300 #define NULL (void*) 0
15301 #endif
15302
15303 static int fildes[2];
15304
15305 static void *task(p)
15306         void *p;
15307 {
15308         int i;
15309         struct timeval tv;
15310
15311         fd_set rfds;
15312
15313         tv.tv_sec=10;
15314         tv.tv_usec=0;
15315
15316         FD_ZERO(&rfds);
15317         FD_SET(fildes[0], &rfds);
15318
15319         /* we're not interested in any fds */
15320         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
15321
15322         if(i < 0) {
15323                 perror("select");
15324                 exit(10);
15325         }
15326
15327         exit(0); /* if we exit here, the select blocked the whole process */
15328 }
15329
15330 int main(argc, argv)
15331         int argc;
15332         char **argv;
15333 {
15334         pthread_t t;
15335
15336         /* create a pipe to select */
15337         if(pipe(&fildes[0])) {
15338                 perror("select");
15339                 exit(1);
15340         }
15341
15342 #ifdef HAVE_PTHREAD_SETCONCURRENCY
15343         (void) pthread_setconcurrency(2);
15344 #else
15345 #ifdef HAVE_THR_SETCONCURRENCY
15346         /* Set Solaris LWP concurrency to 2 */
15347         thr_setconcurrency(2);
15348 #endif
15349 #endif
15350
15351 #if HAVE_PTHREADS < 6
15352         pthread_create(&t, pthread_attr_default, task, NULL);
15353 #else
15354         pthread_create(&t, NULL, task, NULL);
15355 #endif
15356
15357         /* make sure task runs first */
15358 #if HAVE_THR_YIELD
15359         thr_yield();
15360 #elif defined( HAVE_SCHED_YIELD )
15361         sched_yield();
15362 #elif defined( HAVE_PTHREAD_YIELD )
15363         pthread_yield();
15364 #endif
15365
15366         exit(2);
15367 }
15368 EOF
15369 if { (eval echo configure:15370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15370 then
15371   ol_cv_pthread_select_yields=no
15372 else
15373   echo "configure: failed program was:" >&5
15374   cat conftest.$ac_ext >&5
15375   rm -fr conftest*
15376   ol_cv_pthread_select_yields=yes
15377 fi
15378 rm -fr conftest*
15379 fi
15380
15381 fi
15382
15383 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
15384
15385                                 if test $ol_cv_pthread_select_yields = cross ; then
15386                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
15387                                 fi
15388
15389                                 if test $ol_cv_pthread_select_yields = yes ; then
15390                                         ol_with_yielding_select=yes
15391                                 fi
15392                         fi
15393
15394                                                 CPPFLAGS="$save_CPPFLAGS"
15395                         LIBS="$save_LIBS"
15396                 else
15397                         { echo "configure: error: could not locate usable POSIX Threads" 1>&2; exit 1; }
15398                 fi
15399         fi
15400
15401         if test $ol_with_threads = posix ; then
15402                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
15403         fi
15404 fi
15405
15406 if test $ol_with_threads = auto -o $ol_with_threads = yes \
15407         -o $ol_with_threads = mach ; then
15408
15409                 for ac_hdr in mach/cthreads.h cthreads.h
15410 do
15411 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15412 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15413 echo "configure:15414: checking for $ac_hdr" >&5
15414 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15415   echo $ac_n "(cached) $ac_c" 1>&6
15416 else
15417   cat > conftest.$ac_ext <<EOF
15418 #line 15419 "configure"
15419 #include "confdefs.h"
15420 #include <$ac_hdr>
15421 EOF
15422 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15423 { (eval echo configure:15424: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15424 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15425 if test -z "$ac_err"; then
15426   rm -rf conftest*
15427   eval "ac_cv_header_$ac_safe=yes"
15428 else
15429   echo "$ac_err" >&5
15430   echo "configure: failed program was:" >&5
15431   cat conftest.$ac_ext >&5
15432   rm -rf conftest*
15433   eval "ac_cv_header_$ac_safe=no"
15434 fi
15435 rm -f conftest*
15436 fi
15437 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15438   echo "$ac_t""yes" 1>&6
15439     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15440   cat >> confdefs.h <<EOF
15441 #define $ac_tr_hdr 1
15442 EOF
15443  
15444 else
15445   echo "$ac_t""no" 1>&6
15446 fi
15447 done
15448
15449         if test $ac_cv_header_mach_cthreads_h = yes ; then
15450                 ol_with_threads=found
15451
15452                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
15453 echo "configure:15454: checking for cthread_fork" >&5
15454 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
15455   echo $ac_n "(cached) $ac_c" 1>&6
15456 else
15457   cat > conftest.$ac_ext <<EOF
15458 #line 15459 "configure"
15459 #include "confdefs.h"
15460 /* System header to define __stub macros and hopefully few prototypes,
15461     which can conflict with char cthread_fork(); below.  */
15462 #include <assert.h>
15463 /* Override any gcc2 internal prototype to avoid an error.  */
15464 /* We use char because int might match the return type of a gcc2
15465     builtin and then its argument prototype would still apply.  */
15466 char cthread_fork();
15467 char (*f)();
15468
15469 int main() {
15470
15471 /* The GNU C library defines this for functions which it implements
15472     to always fail with ENOSYS.  Some functions are actually named
15473     something starting with __ and the normal name is an alias.  */
15474 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
15475 choke me
15476 #else
15477 f = cthread_fork;
15478 #endif
15479
15480 ; return 0; }
15481 EOF
15482 if { (eval echo configure:15483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15483   rm -rf conftest*
15484   eval "ac_cv_func_cthread_fork=yes"
15485 else
15486   echo "configure: failed program was:" >&5
15487   cat conftest.$ac_ext >&5
15488   rm -rf conftest*
15489   eval "ac_cv_func_cthread_fork=no"
15490 fi
15491 rm -f conftest*
15492 fi
15493
15494 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
15495   echo "$ac_t""yes" 1>&6
15496   ol_link_threads=yes
15497 else
15498   echo "$ac_t""no" 1>&6
15499 fi
15500
15501
15502                 if test $ol_link_threads = no ; then
15503                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
15504 echo "configure:15505: checking for cthread_fork with -all_load" >&5
15505 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
15506   echo $ac_n "(cached) $ac_c" 1>&6
15507 else
15508   
15509                                                                 save_LIBS="$LIBS"
15510                                 LIBS="-all_load $LIBS"
15511                                 cat > conftest.$ac_ext <<EOF
15512 #line 15513 "configure"
15513 #include "confdefs.h"
15514 #include <mach/cthreads.h>
15515 int main() {
15516
15517                                         cthread_fork((void *)0, (void *)0);
15518                                         
15519 ; return 0; }
15520 EOF
15521 if { (eval echo configure:15522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15522   rm -rf conftest*
15523   ol_cv_cthread_all_load=yes
15524 else
15525   echo "configure: failed program was:" >&5
15526   cat conftest.$ac_ext >&5
15527   rm -rf conftest*
15528   ol_cv_cthread_all_load=no
15529 fi
15530 rm -f conftest*
15531                                                                 LIBS="$save_LIBS"
15532                         
15533 fi
15534
15535 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
15536
15537                         if test $ol_cv_cthread_all_load = yes ; then
15538                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
15539                                 ol_link_threads=mach
15540                                 ol_with_threads=found
15541                         fi
15542                 fi
15543
15544         elif test $ac_cv_header_cthreads_h = yes ; then
15545                                 
15546                 ol_with_threads=found
15547  
15548                                 save_LIBS="$LIBS"
15549                 LIBS="$LIBS -lthreads"
15550                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
15551 echo "configure:15552: checking for cthread_fork" >&5
15552 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
15553   echo $ac_n "(cached) $ac_c" 1>&6
15554 else
15555   cat > conftest.$ac_ext <<EOF
15556 #line 15557 "configure"
15557 #include "confdefs.h"
15558 /* System header to define __stub macros and hopefully few prototypes,
15559     which can conflict with char cthread_fork(); below.  */
15560 #include <assert.h>
15561 /* Override any gcc2 internal prototype to avoid an error.  */
15562 /* We use char because int might match the return type of a gcc2
15563     builtin and then its argument prototype would still apply.  */
15564 char cthread_fork();
15565 char (*f)();
15566
15567 int main() {
15568
15569 /* The GNU C library defines this for functions which it implements
15570     to always fail with ENOSYS.  Some functions are actually named
15571     something starting with __ and the normal name is an alias.  */
15572 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
15573 choke me
15574 #else
15575 f = cthread_fork;
15576 #endif
15577
15578 ; return 0; }
15579 EOF
15580 if { (eval echo configure:15581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15581   rm -rf conftest*
15582   eval "ac_cv_func_cthread_fork=yes"
15583 else
15584   echo "configure: failed program was:" >&5
15585   cat conftest.$ac_ext >&5
15586   rm -rf conftest*
15587   eval "ac_cv_func_cthread_fork=no"
15588 fi
15589 rm -f conftest*
15590 fi
15591
15592 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
15593   echo "$ac_t""yes" 1>&6
15594   ol_link_threads=yes
15595 else
15596   echo "$ac_t""no" 1>&6
15597 fi
15598
15599                 LIBS="$save_LIBS"
15600
15601                 if test $ol_link_threads = yes ; then
15602                         LTHREAD_LIBS="-lthreads"
15603                         ol_link_threads=mach
15604                         ol_with_threads=found
15605                 else
15606                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
15607                 fi
15608
15609         elif test $ol_with_threads = mach ; then
15610                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
15611         fi
15612
15613         if test $ol_link_threads = mach ; then
15614                 cat >> confdefs.h <<\EOF
15615 #define HAVE_MACH_CTHREADS 1
15616 EOF
15617
15618         elif test $ol_with_threads = found ; then
15619                 { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
15620         fi
15621 fi
15622
15623 if test $ol_with_threads = auto -o $ol_with_threads = yes \
15624         -o $ol_with_threads = pth ; then
15625
15626         for ac_hdr in pth.h
15627 do
15628 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15629 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15630 echo "configure:15631: checking for $ac_hdr" >&5
15631 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15632   echo $ac_n "(cached) $ac_c" 1>&6
15633 else
15634   cat > conftest.$ac_ext <<EOF
15635 #line 15636 "configure"
15636 #include "confdefs.h"
15637 #include <$ac_hdr>
15638 EOF
15639 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15640 { (eval echo configure:15641: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15641 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15642 if test -z "$ac_err"; then
15643   rm -rf conftest*
15644   eval "ac_cv_header_$ac_safe=yes"
15645 else
15646   echo "$ac_err" >&5
15647   echo "configure: failed program was:" >&5
15648   cat conftest.$ac_ext >&5
15649   rm -rf conftest*
15650   eval "ac_cv_header_$ac_safe=no"
15651 fi
15652 rm -f conftest*
15653 fi
15654 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15655   echo "$ac_t""yes" 1>&6
15656     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15657   cat >> confdefs.h <<EOF
15658 #define $ac_tr_hdr 1
15659 EOF
15660  
15661 else
15662   echo "$ac_t""no" 1>&6
15663 fi
15664 done
15665
15666
15667         if test $ac_cv_header_pth_h = yes ; then
15668                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
15669 echo "configure:15670: checking for pth_version in -lpth" >&5
15670 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
15671 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15672   echo $ac_n "(cached) $ac_c" 1>&6
15673 else
15674   ac_save_LIBS="$LIBS"
15675 LIBS="-lpth  $LIBS"
15676 cat > conftest.$ac_ext <<EOF
15677 #line 15678 "configure"
15678 #include "confdefs.h"
15679 /* Override any gcc2 internal prototype to avoid an error.  */
15680 /* We use char because int might match the return type of a gcc2
15681     builtin and then its argument prototype would still apply.  */
15682 char pth_version();
15683
15684 int main() {
15685 pth_version()
15686 ; return 0; }
15687 EOF
15688 if { (eval echo configure:15689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15689   rm -rf conftest*
15690   eval "ac_cv_lib_$ac_lib_var=yes"
15691 else
15692   echo "configure: failed program was:" >&5
15693   cat conftest.$ac_ext >&5
15694   rm -rf conftest*
15695   eval "ac_cv_lib_$ac_lib_var=no"
15696 fi
15697 rm -f conftest*
15698 LIBS="$ac_save_LIBS"
15699
15700 fi
15701 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15702   echo "$ac_t""yes" 1>&6
15703   have_pth=yes
15704 else
15705   echo "$ac_t""no" 1>&6
15706 have_pth=no
15707 fi
15708
15709
15710                 if test $have_pth = yes ; then
15711                         cat >> confdefs.h <<\EOF
15712 #define HAVE_GNU_PTH 1
15713 EOF
15714
15715                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
15716                         ol_link_threads=pth
15717                         ol_with_threads=found
15718
15719                         if test $ol_with_yielding_select = auto ; then
15720                                 ol_with_yielding_select=yes
15721                         fi
15722                 fi
15723         fi
15724 fi
15725
15726 if test $ol_with_threads = auto -o $ol_with_threads = yes \
15727         -o $ol_with_threads = lwp ; then
15728
15729                 for ac_hdr in thread.h synch.h
15730 do
15731 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15732 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15733 echo "configure:15734: checking for $ac_hdr" >&5
15734 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15735   echo $ac_n "(cached) $ac_c" 1>&6
15736 else
15737   cat > conftest.$ac_ext <<EOF
15738 #line 15739 "configure"
15739 #include "confdefs.h"
15740 #include <$ac_hdr>
15741 EOF
15742 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15743 { (eval echo configure:15744: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15744 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15745 if test -z "$ac_err"; then
15746   rm -rf conftest*
15747   eval "ac_cv_header_$ac_safe=yes"
15748 else
15749   echo "$ac_err" >&5
15750   echo "configure: failed program was:" >&5
15751   cat conftest.$ac_ext >&5
15752   rm -rf conftest*
15753   eval "ac_cv_header_$ac_safe=no"
15754 fi
15755 rm -f conftest*
15756 fi
15757 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15758   echo "$ac_t""yes" 1>&6
15759     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15760   cat >> confdefs.h <<EOF
15761 #define $ac_tr_hdr 1
15762 EOF
15763  
15764 else
15765   echo "$ac_t""no" 1>&6
15766 fi
15767 done
15768
15769         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
15770                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
15771 echo "configure:15772: checking for thr_create in -lthread" >&5
15772 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
15773 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15774   echo $ac_n "(cached) $ac_c" 1>&6
15775 else
15776   ac_save_LIBS="$LIBS"
15777 LIBS="-lthread  $LIBS"
15778 cat > conftest.$ac_ext <<EOF
15779 #line 15780 "configure"
15780 #include "confdefs.h"
15781 /* Override any gcc2 internal prototype to avoid an error.  */
15782 /* We use char because int might match the return type of a gcc2
15783     builtin and then its argument prototype would still apply.  */
15784 char thr_create();
15785
15786 int main() {
15787 thr_create()
15788 ; return 0; }
15789 EOF
15790 if { (eval echo configure:15791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15791   rm -rf conftest*
15792   eval "ac_cv_lib_$ac_lib_var=yes"
15793 else
15794   echo "configure: failed program was:" >&5
15795   cat conftest.$ac_ext >&5
15796   rm -rf conftest*
15797   eval "ac_cv_lib_$ac_lib_var=no"
15798 fi
15799 rm -f conftest*
15800 LIBS="$ac_save_LIBS"
15801
15802 fi
15803 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15804   echo "$ac_t""yes" 1>&6
15805   have_thr=yes
15806 else
15807   echo "$ac_t""no" 1>&6
15808 have_thr=no
15809 fi
15810
15811
15812                 if test $have_thr = yes ; then
15813                         cat >> confdefs.h <<\EOF
15814 #define HAVE_THR 1
15815 EOF
15816
15817                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
15818                         ol_link_threads=thr
15819
15820                         if test $ol_with_yielding_select = auto ; then
15821                                 ol_with_yielding_select=yes
15822                         fi
15823
15824                                                 for ac_func in \
15825                                 thr_setconcurrency \
15826                                 thr_getconcurrency \
15827                         
15828 do
15829 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15830 echo "configure:15831: checking for $ac_func" >&5
15831 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15832   echo $ac_n "(cached) $ac_c" 1>&6
15833 else
15834   cat > conftest.$ac_ext <<EOF
15835 #line 15836 "configure"
15836 #include "confdefs.h"
15837 /* System header to define __stub macros and hopefully few prototypes,
15838     which can conflict with char $ac_func(); below.  */
15839 #include <assert.h>
15840 /* Override any gcc2 internal prototype to avoid an error.  */
15841 /* We use char because int might match the return type of a gcc2
15842     builtin and then its argument prototype would still apply.  */
15843 char $ac_func();
15844 char (*f)();
15845
15846 int main() {
15847
15848 /* The GNU C library defines this for functions which it implements
15849     to always fail with ENOSYS.  Some functions are actually named
15850     something starting with __ and the normal name is an alias.  */
15851 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15852 choke me
15853 #else
15854 f = $ac_func;
15855 #endif
15856
15857 ; return 0; }
15858 EOF
15859 if { (eval echo configure:15860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15860   rm -rf conftest*
15861   eval "ac_cv_func_$ac_func=yes"
15862 else
15863   echo "configure: failed program was:" >&5
15864   cat conftest.$ac_ext >&5
15865   rm -rf conftest*
15866   eval "ac_cv_func_$ac_func=no"
15867 fi
15868 rm -f conftest*
15869 fi
15870
15871 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15872   echo "$ac_t""yes" 1>&6
15873     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15874   cat >> confdefs.h <<EOF
15875 #define $ac_tr_func 1
15876 EOF
15877  
15878 else
15879   echo "$ac_t""no" 1>&6
15880 fi
15881 done
15882
15883                 fi
15884         fi
15885
15886                 for ac_hdr in lwp/lwp.h
15887 do
15888 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15889 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15890 echo "configure:15891: checking for $ac_hdr" >&5
15891 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15892   echo $ac_n "(cached) $ac_c" 1>&6
15893 else
15894   cat > conftest.$ac_ext <<EOF
15895 #line 15896 "configure"
15896 #include "confdefs.h"
15897 #include <$ac_hdr>
15898 EOF
15899 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15900 { (eval echo configure:15901: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15901 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15902 if test -z "$ac_err"; then
15903   rm -rf conftest*
15904   eval "ac_cv_header_$ac_safe=yes"
15905 else
15906   echo "$ac_err" >&5
15907   echo "configure: failed program was:" >&5
15908   cat conftest.$ac_ext >&5
15909   rm -rf conftest*
15910   eval "ac_cv_header_$ac_safe=no"
15911 fi
15912 rm -f conftest*
15913 fi
15914 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15915   echo "$ac_t""yes" 1>&6
15916     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15917   cat >> confdefs.h <<EOF
15918 #define $ac_tr_hdr 1
15919 EOF
15920  
15921 else
15922   echo "$ac_t""no" 1>&6
15923 fi
15924 done
15925
15926         if test $ac_cv_header_lwp_lwp_h = yes ; then
15927                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
15928 echo "configure:15929: checking for lwp_create in -llwp" >&5
15929 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
15930 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15931   echo $ac_n "(cached) $ac_c" 1>&6
15932 else
15933   ac_save_LIBS="$LIBS"
15934 LIBS="-llwp  $LIBS"
15935 cat > conftest.$ac_ext <<EOF
15936 #line 15937 "configure"
15937 #include "confdefs.h"
15938 /* Override any gcc2 internal prototype to avoid an error.  */
15939 /* We use char because int might match the return type of a gcc2
15940     builtin and then its argument prototype would still apply.  */
15941 char lwp_create();
15942
15943 int main() {
15944 lwp_create()
15945 ; return 0; }
15946 EOF
15947 if { (eval echo configure:15948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15948   rm -rf conftest*
15949   eval "ac_cv_lib_$ac_lib_var=yes"
15950 else
15951   echo "configure: failed program was:" >&5
15952   cat conftest.$ac_ext >&5
15953   rm -rf conftest*
15954   eval "ac_cv_lib_$ac_lib_var=no"
15955 fi
15956 rm -f conftest*
15957 LIBS="$ac_save_LIBS"
15958
15959 fi
15960 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15961   echo "$ac_t""yes" 1>&6
15962   have_lwp=yes
15963 else
15964   echo "$ac_t""no" 1>&6
15965 have_lwp=no
15966 fi
15967
15968
15969                 if test $have_lwp = yes ; then
15970                         cat >> confdefs.h <<\EOF
15971 #define HAVE_LWP 1
15972 EOF
15973
15974                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
15975                         ol_link_threads=lwp
15976
15977                         if test $ol_with_yielding_select = auto ; then
15978                                 ol_with_yielding_select=no
15979                         fi
15980                 fi
15981         fi
15982 fi
15983
15984 if test $ol_with_yielding_select = yes ; then
15985         cat >> confdefs.h <<\EOF
15986 #define HAVE_YIELDING_SELECT 1
15987 EOF
15988
15989 fi
15990
15991 if test $ol_with_threads = manual ; then
15992                 ol_link_threads=yes
15993
15994         echo "configure: warning: thread defines and link options must be set manually" 1>&2
15995
15996         for ac_hdr in pthread.h sched.h
15997 do
15998 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15999 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16000 echo "configure:16001: checking for $ac_hdr" >&5
16001 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16002   echo $ac_n "(cached) $ac_c" 1>&6
16003 else
16004   cat > conftest.$ac_ext <<EOF
16005 #line 16006 "configure"
16006 #include "confdefs.h"
16007 #include <$ac_hdr>
16008 EOF
16009 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16010 { (eval echo configure:16011: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16011 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16012 if test -z "$ac_err"; then
16013   rm -rf conftest*
16014   eval "ac_cv_header_$ac_safe=yes"
16015 else
16016   echo "$ac_err" >&5
16017   echo "configure: failed program was:" >&5
16018   cat conftest.$ac_ext >&5
16019   rm -rf conftest*
16020   eval "ac_cv_header_$ac_safe=no"
16021 fi
16022 rm -f conftest*
16023 fi
16024 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16025   echo "$ac_t""yes" 1>&6
16026     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16027   cat >> confdefs.h <<EOF
16028 #define $ac_tr_hdr 1
16029 EOF
16030  
16031 else
16032   echo "$ac_t""no" 1>&6
16033 fi
16034 done
16035
16036         for ac_func in sched_yield pthread_yield
16037 do
16038 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16039 echo "configure:16040: checking for $ac_func" >&5
16040 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16041   echo $ac_n "(cached) $ac_c" 1>&6
16042 else
16043   cat > conftest.$ac_ext <<EOF
16044 #line 16045 "configure"
16045 #include "confdefs.h"
16046 /* System header to define __stub macros and hopefully few prototypes,
16047     which can conflict with char $ac_func(); below.  */
16048 #include <assert.h>
16049 /* Override any gcc2 internal prototype to avoid an error.  */
16050 /* We use char because int might match the return type of a gcc2
16051     builtin and then its argument prototype would still apply.  */
16052 char $ac_func();
16053 char (*f)();
16054
16055 int main() {
16056
16057 /* The GNU C library defines this for functions which it implements
16058     to always fail with ENOSYS.  Some functions are actually named
16059     something starting with __ and the normal name is an alias.  */
16060 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16061 choke me
16062 #else
16063 f = $ac_func;
16064 #endif
16065
16066 ; return 0; }
16067 EOF
16068 if { (eval echo configure:16069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16069   rm -rf conftest*
16070   eval "ac_cv_func_$ac_func=yes"
16071 else
16072   echo "configure: failed program was:" >&5
16073   cat conftest.$ac_ext >&5
16074   rm -rf conftest*
16075   eval "ac_cv_func_$ac_func=no"
16076 fi
16077 rm -f conftest*
16078 fi
16079
16080 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16081   echo "$ac_t""yes" 1>&6
16082     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16083   cat >> confdefs.h <<EOF
16084 #define $ac_tr_func 1
16085 EOF
16086  
16087 else
16088   echo "$ac_t""no" 1>&6
16089 fi
16090 done
16091
16092         
16093         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
16094 echo "configure:16095: checking for LinuxThreads pthread.h" >&5
16095 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
16096   echo $ac_n "(cached) $ac_c" 1>&6
16097 else
16098   cat > conftest.$ac_ext <<EOF
16099 #line 16100 "configure"
16100 #include "confdefs.h"
16101 #include <pthread.h>
16102 EOF
16103 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16104   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
16105   rm -rf conftest*
16106   ol_cv_header_linux_threads=yes
16107 else
16108   rm -rf conftest*
16109   ol_cv_header_linux_threads=no
16110 fi
16111 rm -f conftest*
16112
16113                 
16114 fi
16115
16116 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
16117         if test $ol_cv_header_linux_threads = yes; then
16118                 cat >> confdefs.h <<\EOF
16119 #define HAVE_LINUX_THREADS 1
16120 EOF
16121
16122         fi
16123
16124
16125         for ac_hdr in mach/cthreads.h
16126 do
16127 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16128 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16129 echo "configure:16130: checking for $ac_hdr" >&5
16130 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16131   echo $ac_n "(cached) $ac_c" 1>&6
16132 else
16133   cat > conftest.$ac_ext <<EOF
16134 #line 16135 "configure"
16135 #include "confdefs.h"
16136 #include <$ac_hdr>
16137 EOF
16138 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16139 { (eval echo configure:16140: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16140 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16141 if test -z "$ac_err"; then
16142   rm -rf conftest*
16143   eval "ac_cv_header_$ac_safe=yes"
16144 else
16145   echo "$ac_err" >&5
16146   echo "configure: failed program was:" >&5
16147   cat conftest.$ac_ext >&5
16148   rm -rf conftest*
16149   eval "ac_cv_header_$ac_safe=no"
16150 fi
16151 rm -f conftest*
16152 fi
16153 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16154   echo "$ac_t""yes" 1>&6
16155     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16156   cat >> confdefs.h <<EOF
16157 #define $ac_tr_hdr 1
16158 EOF
16159  
16160 else
16161   echo "$ac_t""no" 1>&6
16162 fi
16163 done
16164
16165         for ac_hdr in lwp/lwp.h
16166 do
16167 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16168 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16169 echo "configure:16170: checking for $ac_hdr" >&5
16170 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16171   echo $ac_n "(cached) $ac_c" 1>&6
16172 else
16173   cat > conftest.$ac_ext <<EOF
16174 #line 16175 "configure"
16175 #include "confdefs.h"
16176 #include <$ac_hdr>
16177 EOF
16178 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16179 { (eval echo configure:16180: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16180 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16181 if test -z "$ac_err"; then
16182   rm -rf conftest*
16183   eval "ac_cv_header_$ac_safe=yes"
16184 else
16185   echo "$ac_err" >&5
16186   echo "configure: failed program was:" >&5
16187   cat conftest.$ac_ext >&5
16188   rm -rf conftest*
16189   eval "ac_cv_header_$ac_safe=no"
16190 fi
16191 rm -f conftest*
16192 fi
16193 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16194   echo "$ac_t""yes" 1>&6
16195     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16196   cat >> confdefs.h <<EOF
16197 #define $ac_tr_hdr 1
16198 EOF
16199  
16200 else
16201   echo "$ac_t""no" 1>&6
16202 fi
16203 done
16204
16205         for ac_hdr in thread.h synch.h
16206 do
16207 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16208 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16209 echo "configure:16210: checking for $ac_hdr" >&5
16210 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16211   echo $ac_n "(cached) $ac_c" 1>&6
16212 else
16213   cat > conftest.$ac_ext <<EOF
16214 #line 16215 "configure"
16215 #include "confdefs.h"
16216 #include <$ac_hdr>
16217 EOF
16218 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16219 { (eval echo configure:16220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16220 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16221 if test -z "$ac_err"; then
16222   rm -rf conftest*
16223   eval "ac_cv_header_$ac_safe=yes"
16224 else
16225   echo "$ac_err" >&5
16226   echo "configure: failed program was:" >&5
16227   cat conftest.$ac_ext >&5
16228   rm -rf conftest*
16229   eval "ac_cv_header_$ac_safe=no"
16230 fi
16231 rm -f conftest*
16232 fi
16233 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16234   echo "$ac_t""yes" 1>&6
16235     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16236   cat >> confdefs.h <<EOF
16237 #define $ac_tr_hdr 1
16238 EOF
16239  
16240 else
16241   echo "$ac_t""no" 1>&6
16242 fi
16243 done
16244
16245 fi
16246
16247 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
16248                         cat >> confdefs.h <<\EOF
16249 #define REENTRANT 1
16250 EOF
16251
16252         cat >> confdefs.h <<\EOF
16253 #define _REENTRANT 1
16254 EOF
16255
16256         cat >> confdefs.h <<\EOF
16257 #define THREAD_SAFE 1
16258 EOF
16259
16260         cat >> confdefs.h <<\EOF
16261 #define _THREAD_SAFE 1
16262 EOF
16263
16264         cat >> confdefs.h <<\EOF
16265 #define THREADSAFE 1
16266 EOF
16267
16268         cat >> confdefs.h <<\EOF
16269 #define _THREADSAFE 1
16270 EOF
16271
16272         cat >> confdefs.h <<\EOF
16273 #define _SGI_MP_SOURCE 1
16274 EOF
16275
16276
16277                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
16278 echo "configure:16279: checking for thread specific errno" >&5
16279 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
16280   echo $ac_n "(cached) $ac_c" 1>&6
16281 else
16282   
16283                 cat > conftest.$ac_ext <<EOF
16284 #line 16285 "configure"
16285 #include "confdefs.h"
16286 #include <errno.h>
16287 int main() {
16288 errno = 0;
16289 ; return 0; }
16290 EOF
16291 if { (eval echo configure:16292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16292   rm -rf conftest*
16293   ol_cv_errno_thread_specific=yes
16294 else
16295   echo "configure: failed program was:" >&5
16296   cat conftest.$ac_ext >&5
16297   rm -rf conftest*
16298   ol_cv_errno_thread_specific=no
16299 fi
16300 rm -f conftest*
16301         
16302 fi
16303
16304 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
16305
16306                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
16307 echo "configure:16308: checking for thread specific h_errno" >&5
16308 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
16309   echo $ac_n "(cached) $ac_c" 1>&6
16310 else
16311   
16312                 cat > conftest.$ac_ext <<EOF
16313 #line 16314 "configure"
16314 #include "confdefs.h"
16315 #include <netdb.h>
16316 int main() {
16317 h_errno = 0;
16318 ; return 0; }
16319 EOF
16320 if { (eval echo configure:16321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16321   rm -rf conftest*
16322   ol_cv_h_errno_thread_specific=yes
16323 else
16324   echo "configure: failed program was:" >&5
16325   cat conftest.$ac_ext >&5
16326   rm -rf conftest*
16327   ol_cv_h_errno_thread_specific=no
16328 fi
16329 rm -f conftest*
16330         
16331 fi
16332
16333 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
16334
16335         if test $ol_cv_errno_thread_specific != yes \
16336                 -o $ol_cv_h_errno_thread_specific != yes ; then
16337                 LIBS="$LTHREAD_LIBS $LIBS"
16338                 LTHREAD_LIBS=""
16339         fi
16340
16341 fi  
16342
16343 if test $ol_link_threads = no ; then
16344         if test $ol_with_threads = yes ; then
16345                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
16346         fi
16347
16348         if test $ol_with_threads = auto ; then
16349                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
16350                 ol_with_threads=no
16351         fi
16352
16353         cat >> confdefs.h <<\EOF
16354 #define NO_THREADS 1
16355 EOF
16356
16357         LTHREAD_LIBS=""
16358 fi
16359
16360 if test $ol_link_threads != no ; then
16361         cat >> confdefs.h <<\EOF
16362 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
16363 EOF
16364
16365 fi
16366
16367 for ac_func in \
16368         ctime_r                 \
16369         gethostbyname_r gethostbyaddr_r \
16370
16371 do
16372 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16373 echo "configure:16374: checking for $ac_func" >&5
16374 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16375   echo $ac_n "(cached) $ac_c" 1>&6
16376 else
16377   cat > conftest.$ac_ext <<EOF
16378 #line 16379 "configure"
16379 #include "confdefs.h"
16380 /* System header to define __stub macros and hopefully few prototypes,
16381     which can conflict with char $ac_func(); below.  */
16382 #include <assert.h>
16383 /* Override any gcc2 internal prototype to avoid an error.  */
16384 /* We use char because int might match the return type of a gcc2
16385     builtin and then its argument prototype would still apply.  */
16386 char $ac_func();
16387 char (*f)();
16388
16389 int main() {
16390
16391 /* The GNU C library defines this for functions which it implements
16392     to always fail with ENOSYS.  Some functions are actually named
16393     something starting with __ and the normal name is an alias.  */
16394 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16395 choke me
16396 #else
16397 f = $ac_func;
16398 #endif
16399
16400 ; return 0; }
16401 EOF
16402 if { (eval echo configure:16403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16403   rm -rf conftest*
16404   eval "ac_cv_func_$ac_func=yes"
16405 else
16406   echo "configure: failed program was:" >&5
16407   cat conftest.$ac_ext >&5
16408   rm -rf conftest*
16409   eval "ac_cv_func_$ac_func=no"
16410 fi
16411 rm -f conftest*
16412 fi
16413
16414 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16415   echo "$ac_t""yes" 1>&6
16416     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16417   cat >> confdefs.h <<EOF
16418 #define $ac_tr_func 1
16419 EOF
16420  
16421 else
16422   echo "$ac_t""no" 1>&6
16423 fi
16424 done
16425
16426
16427 if test "$ac_cv_func_ctime_r" = no ; then
16428         ol_cv_func_ctime_r_nargs=0
16429 else
16430         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
16431 echo "configure:16432: checking number of arguments of ctime_r" >&5
16432 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
16433   echo $ac_n "(cached) $ac_c" 1>&6
16434 else
16435   cat > conftest.$ac_ext <<EOF
16436 #line 16437 "configure"
16437 #include "confdefs.h"
16438 #include <time.h>
16439 int main() {
16440 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
16441 ; return 0; }
16442 EOF
16443 if { (eval echo configure:16444: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16444   rm -rf conftest*
16445   ol_cv_func_ctime_r_nargs3=yes
16446 else
16447   echo "configure: failed program was:" >&5
16448   cat conftest.$ac_ext >&5
16449   rm -rf conftest*
16450   ol_cv_func_ctime_r_nargs3=no
16451 fi
16452 rm -f conftest*
16453
16454         cat > conftest.$ac_ext <<EOF
16455 #line 16456 "configure"
16456 #include "confdefs.h"
16457 #include <time.h>
16458 int main() {
16459 time_t ti; char *buffer; ctime_r(&ti,buffer);
16460 ; return 0; }
16461 EOF
16462 if { (eval echo configure:16463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16463   rm -rf conftest*
16464   ol_cv_func_ctime_r_nargs2=yes
16465 else
16466   echo "configure: failed program was:" >&5
16467   cat conftest.$ac_ext >&5
16468   rm -rf conftest*
16469   ol_cv_func_ctime_r_nargs2=no
16470 fi
16471 rm -f conftest*
16472
16473         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
16474                 $ol_cv_func_ctime_r_nargs2 = no ; then
16475
16476                 ol_cv_func_ctime_r_nargs=3
16477
16478         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
16479                 $ol_cv_func_ctime_r_nargs2 = yes ; then
16480
16481                 ol_cv_func_ctime_r_nargs=2
16482
16483         else
16484                 ol_cv_func_ctime_r_nargs=0
16485         fi
16486   
16487 fi
16488
16489 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
16490
16491   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
16492         cat >> confdefs.h <<EOF
16493 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
16494 EOF
16495
16496   fi
16497
16498 fi
16499
16500 if test "$ac_cv_func_gethostbyname_r" = yes ; then
16501         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
16502 echo "configure:16503: checking number of arguments of gethostbyname_r" >&5
16503 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
16504   echo $ac_n "(cached) $ac_c" 1>&6
16505 else
16506   cat > conftest.$ac_ext <<EOF
16507 #line 16508 "configure"
16508 #include "confdefs.h"
16509 #include <sys/types.h>
16510 #include <sys/socket.h>
16511 #include <netinet/in.h>
16512 #include <netdb.h>
16513 #define BUFSIZE (sizeof(struct hostent)+10)
16514 int main() {
16515 struct hostent hent; char buffer[BUFSIZE];
16516                 int bufsize=BUFSIZE;int h_errno;
16517                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
16518                         buffer, bufsize, &h_errno);
16519 ; return 0; }
16520 EOF
16521 if { (eval echo configure:16522: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16522   rm -rf conftest*
16523   ol_cv_func_gethostbyname_r_nargs5=yes
16524 else
16525   echo "configure: failed program was:" >&5
16526   cat conftest.$ac_ext >&5
16527   rm -rf conftest*
16528   ol_cv_func_gethostbyname_r_nargs5=no
16529 fi
16530 rm -f conftest*
16531
16532         cat > conftest.$ac_ext <<EOF
16533 #line 16534 "configure"
16534 #include "confdefs.h"
16535 #include <sys/types.h>
16536 #include <sys/socket.h>
16537 #include <netinet/in.h>
16538 #include <netdb.h>
16539 #define BUFSIZE (sizeof(struct hostent)+10)
16540 int main() {
16541 struct hostent hent;struct hostent *rhent;
16542                 char buffer[BUFSIZE];
16543                 int bufsize=BUFSIZE;int h_errno;
16544                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
16545                         &rhent, &h_errno);
16546 ; return 0; }
16547 EOF
16548 if { (eval echo configure:16549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16549   rm -rf conftest*
16550   ol_cv_func_gethostbyname_r_nargs6=yes
16551 else
16552   echo "configure: failed program was:" >&5
16553   cat conftest.$ac_ext >&5
16554   rm -rf conftest*
16555   ol_cv_func_gethostbyname_r_nargs6=no
16556 fi
16557 rm -f conftest*
16558
16559         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
16560                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
16561
16562                 ol_cv_func_gethostbyname_r_nargs=5
16563
16564         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
16565                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
16566
16567                 ol_cv_func_gethostbyname_r_nargs=6
16568
16569         else
16570                 ol_cv_func_gethostbyname_r_nargs=0
16571         fi
16572   
16573 fi
16574
16575 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
16576   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
16577         cat >> confdefs.h <<EOF
16578 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
16579 EOF
16580
16581   fi
16582
16583 else
16584         ol_cv_func_gethostbyname_r_nargs=0
16585 fi
16586  
16587 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
16588         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
16589 echo "configure:16590: checking number of arguments of gethostbyaddr_r" >&5
16590 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
16591   echo $ac_n "(cached) $ac_c" 1>&6
16592 else
16593   cat > conftest.$ac_ext <<EOF
16594 #line 16595 "configure"
16595 #include "confdefs.h"
16596 #include <sys/types.h>
16597 #include <sys/socket.h>
16598 #include <netinet/in.h>
16599 #include <netdb.h>
16600 #define BUFSIZE (sizeof(struct hostent)+10)
16601 int main() {
16602 struct hostent hent; char buffer[BUFSIZE]; 
16603             struct in_addr add;
16604             size_t alen=sizeof(struct in_addr);
16605             int bufsize=BUFSIZE;int h_errno;
16606                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
16607                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
16608 ; return 0; }
16609 EOF
16610 if { (eval echo configure:16611: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16611   rm -rf conftest*
16612   ol_cv_func_gethostbyaddr_r_nargs7=yes
16613 else
16614   echo "configure: failed program was:" >&5
16615   cat conftest.$ac_ext >&5
16616   rm -rf conftest*
16617   ol_cv_func_gethostbyaddr_r_nargs7=no
16618 fi
16619 rm -f conftest*
16620
16621         cat > conftest.$ac_ext <<EOF
16622 #line 16623 "configure"
16623 #include "confdefs.h"
16624 #include <sys/types.h>
16625 #include <sys/socket.h>
16626 #include <netinet/in.h>
16627 #include <netdb.h>
16628 #define BUFSIZE (sizeof(struct hostent)+10)
16629 int main() {
16630 struct hostent hent;
16631                 struct hostent *rhent; char buffer[BUFSIZE]; 
16632                 struct in_addr add;
16633                 size_t alen=sizeof(struct in_addr);
16634                 int bufsize=BUFSIZE;int h_errno;
16635                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
16636                         alen, AF_INET, &hent, buffer, bufsize, 
16637                         &rhent, &h_errno);
16638 ; return 0; }
16639 EOF
16640 if { (eval echo configure:16641: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16641   rm -rf conftest*
16642   ol_cv_func_gethostbyaddr_r_nargs8=yes
16643 else
16644   echo "configure: failed program was:" >&5
16645   cat conftest.$ac_ext >&5
16646   rm -rf conftest*
16647   ol_cv_func_gethostbyaddr_r_nargs8=no
16648 fi
16649 rm -f conftest*
16650
16651         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
16652                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
16653
16654                 ol_cv_func_gethostbyaddr_r_nargs=7
16655
16656         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
16657                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
16658
16659                 ol_cv_func_gethostbyaddr_r_nargs=8
16660
16661         else
16662                 ol_cv_func_gethostbyaddr_r_nargs=0
16663         fi
16664   
16665 fi
16666
16667 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
16668   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
16669     cat >> confdefs.h <<EOF
16670 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
16671 EOF
16672
16673   fi
16674
16675 else
16676         ol_cv_func_gethostbyaddr_r_nargs=0
16677 fi
16678
16679 ol_link_ldbm=no 
16680
16681 if test $ol_with_ldbm_api = auto \
16682         -o $ol_with_ldbm_api = berkeley \
16683         -o $ol_with_ldbm_api = bcompat ; then
16684
16685         if test $ol_with_ldbm_api = bcompat; then \
16686                 for ac_hdr in db_185.h db.h
16687 do
16688 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16689 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16690 echo "configure:16691: checking for $ac_hdr" >&5
16691 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16692   echo $ac_n "(cached) $ac_c" 1>&6
16693 else
16694   cat > conftest.$ac_ext <<EOF
16695 #line 16696 "configure"
16696 #include "confdefs.h"
16697 #include <$ac_hdr>
16698 EOF
16699 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16700 { (eval echo configure:16701: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16701 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16702 if test -z "$ac_err"; then
16703   rm -rf conftest*
16704   eval "ac_cv_header_$ac_safe=yes"
16705 else
16706   echo "$ac_err" >&5
16707   echo "configure: failed program was:" >&5
16708   cat conftest.$ac_ext >&5
16709   rm -rf conftest*
16710   eval "ac_cv_header_$ac_safe=no"
16711 fi
16712 rm -f conftest*
16713 fi
16714 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16715   echo "$ac_t""yes" 1>&6
16716     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16717   cat >> confdefs.h <<EOF
16718 #define $ac_tr_hdr 1
16719 EOF
16720  
16721 else
16722   echo "$ac_t""no" 1>&6
16723 fi
16724 done
16725
16726 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
16727         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
16728 echo "configure:16729: checking if Berkeley DB header compatibility" >&5
16729 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
16730   echo $ac_n "(cached) $ac_c" 1>&6
16731 else
16732   
16733                 cat > conftest.$ac_ext <<EOF
16734 #line 16735 "configure"
16735 #include "confdefs.h"
16736
16737 #if HAVE_DB_185_H
16738 #       include <db_185.h>
16739 #else
16740 #       include <db.h>
16741 #endif
16742
16743  /* this check could be improved */
16744 #ifndef DB_VERSION_MAJOR
16745 #       define DB_VERSION_MAJOR 1
16746 #endif
16747
16748 #if DB_VERSION_MAJOR == 1 
16749         __db_version_1
16750 #endif
16751
16752 EOF
16753 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16754   egrep "__db_version_1" >/dev/null 2>&1; then
16755   rm -rf conftest*
16756   ol_cv_header_db1=yes
16757 else
16758   rm -rf conftest*
16759   ol_cv_header_db1=no
16760 fi
16761 rm -f conftest*
16762
16763 fi
16764
16765 echo "$ac_t""$ol_cv_header_db1" 1>&6
16766
16767         if test $ol_cv_header_db1 = yes ; then
16768                 ol_cv_lib_db=no
16769 if test $ol_cv_lib_db = no ; then
16770         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
16771 echo "configure:16772: checking for Berkeley DB link (default)" >&5
16772 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
16773   echo $ac_n "(cached) $ac_c" 1>&6
16774 else
16775   
16776         ol_DB_LIB=
16777         ol_LIBS=$LIBS
16778         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16779
16780         cat > conftest.$ac_ext <<EOF
16781 #line 16782 "configure"
16782 #include "confdefs.h"
16783
16784 #ifdef HAVE_DB_185_H
16785 # include <db_185.h>
16786 #else
16787 # include <db.h>
16788 #endif
16789
16790 #ifndef DB_VERSION_MAJOR
16791 # define DB_VERSION_MAJOR 1
16792 #endif
16793
16794 #ifndef NULL
16795 #define NULL ((void*)0)
16796 #endif
16797
16798 int main() {
16799
16800 #if DB_VERSION_MAJOR > 1
16801         {
16802                 char *version;
16803                 int major, minor, patch;
16804
16805                 version = db_version( &major, &minor, &patch );
16806
16807                 if( major != DB_VERSION_MAJOR ||
16808                         minor < DB_VERSION_MINOR )
16809                 {
16810                         printf("Berkeley DB version mismatch\n"
16811                                 "\texpected: %s\n\tgot: %s\n",
16812                                 DB_VERSION_STRING, version);
16813                         return 1;
16814                 }
16815         }
16816 #endif
16817
16818 #if DB_VERSION_MAJOR > 2
16819         db_env_create( NULL, 0 );
16820 #elif DB_VERSION_MAJOR > 1
16821         db_appexit( NULL );
16822 #else
16823         (void) dbopen( NULL, 0, 0, 0, NULL);
16824 #endif
16825
16826 ; return 0; }
16827 EOF
16828 if { (eval echo configure:16829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16829   rm -rf conftest*
16830   ol_cv_db_none=yes
16831 else
16832   echo "configure: failed program was:" >&5
16833   cat conftest.$ac_ext >&5
16834   rm -rf conftest*
16835   ol_cv_db_none=no
16836 fi
16837 rm -f conftest*
16838
16839         LIBS="$ol_LIBS"
16840
16841 fi
16842
16843 echo "$ac_t""$ol_cv_db_none" 1>&6
16844
16845         if test $ol_cv_db_none = yes ; then
16846                 ol_cv_lib_db=yes
16847         fi
16848 fi
16849
16850 if test $ol_cv_lib_db = no ; then
16851         echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
16852 echo "configure:16853: checking for Berkeley DB link (-ldb4)" >&5
16853 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
16854   echo $ac_n "(cached) $ac_c" 1>&6
16855 else
16856   
16857         ol_DB_LIB=-ldb4
16858         ol_LIBS=$LIBS
16859         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16860
16861         cat > conftest.$ac_ext <<EOF
16862 #line 16863 "configure"
16863 #include "confdefs.h"
16864
16865 #ifdef HAVE_DB_185_H
16866 # include <db_185.h>
16867 #else
16868 # include <db.h>
16869 #endif
16870
16871 #ifndef DB_VERSION_MAJOR
16872 # define DB_VERSION_MAJOR 1
16873 #endif
16874
16875 #ifndef NULL
16876 #define NULL ((void*)0)
16877 #endif
16878
16879 int main() {
16880
16881 #if DB_VERSION_MAJOR > 1
16882         {
16883                 char *version;
16884                 int major, minor, patch;
16885
16886                 version = db_version( &major, &minor, &patch );
16887
16888                 if( major != DB_VERSION_MAJOR ||
16889                         minor < DB_VERSION_MINOR )
16890                 {
16891                         printf("Berkeley DB version mismatch\n"
16892                                 "\texpected: %s\n\tgot: %s\n",
16893                                 DB_VERSION_STRING, version);
16894                         return 1;
16895                 }
16896         }
16897 #endif
16898
16899 #if DB_VERSION_MAJOR > 2
16900         db_env_create( NULL, 0 );
16901 #elif DB_VERSION_MAJOR > 1
16902         db_appexit( NULL );
16903 #else
16904         (void) dbopen( NULL, 0, 0, 0, NULL);
16905 #endif
16906
16907 ; return 0; }
16908 EOF
16909 if { (eval echo configure:16910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16910   rm -rf conftest*
16911   ol_cv_db_db4=yes
16912 else
16913   echo "configure: failed program was:" >&5
16914   cat conftest.$ac_ext >&5
16915   rm -rf conftest*
16916   ol_cv_db_db4=no
16917 fi
16918 rm -f conftest*
16919
16920         LIBS="$ol_LIBS"
16921
16922 fi
16923
16924 echo "$ac_t""$ol_cv_db_db4" 1>&6
16925
16926         if test $ol_cv_db_db4 = yes ; then
16927                 ol_cv_lib_db=-ldb4
16928         fi
16929 fi
16930
16931 if test $ol_cv_lib_db = no ; then
16932         echo $ac_n "checking for Berkeley DB link (-ldb-4)""... $ac_c" 1>&6
16933 echo "configure:16934: checking for Berkeley DB link (-ldb-4)" >&5
16934 if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then
16935   echo $ac_n "(cached) $ac_c" 1>&6
16936 else
16937   
16938         ol_DB_LIB=-ldb-4
16939         ol_LIBS=$LIBS
16940         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16941
16942         cat > conftest.$ac_ext <<EOF
16943 #line 16944 "configure"
16944 #include "confdefs.h"
16945
16946 #ifdef HAVE_DB_185_H
16947 # include <db_185.h>
16948 #else
16949 # include <db.h>
16950 #endif
16951
16952 #ifndef DB_VERSION_MAJOR
16953 # define DB_VERSION_MAJOR 1
16954 #endif
16955
16956 #ifndef NULL
16957 #define NULL ((void*)0)
16958 #endif
16959
16960 int main() {
16961
16962 #if DB_VERSION_MAJOR > 1
16963         {
16964                 char *version;
16965                 int major, minor, patch;
16966
16967                 version = db_version( &major, &minor, &patch );
16968
16969                 if( major != DB_VERSION_MAJOR ||
16970                         minor < DB_VERSION_MINOR )
16971                 {
16972                         printf("Berkeley DB version mismatch\n"
16973                                 "\texpected: %s\n\tgot: %s\n",
16974                                 DB_VERSION_STRING, version);
16975                         return 1;
16976                 }
16977         }
16978 #endif
16979
16980 #if DB_VERSION_MAJOR > 2
16981         db_env_create( NULL, 0 );
16982 #elif DB_VERSION_MAJOR > 1
16983         db_appexit( NULL );
16984 #else
16985         (void) dbopen( NULL, 0, 0, 0, NULL);
16986 #endif
16987
16988 ; return 0; }
16989 EOF
16990 if { (eval echo configure:16991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16991   rm -rf conftest*
16992   ol_cv_db_db_4=yes
16993 else
16994   echo "configure: failed program was:" >&5
16995   cat conftest.$ac_ext >&5
16996   rm -rf conftest*
16997   ol_cv_db_db_4=no
16998 fi
16999 rm -f conftest*
17000
17001         LIBS="$ol_LIBS"
17002
17003 fi
17004
17005 echo "$ac_t""$ol_cv_db_db_4" 1>&6
17006
17007         if test $ol_cv_db_db_4 = yes ; then
17008                 ol_cv_lib_db=-ldb-4
17009         fi
17010 fi
17011
17012 if test $ol_cv_lib_db = no ; then
17013         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
17014 echo "configure:17015: checking for Berkeley DB link (-ldb)" >&5
17015 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
17016   echo $ac_n "(cached) $ac_c" 1>&6
17017 else
17018   
17019         ol_DB_LIB=-ldb
17020         ol_LIBS=$LIBS
17021         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17022
17023         cat > conftest.$ac_ext <<EOF
17024 #line 17025 "configure"
17025 #include "confdefs.h"
17026
17027 #ifdef HAVE_DB_185_H
17028 # include <db_185.h>
17029 #else
17030 # include <db.h>
17031 #endif
17032
17033 #ifndef DB_VERSION_MAJOR
17034 # define DB_VERSION_MAJOR 1
17035 #endif
17036
17037 #ifndef NULL
17038 #define NULL ((void*)0)
17039 #endif
17040
17041 int main() {
17042
17043 #if DB_VERSION_MAJOR > 1
17044         {
17045                 char *version;
17046                 int major, minor, patch;
17047
17048                 version = db_version( &major, &minor, &patch );
17049
17050                 if( major != DB_VERSION_MAJOR ||
17051                         minor < DB_VERSION_MINOR )
17052                 {
17053                         printf("Berkeley DB version mismatch\n"
17054                                 "\texpected: %s\n\tgot: %s\n",
17055                                 DB_VERSION_STRING, version);
17056                         return 1;
17057                 }
17058         }
17059 #endif
17060
17061 #if DB_VERSION_MAJOR > 2
17062         db_env_create( NULL, 0 );
17063 #elif DB_VERSION_MAJOR > 1
17064         db_appexit( NULL );
17065 #else
17066         (void) dbopen( NULL, 0, 0, 0, NULL);
17067 #endif
17068
17069 ; return 0; }
17070 EOF
17071 if { (eval echo configure:17072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17072   rm -rf conftest*
17073   ol_cv_db_db=yes
17074 else
17075   echo "configure: failed program was:" >&5
17076   cat conftest.$ac_ext >&5
17077   rm -rf conftest*
17078   ol_cv_db_db=no
17079 fi
17080 rm -f conftest*
17081
17082         LIBS="$ol_LIBS"
17083
17084 fi
17085
17086 echo "$ac_t""$ol_cv_db_db" 1>&6
17087
17088         if test $ol_cv_db_db = yes ; then
17089                 ol_cv_lib_db=-ldb
17090         fi
17091 fi
17092
17093 if test $ol_cv_lib_db = no ; then
17094         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
17095 echo "configure:17096: checking for Berkeley DB link (-ldb3)" >&5
17096 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
17097   echo $ac_n "(cached) $ac_c" 1>&6
17098 else
17099   
17100         ol_DB_LIB=-ldb3
17101         ol_LIBS=$LIBS
17102         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17103
17104         cat > conftest.$ac_ext <<EOF
17105 #line 17106 "configure"
17106 #include "confdefs.h"
17107
17108 #ifdef HAVE_DB_185_H
17109 # include <db_185.h>
17110 #else
17111 # include <db.h>
17112 #endif
17113
17114 #ifndef DB_VERSION_MAJOR
17115 # define DB_VERSION_MAJOR 1
17116 #endif
17117
17118 #ifndef NULL
17119 #define NULL ((void*)0)
17120 #endif
17121
17122 int main() {
17123
17124 #if DB_VERSION_MAJOR > 1
17125         {
17126                 char *version;
17127                 int major, minor, patch;
17128
17129                 version = db_version( &major, &minor, &patch );
17130
17131                 if( major != DB_VERSION_MAJOR ||
17132                         minor < DB_VERSION_MINOR )
17133                 {
17134                         printf("Berkeley DB version mismatch\n"
17135                                 "\texpected: %s\n\tgot: %s\n",
17136                                 DB_VERSION_STRING, version);
17137                         return 1;
17138                 }
17139         }
17140 #endif
17141
17142 #if DB_VERSION_MAJOR > 2
17143         db_env_create( NULL, 0 );
17144 #elif DB_VERSION_MAJOR > 1
17145         db_appexit( NULL );
17146 #else
17147         (void) dbopen( NULL, 0, 0, 0, NULL);
17148 #endif
17149
17150 ; return 0; }
17151 EOF
17152 if { (eval echo configure:17153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17153   rm -rf conftest*
17154   ol_cv_db_db3=yes
17155 else
17156   echo "configure: failed program was:" >&5
17157   cat conftest.$ac_ext >&5
17158   rm -rf conftest*
17159   ol_cv_db_db3=no
17160 fi
17161 rm -f conftest*
17162
17163         LIBS="$ol_LIBS"
17164
17165 fi
17166
17167 echo "$ac_t""$ol_cv_db_db3" 1>&6
17168
17169         if test $ol_cv_db_db3 = yes ; then
17170                 ol_cv_lib_db=-ldb3
17171         fi
17172 fi
17173
17174 if test $ol_cv_lib_db = no ; then
17175         echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6
17176 echo "configure:17177: checking for Berkeley DB link (-ldb-3)" >&5
17177 if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then
17178   echo $ac_n "(cached) $ac_c" 1>&6
17179 else
17180   
17181         ol_DB_LIB=-ldb-3
17182         ol_LIBS=$LIBS
17183         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17184
17185         cat > conftest.$ac_ext <<EOF
17186 #line 17187 "configure"
17187 #include "confdefs.h"
17188
17189 #ifdef HAVE_DB_185_H
17190 # include <db_185.h>
17191 #else
17192 # include <db.h>
17193 #endif
17194
17195 #ifndef DB_VERSION_MAJOR
17196 # define DB_VERSION_MAJOR 1
17197 #endif
17198
17199 #ifndef NULL
17200 #define NULL ((void*)0)
17201 #endif
17202
17203 int main() {
17204
17205 #if DB_VERSION_MAJOR > 1
17206         {
17207                 char *version;
17208                 int major, minor, patch;
17209
17210                 version = db_version( &major, &minor, &patch );
17211
17212                 if( major != DB_VERSION_MAJOR ||
17213                         minor < DB_VERSION_MINOR )
17214                 {
17215                         printf("Berkeley DB version mismatch\n"
17216                                 "\texpected: %s\n\tgot: %s\n",
17217                                 DB_VERSION_STRING, version);
17218                         return 1;
17219                 }
17220         }
17221 #endif
17222
17223 #if DB_VERSION_MAJOR > 2
17224         db_env_create( NULL, 0 );
17225 #elif DB_VERSION_MAJOR > 1
17226         db_appexit( NULL );
17227 #else
17228         (void) dbopen( NULL, 0, 0, 0, NULL);
17229 #endif
17230
17231 ; return 0; }
17232 EOF
17233 if { (eval echo configure:17234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17234   rm -rf conftest*
17235   ol_cv_db_db_3=yes
17236 else
17237   echo "configure: failed program was:" >&5
17238   cat conftest.$ac_ext >&5
17239   rm -rf conftest*
17240   ol_cv_db_db_3=no
17241 fi
17242 rm -f conftest*
17243
17244         LIBS="$ol_LIBS"
17245
17246 fi
17247
17248 echo "$ac_t""$ol_cv_db_db_3" 1>&6
17249
17250         if test $ol_cv_db_db_3 = yes ; then
17251                 ol_cv_lib_db=-ldb-3
17252         fi
17253 fi
17254
17255 if test $ol_cv_lib_db = no ; then
17256         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
17257 echo "configure:17258: checking for Berkeley DB link (-ldb2)" >&5
17258 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
17259   echo $ac_n "(cached) $ac_c" 1>&6
17260 else
17261   
17262         ol_DB_LIB=-ldb2
17263         ol_LIBS=$LIBS
17264         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17265
17266         cat > conftest.$ac_ext <<EOF
17267 #line 17268 "configure"
17268 #include "confdefs.h"
17269
17270 #ifdef HAVE_DB_185_H
17271 # include <db_185.h>
17272 #else
17273 # include <db.h>
17274 #endif
17275
17276 #ifndef DB_VERSION_MAJOR
17277 # define DB_VERSION_MAJOR 1
17278 #endif
17279
17280 #ifndef NULL
17281 #define NULL ((void*)0)
17282 #endif
17283
17284 int main() {
17285
17286 #if DB_VERSION_MAJOR > 1
17287         {
17288                 char *version;
17289                 int major, minor, patch;
17290
17291                 version = db_version( &major, &minor, &patch );
17292
17293                 if( major != DB_VERSION_MAJOR ||
17294                         minor < DB_VERSION_MINOR )
17295                 {
17296                         printf("Berkeley DB version mismatch\n"
17297                                 "\texpected: %s\n\tgot: %s\n",
17298                                 DB_VERSION_STRING, version);
17299                         return 1;
17300                 }
17301         }
17302 #endif
17303
17304 #if DB_VERSION_MAJOR > 2
17305         db_env_create( NULL, 0 );
17306 #elif DB_VERSION_MAJOR > 1
17307         db_appexit( NULL );
17308 #else
17309         (void) dbopen( NULL, 0, 0, 0, NULL);
17310 #endif
17311
17312 ; return 0; }
17313 EOF
17314 if { (eval echo configure:17315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17315   rm -rf conftest*
17316   ol_cv_db_db2=yes
17317 else
17318   echo "configure: failed program was:" >&5
17319   cat conftest.$ac_ext >&5
17320   rm -rf conftest*
17321   ol_cv_db_db2=no
17322 fi
17323 rm -f conftest*
17324
17325         LIBS="$ol_LIBS"
17326
17327 fi
17328
17329 echo "$ac_t""$ol_cv_db_db2" 1>&6
17330
17331         if test $ol_cv_db_db2 = yes ; then
17332                 ol_cv_lib_db=-ldb2
17333         fi
17334 fi
17335
17336 if test $ol_cv_lib_db = no ; then
17337         echo $ac_n "checking for Berkeley DB link (-ldb-2)""... $ac_c" 1>&6
17338 echo "configure:17339: checking for Berkeley DB link (-ldb-2)" >&5
17339 if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then
17340   echo $ac_n "(cached) $ac_c" 1>&6
17341 else
17342   
17343         ol_DB_LIB=-ldb-2
17344         ol_LIBS=$LIBS
17345         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17346
17347         cat > conftest.$ac_ext <<EOF
17348 #line 17349 "configure"
17349 #include "confdefs.h"
17350
17351 #ifdef HAVE_DB_185_H
17352 # include <db_185.h>
17353 #else
17354 # include <db.h>
17355 #endif
17356
17357 #ifndef DB_VERSION_MAJOR
17358 # define DB_VERSION_MAJOR 1
17359 #endif
17360
17361 #ifndef NULL
17362 #define NULL ((void*)0)
17363 #endif
17364
17365 int main() {
17366
17367 #if DB_VERSION_MAJOR > 1
17368         {
17369                 char *version;
17370                 int major, minor, patch;
17371
17372                 version = db_version( &major, &minor, &patch );
17373
17374                 if( major != DB_VERSION_MAJOR ||
17375                         minor < DB_VERSION_MINOR )
17376                 {
17377                         printf("Berkeley DB version mismatch\n"
17378                                 "\texpected: %s\n\tgot: %s\n",
17379                                 DB_VERSION_STRING, version);
17380                         return 1;
17381                 }
17382         }
17383 #endif
17384
17385 #if DB_VERSION_MAJOR > 2
17386         db_env_create( NULL, 0 );
17387 #elif DB_VERSION_MAJOR > 1
17388         db_appexit( NULL );
17389 #else
17390         (void) dbopen( NULL, 0, 0, 0, NULL);
17391 #endif
17392
17393 ; return 0; }
17394 EOF
17395 if { (eval echo configure:17396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17396   rm -rf conftest*
17397   ol_cv_db_db_2=yes
17398 else
17399   echo "configure: failed program was:" >&5
17400   cat conftest.$ac_ext >&5
17401   rm -rf conftest*
17402   ol_cv_db_db_2=no
17403 fi
17404 rm -f conftest*
17405
17406         LIBS="$ol_LIBS"
17407
17408 fi
17409
17410 echo "$ac_t""$ol_cv_db_db_2" 1>&6
17411
17412         if test $ol_cv_db_db_2 = yes ; then
17413                 ol_cv_lib_db=-ldb-2
17414         fi
17415 fi
17416
17417 if test $ol_cv_lib_db = no ; then
17418         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
17419 echo "configure:17420: checking for Berkeley DB link (-ldb1)" >&5
17420 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
17421   echo $ac_n "(cached) $ac_c" 1>&6
17422 else
17423   
17424         ol_DB_LIB=-ldb1
17425         ol_LIBS=$LIBS
17426         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17427
17428         cat > conftest.$ac_ext <<EOF
17429 #line 17430 "configure"
17430 #include "confdefs.h"
17431
17432 #ifdef HAVE_DB_185_H
17433 # include <db_185.h>
17434 #else
17435 # include <db.h>
17436 #endif
17437
17438 #ifndef DB_VERSION_MAJOR
17439 # define DB_VERSION_MAJOR 1
17440 #endif
17441
17442 #ifndef NULL
17443 #define NULL ((void*)0)
17444 #endif
17445
17446 int main() {
17447
17448 #if DB_VERSION_MAJOR > 1
17449         {
17450                 char *version;
17451                 int major, minor, patch;
17452
17453                 version = db_version( &major, &minor, &patch );
17454
17455                 if( major != DB_VERSION_MAJOR ||
17456                         minor < DB_VERSION_MINOR )
17457                 {
17458                         printf("Berkeley DB version mismatch\n"
17459                                 "\texpected: %s\n\tgot: %s\n",
17460                                 DB_VERSION_STRING, version);
17461                         return 1;
17462                 }
17463         }
17464 #endif
17465
17466 #if DB_VERSION_MAJOR > 2
17467         db_env_create( NULL, 0 );
17468 #elif DB_VERSION_MAJOR > 1
17469         db_appexit( NULL );
17470 #else
17471         (void) dbopen( NULL, 0, 0, 0, NULL);
17472 #endif
17473
17474 ; return 0; }
17475 EOF
17476 if { (eval echo configure:17477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17477   rm -rf conftest*
17478   ol_cv_db_db1=yes
17479 else
17480   echo "configure: failed program was:" >&5
17481   cat conftest.$ac_ext >&5
17482   rm -rf conftest*
17483   ol_cv_db_db1=no
17484 fi
17485 rm -f conftest*
17486
17487         LIBS="$ol_LIBS"
17488
17489 fi
17490
17491 echo "$ac_t""$ol_cv_db_db1" 1>&6
17492
17493         if test $ol_cv_db_db1 = yes ; then
17494                 ol_cv_lib_db=-ldb1
17495         fi
17496 fi
17497
17498 if test $ol_cv_lib_db = no ; then
17499         echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6
17500 echo "configure:17501: checking for Berkeley DB link (-ldb-1)" >&5
17501 if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then
17502   echo $ac_n "(cached) $ac_c" 1>&6
17503 else
17504   
17505         ol_DB_LIB=-ldb-1
17506         ol_LIBS=$LIBS
17507         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17508
17509         cat > conftest.$ac_ext <<EOF
17510 #line 17511 "configure"
17511 #include "confdefs.h"
17512
17513 #ifdef HAVE_DB_185_H
17514 # include <db_185.h>
17515 #else
17516 # include <db.h>
17517 #endif
17518
17519 #ifndef DB_VERSION_MAJOR
17520 # define DB_VERSION_MAJOR 1
17521 #endif
17522
17523 #ifndef NULL
17524 #define NULL ((void*)0)
17525 #endif
17526
17527 int main() {
17528
17529 #if DB_VERSION_MAJOR > 1
17530         {
17531                 char *version;
17532                 int major, minor, patch;
17533
17534                 version = db_version( &major, &minor, &patch );
17535
17536                 if( major != DB_VERSION_MAJOR ||
17537                         minor < DB_VERSION_MINOR )
17538                 {
17539                         printf("Berkeley DB version mismatch\n"
17540                                 "\texpected: %s\n\tgot: %s\n",
17541                                 DB_VERSION_STRING, version);
17542                         return 1;
17543                 }
17544         }
17545 #endif
17546
17547 #if DB_VERSION_MAJOR > 2
17548         db_env_create( NULL, 0 );
17549 #elif DB_VERSION_MAJOR > 1
17550         db_appexit( NULL );
17551 #else
17552         (void) dbopen( NULL, 0, 0, 0, NULL);
17553 #endif
17554
17555 ; return 0; }
17556 EOF
17557 if { (eval echo configure:17558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17558   rm -rf conftest*
17559   ol_cv_db_db_1=yes
17560 else
17561   echo "configure: failed program was:" >&5
17562   cat conftest.$ac_ext >&5
17563   rm -rf conftest*
17564   ol_cv_db_db_1=no
17565 fi
17566 rm -f conftest*
17567
17568         LIBS="$ol_LIBS"
17569
17570 fi
17571
17572 echo "$ac_t""$ol_cv_db_db_1" 1>&6
17573
17574         if test $ol_cv_db_db_1 = yes ; then
17575                 ol_cv_lib_db=-ldb-1
17576         fi
17577 fi
17578
17579
17580                 if test "$ol_cv_lib_db" != no ; then
17581                         ol_cv_berkeley_db=yes
17582                 fi
17583         fi
17584 fi
17585
17586         else
17587                 ol_cv_berkeley_db=no
17588 for ac_hdr in db.h
17589 do
17590 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
17591 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
17592 echo "configure:17593: checking for $ac_hdr" >&5
17593 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
17594   echo $ac_n "(cached) $ac_c" 1>&6
17595 else
17596   cat > conftest.$ac_ext <<EOF
17597 #line 17598 "configure"
17598 #include "confdefs.h"
17599 #include <$ac_hdr>
17600 EOF
17601 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
17602 { (eval echo configure:17603: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
17603 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
17604 if test -z "$ac_err"; then
17605   rm -rf conftest*
17606   eval "ac_cv_header_$ac_safe=yes"
17607 else
17608   echo "$ac_err" >&5
17609   echo "configure: failed program was:" >&5
17610   cat conftest.$ac_ext >&5
17611   rm -rf conftest*
17612   eval "ac_cv_header_$ac_safe=no"
17613 fi
17614 rm -f conftest*
17615 fi
17616 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
17617   echo "$ac_t""yes" 1>&6
17618     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
17619   cat >> confdefs.h <<EOF
17620 #define $ac_tr_hdr 1
17621 EOF
17622  
17623 else
17624   echo "$ac_t""no" 1>&6
17625 fi
17626 done
17627
17628 if test $ac_cv_header_db_h = yes; then
17629         ol_cv_lib_db=no
17630 if test $ol_cv_lib_db = no ; then
17631         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
17632 echo "configure:17633: checking for Berkeley DB link (default)" >&5
17633 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
17634   echo $ac_n "(cached) $ac_c" 1>&6
17635 else
17636   
17637         ol_DB_LIB=
17638         ol_LIBS=$LIBS
17639         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17640
17641         cat > conftest.$ac_ext <<EOF
17642 #line 17643 "configure"
17643 #include "confdefs.h"
17644
17645 #ifdef HAVE_DB_185_H
17646 # include <db_185.h>
17647 #else
17648 # include <db.h>
17649 #endif
17650
17651 #ifndef DB_VERSION_MAJOR
17652 # define DB_VERSION_MAJOR 1
17653 #endif
17654
17655 #ifndef NULL
17656 #define NULL ((void*)0)
17657 #endif
17658
17659 int main() {
17660
17661 #if DB_VERSION_MAJOR > 1
17662         {
17663                 char *version;
17664                 int major, minor, patch;
17665
17666                 version = db_version( &major, &minor, &patch );
17667
17668                 if( major != DB_VERSION_MAJOR ||
17669                         minor < DB_VERSION_MINOR )
17670                 {
17671                         printf("Berkeley DB version mismatch\n"
17672                                 "\texpected: %s\n\tgot: %s\n",
17673                                 DB_VERSION_STRING, version);
17674                         return 1;
17675                 }
17676         }
17677 #endif
17678
17679 #if DB_VERSION_MAJOR > 2
17680         db_env_create( NULL, 0 );
17681 #elif DB_VERSION_MAJOR > 1
17682         db_appexit( NULL );
17683 #else
17684         (void) dbopen( NULL, 0, 0, 0, NULL);
17685 #endif
17686
17687 ; return 0; }
17688 EOF
17689 if { (eval echo configure:17690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17690   rm -rf conftest*
17691   ol_cv_db_none=yes
17692 else
17693   echo "configure: failed program was:" >&5
17694   cat conftest.$ac_ext >&5
17695   rm -rf conftest*
17696   ol_cv_db_none=no
17697 fi
17698 rm -f conftest*
17699
17700         LIBS="$ol_LIBS"
17701
17702 fi
17703
17704 echo "$ac_t""$ol_cv_db_none" 1>&6
17705
17706         if test $ol_cv_db_none = yes ; then
17707                 ol_cv_lib_db=yes
17708         fi
17709 fi
17710
17711 if test $ol_cv_lib_db = no ; then
17712         echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
17713 echo "configure:17714: checking for Berkeley DB link (-ldb4)" >&5
17714 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
17715   echo $ac_n "(cached) $ac_c" 1>&6
17716 else
17717   
17718         ol_DB_LIB=-ldb4
17719         ol_LIBS=$LIBS
17720         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17721
17722         cat > conftest.$ac_ext <<EOF
17723 #line 17724 "configure"
17724 #include "confdefs.h"
17725
17726 #ifdef HAVE_DB_185_H
17727 # include <db_185.h>
17728 #else
17729 # include <db.h>
17730 #endif
17731
17732 #ifndef DB_VERSION_MAJOR
17733 # define DB_VERSION_MAJOR 1
17734 #endif
17735
17736 #ifndef NULL
17737 #define NULL ((void*)0)
17738 #endif
17739
17740 int main() {
17741
17742 #if DB_VERSION_MAJOR > 1
17743         {
17744                 char *version;
17745                 int major, minor, patch;
17746
17747                 version = db_version( &major, &minor, &patch );
17748
17749                 if( major != DB_VERSION_MAJOR ||
17750                         minor < DB_VERSION_MINOR )
17751                 {
17752                         printf("Berkeley DB version mismatch\n"
17753                                 "\texpected: %s\n\tgot: %s\n",
17754                                 DB_VERSION_STRING, version);
17755                         return 1;
17756                 }
17757         }
17758 #endif
17759
17760 #if DB_VERSION_MAJOR > 2
17761         db_env_create( NULL, 0 );
17762 #elif DB_VERSION_MAJOR > 1
17763         db_appexit( NULL );
17764 #else
17765         (void) dbopen( NULL, 0, 0, 0, NULL);
17766 #endif
17767
17768 ; return 0; }
17769 EOF
17770 if { (eval echo configure:17771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17771   rm -rf conftest*
17772   ol_cv_db_db4=yes
17773 else
17774   echo "configure: failed program was:" >&5
17775   cat conftest.$ac_ext >&5
17776   rm -rf conftest*
17777   ol_cv_db_db4=no
17778 fi
17779 rm -f conftest*
17780
17781         LIBS="$ol_LIBS"
17782
17783 fi
17784
17785 echo "$ac_t""$ol_cv_db_db4" 1>&6
17786
17787         if test $ol_cv_db_db4 = yes ; then
17788                 ol_cv_lib_db=-ldb4
17789         fi
17790 fi
17791
17792 if test $ol_cv_lib_db = no ; then
17793         echo $ac_n "checking for Berkeley DB link (-ldb-4)""... $ac_c" 1>&6
17794 echo "configure:17795: checking for Berkeley DB link (-ldb-4)" >&5
17795 if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then
17796   echo $ac_n "(cached) $ac_c" 1>&6
17797 else
17798   
17799         ol_DB_LIB=-ldb-4
17800         ol_LIBS=$LIBS
17801         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17802
17803         cat > conftest.$ac_ext <<EOF
17804 #line 17805 "configure"
17805 #include "confdefs.h"
17806
17807 #ifdef HAVE_DB_185_H
17808 # include <db_185.h>
17809 #else
17810 # include <db.h>
17811 #endif
17812
17813 #ifndef DB_VERSION_MAJOR
17814 # define DB_VERSION_MAJOR 1
17815 #endif
17816
17817 #ifndef NULL
17818 #define NULL ((void*)0)
17819 #endif
17820
17821 int main() {
17822
17823 #if DB_VERSION_MAJOR > 1
17824         {
17825                 char *version;
17826                 int major, minor, patch;
17827
17828                 version = db_version( &major, &minor, &patch );
17829
17830                 if( major != DB_VERSION_MAJOR ||
17831                         minor < DB_VERSION_MINOR )
17832                 {
17833                         printf("Berkeley DB version mismatch\n"
17834                                 "\texpected: %s\n\tgot: %s\n",
17835                                 DB_VERSION_STRING, version);
17836                         return 1;
17837                 }
17838         }
17839 #endif
17840
17841 #if DB_VERSION_MAJOR > 2
17842         db_env_create( NULL, 0 );
17843 #elif DB_VERSION_MAJOR > 1
17844         db_appexit( NULL );
17845 #else
17846         (void) dbopen( NULL, 0, 0, 0, NULL);
17847 #endif
17848
17849 ; return 0; }
17850 EOF
17851 if { (eval echo configure:17852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17852   rm -rf conftest*
17853   ol_cv_db_db_4=yes
17854 else
17855   echo "configure: failed program was:" >&5
17856   cat conftest.$ac_ext >&5
17857   rm -rf conftest*
17858   ol_cv_db_db_4=no
17859 fi
17860 rm -f conftest*
17861
17862         LIBS="$ol_LIBS"
17863
17864 fi
17865
17866 echo "$ac_t""$ol_cv_db_db_4" 1>&6
17867
17868         if test $ol_cv_db_db_4 = yes ; then
17869                 ol_cv_lib_db=-ldb-4
17870         fi
17871 fi
17872
17873 if test $ol_cv_lib_db = no ; then
17874         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
17875 echo "configure:17876: checking for Berkeley DB link (-ldb)" >&5
17876 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
17877   echo $ac_n "(cached) $ac_c" 1>&6
17878 else
17879   
17880         ol_DB_LIB=-ldb
17881         ol_LIBS=$LIBS
17882         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17883
17884         cat > conftest.$ac_ext <<EOF
17885 #line 17886 "configure"
17886 #include "confdefs.h"
17887
17888 #ifdef HAVE_DB_185_H
17889 # include <db_185.h>
17890 #else
17891 # include <db.h>
17892 #endif
17893
17894 #ifndef DB_VERSION_MAJOR
17895 # define DB_VERSION_MAJOR 1
17896 #endif
17897
17898 #ifndef NULL
17899 #define NULL ((void*)0)
17900 #endif
17901
17902 int main() {
17903
17904 #if DB_VERSION_MAJOR > 1
17905         {
17906                 char *version;
17907                 int major, minor, patch;
17908
17909                 version = db_version( &major, &minor, &patch );
17910
17911                 if( major != DB_VERSION_MAJOR ||
17912                         minor < DB_VERSION_MINOR )
17913                 {
17914                         printf("Berkeley DB version mismatch\n"
17915                                 "\texpected: %s\n\tgot: %s\n",
17916                                 DB_VERSION_STRING, version);
17917                         return 1;
17918                 }
17919         }
17920 #endif
17921
17922 #if DB_VERSION_MAJOR > 2
17923         db_env_create( NULL, 0 );
17924 #elif DB_VERSION_MAJOR > 1
17925         db_appexit( NULL );
17926 #else
17927         (void) dbopen( NULL, 0, 0, 0, NULL);
17928 #endif
17929
17930 ; return 0; }
17931 EOF
17932 if { (eval echo configure:17933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17933   rm -rf conftest*
17934   ol_cv_db_db=yes
17935 else
17936   echo "configure: failed program was:" >&5
17937   cat conftest.$ac_ext >&5
17938   rm -rf conftest*
17939   ol_cv_db_db=no
17940 fi
17941 rm -f conftest*
17942
17943         LIBS="$ol_LIBS"
17944
17945 fi
17946
17947 echo "$ac_t""$ol_cv_db_db" 1>&6
17948
17949         if test $ol_cv_db_db = yes ; then
17950                 ol_cv_lib_db=-ldb
17951         fi
17952 fi
17953
17954 if test $ol_cv_lib_db = no ; then
17955         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
17956 echo "configure:17957: checking for Berkeley DB link (-ldb3)" >&5
17957 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
17958   echo $ac_n "(cached) $ac_c" 1>&6
17959 else
17960   
17961         ol_DB_LIB=-ldb3
17962         ol_LIBS=$LIBS
17963         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17964
17965         cat > conftest.$ac_ext <<EOF
17966 #line 17967 "configure"
17967 #include "confdefs.h"
17968
17969 #ifdef HAVE_DB_185_H
17970 # include <db_185.h>
17971 #else
17972 # include <db.h>
17973 #endif
17974
17975 #ifndef DB_VERSION_MAJOR
17976 # define DB_VERSION_MAJOR 1
17977 #endif
17978
17979 #ifndef NULL
17980 #define NULL ((void*)0)
17981 #endif
17982
17983 int main() {
17984
17985 #if DB_VERSION_MAJOR > 1
17986         {
17987                 char *version;
17988                 int major, minor, patch;
17989
17990                 version = db_version( &major, &minor, &patch );
17991
17992                 if( major != DB_VERSION_MAJOR ||
17993                         minor < DB_VERSION_MINOR )
17994                 {
17995                         printf("Berkeley DB version mismatch\n"
17996                                 "\texpected: %s\n\tgot: %s\n",
17997                                 DB_VERSION_STRING, version);
17998                         return 1;
17999                 }
18000         }
18001 #endif
18002
18003 #if DB_VERSION_MAJOR > 2
18004         db_env_create( NULL, 0 );
18005 #elif DB_VERSION_MAJOR > 1
18006         db_appexit( NULL );
18007 #else
18008         (void) dbopen( NULL, 0, 0, 0, NULL);
18009 #endif
18010
18011 ; return 0; }
18012 EOF
18013 if { (eval echo configure:18014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18014   rm -rf conftest*
18015   ol_cv_db_db3=yes
18016 else
18017   echo "configure: failed program was:" >&5
18018   cat conftest.$ac_ext >&5
18019   rm -rf conftest*
18020   ol_cv_db_db3=no
18021 fi
18022 rm -f conftest*
18023
18024         LIBS="$ol_LIBS"
18025
18026 fi
18027
18028 echo "$ac_t""$ol_cv_db_db3" 1>&6
18029
18030         if test $ol_cv_db_db3 = yes ; then
18031                 ol_cv_lib_db=-ldb3
18032         fi
18033 fi
18034
18035 if test $ol_cv_lib_db = no ; then
18036         echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6
18037 echo "configure:18038: checking for Berkeley DB link (-ldb-3)" >&5
18038 if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then
18039   echo $ac_n "(cached) $ac_c" 1>&6
18040 else
18041   
18042         ol_DB_LIB=-ldb-3
18043         ol_LIBS=$LIBS
18044         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18045
18046         cat > conftest.$ac_ext <<EOF
18047 #line 18048 "configure"
18048 #include "confdefs.h"
18049
18050 #ifdef HAVE_DB_185_H
18051 # include <db_185.h>
18052 #else
18053 # include <db.h>
18054 #endif
18055
18056 #ifndef DB_VERSION_MAJOR
18057 # define DB_VERSION_MAJOR 1
18058 #endif
18059
18060 #ifndef NULL
18061 #define NULL ((void*)0)
18062 #endif
18063
18064 int main() {
18065
18066 #if DB_VERSION_MAJOR > 1
18067         {
18068                 char *version;
18069                 int major, minor, patch;
18070
18071                 version = db_version( &major, &minor, &patch );
18072
18073                 if( major != DB_VERSION_MAJOR ||
18074                         minor < DB_VERSION_MINOR )
18075                 {
18076                         printf("Berkeley DB version mismatch\n"
18077                                 "\texpected: %s\n\tgot: %s\n",
18078                                 DB_VERSION_STRING, version);
18079                         return 1;
18080                 }
18081         }
18082 #endif
18083
18084 #if DB_VERSION_MAJOR > 2
18085         db_env_create( NULL, 0 );
18086 #elif DB_VERSION_MAJOR > 1
18087         db_appexit( NULL );
18088 #else
18089         (void) dbopen( NULL, 0, 0, 0, NULL);
18090 #endif
18091
18092 ; return 0; }
18093 EOF
18094 if { (eval echo configure:18095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18095   rm -rf conftest*
18096   ol_cv_db_db_3=yes
18097 else
18098   echo "configure: failed program was:" >&5
18099   cat conftest.$ac_ext >&5
18100   rm -rf conftest*
18101   ol_cv_db_db_3=no
18102 fi
18103 rm -f conftest*
18104
18105         LIBS="$ol_LIBS"
18106
18107 fi
18108
18109 echo "$ac_t""$ol_cv_db_db_3" 1>&6
18110
18111         if test $ol_cv_db_db_3 = yes ; then
18112                 ol_cv_lib_db=-ldb-3
18113         fi
18114 fi
18115
18116 if test $ol_cv_lib_db = no ; then
18117         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
18118 echo "configure:18119: checking for Berkeley DB link (-ldb2)" >&5
18119 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
18120   echo $ac_n "(cached) $ac_c" 1>&6
18121 else
18122   
18123         ol_DB_LIB=-ldb2
18124         ol_LIBS=$LIBS
18125         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18126
18127         cat > conftest.$ac_ext <<EOF
18128 #line 18129 "configure"
18129 #include "confdefs.h"
18130
18131 #ifdef HAVE_DB_185_H
18132 # include <db_185.h>
18133 #else
18134 # include <db.h>
18135 #endif
18136
18137 #ifndef DB_VERSION_MAJOR
18138 # define DB_VERSION_MAJOR 1
18139 #endif
18140
18141 #ifndef NULL
18142 #define NULL ((void*)0)
18143 #endif
18144
18145 int main() {
18146
18147 #if DB_VERSION_MAJOR > 1
18148         {
18149                 char *version;
18150                 int major, minor, patch;
18151
18152                 version = db_version( &major, &minor, &patch );
18153
18154                 if( major != DB_VERSION_MAJOR ||
18155                         minor < DB_VERSION_MINOR )
18156                 {
18157                         printf("Berkeley DB version mismatch\n"
18158                                 "\texpected: %s\n\tgot: %s\n",
18159                                 DB_VERSION_STRING, version);
18160                         return 1;
18161                 }
18162         }
18163 #endif
18164
18165 #if DB_VERSION_MAJOR > 2
18166         db_env_create( NULL, 0 );
18167 #elif DB_VERSION_MAJOR > 1
18168         db_appexit( NULL );
18169 #else
18170         (void) dbopen( NULL, 0, 0, 0, NULL);
18171 #endif
18172
18173 ; return 0; }
18174 EOF
18175 if { (eval echo configure:18176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18176   rm -rf conftest*
18177   ol_cv_db_db2=yes
18178 else
18179   echo "configure: failed program was:" >&5
18180   cat conftest.$ac_ext >&5
18181   rm -rf conftest*
18182   ol_cv_db_db2=no
18183 fi
18184 rm -f conftest*
18185
18186         LIBS="$ol_LIBS"
18187
18188 fi
18189
18190 echo "$ac_t""$ol_cv_db_db2" 1>&6
18191
18192         if test $ol_cv_db_db2 = yes ; then
18193                 ol_cv_lib_db=-ldb2
18194         fi
18195 fi
18196
18197 if test $ol_cv_lib_db = no ; then
18198         echo $ac_n "checking for Berkeley DB link (-ldb-2)""... $ac_c" 1>&6
18199 echo "configure:18200: checking for Berkeley DB link (-ldb-2)" >&5
18200 if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then
18201   echo $ac_n "(cached) $ac_c" 1>&6
18202 else
18203   
18204         ol_DB_LIB=-ldb-2
18205         ol_LIBS=$LIBS
18206         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18207
18208         cat > conftest.$ac_ext <<EOF
18209 #line 18210 "configure"
18210 #include "confdefs.h"
18211
18212 #ifdef HAVE_DB_185_H
18213 # include <db_185.h>
18214 #else
18215 # include <db.h>
18216 #endif
18217
18218 #ifndef DB_VERSION_MAJOR
18219 # define DB_VERSION_MAJOR 1
18220 #endif
18221
18222 #ifndef NULL
18223 #define NULL ((void*)0)
18224 #endif
18225
18226 int main() {
18227
18228 #if DB_VERSION_MAJOR > 1
18229         {
18230                 char *version;
18231                 int major, minor, patch;
18232
18233                 version = db_version( &major, &minor, &patch );
18234
18235                 if( major != DB_VERSION_MAJOR ||
18236                         minor < DB_VERSION_MINOR )
18237                 {
18238                         printf("Berkeley DB version mismatch\n"
18239                                 "\texpected: %s\n\tgot: %s\n",
18240                                 DB_VERSION_STRING, version);
18241                         return 1;
18242                 }
18243         }
18244 #endif
18245
18246 #if DB_VERSION_MAJOR > 2
18247         db_env_create( NULL, 0 );
18248 #elif DB_VERSION_MAJOR > 1
18249         db_appexit( NULL );
18250 #else
18251         (void) dbopen( NULL, 0, 0, 0, NULL);
18252 #endif
18253
18254 ; return 0; }
18255 EOF
18256 if { (eval echo configure:18257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18257   rm -rf conftest*
18258   ol_cv_db_db_2=yes
18259 else
18260   echo "configure: failed program was:" >&5
18261   cat conftest.$ac_ext >&5
18262   rm -rf conftest*
18263   ol_cv_db_db_2=no
18264 fi
18265 rm -f conftest*
18266
18267         LIBS="$ol_LIBS"
18268
18269 fi
18270
18271 echo "$ac_t""$ol_cv_db_db_2" 1>&6
18272
18273         if test $ol_cv_db_db_2 = yes ; then
18274                 ol_cv_lib_db=-ldb-2
18275         fi
18276 fi
18277
18278 if test $ol_cv_lib_db = no ; then
18279         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
18280 echo "configure:18281: checking for Berkeley DB link (-ldb1)" >&5
18281 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
18282   echo $ac_n "(cached) $ac_c" 1>&6
18283 else
18284   
18285         ol_DB_LIB=-ldb1
18286         ol_LIBS=$LIBS
18287         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18288
18289         cat > conftest.$ac_ext <<EOF
18290 #line 18291 "configure"
18291 #include "confdefs.h"
18292
18293 #ifdef HAVE_DB_185_H
18294 # include <db_185.h>
18295 #else
18296 # include <db.h>
18297 #endif
18298
18299 #ifndef DB_VERSION_MAJOR
18300 # define DB_VERSION_MAJOR 1
18301 #endif
18302
18303 #ifndef NULL
18304 #define NULL ((void*)0)
18305 #endif
18306
18307 int main() {
18308
18309 #if DB_VERSION_MAJOR > 1
18310         {
18311                 char *version;
18312                 int major, minor, patch;
18313
18314                 version = db_version( &major, &minor, &patch );
18315
18316                 if( major != DB_VERSION_MAJOR ||
18317                         minor < DB_VERSION_MINOR )
18318                 {
18319                         printf("Berkeley DB version mismatch\n"
18320                                 "\texpected: %s\n\tgot: %s\n",
18321                                 DB_VERSION_STRING, version);
18322                         return 1;
18323                 }
18324         }
18325 #endif
18326
18327 #if DB_VERSION_MAJOR > 2
18328         db_env_create( NULL, 0 );
18329 #elif DB_VERSION_MAJOR > 1
18330         db_appexit( NULL );
18331 #else
18332         (void) dbopen( NULL, 0, 0, 0, NULL);
18333 #endif
18334
18335 ; return 0; }
18336 EOF
18337 if { (eval echo configure:18338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18338   rm -rf conftest*
18339   ol_cv_db_db1=yes
18340 else
18341   echo "configure: failed program was:" >&5
18342   cat conftest.$ac_ext >&5
18343   rm -rf conftest*
18344   ol_cv_db_db1=no
18345 fi
18346 rm -f conftest*
18347
18348         LIBS="$ol_LIBS"
18349
18350 fi
18351
18352 echo "$ac_t""$ol_cv_db_db1" 1>&6
18353
18354         if test $ol_cv_db_db1 = yes ; then
18355                 ol_cv_lib_db=-ldb1
18356         fi
18357 fi
18358
18359 if test $ol_cv_lib_db = no ; then
18360         echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6
18361 echo "configure:18362: checking for Berkeley DB link (-ldb-1)" >&5
18362 if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then
18363   echo $ac_n "(cached) $ac_c" 1>&6
18364 else
18365   
18366         ol_DB_LIB=-ldb-1
18367         ol_LIBS=$LIBS
18368         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18369
18370         cat > conftest.$ac_ext <<EOF
18371 #line 18372 "configure"
18372 #include "confdefs.h"
18373
18374 #ifdef HAVE_DB_185_H
18375 # include <db_185.h>
18376 #else
18377 # include <db.h>
18378 #endif
18379
18380 #ifndef DB_VERSION_MAJOR
18381 # define DB_VERSION_MAJOR 1
18382 #endif
18383
18384 #ifndef NULL
18385 #define NULL ((void*)0)
18386 #endif
18387
18388 int main() {
18389
18390 #if DB_VERSION_MAJOR > 1
18391         {
18392                 char *version;
18393                 int major, minor, patch;
18394
18395                 version = db_version( &major, &minor, &patch );
18396
18397                 if( major != DB_VERSION_MAJOR ||
18398                         minor < DB_VERSION_MINOR )
18399                 {
18400                         printf("Berkeley DB version mismatch\n"
18401                                 "\texpected: %s\n\tgot: %s\n",
18402                                 DB_VERSION_STRING, version);
18403                         return 1;
18404                 }
18405         }
18406 #endif
18407
18408 #if DB_VERSION_MAJOR > 2
18409         db_env_create( NULL, 0 );
18410 #elif DB_VERSION_MAJOR > 1
18411         db_appexit( NULL );
18412 #else
18413         (void) dbopen( NULL, 0, 0, 0, NULL);
18414 #endif
18415
18416 ; return 0; }
18417 EOF
18418 if { (eval echo configure:18419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18419   rm -rf conftest*
18420   ol_cv_db_db_1=yes
18421 else
18422   echo "configure: failed program was:" >&5
18423   cat conftest.$ac_ext >&5
18424   rm -rf conftest*
18425   ol_cv_db_db_1=no
18426 fi
18427 rm -f conftest*
18428
18429         LIBS="$ol_LIBS"
18430
18431 fi
18432
18433 echo "$ac_t""$ol_cv_db_db_1" 1>&6
18434
18435         if test $ol_cv_db_db_1 = yes ; then
18436                 ol_cv_lib_db=-ldb-1
18437         fi
18438 fi
18439
18440
18441         if test "$ol_cv_lib_db" != no ; then
18442                 ol_cv_berkeley_db=yes
18443                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
18444 echo "configure:18445: checking for Berkeley DB thread support" >&5
18445 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
18446   echo $ac_n "(cached) $ac_c" 1>&6
18447 else
18448   
18449         ol_LIBS="$LIBS"
18450         LIBS="$LTHREAD_LIBS $LIBS"
18451         if test $ol_cv_lib_db != yes ; then
18452                 LIBS="$ol_cv_lib_db $LIBS"
18453         fi
18454
18455         if test "$cross_compiling" = yes; then
18456   ol_cv_berkeley_db_thread=cross
18457 else
18458   cat > conftest.$ac_ext <<EOF
18459 #line 18460 "configure"
18460 #include "confdefs.h"
18461
18462 #ifdef HAVE_DB_185_H
18463         choke me;
18464 #else
18465 #include <db.h>
18466 #endif
18467 #ifndef NULL
18468 #define NULL ((void *)0)
18469 #endif
18470 main()
18471 {
18472         int rc;
18473         u_int32_t flags = DB_CREATE |
18474 #ifdef DB_PRIVATE
18475                 DB_PRIVATE |
18476 #endif
18477                 DB_THREAD;
18478
18479 #if DB_VERSION_MAJOR > 2
18480         DB_ENV *env = NULL;
18481
18482         rc = db_env_create( &env, 0 );
18483
18484         flags |= DB_INIT_MPOOL;
18485 #ifdef DB_MPOOL_PRIVATE
18486         flags |= DB_MPOOL_PRIVATE;
18487 #endif
18488
18489         if( rc ) {
18490                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
18491                 return rc;
18492         }
18493
18494 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
18495         rc = env->open( env, NULL, flags, 0 );
18496 #else
18497         rc = env->open( env, NULL, NULL, flags, 0 );
18498 #endif
18499
18500         if ( rc == 0 ) {
18501                 rc = env->close( env, 0 );
18502         }
18503
18504         if( rc ) {
18505                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
18506                 return rc;
18507         }
18508
18509 #else
18510         DB_ENV env;
18511         memset( &env, '\0', sizeof(env) );
18512
18513         rc = db_appinit( NULL, NULL, &env, flags );
18514
18515         if( rc == 0 ) {
18516                 db_appexit( &env );
18517         }
18518
18519         unlink("__db_mpool.share");
18520         unlink("__db_lock.share");
18521 #endif
18522
18523         return rc;
18524 }
18525 EOF
18526 if { (eval echo configure:18527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
18527 then
18528   ol_cv_berkeley_db_thread=yes
18529 else
18530   echo "configure: failed program was:" >&5
18531   cat conftest.$ac_ext >&5
18532   rm -fr conftest*
18533   ol_cv_berkeley_db_thread=no
18534 fi
18535 rm -fr conftest*
18536 fi
18537
18538
18539         LIBS="$ol_LIBS"
18540
18541 fi
18542
18543 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
18544
18545         if test $ol_cv_berkeley_db_thread != no ; then
18546                 cat >> confdefs.h <<\EOF
18547 #define HAVE_BERKELEY_DB_THREAD 1
18548 EOF
18549
18550         fi
18551
18552         fi
18553 fi
18554
18555         fi
18556
18557         if test $ol_cv_berkeley_db != no ; then
18558                 cat >> confdefs.h <<\EOF
18559 #define HAVE_BERKELEY_DB 1
18560 EOF
18561
18562
18563                 ol_link_ldbm=berkeley
18564                 ol_with_ldbm_api=berkeley
18565
18566                 if test $ol_with_ldbm_type = hash ; then
18567                         cat >> confdefs.h <<\EOF
18568 #define LDBM_USE_DBHASH 1
18569 EOF
18570
18571                 else
18572                         cat >> confdefs.h <<\EOF
18573 #define LDBM_USE_DBBTREE 1
18574 EOF
18575
18576                 fi
18577
18578                                                 if test $ol_cv_lib_db != yes ; then
18579                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
18580                 fi
18581         fi
18582 fi
18583
18584 if test $ol_enable_bdb = yes -a $ol_link_ldbm != berkeley ; then
18585         { echo "configure: error: BDB: BerkeleyDB not available" 1>&2; exit 1; }
18586 elif test $ol_enable_bdb != no -a $ol_link_ldbm = berkeley ; then
18587         echo $ac_n "checking Berkeley DB version for BDB backend""... $ac_c" 1>&6
18588 echo "configure:18589: checking Berkeley DB version for BDB backend" >&5
18589 if eval "test \"\${ol_cv_bdb_compat+set}\" = set"; then
18590   echo $ac_n "(cached) $ac_c" 1>&6
18591 else
18592   
18593         cat > conftest.$ac_ext <<EOF
18594 #line 18595 "configure"
18595 #include "confdefs.h"
18596
18597 #include <db.h>
18598
18599  /* this check could be improved */
18600 #ifndef DB_VERSION_MAJOR
18601 #       define DB_VERSION_MAJOR 1
18602 #endif
18603
18604 /* require 4.0 or later */
18605 #if DB_VERSION_MAJOR >= 4 
18606         __db_version_compat
18607 #endif
18608         
18609 EOF
18610 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
18611   egrep "__db_version_compat" >/dev/null 2>&1; then
18612   rm -rf conftest*
18613   ol_cv_bdb_compat=yes
18614 else
18615   rm -rf conftest*
18616   ol_cv_bdb_compat=no
18617 fi
18618 rm -f conftest*
18619
18620 fi
18621
18622 echo "$ac_t""$ol_cv_bdb_compat" 1>&6
18623
18624
18625         if test $ol_cv_bdb_compat = yes ; then
18626                 ol_enable_bdb=yes
18627         elif test $ol_enable_bdb = yes ; then
18628                 { echo "configure: error: BDB: BerkeleyDB version incompatible" 1>&2; exit 1; }
18629         else
18630                 ol_enable_bdb=no
18631         fi
18632 fi
18633
18634 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
18635         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
18636         ol_with_ldbm_api=none
18637 fi
18638
18639 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
18640         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
18641 echo "configure:18642: checking for MDBM library" >&5
18642 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
18643   echo $ac_n "(cached) $ac_c" 1>&6
18644 else
18645         ol_LIBS="$LIBS"
18646         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
18647 echo "configure:18648: checking for mdbm_set_chain" >&5
18648 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
18649   echo $ac_n "(cached) $ac_c" 1>&6
18650 else
18651   cat > conftest.$ac_ext <<EOF
18652 #line 18653 "configure"
18653 #include "confdefs.h"
18654 /* System header to define __stub macros and hopefully few prototypes,
18655     which can conflict with char mdbm_set_chain(); below.  */
18656 #include <assert.h>
18657 /* Override any gcc2 internal prototype to avoid an error.  */
18658 /* We use char because int might match the return type of a gcc2
18659     builtin and then its argument prototype would still apply.  */
18660 char mdbm_set_chain();
18661 char (*f)();
18662
18663 int main() {
18664
18665 /* The GNU C library defines this for functions which it implements
18666     to always fail with ENOSYS.  Some functions are actually named
18667     something starting with __ and the normal name is an alias.  */
18668 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
18669 choke me
18670 #else
18671 f = mdbm_set_chain;
18672 #endif
18673
18674 ; return 0; }
18675 EOF
18676 if { (eval echo configure:18677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18677   rm -rf conftest*
18678   eval "ac_cv_func_mdbm_set_chain=yes"
18679 else
18680   echo "configure: failed program was:" >&5
18681   cat conftest.$ac_ext >&5
18682   rm -rf conftest*
18683   eval "ac_cv_func_mdbm_set_chain=no"
18684 fi
18685 rm -f conftest*
18686 fi
18687
18688 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
18689   echo "$ac_t""yes" 1>&6
18690   ol_cv_lib_mdbm=yes
18691 else
18692   echo "$ac_t""no" 1>&6
18693
18694                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
18695 echo "configure:18696: checking for mdbm_set_chain in -lmdbm" >&5
18696 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
18697 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
18698   echo $ac_n "(cached) $ac_c" 1>&6
18699 else
18700   ac_save_LIBS="$LIBS"
18701 LIBS="-lmdbm  $LIBS"
18702 cat > conftest.$ac_ext <<EOF
18703 #line 18704 "configure"
18704 #include "confdefs.h"
18705 /* Override any gcc2 internal prototype to avoid an error.  */
18706 /* We use char because int might match the return type of a gcc2
18707     builtin and then its argument prototype would still apply.  */
18708 char mdbm_set_chain();
18709
18710 int main() {
18711 mdbm_set_chain()
18712 ; return 0; }
18713 EOF
18714 if { (eval echo configure:18715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18715   rm -rf conftest*
18716   eval "ac_cv_lib_$ac_lib_var=yes"
18717 else
18718   echo "configure: failed program was:" >&5
18719   cat conftest.$ac_ext >&5
18720   rm -rf conftest*
18721   eval "ac_cv_lib_$ac_lib_var=no"
18722 fi
18723 rm -f conftest*
18724 LIBS="$ac_save_LIBS"
18725
18726 fi
18727 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
18728   echo "$ac_t""yes" 1>&6
18729   ol_cv_lib_mdbm=-lmdbm
18730 else
18731   echo "$ac_t""no" 1>&6
18732 ol_cv_lib_mdbm=no
18733 fi
18734
18735         
18736 fi
18737
18738         LIBS="$ol_LIBS"
18739
18740 fi
18741
18742 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
18743
18744
18745  for ac_hdr in mdbm.h
18746 do
18747 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
18748 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
18749 echo "configure:18750: checking for $ac_hdr" >&5
18750 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
18751   echo $ac_n "(cached) $ac_c" 1>&6
18752 else
18753   cat > conftest.$ac_ext <<EOF
18754 #line 18755 "configure"
18755 #include "confdefs.h"
18756 #include <$ac_hdr>
18757 EOF
18758 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
18759 { (eval echo configure:18760: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
18760 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
18761 if test -z "$ac_err"; then
18762   rm -rf conftest*
18763   eval "ac_cv_header_$ac_safe=yes"
18764 else
18765   echo "$ac_err" >&5
18766   echo "configure: failed program was:" >&5
18767   cat conftest.$ac_ext >&5
18768   rm -rf conftest*
18769   eval "ac_cv_header_$ac_safe=no"
18770 fi
18771 rm -f conftest*
18772 fi
18773 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
18774   echo "$ac_t""yes" 1>&6
18775     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
18776   cat >> confdefs.h <<EOF
18777 #define $ac_tr_hdr 1
18778 EOF
18779  
18780 else
18781   echo "$ac_t""no" 1>&6
18782 fi
18783 done
18784
18785  echo $ac_n "checking for db""... $ac_c" 1>&6
18786 echo "configure:18787: checking for db" >&5
18787 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
18788   echo $ac_n "(cached) $ac_c" 1>&6
18789 else
18790   
18791         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
18792                 ol_cv_mdbm=no
18793         else
18794                 ol_cv_mdbm=yes
18795         fi
18796
18797 fi
18798
18799 echo "$ac_t""$ol_cv_mdbm" 1>&6
18800  if test $ol_cv_mdbm = yes ; then
18801         cat >> confdefs.h <<\EOF
18802 #define HAVE_MDBM 1
18803 EOF
18804
18805  fi
18806
18807
18808         if test $ol_cv_mdbm = yes ; then
18809                 ol_link_ldbm=mdbm
18810                 ol_with_ldbm_api=mdbm
18811                 if test $ol_cv_lib_mdbm != yes ; then
18812                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
18813                 fi
18814         fi
18815 fi
18816
18817 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
18818         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
18819 echo "configure:18820: checking for GDBM library" >&5
18820 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
18821   echo $ac_n "(cached) $ac_c" 1>&6
18822 else
18823         ol_LIBS="$LIBS"
18824         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
18825 echo "configure:18826: checking for gdbm_open" >&5
18826 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
18827   echo $ac_n "(cached) $ac_c" 1>&6
18828 else
18829   cat > conftest.$ac_ext <<EOF
18830 #line 18831 "configure"
18831 #include "confdefs.h"
18832 /* System header to define __stub macros and hopefully few prototypes,
18833     which can conflict with char gdbm_open(); below.  */
18834 #include <assert.h>
18835 /* Override any gcc2 internal prototype to avoid an error.  */
18836 /* We use char because int might match the return type of a gcc2
18837     builtin and then its argument prototype would still apply.  */
18838 char gdbm_open();
18839 char (*f)();
18840
18841 int main() {
18842
18843 /* The GNU C library defines this for functions which it implements
18844     to always fail with ENOSYS.  Some functions are actually named
18845     something starting with __ and the normal name is an alias.  */
18846 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
18847 choke me
18848 #else
18849 f = gdbm_open;
18850 #endif
18851
18852 ; return 0; }
18853 EOF
18854 if { (eval echo configure:18855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18855   rm -rf conftest*
18856   eval "ac_cv_func_gdbm_open=yes"
18857 else
18858   echo "configure: failed program was:" >&5
18859   cat conftest.$ac_ext >&5
18860   rm -rf conftest*
18861   eval "ac_cv_func_gdbm_open=no"
18862 fi
18863 rm -f conftest*
18864 fi
18865
18866 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
18867   echo "$ac_t""yes" 1>&6
18868   ol_cv_lib_gdbm=yes
18869 else
18870   echo "$ac_t""no" 1>&6
18871
18872                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
18873 echo "configure:18874: checking for gdbm_open in -lgdbm" >&5
18874 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
18875 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
18876   echo $ac_n "(cached) $ac_c" 1>&6
18877 else
18878   ac_save_LIBS="$LIBS"
18879 LIBS="-lgdbm  $LIBS"
18880 cat > conftest.$ac_ext <<EOF
18881 #line 18882 "configure"
18882 #include "confdefs.h"
18883 /* Override any gcc2 internal prototype to avoid an error.  */
18884 /* We use char because int might match the return type of a gcc2
18885     builtin and then its argument prototype would still apply.  */
18886 char gdbm_open();
18887
18888 int main() {
18889 gdbm_open()
18890 ; return 0; }
18891 EOF
18892 if { (eval echo configure:18893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18893   rm -rf conftest*
18894   eval "ac_cv_lib_$ac_lib_var=yes"
18895 else
18896   echo "configure: failed program was:" >&5
18897   cat conftest.$ac_ext >&5
18898   rm -rf conftest*
18899   eval "ac_cv_lib_$ac_lib_var=no"
18900 fi
18901 rm -f conftest*
18902 LIBS="$ac_save_LIBS"
18903
18904 fi
18905 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
18906   echo "$ac_t""yes" 1>&6
18907   ol_cv_lib_gdbm=-lgdbm
18908 else
18909   echo "$ac_t""no" 1>&6
18910 ol_cv_lib_gdbm=no
18911 fi
18912
18913         
18914 fi
18915
18916         LIBS="$ol_LIBS"
18917
18918 fi
18919
18920 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
18921
18922
18923  for ac_hdr in gdbm.h
18924 do
18925 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
18926 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
18927 echo "configure:18928: checking for $ac_hdr" >&5
18928 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
18929   echo $ac_n "(cached) $ac_c" 1>&6
18930 else
18931   cat > conftest.$ac_ext <<EOF
18932 #line 18933 "configure"
18933 #include "confdefs.h"
18934 #include <$ac_hdr>
18935 EOF
18936 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
18937 { (eval echo configure:18938: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
18938 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
18939 if test -z "$ac_err"; then
18940   rm -rf conftest*
18941   eval "ac_cv_header_$ac_safe=yes"
18942 else
18943   echo "$ac_err" >&5
18944   echo "configure: failed program was:" >&5
18945   cat conftest.$ac_ext >&5
18946   rm -rf conftest*
18947   eval "ac_cv_header_$ac_safe=no"
18948 fi
18949 rm -f conftest*
18950 fi
18951 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
18952   echo "$ac_t""yes" 1>&6
18953     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
18954   cat >> confdefs.h <<EOF
18955 #define $ac_tr_hdr 1
18956 EOF
18957  
18958 else
18959   echo "$ac_t""no" 1>&6
18960 fi
18961 done
18962
18963  echo $ac_n "checking for db""... $ac_c" 1>&6
18964 echo "configure:18965: checking for db" >&5
18965 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
18966   echo $ac_n "(cached) $ac_c" 1>&6
18967 else
18968   
18969         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
18970                 ol_cv_gdbm=no
18971         else
18972                 ol_cv_gdbm=yes
18973         fi
18974
18975 fi
18976
18977 echo "$ac_t""$ol_cv_gdbm" 1>&6
18978  if test $ol_cv_gdbm = yes ; then
18979         cat >> confdefs.h <<\EOF
18980 #define HAVE_GDBM 1
18981 EOF
18982
18983  fi
18984
18985
18986         if test $ol_cv_gdbm = yes ; then
18987                 ol_link_ldbm=gdbm
18988                 ol_with_ldbm_api=gdbm
18989
18990                 if test $ol_cv_lib_gdbm != yes ; then
18991                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
18992                 fi
18993         fi
18994 fi
18995
18996 if test $ol_with_ldbm_api = ndbm ; then
18997         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
18998 echo "configure:18999: checking for NDBM library" >&5
18999 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
19000   echo $ac_n "(cached) $ac_c" 1>&6
19001 else
19002         ol_LIBS="$LIBS"
19003         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
19004 echo "configure:19005: checking for dbm_open" >&5
19005 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
19006   echo $ac_n "(cached) $ac_c" 1>&6
19007 else
19008   cat > conftest.$ac_ext <<EOF
19009 #line 19010 "configure"
19010 #include "confdefs.h"
19011 /* System header to define __stub macros and hopefully few prototypes,
19012     which can conflict with char dbm_open(); below.  */
19013 #include <assert.h>
19014 /* Override any gcc2 internal prototype to avoid an error.  */
19015 /* We use char because int might match the return type of a gcc2
19016     builtin and then its argument prototype would still apply.  */
19017 char dbm_open();
19018 char (*f)();
19019
19020 int main() {
19021
19022 /* The GNU C library defines this for functions which it implements
19023     to always fail with ENOSYS.  Some functions are actually named
19024     something starting with __ and the normal name is an alias.  */
19025 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
19026 choke me
19027 #else
19028 f = dbm_open;
19029 #endif
19030
19031 ; return 0; }
19032 EOF
19033 if { (eval echo configure:19034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19034   rm -rf conftest*
19035   eval "ac_cv_func_dbm_open=yes"
19036 else
19037   echo "configure: failed program was:" >&5
19038   cat conftest.$ac_ext >&5
19039   rm -rf conftest*
19040   eval "ac_cv_func_dbm_open=no"
19041 fi
19042 rm -f conftest*
19043 fi
19044
19045 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
19046   echo "$ac_t""yes" 1>&6
19047   ol_cv_lib_ndbm=yes
19048 else
19049   echo "$ac_t""no" 1>&6
19050
19051                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
19052 echo "configure:19053: checking for dbm_open in -lndbm" >&5
19053 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
19054 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19055   echo $ac_n "(cached) $ac_c" 1>&6
19056 else
19057   ac_save_LIBS="$LIBS"
19058 LIBS="-lndbm  $LIBS"
19059 cat > conftest.$ac_ext <<EOF
19060 #line 19061 "configure"
19061 #include "confdefs.h"
19062 /* Override any gcc2 internal prototype to avoid an error.  */
19063 /* We use char because int might match the return type of a gcc2
19064     builtin and then its argument prototype would still apply.  */
19065 char dbm_open();
19066
19067 int main() {
19068 dbm_open()
19069 ; return 0; }
19070 EOF
19071 if { (eval echo configure:19072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19072   rm -rf conftest*
19073   eval "ac_cv_lib_$ac_lib_var=yes"
19074 else
19075   echo "configure: failed program was:" >&5
19076   cat conftest.$ac_ext >&5
19077   rm -rf conftest*
19078   eval "ac_cv_lib_$ac_lib_var=no"
19079 fi
19080 rm -f conftest*
19081 LIBS="$ac_save_LIBS"
19082
19083 fi
19084 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19085   echo "$ac_t""yes" 1>&6
19086   ol_cv_lib_ndbm=-lndbm
19087 else
19088   echo "$ac_t""no" 1>&6
19089
19090                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
19091 echo "configure:19092: checking for dbm_open in -ldbm" >&5
19092 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
19093 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19094   echo $ac_n "(cached) $ac_c" 1>&6
19095 else
19096   ac_save_LIBS="$LIBS"
19097 LIBS="-ldbm  $LIBS"
19098 cat > conftest.$ac_ext <<EOF
19099 #line 19100 "configure"
19100 #include "confdefs.h"
19101 /* Override any gcc2 internal prototype to avoid an error.  */
19102 /* We use char because int might match the return type of a gcc2
19103     builtin and then its argument prototype would still apply.  */
19104 char dbm_open();
19105
19106 int main() {
19107 dbm_open()
19108 ; return 0; }
19109 EOF
19110 if { (eval echo configure:19111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19111   rm -rf conftest*
19112   eval "ac_cv_lib_$ac_lib_var=yes"
19113 else
19114   echo "configure: failed program was:" >&5
19115   cat conftest.$ac_ext >&5
19116   rm -rf conftest*
19117   eval "ac_cv_lib_$ac_lib_var=no"
19118 fi
19119 rm -f conftest*
19120 LIBS="$ac_save_LIBS"
19121
19122 fi
19123 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19124   echo "$ac_t""yes" 1>&6
19125   ol_cv_lib_ndbm=-ldbm
19126 else
19127   echo "$ac_t""no" 1>&6
19128 ol_cv_lib_ndbm=no
19129 fi
19130                 
19131 fi
19132
19133         
19134 fi
19135
19136         LIBS="$ol_LIBS"
19137
19138 fi
19139
19140 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
19141
19142
19143  for ac_hdr in ndbm.h
19144 do
19145 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19146 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19147 echo "configure:19148: checking for $ac_hdr" >&5
19148 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19149   echo $ac_n "(cached) $ac_c" 1>&6
19150 else
19151   cat > conftest.$ac_ext <<EOF
19152 #line 19153 "configure"
19153 #include "confdefs.h"
19154 #include <$ac_hdr>
19155 EOF
19156 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19157 { (eval echo configure:19158: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19158 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19159 if test -z "$ac_err"; then
19160   rm -rf conftest*
19161   eval "ac_cv_header_$ac_safe=yes"
19162 else
19163   echo "$ac_err" >&5
19164   echo "configure: failed program was:" >&5
19165   cat conftest.$ac_ext >&5
19166   rm -rf conftest*
19167   eval "ac_cv_header_$ac_safe=no"
19168 fi
19169 rm -f conftest*
19170 fi
19171 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19172   echo "$ac_t""yes" 1>&6
19173     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19174   cat >> confdefs.h <<EOF
19175 #define $ac_tr_hdr 1
19176 EOF
19177  
19178 else
19179   echo "$ac_t""no" 1>&6
19180 fi
19181 done
19182
19183  echo $ac_n "checking for db""... $ac_c" 1>&6
19184 echo "configure:19185: checking for db" >&5
19185 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
19186   echo $ac_n "(cached) $ac_c" 1>&6
19187 else
19188   
19189         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
19190                 ol_cv_ndbm=no
19191         else
19192                 ol_cv_ndbm=yes
19193         fi
19194
19195 fi
19196
19197 echo "$ac_t""$ol_cv_ndbm" 1>&6
19198  if test $ol_cv_ndbm = yes ; then
19199         cat >> confdefs.h <<\EOF
19200 #define HAVE_NDBM 1
19201 EOF
19202
19203  fi
19204
19205
19206         if test $ol_cv_ndbm = yes ; then
19207                 ol_link_ldbm=ndbm
19208                 ol_with_ldbm_api=ndbm
19209
19210                 if test $ol_cv_lib_ndbm != yes ; then
19211                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
19212                 fi
19213         fi
19214 fi
19215
19216 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
19217         echo "configure: warning: could not find suitable LDBM backend" 1>&2
19218         if test $ol_enable_ldbm = yes ; then
19219                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
19220         fi
19221
19222         echo "configure: warning: disabling LDBM" 1>&2
19223         ol_enable_ldbm=no
19224 fi
19225
19226 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
19227         BUILD_LIBS_DYNAMIC=shared
19228         cat >> confdefs.h <<\EOF
19229 #define LDAP_LIBS_DYNAMIC 1
19230 EOF
19231
19232 else
19233         BUILD_LIBS_DYNAMIC=static
19234 fi
19235
19236 if test $ol_enable_wrappers != no ; then
19237         for ac_hdr in tcpd.h
19238 do
19239 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19240 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19241 echo "configure:19242: checking for $ac_hdr" >&5
19242 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19243   echo $ac_n "(cached) $ac_c" 1>&6
19244 else
19245   cat > conftest.$ac_ext <<EOF
19246 #line 19247 "configure"
19247 #include "confdefs.h"
19248 #include <$ac_hdr>
19249 EOF
19250 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19251 { (eval echo configure:19252: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19252 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19253 if test -z "$ac_err"; then
19254   rm -rf conftest*
19255   eval "ac_cv_header_$ac_safe=yes"
19256 else
19257   echo "$ac_err" >&5
19258   echo "configure: failed program was:" >&5
19259   cat conftest.$ac_ext >&5
19260   rm -rf conftest*
19261   eval "ac_cv_header_$ac_safe=no"
19262 fi
19263 rm -f conftest*
19264 fi
19265 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19266   echo "$ac_t""yes" 1>&6
19267     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19268   cat >> confdefs.h <<EOF
19269 #define $ac_tr_hdr 1
19270 EOF
19271  
19272                 echo $ac_n "checking for TCP wrappers library""... $ac_c" 1>&6
19273 echo "configure:19274: checking for TCP wrappers library" >&5
19274                 save_LIBS="$LIBS"
19275                 LIBS="$LIBS -lwrap"
19276                 cat > conftest.$ac_ext <<EOF
19277 #line 19278 "configure"
19278 #include "confdefs.h"
19279
19280 #include <tcpd.h>
19281 int allow_severity = 0;
19282 int deny_severity  = 0;
19283
19284 struct request_info *req;
19285                 
19286 int main() {
19287
19288 hosts_access(req)
19289                 
19290 ; return 0; }
19291 EOF
19292 if { (eval echo configure:19293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19293   rm -rf conftest*
19294   echo "$ac_t""-lwrap" 1>&6
19295                 have_wrappers=yes
19296                 LIBS="$save_LIBS"
19297 else
19298   echo "configure: failed program was:" >&5
19299   cat conftest.$ac_ext >&5
19300   rm -rf conftest*
19301   
19302                                 LIBS="$LIBS -lnsl"
19303                 cat > conftest.$ac_ext <<EOF
19304 #line 19305 "configure"
19305 #include "confdefs.h"
19306
19307 #include <tcpd.h>
19308 int allow_severity = 0;
19309 int deny_severity  = 0;
19310
19311 struct request_info *req;
19312                 
19313 int main() {
19314
19315 hosts_access(req)
19316                 
19317 ; return 0; }
19318 EOF
19319 if { (eval echo configure:19320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19320   rm -rf conftest*
19321   echo "$ac_t""-lwrap -lnsl" 1>&6
19322                 have_wrappers=yes
19323                 LIBS="$save_LIBS -lnsl"
19324 else
19325   echo "configure: failed program was:" >&5
19326   cat conftest.$ac_ext >&5
19327   rm -rf conftest*
19328   
19329                 echo "$ac_t""no" 1>&6
19330                 have_wrappers=no
19331                 LIBS=$save_LIBS
19332 fi
19333 rm -f conftest*
19334 fi
19335 rm -f conftest*
19336 else
19337   echo "$ac_t""no" 1>&6
19338 have_wrappers=no
19339 fi
19340 done
19341
19342
19343         if test $have_wrappers = yes ; then
19344                 cat >> confdefs.h <<\EOF
19345 #define HAVE_TCPD 1
19346 EOF
19347
19348                 WRAP_LIBS="-lwrap"
19349         elif test $ol_enable_wrappers = yes ; then
19350                 { echo "configure: error: could not find TCP wrappers, select apppropriate options ore disable" 1>&2; exit 1; }
19351         else
19352                 echo "configure: warning: could not find TCP wrappers, support disabled" 1>&2
19353                 WRAP_LIBS=""
19354         fi
19355 fi
19356
19357 if test $ol_enable_syslog != no ; then
19358         echo $ac_n "checking for openlog""... $ac_c" 1>&6
19359 echo "configure:19360: checking for openlog" >&5
19360 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
19361   echo $ac_n "(cached) $ac_c" 1>&6
19362 else
19363   cat > conftest.$ac_ext <<EOF
19364 #line 19365 "configure"
19365 #include "confdefs.h"
19366 /* System header to define __stub macros and hopefully few prototypes,
19367     which can conflict with char openlog(); below.  */
19368 #include <assert.h>
19369 /* Override any gcc2 internal prototype to avoid an error.  */
19370 /* We use char because int might match the return type of a gcc2
19371     builtin and then its argument prototype would still apply.  */
19372 char openlog();
19373 char (*f)();
19374
19375 int main() {
19376
19377 /* The GNU C library defines this for functions which it implements
19378     to always fail with ENOSYS.  Some functions are actually named
19379     something starting with __ and the normal name is an alias.  */
19380 #if defined (__stub_openlog) || defined (__stub___openlog)
19381 choke me
19382 #else
19383 f = openlog;
19384 #endif
19385
19386 ; return 0; }
19387 EOF
19388 if { (eval echo configure:19389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19389   rm -rf conftest*
19390   eval "ac_cv_func_openlog=yes"
19391 else
19392   echo "configure: failed program was:" >&5
19393   cat conftest.$ac_ext >&5
19394   rm -rf conftest*
19395   eval "ac_cv_func_openlog=no"
19396 fi
19397 rm -f conftest*
19398 fi
19399
19400 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
19401   echo "$ac_t""yes" 1>&6
19402   :
19403 else
19404   echo "$ac_t""no" 1>&6
19405 fi
19406
19407         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
19408                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
19409         fi
19410         ol_enable_syslog=$ac_cv_func_openlog
19411 fi
19412
19413
19414 ol_link_sql=no
19415 if test $ol_enable_sql != no ; then
19416         for ac_hdr in sql.h sqlext.h
19417 do
19418 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19419 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19420 echo "configure:19421: checking for $ac_hdr" >&5
19421 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19422   echo $ac_n "(cached) $ac_c" 1>&6
19423 else
19424   cat > conftest.$ac_ext <<EOF
19425 #line 19426 "configure"
19426 #include "confdefs.h"
19427 #include <$ac_hdr>
19428 EOF
19429 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19430 { (eval echo configure:19431: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19431 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19432 if test -z "$ac_err"; then
19433   rm -rf conftest*
19434   eval "ac_cv_header_$ac_safe=yes"
19435 else
19436   echo "$ac_err" >&5
19437   echo "configure: failed program was:" >&5
19438   cat conftest.$ac_ext >&5
19439   rm -rf conftest*
19440   eval "ac_cv_header_$ac_safe=no"
19441 fi
19442 rm -f conftest*
19443 fi
19444 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19445   echo "$ac_t""yes" 1>&6
19446     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19447   cat >> confdefs.h <<EOF
19448 #define $ac_tr_hdr 1
19449 EOF
19450  
19451 else
19452   echo "$ac_t""no" 1>&6
19453 { echo "configure: error: could not locate SQL headers" 1>&2; exit 1; }
19454         
19455 fi
19456 done
19457
19458
19459         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
19460 echo "configure:19461: checking for SQLDriverConnect in -liodbc" >&5
19461 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
19462 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19463   echo $ac_n "(cached) $ac_c" 1>&6
19464 else
19465   ac_save_LIBS="$LIBS"
19466 LIBS="-liodbc  $LIBS"
19467 cat > conftest.$ac_ext <<EOF
19468 #line 19469 "configure"
19469 #include "confdefs.h"
19470 /* Override any gcc2 internal prototype to avoid an error.  */
19471 /* We use char because int might match the return type of a gcc2
19472     builtin and then its argument prototype would still apply.  */
19473 char SQLDriverConnect();
19474
19475 int main() {
19476 SQLDriverConnect()
19477 ; return 0; }
19478 EOF
19479 if { (eval echo configure:19480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19480   rm -rf conftest*
19481   eval "ac_cv_lib_$ac_lib_var=yes"
19482 else
19483   echo "configure: failed program was:" >&5
19484   cat conftest.$ac_ext >&5
19485   rm -rf conftest*
19486   eval "ac_cv_lib_$ac_lib_var=no"
19487 fi
19488 rm -f conftest*
19489 LIBS="$ac_save_LIBS"
19490
19491 fi
19492 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19493   echo "$ac_t""yes" 1>&6
19494   have_iodbc=yes
19495 else
19496   echo "$ac_t""no" 1>&6
19497 have_iodbc=no
19498 fi
19499
19500         if test $have_iodbc = yes ; then
19501                 ol_link_sql="-liodbc"
19502         else
19503                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
19504 echo "configure:19505: checking for SQLDriverConnect in -lodbc" >&5
19505 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
19506 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19507   echo $ac_n "(cached) $ac_c" 1>&6
19508 else
19509   ac_save_LIBS="$LIBS"
19510 LIBS="-lodbc  $LIBS"
19511 cat > conftest.$ac_ext <<EOF
19512 #line 19513 "configure"
19513 #include "confdefs.h"
19514 /* Override any gcc2 internal prototype to avoid an error.  */
19515 /* We use char because int might match the return type of a gcc2
19516     builtin and then its argument prototype would still apply.  */
19517 char SQLDriverConnect();
19518
19519 int main() {
19520 SQLDriverConnect()
19521 ; return 0; }
19522 EOF
19523 if { (eval echo configure:19524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19524   rm -rf conftest*
19525   eval "ac_cv_lib_$ac_lib_var=yes"
19526 else
19527   echo "configure: failed program was:" >&5
19528   cat conftest.$ac_ext >&5
19529   rm -rf conftest*
19530   eval "ac_cv_lib_$ac_lib_var=no"
19531 fi
19532 rm -f conftest*
19533 LIBS="$ac_save_LIBS"
19534
19535 fi
19536 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19537   echo "$ac_t""yes" 1>&6
19538   have_odbc=yes
19539 else
19540   echo "$ac_t""no" 1>&6
19541 have_odbc=no
19542 fi
19543
19544                 if test $have_odbc = yes ; then
19545                         ol_link_sql="-lodbc"
19546                 fi
19547         fi
19548
19549         if test $ol_link_sql != no ; then
19550                 SLAPD_SQL_LIBS="$ol_link_sql"
19551
19552         elif test $ol_enable_sql != auto ; then
19553                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
19554         fi
19555 fi
19556
19557 if test $ol_enable_tcl != no ; then
19558         for ac_hdr in tcl.h
19559 do
19560 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19561 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19562 echo "configure:19563: checking for $ac_hdr" >&5
19563 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19564   echo $ac_n "(cached) $ac_c" 1>&6
19565 else
19566   cat > conftest.$ac_ext <<EOF
19567 #line 19568 "configure"
19568 #include "confdefs.h"
19569 #include <$ac_hdr>
19570 EOF
19571 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19572 { (eval echo configure:19573: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19573 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19574 if test -z "$ac_err"; then
19575   rm -rf conftest*
19576   eval "ac_cv_header_$ac_safe=yes"
19577 else
19578   echo "$ac_err" >&5
19579   echo "configure: failed program was:" >&5
19580   cat conftest.$ac_ext >&5
19581   rm -rf conftest*
19582   eval "ac_cv_header_$ac_safe=no"
19583 fi
19584 rm -f conftest*
19585 fi
19586 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19587   echo "$ac_t""yes" 1>&6
19588     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19589   cat >> confdefs.h <<EOF
19590 #define $ac_tr_hdr 1
19591 EOF
19592  
19593 else
19594   echo "$ac_t""no" 1>&6
19595 fi
19596 done
19597
19598
19599         if test $ac_cv_header_tcl_h != yes ; then
19600                 have_tcl=no
19601         else
19602                 for lib in tcl tcl7.6 tcl8.0 tcl8.2 ; do
19603                         echo $ac_n "checking for main in -l$lib""... $ac_c" 1>&6
19604 echo "configure:19605: checking for main in -l$lib" >&5
19605 ac_lib_var=`echo $lib'_'main | sed 'y%./+-:%__p__%'`
19606 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19607   echo $ac_n "(cached) $ac_c" 1>&6
19608 else
19609   ac_save_LIBS="$LIBS"
19610 LIBS="-l$lib  $LIBS"
19611 cat > conftest.$ac_ext <<EOF
19612 #line 19613 "configure"
19613 #include "confdefs.h"
19614
19615 int main() {
19616 main()
19617 ; return 0; }
19618 EOF
19619 if { (eval echo configure:19620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19620   rm -rf conftest*
19621   eval "ac_cv_lib_$ac_lib_var=yes"
19622 else
19623   echo "configure: failed program was:" >&5
19624   cat conftest.$ac_ext >&5
19625   rm -rf conftest*
19626   eval "ac_cv_lib_$ac_lib_var=no"
19627 fi
19628 rm -f conftest*
19629 LIBS="$ac_save_LIBS"
19630
19631 fi
19632 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19633   echo "$ac_t""yes" 1>&6
19634   have_tcl=yes
19635                            if test x"$ol_with_tcl_module" = "xstatic" ; then
19636                                         SLAPD_LIBS="$SLAPD_LIBS -l${lib}"
19637                            else
19638                                         MOD_TCL_LIB="-l${lib}"
19639                            fi;break
19640 else
19641   echo "$ac_t""no" 1>&6
19642 have_tcl=no
19643 fi
19644
19645                 done
19646         fi
19647
19648         if test $have_tcl != yes ; then
19649                 echo "configure: warning: could not find -ltcl" 1>&2
19650                 if test $ol_enable_tcl = yes ; then
19651                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
19652                 fi
19653
19654                 ol_enable_tcl=no
19655         fi
19656 fi
19657
19658 ol_link_termcap=no
19659 for ac_hdr in termcap.h ncurses.h
19660 do
19661 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19662 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19663 echo "configure:19664: checking for $ac_hdr" >&5
19664 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19665   echo $ac_n "(cached) $ac_c" 1>&6
19666 else
19667   cat > conftest.$ac_ext <<EOF
19668 #line 19669 "configure"
19669 #include "confdefs.h"
19670 #include <$ac_hdr>
19671 EOF
19672 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19673 { (eval echo configure:19674: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19674 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19675 if test -z "$ac_err"; then
19676   rm -rf conftest*
19677   eval "ac_cv_header_$ac_safe=yes"
19678 else
19679   echo "$ac_err" >&5
19680   echo "configure: failed program was:" >&5
19681   cat conftest.$ac_ext >&5
19682   rm -rf conftest*
19683   eval "ac_cv_header_$ac_safe=no"
19684 fi
19685 rm -f conftest*
19686 fi
19687 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19688   echo "$ac_t""yes" 1>&6
19689     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19690   cat >> confdefs.h <<EOF
19691 #define $ac_tr_hdr 1
19692 EOF
19693  
19694 else
19695   echo "$ac_t""no" 1>&6
19696 fi
19697 done
19698
19699
19700 if test $ol_link_termcap = no ; then
19701         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
19702 echo "configure:19703: checking for tputs in -ltermcap" >&5
19703 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
19704 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19705   echo $ac_n "(cached) $ac_c" 1>&6
19706 else
19707   ac_save_LIBS="$LIBS"
19708 LIBS="-ltermcap  $LIBS"
19709 cat > conftest.$ac_ext <<EOF
19710 #line 19711 "configure"
19711 #include "confdefs.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 tputs();
19716
19717 int main() {
19718 tputs()
19719 ; return 0; }
19720 EOF
19721 if { (eval echo configure:19722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19722   rm -rf conftest*
19723   eval "ac_cv_lib_$ac_lib_var=yes"
19724 else
19725   echo "configure: failed program was:" >&5
19726   cat conftest.$ac_ext >&5
19727   rm -rf conftest*
19728   eval "ac_cv_lib_$ac_lib_var=no"
19729 fi
19730 rm -f conftest*
19731 LIBS="$ac_save_LIBS"
19732
19733 fi
19734 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19735   echo "$ac_t""yes" 1>&6
19736   have_termcap=yes
19737 else
19738   echo "$ac_t""no" 1>&6
19739 have_termcap=no
19740 fi
19741
19742         if test $have_termcap = yes ; then
19743                 cat >> confdefs.h <<\EOF
19744 #define HAVE_TERMCAP 1
19745 EOF
19746
19747                 ol_link_termcap=yes
19748                 TERMCAP_LIBS=-ltermcap
19749         fi
19750 fi
19751
19752 if test $ol_link_termcap = no ; then
19753         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
19754 echo "configure:19755: checking for initscr in -lncurses" >&5
19755 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
19756 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19757   echo $ac_n "(cached) $ac_c" 1>&6
19758 else
19759   ac_save_LIBS="$LIBS"
19760 LIBS="-lncurses  $LIBS"
19761 cat > conftest.$ac_ext <<EOF
19762 #line 19763 "configure"
19763 #include "confdefs.h"
19764 /* Override any gcc2 internal prototype to avoid an error.  */
19765 /* We use char because int might match the return type of a gcc2
19766     builtin and then its argument prototype would still apply.  */
19767 char initscr();
19768
19769 int main() {
19770 initscr()
19771 ; return 0; }
19772 EOF
19773 if { (eval echo configure:19774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19774   rm -rf conftest*
19775   eval "ac_cv_lib_$ac_lib_var=yes"
19776 else
19777   echo "configure: failed program was:" >&5
19778   cat conftest.$ac_ext >&5
19779   rm -rf conftest*
19780   eval "ac_cv_lib_$ac_lib_var=no"
19781 fi
19782 rm -f conftest*
19783 LIBS="$ac_save_LIBS"
19784
19785 fi
19786 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19787   echo "$ac_t""yes" 1>&6
19788   have_ncurses=yes
19789 else
19790   echo "$ac_t""no" 1>&6
19791 have_ncurses=no
19792 fi
19793
19794         if test $have_ncurses = yes ; then
19795                 cat >> confdefs.h <<\EOF
19796 #define HAVE_NCURSES 1
19797 EOF
19798
19799                 ol_link_termcap=yes
19800                 TERMCAP_LIBS=-lncurses
19801         fi
19802 fi
19803
19804 if test $ol_link_termcap = no ; then
19805         cat >> confdefs.h <<\EOF
19806 #define NO_TERMCAP 1
19807 EOF
19808
19809         TERMCAP_LIBS=
19810 fi
19811
19812 ol_link_sasl=no
19813 ol_link_spasswd=no
19814 if test $ol_with_cyrus_sasl != no ; then
19815         for ac_hdr in sasl/sasl.h sasl.h
19816 do
19817 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19818 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19819 echo "configure:19820: checking for $ac_hdr" >&5
19820 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19821   echo $ac_n "(cached) $ac_c" 1>&6
19822 else
19823   cat > conftest.$ac_ext <<EOF
19824 #line 19825 "configure"
19825 #include "confdefs.h"
19826 #include <$ac_hdr>
19827 EOF
19828 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19829 { (eval echo configure:19830: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19830 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19831 if test -z "$ac_err"; then
19832   rm -rf conftest*
19833   eval "ac_cv_header_$ac_safe=yes"
19834 else
19835   echo "$ac_err" >&5
19836   echo "configure: failed program was:" >&5
19837   cat conftest.$ac_ext >&5
19838   rm -rf conftest*
19839   eval "ac_cv_header_$ac_safe=no"
19840 fi
19841 rm -f conftest*
19842 fi
19843 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19844   echo "$ac_t""yes" 1>&6
19845     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19846   cat >> confdefs.h <<EOF
19847 #define $ac_tr_hdr 1
19848 EOF
19849  
19850 else
19851   echo "$ac_t""no" 1>&6
19852 fi
19853 done
19854
19855
19856         if test $ac_cv_header_sasl_sasl_h = yes -o $ac_cv_header_sasl_h = yes; then
19857                 echo $ac_n "checking for sasl_client_init in -lsasl2""... $ac_c" 1>&6
19858 echo "configure:19859: checking for sasl_client_init in -lsasl2" >&5
19859 ac_lib_var=`echo sasl2'_'sasl_client_init | sed 'y%./+-:%__p__%'`
19860 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19861   echo $ac_n "(cached) $ac_c" 1>&6
19862 else
19863   ac_save_LIBS="$LIBS"
19864 LIBS="-lsasl2  $LIBS"
19865 cat > conftest.$ac_ext <<EOF
19866 #line 19867 "configure"
19867 #include "confdefs.h"
19868 /* Override any gcc2 internal prototype to avoid an error.  */
19869 /* We use char because int might match the return type of a gcc2
19870     builtin and then its argument prototype would still apply.  */
19871 char sasl_client_init();
19872
19873 int main() {
19874 sasl_client_init()
19875 ; return 0; }
19876 EOF
19877 if { (eval echo configure:19878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19878   rm -rf conftest*
19879   eval "ac_cv_lib_$ac_lib_var=yes"
19880 else
19881   echo "configure: failed program was:" >&5
19882   cat conftest.$ac_ext >&5
19883   rm -rf conftest*
19884   eval "ac_cv_lib_$ac_lib_var=no"
19885 fi
19886 rm -f conftest*
19887 LIBS="$ac_save_LIBS"
19888
19889 fi
19890 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19891   echo "$ac_t""yes" 1>&6
19892   ol_link_sasl="-lsasl2"
19893 else
19894   echo "$ac_t""no" 1>&6
19895 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
19896 echo "configure:19897: checking for sasl_client_init in -lsasl" >&5
19897 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
19898 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19899   echo $ac_n "(cached) $ac_c" 1>&6
19900 else
19901   ac_save_LIBS="$LIBS"
19902 LIBS="-lsasl  $LIBS"
19903 cat > conftest.$ac_ext <<EOF
19904 #line 19905 "configure"
19905 #include "confdefs.h"
19906 /* Override any gcc2 internal prototype to avoid an error.  */
19907 /* We use char because int might match the return type of a gcc2
19908     builtin and then its argument prototype would still apply.  */
19909 char sasl_client_init();
19910
19911 int main() {
19912 sasl_client_init()
19913 ; return 0; }
19914 EOF
19915 if { (eval echo configure:19916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19916   rm -rf conftest*
19917   eval "ac_cv_lib_$ac_lib_var=yes"
19918 else
19919   echo "configure: failed program was:" >&5
19920   cat conftest.$ac_ext >&5
19921   rm -rf conftest*
19922   eval "ac_cv_lib_$ac_lib_var=no"
19923 fi
19924 rm -f conftest*
19925 LIBS="$ac_save_LIBS"
19926
19927 fi
19928 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19929   echo "$ac_t""yes" 1>&6
19930   ol_link_sasl="-lsasl"
19931 else
19932   echo "$ac_t""no" 1>&6
19933 fi
19934
19935 fi
19936
19937         fi
19938
19939         if test $ol_link_sasl = no ; then
19940                 if test $ol_with_cyrus_sasl != auto ; then
19941                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
19942                 else
19943                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
19944                         echo "configure: warning: SASL authentication not supported!" 1>&2
19945                         if test $ol_link_tls = no ; then
19946                                 echo "configure: warning: Strong authentication not supported!" 1>&2
19947                         fi
19948                 fi
19949         else
19950                 echo $ac_n "checking Cyrus SASL library version""... $ac_c" 1>&6
19951 echo "configure:19952: checking Cyrus SASL library version" >&5
19952 if eval "test \"\${ol_cv_sasl_compat+set}\" = set"; then
19953   echo $ac_n "(cached) $ac_c" 1>&6
19954 else
19955   
19956         cat > conftest.$ac_ext <<EOF
19957 #line 19958 "configure"
19958 #include "confdefs.h"
19959
19960 #ifdef HAVE_SASL_SASL_H
19961 #include <sasl/sasl.h>
19962 #else
19963 #include <sasl.h>
19964 #endif
19965
19966 /* require 2.1.3 or later */
19967 #if SASL_VERSION_MAJOR == 1  && SASL_VERSION_MINOR >= 5
19968         char *__sasl_compat = "1.5.x okay";
19969 #elif SASL_VERSION_MAJOR == 2  && SASL_VERSION_MINOR > 1
19970         __sasl_compat "2.2+ or better okay (we guess)";
19971 #elif SASL_VERSION_MAJOR == 2  && SASL_VERSION_MINOR == 1 \
19972         && SASL_VERSION_STEP >=3
19973         __sasl_compat = "2.1.3+ or better okay";
19974 #endif
19975         
19976 EOF
19977 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
19978   egrep "__sasl_compat" >/dev/null 2>&1; then
19979   rm -rf conftest*
19980   ol_cv_sasl_compat=yes
19981 else
19982   rm -rf conftest*
19983   ol_cv_sasl_compat=no
19984 fi
19985 rm -f conftest*
19986
19987 fi
19988
19989 echo "$ac_t""$ol_cv_sasl_compat" 1>&6
19990
19991                 if test $ol_cv_sasl_compat = no ; then
19992                         ol_link_sasl=no
19993                         { echo "configure: error: Cyrus SASL library located but incompatible" 1>&2; exit 1; }
19994                 fi
19995
19996                 cat >> confdefs.h <<\EOF
19997 #define HAVE_CYRUS_SASL 1
19998 EOF
19999
20000                 SASL_LIBS="$ol_link_sasl"
20001                 if test $ol_enable_spasswd != no ; then
20002                         ol_link_spasswd=yes
20003                 fi
20004
20005                 ac_save_LIBS="$LIBS"
20006                 LIBS="$LIBS $ol_link_sasl"
20007                 echo $ac_n "checking for sasl_version""... $ac_c" 1>&6
20008 echo "configure:20009: checking for sasl_version" >&5
20009 if eval "test \"\${ac_cv_func_sasl_version+set}\" = set"; then
20010   echo $ac_n "(cached) $ac_c" 1>&6
20011 else
20012   cat > conftest.$ac_ext <<EOF
20013 #line 20014 "configure"
20014 #include "confdefs.h"
20015 /* System header to define __stub macros and hopefully few prototypes,
20016     which can conflict with char sasl_version(); below.  */
20017 #include <assert.h>
20018 /* Override any gcc2 internal prototype to avoid an error.  */
20019 /* We use char because int might match the return type of a gcc2
20020     builtin and then its argument prototype would still apply.  */
20021 char sasl_version();
20022 char (*f)();
20023
20024 int main() {
20025
20026 /* The GNU C library defines this for functions which it implements
20027     to always fail with ENOSYS.  Some functions are actually named
20028     something starting with __ and the normal name is an alias.  */
20029 #if defined (__stub_sasl_version) || defined (__stub___sasl_version)
20030 choke me
20031 #else
20032 f = sasl_version;
20033 #endif
20034
20035 ; return 0; }
20036 EOF
20037 if { (eval echo configure:20038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20038   rm -rf conftest*
20039   eval "ac_cv_func_sasl_version=yes"
20040 else
20041   echo "configure: failed program was:" >&5
20042   cat conftest.$ac_ext >&5
20043   rm -rf conftest*
20044   eval "ac_cv_func_sasl_version=no"
20045 fi
20046 rm -f conftest*
20047 fi
20048
20049 if eval "test \"`echo '$ac_cv_func_'sasl_version`\" = yes"; then
20050   echo "$ac_t""yes" 1>&6
20051   cat >> confdefs.h <<\EOF
20052 #define HAVE_SASL_VERSION 1
20053 EOF
20054
20055 else
20056   echo "$ac_t""no" 1>&6
20057 fi
20058
20059                 LIBS="$ac_save_LIBS"
20060         fi
20061
20062 else
20063         echo "configure: warning: SASL authentication not supported!" 1>&2
20064         if test $ol_link_tls = no ; then
20065                 echo "configure: warning: Strong authentication not supported!" 1>&2
20066         fi
20067 fi
20068
20069 if test $cross_compiling != yes -a "$ac_cv_mingw32" != yes ; then
20070         dev=no
20071         if test -r /dev/urandom ; then
20072                 dev="/dev/urandom";
20073         elif test -r /idev/urandom ; then
20074                 dev="/idev/urandom";
20075         elif test -r /dev/srandom ; then
20076                 dev="/dev/srandom";
20077         elif test -r /dev/random ; then
20078                 dev="/dev/random";
20079         elif test -r /idev/random ; then
20080                 dev="/idev/random";
20081         fi
20082
20083         if test $dev != no ; then
20084                 cat >> confdefs.h <<EOF
20085 #define URANDOM_DEVICE "$dev"
20086 EOF
20087
20088         fi
20089 fi
20090
20091 ol_link_fetch=no
20092 if test $ol_with_fetch != no ; then
20093         ol_LIBS=$LIBS
20094 LIBS="-lfetch -lcom_err $LIBS"
20095 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
20096 echo "configure:20097: checking fetch(3) library" >&5
20097 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
20098   echo $ac_n "(cached) $ac_c" 1>&6
20099 else
20100   
20101         cat > conftest.$ac_ext <<EOF
20102 #line 20103 "configure"
20103 #include "confdefs.h"
20104
20105 #include <sys/param.h>
20106 #include <stdio.h>
20107 #include <fetch.h>
20108 int main() {
20109 struct url *u = fetchParseURL("file:///"); 
20110 ; return 0; }
20111 EOF
20112 if { (eval echo configure:20113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20113   rm -rf conftest*
20114   ol_cv_lib_fetch=yes
20115 else
20116   echo "configure: failed program was:" >&5
20117   cat conftest.$ac_ext >&5
20118   rm -rf conftest*
20119   ol_cv_lib_fetch=no
20120 fi
20121 rm -f conftest*
20122 fi
20123
20124 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
20125 LIBS=$ol_LIBS
20126 if test $ol_cv_lib_fetch != no ; then
20127         ol_link_fetch="-lfetch -lcom_err"
20128         cat >> confdefs.h <<\EOF
20129 #define HAVE_FETCH 1
20130 EOF
20131
20132 fi
20133
20134
20135         if test $ol_cv_lib_fetch != no ; then
20136                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
20137                 ol_link_fetch=freebsd
20138
20139         elif test $ol_with_fetch != auto ; then
20140                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
20141         fi 
20142 fi
20143
20144 ol_link_readline=no
20145 if test $ol_with_readline != no ; then
20146         for ac_hdr in readline/readline.h readline/history.h
20147 do
20148 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20149 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20150 echo "configure:20151: checking for $ac_hdr" >&5
20151 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20152   echo $ac_n "(cached) $ac_c" 1>&6
20153 else
20154   cat > conftest.$ac_ext <<EOF
20155 #line 20156 "configure"
20156 #include "confdefs.h"
20157 #include <$ac_hdr>
20158 EOF
20159 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20160 { (eval echo configure:20161: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20161 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20162 if test -z "$ac_err"; then
20163   rm -rf conftest*
20164   eval "ac_cv_header_$ac_safe=yes"
20165 else
20166   echo "$ac_err" >&5
20167   echo "configure: failed program was:" >&5
20168   cat conftest.$ac_ext >&5
20169   rm -rf conftest*
20170   eval "ac_cv_header_$ac_safe=no"
20171 fi
20172 rm -f conftest*
20173 fi
20174 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20175   echo "$ac_t""yes" 1>&6
20176     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20177   cat >> confdefs.h <<EOF
20178 #define $ac_tr_hdr 1
20179 EOF
20180  
20181 else
20182   echo "$ac_t""no" 1>&6
20183 fi
20184 done
20185
20186
20187         if test $ac_cv_header_readline_readline_h = yes ; then
20188                 save_LIBS="$LIBS"
20189                 LIBS="$TERMCAP_LIBS $LIBS"
20190                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
20191 echo "configure:20192: checking for readline in -lreadline" >&5
20192 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
20193 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20194   echo $ac_n "(cached) $ac_c" 1>&6
20195 else
20196   ac_save_LIBS="$LIBS"
20197 LIBS="-lreadline  $LIBS"
20198 cat > conftest.$ac_ext <<EOF
20199 #line 20200 "configure"
20200 #include "confdefs.h"
20201 /* Override any gcc2 internal prototype to avoid an error.  */
20202 /* We use char because int might match the return type of a gcc2
20203     builtin and then its argument prototype would still apply.  */
20204 char readline();
20205
20206 int main() {
20207 readline()
20208 ; return 0; }
20209 EOF
20210 if { (eval echo configure:20211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20211   rm -rf conftest*
20212   eval "ac_cv_lib_$ac_lib_var=yes"
20213 else
20214   echo "configure: failed program was:" >&5
20215   cat conftest.$ac_ext >&5
20216   rm -rf conftest*
20217   eval "ac_cv_lib_$ac_lib_var=no"
20218 fi
20219 rm -f conftest*
20220 LIBS="$ac_save_LIBS"
20221
20222 fi
20223 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20224   echo "$ac_t""yes" 1>&6
20225   have_readline=yes
20226 else
20227   echo "$ac_t""no" 1>&6
20228 have_readline=no
20229 fi
20230
20231                 LIBS="$save_LIBS"
20232                         
20233                 if test $have_readline = yes ; then
20234                         ol_with_readline=found
20235                         ol_link_readline=yes
20236
20237                         READLINE_LIBS="-lreadline"
20238                 fi
20239         fi
20240 fi
20241
20242 if test $ol_link_readline = yes ; then
20243         cat >> confdefs.h <<\EOF
20244 #define HAVE_READLINE 1
20245 EOF
20246
20247 fi
20248
20249
20250 if test $ol_enable_crypt != no ; then
20251         save_LIBS="$LIBS"
20252         LIBS="$TLS_LIBS $LIBS"
20253
20254         echo $ac_n "checking for crypt""... $ac_c" 1>&6
20255 echo "configure:20256: checking for crypt" >&5
20256 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
20257   echo $ac_n "(cached) $ac_c" 1>&6
20258 else
20259   cat > conftest.$ac_ext <<EOF
20260 #line 20261 "configure"
20261 #include "confdefs.h"
20262 /* System header to define __stub macros and hopefully few prototypes,
20263     which can conflict with char crypt(); below.  */
20264 #include <assert.h>
20265 /* Override any gcc2 internal prototype to avoid an error.  */
20266 /* We use char because int might match the return type of a gcc2
20267     builtin and then its argument prototype would still apply.  */
20268 char crypt();
20269 char (*f)();
20270
20271 int main() {
20272
20273 /* The GNU C library defines this for functions which it implements
20274     to always fail with ENOSYS.  Some functions are actually named
20275     something starting with __ and the normal name is an alias.  */
20276 #if defined (__stub_crypt) || defined (__stub___crypt)
20277 choke me
20278 #else
20279 f = crypt;
20280 #endif
20281
20282 ; return 0; }
20283 EOF
20284 if { (eval echo configure:20285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20285   rm -rf conftest*
20286   eval "ac_cv_func_crypt=yes"
20287 else
20288   echo "configure: failed program was:" >&5
20289   cat conftest.$ac_ext >&5
20290   rm -rf conftest*
20291   eval "ac_cv_func_crypt=no"
20292 fi
20293 rm -f conftest*
20294 fi
20295
20296 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
20297   echo "$ac_t""yes" 1>&6
20298   have_crypt=yes
20299 else
20300   echo "$ac_t""no" 1>&6
20301
20302                 LIBS="$save_LIBS"
20303                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
20304 echo "configure:20305: checking for crypt in -lcrypt" >&5
20305 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
20306 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20307   echo $ac_n "(cached) $ac_c" 1>&6
20308 else
20309   ac_save_LIBS="$LIBS"
20310 LIBS="-lcrypt  $LIBS"
20311 cat > conftest.$ac_ext <<EOF
20312 #line 20313 "configure"
20313 #include "confdefs.h"
20314 /* Override any gcc2 internal prototype to avoid an error.  */
20315 /* We use char because int might match the return type of a gcc2
20316     builtin and then its argument prototype would still apply.  */
20317 char crypt();
20318
20319 int main() {
20320 crypt()
20321 ; return 0; }
20322 EOF
20323 if { (eval echo configure:20324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20324   rm -rf conftest*
20325   eval "ac_cv_lib_$ac_lib_var=yes"
20326 else
20327   echo "configure: failed program was:" >&5
20328   cat conftest.$ac_ext >&5
20329   rm -rf conftest*
20330   eval "ac_cv_lib_$ac_lib_var=no"
20331 fi
20332 rm -f conftest*
20333 LIBS="$ac_save_LIBS"
20334
20335 fi
20336 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20337   echo "$ac_t""yes" 1>&6
20338   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
20339                         have_crypt=yes
20340 else
20341   echo "$ac_t""no" 1>&6
20342 have_crypt=no
20343 fi
20344
20345 fi
20346
20347
20348         LIBS="$save_LIBS"
20349
20350         if test $have_crypt = yes ; then
20351                 cat >> confdefs.h <<\EOF
20352 #define HAVE_CRYPT 1
20353 EOF
20354
20355         else
20356                 echo "configure: warning: could not find crypt" 1>&2
20357                 if test $ol_enable_crypt = yes ; then
20358                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
20359                 fi
20360
20361                 echo "configure: warning: disabling crypt support" 1>&2
20362                 ol_enable_crypt=no
20363         fi
20364 fi
20365
20366 if test $ol_enable_proctitle != no ; then
20367         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
20368 echo "configure:20369: checking for setproctitle" >&5
20369 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
20370   echo $ac_n "(cached) $ac_c" 1>&6
20371 else
20372   cat > conftest.$ac_ext <<EOF
20373 #line 20374 "configure"
20374 #include "confdefs.h"
20375 /* System header to define __stub macros and hopefully few prototypes,
20376     which can conflict with char setproctitle(); below.  */
20377 #include <assert.h>
20378 /* Override any gcc2 internal prototype to avoid an error.  */
20379 /* We use char because int might match the return type of a gcc2
20380     builtin and then its argument prototype would still apply.  */
20381 char setproctitle();
20382 char (*f)();
20383
20384 int main() {
20385
20386 /* The GNU C library defines this for functions which it implements
20387     to always fail with ENOSYS.  Some functions are actually named
20388     something starting with __ and the normal name is an alias.  */
20389 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
20390 choke me
20391 #else
20392 f = setproctitle;
20393 #endif
20394
20395 ; return 0; }
20396 EOF
20397 if { (eval echo configure:20398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20398   rm -rf conftest*
20399   eval "ac_cv_func_setproctitle=yes"
20400 else
20401   echo "configure: failed program was:" >&5
20402   cat conftest.$ac_ext >&5
20403   rm -rf conftest*
20404   eval "ac_cv_func_setproctitle=no"
20405 fi
20406 rm -f conftest*
20407 fi
20408
20409 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
20410   echo "$ac_t""yes" 1>&6
20411   have_setproctitle=yes
20412 else
20413   echo "$ac_t""no" 1>&6
20414
20415                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
20416 echo "configure:20417: checking for setproctitle in -lutil" >&5
20417 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
20418 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20419   echo $ac_n "(cached) $ac_c" 1>&6
20420 else
20421   ac_save_LIBS="$LIBS"
20422 LIBS="-lutil  $LIBS"
20423 cat > conftest.$ac_ext <<EOF
20424 #line 20425 "configure"
20425 #include "confdefs.h"
20426 /* Override any gcc2 internal prototype to avoid an error.  */
20427 /* We use char because int might match the return type of a gcc2
20428     builtin and then its argument prototype would still apply.  */
20429 char setproctitle();
20430
20431 int main() {
20432 setproctitle()
20433 ; return 0; }
20434 EOF
20435 if { (eval echo configure:20436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20436   rm -rf conftest*
20437   eval "ac_cv_lib_$ac_lib_var=yes"
20438 else
20439   echo "configure: failed program was:" >&5
20440   cat conftest.$ac_ext >&5
20441   rm -rf conftest*
20442   eval "ac_cv_lib_$ac_lib_var=no"
20443 fi
20444 rm -f conftest*
20445 LIBS="$ac_save_LIBS"
20446
20447 fi
20448 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20449   echo "$ac_t""yes" 1>&6
20450   have_setproctitle=yes
20451                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
20452 else
20453   echo "$ac_t""no" 1>&6
20454 have_setproctitle=no
20455                         LIBOBJS="$LIBOBJS setproctitle.o"
20456                         LIBSRCS="$LIBSRCS setproctitle.c"
20457 fi
20458
20459 fi
20460
20461
20462         if test $have_setproctitle = yes ; then
20463                 cat >> confdefs.h <<\EOF
20464 #define HAVE_SETPROCTITLE 1
20465 EOF
20466
20467         fi
20468 fi
20469
20470 if test $ol_enable_slp != no ; then
20471         for ac_hdr in slp.h 
20472 do
20473 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20474 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20475 echo "configure:20476: checking for $ac_hdr" >&5
20476 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20477   echo $ac_n "(cached) $ac_c" 1>&6
20478 else
20479   cat > conftest.$ac_ext <<EOF
20480 #line 20481 "configure"
20481 #include "confdefs.h"
20482 #include <$ac_hdr>
20483 EOF
20484 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20485 { (eval echo configure:20486: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20486 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20487 if test -z "$ac_err"; then
20488   rm -rf conftest*
20489   eval "ac_cv_header_$ac_safe=yes"
20490 else
20491   echo "$ac_err" >&5
20492   echo "configure: failed program was:" >&5
20493   cat conftest.$ac_ext >&5
20494   rm -rf conftest*
20495   eval "ac_cv_header_$ac_safe=no"
20496 fi
20497 rm -f conftest*
20498 fi
20499 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20500   echo "$ac_t""yes" 1>&6
20501     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20502   cat >> confdefs.h <<EOF
20503 #define $ac_tr_hdr 1
20504 EOF
20505  
20506 else
20507   echo "$ac_t""no" 1>&6
20508 fi
20509 done
20510
20511
20512         if test $ac_cv_header_slp_h = yes ; then
20513                 echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
20514 echo "configure:20515: checking for SLPOpen in -lslp" >&5
20515 ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-:%__p__%'`
20516 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20517   echo $ac_n "(cached) $ac_c" 1>&6
20518 else
20519   ac_save_LIBS="$LIBS"
20520 LIBS="-lslp  $LIBS"
20521 cat > conftest.$ac_ext <<EOF
20522 #line 20523 "configure"
20523 #include "confdefs.h"
20524 /* Override any gcc2 internal prototype to avoid an error.  */
20525 /* We use char because int might match the return type of a gcc2
20526     builtin and then its argument prototype would still apply.  */
20527 char SLPOpen();
20528
20529 int main() {
20530 SLPOpen()
20531 ; return 0; }
20532 EOF
20533 if { (eval echo configure:20534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20534   rm -rf conftest*
20535   eval "ac_cv_lib_$ac_lib_var=yes"
20536 else
20537   echo "configure: failed program was:" >&5
20538   cat conftest.$ac_ext >&5
20539   rm -rf conftest*
20540   eval "ac_cv_lib_$ac_lib_var=no"
20541 fi
20542 rm -f conftest*
20543 LIBS="$ac_save_LIBS"
20544
20545 fi
20546 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20547   echo "$ac_t""yes" 1>&6
20548   have_slp=yes
20549 else
20550   echo "$ac_t""no" 1>&6
20551 have_slp=no
20552 fi
20553
20554                 if test $have_slp = yes ; then
20555                         cat >> confdefs.h <<\EOF
20556 #define HAVE_SLP 1
20557 EOF
20558
20559                         SLAPD_SLP_LIBS=-lslp
20560                 fi
20561
20562         elif test $ol_enable_slp = yes ; then
20563                 { echo "configure: error: SLP not found" 1>&2; exit 1; }
20564         fi
20565 fi
20566
20567 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
20568 echo "configure:20569: checking for ANSI C header files" >&5
20569 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
20570   echo $ac_n "(cached) $ac_c" 1>&6
20571 else
20572   cat > conftest.$ac_ext <<EOF
20573 #line 20574 "configure"
20574 #include "confdefs.h"
20575 #include <stdlib.h>
20576 #include <stdarg.h>
20577 #include <string.h>
20578 #include <float.h>
20579 EOF
20580 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20581 { (eval echo configure:20582: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20582 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20583 if test -z "$ac_err"; then
20584   rm -rf conftest*
20585   ac_cv_header_stdc=yes
20586 else
20587   echo "$ac_err" >&5
20588   echo "configure: failed program was:" >&5
20589   cat conftest.$ac_ext >&5
20590   rm -rf conftest*
20591   ac_cv_header_stdc=no
20592 fi
20593 rm -f conftest*
20594
20595 if test $ac_cv_header_stdc = yes; then
20596   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
20597 cat > conftest.$ac_ext <<EOF
20598 #line 20599 "configure"
20599 #include "confdefs.h"
20600 #include <string.h>
20601 EOF
20602 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20603   egrep "memchr" >/dev/null 2>&1; then
20604   :
20605 else
20606   rm -rf conftest*
20607   ac_cv_header_stdc=no
20608 fi
20609 rm -f conftest*
20610
20611 fi
20612
20613 if test $ac_cv_header_stdc = yes; then
20614   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
20615 cat > conftest.$ac_ext <<EOF
20616 #line 20617 "configure"
20617 #include "confdefs.h"
20618 #include <stdlib.h>
20619 EOF
20620 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20621   egrep "free" >/dev/null 2>&1; then
20622   :
20623 else
20624   rm -rf conftest*
20625   ac_cv_header_stdc=no
20626 fi
20627 rm -f conftest*
20628
20629 fi
20630
20631 if test $ac_cv_header_stdc = yes; then
20632   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
20633 if test "$cross_compiling" = yes; then
20634   :
20635 else
20636   cat > conftest.$ac_ext <<EOF
20637 #line 20638 "configure"
20638 #include "confdefs.h"
20639 #include <ctype.h>
20640 #if ((' ' & 0x0FF) == 0x020)
20641 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
20642 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
20643 #else
20644 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
20645  || ('j' <= (c) && (c) <= 'r') \
20646  || ('s' <= (c) && (c) <= 'z'))
20647 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
20648 #endif
20649 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
20650 int main () { int i; for (i = 0; i < 256; i++)
20651 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
20652 exit (0); }
20653
20654 EOF
20655 if { (eval echo configure:20656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
20656 then
20657   :
20658 else
20659   echo "configure: failed program was:" >&5
20660   cat conftest.$ac_ext >&5
20661   rm -fr conftest*
20662   ac_cv_header_stdc=no
20663 fi
20664 rm -fr conftest*
20665 fi
20666
20667 fi
20668 fi
20669
20670 echo "$ac_t""$ac_cv_header_stdc" 1>&6
20671 if test $ac_cv_header_stdc = yes; then
20672   cat >> confdefs.h <<\EOF
20673 #define STDC_HEADERS 1
20674 EOF
20675
20676 fi
20677
20678 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
20679 echo "configure:20680: checking for mode_t" >&5
20680 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
20681   echo $ac_n "(cached) $ac_c" 1>&6
20682 else
20683   cat > conftest.$ac_ext <<EOF
20684 #line 20685 "configure"
20685 #include "confdefs.h"
20686 #include <sys/types.h>
20687 #if STDC_HEADERS
20688 #include <stdlib.h>
20689 #include <stddef.h>
20690 #endif
20691
20692 EOF
20693 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20694   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
20695   rm -rf conftest*
20696   eval "ac_cv_type_mode_t=yes"
20697 else
20698   rm -rf conftest*
20699   eval "ac_cv_type_mode_t=no"
20700 fi
20701 rm -f conftest*
20702
20703 fi
20704 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
20705   echo "$ac_t""yes" 1>&6
20706 else
20707   echo "$ac_t""no" 1>&6
20708   cat >> confdefs.h <<EOF
20709 #define mode_t int
20710 EOF
20711
20712 fi
20713
20714 echo $ac_n "checking for off_t""... $ac_c" 1>&6
20715 echo "configure:20716: checking for off_t" >&5
20716 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
20717   echo $ac_n "(cached) $ac_c" 1>&6
20718 else
20719   cat > conftest.$ac_ext <<EOF
20720 #line 20721 "configure"
20721 #include "confdefs.h"
20722 #include <sys/types.h>
20723 #if STDC_HEADERS
20724 #include <stdlib.h>
20725 #include <stddef.h>
20726 #endif
20727
20728 EOF
20729 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20730   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
20731   rm -rf conftest*
20732   eval "ac_cv_type_off_t=yes"
20733 else
20734   rm -rf conftest*
20735   eval "ac_cv_type_off_t=no"
20736 fi
20737 rm -f conftest*
20738
20739 fi
20740 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
20741   echo "$ac_t""yes" 1>&6
20742 else
20743   echo "$ac_t""no" 1>&6
20744   cat >> confdefs.h <<EOF
20745 #define off_t long
20746 EOF
20747
20748 fi
20749
20750 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
20751 echo "configure:20752: checking for pid_t" >&5
20752 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
20753   echo $ac_n "(cached) $ac_c" 1>&6
20754 else
20755   cat > conftest.$ac_ext <<EOF
20756 #line 20757 "configure"
20757 #include "confdefs.h"
20758 #include <sys/types.h>
20759 #if STDC_HEADERS
20760 #include <stdlib.h>
20761 #include <stddef.h>
20762 #endif
20763
20764 EOF
20765 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20766   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
20767   rm -rf conftest*
20768   eval "ac_cv_type_pid_t=yes"
20769 else
20770   rm -rf conftest*
20771   eval "ac_cv_type_pid_t=no"
20772 fi
20773 rm -f conftest*
20774
20775 fi
20776 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
20777   echo "$ac_t""yes" 1>&6
20778 else
20779   echo "$ac_t""no" 1>&6
20780   cat >> confdefs.h <<EOF
20781 #define pid_t int
20782 EOF
20783
20784 fi
20785
20786 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
20787 echo "configure:20788: checking for ptrdiff_t" >&5
20788 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
20789   echo $ac_n "(cached) $ac_c" 1>&6
20790 else
20791   cat > conftest.$ac_ext <<EOF
20792 #line 20793 "configure"
20793 #include "confdefs.h"
20794 #include <stddef.h>
20795 int main() {
20796 ptrdiff_t p
20797 ; return 0; }
20798 EOF
20799 if { (eval echo configure:20800: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
20800   rm -rf conftest*
20801   am_cv_type_ptrdiff_t=yes
20802 else
20803   echo "configure: failed program was:" >&5
20804   cat conftest.$ac_ext >&5
20805   rm -rf conftest*
20806   am_cv_type_ptrdiff_t=no
20807 fi
20808 rm -f conftest*
20809 fi
20810
20811 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
20812    if test $am_cv_type_ptrdiff_t = yes; then
20813      cat >> confdefs.h <<\EOF
20814 #define HAVE_PTRDIFF_T 1
20815 EOF
20816
20817    fi
20818
20819 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
20820 echo "configure:20821: checking return type of signal handlers" >&5
20821 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
20822   echo $ac_n "(cached) $ac_c" 1>&6
20823 else
20824   cat > conftest.$ac_ext <<EOF
20825 #line 20826 "configure"
20826 #include "confdefs.h"
20827 #include <sys/types.h>
20828 #include <signal.h>
20829 #ifdef signal
20830 #undef signal
20831 #endif
20832 #ifdef __cplusplus
20833 extern "C" void (*signal (int, void (*)(int)))(int);
20834 #else
20835 void (*signal ()) ();
20836 #endif
20837
20838 int main() {
20839 int i;
20840 ; return 0; }
20841 EOF
20842 if { (eval echo configure:20843: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
20843   rm -rf conftest*
20844   ac_cv_type_signal=void
20845 else
20846   echo "configure: failed program was:" >&5
20847   cat conftest.$ac_ext >&5
20848   rm -rf conftest*
20849   ac_cv_type_signal=int
20850 fi
20851 rm -f conftest*
20852 fi
20853
20854 echo "$ac_t""$ac_cv_type_signal" 1>&6
20855 cat >> confdefs.h <<EOF
20856 #define RETSIGTYPE $ac_cv_type_signal
20857 EOF
20858
20859
20860 echo $ac_n "checking for size_t""... $ac_c" 1>&6
20861 echo "configure:20862: checking for size_t" >&5
20862 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
20863   echo $ac_n "(cached) $ac_c" 1>&6
20864 else
20865   cat > conftest.$ac_ext <<EOF
20866 #line 20867 "configure"
20867 #include "confdefs.h"
20868 #include <sys/types.h>
20869 #if STDC_HEADERS
20870 #include <stdlib.h>
20871 #include <stddef.h>
20872 #endif
20873
20874 EOF
20875 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20876   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
20877   rm -rf conftest*
20878   eval "ac_cv_type_size_t=yes"
20879 else
20880   rm -rf conftest*
20881   eval "ac_cv_type_size_t=no"
20882 fi
20883 rm -f conftest*
20884
20885 fi
20886 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
20887   echo "$ac_t""yes" 1>&6
20888 else
20889   echo "$ac_t""no" 1>&6
20890   cat >> confdefs.h <<EOF
20891 #define size_t unsigned
20892 EOF
20893
20894 fi
20895
20896
20897 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
20898 echo "configure:20899: checking for ssize_t" >&5
20899 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
20900   echo $ac_n "(cached) $ac_c" 1>&6
20901 else
20902   cat > conftest.$ac_ext <<EOF
20903 #line 20904 "configure"
20904 #include "confdefs.h"
20905 #include <sys/types.h>
20906 #if STDC_HEADERS
20907 #include <stdlib.h>
20908 #include <stddef.h>
20909 #endif
20910
20911 EOF
20912 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20913   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
20914   rm -rf conftest*
20915   eval "ac_cv_type_ssize_t=yes"
20916 else
20917   rm -rf conftest*
20918   eval "ac_cv_type_ssize_t=no"
20919 fi
20920 rm -f conftest*
20921
20922 fi
20923 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
20924   echo "$ac_t""yes" 1>&6
20925 else
20926   echo "$ac_t""no" 1>&6
20927   cat >> confdefs.h <<EOF
20928 #define ssize_t signed int
20929 EOF
20930
20931 fi
20932
20933 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
20934 echo "configure:20935: checking for caddr_t" >&5
20935 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
20936   echo $ac_n "(cached) $ac_c" 1>&6
20937 else
20938   cat > conftest.$ac_ext <<EOF
20939 #line 20940 "configure"
20940 #include "confdefs.h"
20941 #include <sys/types.h>
20942 #if STDC_HEADERS
20943 #include <stdlib.h>
20944 #include <stddef.h>
20945 #endif
20946
20947 EOF
20948 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20949   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
20950   rm -rf conftest*
20951   eval "ac_cv_type_caddr_t=yes"
20952 else
20953   rm -rf conftest*
20954   eval "ac_cv_type_caddr_t=no"
20955 fi
20956 rm -f conftest*
20957
20958 fi
20959 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
20960   echo "$ac_t""yes" 1>&6
20961 else
20962   echo "$ac_t""no" 1>&6
20963   cat >> confdefs.h <<EOF
20964 #define caddr_t char *
20965 EOF
20966
20967 fi
20968
20969
20970 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
20971 echo "configure:20972: checking for socklen_t" >&5
20972 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
20973   echo $ac_n "(cached) $ac_c" 1>&6
20974 else
20975   cat > conftest.$ac_ext <<EOF
20976 #line 20977 "configure"
20977 #include "confdefs.h"
20978
20979 #ifdef HAVE_SYS_TYPES_H
20980 #include <sys/types.h>
20981 #endif
20982 #ifdef HAVE_SYS_SOCKET_H
20983 #include <sys/socket.h>
20984 #endif
20985
20986 int main() {
20987 socklen_t len;
20988 ; return 0; }
20989 EOF
20990 if { (eval echo configure:20991: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
20991   rm -rf conftest*
20992   ol_cv_type_socklen_t=yes
20993 else
20994   echo "configure: failed program was:" >&5
20995   cat conftest.$ac_ext >&5
20996   rm -rf conftest*
20997   ol_cv_type_socklen_t=no
20998 fi
20999 rm -f conftest*
21000 fi
21001
21002 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
21003   if test $ol_cv_type_socklen_t = no; then
21004     cat >> confdefs.h <<\EOF
21005 #define socklen_t int
21006 EOF
21007
21008   fi
21009  
21010 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
21011 echo "configure:21012: checking for member st_blksize in aggregate type struct stat" >&5
21012 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
21013   echo $ac_n "(cached) $ac_c" 1>&6
21014 else
21015   cat > conftest.$ac_ext <<EOF
21016 #line 21017 "configure"
21017 #include "confdefs.h"
21018 #include <sys/types.h>
21019 #include <sys/stat.h>
21020 int main() {
21021 struct stat foo; foo.st_blksize;
21022 ; return 0; }
21023 EOF
21024 if { (eval echo configure:21025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21025   rm -rf conftest*
21026   ac_cv_c_struct_member_st_blksize=yes
21027 else
21028   echo "configure: failed program was:" >&5
21029   cat conftest.$ac_ext >&5
21030   rm -rf conftest*
21031   ac_cv_c_struct_member_st_blksize=no
21032 fi
21033 rm -f conftest*
21034 fi
21035
21036 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
21037 st_blksize="$ac_cv_c_struct_member_st_blksize"
21038 if test $ac_cv_c_struct_member_st_blksize = yes; then
21039   cat >> confdefs.h <<\EOF
21040 #define HAVE_ST_BLKSIZE 1
21041 EOF
21042
21043 fi
21044
21045 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
21046 echo "configure:21047: checking whether time.h and sys/time.h may both be included" >&5
21047 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
21048   echo $ac_n "(cached) $ac_c" 1>&6
21049 else
21050   cat > conftest.$ac_ext <<EOF
21051 #line 21052 "configure"
21052 #include "confdefs.h"
21053 #include <sys/types.h>
21054 #include <sys/time.h>
21055 #include <time.h>
21056 int main() {
21057 struct tm *tp;
21058 ; return 0; }
21059 EOF
21060 if { (eval echo configure:21061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21061   rm -rf conftest*
21062   ac_cv_header_time=yes
21063 else
21064   echo "configure: failed program was:" >&5
21065   cat conftest.$ac_ext >&5
21066   rm -rf conftest*
21067   ac_cv_header_time=no
21068 fi
21069 rm -f conftest*
21070 fi
21071
21072 echo "$ac_t""$ac_cv_header_time" 1>&6
21073 if test $ac_cv_header_time = yes; then
21074   cat >> confdefs.h <<\EOF
21075 #define TIME_WITH_SYS_TIME 1
21076 EOF
21077
21078 fi
21079
21080 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
21081 echo "configure:21082: checking whether struct tm is in sys/time.h or time.h" >&5
21082 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
21083   echo $ac_n "(cached) $ac_c" 1>&6
21084 else
21085   cat > conftest.$ac_ext <<EOF
21086 #line 21087 "configure"
21087 #include "confdefs.h"
21088 #include <sys/types.h>
21089 #include <time.h>
21090 int main() {
21091 struct tm *tp; tp->tm_sec;
21092 ; return 0; }
21093 EOF
21094 if { (eval echo configure:21095: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21095   rm -rf conftest*
21096   ac_cv_struct_tm=time.h
21097 else
21098   echo "configure: failed program was:" >&5
21099   cat conftest.$ac_ext >&5
21100   rm -rf conftest*
21101   ac_cv_struct_tm=sys/time.h
21102 fi
21103 rm -f conftest*
21104 fi
21105
21106 echo "$ac_t""$ac_cv_struct_tm" 1>&6
21107 if test $ac_cv_struct_tm = sys/time.h; then
21108   cat >> confdefs.h <<\EOF
21109 #define TM_IN_SYS_TIME 1
21110 EOF
21111
21112 fi
21113
21114 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
21115 echo "configure:21116: checking for uid_t in sys/types.h" >&5
21116 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
21117   echo $ac_n "(cached) $ac_c" 1>&6
21118 else
21119   cat > conftest.$ac_ext <<EOF
21120 #line 21121 "configure"
21121 #include "confdefs.h"
21122 #include <sys/types.h>
21123 EOF
21124 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21125   egrep "uid_t" >/dev/null 2>&1; then
21126   rm -rf conftest*
21127   ac_cv_type_uid_t=yes
21128 else
21129   rm -rf conftest*
21130   ac_cv_type_uid_t=no
21131 fi
21132 rm -f conftest*
21133
21134 fi
21135
21136 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
21137 if test $ac_cv_type_uid_t = no; then
21138   cat >> confdefs.h <<\EOF
21139 #define uid_t int
21140 EOF
21141
21142   cat >> confdefs.h <<\EOF
21143 #define gid_t int
21144 EOF
21145
21146 fi
21147
21148 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
21149 echo "configure:21150: checking for sig_atomic_t" >&5
21150 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
21151   echo $ac_n "(cached) $ac_c" 1>&6
21152 else
21153   cat > conftest.$ac_ext <<EOF
21154 #line 21155 "configure"
21155 #include "confdefs.h"
21156 #include <signal.h>
21157 int main() {
21158 sig_atomic_t atomic;
21159 ; return 0; }
21160 EOF
21161 if { (eval echo configure:21162: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21162   rm -rf conftest*
21163   ol_cv_type_sig_atomic_t=yes
21164 else
21165   echo "configure: failed program was:" >&5
21166   cat conftest.$ac_ext >&5
21167   rm -rf conftest*
21168   ol_cv_type_sig_atomic_t=no
21169 fi
21170 rm -f conftest*
21171 fi
21172
21173 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
21174   if test $ol_cv_type_sig_atomic_t = no; then
21175     cat >> confdefs.h <<\EOF
21176 #define sig_atomic_t int
21177 EOF
21178
21179   fi
21180  
21181
21182
21183 # test for pw_gecos in struct passwd
21184 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
21185 echo "configure:21186: checking struct passwd for pw_gecos" >&5
21186 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
21187   echo $ac_n "(cached) $ac_c" 1>&6
21188 else
21189   
21190         cat > conftest.$ac_ext <<EOF
21191 #line 21192 "configure"
21192 #include "confdefs.h"
21193 #include <pwd.h>
21194 int main() {
21195
21196         struct passwd pwd;
21197         pwd.pw_gecos = pwd.pw_name;
21198
21199 ; return 0; }
21200 EOF
21201 if { (eval echo configure:21202: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21202   rm -rf conftest*
21203   ol_cv_struct_passwd_pw_gecos=yes
21204 else
21205   echo "configure: failed program was:" >&5
21206   cat conftest.$ac_ext >&5
21207   rm -rf conftest*
21208   ol_cv_struct_passwd_pw_gecos=no
21209 fi
21210 rm -f conftest*
21211 fi
21212
21213 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
21214 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
21215         cat >> confdefs.h <<\EOF
21216 #define HAVE_PW_GECOS 1
21217 EOF
21218
21219 fi
21220
21221 # test for pw_passwd in struct passwd
21222 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
21223 echo "configure:21224: checking struct passwd for pw_passwd" >&5
21224 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
21225   echo $ac_n "(cached) $ac_c" 1>&6
21226 else
21227   
21228         cat > conftest.$ac_ext <<EOF
21229 #line 21230 "configure"
21230 #include "confdefs.h"
21231 #include <pwd.h>
21232 int main() {
21233
21234         struct passwd pwd;
21235         pwd.pw_passwd = pwd.pw_name;
21236
21237 ; return 0; }
21238 EOF
21239 if { (eval echo configure:21240: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21240   rm -rf conftest*
21241   ol_cv_struct_passwd_pw_passwd=yes
21242 else
21243   echo "configure: failed program was:" >&5
21244   cat conftest.$ac_ext >&5
21245   rm -rf conftest*
21246   ol_cv_struct_passwd_pw_passwd=no
21247 fi
21248 rm -f conftest*
21249 fi
21250
21251 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
21252 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
21253         cat >> confdefs.h <<\EOF
21254 #define HAVE_PW_PASSWD 1
21255 EOF
21256
21257 fi
21258
21259
21260 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
21261 echo "configure:21262: checking if toupper() requires islower()" >&5
21262 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
21263   echo $ac_n "(cached) $ac_c" 1>&6
21264 else
21265   
21266         if test "$cross_compiling" = yes; then
21267   ol_cv_c_upper_lower=safe
21268 else
21269   cat > conftest.$ac_ext <<EOF
21270 #line 21271 "configure"
21271 #include "confdefs.h"
21272
21273 #include <ctype.h>
21274 main()
21275 {
21276         if ('C' == toupper('C'))
21277                 exit(0);
21278         else
21279                 exit(1);
21280 }
21281 EOF
21282 if { (eval echo configure:21283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
21283 then
21284   ol_cv_c_upper_lower=no
21285 else
21286   echo "configure: failed program was:" >&5
21287   cat conftest.$ac_ext >&5
21288   rm -fr conftest*
21289   ol_cv_c_upper_lower=yes
21290 fi
21291 rm -fr conftest*
21292 fi
21293
21294 fi
21295
21296 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
21297 if test $ol_cv_c_upper_lower != no ; then
21298         cat >> confdefs.h <<\EOF
21299 #define C_UPPER_LOWER 1
21300 EOF
21301
21302 fi
21303
21304 echo $ac_n "checking for working const""... $ac_c" 1>&6
21305 echo "configure:21306: checking for working const" >&5
21306 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
21307   echo $ac_n "(cached) $ac_c" 1>&6
21308 else
21309   cat > conftest.$ac_ext <<EOF
21310 #line 21311 "configure"
21311 #include "confdefs.h"
21312
21313 int main() {
21314
21315 /* Ultrix mips cc rejects this.  */
21316 typedef int charset[2]; const charset x;
21317 /* SunOS 4.1.1 cc rejects this.  */
21318 char const *const *ccp;
21319 char **p;
21320 /* NEC SVR4.0.2 mips cc rejects this.  */
21321 struct point {int x, y;};
21322 static struct point const zero = {0,0};
21323 /* AIX XL C 1.02.0.0 rejects this.
21324    It does not let you subtract one const X* pointer from another in an arm
21325    of an if-expression whose if-part is not a constant expression */
21326 const char *g = "string";
21327 ccp = &g + (g ? g-g : 0);
21328 /* HPUX 7.0 cc rejects these. */
21329 ++ccp;
21330 p = (char**) ccp;
21331 ccp = (char const *const *) p;
21332 { /* SCO 3.2v4 cc rejects this.  */
21333   char *t;
21334   char const *s = 0 ? (char *) 0 : (char const *) 0;
21335
21336   *t++ = 0;
21337 }
21338 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
21339   int x[] = {25, 17};
21340   const int *foo = &x[0];
21341   ++foo;
21342 }
21343 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
21344   typedef const int *iptr;
21345   iptr p = 0;
21346   ++p;
21347 }
21348 { /* AIX XL C 1.02.0.0 rejects this saying
21349      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
21350   struct s { int j; const int *ap[3]; };
21351   struct s *b; b->j = 5;
21352 }
21353 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
21354   const int foo = 10;
21355 }
21356
21357 ; return 0; }
21358 EOF
21359 if { (eval echo configure:21360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21360   rm -rf conftest*
21361   ac_cv_c_const=yes
21362 else
21363   echo "configure: failed program was:" >&5
21364   cat conftest.$ac_ext >&5
21365   rm -rf conftest*
21366   ac_cv_c_const=no
21367 fi
21368 rm -f conftest*
21369 fi
21370
21371 echo "$ac_t""$ac_cv_c_const" 1>&6
21372 if test $ac_cv_c_const = no; then
21373   cat >> confdefs.h <<\EOF
21374 #define const 
21375 EOF
21376
21377 fi
21378
21379 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
21380 echo "configure:21381: checking if compiler understands volatile" >&5
21381 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
21382   echo $ac_n "(cached) $ac_c" 1>&6
21383 else
21384   cat > conftest.$ac_ext <<EOF
21385 #line 21386 "configure"
21386 #include "confdefs.h"
21387 int x, y, z;
21388 int main() {
21389 volatile int a; int * volatile b = x ? &y : &z;
21390       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
21391       *b = 0;
21392 ; return 0; }
21393 EOF
21394 if { (eval echo configure:21395: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21395   rm -rf conftest*
21396   ol_cv_c_volatile=yes
21397 else
21398   echo "configure: failed program was:" >&5
21399   cat conftest.$ac_ext >&5
21400   rm -rf conftest*
21401   ol_cv_c_volatile=no
21402 fi
21403 rm -f conftest*
21404 fi
21405
21406 echo "$ac_t""$ol_cv_c_volatile" 1>&6
21407   if test $ol_cv_c_volatile = yes; then
21408     : 
21409   else
21410     cat >> confdefs.h <<\EOF
21411 #define volatile 
21412 EOF
21413
21414   fi
21415  
21416
21417 if test $cross_compiling = yes ; then
21418         cat >> confdefs.h <<\EOF
21419 #define CROSS_COMPILING 1
21420 EOF
21421
21422 else
21423         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
21424 echo "configure:21425: checking whether byte ordering is bigendian" >&5
21425 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
21426   echo $ac_n "(cached) $ac_c" 1>&6
21427 else
21428   ac_cv_c_bigendian=unknown
21429 # See if sys/param.h defines the BYTE_ORDER macro.
21430 cat > conftest.$ac_ext <<EOF
21431 #line 21432 "configure"
21432 #include "confdefs.h"
21433 #include <sys/types.h>
21434 #include <sys/param.h>
21435 int main() {
21436
21437 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
21438  bogus endian macros
21439 #endif
21440 ; return 0; }
21441 EOF
21442 if { (eval echo configure:21443: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21443   rm -rf conftest*
21444   # It does; now see whether it defined to BIG_ENDIAN or not.
21445 cat > conftest.$ac_ext <<EOF
21446 #line 21447 "configure"
21447 #include "confdefs.h"
21448 #include <sys/types.h>
21449 #include <sys/param.h>
21450 int main() {
21451
21452 #if BYTE_ORDER != BIG_ENDIAN
21453  not big endian
21454 #endif
21455 ; return 0; }
21456 EOF
21457 if { (eval echo configure:21458: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21458   rm -rf conftest*
21459   ac_cv_c_bigendian=yes
21460 else
21461   echo "configure: failed program was:" >&5
21462   cat conftest.$ac_ext >&5
21463   rm -rf conftest*
21464   ac_cv_c_bigendian=no
21465 fi
21466 rm -f conftest*
21467 else
21468   echo "configure: failed program was:" >&5
21469   cat conftest.$ac_ext >&5
21470 fi
21471 rm -f conftest*
21472 if test $ac_cv_c_bigendian = unknown; then
21473 if test "$cross_compiling" = yes; then
21474     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
21475 else
21476   cat > conftest.$ac_ext <<EOF
21477 #line 21478 "configure"
21478 #include "confdefs.h"
21479 main () {
21480   /* Are we little or big endian?  From Harbison&Steele.  */
21481   union
21482   {
21483     long l;
21484     char c[sizeof (long)];
21485   } u;
21486   u.l = 1;
21487   exit (u.c[sizeof (long) - 1] == 1);
21488 }
21489 EOF
21490 if { (eval echo configure:21491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
21491 then
21492   ac_cv_c_bigendian=no
21493 else
21494   echo "configure: failed program was:" >&5
21495   cat conftest.$ac_ext >&5
21496   rm -fr conftest*
21497   ac_cv_c_bigendian=yes
21498 fi
21499 rm -fr conftest*
21500 fi
21501
21502 fi
21503 fi
21504
21505 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
21506 if test $ac_cv_c_bigendian = yes; then
21507   cat >> confdefs.h <<\EOF
21508 #define WORDS_BIGENDIAN 1
21509 EOF
21510
21511 fi
21512
21513 fi
21514
21515 echo $ac_n "checking size of short""... $ac_c" 1>&6
21516 echo "configure:21517: checking size of short" >&5 
21517 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
21518   echo $ac_n "(cached) $ac_c" 1>&6
21519 else
21520   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
21521   cat > conftest.$ac_ext <<EOF
21522 #line 21523 "configure"
21523 #include "confdefs.h"
21524 #include "confdefs.h" 
21525 #include <sys/types.h> 
21526  
21527
21528 int main() {
21529 switch (0) case 0: case (sizeof (short) == $ac_size):;
21530 ; return 0; }
21531 EOF
21532 if { (eval echo configure:21533: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21533   rm -rf conftest*
21534   ac_cv_sizeof_short=$ac_size
21535 else
21536   echo "configure: failed program was:" >&5
21537   cat conftest.$ac_ext >&5
21538 fi
21539 rm -f conftest* 
21540   if test x$ac_cv_sizeof_short != x ; then break; fi 
21541 done 
21542
21543 fi
21544  
21545 if test x$ac_cv_sizeof_short = x ; then 
21546   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
21547 fi 
21548 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
21549 cat >> confdefs.h <<EOF
21550 #define SIZEOF_SHORT $ac_cv_sizeof_short
21551 EOF
21552  
21553  
21554 echo $ac_n "checking size of int""... $ac_c" 1>&6
21555 echo "configure:21556: checking size of int" >&5 
21556 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
21557   echo $ac_n "(cached) $ac_c" 1>&6
21558 else
21559   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
21560   cat > conftest.$ac_ext <<EOF
21561 #line 21562 "configure"
21562 #include "confdefs.h"
21563 #include "confdefs.h" 
21564 #include <sys/types.h> 
21565  
21566
21567 int main() {
21568 switch (0) case 0: case (sizeof (int) == $ac_size):;
21569 ; return 0; }
21570 EOF
21571 if { (eval echo configure:21572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21572   rm -rf conftest*
21573   ac_cv_sizeof_int=$ac_size
21574 else
21575   echo "configure: failed program was:" >&5
21576   cat conftest.$ac_ext >&5
21577 fi
21578 rm -f conftest* 
21579   if test x$ac_cv_sizeof_int != x ; then break; fi 
21580 done 
21581
21582 fi
21583  
21584 if test x$ac_cv_sizeof_int = x ; then 
21585   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
21586 fi 
21587 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
21588 cat >> confdefs.h <<EOF
21589 #define SIZEOF_INT $ac_cv_sizeof_int
21590 EOF
21591  
21592  
21593 echo $ac_n "checking size of long""... $ac_c" 1>&6
21594 echo "configure:21595: checking size of long" >&5 
21595 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
21596   echo $ac_n "(cached) $ac_c" 1>&6
21597 else
21598   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
21599   cat > conftest.$ac_ext <<EOF
21600 #line 21601 "configure"
21601 #include "confdefs.h"
21602 #include "confdefs.h" 
21603 #include <sys/types.h> 
21604  
21605
21606 int main() {
21607 switch (0) case 0: case (sizeof (long) == $ac_size):;
21608 ; return 0; }
21609 EOF
21610 if { (eval echo configure:21611: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21611   rm -rf conftest*
21612   ac_cv_sizeof_long=$ac_size
21613 else
21614   echo "configure: failed program was:" >&5
21615   cat conftest.$ac_ext >&5
21616 fi
21617 rm -f conftest* 
21618   if test x$ac_cv_sizeof_long != x ; then break; fi 
21619 done 
21620
21621 fi
21622  
21623 if test x$ac_cv_sizeof_long = x ; then 
21624   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
21625 fi 
21626 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
21627 cat >> confdefs.h <<EOF
21628 #define SIZEOF_LONG $ac_cv_sizeof_long
21629 EOF
21630  
21631
21632
21633 if test "$ac_cv_sizeof_int" -lt 4 ; then
21634         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
21635
21636         cat >> confdefs.h <<\EOF
21637 #define LBER_INT_T long
21638 EOF
21639
21640 else
21641         cat >> confdefs.h <<\EOF
21642 #define LBER_INT_T int
21643 EOF
21644
21645 fi
21646
21647 cat >> confdefs.h <<\EOF
21648 #define LBER_LEN_T long
21649 EOF
21650
21651 cat >> confdefs.h <<\EOF
21652 #define LBER_SOCKET_T int
21653 EOF
21654
21655 cat >> confdefs.h <<\EOF
21656 #define LBER_TAG_T long
21657 EOF
21658
21659
21660 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
21661 echo "configure:21662: checking for 8-bit clean memcmp" >&5
21662 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
21663   echo $ac_n "(cached) $ac_c" 1>&6
21664 else
21665   if test "$cross_compiling" = yes; then
21666   ac_cv_func_memcmp_clean=no
21667 else
21668   cat > conftest.$ac_ext <<EOF
21669 #line 21670 "configure"
21670 #include "confdefs.h"
21671
21672 main()
21673 {
21674   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
21675   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
21676 }
21677
21678 EOF
21679 if { (eval echo configure:21680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
21680 then
21681   ac_cv_func_memcmp_clean=yes
21682 else
21683   echo "configure: failed program was:" >&5
21684   cat conftest.$ac_ext >&5
21685   rm -fr conftest*
21686   ac_cv_func_memcmp_clean=no
21687 fi
21688 rm -fr conftest*
21689 fi
21690
21691 fi
21692
21693 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
21694 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
21695
21696 echo $ac_n "checking for strftime""... $ac_c" 1>&6
21697 echo "configure:21698: checking for strftime" >&5
21698 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
21699   echo $ac_n "(cached) $ac_c" 1>&6
21700 else
21701   cat > conftest.$ac_ext <<EOF
21702 #line 21703 "configure"
21703 #include "confdefs.h"
21704 /* System header to define __stub macros and hopefully few prototypes,
21705     which can conflict with char strftime(); below.  */
21706 #include <assert.h>
21707 /* Override any gcc2 internal prototype to avoid an error.  */
21708 /* We use char because int might match the return type of a gcc2
21709     builtin and then its argument prototype would still apply.  */
21710 char strftime();
21711 char (*f)();
21712
21713 int main() {
21714
21715 /* The GNU C library defines this for functions which it implements
21716     to always fail with ENOSYS.  Some functions are actually named
21717     something starting with __ and the normal name is an alias.  */
21718 #if defined (__stub_strftime) || defined (__stub___strftime)
21719 choke me
21720 #else
21721 f = strftime;
21722 #endif
21723
21724 ; return 0; }
21725 EOF
21726 if { (eval echo configure:21727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21727   rm -rf conftest*
21728   eval "ac_cv_func_strftime=yes"
21729 else
21730   echo "configure: failed program was:" >&5
21731   cat conftest.$ac_ext >&5
21732   rm -rf conftest*
21733   eval "ac_cv_func_strftime=no"
21734 fi
21735 rm -f conftest*
21736 fi
21737
21738 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
21739   echo "$ac_t""yes" 1>&6
21740   cat >> confdefs.h <<\EOF
21741 #define HAVE_STRFTIME 1
21742 EOF
21743
21744 else
21745   echo "$ac_t""no" 1>&6
21746 # strftime is in -lintl on SCO UNIX.
21747 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
21748 echo "configure:21749: checking for strftime in -lintl" >&5
21749 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
21750 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
21751   echo $ac_n "(cached) $ac_c" 1>&6
21752 else
21753   ac_save_LIBS="$LIBS"
21754 LIBS="-lintl  $LIBS"
21755 cat > conftest.$ac_ext <<EOF
21756 #line 21757 "configure"
21757 #include "confdefs.h"
21758 /* Override any gcc2 internal prototype to avoid an error.  */
21759 /* We use char because int might match the return type of a gcc2
21760     builtin and then its argument prototype would still apply.  */
21761 char strftime();
21762
21763 int main() {
21764 strftime()
21765 ; return 0; }
21766 EOF
21767 if { (eval echo configure:21768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21768   rm -rf conftest*
21769   eval "ac_cv_lib_$ac_lib_var=yes"
21770 else
21771   echo "configure: failed program was:" >&5
21772   cat conftest.$ac_ext >&5
21773   rm -rf conftest*
21774   eval "ac_cv_lib_$ac_lib_var=no"
21775 fi
21776 rm -f conftest*
21777 LIBS="$ac_save_LIBS"
21778
21779 fi
21780 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
21781   echo "$ac_t""yes" 1>&6
21782   cat >> confdefs.h <<\EOF
21783 #define HAVE_STRFTIME 1
21784 EOF
21785
21786 LIBS="-lintl $LIBS"
21787 else
21788   echo "$ac_t""no" 1>&6
21789 fi
21790
21791 fi
21792
21793
21794 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
21795 echo "configure:21796: checking for inet_aton()" >&5
21796 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
21797   echo $ac_n "(cached) $ac_c" 1>&6
21798 else
21799   cat > conftest.$ac_ext <<EOF
21800 #line 21801 "configure"
21801 #include "confdefs.h"
21802
21803 #ifdef HAVE_SYS_TYPES_H
21804 #       include <sys/types.h>
21805 #endif
21806 #ifdef HAVE_SYS_SOCKET_H
21807 #       include <sys/socket.h>
21808 #       ifdef HAVE_SYS_SELECT_H
21809 #               include <sys/select.h>
21810 #       endif
21811 #       include <netinet/in.h>
21812 #       ifdef HAVE_ARPA_INET_H
21813 #               include <arpa/inet.h>
21814 #       endif
21815 #endif
21816
21817 int main() {
21818 struct in_addr in;
21819 int rc = inet_aton( "255.255.255.255", &in );
21820 ; return 0; }
21821 EOF
21822 if { (eval echo configure:21823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21823   rm -rf conftest*
21824   ol_cv_func_inet_aton=yes
21825 else
21826   echo "configure: failed program was:" >&5
21827   cat conftest.$ac_ext >&5
21828   rm -rf conftest*
21829   ol_cv_func_inet_aton=no
21830 fi
21831 rm -f conftest*
21832 fi
21833
21834 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
21835   if test $ol_cv_func_inet_aton != no; then
21836     cat >> confdefs.h <<\EOF
21837 #define HAVE_INET_ATON 1
21838 EOF
21839
21840   fi
21841  
21842
21843 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
21844 echo "configure:21845: checking for _spawnlp" >&5
21845 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
21846   echo $ac_n "(cached) $ac_c" 1>&6
21847 else
21848   cat > conftest.$ac_ext <<EOF
21849 #line 21850 "configure"
21850 #include "confdefs.h"
21851 /* System header to define __stub macros and hopefully few prototypes,
21852     which can conflict with char _spawnlp(); below.  */
21853 #include <assert.h>
21854 /* Override any gcc2 internal prototype to avoid an error.  */
21855 /* We use char because int might match the return type of a gcc2
21856     builtin and then its argument prototype would still apply.  */
21857 char _spawnlp();
21858 char (*f)();
21859
21860 int main() {
21861
21862 /* The GNU C library defines this for functions which it implements
21863     to always fail with ENOSYS.  Some functions are actually named
21864     something starting with __ and the normal name is an alias.  */
21865 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
21866 choke me
21867 #else
21868 f = _spawnlp;
21869 #endif
21870
21871 ; return 0; }
21872 EOF
21873 if { (eval echo configure:21874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21874   rm -rf conftest*
21875   eval "ac_cv_func__spawnlp=yes"
21876 else
21877   echo "configure: failed program was:" >&5
21878   cat conftest.$ac_ext >&5
21879   rm -rf conftest*
21880   eval "ac_cv_func__spawnlp=no"
21881 fi
21882 rm -f conftest*
21883 fi
21884
21885 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
21886   echo "$ac_t""yes" 1>&6
21887   cat >> confdefs.h <<\EOF
21888 #define HAVE_SPAWNLP 1
21889 EOF
21890
21891 else
21892   echo "$ac_t""no" 1>&6
21893 fi
21894
21895
21896 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
21897 echo "configure:21898: checking for _snprintf" >&5
21898 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
21899   echo $ac_n "(cached) $ac_c" 1>&6
21900 else
21901   cat > conftest.$ac_ext <<EOF
21902 #line 21903 "configure"
21903 #include "confdefs.h"
21904 /* System header to define __stub macros and hopefully few prototypes,
21905     which can conflict with char _snprintf(); below.  */
21906 #include <assert.h>
21907 /* Override any gcc2 internal prototype to avoid an error.  */
21908 /* We use char because int might match the return type of a gcc2
21909     builtin and then its argument prototype would still apply.  */
21910 char _snprintf();
21911 char (*f)();
21912
21913 int main() {
21914
21915 /* The GNU C library defines this for functions which it implements
21916     to always fail with ENOSYS.  Some functions are actually named
21917     something starting with __ and the normal name is an alias.  */
21918 #if defined (__stub__snprintf) || defined (__stub____snprintf)
21919 choke me
21920 #else
21921 f = _snprintf;
21922 #endif
21923
21924 ; return 0; }
21925 EOF
21926 if { (eval echo configure:21927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21927   rm -rf conftest*
21928   eval "ac_cv_func__snprintf=yes"
21929 else
21930   echo "configure: failed program was:" >&5
21931   cat conftest.$ac_ext >&5
21932   rm -rf conftest*
21933   eval "ac_cv_func__snprintf=no"
21934 fi
21935 rm -f conftest*
21936 fi
21937
21938 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
21939   echo "$ac_t""yes" 1>&6
21940   ac_cv_func_snprintf=yes
21941         cat >> confdefs.h <<\EOF
21942 #define snprintf _snprintf
21943 EOF
21944
21945
21946 else
21947   echo "$ac_t""no" 1>&6
21948 fi
21949
21950
21951 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
21952 echo "configure:21953: checking for _vsnprintf" >&5
21953 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
21954   echo $ac_n "(cached) $ac_c" 1>&6
21955 else
21956   cat > conftest.$ac_ext <<EOF
21957 #line 21958 "configure"
21958 #include "confdefs.h"
21959 /* System header to define __stub macros and hopefully few prototypes,
21960     which can conflict with char _vsnprintf(); below.  */
21961 #include <assert.h>
21962 /* Override any gcc2 internal prototype to avoid an error.  */
21963 /* We use char because int might match the return type of a gcc2
21964     builtin and then its argument prototype would still apply.  */
21965 char _vsnprintf();
21966 char (*f)();
21967
21968 int main() {
21969
21970 /* The GNU C library defines this for functions which it implements
21971     to always fail with ENOSYS.  Some functions are actually named
21972     something starting with __ and the normal name is an alias.  */
21973 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
21974 choke me
21975 #else
21976 f = _vsnprintf;
21977 #endif
21978
21979 ; return 0; }
21980 EOF
21981 if { (eval echo configure:21982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21982   rm -rf conftest*
21983   eval "ac_cv_func__vsnprintf=yes"
21984 else
21985   echo "configure: failed program was:" >&5
21986   cat conftest.$ac_ext >&5
21987   rm -rf conftest*
21988   eval "ac_cv_func__vsnprintf=no"
21989 fi
21990 rm -f conftest*
21991 fi
21992
21993 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
21994   echo "$ac_t""yes" 1>&6
21995   ac_cv_func_vsnprintf=yes
21996         cat >> confdefs.h <<\EOF
21997 #define vsnprintf _vsnprintf
21998 EOF
21999
22000
22001 else
22002   echo "$ac_t""no" 1>&6
22003 fi
22004
22005
22006 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
22007 echo "configure:22008: checking for vprintf" >&5
22008 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
22009   echo $ac_n "(cached) $ac_c" 1>&6
22010 else
22011   cat > conftest.$ac_ext <<EOF
22012 #line 22013 "configure"
22013 #include "confdefs.h"
22014 /* System header to define __stub macros and hopefully few prototypes,
22015     which can conflict with char vprintf(); below.  */
22016 #include <assert.h>
22017 /* Override any gcc2 internal prototype to avoid an error.  */
22018 /* We use char because int might match the return type of a gcc2
22019     builtin and then its argument prototype would still apply.  */
22020 char vprintf();
22021 char (*f)();
22022
22023 int main() {
22024
22025 /* The GNU C library defines this for functions which it implements
22026     to always fail with ENOSYS.  Some functions are actually named
22027     something starting with __ and the normal name is an alias.  */
22028 #if defined (__stub_vprintf) || defined (__stub___vprintf)
22029 choke me
22030 #else
22031 f = vprintf;
22032 #endif
22033
22034 ; return 0; }
22035 EOF
22036 if { (eval echo configure:22037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22037   rm -rf conftest*
22038   eval "ac_cv_func_vprintf=yes"
22039 else
22040   echo "configure: failed program was:" >&5
22041   cat conftest.$ac_ext >&5
22042   rm -rf conftest*
22043   eval "ac_cv_func_vprintf=no"
22044 fi
22045 rm -f conftest*
22046 fi
22047
22048 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
22049   echo "$ac_t""yes" 1>&6
22050   cat >> confdefs.h <<\EOF
22051 #define HAVE_VPRINTF 1
22052 EOF
22053
22054 else
22055   echo "$ac_t""no" 1>&6
22056 fi
22057
22058 if test "$ac_cv_func_vprintf" != yes; then
22059 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
22060 echo "configure:22061: checking for _doprnt" >&5
22061 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
22062   echo $ac_n "(cached) $ac_c" 1>&6
22063 else
22064   cat > conftest.$ac_ext <<EOF
22065 #line 22066 "configure"
22066 #include "confdefs.h"
22067 /* System header to define __stub macros and hopefully few prototypes,
22068     which can conflict with char _doprnt(); below.  */
22069 #include <assert.h>
22070 /* Override any gcc2 internal prototype to avoid an error.  */
22071 /* We use char because int might match the return type of a gcc2
22072     builtin and then its argument prototype would still apply.  */
22073 char _doprnt();
22074 char (*f)();
22075
22076 int main() {
22077
22078 /* The GNU C library defines this for functions which it implements
22079     to always fail with ENOSYS.  Some functions are actually named
22080     something starting with __ and the normal name is an alias.  */
22081 #if defined (__stub__doprnt) || defined (__stub____doprnt)
22082 choke me
22083 #else
22084 f = _doprnt;
22085 #endif
22086
22087 ; return 0; }
22088 EOF
22089 if { (eval echo configure:22090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22090   rm -rf conftest*
22091   eval "ac_cv_func__doprnt=yes"
22092 else
22093   echo "configure: failed program was:" >&5
22094   cat conftest.$ac_ext >&5
22095   rm -rf conftest*
22096   eval "ac_cv_func__doprnt=no"
22097 fi
22098 rm -f conftest*
22099 fi
22100
22101 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
22102   echo "$ac_t""yes" 1>&6
22103   cat >> confdefs.h <<\EOF
22104 #define HAVE_DOPRNT 1
22105 EOF
22106
22107 else
22108   echo "$ac_t""no" 1>&6
22109 fi
22110
22111 fi
22112
22113
22114 if test $ac_cv_func_vprintf = yes ; then
22115                 for ac_func in snprintf vsnprintf
22116 do
22117 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
22118 echo "configure:22119: checking for $ac_func" >&5
22119 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
22120   echo $ac_n "(cached) $ac_c" 1>&6
22121 else
22122   cat > conftest.$ac_ext <<EOF
22123 #line 22124 "configure"
22124 #include "confdefs.h"
22125 /* System header to define __stub macros and hopefully few prototypes,
22126     which can conflict with char $ac_func(); below.  */
22127 #include <assert.h>
22128 /* Override any gcc2 internal prototype to avoid an error.  */
22129 /* We use char because int might match the return type of a gcc2
22130     builtin and then its argument prototype would still apply.  */
22131 char $ac_func();
22132 char (*f)();
22133
22134 int main() {
22135
22136 /* The GNU C library defines this for functions which it implements
22137     to always fail with ENOSYS.  Some functions are actually named
22138     something starting with __ and the normal name is an alias.  */
22139 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
22140 choke me
22141 #else
22142 f = $ac_func;
22143 #endif
22144
22145 ; return 0; }
22146 EOF
22147 if { (eval echo configure:22148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22148   rm -rf conftest*
22149   eval "ac_cv_func_$ac_func=yes"
22150 else
22151   echo "configure: failed program was:" >&5
22152   cat conftest.$ac_ext >&5
22153   rm -rf conftest*
22154   eval "ac_cv_func_$ac_func=no"
22155 fi
22156 rm -f conftest*
22157 fi
22158
22159 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
22160   echo "$ac_t""yes" 1>&6
22161     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
22162   cat >> confdefs.h <<EOF
22163 #define $ac_tr_func 1
22164 EOF
22165  
22166 else
22167   echo "$ac_t""no" 1>&6
22168 fi
22169 done
22170
22171 fi
22172
22173 for ac_func in \
22174         bcopy                   \
22175         closesocket             \
22176         chroot                  \
22177         endgrent                \
22178         endpwent                \
22179         fcntl                   \
22180         flock                   \
22181         fstat                   \
22182         getdtablesize   \
22183         getgrgid                \
22184         gethostname             \
22185         getpass                 \
22186         getpassphrase   \
22187         getpwuid                \
22188         getpwnam                \
22189         getspnam                \
22190         gettimeofday    \
22191         initgroups              \
22192         lockf                   \
22193         memcpy                  \
22194         memmove                 \
22195         mkstemp                 \
22196         mktemp                  \
22197         pipe                    \
22198         read                    \
22199         recv                    \
22200         recvfrom                \
22201         setpwfile               \
22202         setgid                  \
22203         setegid                 \
22204         setsid                  \
22205         setuid                  \
22206         seteuid                 \
22207         sigaction               \
22208         signal                  \
22209         sigset                  \
22210         strdup                  \
22211         strerror                \
22212         strpbrk                 \
22213         strrchr                 \
22214         strsep                  \
22215         strstr                  \
22216         strtol                  \
22217         strtoul                 \
22218         strspn                  \
22219         sysconf                 \
22220         usleep                  \
22221         waitpid                 \
22222         wait4                   \
22223         write                   \
22224         send                    \
22225         sendmsg                 \
22226         sendto                  \
22227
22228 do
22229 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
22230 echo "configure:22231: checking for $ac_func" >&5
22231 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
22232   echo $ac_n "(cached) $ac_c" 1>&6
22233 else
22234   cat > conftest.$ac_ext <<EOF
22235 #line 22236 "configure"
22236 #include "confdefs.h"
22237 /* System header to define __stub macros and hopefully few prototypes,
22238     which can conflict with char $ac_func(); below.  */
22239 #include <assert.h>
22240 /* Override any gcc2 internal prototype to avoid an error.  */
22241 /* We use char because int might match the return type of a gcc2
22242     builtin and then its argument prototype would still apply.  */
22243 char $ac_func();
22244 char (*f)();
22245
22246 int main() {
22247
22248 /* The GNU C library defines this for functions which it implements
22249     to always fail with ENOSYS.  Some functions are actually named
22250     something starting with __ and the normal name is an alias.  */
22251 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
22252 choke me
22253 #else
22254 f = $ac_func;
22255 #endif
22256
22257 ; return 0; }
22258 EOF
22259 if { (eval echo configure:22260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22260   rm -rf conftest*
22261   eval "ac_cv_func_$ac_func=yes"
22262 else
22263   echo "configure: failed program was:" >&5
22264   cat conftest.$ac_ext >&5
22265   rm -rf conftest*
22266   eval "ac_cv_func_$ac_func=no"
22267 fi
22268 rm -f conftest*
22269 fi
22270
22271 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
22272   echo "$ac_t""yes" 1>&6
22273     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
22274   cat >> confdefs.h <<EOF
22275 #define $ac_tr_func 1
22276 EOF
22277  
22278 else
22279   echo "$ac_t""no" 1>&6
22280 fi
22281 done
22282
22283
22284 for ac_func in getopt getpeereid
22285 do
22286 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
22287 echo "configure:22288: checking for $ac_func" >&5
22288 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
22289   echo $ac_n "(cached) $ac_c" 1>&6
22290 else
22291   cat > conftest.$ac_ext <<EOF
22292 #line 22293 "configure"
22293 #include "confdefs.h"
22294 /* System header to define __stub macros and hopefully few prototypes,
22295     which can conflict with char $ac_func(); below.  */
22296 #include <assert.h>
22297 /* Override any gcc2 internal prototype to avoid an error.  */
22298 /* We use char because int might match the return type of a gcc2
22299     builtin and then its argument prototype would still apply.  */
22300 char $ac_func();
22301 char (*f)();
22302
22303 int main() {
22304
22305 /* The GNU C library defines this for functions which it implements
22306     to always fail with ENOSYS.  Some functions are actually named
22307     something starting with __ and the normal name is an alias.  */
22308 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
22309 choke me
22310 #else
22311 f = $ac_func;
22312 #endif
22313
22314 ; return 0; }
22315 EOF
22316 if { (eval echo configure:22317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22317   rm -rf conftest*
22318   eval "ac_cv_func_$ac_func=yes"
22319 else
22320   echo "configure: failed program was:" >&5
22321   cat conftest.$ac_ext >&5
22322   rm -rf conftest*
22323   eval "ac_cv_func_$ac_func=no"
22324 fi
22325 rm -f conftest*
22326 fi
22327
22328 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
22329   echo "$ac_t""yes" 1>&6
22330     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
22331   cat >> confdefs.h <<EOF
22332 #define $ac_tr_func 1
22333 EOF
22334  
22335 else
22336   echo "$ac_t""no" 1>&6
22337 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
22338 fi
22339 done
22340
22341
22342
22343 if test "$ac_cv_func_getopt" != yes; then
22344         LIBSRCS="$LIBSRCS getopt.c"
22345 fi
22346 if test "$ac_cv_func_getpeereid" != yes; then
22347         LIBSRCS="$LIBSRCS getpeereid.c"
22348 fi
22349 if test "$ac_cv_func_snprintf" != yes -o "$ac_cv_func_vsnprintf" != yes; then
22350         if test "$ac_cv_func_snprintf" != yes; then
22351                 cat >> confdefs.h <<\EOF
22352 #define snprintf ber_pvt_snprintf
22353 EOF
22354
22355         fi
22356         if test "$ac_cv_func_vsnprintf" != yes; then
22357                 cat >> confdefs.h <<\EOF
22358 #define vsnprintf ber_pvt_vsnprintf
22359 EOF
22360
22361         fi
22362 fi
22363
22364 # Check Configuration
22365 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
22366 echo "configure:22367: checking declaration of sys_errlist" >&5
22367 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
22368   echo $ac_n "(cached) $ac_c" 1>&6
22369 else
22370   
22371         cat > conftest.$ac_ext <<EOF
22372 #line 22373 "configure"
22373 #include "confdefs.h"
22374
22375 #include <stdio.h>
22376 #include <sys/types.h>
22377 #include <errno.h>
22378 #ifdef WINNT
22379 #include <stdlib.h>
22380 #endif 
22381 int main() {
22382 char *c = (char *) *sys_errlist
22383 ; return 0; }
22384 EOF
22385 if { (eval echo configure:22386: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22386   rm -rf conftest*
22387   ol_cv_dcl_sys_errlist=yes
22388         ol_cv_have_sys_errlist=yes
22389 else
22390   echo "configure: failed program was:" >&5
22391   cat conftest.$ac_ext >&5
22392   rm -rf conftest*
22393   ol_cv_dcl_sys_errlist=no
22394 fi
22395 rm -f conftest*
22396 fi
22397
22398 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
22399 #
22400 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
22401 if test $ol_cv_dcl_sys_errlist = no ; then
22402         cat >> confdefs.h <<\EOF
22403 #define DECL_SYS_ERRLIST 1
22404 EOF
22405
22406
22407         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
22408 echo "configure:22409: checking existence of sys_errlist" >&5
22409 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
22410   echo $ac_n "(cached) $ac_c" 1>&6
22411 else
22412   
22413                 cat > conftest.$ac_ext <<EOF
22414 #line 22415 "configure"
22415 #include "confdefs.h"
22416 #include <errno.h>
22417 int main() {
22418 char *c = (char *) *sys_errlist
22419 ; return 0; }
22420 EOF
22421 if { (eval echo configure:22422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22422   rm -rf conftest*
22423   ol_cv_have_sys_errlist=yes
22424 else
22425   echo "configure: failed program was:" >&5
22426   cat conftest.$ac_ext >&5
22427   rm -rf conftest*
22428   ol_cv_have_sys_errlist=no
22429 fi
22430 rm -f conftest*
22431 fi
22432
22433 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
22434 fi
22435 if test $ol_cv_have_sys_errlist = yes ; then
22436         cat >> confdefs.h <<\EOF
22437 #define HAVE_SYS_ERRLIST 1
22438 EOF
22439
22440 fi
22441
22442
22443
22444 if test "$ol_enable_slapi" != no ; then
22445                         for ac_hdr in ltdl.h
22446 do
22447 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
22448 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
22449 echo "configure:22450: checking for $ac_hdr" >&5
22450 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
22451   echo $ac_n "(cached) $ac_c" 1>&6
22452 else
22453   cat > conftest.$ac_ext <<EOF
22454 #line 22455 "configure"
22455 #include "confdefs.h"
22456 #include <$ac_hdr>
22457 EOF
22458 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
22459 { (eval echo configure:22460: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
22460 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
22461 if test -z "$ac_err"; then
22462   rm -rf conftest*
22463   eval "ac_cv_header_$ac_safe=yes"
22464 else
22465   echo "$ac_err" >&5
22466   echo "configure: failed program was:" >&5
22467   cat conftest.$ac_ext >&5
22468   rm -rf conftest*
22469   eval "ac_cv_header_$ac_safe=no"
22470 fi
22471 rm -f conftest*
22472 fi
22473 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
22474   echo "$ac_t""yes" 1>&6
22475     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
22476   cat >> confdefs.h <<EOF
22477 #define $ac_tr_hdr 1
22478 EOF
22479  
22480 else
22481   echo "$ac_t""no" 1>&6
22482 fi
22483 done
22484
22485
22486         if test $ac_cv_header_ltdl_h != yes ; then
22487                 { echo "configure: error: could not locate <ltdl.h>" 1>&2; exit 1; }
22488         fi
22489         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
22490 echo "configure:22491: checking for lt_dlinit in -lltdl" >&5
22491 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
22492 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
22493   echo $ac_n "(cached) $ac_c" 1>&6
22494 else
22495   ac_save_LIBS="$LIBS"
22496 LIBS="-lltdl  $LIBS"
22497 cat > conftest.$ac_ext <<EOF
22498 #line 22499 "configure"
22499 #include "confdefs.h"
22500 /* Override any gcc2 internal prototype to avoid an error.  */
22501 /* We use char because int might match the return type of a gcc2
22502     builtin and then its argument prototype would still apply.  */
22503 char lt_dlinit();
22504
22505 int main() {
22506 lt_dlinit()
22507 ; return 0; }
22508 EOF
22509 if { (eval echo configure:22510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22510   rm -rf conftest*
22511   eval "ac_cv_lib_$ac_lib_var=yes"
22512 else
22513   echo "configure: failed program was:" >&5
22514   cat conftest.$ac_ext >&5
22515   rm -rf conftest*
22516   eval "ac_cv_lib_$ac_lib_var=no"
22517 fi
22518 rm -f conftest*
22519 LIBS="$ac_save_LIBS"
22520
22521 fi
22522 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
22523   echo "$ac_t""yes" 1>&6
22524   
22525                 SLAPI_LIBS=-lltdl
22526                 LIBSLAPI=./libslapi.a
22527                 LIBSLAPITOOLS=../libslapi.a
22528                 cat >> confdefs.h <<\EOF
22529 #define HAVE_LIBLTDL 1
22530 EOF
22531
22532         
22533 else
22534   echo "$ac_t""no" 1>&6
22535 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
22536 fi
22537
22538
22539         cat >> confdefs.h <<\EOF
22540 #define LDAP_SLAPI 1
22541 EOF
22542
22543 fi
22544
22545 if test "$ol_enable_debug" != no ; then
22546         cat >> confdefs.h <<\EOF
22547 #define LDAP_DEBUG 1
22548 EOF
22549
22550 fi
22551 if test "$ol_enable_syslog" = yes ; then
22552         cat >> confdefs.h <<\EOF
22553 #define LDAP_SYSLOG 1
22554 EOF
22555
22556 fi
22557 if test "$ol_enable_cache" = no ; then
22558         cat >> confdefs.h <<\EOF
22559 #define LDAP_NOCACHE 1
22560 EOF
22561
22562 fi
22563 if test "$ol_link_kbind" != no ; then
22564         cat >> confdefs.h <<\EOF
22565 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
22566 EOF
22567
22568 fi
22569 if test "$ol_enable_proctitle" != no ; then
22570         cat >> confdefs.h <<\EOF
22571 #define LDAP_PROCTITLE 1
22572 EOF
22573
22574 fi
22575 if test "$ol_enable_referrals" != no ; then
22576         cat >> confdefs.h <<\EOF
22577 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
22578 EOF
22579
22580 fi
22581 if test "$ol_enable_local" != no; then
22582         cat >> confdefs.h <<\EOF
22583 #define LDAP_PF_LOCAL 1
22584 EOF
22585
22586 fi
22587 if test "$ol_link_ipv6" != no; then
22588         cat >> confdefs.h <<\EOF
22589 #define LDAP_PF_INET6 1
22590 EOF
22591
22592 fi
22593 if test "$ol_enable_cleartext" != no ; then
22594         cat >> confdefs.h <<\EOF
22595 #define SLAPD_CLEARTEXT 1
22596 EOF
22597
22598 fi
22599 if test "$ol_enable_crypt" != no ; then
22600         cat >> confdefs.h <<\EOF
22601 #define SLAPD_CRYPT 1
22602 EOF
22603
22604 fi
22605 if test "$ol_link_kpasswd" != no ; then
22606         cat >> confdefs.h <<\EOF
22607 #define SLAPD_KPASSWD 1
22608 EOF
22609
22610 fi
22611 if test "$ol_link_spasswd" != no ; then
22612         cat >> confdefs.h <<\EOF
22613 #define SLAPD_SPASSWD 1
22614 EOF
22615
22616 fi
22617 if test "$ol_enable_multimaster" != no ; then
22618         cat >> confdefs.h <<\EOF
22619 #define SLAPD_MULTIMASTER 1
22620 EOF
22621
22622 fi
22623 if test "$ol_enable_phonetic" != no ; then
22624         cat >> confdefs.h <<\EOF
22625 #define SLAPD_PHONETIC 1
22626 EOF
22627
22628 fi
22629 if test "$ol_enable_rlookups" != no ; then
22630         cat >> confdefs.h <<\EOF
22631 #define SLAPD_RLOOKUPS 1
22632 EOF
22633
22634 fi
22635 if test "$ol_enable_aci" != no ; then
22636         cat >> confdefs.h <<\EOF
22637 #define SLAPD_ACI_ENABLED 1
22638 EOF
22639
22640 fi
22641
22642 if test "$ol_link_modules" != no ; then
22643         cat >> confdefs.h <<\EOF
22644 #define SLAPD_MODULES 1
22645 EOF
22646
22647         BUILD_SLAPD=yes
22648         SLAPD_MODULES_LDFLAGS="-dlopen self"
22649 fi
22650
22651 if test "$ol_enable_bdb" != no ; then
22652         cat >> confdefs.h <<\EOF
22653 #define SLAPD_BDB 1
22654 EOF
22655
22656         BUILD_SLAPD=yes
22657         BUILD_BDB=yes
22658         if test "$ol_with_bdb_module" != static ; then
22659                 cat >> confdefs.h <<\EOF
22660 #define SLAPD_BDB_DYNAMIC 1
22661 EOF
22662
22663                 BUILD_BDB=mod
22664                 BUILD_BDB_DYNAMIC=shared
22665                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-bdb"
22666         else
22667                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-bdb"
22668         fi
22669 fi
22670
22671 if test "$ol_link_dnssrv" != no ; then
22672         cat >> confdefs.h <<\EOF
22673 #define SLAPD_DNSSRV 1
22674 EOF
22675
22676         BUILD_SLAPD=yes
22677         BUILD_DNSSRV=yes
22678         if test "$ol_with_dnssrv_module" != static ; then
22679                 cat >> confdefs.h <<\EOF
22680 #define SLAPD_DNSSRV_DYNAMIC 1
22681 EOF
22682
22683                 BUILD_DNSSRV=mod
22684                 BUILD_DNSSRV_DYNAMIC=shared
22685                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-dnssrv"
22686         else
22687                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-dnssrv"
22688         fi
22689 fi
22690
22691 if test "$ol_enable_ldap" != no ; then
22692         cat >> confdefs.h <<\EOF
22693 #define SLAPD_LDAP 1
22694 EOF
22695
22696         BUILD_SLAPD=yes
22697         BUILD_LDAP=yes
22698         if test "$ol_with_ldap_module" != static ; then
22699                 cat >> confdefs.h <<\EOF
22700 #define SLAPD_LDAP_DYNAMIC 1
22701 EOF
22702
22703                 BUILD_LDAP=mod
22704                 BUILD_LDAP_DYNAMIC=shared
22705                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldap"
22706         else
22707                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldap"
22708         fi
22709 fi
22710
22711 if test "$ol_link_ldbm" != no -a $ol_enable_ldbm != no; then
22712         cat >> confdefs.h <<\EOF
22713 #define SLAPD_LDBM 1
22714 EOF
22715
22716         BUILD_SLAPD=yes
22717         BUILD_LDBM=yes
22718         if test "$ol_with_ldbm_module" != static ; then
22719                 cat >> confdefs.h <<\EOF
22720 #define SLAPD_LDBM_DYNAMIC 1
22721 EOF
22722
22723                 BUILD_LDBM=mod
22724                 BUILD_LDBM_DYNAMIC=shared
22725                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldbm"
22726         else
22727                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldbm"
22728         fi
22729 fi
22730
22731 if test "$ol_enable_meta" != no ; then
22732         if test "$ol_enable_ldap" = no ; then
22733                 { echo "configure: error: need --enable-ldap to use --enable-meta" 1>&2; exit 1; }
22734         fi
22735         if test "$ol_enable_rewrite" = no ; then
22736                 { echo "configure: error: need --enable-rewrite to use --enable-meta" 1>&2; exit 1; }
22737         fi
22738         cat >> confdefs.h <<\EOF
22739 #define SLAPD_META 1
22740 EOF
22741
22742         BUILD_SLAPD=yes
22743         BUILD_META=yes
22744         BUILD_LDAP=yes
22745         BUILD_REWRITE=yes
22746         if test "$ol_with_meta_module" != static ; then
22747                 cat >> confdefs.h <<\EOF
22748 #define SLAPD_META_DYNAMIC 1
22749 EOF
22750
22751                 BUILD_META=mod
22752                 BUILD_META_DYNAMIC=shared
22753                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-meta"
22754         else
22755                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-meta"
22756         fi
22757 fi
22758
22759 if test "$ol_enable_monitor" != no ; then
22760         cat >> confdefs.h <<\EOF
22761 #define SLAPD_MONITOR 1
22762 EOF
22763
22764         BUILD_SLAPD=yes
22765         BUILD_MONITOR=yes
22766         if test "$ol_with_monitor_module" != static ; then
22767                 cat >> confdefs.h <<\EOF
22768 #define SLAPD_MONITOR_DYNAMIC 1
22769 EOF
22770
22771                 BUILD_MONITOR=mod
22772                 BUILD_MONITOR_DYNAMIC=shared
22773                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-monitor"
22774         else
22775                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-monitor"
22776         fi
22777 fi
22778
22779 if test "$ol_enable_null" != no ; then
22780         cat >> confdefs.h <<\EOF
22781 #define SLAPD_NULL 1
22782 EOF
22783
22784         BUILD_SLAPD=yes
22785         BUILD_NULL=yes
22786         if test "$ol_with_null_module" != static ; then
22787                 cat >> confdefs.h <<\EOF
22788 #define SLAPD_NULL_DYNAMIC 1
22789 EOF
22790
22791                 BUILD_NULL=mod
22792                 BUILD_NULL_DYNAMIC=shared
22793                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-null"
22794         else
22795                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-null"
22796         fi
22797 fi
22798
22799 if test "$ol_enable_passwd" != no ; then
22800         cat >> confdefs.h <<\EOF
22801 #define SLAPD_PASSWD 1
22802 EOF
22803
22804         BUILD_SLAPD=yes
22805         BUILD_PASSWD=yes
22806         if test "$ol_with_passwd_module" != static ; then
22807                 cat >> confdefs.h <<\EOF
22808 #define SLAPD_PASSWD_DYNAMIC 1
22809 EOF
22810
22811                 BUILD_PASSWD=mod
22812                 BUILD_PASSWD_DYNAMIC=shared
22813                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-passwd"
22814         else
22815                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-passwd"
22816         fi
22817 fi
22818
22819 if test "$ol_link_perl" != no ; then
22820         cat >> confdefs.h <<\EOF
22821 #define SLAPD_PERL 1
22822 EOF
22823
22824         BUILD_SLAPD=yes
22825         BUILD_PERL=yes
22826         if test "$ol_with_perl_module" != static ; then
22827                 cat >> confdefs.h <<\EOF
22828 #define SLAPD_PERL_DYNAMIC 1
22829 EOF
22830
22831                 BUILD_PERL=mod
22832                 BUILD_PERL_DYNAMIC=shared
22833                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-perl"
22834         else
22835                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-perl"
22836         fi
22837 fi
22838
22839 if test "$ol_enable_shell" != no ; then
22840         if test "$ol_link_thread" != no ; then
22841                 echo "configure: warning: Use of --without-threads is recommended with back-shell" 1>&2
22842         fi
22843         cat >> confdefs.h <<\EOF
22844 #define SLAPD_SHELL 1
22845 EOF
22846
22847         BUILD_SLAPD=yes
22848         BUILD_SHELL=yes
22849         if test "$ol_with_shell_module" != static ; then
22850                 cat >> confdefs.h <<\EOF
22851 #define SLAPD_SHELL_DYNAMIC 1
22852 EOF
22853
22854                 BUILD_SHELL=mod
22855                 BUILD_SHELL_DYNAMIC=shared
22856                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-shell"
22857         else
22858                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-shell"
22859         fi
22860 fi
22861
22862 if test "$ol_enable_tcl" != no ; then
22863         cat >> confdefs.h <<\EOF
22864 #define SLAPD_TCL 1
22865 EOF
22866
22867         BUILD_SLAPD=yes
22868         BUILD_TCL=yes
22869         if test "$ol_with_tcl_module" != static; then
22870                 cat >> confdefs.h <<\EOF
22871 #define SLAPD_TCL_DYNAMIC 1
22872 EOF
22873
22874                 BUILD_TCL=mod
22875                 BUILD_TCL_DYNAMIC=shared
22876                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-tcl"
22877         else
22878                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-tcl"
22879         fi
22880 fi
22881
22882 if test "$ol_link_sql" != no ; then
22883         cat >> confdefs.h <<\EOF
22884 #define SLAPD_SQL 1
22885 EOF
22886
22887         BUILD_SLAPD=yes
22888         BUILD_SQL=yes
22889         if test "$ol_with_sql_module" != static; then
22890                 cat >> confdefs.h <<\EOF
22891 #define SLAPD_SQL_DYNAMIC 1
22892 EOF
22893
22894                 BUILD_SQL=mod
22895                 BUILD_SQL_DYNAMIC=shared
22896                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-sql"
22897         else
22898                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-sql"
22899         fi
22900 fi
22901
22902 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
22903         $BUILD_SLAPD = yes ; then
22904         BUILD_SLURPD=yes
22905 fi
22906
22907 if test "$ol_enable_rewrite" != no ; then
22908         cat >> confdefs.h <<\EOF
22909 #define ENABLE_REWRITE 1
22910 EOF
22911
22912         BUILD_REWRITE=yes
22913 fi
22914
22915 if test "$ol_enable_slapi" != no ; then
22916         cat >> confdefs.h <<\EOF
22917 #define ENABLE_SLAPI 1
22918 EOF
22919
22920         BUILD_SLAPI=yes
22921         SLAPD_SLAPI_DEPEND=libslapi.a
22922 fi
22923
22924
22925
22926 if test "$ac_cv_mingw32" = yes ; then
22927         PLAT=NT
22928         SLAPD_MODULES_LDFLAGS=
22929 else
22930         PLAT=UNIX
22931 fi
22932
22933 if test -z "$SLAPD_STATIC_BACKENDS"; then
22934         SLAPD_NO_STATIC='#'
22935 else
22936         SLAPD_NO_STATIC=
22937 fi
22938
22939
22940
22941
22942
22943
22944   
22945   
22946   
22947   
22948   
22949   
22950   
22951   
22952   
22953   
22954   
22955   
22956   
22957   
22958   
22959   
22960   
22961   
22962   
22963   
22964   
22965   
22966   
22967   
22968   
22969   
22970
22971
22972
22973
22974
22975
22976
22977
22978
22979
22980
22981
22982
22983
22984
22985
22986
22987
22988
22989
22990
22991
22992
22993
22994
22995
22996
22997
22998
22999
23000
23001
23002
23003
23004
23005
23006
23007
23008
23009
23010
23011 # Check whether --with-xxinstall or --without-xxinstall was given.
23012 if test "${with_xxinstall+set}" = set; then
23013   withval="$with_xxinstall"
23014   :
23015 fi
23016
23017
23018
23019 trap '' 1 2 15
23020
23021 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
23022
23023 test "x$prefix" = xNONE && prefix=$ac_default_prefix
23024 # Let make expand exec_prefix.
23025 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
23026
23027 # Any assignment to VPATH causes Sun make to only execute
23028 # the first set of double-colon rules, so remove it if not needed.
23029 # If there is a colon in the path, we need to keep it.
23030 if test "x$srcdir" = x.; then
23031   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
23032 fi
23033
23034 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
23035
23036 DEFS=-DHAVE_CONFIG_H
23037
23038 # Without the "./", some shells look in PATH for config.status.
23039 : ${CONFIG_STATUS=./config.status}
23040
23041 echo creating $CONFIG_STATUS
23042 rm -f $CONFIG_STATUS
23043 cat > $CONFIG_STATUS <<EOF
23044 #! /bin/sh
23045 # Generated automatically by configure.
23046 # Run this file to recreate the current configuration.
23047 # This directory was configured as follows,
23048 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
23049 #
23050 # $0 $ac_configure_args
23051 #
23052 # Compiler output produced by configure, useful for debugging
23053 # configure, is in ./config.log if it exists.
23054
23055 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
23056 for ac_option
23057 do
23058   case "\$ac_option" in
23059   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
23060     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
23061     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
23062   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
23063     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
23064     exit 0 ;;
23065   -help | --help | --hel | --he | --h)
23066     echo "\$ac_cs_usage"; exit 0 ;;
23067   *) echo "\$ac_cs_usage"; exit 1 ;;
23068   esac
23069 done
23070
23071 ac_given_srcdir=$srcdir
23072 ac_given_INSTALL="$INSTALL"
23073
23074 trap 'rm -fr `echo "\
23075 Makefile:build/top.mk:Makefile.in:build/dir.mk \
23076 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
23077 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
23078 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
23079 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
23080 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
23081 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
23082 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
23083 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
23084 include/Makefile:build/top.mk:include/Makefile.in \
23085 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
23086 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
23087 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23088 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23089 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
23090 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
23091 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
23092 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
23093 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
23094 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
23095 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
23096 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
23097 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
23098 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
23099 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
23100 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
23101 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
23102 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
23103 servers/slapd/back-null/Makefile:build/top.mk:servers/slapd/back-null/Makefile.in:build/mod.mk \
23104 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
23105 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
23106 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
23107 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
23108 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
23109 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
23110 servers/slapd/slapi/Makefile:build/top.mk:servers/slapd/slapi/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23111 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
23112 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
23113 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
23114 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
23115  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
23116 EOF
23117 cat >> $CONFIG_STATUS <<EOF
23118
23119 # Protect against being on the right side of a sed subst in config.status.
23120 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
23121  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
23122 $ac_vpsub
23123 $extrasub
23124 s%@SHELL@%$SHELL%g
23125 s%@CFLAGS@%$CFLAGS%g
23126 s%@CPPFLAGS@%$CPPFLAGS%g
23127 s%@CXXFLAGS@%$CXXFLAGS%g
23128 s%@FFLAGS@%$FFLAGS%g
23129 s%@DEFS@%$DEFS%g
23130 s%@LDFLAGS@%$LDFLAGS%g
23131 s%@LIBS@%$LIBS%g
23132 s%@exec_prefix@%$exec_prefix%g
23133 s%@prefix@%$prefix%g
23134 s%@program_transform_name@%$program_transform_name%g
23135 s%@bindir@%$bindir%g
23136 s%@sbindir@%$sbindir%g
23137 s%@libexecdir@%$libexecdir%g
23138 s%@datadir@%$datadir%g
23139 s%@sysconfdir@%$sysconfdir%g
23140 s%@sharedstatedir@%$sharedstatedir%g
23141 s%@localstatedir@%$localstatedir%g
23142 s%@libdir@%$libdir%g
23143 s%@includedir@%$includedir%g
23144 s%@oldincludedir@%$oldincludedir%g
23145 s%@infodir@%$infodir%g
23146 s%@mandir@%$mandir%g
23147 s%@host@%$host%g
23148 s%@host_alias@%$host_alias%g
23149 s%@host_cpu@%$host_cpu%g
23150 s%@host_vendor@%$host_vendor%g
23151 s%@host_os@%$host_os%g
23152 s%@target@%$target%g
23153 s%@target_alias@%$target_alias%g
23154 s%@target_cpu@%$target_cpu%g
23155 s%@target_vendor@%$target_vendor%g
23156 s%@target_os@%$target_os%g
23157 s%@build@%$build%g
23158 s%@build_alias@%$build_alias%g
23159 s%@build_cpu@%$build_cpu%g
23160 s%@build_vendor@%$build_vendor%g
23161 s%@build_os@%$build_os%g
23162 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
23163 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
23164 s%@INSTALL_DATA@%$INSTALL_DATA%g
23165 s%@PACKAGE@%$PACKAGE%g
23166 s%@VERSION@%$VERSION%g
23167 s%@ACLOCAL@%$ACLOCAL%g
23168 s%@AUTOCONF@%$AUTOCONF%g
23169 s%@AUTOMAKE@%$AUTOMAKE%g
23170 s%@AUTOHEADER@%$AUTOHEADER%g
23171 s%@MAKEINFO@%$MAKEINFO%g
23172 s%@install_sh@%$install_sh%g
23173 s%@AMTAR@%$AMTAR%g
23174 s%@AWK@%$AWK%g
23175 s%@AMTARFLAGS@%$AMTARFLAGS%g
23176 s%@SET_MAKE@%$SET_MAKE%g
23177 s%@OPENLDAP_LIBVERSION@%$OPENLDAP_LIBVERSION%g
23178 s%@OPENLDAP_RELEASE_DATE@%$OPENLDAP_RELEASE_DATE%g
23179 s%@top_builddir@%$top_builddir%g
23180 s%@ldap_subdir@%$ldap_subdir%g
23181 s%@CC@%$CC%g
23182 s%@AR@%$AR%g
23183 s%@LN_S@%$LN_S%g
23184 s%@OBJEXT@%$OBJEXT%g
23185 s%@EXEEXT@%$EXEEXT%g
23186 s%@ECHO@%$ECHO%g
23187 s%@RANLIB@%$RANLIB%g
23188 s%@STRIP@%$STRIP%g
23189 s%@DLLTOOL@%$DLLTOOL%g
23190 s%@AS@%$AS%g
23191 s%@OBJDUMP@%$OBJDUMP%g
23192 s%@CPP@%$CPP%g
23193 s%@LIBTOOL@%$LIBTOOL%g
23194 s%@LTSTATIC@%$LTSTATIC%g
23195 s%@LN_H@%$LN_H%g
23196 s%@PERLBIN@%$PERLBIN%g
23197 s%@OL_MKDEP@%$OL_MKDEP%g
23198 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
23199 s%@LIBOBJS@%$LIBOBJS%g
23200 s%@LIBSRCS@%$LIBSRCS%g
23201 s%@PLAT@%$PLAT%g
23202 s%@BUILD_LIBS_DYNAMIC@%$BUILD_LIBS_DYNAMIC%g
23203 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
23204 s%@BUILD_SLAPI@%$BUILD_SLAPI%g
23205 s%@SLAPD_SLAPI_DEPEND@%$SLAPD_SLAPI_DEPEND%g
23206 s%@BUILD_BDB@%$BUILD_BDB%g
23207 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
23208 s%@BUILD_LDAP@%$BUILD_LDAP%g
23209 s%@BUILD_LDBM@%$BUILD_LDBM%g
23210 s%@BUILD_META@%$BUILD_META%g
23211 s%@BUILD_MONITOR@%$BUILD_MONITOR%g
23212 s%@BUILD_NULL@%$BUILD_NULL%g
23213 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
23214 s%@BUILD_PERL@%$BUILD_PERL%g
23215 s%@BUILD_SHELL@%$BUILD_SHELL%g
23216 s%@BUILD_SQL@%$BUILD_SQL%g
23217 s%@BUILD_TCL@%$BUILD_TCL%g
23218 s%@BUILD_BDB_DYNAMIC@%$BUILD_BDB_DYNAMIC%g
23219 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
23220 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
23221 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
23222 s%@BUILD_META_DYNAMIC@%$BUILD_META_DYNAMIC%g
23223 s%@BUILD_MONITOR_DYNAMIC@%$BUILD_MONITOR_DYNAMIC%g
23224 s%@BUILD_NULL_DYNAMIC@%$BUILD_NULL_DYNAMIC%g
23225 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
23226 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
23227 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
23228 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
23229 s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g
23230 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
23231 s%@LDAP_LIBS@%$LDAP_LIBS%g
23232 s%@LDIF_LIBS@%$LDIF_LIBS%g
23233 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
23234 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
23235 s%@LDBM_LIBS@%$LDBM_LIBS%g
23236 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
23237 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
23238 s%@WRAP_LIBS@%$WRAP_LIBS%g
23239 s%@MOD_TCL_LIB@%$MOD_TCL_LIB%g
23240 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
23241 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
23242 s%@SLAPD_NO_STATIC@%$SLAPD_NO_STATIC%g
23243 s%@SLAPD_STATIC_BACKENDS@%$SLAPD_STATIC_BACKENDS%g
23244 s%@SLAPD_DYNAMIC_BACKENDS@%$SLAPD_DYNAMIC_BACKENDS%g
23245 s%@PERL_CPPFLAGS@%$PERL_CPPFLAGS%g
23246 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
23247 s%@MOD_PERL_LDFLAGS@%$MOD_PERL_LDFLAGS%g
23248 s%@KRB4_LIBS@%$KRB4_LIBS%g
23249 s%@KRB5_LIBS@%$KRB5_LIBS%g
23250 s%@READLINE_LIBS@%$READLINE_LIBS%g
23251 s%@SASL_LIBS@%$SASL_LIBS%g
23252 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
23253 s%@TLS_LIBS@%$TLS_LIBS%g
23254 s%@MODULES_LIBS@%$MODULES_LIBS%g
23255 s%@SLAPI_LIBS@%$SLAPI_LIBS%g
23256 s%@LIBSLAPI@%$LIBSLAPI%g
23257 s%@LIBSLAPITOOLS@%$LIBSLAPITOOLS%g
23258 s%@AUTH_LIBS@%$AUTH_LIBS%g
23259 s%@SLAPD_SLP_LIBS@%$SLAPD_SLP_LIBS%g
23260 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
23261 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
23262 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
23263
23264 CEOF
23265 EOF
23266
23267 cat >> $CONFIG_STATUS <<\EOF
23268
23269 # Split the substitutions into bite-sized pieces for seds with
23270 # small command number limits, like on Digital OSF/1 and HP-UX.
23271 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
23272 ac_file=1 # Number of current file.
23273 ac_beg=1 # First line for current file.
23274 ac_end=$ac_max_sed_cmds # Line after last line for current file.
23275 ac_more_lines=:
23276 ac_sed_cmds=""
23277 while $ac_more_lines; do
23278   if test $ac_beg -gt 1; then
23279     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
23280   else
23281     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
23282   fi
23283   if test ! -s conftest.s$ac_file; then
23284     ac_more_lines=false
23285     rm -f conftest.s$ac_file
23286   else
23287     if test -z "$ac_sed_cmds"; then
23288       ac_sed_cmds="sed -f conftest.s$ac_file"
23289     else
23290       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
23291     fi
23292     ac_file=`expr $ac_file + 1`
23293     ac_beg=$ac_end
23294     ac_end=`expr $ac_end + $ac_max_sed_cmds`
23295   fi
23296 done
23297 if test -z "$ac_sed_cmds"; then
23298   ac_sed_cmds=cat
23299 fi
23300 EOF
23301
23302 cat >> $CONFIG_STATUS <<EOF
23303
23304 CONFIG_FILES=\${CONFIG_FILES-"\
23305 Makefile:build/top.mk:Makefile.in:build/dir.mk \
23306 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
23307 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
23308 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
23309 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
23310 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
23311 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
23312 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
23313 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
23314 include/Makefile:build/top.mk:include/Makefile.in \
23315 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
23316 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
23317 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23318 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23319 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
23320 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
23321 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
23322 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
23323 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
23324 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
23325 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
23326 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
23327 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
23328 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
23329 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
23330 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
23331 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
23332 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
23333 servers/slapd/back-null/Makefile:build/top.mk:servers/slapd/back-null/Makefile.in:build/mod.mk \
23334 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
23335 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
23336 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
23337 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
23338 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
23339 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
23340 servers/slapd/slapi/Makefile:build/top.mk:servers/slapd/slapi/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23341 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
23342 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
23343 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
23344 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
23345 "}
23346 EOF
23347 cat >> $CONFIG_STATUS <<\EOF
23348 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
23349   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23350   case "$ac_file" in
23351   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
23352        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
23353   *) ac_file_in="${ac_file}.in" ;;
23354   esac
23355
23356   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
23357
23358   # Remove last slash and all that follows it.  Not all systems have dirname.
23359   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
23360   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23361     # The file is in a subdirectory.
23362     test ! -d "$ac_dir" && mkdir "$ac_dir"
23363     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
23364     # A "../" for each directory in $ac_dir_suffix.
23365     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
23366   else
23367     ac_dir_suffix= ac_dots=
23368   fi
23369
23370   case "$ac_given_srcdir" in
23371   .)  srcdir=.
23372       if test -z "$ac_dots"; then top_srcdir=.
23373       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
23374   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
23375   *) # Relative path.
23376     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
23377     top_srcdir="$ac_dots$ac_given_srcdir" ;;
23378   esac
23379
23380   case "$ac_given_INSTALL" in
23381   [/$]*) INSTALL="$ac_given_INSTALL" ;;
23382   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
23383   esac
23384
23385   echo creating "$ac_file"
23386   rm -f "$ac_file"
23387   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
23388   case "$ac_file" in
23389   *[Mm]akefile*) ac_comsub="1i\\
23390 # $configure_input" ;;
23391   *) ac_comsub= ;;
23392   esac
23393
23394   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
23395   sed -e "$ac_comsub
23396 s%@configure_input@%$configure_input%g
23397 s%@srcdir@%$srcdir%g
23398 s%@top_srcdir@%$top_srcdir%g
23399 s%@INSTALL@%$INSTALL%g
23400 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
23401 fi; done
23402 rm -f conftest.s*
23403
23404 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
23405 # NAME is the cpp macro being defined and VALUE is the value it is being given.
23406 #
23407 # ac_d sets the value in "#define NAME VALUE" lines.
23408 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
23409 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
23410 ac_dC='\3'
23411 ac_dD='%g'
23412 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
23413 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23414 ac_uB='\([      ]\)%\1#\2define\3'
23415 ac_uC=' '
23416 ac_uD='\4%g'
23417 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
23418 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23419 ac_eB='$%\1#\2define\3'
23420 ac_eC=' '
23421 ac_eD='%g'
23422
23423 if test "${CONFIG_HEADERS+set}" != set; then
23424 EOF
23425 cat >> $CONFIG_STATUS <<EOF
23426   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
23427 EOF
23428 cat >> $CONFIG_STATUS <<\EOF
23429 fi
23430 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
23431   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23432   case "$ac_file" in
23433   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
23434        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
23435   *) ac_file_in="${ac_file}.in" ;;
23436   esac
23437
23438   echo creating $ac_file
23439
23440   rm -f conftest.frag conftest.in conftest.out
23441   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
23442   cat $ac_file_inputs > conftest.in
23443
23444 EOF
23445
23446 # Transform confdefs.h into a sed script conftest.vals that substitutes
23447 # the proper values into config.h.in to produce config.h.  And first:
23448 # Protect against being on the right side of a sed subst in config.status.
23449 # Protect against being in an unquoted here document in config.status.
23450 rm -f conftest.vals
23451 cat > conftest.hdr <<\EOF
23452 s/[\\&%]/\\&/g
23453 s%[\\$`]%\\&%g
23454 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
23455 s%ac_d%ac_u%gp
23456 s%ac_u%ac_e%gp
23457 EOF
23458 sed -n -f conftest.hdr confdefs.h > conftest.vals
23459 rm -f conftest.hdr
23460
23461 # This sed command replaces #undef with comments.  This is necessary, for
23462 # example, in the case of _POSIX_SOURCE, which is predefined and required
23463 # on some systems where configure will not decide to define it.
23464 cat >> conftest.vals <<\EOF
23465 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
23466 EOF
23467
23468 # Break up conftest.vals because some shells have a limit on
23469 # the size of here documents, and old seds have small limits too.
23470
23471 rm -f conftest.tail
23472 while :
23473 do
23474   ac_lines=`grep -c . conftest.vals`
23475   # grep -c gives empty output for an empty file on some AIX systems.
23476   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
23477   # Write a limited-size here document to conftest.frag.
23478   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
23479   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
23480   echo 'CEOF
23481   sed -f conftest.frag conftest.in > conftest.out
23482   rm -f conftest.in
23483   mv conftest.out conftest.in
23484 ' >> $CONFIG_STATUS
23485   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
23486   rm -f conftest.vals
23487   mv conftest.tail conftest.vals
23488 done
23489 rm -f conftest.vals
23490
23491 cat >> $CONFIG_STATUS <<\EOF
23492   rm -f conftest.frag conftest.h
23493   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
23494   cat conftest.in >> conftest.h
23495   rm -f conftest.in
23496   if cmp -s $ac_file conftest.h 2>/dev/null; then
23497     echo "$ac_file is unchanged"
23498     rm -f conftest.h
23499   else
23500     # Remove last slash and all that follows it.  Not all systems have dirname.
23501       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
23502       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23503       # The file is in a subdirectory.
23504       test ! -d "$ac_dir" && mkdir "$ac_dir"
23505     fi
23506     rm -f $ac_file
23507     mv conftest.h $ac_file
23508   fi
23509 fi; done
23510
23511 EOF
23512 cat >> $CONFIG_STATUS <<EOF
23513
23514 EOF
23515 cat >> $CONFIG_STATUS <<\EOF
23516
23517 date > stamp-h
23518 echo Please run \"make depend\" to build dependencies
23519
23520 exit 0
23521 EOF
23522 chmod +x $CONFIG_STATUS
23523 rm -fr confdefs* $ac_clean_files
23524 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
23525