]> git.sur5r.net Git - openldap/blob - configure
rebuild after openldap.m4 changes
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.462 2003/03/02 20:46:41 kurt Exp  
4
5 # Copyright 1998-2003 The OpenLDAP Foundation.  All Rights Reserved.
6
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted only as authorized by the OpenLDAP
9 # Public License.  A copy of this license is available at
10 # http://www.OpenLDAP.org/license.html or in file LICENSE in the
11 # top-level directory of the distribution.
12
13 echo "Copyright 1998-2003 The OpenLDAP Foundation,  All Rights Reserved."
14 echo "  Restrictions apply, see COPYRIGHT and LICENSE files."
15
16 # Guess values for system-dependent variables and create Makefiles.
17 # Generated automatically using autoconf version 2.13.1 
18 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
19 #
20 # This configure script is free software; the Free Software Foundation
21 # gives unlimited permission to copy, distribute and modify it.
22
23 # Defaults:
24 ac_help=
25 ac_default_prefix=/usr/local
26 # Any additions from configure.in:
27 ac_default_prefix=/usr/local
28 ac_help="$ac_help
29   --with-subdir=DIR       change default subdirectory used for installs"
30 ac_help="$ac_help
31   --enable-debug          enable debugging [yes]"
32 ac_help="$ac_help
33   --enable-dynamic        enable linking built binaries with dynamic libs [no]"
34 ac_help="$ac_help
35   --enable-syslog         enable syslog support [auto]"
36 ac_help="$ac_help
37   --enable-proctitle      enable proctitle support [yes]"
38 ac_help="$ac_help
39   --enable-ipv6           enable IPv6 support [auto]"
40 ac_help="$ac_help
41   --enable-local          enable AF_LOCAL (AF_UNIX) socket support [auto]"
42 ac_help="$ac_help
43   --enable-x-compile      enable cross compiling [no]"
44 ac_help="$ac_help
45   --with-cyrus-sasl       with Cyrus SASL support [auto]"
46 ac_help="$ac_help
47   --with-fetch            with fetch(3) URL support [auto]"
48 ac_help="$ac_help
49   --with-kerberos         with Kerberos support [auto]"
50 ac_help="$ac_help
51   --with-readline         with readline support [auto]"
52 ac_help="$ac_help
53   --with-threads          with threads [auto]"
54 ac_help="$ac_help
55   --with-tls              with TLS/SSL support [auto]"
56 ac_help="$ac_help
57   --with-yielding-select  with implicitly yielding select [auto]"
58 ac_help="$ac_help
59
60 SLAPD (Standalone LDAP Daemon) Options:"
61 ac_help="$ac_help
62   --enable-slapd          enable building slapd [yes]"
63 ac_help="$ac_help
64     --enable-aci          enable per-object ACIs (experimental) [no]"
65 ac_help="$ac_help
66     --enable-cleartext    enable cleartext passwords [yes]"
67 ac_help="$ac_help
68     --enable-crypt        enable crypt(3) passwords [no]"
69 ac_help="$ac_help
70     --enable-kpasswd      enable Kerberos password verification [no]"
71 ac_help="$ac_help
72     --enable-lmpasswd     enable LAN Manager passwords [no]"
73 ac_help="$ac_help
74     --enable-spasswd      enable (Cyrus) SASL password verification [no]"
75 ac_help="$ac_help
76     --enable-modules      enable dynamic module support [no]"
77 ac_help="$ac_help
78     --enable-phonetic     enable phonetic/soundex [no]"
79 ac_help="$ac_help
80     --enable-rewrite      enable DN rewriting in back-ldap and back-meta [no]"
81 ac_help="$ac_help
82     --enable-rlookups     enable reverse lookups of client hostnames [no]"
83 ac_help="$ac_help
84     --enable-slapi        enable installation of slapi library [no]"
85 ac_help="$ac_help
86     --enable-slp          enable SLPv2 support [no]"
87 ac_help="$ac_help
88     --enable-wrappers     enable tcp wrapper support [no]"
89 ac_help="$ac_help
90     --enable-bdb          enable Berkeley DB backend [yes]"
91 ac_help="$ac_help
92     --with-bdb-module     module type static|dynamic [static]"
93 ac_help="$ac_help
94     --enable-dnssrv       enable dnssrv backend [no]"
95 ac_help="$ac_help
96     --with-dnssrv-module  module type static|dynamic [static]"
97 ac_help="$ac_help
98     --enable-ldap         enable ldap backend [no]"
99 ac_help="$ac_help
100     --with-ldap-module    module type static|dynamic [static]"
101 ac_help="$ac_help
102     --enable-ldbm         enable ldbm backend [no]"
103 ac_help="$ac_help
104     --with-ldbm-api       with LDBM API auto|berkeley|bcompat|mdbm|gdbm [auto]"
105 ac_help="$ac_help
106     --with-ldbm-module    module type static|dynamic [static]"
107 ac_help="$ac_help
108     --with-ldbm-type      use LDBM type auto|btree|hash [auto]"
109 ac_help="$ac_help
110     --enable-meta         enable metadirectory backend [no]"
111 ac_help="$ac_help
112     --with-meta-module    module type static|dynamic [static]"
113 ac_help="$ac_help
114     --enable-monitor      enable monitor backend [no]"
115 ac_help="$ac_help
116     --with-monitor-module module type static|dynamic [static]"
117 ac_help="$ac_help
118     --enable-null         enable null backend [no]"
119 ac_help="$ac_help
120     --with-null-module    module type static|dynamic [static]"
121 ac_help="$ac_help
122     --enable-passwd       enable passwd backend [no]"
123 ac_help="$ac_help
124     --with-passwd-module  module type static|dynamic [static]"
125 ac_help="$ac_help
126     --enable-perl         enable perl backend [no]"
127 ac_help="$ac_help
128     --with-perl-module    module type static|dynamic [static]"
129 ac_help="$ac_help
130     --enable-shell        enable shell backend [no]"
131 ac_help="$ac_help
132     --with-shell-module   module type static|dynamic [static]"
133 ac_help="$ac_help
134     --enable-sql          enable sql backend [no]"
135 ac_help="$ac_help
136     --with-sql-module     module type static|dynamic [static]"
137 ac_help="$ac_help
138     --enable-tcl          enable tcl backend [no]"
139 ac_help="$ac_help
140     --with-tcl-module     module type static|dynamic [static]"
141 ac_help="$ac_help
142
143 SLURPD (Replication Daemon) Options:"
144 ac_help="$ac_help
145   --enable-slurpd         enable building slurpd [auto]"
146 ac_help="$ac_help
147
148 Library Generation & Linking Options"
149 ac_help="$ac_help
150   --enable-static[=PKGS]  build static libraries [default=yes]"
151 ac_help="$ac_help
152   --enable-shared[=PKGS]  build shared libraries [default=yes]"
153 ac_help="$ac_help
154   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
155 ac_help="$ac_help
156   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
157
158 # Find the correct PATH separator.  Usually this is `:', but
159 # DJGPP uses `;' like DOS.
160 if test "X${PATH_SEPARATOR+set}" != Xset; then
161   UNAME=${UNAME-`uname 2>/dev/null`}
162   case X$UNAME in
163     *-DOS) lt_cv_sys_path_separator=';' ;;
164     *)     lt_cv_sys_path_separator=':' ;;
165   esac
166   PATH_SEPARATOR=$lt_cv_sys_path_separator
167 fi
168
169
170 # Check that we are running under the correct shell.
171 SHELL=${CONFIG_SHELL-/bin/sh}
172
173 case X$ECHO in
174 X*--fallback-echo)
175   # Remove one level of quotation (which was required for Make).
176   ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
177   ;;
178 esac
179
180 echo=${ECHO-echo}
181 if test "X$1" = X--no-reexec; then
182   # Discard the --no-reexec flag, and continue.
183   shift
184 elif test "X$1" = X--fallback-echo; then
185   # Avoid inline document here, it may be left over
186   :
187 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
188   # Yippee, $echo works!
189   :
190 else
191   # Restart under the correct shell.
192   exec $SHELL "$0" --no-reexec ${1+"$@"}
193 fi
194
195 if test "X$1" = X--fallback-echo; then
196   # used as fallback echo
197   shift
198   cat <<EOF
199
200 EOF
201   exit 0
202 fi
203
204 # The HP-UX ksh and POSIX shell print the target directory to stdout
205 # if CDPATH is set.
206 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
207
208 if test -z "$ECHO"; then
209 if test "X${echo_test_string+set}" != Xset; then
210 # find a string as large as possible, as long as the shell can cope with it
211   for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
212     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
213     if (echo_test_string="`eval $cmd`") 2>/dev/null &&
214        echo_test_string="`eval $cmd`" &&
215        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
216     then
217       break
218     fi
219   done
220 fi
221
222 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
223    echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
224    test "X$echo_testing_string" = "X$echo_test_string"; then
225   :
226 else
227   # The Solaris, AIX, and Digital Unix default echo programs unquote
228   # backslashes.  This makes it impossible to quote backslashes using
229   #   echo "$something" | sed 's/\\/\\\\/g'
230   #
231   # So, first we look for a working echo in the user's PATH.
232
233   IFS="${IFS=   }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
234   for dir in $PATH /usr/ucb; do
235     if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
236        test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
237        echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
238        test "X$echo_testing_string" = "X$echo_test_string"; then
239       echo="$dir/echo"
240       break
241     fi
242   done
243   IFS="$save_ifs"
244
245   if test "X$echo" = Xecho; then
246     # We didn't find a better echo, so look for alternatives.
247     if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
248        echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
249        test "X$echo_testing_string" = "X$echo_test_string"; then
250       # This shell has a builtin print -r that does the trick.
251       echo='print -r'
252     elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
253          test "X$CONFIG_SHELL" != X/bin/ksh; then
254       # If we have ksh, try running configure again with it.
255       ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
256       export ORIGINAL_CONFIG_SHELL
257       CONFIG_SHELL=/bin/ksh
258       export CONFIG_SHELL
259       exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
260     else
261       # Try using printf.
262       echo='printf %s\n'
263       if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
264          echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
265          test "X$echo_testing_string" = "X$echo_test_string"; then
266         # Cool, printf works
267         :
268       elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
269            test "X$echo_testing_string" = 'X\t' &&
270            echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
271            test "X$echo_testing_string" = "X$echo_test_string"; then
272         CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
273         export CONFIG_SHELL
274         SHELL="$CONFIG_SHELL"
275         export SHELL
276         echo="$CONFIG_SHELL $0 --fallback-echo"
277       elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
278            test "X$echo_testing_string" = 'X\t' &&
279            echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
280            test "X$echo_testing_string" = "X$echo_test_string"; then
281         echo="$CONFIG_SHELL $0 --fallback-echo"
282       else
283         # maybe with a smaller string...
284         prev=:
285
286         for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
287           if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
288           then
289             break
290           fi
291           prev="$cmd"
292         done
293
294         if test "$prev" != 'sed 50q "$0"'; then
295           echo_test_string=`eval $prev`
296           export echo_test_string
297           exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
298         else
299           # Oops.  We lost completely, so just stick with echo.
300           echo=echo
301         fi
302       fi
303     fi
304   fi
305 fi
306 fi
307
308 # Copy echo and quote the copy suitably for passing to libtool from
309 # the Makefile, instead of quoting the original, which is used later.
310 ECHO=$echo
311 if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
312    ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
313 fi
314
315
316 ac_help="$ac_help
317   --disable-libtool-lock  avoid locking (might break parallel builds)"
318 ac_help="$ac_help
319   --with-pic              try to use only PIC/non-PIC objects [default=use both]"
320 ac_help="$ac_help
321
322 See INSTALL file for further details."
323
324 # Initialize some variables set by options.
325 # The variables have the same names as the options, with
326 # dashes changed to underlines.
327 build=NONE
328 cache_file=./config.cache
329 exec_prefix=NONE
330 host=NONE
331 no_create=
332 nonopt=NONE
333 no_recursion=
334 prefix=NONE
335 program_prefix=NONE
336 program_suffix=NONE
337 program_transform_name=s,x,x,
338 silent=
339 site=
340 srcdir=
341 target=NONE
342 verbose=
343 x_includes=NONE
344 x_libraries=NONE
345 bindir='${exec_prefix}/bin'
346 sbindir='${exec_prefix}/sbin'
347 libexecdir='${exec_prefix}/libexec'
348 datadir='${prefix}/share'
349 sysconfdir='${prefix}/etc'
350 sharedstatedir='${prefix}/com'
351 localstatedir='${prefix}/var'
352 libdir='${exec_prefix}/lib'
353 includedir='${prefix}/include'
354 oldincludedir='/usr/include'
355 infodir='${prefix}/info'
356 mandir='${prefix}/man'
357
358 # Initialize some other variables.
359 subdirs=
360 MFLAGS= MAKEFLAGS=
361 SHELL=${CONFIG_SHELL-/bin/sh}
362 # Maximum number of lines to put in a shell here document.
363 ac_max_here_lines=12
364
365 ac_prev=
366 for ac_option
367 do
368
369   # If the previous option needs an argument, assign it.
370   if test -n "$ac_prev"; then
371     eval "$ac_prev=\$ac_option"
372     ac_prev=
373     continue
374   fi
375
376   case "$ac_option" in
377   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
378   *) ac_optarg= ;;
379   esac
380
381   # Accept the important Cygnus configure options, so we can diagnose typos.
382
383   case "$ac_option" in
384
385   -bindir | --bindir | --bindi | --bind | --bin | --bi)
386     ac_prev=bindir ;;
387   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
388     bindir="$ac_optarg" ;;
389
390   -build | --build | --buil | --bui | --bu)
391     ac_prev=build ;;
392   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
393     build="$ac_optarg" ;;
394
395   -cache-file | --cache-file | --cache-fil | --cache-fi \
396   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
397     ac_prev=cache_file ;;
398   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
399   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
400     cache_file="$ac_optarg" ;;
401
402   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
403     ac_prev=datadir ;;
404   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
405   | --da=*)
406     datadir="$ac_optarg" ;;
407
408   -disable-* | --disable-*)
409     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
410     # Reject names that are not valid shell variable names.
411     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
412       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
413     fi
414     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
415     eval "enable_${ac_feature}=no" ;;
416
417   -enable-* | --enable-*)
418     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
419     # Reject names that are not valid shell variable names.
420     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
421       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
422     fi
423     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
424     case "$ac_option" in
425       *=*) ;;
426       *) ac_optarg=yes ;;
427     esac
428     eval "enable_${ac_feature}='$ac_optarg'" ;;
429
430   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
431   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
432   | --exec | --exe | --ex)
433     ac_prev=exec_prefix ;;
434   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
435   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
436   | --exec=* | --exe=* | --ex=*)
437     exec_prefix="$ac_optarg" ;;
438
439   -gas | --gas | --ga | --g)
440     # Obsolete; use --with-gas.
441     with_gas=yes ;;
442
443   -help | --help | --hel | --he)
444     # Omit some internal or obsolete options to make the list less imposing.
445     # This message is too long to be a string in the A/UX 3.1 sh.
446     cat << EOF
447 Usage: configure [options] [host]
448 Options: [defaults in brackets after descriptions]
449 Configuration:
450   --cache-file=FILE       cache test results in FILE
451   --help                  print this message
452   --no-create             do not create output files
453   --quiet, --silent       do not print \`checking...' messages
454   --version               print the version of autoconf that created configure
455 Directory and file names:
456   --prefix=PREFIX         install architecture-independent files in PREFIX
457                           [$ac_default_prefix]
458   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
459                           [same as prefix]
460   --bindir=DIR            user executables in DIR [EPREFIX/bin]
461   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
462   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
463   --datadir=DIR           read-only architecture-independent data in DIR
464                           [PREFIX/share]
465   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
466   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
467                           [PREFIX/com]
468   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
469   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
470   --includedir=DIR        C header files in DIR [PREFIX/include]
471   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
472   --infodir=DIR           info documentation in DIR [PREFIX/info]
473   --mandir=DIR            man documentation in DIR [PREFIX/man]
474   --srcdir=DIR            find the sources in DIR [configure dir or ..]
475   --program-prefix=PREFIX prepend PREFIX to installed program names
476   --program-suffix=SUFFIX append SUFFIX to installed program names
477   --program-transform-name=PROGRAM
478                           run sed PROGRAM on installed program names
479 EOF
480     cat << EOF
481 Host type:
482   --build=BUILD           configure for building on BUILD [BUILD=HOST]
483   --host=HOST             configure for HOST [guessed]
484   --target=TARGET         configure for TARGET [TARGET=HOST]
485 Features and packages:
486   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
487   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
488   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
489   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
490   --x-includes=DIR        X include files are in DIR
491   --x-libraries=DIR       X library files are in DIR
492 EOF
493     if test -n "$ac_help"; then
494       echo "--enable and --with options recognized:$ac_help"
495     fi
496     exit 0 ;;
497
498   -host | --host | --hos | --ho)
499     ac_prev=host ;;
500   -host=* | --host=* | --hos=* | --ho=*)
501     host="$ac_optarg" ;;
502
503   -includedir | --includedir | --includedi | --included | --include \
504   | --includ | --inclu | --incl | --inc)
505     ac_prev=includedir ;;
506   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
507   | --includ=* | --inclu=* | --incl=* | --inc=*)
508     includedir="$ac_optarg" ;;
509
510   -infodir | --infodir | --infodi | --infod | --info | --inf)
511     ac_prev=infodir ;;
512   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
513     infodir="$ac_optarg" ;;
514
515   -libdir | --libdir | --libdi | --libd)
516     ac_prev=libdir ;;
517   -libdir=* | --libdir=* | --libdi=* | --libd=*)
518     libdir="$ac_optarg" ;;
519
520   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
521   | --libexe | --libex | --libe)
522     ac_prev=libexecdir ;;
523   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
524   | --libexe=* | --libex=* | --libe=*)
525     libexecdir="$ac_optarg" ;;
526
527   -localstatedir | --localstatedir | --localstatedi | --localstated \
528   | --localstate | --localstat | --localsta | --localst \
529   | --locals | --local | --loca | --loc | --lo)
530     ac_prev=localstatedir ;;
531   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
532   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
533   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
534     localstatedir="$ac_optarg" ;;
535
536   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
537     ac_prev=mandir ;;
538   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
539     mandir="$ac_optarg" ;;
540
541   -nfp | --nfp | --nf)
542     # Obsolete; use --without-fp.
543     with_fp=no ;;
544
545   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
546   | --no-cr | --no-c)
547     no_create=yes ;;
548
549   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
550   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
551     no_recursion=yes ;;
552
553   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
554   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
555   | --oldin | --oldi | --old | --ol | --o)
556     ac_prev=oldincludedir ;;
557   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
558   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
559   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
560     oldincludedir="$ac_optarg" ;;
561
562   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
563     ac_prev=prefix ;;
564   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
565     prefix="$ac_optarg" ;;
566
567   -program-prefix | --program-prefix | --program-prefi | --program-pref \
568   | --program-pre | --program-pr | --program-p)
569     ac_prev=program_prefix ;;
570   -program-prefix=* | --program-prefix=* | --program-prefi=* \
571   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
572     program_prefix="$ac_optarg" ;;
573
574   -program-suffix | --program-suffix | --program-suffi | --program-suff \
575   | --program-suf | --program-su | --program-s)
576     ac_prev=program_suffix ;;
577   -program-suffix=* | --program-suffix=* | --program-suffi=* \
578   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
579     program_suffix="$ac_optarg" ;;
580
581   -program-transform-name | --program-transform-name \
582   | --program-transform-nam | --program-transform-na \
583   | --program-transform-n | --program-transform- \
584   | --program-transform | --program-transfor \
585   | --program-transfo | --program-transf \
586   | --program-trans | --program-tran \
587   | --progr-tra | --program-tr | --program-t)
588     ac_prev=program_transform_name ;;
589   -program-transform-name=* | --program-transform-name=* \
590   | --program-transform-nam=* | --program-transform-na=* \
591   | --program-transform-n=* | --program-transform-=* \
592   | --program-transform=* | --program-transfor=* \
593   | --program-transfo=* | --program-transf=* \
594   | --program-trans=* | --program-tran=* \
595   | --progr-tra=* | --program-tr=* | --program-t=*)
596     program_transform_name="$ac_optarg" ;;
597
598   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
599   | -silent | --silent | --silen | --sile | --sil)
600     silent=yes ;;
601
602   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
603     ac_prev=sbindir ;;
604   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
605   | --sbi=* | --sb=*)
606     sbindir="$ac_optarg" ;;
607
608   -sharedstatedir | --sharedstatedir | --sharedstatedi \
609   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
610   | --sharedst | --shareds | --shared | --share | --shar \
611   | --sha | --sh)
612     ac_prev=sharedstatedir ;;
613   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
614   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
615   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
616   | --sha=* | --sh=*)
617     sharedstatedir="$ac_optarg" ;;
618
619   -site | --site | --sit)
620     ac_prev=site ;;
621   -site=* | --site=* | --sit=*)
622     site="$ac_optarg" ;;
623
624   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
625     ac_prev=srcdir ;;
626   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
627     srcdir="$ac_optarg" ;;
628
629   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
630   | --syscon | --sysco | --sysc | --sys | --sy)
631     ac_prev=sysconfdir ;;
632   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
633   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
634     sysconfdir="$ac_optarg" ;;
635
636   -target | --target | --targe | --targ | --tar | --ta | --t)
637     ac_prev=target ;;
638   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
639     target="$ac_optarg" ;;
640
641   -v | -verbose | --verbose | --verbos | --verbo | --verb)
642     verbose=yes ;;
643
644   -version | --version | --versio | --versi | --vers)
645     echo "configure generated by autoconf version 2.13.1"
646     exit 0 ;;
647
648   -with-* | --with-*)
649     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
650     # Reject names that are not valid shell variable names.
651     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
652       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
653     fi
654     ac_package=`echo $ac_package| sed 's/-/_/g'`
655     case "$ac_option" in
656       *=*) ;;
657       *) ac_optarg=yes ;;
658     esac
659     eval "with_${ac_package}='$ac_optarg'" ;;
660
661   -without-* | --without-*)
662     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
663     # Reject names that are not valid shell variable names.
664     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
665       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
666     fi
667     ac_package=`echo $ac_package| sed 's/-/_/g'`
668     eval "with_${ac_package}=no" ;;
669
670   --x)
671     # Obsolete; use --with-x.
672     with_x=yes ;;
673
674   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
675   | --x-incl | --x-inc | --x-in | --x-i)
676     ac_prev=x_includes ;;
677   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
678   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
679     x_includes="$ac_optarg" ;;
680
681   -x-libraries | --x-libraries | --x-librarie | --x-librari \
682   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
683     ac_prev=x_libraries ;;
684   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
685   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
686     x_libraries="$ac_optarg" ;;
687
688   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
689     ;;
690
691   *)
692     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
693       echo "configure: warning: $ac_option: invalid host type" 1>&2
694     fi
695     if test "x$nonopt" != xNONE; then
696       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
697     fi
698     nonopt="$ac_option"
699     ;;
700
701   esac
702 done
703
704 if test -n "$ac_prev"; then
705   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
706 fi
707
708 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
709
710 # File descriptor usage:
711 # 0 standard input
712 # 1 file creation
713 # 2 errors and warnings
714 # 3 some systems may open it to /dev/tty
715 # 4 used on the Kubota Titan
716 # 6 checking for... messages and results
717 # 5 compiler messages saved in config.log
718 if test "$silent" = yes; then
719   exec 6>/dev/null
720 else
721   exec 6>&1
722 fi
723 exec 5>./config.log
724
725 echo "\
726 This file contains any messages produced by compilers while
727 running configure, to aid debugging if configure makes a mistake.
728 " 1>&5
729
730 # Strip out --no-create and --no-recursion so they do not pile up.
731 # Also quote any args containing shell metacharacters.
732 ac_configure_args=
733 for ac_arg
734 do
735   case "$ac_arg" in
736   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
737   | --no-cr | --no-c) ;;
738   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
739   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
740   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
741   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
742   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
743   esac
744 done
745
746 # NLS nuisances.
747 # Only set these to C if already set.  These must not be set unconditionally
748 # because not all systems understand e.g. LANG=C (notably SCO).
749 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
750 # Non-C LC_CTYPE values break the ctype check.
751 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
752 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
753 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
754 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
755
756 # confdefs.h avoids OS command line length limits that DEFS can exceed.
757 rm -rf conftest* confdefs.h
758 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
759 echo > confdefs.h
760
761 # A filename unique to this package, relative to the directory that
762 # configure is in, which we can look for to find out if srcdir is correct.
763 ac_unique_file=build/version.sh
764
765 # Find the source files, if location was not specified.
766 if test -z "$srcdir"; then
767   ac_srcdir_defaulted=yes
768   # Try the directory containing this script, then its parent.
769   ac_prog=$0
770   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
771   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
772   srcdir=$ac_confdir
773   if test ! -r $srcdir/$ac_unique_file; then
774     srcdir=..
775   fi
776 else
777   ac_srcdir_defaulted=no
778 fi
779 if test ! -r $srcdir/$ac_unique_file; then
780   if test "$ac_srcdir_defaulted" = yes; then
781     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
782   else
783     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
784   fi
785 fi
786 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
787
788 # Prefer explicitly selected file to automatically selected ones.
789 if test -z "$CONFIG_SITE"; then
790   if test "x$prefix" != xNONE; then
791     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
792   else
793     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
794   fi
795 fi
796 for ac_site_file in $CONFIG_SITE; do
797   if test -r "$ac_site_file"; then
798     echo "loading site script $ac_site_file"
799     . "$ac_site_file"
800   fi
801 done
802
803
804 ac_ext=c
805 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
806 ac_cpp='$CPP $CPPFLAGS'
807 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
808 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
809 cross_compiling=$ac_cv_prog_cc_cross
810
811 ac_exeext=
812 ac_objext=o
813 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
814   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
815   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
816     ac_n= ac_c='
817 ' ac_t='        '
818   else
819     ac_n=-n ac_c= ac_t=
820   fi
821 else
822   ac_n= ac_c='\c' ac_t=
823 fi
824
825
826 # set unset (borrowed from autoconf 2.49c)
827 if (OL_FOO=OL_FOO; unset OL_FOO) >/dev/null 2>&1; then
828   ol_unset=unset
829 else
830   ol_unset=false
831 fi
832 # unset CDPATH
833 $ol_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
834
835 ac_aux_dir=
836 for ac_dir in build $srcdir/build; do
837   if test -f $ac_dir/install-sh; then
838     ac_aux_dir=$ac_dir
839     ac_install_sh="$ac_aux_dir/install-sh -c"
840     break
841   elif test -f $ac_dir/install.sh; then
842     ac_aux_dir=$ac_dir
843     ac_install_sh="$ac_aux_dir/install.sh -c"
844     break
845   elif test -f $ac_dir/shtool; then
846     ac_aux_dir=$ac_dir
847     ac_install_sh="$ac_aux_dir/shtool install -c"
848     break
849   fi
850 done
851 if test -z "$ac_aux_dir"; then
852   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
853 fi
854 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
855 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
856 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
857
858 eval `$ac_aux_dir/version.sh`
859 if test -z "$OL_STRING"; then
860         { echo "configure: error: could not determine version" 1>&2; exit 1; }
861 fi
862
863 if test -f "$ac_aux_dir/shtool" -a ! -d $ac_aux_dir/shtool; then
864         ac_cv_shtool="$ac_aux_dir/shtool"
865 else
866         { echo "configure: error: no shtool found in $ac_aux_dir" 1>&2; exit 1; }
867 fi
868
869 SHTOOL="$ac_cv_shtool"
870
871 TB="`$SHTOOL echo -e '%B' 2>/dev/null`"
872 TN="`$SHTOOL echo -e '%b' 2>/dev/null`"
873
874 OPENLDAP_CVS=""
875 if test -d $ac_aux_dir/CVS; then
876         OPENLDAP_CVS="(from CVS sources) "
877 fi
878
879 echo "Configuring ${TB}${OL_STRING}${TN} ${OPENLDAP_CVS}..."
880
881
882 echo $ac_n "checking host system type""... $ac_c" 1>&6
883 echo "configure:884: checking host system type" >&5
884 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
885
886 # Make sure we can run config.sub.
887   if $ac_config_sub sun4 >/dev/null 2>&1; then :
888     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
889   fi
890
891   ac_cv_host_alias=$host
892   case "$ac_cv_host_alias" in
893   NONE)
894     case $nonopt in
895     NONE)
896       if ac_cv_host_alias=`$ac_config_guess`; then :
897       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
898       fi ;;
899     *) ac_cv_host_alias=$nonopt ;;
900     esac ;;
901   esac
902
903   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
904   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
905   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
906   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
907 else
908   echo $ac_n "(cached) $ac_c" 1>&6
909 fi
910
911 echo "$ac_t""$ac_cv_host" 1>&6
912
913 host=$ac_cv_host
914 host_alias=$ac_cv_host_alias
915 host_cpu=$ac_cv_host_cpu
916 host_vendor=$ac_cv_host_vendor
917 host_os=$ac_cv_host_os
918
919
920
921
922
923 echo $ac_n "checking target system type""... $ac_c" 1>&6
924 echo "configure:925: checking target system type" >&5
925 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
926
927 # Make sure we can run config.sub.
928   if $ac_config_sub sun4 >/dev/null 2>&1; then :
929     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
930   fi
931
932   ac_cv_target_alias=$target
933   case "$ac_cv_target_alias" in
934   NONE)
935     case $nonopt in
936     NONE)
937       ac_cv_target_alias=$host_alias ;;
938
939     *) ac_cv_target_alias=$nonopt ;;
940     esac ;;
941   esac
942
943   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
944   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
945   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
946   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
947 else
948   echo $ac_n "(cached) $ac_c" 1>&6
949 fi
950
951 echo "$ac_t""$ac_cv_target" 1>&6
952
953 target=$ac_cv_target
954 target_alias=$ac_cv_target_alias
955 target_cpu=$ac_cv_target_cpu
956 target_vendor=$ac_cv_target_vendor
957 target_os=$ac_cv_target_os
958
959
960
961
962
963 echo $ac_n "checking build system type""... $ac_c" 1>&6
964 echo "configure:965: checking build system type" >&5
965 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
966
967 # Make sure we can run config.sub.
968   if $ac_config_sub sun4 >/dev/null 2>&1; then :
969     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
970   fi
971
972   ac_cv_build_alias=$build
973   case "$ac_cv_build_alias" in
974   NONE)
975     case $nonopt in
976     NONE)
977       ac_cv_build_alias=$host_alias ;;
978
979     *) ac_cv_build_alias=$nonopt ;;
980     esac ;;
981   esac
982
983   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
984   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
985   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
986   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
987 else
988   echo $ac_n "(cached) $ac_c" 1>&6
989 fi
990
991 echo "$ac_t""$ac_cv_build" 1>&6
992
993 build=$ac_cv_build
994 build_alias=$ac_cv_build_alias
995 build_cpu=$ac_cv_build_cpu
996 build_vendor=$ac_cv_build_vendor
997 build_os=$ac_cv_build_os
998
999
1000
1001
1002
1003 # Do some error checking and defaulting for the host and target type.
1004 # The inputs are:
1005 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
1006 #
1007 # The rules are:
1008 # 1. You are not allowed to specify --host, --target, and nonopt at the
1009 #    same time.
1010 # 2. Host defaults to nonopt.
1011 # 3. If nonopt is not specified, then host defaults to the current host,
1012 #    as determined by config.guess.
1013 # 4. Target and build default to nonopt.
1014 # 5. If nonopt is not specified, then target and build default to host.
1015
1016 # The aliases save the names the user supplied, while $host etc.
1017 # will get canonicalized.
1018 case $host---$target---$nonopt in
1019 NONE---*---* | *---NONE---* | *---*---NONE) ;;
1020 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
1021 esac
1022
1023 test "$host_alias" != "$target_alias" &&
1024   test "$program_prefix$program_suffix$program_transform_name" = \
1025     NONENONEs,x,x, &&
1026   program_prefix=${target_alias}-
1027
1028
1029 # Find a good install program.  We prefer a C program (faster),
1030 # so one script is as good as another.  But avoid the broken or
1031 # incompatible versions:
1032 # SysV /etc/install, /usr/sbin/install
1033 # SunOS /usr/etc/install
1034 # IRIX /sbin/install
1035 # AIX /bin/install
1036 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1037 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1038 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1039 # ./install, which can be erroneously created by make from ./install.sh.
1040 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1041 echo "configure:1042: checking for a BSD compatible install" >&5
1042 if test -z "$INSTALL"; then
1043 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
1044   echo $ac_n "(cached) $ac_c" 1>&6
1045 else
1046     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1047   for ac_dir in $PATH; do
1048     # Account for people who put trailing slashes in PATH elements.
1049     case "$ac_dir/" in
1050     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1051     *)
1052       # OSF1 and SCO ODT 3.0 have their own names for install.
1053       # Don't use installbsd from OSF since it installs stuff as root
1054       # by default.
1055       for ac_prog in ginstall scoinst install; do
1056         if test -f $ac_dir/$ac_prog; then
1057           if test $ac_prog = install &&
1058             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1059             # AIX install.  It has an incompatible calling convention.
1060             :
1061           elif test $ac_prog = install &&
1062             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
1063             # program-specific install script used by HP pwplus--don't use.
1064             :
1065           else
1066             ac_cv_path_install="$ac_dir/$ac_prog -c"
1067             break 2
1068           fi
1069         fi
1070       done
1071       ;;
1072     esac
1073   done
1074   IFS="$ac_save_IFS"
1075
1076 fi
1077   if test "${ac_cv_path_install+set}" = set; then
1078     INSTALL="$ac_cv_path_install"
1079   else
1080     # As a last resort, use the slow shell script.  We don't cache a
1081     # path for INSTALL within a source directory, because that will
1082     # break other packages using the cache if that directory is
1083     # removed, or if the path is relative.
1084     INSTALL="$ac_install_sh"
1085   fi
1086 fi
1087 echo "$ac_t""$INSTALL" 1>&6
1088
1089 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1090 # It thinks the first close brace ends the variable substitution.
1091 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1092
1093 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
1094
1095 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1096
1097 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
1098 echo "configure:1099: checking whether build environment is sane" >&5
1099 # Just in case
1100 sleep 1
1101 echo timestamp > conftestfile
1102 # Do `set' in a subshell so we don't clobber the current shell's
1103 # arguments.  Must try -L first in case configure is actually a
1104 # symlink; some systems play weird games with the mod time of symlinks
1105 # (eg FreeBSD returns the mod time of the symlink's containing
1106 # directory).
1107 if (
1108    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1109    if test "$*" = "X"; then
1110       # -L didn't work.
1111       set X `ls -t $srcdir/configure conftestfile`
1112    fi
1113    if test "$*" != "X $srcdir/configure conftestfile" \
1114       && test "$*" != "X conftestfile $srcdir/configure"; then
1115
1116       # If neither matched, then we have a broken ls.  This can happen
1117       # if, for instance, CONFIG_SHELL is bash and it inherits a
1118       # broken ls alias from the environment.  This has actually
1119       # happened.  Such a system could not be considered "sane".
1120       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
1121 alias in your environment" 1>&2; exit 1; }
1122    fi
1123
1124    test "$2" = conftestfile
1125    )
1126 then
1127    # Ok.
1128    :
1129 else
1130    { echo "configure: error: newly created file is older than distributed files!
1131 Check your system clock" 1>&2; exit 1; }
1132 fi
1133 rm -f conftest*
1134 echo "$ac_t""yes" 1>&6
1135 if test "$program_transform_name" = s,x,x,; then
1136   program_transform_name=
1137 else
1138   # Double any \ or $.  echo might interpret backslashes.
1139   cat <<\EOF_SED > conftestsed
1140 s,\\,\\\\,g; s,\$,$$,g
1141 EOF_SED
1142   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
1143   rm -f conftestsed
1144 fi
1145 test "$program_prefix" != NONE &&
1146   program_transform_name="s,^,${program_prefix},;$program_transform_name"
1147 # Use a double $ so make ignores it.
1148 test "$program_suffix" != NONE &&
1149   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
1150
1151 # sed with no file args requires a program.
1152 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
1153
1154 for ac_prog in mawk gawk nawk awk
1155 do
1156 # Extract the first word of "$ac_prog", so it can be a program name with args.
1157 set dummy $ac_prog; ac_word=$2
1158 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1159 echo "configure:1160: checking for $ac_word" >&5
1160 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
1161   echo $ac_n "(cached) $ac_c" 1>&6
1162 else
1163   if test -n "$AWK"; then
1164   ac_cv_prog_AWK="$AWK" # Let the user override the test.
1165 else
1166   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1167   ac_dummy="$PATH"
1168   for ac_dir in $ac_dummy; do
1169     test -z "$ac_dir" && ac_dir=.
1170     if test -f $ac_dir/$ac_word; then
1171       ac_cv_prog_AWK="$ac_prog"
1172       break
1173     fi
1174   done
1175   IFS="$ac_save_ifs"
1176 fi
1177 fi
1178 AWK="$ac_cv_prog_AWK"
1179 if test -n "$AWK"; then
1180   echo "$ac_t""$AWK" 1>&6
1181 else
1182   echo "$ac_t""no" 1>&6
1183 fi
1184
1185 test -n "$AWK" && break
1186 done
1187
1188 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1189 echo "configure:1190: checking whether ${MAKE-make} sets \${MAKE}" >&5
1190 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1191 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1192   echo $ac_n "(cached) $ac_c" 1>&6
1193 else
1194   cat > conftestmake <<\EOF
1195 all:
1196         @echo 'ac_maketemp="${MAKE}"'
1197 EOF
1198 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1199 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1200 if test -n "$ac_maketemp"; then
1201   eval ac_cv_prog_make_${ac_make}_set=yes
1202 else
1203   eval ac_cv_prog_make_${ac_make}_set=no
1204 fi
1205 rm -f conftestmake
1206 fi
1207 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1208   echo "$ac_t""yes" 1>&6
1209   SET_MAKE=
1210 else
1211   echo "$ac_t""no" 1>&6
1212   SET_MAKE="MAKE=${MAKE-make}"
1213 fi
1214
1215
1216
1217 PACKAGE=$OL_PACKAGE
1218
1219 VERSION=$OL_VERSION
1220
1221 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1222   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
1223 fi
1224
1225
1226
1227 missing_dir=`cd $ac_aux_dir && pwd`
1228 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1229 echo "configure:1230: checking for working aclocal" >&5
1230 # Run test in a subshell; some versions of sh will print an error if
1231 # an executable is not found, even if stderr is redirected.
1232 # Redirect stdin to placate older versions of autoconf.  Sigh.
1233 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1234    ACLOCAL=aclocal
1235    echo "$ac_t""found" 1>&6
1236 else
1237    ACLOCAL="$missing_dir/missing aclocal"
1238    echo "$ac_t""missing" 1>&6
1239 fi
1240
1241 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1242 echo "configure:1243: checking for working autoconf" >&5
1243 # Run test in a subshell; some versions of sh will print an error if
1244 # an executable is not found, even if stderr is redirected.
1245 # Redirect stdin to placate older versions of autoconf.  Sigh.
1246 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1247    AUTOCONF=autoconf
1248    echo "$ac_t""found" 1>&6
1249 else
1250    AUTOCONF="$missing_dir/missing autoconf"
1251    echo "$ac_t""missing" 1>&6
1252 fi
1253
1254 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1255 echo "configure:1256: checking for working automake" >&5
1256 # Run test in a subshell; some versions of sh will print an error if
1257 # an executable is not found, even if stderr is redirected.
1258 # Redirect stdin to placate older versions of autoconf.  Sigh.
1259 if (automake --version) < /dev/null > /dev/null 2>&1; then
1260    AUTOMAKE=automake
1261    echo "$ac_t""found" 1>&6
1262 else
1263    AUTOMAKE="$missing_dir/missing automake"
1264    echo "$ac_t""missing" 1>&6
1265 fi
1266
1267 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1268 echo "configure:1269: checking for working autoheader" >&5
1269 # Run test in a subshell; some versions of sh will print an error if
1270 # an executable is not found, even if stderr is redirected.
1271 # Redirect stdin to placate older versions of autoconf.  Sigh.
1272 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1273    AUTOHEADER=autoheader
1274    echo "$ac_t""found" 1>&6
1275 else
1276    AUTOHEADER="$missing_dir/missing autoheader"
1277    echo "$ac_t""missing" 1>&6
1278 fi
1279
1280 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1281 echo "configure:1282: checking for working makeinfo" >&5
1282 # Run test in a subshell; some versions of sh will print an error if
1283 # an executable is not found, even if stderr is redirected.
1284 # Redirect stdin to placate older versions of autoconf.  Sigh.
1285 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1286    MAKEINFO=makeinfo
1287    echo "$ac_t""found" 1>&6
1288 else
1289    MAKEINFO="$missing_dir/missing makeinfo"
1290    echo "$ac_t""missing" 1>&6
1291 fi
1292
1293 install_sh="$missing_dir/install-sh"
1294 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1295
1296 for ac_prog in gnutar gtar tar
1297 do
1298 # Extract the first word of "$ac_prog", so it can be a program name with args.
1299 set dummy $ac_prog; ac_word=$2
1300 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1301 echo "configure:1302: checking for $ac_word" >&5
1302 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1303   echo $ac_n "(cached) $ac_c" 1>&6
1304 else
1305   if test -n "$AMTAR"; then
1306   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1307 else
1308   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1309   ac_dummy="$PATH"
1310   for ac_dir in $ac_dummy; do
1311     test -z "$ac_dir" && ac_dir=.
1312     if test -f $ac_dir/$ac_word; then
1313       ac_cv_prog_AMTAR="$ac_prog"
1314       break
1315     fi
1316   done
1317   IFS="$ac_save_ifs"
1318 fi
1319 fi
1320 AMTAR="$ac_cv_prog_AMTAR"
1321 if test -n "$AMTAR"; then
1322   echo "$ac_t""$AMTAR" 1>&6
1323 else
1324   echo "$ac_t""no" 1>&6
1325 fi
1326
1327 test -n "$AMTAR" && break
1328 done
1329
1330
1331 AMTARFLAGS=
1332 if test -n "$AMTAR"; then
1333   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1334         AMTARFLAGS=o
1335   fi
1336 fi
1337
1338 cat >> confdefs.h <<EOF
1339 #define OPENLDAP_PACKAGE "$PACKAGE"
1340 EOF
1341
1342 cat >> confdefs.h <<EOF
1343 #define OPENLDAP_VERSION "$VERSION"
1344 EOF
1345
1346
1347 cat >> confdefs.h <<EOF
1348 #define LDAP_VENDOR_VERSION $OL_API_INC
1349 EOF
1350
1351 cat >> confdefs.h <<EOF
1352 #define LDAP_VENDOR_VERSION_MAJOR $OL_MAJOR
1353 EOF
1354
1355 cat >> confdefs.h <<EOF
1356 #define LDAP_VENDOR_VERSION_MINOR $OL_MINOR
1357 EOF
1358
1359 cat >> confdefs.h <<EOF
1360 #define LDAP_VENDOR_VERSION_PATCH $OL_PATCH
1361 EOF
1362
1363
1364 OPENLDAP_LIBVERSION=$OL_API_LIB
1365
1366 OPENLDAP_RELEASE_DATE="$OL_RELEASE_DATE"
1367
1368
1369
1370 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1371 echo "configure:1372: checking configure arguments" >&5
1372
1373
1374 top_builddir=`pwd`
1375
1376 ldap_subdir="/openldap"
1377
1378 # Check whether --with-subdir or --without-subdir was given.
1379 if test "${with_subdir+set}" = set; then
1380   withval="$with_subdir"
1381   case "$withval" in
1382         no) ldap_subdir=""
1383                 ;;
1384         yes)
1385                 ;;
1386         /*|\\*)
1387                 ldap_subdir="$withval"
1388                 ;;
1389         *)
1390                 ldap_subdir="/$withval"
1391                 ;;
1392 esac
1393
1394 fi
1395
1396
1397 # OpenLDAP --enable-debug
1398         # Check whether --enable-debug or --disable-debug was given.
1399 if test "${enable_debug+set}" = set; then
1400   enableval="$enable_debug"
1401   
1402         ol_arg=invalid
1403         for ol_val in auto yes no ; do
1404                 if test "$enableval" = "$ol_val" ; then
1405                         ol_arg="$ol_val"
1406                 fi
1407         done
1408         if test "$ol_arg" = "invalid" ; then
1409                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1410         fi
1411         ol_enable_debug="$ol_arg"
1412
1413 else
1414         ol_enable_debug="yes"
1415 fi
1416 # end --enable-debug
1417 # OpenLDAP --enable-dynamic
1418         # Check whether --enable-dynamic or --disable-dynamic was given.
1419 if test "${enable_dynamic+set}" = set; then
1420   enableval="$enable_dynamic"
1421   
1422         ol_arg=invalid
1423         for ol_val in auto yes no ; do
1424                 if test "$enableval" = "$ol_val" ; then
1425                         ol_arg="$ol_val"
1426                 fi
1427         done
1428         if test "$ol_arg" = "invalid" ; then
1429                 { echo "configure: error: bad value $enableval for --enable-dynamic" 1>&2; exit 1; }
1430         fi
1431         ol_enable_dynamic="$ol_arg"
1432
1433 else
1434         ol_enable_dynamic="no"
1435 fi
1436 # end --enable-dynamic
1437 # OpenLDAP --enable-syslog
1438         # Check whether --enable-syslog or --disable-syslog was given.
1439 if test "${enable_syslog+set}" = set; then
1440   enableval="$enable_syslog"
1441   
1442         ol_arg=invalid
1443         for ol_val in auto yes no ; do
1444                 if test "$enableval" = "$ol_val" ; then
1445                         ol_arg="$ol_val"
1446                 fi
1447         done
1448         if test "$ol_arg" = "invalid" ; then
1449                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1450         fi
1451         ol_enable_syslog="$ol_arg"
1452
1453 else
1454         ol_enable_syslog="auto"
1455 fi
1456 # end --enable-syslog
1457 # OpenLDAP --enable-proctitle
1458         # Check whether --enable-proctitle or --disable-proctitle was given.
1459 if test "${enable_proctitle+set}" = set; then
1460   enableval="$enable_proctitle"
1461   
1462         ol_arg=invalid
1463         for ol_val in auto yes no ; do
1464                 if test "$enableval" = "$ol_val" ; then
1465                         ol_arg="$ol_val"
1466                 fi
1467         done
1468         if test "$ol_arg" = "invalid" ; then
1469                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1470         fi
1471         ol_enable_proctitle="$ol_arg"
1472
1473 else
1474         ol_enable_proctitle="yes"
1475 fi
1476 # end --enable-proctitle
1477 ol_enable_referrals=${ol_enable_referrals-no}
1478 ol_enable_kbind=${ol_enable_kbind-no}
1479 # OpenLDAP --enable-ipv6
1480         # Check whether --enable-ipv6 or --disable-ipv6 was given.
1481 if test "${enable_ipv6+set}" = set; then
1482   enableval="$enable_ipv6"
1483   
1484         ol_arg=invalid
1485         for ol_val in auto yes no ; do
1486                 if test "$enableval" = "$ol_val" ; then
1487                         ol_arg="$ol_val"
1488                 fi
1489         done
1490         if test "$ol_arg" = "invalid" ; then
1491                 { echo "configure: error: bad value $enableval for --enable-ipv6" 1>&2; exit 1; }
1492         fi
1493         ol_enable_ipv6="$ol_arg"
1494
1495 else
1496         ol_enable_ipv6="auto"
1497 fi
1498 # end --enable-ipv6
1499 # OpenLDAP --enable-local
1500         # Check whether --enable-local or --disable-local was given.
1501 if test "${enable_local+set}" = set; then
1502   enableval="$enable_local"
1503   
1504         ol_arg=invalid
1505         for ol_val in auto yes no ; do
1506                 if test "$enableval" = "$ol_val" ; then
1507                         ol_arg="$ol_val"
1508                 fi
1509         done
1510         if test "$ol_arg" = "invalid" ; then
1511                 { echo "configure: error: bad value $enableval for --enable-local" 1>&2; exit 1; }
1512         fi
1513         ol_enable_local="$ol_arg"
1514
1515 else
1516         ol_enable_local="auto"
1517 fi
1518 # end --enable-local
1519 # OpenLDAP --enable-x_compile
1520         # Check whether --enable-x_compile or --disable-x_compile was given.
1521 if test "${enable_x_compile+set}" = set; then
1522   enableval="$enable_x_compile"
1523   
1524         ol_arg=invalid
1525         for ol_val in yes no ; do
1526                 if test "$enableval" = "$ol_val" ; then
1527                         ol_arg="$ol_val"
1528                 fi
1529         done
1530         if test "$ol_arg" = "invalid" ; then
1531                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1532         fi
1533         ol_enable_x_compile="$ol_arg"
1534
1535 else
1536         ol_enable_x_compile="no"
1537 fi
1538 # end --enable-x_compile
1539
1540
1541 # OpenLDAP --with-cyrus_sasl
1542         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1543 if test "${with_cyrus_sasl+set}" = set; then
1544   withval="$with_cyrus_sasl"
1545   
1546         ol_arg=invalid
1547         for ol_val in auto yes no  ; do
1548                 if test "$withval" = "$ol_val" ; then
1549                         ol_arg="$ol_val"
1550                 fi
1551         done
1552         if test "$ol_arg" = "invalid" ; then
1553                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1554         fi
1555         ol_with_cyrus_sasl="$ol_arg"
1556
1557 else
1558         ol_with_cyrus_sasl="auto"
1559 fi
1560 # end --with-cyrus_sasl
1561
1562 # OpenLDAP --with-fetch
1563         # Check whether --with-fetch or --without-fetch was given.
1564 if test "${with_fetch+set}" = set; then
1565   withval="$with_fetch"
1566   
1567         ol_arg=invalid
1568         for ol_val in auto yes no  ; do
1569                 if test "$withval" = "$ol_val" ; then
1570                         ol_arg="$ol_val"
1571                 fi
1572         done
1573         if test "$ol_arg" = "invalid" ; then
1574                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1575         fi
1576         ol_with_fetch="$ol_arg"
1577
1578 else
1579         ol_with_fetch="auto"
1580 fi
1581 # end --with-fetch
1582
1583 # OpenLDAP --with-kerberos
1584         # Check whether --with-kerberos or --without-kerberos was given.
1585 if test "${with_kerberos+set}" = set; then
1586   withval="$with_kerberos"
1587   
1588         ol_arg=invalid
1589         for ol_val in auto k5 k5only k425 kth k4 afs yes no ; do
1590                 if test "$withval" = "$ol_val" ; then
1591                         ol_arg="$ol_val"
1592                 fi
1593         done
1594         if test "$ol_arg" = "invalid" ; then
1595                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1596         fi
1597         ol_with_kerberos="$ol_arg"
1598
1599 else
1600         ol_with_kerberos="auto"
1601 fi
1602 # end --with-kerberos
1603
1604 # OpenLDAP --with-readline
1605         # Check whether --with-readline or --without-readline was given.
1606 if test "${with_readline+set}" = set; then
1607   withval="$with_readline"
1608   
1609         ol_arg=invalid
1610         for ol_val in auto yes no  ; do
1611                 if test "$withval" = "$ol_val" ; then
1612                         ol_arg="$ol_val"
1613                 fi
1614         done
1615         if test "$ol_arg" = "invalid" ; then
1616                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1617         fi
1618         ol_with_readline="$ol_arg"
1619
1620 else
1621         ol_with_readline="auto"
1622 fi
1623 # end --with-readline
1624
1625 # OpenLDAP --with-threads
1626         # Check whether --with-threads or --without-threads was given.
1627 if test "${with_threads+set}" = set; then
1628   withval="$with_threads"
1629   
1630         ol_arg=invalid
1631         for ol_val in auto nt posix mach pth lwp yes no manual  ; do
1632                 if test "$withval" = "$ol_val" ; then
1633                         ol_arg="$ol_val"
1634                 fi
1635         done
1636         if test "$ol_arg" = "invalid" ; then
1637                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1638         fi
1639         ol_with_threads="$ol_arg"
1640
1641 else
1642         ol_with_threads="auto"
1643 fi
1644 # end --with-threads
1645
1646 # OpenLDAP --with-tls
1647         # Check whether --with-tls or --without-tls was given.
1648 if test "${with_tls+set}" = set; then
1649   withval="$with_tls"
1650   
1651         ol_arg=invalid
1652         for ol_val in auto ssleay openssl yes no  ; do
1653                 if test "$withval" = "$ol_val" ; then
1654                         ol_arg="$ol_val"
1655                 fi
1656         done
1657         if test "$ol_arg" = "invalid" ; then
1658                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1659         fi
1660         ol_with_tls="$ol_arg"
1661
1662 else
1663         ol_with_tls="auto"
1664 fi
1665 # end --with-tls
1666
1667 # OpenLDAP --with-yielding_select
1668         # Check whether --with-yielding_select or --without-yielding_select was given.
1669 if test "${with_yielding_select+set}" = set; then
1670   withval="$with_yielding_select"
1671   
1672         ol_arg=invalid
1673         for ol_val in auto yes no manual  ; do
1674                 if test "$withval" = "$ol_val" ; then
1675                         ol_arg="$ol_val"
1676                 fi
1677         done
1678         if test "$ol_arg" = "invalid" ; then
1679                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1680         fi
1681         ol_with_yielding_select="$ol_arg"
1682
1683 else
1684         ol_with_yielding_select="auto"
1685 fi
1686 # end --with-yielding_select
1687
1688
1689
1690 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1691 if test "${with_xxslapdoptions+set}" = set; then
1692   withval="$with_xxslapdoptions"
1693   :
1694 fi
1695
1696 # OpenLDAP --enable-slapd
1697         # Check whether --enable-slapd or --disable-slapd was given.
1698 if test "${enable_slapd+set}" = set; then
1699   enableval="$enable_slapd"
1700   
1701         ol_arg=invalid
1702         for ol_val in auto yes no ; do
1703                 if test "$enableval" = "$ol_val" ; then
1704                         ol_arg="$ol_val"
1705                 fi
1706         done
1707         if test "$ol_arg" = "invalid" ; then
1708                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1709         fi
1710         ol_enable_slapd="$ol_arg"
1711
1712 else
1713         ol_enable_slapd="yes"
1714 fi
1715 # end --enable-slapd
1716 # OpenLDAP --enable-aci
1717         # Check whether --enable-aci or --disable-aci was given.
1718 if test "${enable_aci+set}" = set; then
1719   enableval="$enable_aci"
1720   
1721         ol_arg=invalid
1722         for ol_val in auto yes no ; do
1723                 if test "$enableval" = "$ol_val" ; then
1724                         ol_arg="$ol_val"
1725                 fi
1726         done
1727         if test "$ol_arg" = "invalid" ; then
1728                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1729         fi
1730         ol_enable_aci="$ol_arg"
1731
1732 else
1733         ol_enable_aci="no"
1734 fi
1735 # end --enable-aci
1736 # OpenLDAP --enable-cleartext
1737         # Check whether --enable-cleartext or --disable-cleartext was given.
1738 if test "${enable_cleartext+set}" = set; then
1739   enableval="$enable_cleartext"
1740   
1741         ol_arg=invalid
1742         for ol_val in auto yes no ; do
1743                 if test "$enableval" = "$ol_val" ; then
1744                         ol_arg="$ol_val"
1745                 fi
1746         done
1747         if test "$ol_arg" = "invalid" ; then
1748                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1749         fi
1750         ol_enable_cleartext="$ol_arg"
1751
1752 else
1753         ol_enable_cleartext="yes"
1754 fi
1755 # end --enable-cleartext
1756 # OpenLDAP --enable-crypt
1757         # Check whether --enable-crypt or --disable-crypt was given.
1758 if test "${enable_crypt+set}" = set; then
1759   enableval="$enable_crypt"
1760   
1761         ol_arg=invalid
1762         for ol_val in auto yes no ; do
1763                 if test "$enableval" = "$ol_val" ; then
1764                         ol_arg="$ol_val"
1765                 fi
1766         done
1767         if test "$ol_arg" = "invalid" ; then
1768                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1769         fi
1770         ol_enable_crypt="$ol_arg"
1771
1772 else
1773         ol_enable_crypt="no"
1774 fi
1775 # end --enable-crypt
1776 # OpenLDAP --enable-kpasswd
1777         # Check whether --enable-kpasswd or --disable-kpasswd was given.
1778 if test "${enable_kpasswd+set}" = set; then
1779   enableval="$enable_kpasswd"
1780   
1781         ol_arg=invalid
1782         for ol_val in auto yes no ; do
1783                 if test "$enableval" = "$ol_val" ; then
1784                         ol_arg="$ol_val"
1785                 fi
1786         done
1787         if test "$ol_arg" = "invalid" ; then
1788                 { echo "configure: error: bad value $enableval for --enable-kpasswd" 1>&2; exit 1; }
1789         fi
1790         ol_enable_kpasswd="$ol_arg"
1791
1792 else
1793         ol_enable_kpasswd="no"
1794 fi
1795 # end --enable-kpasswd
1796 # OpenLDAP --enable-lmpasswd
1797         # Check whether --enable-lmpasswd or --disable-lmpasswd was given.
1798 if test "${enable_lmpasswd+set}" = set; then
1799   enableval="$enable_lmpasswd"
1800   
1801         ol_arg=invalid
1802         for ol_val in auto yes no ; do
1803                 if test "$enableval" = "$ol_val" ; then
1804                         ol_arg="$ol_val"
1805                 fi
1806         done
1807         if test "$ol_arg" = "invalid" ; then
1808                 { echo "configure: error: bad value $enableval for --enable-lmpasswd" 1>&2; exit 1; }
1809         fi
1810         ol_enable_lmpasswd="$ol_arg"
1811
1812 else
1813         ol_enable_lmpasswd="no"
1814 fi
1815 # end --enable-lmpasswd
1816 # OpenLDAP --enable-spasswd
1817         # Check whether --enable-spasswd or --disable-spasswd was given.
1818 if test "${enable_spasswd+set}" = set; then
1819   enableval="$enable_spasswd"
1820   
1821         ol_arg=invalid
1822         for ol_val in auto yes no ; do
1823                 if test "$enableval" = "$ol_val" ; then
1824                         ol_arg="$ol_val"
1825                 fi
1826         done
1827         if test "$ol_arg" = "invalid" ; then
1828                 { echo "configure: error: bad value $enableval for --enable-spasswd" 1>&2; exit 1; }
1829         fi
1830         ol_enable_spasswd="$ol_arg"
1831
1832 else
1833         ol_enable_spasswd="no"
1834 fi
1835 # end --enable-spasswd
1836 # OpenLDAP --enable-modules
1837         # Check whether --enable-modules or --disable-modules was given.
1838 if test "${enable_modules+set}" = set; then
1839   enableval="$enable_modules"
1840   
1841         ol_arg=invalid
1842         for ol_val in auto yes no ; do
1843                 if test "$enableval" = "$ol_val" ; then
1844                         ol_arg="$ol_val"
1845                 fi
1846         done
1847         if test "$ol_arg" = "invalid" ; then
1848                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1849         fi
1850         ol_enable_modules="$ol_arg"
1851
1852 else
1853         ol_enable_modules="no"
1854 fi
1855 # end --enable-modules
1856 ol_enable_multimaster=${ol_enable_multimaster-no}
1857 # OpenLDAP --enable-phonetic
1858         # Check whether --enable-phonetic or --disable-phonetic was given.
1859 if test "${enable_phonetic+set}" = set; then
1860   enableval="$enable_phonetic"
1861   
1862         ol_arg=invalid
1863         for ol_val in auto yes no ; do
1864                 if test "$enableval" = "$ol_val" ; then
1865                         ol_arg="$ol_val"
1866                 fi
1867         done
1868         if test "$ol_arg" = "invalid" ; then
1869                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1870         fi
1871         ol_enable_phonetic="$ol_arg"
1872
1873 else
1874         ol_enable_phonetic="no"
1875 fi
1876 # end --enable-phonetic
1877 # OpenLDAP --enable-rewrite
1878         # Check whether --enable-rewrite or --disable-rewrite was given.
1879 if test "${enable_rewrite+set}" = set; then
1880   enableval="$enable_rewrite"
1881   
1882         ol_arg=invalid
1883         for ol_val in auto yes no ; do
1884                 if test "$enableval" = "$ol_val" ; then
1885                         ol_arg="$ol_val"
1886                 fi
1887         done
1888         if test "$ol_arg" = "invalid" ; then
1889                 { echo "configure: error: bad value $enableval for --enable-rewrite" 1>&2; exit 1; }
1890         fi
1891         ol_enable_rewrite="$ol_arg"
1892
1893 else
1894         ol_enable_rewrite="no"
1895 fi
1896 # end --enable-rewrite
1897 # OpenLDAP --enable-rlookups
1898         # Check whether --enable-rlookups or --disable-rlookups was given.
1899 if test "${enable_rlookups+set}" = set; then
1900   enableval="$enable_rlookups"
1901   
1902         ol_arg=invalid
1903         for ol_val in auto yes no ; do
1904                 if test "$enableval" = "$ol_val" ; then
1905                         ol_arg="$ol_val"
1906                 fi
1907         done
1908         if test "$ol_arg" = "invalid" ; then
1909                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1910         fi
1911         ol_enable_rlookups="$ol_arg"
1912
1913 else
1914         ol_enable_rlookups="no"
1915 fi
1916 # end --enable-rlookups
1917 # OpenLDAP --enable-slapi
1918         # Check whether --enable-slapi or --disable-slapi was given.
1919 if test "${enable_slapi+set}" = set; then
1920   enableval="$enable_slapi"
1921   
1922         ol_arg=invalid
1923         for ol_val in auto yes no ; do
1924                 if test "$enableval" = "$ol_val" ; then
1925                         ol_arg="$ol_val"
1926                 fi
1927         done
1928         if test "$ol_arg" = "invalid" ; then
1929                 { echo "configure: error: bad value $enableval for --enable-slapi" 1>&2; exit 1; }
1930         fi
1931         ol_enable_slapi="$ol_arg"
1932
1933 else
1934         ol_enable_slapi="no"
1935 fi
1936 # end --enable-slapi
1937 # OpenLDAP --enable-slp
1938         # Check whether --enable-slp or --disable-slp was given.
1939 if test "${enable_slp+set}" = set; then
1940   enableval="$enable_slp"
1941   
1942         ol_arg=invalid
1943         for ol_val in auto yes no ; do
1944                 if test "$enableval" = "$ol_val" ; then
1945                         ol_arg="$ol_val"
1946                 fi
1947         done
1948         if test "$ol_arg" = "invalid" ; then
1949                 { echo "configure: error: bad value $enableval for --enable-slp" 1>&2; exit 1; }
1950         fi
1951         ol_enable_slp="$ol_arg"
1952
1953 else
1954         ol_enable_slp="no"
1955 fi
1956 # end --enable-slp
1957 # OpenLDAP --enable-wrappers
1958         # Check whether --enable-wrappers or --disable-wrappers was given.
1959 if test "${enable_wrappers+set}" = set; then
1960   enableval="$enable_wrappers"
1961   
1962         ol_arg=invalid
1963         for ol_val in auto yes no ; do
1964                 if test "$enableval" = "$ol_val" ; then
1965                         ol_arg="$ol_val"
1966                 fi
1967         done
1968         if test "$ol_arg" = "invalid" ; then
1969                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1970         fi
1971         ol_enable_wrappers="$ol_arg"
1972
1973 else
1974         ol_enable_wrappers="no"
1975 fi
1976 # end --enable-wrappers
1977
1978
1979 # OpenLDAP --enable-bdb
1980         # Check whether --enable-bdb or --disable-bdb was given.
1981 if test "${enable_bdb+set}" = set; then
1982   enableval="$enable_bdb"
1983   
1984         ol_arg=invalid
1985         for ol_val in auto yes no ; do
1986                 if test "$enableval" = "$ol_val" ; then
1987                         ol_arg="$ol_val"
1988                 fi
1989         done
1990         if test "$ol_arg" = "invalid" ; then
1991                 { echo "configure: error: bad value $enableval for --enable-bdb" 1>&2; exit 1; }
1992         fi
1993         ol_enable_bdb="$ol_arg"
1994
1995 else
1996         ol_enable_bdb="yes"
1997 fi
1998 # end --enable-bdb
1999 # OpenLDAP --with-bdb_module
2000         # Check whether --with-bdb_module or --without-bdb_module was given.
2001 if test "${with_bdb_module+set}" = set; then
2002   withval="$with_bdb_module"
2003   
2004         ol_arg=invalid
2005         for ol_val in static dynamic ; do
2006                 if test "$withval" = "$ol_val" ; then
2007                         ol_arg="$ol_val"
2008                 fi
2009         done
2010         if test "$ol_arg" = "invalid" ; then
2011                 { echo "configure: error: bad value $withval for --with-bdb_module" 1>&2; exit 1; }
2012         fi
2013         ol_with_bdb_module="$ol_arg"
2014
2015 else
2016         ol_with_bdb_module="static"
2017 fi
2018 # end --with-bdb_module
2019
2020 # OpenLDAP --enable-dnssrv
2021         # Check whether --enable-dnssrv or --disable-dnssrv was given.
2022 if test "${enable_dnssrv+set}" = set; then
2023   enableval="$enable_dnssrv"
2024   
2025         ol_arg=invalid
2026         for ol_val in auto yes no ; do
2027                 if test "$enableval" = "$ol_val" ; then
2028                         ol_arg="$ol_val"
2029                 fi
2030         done
2031         if test "$ol_arg" = "invalid" ; then
2032                 { echo "configure: error: bad value $enableval for --enable-dnssrv" 1>&2; exit 1; }
2033         fi
2034         ol_enable_dnssrv="$ol_arg"
2035
2036 else
2037         ol_enable_dnssrv="no"
2038 fi
2039 # end --enable-dnssrv
2040 # OpenLDAP --with-dnssrv_module
2041         # Check whether --with-dnssrv_module or --without-dnssrv_module was given.
2042 if test "${with_dnssrv_module+set}" = set; then
2043   withval="$with_dnssrv_module"
2044   
2045         ol_arg=invalid
2046         for ol_val in static dynamic ; do
2047                 if test "$withval" = "$ol_val" ; then
2048                         ol_arg="$ol_val"
2049                 fi
2050         done
2051         if test "$ol_arg" = "invalid" ; then
2052                 { echo "configure: error: bad value $withval for --with-dnssrv_module" 1>&2; exit 1; }
2053         fi
2054         ol_with_dnssrv_module="$ol_arg"
2055
2056 else
2057         ol_with_dnssrv_module="static"
2058 fi
2059 # end --with-dnssrv_module
2060
2061 # OpenLDAP --enable-ldap
2062         # Check whether --enable-ldap or --disable-ldap was given.
2063 if test "${enable_ldap+set}" = set; then
2064   enableval="$enable_ldap"
2065   
2066         ol_arg=invalid
2067         for ol_val in auto yes no ; do
2068                 if test "$enableval" = "$ol_val" ; then
2069                         ol_arg="$ol_val"
2070                 fi
2071         done
2072         if test "$ol_arg" = "invalid" ; then
2073                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
2074         fi
2075         ol_enable_ldap="$ol_arg"
2076
2077 else
2078         ol_enable_ldap="no"
2079 fi
2080 # end --enable-ldap
2081 # OpenLDAP --with-ldap_module
2082         # Check whether --with-ldap_module or --without-ldap_module was given.
2083 if test "${with_ldap_module+set}" = set; then
2084   withval="$with_ldap_module"
2085   
2086         ol_arg=invalid
2087         for ol_val in static dynamic ; do
2088                 if test "$withval" = "$ol_val" ; then
2089                         ol_arg="$ol_val"
2090                 fi
2091         done
2092         if test "$ol_arg" = "invalid" ; then
2093                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
2094         fi
2095         ol_with_ldap_module="$ol_arg"
2096
2097 else
2098         ol_with_ldap_module="static"
2099 fi
2100 # end --with-ldap_module
2101
2102 # OpenLDAP --enable-ldbm
2103         # Check whether --enable-ldbm or --disable-ldbm was given.
2104 if test "${enable_ldbm+set}" = set; then
2105   enableval="$enable_ldbm"
2106   
2107         ol_arg=invalid
2108         for ol_val in auto yes no ; do
2109                 if test "$enableval" = "$ol_val" ; then
2110                         ol_arg="$ol_val"
2111                 fi
2112         done
2113         if test "$ol_arg" = "invalid" ; then
2114                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
2115         fi
2116         ol_enable_ldbm="$ol_arg"
2117
2118 else
2119         ol_enable_ldbm="no"
2120 fi
2121 # end --enable-ldbm
2122 # OpenLDAP --with-ldbm_api
2123         # Check whether --with-ldbm_api or --without-ldbm_api was given.
2124 if test "${with_ldbm_api+set}" = set; then
2125   withval="$with_ldbm_api"
2126   
2127         ol_arg=invalid
2128         for ol_val in auto berkeley bcompat mdbm gdbm ; do
2129                 if test "$withval" = "$ol_val" ; then
2130                         ol_arg="$ol_val"
2131                 fi
2132         done
2133         if test "$ol_arg" = "invalid" ; then
2134                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
2135         fi
2136         ol_with_ldbm_api="$ol_arg"
2137
2138 else
2139         ol_with_ldbm_api="auto"
2140 fi
2141 # end --with-ldbm_api
2142
2143 # OpenLDAP --with-ldbm_module
2144         # Check whether --with-ldbm_module or --without-ldbm_module was given.
2145 if test "${with_ldbm_module+set}" = set; then
2146   withval="$with_ldbm_module"
2147   
2148         ol_arg=invalid
2149         for ol_val in static dynamic ; do
2150                 if test "$withval" = "$ol_val" ; then
2151                         ol_arg="$ol_val"
2152                 fi
2153         done
2154         if test "$ol_arg" = "invalid" ; then
2155                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
2156         fi
2157         ol_with_ldbm_module="$ol_arg"
2158
2159 else
2160         ol_with_ldbm_module="static"
2161 fi
2162 # end --with-ldbm_module
2163
2164 # OpenLDAP --with-ldbm_type
2165         # Check whether --with-ldbm_type or --without-ldbm_type was given.
2166 if test "${with_ldbm_type+set}" = set; then
2167   withval="$with_ldbm_type"
2168   
2169         ol_arg=invalid
2170         for ol_val in auto btree hash ; do
2171                 if test "$withval" = "$ol_val" ; then
2172                         ol_arg="$ol_val"
2173                 fi
2174         done
2175         if test "$ol_arg" = "invalid" ; then
2176                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
2177         fi
2178         ol_with_ldbm_type="$ol_arg"
2179
2180 else
2181         ol_with_ldbm_type="auto"
2182 fi
2183 # end --with-ldbm_type
2184
2185 # OpenLDAP --enable-meta
2186         # Check whether --enable-meta or --disable-meta was given.
2187 if test "${enable_meta+set}" = set; then
2188   enableval="$enable_meta"
2189   
2190         ol_arg=invalid
2191         for ol_val in auto yes no ; do
2192                 if test "$enableval" = "$ol_val" ; then
2193                         ol_arg="$ol_val"
2194                 fi
2195         done
2196         if test "$ol_arg" = "invalid" ; then
2197                 { echo "configure: error: bad value $enableval for --enable-meta" 1>&2; exit 1; }
2198         fi
2199         ol_enable_meta="$ol_arg"
2200
2201 else
2202         ol_enable_meta="no"
2203 fi
2204 # end --enable-meta
2205 # OpenLDAP --with-meta_module
2206         # Check whether --with-meta_module or --without-meta_module was given.
2207 if test "${with_meta_module+set}" = set; then
2208   withval="$with_meta_module"
2209   
2210         ol_arg=invalid
2211         for ol_val in static dynamic ; do
2212                 if test "$withval" = "$ol_val" ; then
2213                         ol_arg="$ol_val"
2214                 fi
2215         done
2216         if test "$ol_arg" = "invalid" ; then
2217                 { echo "configure: error: bad value $withval for --with-meta_module" 1>&2; exit 1; }
2218         fi
2219         ol_with_meta_module="$ol_arg"
2220
2221 else
2222         ol_with_meta_module="static"
2223 fi
2224 # end --with-meta_module
2225
2226 # OpenLDAP --enable-monitor
2227         # Check whether --enable-monitor or --disable-monitor was given.
2228 if test "${enable_monitor+set}" = set; then
2229   enableval="$enable_monitor"
2230   
2231         ol_arg=invalid
2232         for ol_val in auto yes no ; do
2233                 if test "$enableval" = "$ol_val" ; then
2234                         ol_arg="$ol_val"
2235                 fi
2236         done
2237         if test "$ol_arg" = "invalid" ; then
2238                 { echo "configure: error: bad value $enableval for --enable-monitor" 1>&2; exit 1; }
2239         fi
2240         ol_enable_monitor="$ol_arg"
2241
2242 else
2243         ol_enable_monitor="no"
2244 fi
2245 # end --enable-monitor
2246 # OpenLDAP --with-monitor_module
2247         # Check whether --with-monitor_module or --without-monitor_module was given.
2248 if test "${with_monitor_module+set}" = set; then
2249   withval="$with_monitor_module"
2250   
2251         ol_arg=invalid
2252         for ol_val in static dynamic ; do
2253                 if test "$withval" = "$ol_val" ; then
2254                         ol_arg="$ol_val"
2255                 fi
2256         done
2257         if test "$ol_arg" = "invalid" ; then
2258                 { echo "configure: error: bad value $withval for --with-monitor_module" 1>&2; exit 1; }
2259         fi
2260         ol_with_monitor_module="$ol_arg"
2261
2262 else
2263         ol_with_monitor_module="static"
2264 fi
2265 # end --with-monitor_module
2266
2267 # OpenLDAP --enable-null
2268         # Check whether --enable-null or --disable-null was given.
2269 if test "${enable_null+set}" = set; then
2270   enableval="$enable_null"
2271   
2272         ol_arg=invalid
2273         for ol_val in auto yes no ; do
2274                 if test "$enableval" = "$ol_val" ; then
2275                         ol_arg="$ol_val"
2276                 fi
2277         done
2278         if test "$ol_arg" = "invalid" ; then
2279                 { echo "configure: error: bad value $enableval for --enable-null" 1>&2; exit 1; }
2280         fi
2281         ol_enable_null="$ol_arg"
2282
2283 else
2284         ol_enable_null="no"
2285 fi
2286 # end --enable-null
2287 # OpenLDAP --with-null_module
2288         # Check whether --with-null_module or --without-null_module was given.
2289 if test "${with_null_module+set}" = set; then
2290   withval="$with_null_module"
2291   
2292         ol_arg=invalid
2293         for ol_val in static dynamic ; do
2294                 if test "$withval" = "$ol_val" ; then
2295                         ol_arg="$ol_val"
2296                 fi
2297         done
2298         if test "$ol_arg" = "invalid" ; then
2299                 { echo "configure: error: bad value $withval for --with-null_module" 1>&2; exit 1; }
2300         fi
2301         ol_with_null_module="$ol_arg"
2302
2303 else
2304         ol_with_null_module="static"
2305 fi
2306 # end --with-null_module
2307
2308 # OpenLDAP --enable-passwd
2309         # Check whether --enable-passwd or --disable-passwd was given.
2310 if test "${enable_passwd+set}" = set; then
2311   enableval="$enable_passwd"
2312   
2313         ol_arg=invalid
2314         for ol_val in auto yes no ; do
2315                 if test "$enableval" = "$ol_val" ; then
2316                         ol_arg="$ol_val"
2317                 fi
2318         done
2319         if test "$ol_arg" = "invalid" ; then
2320                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
2321         fi
2322         ol_enable_passwd="$ol_arg"
2323
2324 else
2325         ol_enable_passwd="no"
2326 fi
2327 # end --enable-passwd
2328 # OpenLDAP --with-passwd_module
2329         # Check whether --with-passwd_module or --without-passwd_module was given.
2330 if test "${with_passwd_module+set}" = set; then
2331   withval="$with_passwd_module"
2332   
2333         ol_arg=invalid
2334         for ol_val in static dynamic ; do
2335                 if test "$withval" = "$ol_val" ; then
2336                         ol_arg="$ol_val"
2337                 fi
2338         done
2339         if test "$ol_arg" = "invalid" ; then
2340                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
2341         fi
2342         ol_with_passwd_module="$ol_arg"
2343
2344 else
2345         ol_with_passwd_module="static"
2346 fi
2347 # end --with-passwd_module
2348
2349 # OpenLDAP --enable-perl
2350         # Check whether --enable-perl or --disable-perl was given.
2351 if test "${enable_perl+set}" = set; then
2352   enableval="$enable_perl"
2353   
2354         ol_arg=invalid
2355         for ol_val in auto yes no ; do
2356                 if test "$enableval" = "$ol_val" ; then
2357                         ol_arg="$ol_val"
2358                 fi
2359         done
2360         if test "$ol_arg" = "invalid" ; then
2361                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
2362         fi
2363         ol_enable_perl="$ol_arg"
2364
2365 else
2366         ol_enable_perl="no"
2367 fi
2368 # end --enable-perl
2369 # OpenLDAP --with-perl_module
2370         # Check whether --with-perl_module or --without-perl_module was given.
2371 if test "${with_perl_module+set}" = set; then
2372   withval="$with_perl_module"
2373   
2374         ol_arg=invalid
2375         for ol_val in static dynamic ; do
2376                 if test "$withval" = "$ol_val" ; then
2377                         ol_arg="$ol_val"
2378                 fi
2379         done
2380         if test "$ol_arg" = "invalid" ; then
2381                 { echo "configure: error: bad value $withval for --with-perl_module" 1>&2; exit 1; }
2382         fi
2383         ol_with_perl_module="$ol_arg"
2384
2385 else
2386         ol_with_perl_module="static"
2387 fi
2388 # end --with-perl_module
2389
2390 # OpenLDAP --enable-shell
2391         # Check whether --enable-shell or --disable-shell was given.
2392 if test "${enable_shell+set}" = set; then
2393   enableval="$enable_shell"
2394   
2395         ol_arg=invalid
2396         for ol_val in auto yes no ; do
2397                 if test "$enableval" = "$ol_val" ; then
2398                         ol_arg="$ol_val"
2399                 fi
2400         done
2401         if test "$ol_arg" = "invalid" ; then
2402                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
2403         fi
2404         ol_enable_shell="$ol_arg"
2405
2406 else
2407         ol_enable_shell="no"
2408 fi
2409 # end --enable-shell
2410 # OpenLDAP --with-shell_module
2411         # Check whether --with-shell_module or --without-shell_module was given.
2412 if test "${with_shell_module+set}" = set; then
2413   withval="$with_shell_module"
2414   
2415         ol_arg=invalid
2416         for ol_val in static dynamic ; do
2417                 if test "$withval" = "$ol_val" ; then
2418                         ol_arg="$ol_val"
2419                 fi
2420         done
2421         if test "$ol_arg" = "invalid" ; then
2422                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
2423         fi
2424         ol_with_shell_module="$ol_arg"
2425
2426 else
2427         ol_with_shell_module="static"
2428 fi
2429 # end --with-shell_module
2430
2431 # OpenLDAP --enable-sql
2432         # Check whether --enable-sql or --disable-sql was given.
2433 if test "${enable_sql+set}" = set; then
2434   enableval="$enable_sql"
2435   
2436         ol_arg=invalid
2437         for ol_val in auto yes no ; do
2438                 if test "$enableval" = "$ol_val" ; then
2439                         ol_arg="$ol_val"
2440                 fi
2441         done
2442         if test "$ol_arg" = "invalid" ; then
2443                 { echo "configure: error: bad value $enableval for --enable-sql" 1>&2; exit 1; }
2444         fi
2445         ol_enable_sql="$ol_arg"
2446
2447 else
2448         ol_enable_sql="no"
2449 fi
2450 # end --enable-sql
2451 # OpenLDAP --with-sql_module
2452         # Check whether --with-sql_module or --without-sql_module was given.
2453 if test "${with_sql_module+set}" = set; then
2454   withval="$with_sql_module"
2455   
2456         ol_arg=invalid
2457         for ol_val in static dynamic ; do
2458                 if test "$withval" = "$ol_val" ; then
2459                         ol_arg="$ol_val"
2460                 fi
2461         done
2462         if test "$ol_arg" = "invalid" ; then
2463                 { echo "configure: error: bad value $withval for --with-sql_module" 1>&2; exit 1; }
2464         fi
2465         ol_with_sql_module="$ol_arg"
2466
2467 else
2468         ol_with_sql_module="static"
2469 fi
2470 # end --with-sql_module
2471
2472 # OpenLDAP --enable-tcl
2473         # Check whether --enable-tcl or --disable-tcl was given.
2474 if test "${enable_tcl+set}" = set; then
2475   enableval="$enable_tcl"
2476   
2477         ol_arg=invalid
2478         for ol_val in auto yes no ; do
2479                 if test "$enableval" = "$ol_val" ; then
2480                         ol_arg="$ol_val"
2481                 fi
2482         done
2483         if test "$ol_arg" = "invalid" ; then
2484                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
2485         fi
2486         ol_enable_tcl="$ol_arg"
2487
2488 else
2489         ol_enable_tcl="no"
2490 fi
2491 # end --enable-tcl
2492 # OpenLDAP --with-tcl_module
2493         # Check whether --with-tcl_module or --without-tcl_module was given.
2494 if test "${with_tcl_module+set}" = set; then
2495   withval="$with_tcl_module"
2496   
2497         ol_arg=invalid
2498         for ol_val in static dynamic ; do
2499                 if test "$withval" = "$ol_val" ; then
2500                         ol_arg="$ol_val"
2501                 fi
2502         done
2503         if test "$ol_arg" = "invalid" ; then
2504                 { echo "configure: error: bad value $withval for --with-tcl_module" 1>&2; exit 1; }
2505         fi
2506         ol_with_tcl_module="$ol_arg"
2507
2508 else
2509         ol_with_tcl_module="static"
2510 fi
2511 # end --with-tcl_module
2512
2513
2514 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2515 if test "${with_xxslurpdoptions+set}" = set; then
2516   withval="$with_xxslurpdoptions"
2517   :
2518 fi
2519
2520 # OpenLDAP --enable-slurpd
2521         # Check whether --enable-slurpd or --disable-slurpd was given.
2522 if test "${enable_slurpd+set}" = set; then
2523   enableval="$enable_slurpd"
2524   
2525         ol_arg=invalid
2526         for ol_val in auto yes no ; do
2527                 if test "$enableval" = "$ol_val" ; then
2528                         ol_arg="$ol_val"
2529                 fi
2530         done
2531         if test "$ol_arg" = "invalid" ; then
2532                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2533         fi
2534         ol_enable_slurpd="$ol_arg"
2535
2536 else
2537         ol_enable_slurpd="auto"
2538 fi
2539 # end --enable-slurpd
2540
2541 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2542 if test "${with_xxliboptions+set}" = set; then
2543   withval="$with_xxliboptions"
2544   :
2545 fi
2546
2547 # Check whether --enable-static or --disable-static was given.
2548 if test "${enable_static+set}" = set; then
2549   enableval="$enable_static"
2550   p=${PACKAGE-default}
2551 case $enableval in
2552 yes) enable_static=yes ;;
2553 no) enable_static=no ;;
2554 *)
2555   enable_static=no
2556   # Look at the argument we got.  We use all the common list separators.
2557   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2558   for pkg in $enableval; do
2559     if test "X$pkg" = "X$p"; then
2560       enable_static=yes
2561     fi
2562   done
2563   IFS="$ac_save_ifs"
2564   ;;
2565 esac
2566 else
2567   enable_static=yes
2568 fi
2569
2570 # Check whether --enable-shared or --disable-shared was given.
2571 if test "${enable_shared+set}" = set; then
2572   enableval="$enable_shared"
2573   p=${PACKAGE-default}
2574 case $enableval in
2575 yes) enable_shared=yes ;;
2576 no) enable_shared=no ;;
2577 *)
2578   enable_shared=no
2579   # Look at the argument we got.  We use all the common list separators.
2580   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2581   for pkg in $enableval; do
2582     if test "X$pkg" = "X$p"; then
2583       enable_shared=yes
2584     fi
2585   done
2586   IFS="$ac_save_ifs"
2587   ;;
2588 esac
2589 else
2590   enable_shared=yes
2591 fi
2592
2593
2594
2595 # validate options
2596 if test $ol_enable_slapd = no ; then
2597                 if test $ol_enable_slapi = yes ; then
2598                 echo "configure: warning: slapd disabled, ignoring --enable-slapi argument" 1>&2
2599         fi
2600         if test $ol_enable_bdb = yes ; then
2601                 echo "configure: warning: slapd disabled, ignoring --enable-bdb argument" 1>&2
2602         fi
2603         if test $ol_enable_dnssrv = yes ; then
2604                 echo "configure: warning: slapd disabled, ignoring --enable-dnssrv argument" 1>&2
2605         fi
2606         if test $ol_enable_ldap = yes ; then
2607                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2608         fi
2609         if test $ol_enable_ldbm = yes ; then
2610                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2611         fi
2612         if test $ol_enable_meta = yes ; then
2613                 echo "configure: warning: slapd disabled, ignoring --enable-meta argument" 1>&2
2614         fi
2615         if test $ol_enable_monitor = yes ; then
2616                 echo "configure: warning: slapd disabled, ignoring --enable-monitor argument" 1>&2
2617         fi
2618         if test $ol_enable_null = yes ; then
2619                 echo "configure: warning: slapd disabled, ignoring --enable-null argument" 1>&2
2620         fi
2621         if test $ol_enable_passwd = yes ; then
2622                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2623         fi
2624         if test $ol_enable_perl = yes ; then
2625                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
2626         fi
2627         if test $ol_enable_shell = yes ; then
2628                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2629         fi
2630         if test $ol_enable_tcl = yes ; then
2631                 echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
2632         fi
2633         if test $ol_enable_sql = yes ; then
2634                 echo "configure: warning: slapd disabled, ignoring --enable-sql argument" 1>&2
2635         fi
2636         if test $ol_enable_modules = yes ; then
2637                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2638         fi
2639         if test $ol_enable_multimaster = yes ; then
2640                 echo "configure: warning: slapd disabled, ignoring --enable-multimaster argument" 1>&2
2641         fi
2642         if test $ol_enable_wrappers = yes ; then
2643                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2644         fi
2645         if test $ol_enable_phonetic = yes ; then
2646                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2647         fi
2648         if test $ol_enable_rlookups = yes ; then
2649                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2650         fi
2651         if test $ol_enable_aci = yes ; then
2652                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2653         fi
2654         if test $ol_with_ldbm_api != auto ; then
2655                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2656         fi
2657         if test $ol_with_ldbm_type != auto ; then
2658                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2659         fi
2660         if test $ol_with_bdb_module != static ; then
2661                 echo "configure: warning: slapd disabled, ignoring --with-bdb-module argument" 1>&2
2662         fi
2663         if test $ol_with_dnssrv_module != static ; then
2664                 echo "configure: warning: slapd disabled, ignoring --with-dnssrv-module argument" 1>&2
2665         fi
2666         if test $ol_with_ldap_module != static ; then
2667                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2668         fi
2669         if test $ol_with_ldbm_module != static ; then
2670                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2671         fi
2672         if test $ol_with_meta_module != static ; then
2673                 echo "configure: warning: slapd disabled, ignoring --with-meta-module argument" 1>&2
2674         fi
2675         if test $ol_with_monitor_module != static ; then
2676                 echo "configure: warning: slapd disabled, ignoring --with-monitor-module argument" 1>&2
2677         fi
2678         if test $ol_with_null_module != static ; then
2679                 echo "configure: warning: slapd disabled, ignoring --with-null-module argument" 1>&2
2680         fi
2681         if test $ol_with_passwd_module != static ; then
2682                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2683         fi
2684         if test $ol_with_perl_module != static ; then
2685                 echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2
2686         fi
2687         if test $ol_with_shell_module != static ; then
2688                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2689         fi
2690         if test $ol_with_tcl_module != static ; then
2691                 echo "configure: warning: slapd disabled, ignoring --with-tcl-module argument" 1>&2
2692         fi
2693         if test $ol_with_sql_module != static ; then
2694                 echo "configure: warning: slapd disabled, ignoring --with-sql-module argument" 1>&2
2695         fi
2696         if test $ol_enable_slurpd = yes ; then
2697                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2698         fi
2699         if test $ol_enable_rewrite = yes ; then
2700                 echo "configure: warning: slapd disabled, ignoring --enable-rewrite argument" 1>&2
2701         fi
2702
2703         # force settings to no
2704         ol_enable_slapi=no
2705         ol_enable_bdb=no
2706         ol_enable_dnssrv=no
2707         ol_enable_ldap=no
2708         ol_enable_ldbm=no
2709         ol_enable_meta=no
2710         ol_enable_monitor=no
2711         ol_enable_null=no
2712         ol_enable_passwd=no
2713         ol_enable_perl=no
2714         ol_enable_shell=no
2715         ol_enable_tcl=no
2716         ol_enable_sql=no
2717
2718         ol_enable_modules=no
2719         ol_enable_multimaster=no
2720         ol_enable_phonetic=no
2721         ol_enable_rlookups=no
2722         ol_enable_aci=no
2723         ol_enable_wrappers=no
2724         ol_enable_dynamic=no
2725
2726         ol_with_ldbm_api=no
2727         ol_with_ldbm_type=no
2728
2729         ol_with_bdb_module=static
2730         ol_with_dnssrv_module=static
2731         ol_with_ldap_module=static
2732         ol_with_ldbm_module=static
2733         ol_with_meta_module=static
2734         ol_with_monitor_module=static
2735         ol_with_null_module=static
2736         ol_with_passwd_module=static
2737         ol_with_perl_module=static
2738         ol_with_shell_module=static
2739         ol_with_tcl_module=static
2740         ol_with_sql_module=static
2741
2742         ol_enable_slurpd=no
2743
2744         ol_enable_rewrite=no
2745
2746 elif test $ol_enable_ldbm = no ; then
2747         
2748         if test $ol_with_ldbm_api != auto ; then
2749                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2750         fi
2751
2752         if test $ol_with_ldbm_type != auto ; then
2753                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2754         fi
2755
2756         if test $ol_with_ldbm_module != static ; then
2757                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2758         fi
2759
2760         if test $ol_enable_modules != yes -a \
2761                 $ol_enable_bdb = no -a \
2762                 $ol_enable_dnssrv = no -a \
2763                 $ol_enable_ldap = no -a \
2764                 $ol_enable_meta = no -a \
2765                 $ol_enable_monitor = no -a \
2766                 $ol_enable_null = no -a \
2767                 $ol_enable_passwd = no -a \
2768                 $ol_enable_perl = no -a \
2769                 $ol_enable_shell = no -a \
2770                 $ol_enable_sql = no -a \
2771                 $ol_enable_tcl = no ; then
2772
2773                 if test $ol_enable_slapd = yes ; then
2774                         { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2775                 else
2776                         echo "configure: warning: skipping slapd, no backend specified" 1>&2
2777                         ol_enable_slapd=no
2778                 fi
2779         fi
2780
2781         ol_with_ldbm_api=no
2782         ol_with_ldbm_type=no
2783         ol_with_ldbm_module=static
2784
2785         if test $ol_enable_bdb != no ; then
2786                 ol_with_ldbm_api=berkeley
2787         fi
2788
2789 else
2790                 if test $ol_with_ldbm_api = gdbm -a \
2791                 $ol_with_ldbm_type = btree ; then
2792                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2793         fi
2794         if test $ol_with_ldbm_api = mdbm -a \
2795                 $ol_with_ldbm_type = btree ; then
2796                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2797         fi
2798         if test $ol_with_ldbm_api = ndbm -a \
2799                 $ol_with_ldbm_type = btree ; then
2800                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2801         fi
2802
2803         if test $ol_enable_bdb = yes ; then
2804                 if test $ol_with_ldbm_api = auto ; then
2805                         ol_with_ldbm_api=berkeley
2806                 elif test $ol_with_ldbm_api != berkeley ; then
2807                         { echo "configure: error: LDBM API not compatible with BDB" 1>&2; exit 1; }
2808                 fi
2809
2810         elif test $ol_enable_bdb = auto ; then
2811                 if test $ol_with_ldbm_api != berkeley \
2812                         -o $ol_with_ldbm_api != auto ; then
2813                         echo "configure: warning: LDBM API not compatible with BDB, disabling BDB" 1>&2
2814                         ol_enable_bdb=no
2815                 fi
2816         fi
2817 fi
2818
2819 if test $ol_enable_slurpd = yes ; then
2820                 if test $ol_with_threads = no ; then
2821                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2822         fi
2823 fi
2824
2825 if test $ol_enable_lmpasswd = yes ; then
2826         if test $ol_with_tls = no ; then
2827                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
2828         fi
2829 fi
2830
2831 if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
2832         if test $ol_with_kerberos = no ; then
2833                 { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
2834         elif test $ol_with_kerberos = auto ; then
2835                 ol_with_kerberos=yes
2836         fi
2837
2838 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
2839         if test $ol_with_kerberos = auto ; then
2840                 ol_with_kerberos=no
2841         elif test $ol_with_kerberos != no ; then
2842                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2843                 ol_with_kerberos=no
2844         fi
2845 fi
2846
2847 if test $ol_enable_spasswd = yes ; then
2848         if test $ol_with_cyrus_sasl = no ; then
2849                 { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
2850         fi
2851         ol_with_cyrus_sasl=yes
2852 fi
2853
2854 echo "$ac_t""done" 1>&6
2855
2856 LDAP_LIBS=
2857 LDIF_LIBS=
2858 LDBM_LIBS=
2859 LTHREAD_LIBS=
2860 LUTIL_LIBS=
2861
2862 SLAPD_LIBS=
2863 SLURPD_LIBS=
2864
2865 BUILD_SLAPD=no
2866 BUILD_SLURPD=no
2867
2868 BUILD_THREAD=no
2869
2870 BUILD_SLAPI=no
2871 SLAPD_SLAPI_DEPEND=
2872
2873 BUILD_BDB=no
2874 BUILD_DNSSRV=no
2875 BUILD_LDAP=no
2876 BUILD_LDBM=no
2877 BUILD_META=no
2878 BUILD_MONITOR=no
2879 BUILD_NULL=no
2880 BUILD_PASSWD=no
2881 BUILD_PERL=no
2882 BUILD_SHELL=no
2883 BUILD_SQL=no
2884 BUILD_TCL=no
2885
2886 BUILD_BDB_DYNAMIC=static
2887 BUILD_DNSSRV_DYNAMIC=static
2888 BUILD_LDAP_DYNAMIC=static
2889 BUILD_LDBM_DYNAMIC=static
2890 BUILD_META_DYNAMIC=static
2891 BUILD_MONITOR_DYNAMIC=static
2892 BUILD_NULL_DYNAMIC=static
2893 BUILD_PASSWD_DYNAMIC=static
2894 BUILD_PERL_DYNAMIC=static
2895 BUILD_SHELL_DYNAMIC=static
2896 BUILD_TCL_DYNAMIC=static
2897 BUILD_SQL_DYNAMIC=static
2898
2899 SLAPD_MODULES_LDFLAGS=
2900 SLAPD_MODULES_CPPFLAGS=
2901
2902 SLAPD_STATIC_BACKENDS=
2903 SLAPD_DYNAMIC_BACKENDS=
2904
2905 SLAPD_PERL_LDFLAGS=
2906 MOD_PERL_LDFLAGS=
2907 PERL_CPPFLAGS=
2908
2909 SLAPD_SQL_LDFLAGS=
2910 SLAPD_SQL_LIBS=
2911 SLAPD_SQL_INCLUDES=
2912
2913 MOD_TCL_LIB=
2914 KRB4_LIBS=
2915 KRB5_LIBS=
2916 READLINE_LIBS=
2917 SASL_LIBS=
2918 TERMCAP_LIBS=
2919 TLS_LIBS=
2920 MODULES_LIBS=
2921 SLAPI_LIBS=
2922 LIBSLAPI=
2923 LIBSLAPITOOLS=
2924 AUTH_LIBS=
2925
2926 SLAPD_SLP_LIBS=
2927
2928
2929 # Find a good install program.  We prefer a C program (faster),
2930 # so one script is as good as another.  But avoid the broken or
2931 # incompatible versions:
2932 # SysV /etc/install, /usr/sbin/install
2933 # SunOS /usr/etc/install
2934 # IRIX /sbin/install
2935 # AIX /bin/install
2936 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2937 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2938 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2939 # ./install, which can be erroneously created by make from ./install.sh.
2940 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
2941 echo "configure:2942: checking for a BSD compatible install" >&5
2942 if test -z "$INSTALL"; then
2943 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
2944   echo $ac_n "(cached) $ac_c" 1>&6
2945 else
2946     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
2947   for ac_dir in $PATH; do
2948     # Account for people who put trailing slashes in PATH elements.
2949     case "$ac_dir/" in
2950     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
2951     *)
2952       # OSF1 and SCO ODT 3.0 have their own names for install.
2953       # Don't use installbsd from OSF since it installs stuff as root
2954       # by default.
2955       for ac_prog in ginstall scoinst install; do
2956         if test -f $ac_dir/$ac_prog; then
2957           if test $ac_prog = install &&
2958             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
2959             # AIX install.  It has an incompatible calling convention.
2960             :
2961           elif test $ac_prog = install &&
2962             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
2963             # program-specific install script used by HP pwplus--don't use.
2964             :
2965           else
2966             ac_cv_path_install="$ac_dir/$ac_prog -c"
2967             break 2
2968           fi
2969         fi
2970       done
2971       ;;
2972     esac
2973   done
2974   IFS="$ac_save_IFS"
2975
2976 fi
2977   if test "${ac_cv_path_install+set}" = set; then
2978     INSTALL="$ac_cv_path_install"
2979   else
2980     # As a last resort, use the slow shell script.  We don't cache a
2981     # path for INSTALL within a source directory, because that will
2982     # break other packages using the cache if that directory is
2983     # removed, or if the path is relative.
2984     INSTALL="$ac_install_sh"
2985   fi
2986 fi
2987 echo "$ac_t""$INSTALL" 1>&6
2988
2989 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2990 # It thinks the first close brace ends the variable substitution.
2991 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2992
2993 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2994
2995 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2996
2997
2998 cat >> confdefs.h <<\EOF
2999 #define HAVE_MKVERSION 1
3000 EOF
3001
3002
3003
3004
3005 ol_aix_threads=no
3006 case "$target" in
3007 *-*-aix*)       if test -z "$CC" ; then
3008                 case "$ol_with_threads" in
3009                 auto | yes |  posix) ol_aix_threads=yes ;;
3010                 esac
3011         fi
3012 ;;
3013 esac
3014
3015 if test $ol_aix_threads = yes ; then
3016         if test -z "${CC}" ; then
3017                 for ac_prog in cc_r xlc_r cc
3018 do
3019 # Extract the first word of "$ac_prog", so it can be a program name with args.
3020 set dummy $ac_prog; ac_word=$2
3021 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3022 echo "configure:3023: checking for $ac_word" >&5
3023 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3024   echo $ac_n "(cached) $ac_c" 1>&6
3025 else
3026   if test -n "$CC"; then
3027   ac_cv_prog_CC="$CC" # Let the user override the test.
3028 else
3029   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3030   ac_dummy="$PATH"
3031   for ac_dir in $ac_dummy; do
3032     test -z "$ac_dir" && ac_dir=.
3033     if test -f $ac_dir/$ac_word; then
3034       ac_cv_prog_CC="$ac_prog"
3035       break
3036     fi
3037   done
3038   IFS="$ac_save_ifs"
3039 fi
3040 fi
3041 CC="$ac_cv_prog_CC"
3042 if test -n "$CC"; then
3043   echo "$ac_t""$CC" 1>&6
3044 else
3045   echo "$ac_t""no" 1>&6
3046 fi
3047
3048 test -n "$CC" && break
3049 done
3050
3051
3052                 if test "$CC" = cc ; then
3053                                                 if test $ol_with_threads != auto ; then
3054                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
3055                         else
3056                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
3057                         fi
3058                         ol_with_threads=no
3059                 fi
3060         fi
3061
3062         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
3063                 ol_with_threads=posix
3064                 ol_cv_pthread_create=yes
3065         fi
3066 fi
3067
3068 if test -z "${CC}"; then
3069         for ac_prog in cc gcc
3070 do
3071 # Extract the first word of "$ac_prog", so it can be a program name with args.
3072 set dummy $ac_prog; ac_word=$2
3073 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3074 echo "configure:3075: checking for $ac_word" >&5
3075 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3076   echo $ac_n "(cached) $ac_c" 1>&6
3077 else
3078   if test -n "$CC"; then
3079   ac_cv_prog_CC="$CC" # Let the user override the test.
3080 else
3081   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3082   ac_dummy="$PATH"
3083   for ac_dir in $ac_dummy; do
3084     test -z "$ac_dir" && ac_dir=.
3085     if test -f $ac_dir/$ac_word; then
3086       ac_cv_prog_CC="$ac_prog"
3087       break
3088     fi
3089   done
3090   IFS="$ac_save_ifs"
3091 fi
3092 fi
3093 CC="$ac_cv_prog_CC"
3094 if test -n "$CC"; then
3095   echo "$ac_t""$CC" 1>&6
3096 else
3097   echo "$ac_t""no" 1>&6
3098 fi
3099
3100 test -n "$CC" && break
3101 done
3102 test -n "$CC" || CC="missing"
3103
3104
3105         if test "${CC}" = "missing" ; then
3106                 { echo "configure: error: Unable to locate cc(1) or suitable replacement.  Check PATH or set CC." 1>&2; exit 1; }
3107         fi
3108 fi
3109
3110 if test -z "${AR}"; then
3111         for ac_prog in ar gar
3112 do
3113 # Extract the first word of "$ac_prog", so it can be a program name with args.
3114 set dummy $ac_prog; ac_word=$2
3115 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3116 echo "configure:3117: checking for $ac_word" >&5
3117 if eval "test \"\${ac_cv_prog_AR+set}\" = set"; then
3118   echo $ac_n "(cached) $ac_c" 1>&6
3119 else
3120   if test -n "$AR"; then
3121   ac_cv_prog_AR="$AR" # Let the user override the test.
3122 else
3123   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3124   ac_dummy="$PATH"
3125   for ac_dir in $ac_dummy; do
3126     test -z "$ac_dir" && ac_dir=.
3127     if test -f $ac_dir/$ac_word; then
3128       ac_cv_prog_AR="$ac_prog"
3129       break
3130     fi
3131   done
3132   IFS="$ac_save_ifs"
3133 fi
3134 fi
3135 AR="$ac_cv_prog_AR"
3136 if test -n "$AR"; then
3137   echo "$ac_t""$AR" 1>&6
3138 else
3139   echo "$ac_t""no" 1>&6
3140 fi
3141
3142 test -n "$AR" && break
3143 done
3144 test -n "$AR" || AR="missing"
3145
3146
3147         if test "${AR}" = "missing" ; then
3148                 { echo "configure: error: Unable to locate ar(1) or suitable replacement.  Check PATH or set AR." 1>&2; exit 1; }
3149         fi
3150 fi
3151
3152
3153
3154 # Find the correct PATH separator.  Usually this is `:', but
3155 # DJGPP uses `;' like DOS.
3156 if test "X${PATH_SEPARATOR+set}" != Xset; then
3157   UNAME=${UNAME-`uname 2>/dev/null`}
3158   case X$UNAME in
3159     *-DOS) lt_cv_sys_path_separator=';' ;;
3160     *)     lt_cv_sys_path_separator=':' ;;
3161   esac
3162   PATH_SEPARATOR=$lt_cv_sys_path_separator
3163 fi
3164
3165 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3166 echo "configure:3167: checking for Cygwin environment" >&5
3167 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
3168   echo $ac_n "(cached) $ac_c" 1>&6
3169 else
3170   cat > conftest.$ac_ext <<EOF
3171 #line 3172 "configure"
3172 #include "confdefs.h"
3173
3174 int main() {
3175
3176 #ifndef __CYGWIN__
3177 #define __CYGWIN__ __CYGWIN32__
3178 #endif
3179 return __CYGWIN__;
3180 ; return 0; }
3181 EOF
3182 if { (eval echo configure:3183: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3183   rm -rf conftest*
3184   ac_cv_cygwin=yes
3185 else
3186   echo "configure: failed program was:" >&5
3187   cat conftest.$ac_ext >&5
3188   rm -rf conftest*
3189   ac_cv_cygwin=no
3190 fi
3191 rm -f conftest*
3192 fi
3193
3194 echo "$ac_t""$ac_cv_cygwin" 1>&6
3195 CYGWIN=
3196 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3197 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3198 echo "configure:3199: checking for mingw32 environment" >&5
3199 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
3200   echo $ac_n "(cached) $ac_c" 1>&6
3201 else
3202   cat > conftest.$ac_ext <<EOF
3203 #line 3204 "configure"
3204 #include "confdefs.h"
3205
3206 int main() {
3207 return __MINGW32__;
3208 ; return 0; }
3209 EOF
3210 if { (eval echo configure:3211: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3211   rm -rf conftest*
3212   ac_cv_mingw32=yes
3213 else
3214   echo "configure: failed program was:" >&5
3215   cat conftest.$ac_ext >&5
3216   rm -rf conftest*
3217   ac_cv_mingw32=no
3218 fi
3219 rm -f conftest*
3220 fi
3221
3222 echo "$ac_t""$ac_cv_mingw32" 1>&6
3223 MINGW32=
3224 test "$ac_cv_mingw32" = yes && MINGW32=yes
3225 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
3226 echo "configure:3227: checking for EMX OS/2 environment" >&5
3227 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
3228   echo $ac_n "(cached) $ac_c" 1>&6
3229 else
3230   cat > conftest.$ac_ext <<EOF
3231 #line 3232 "configure"
3232 #include "confdefs.h"
3233
3234 int main() {
3235 return __EMX__;
3236 ; return 0; }
3237 EOF
3238 if { (eval echo configure:3239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3239   rm -rf conftest*
3240   ac_cv_emxos2=yes
3241 else
3242   echo "configure: failed program was:" >&5
3243   cat conftest.$ac_ext >&5
3244   rm -rf conftest*
3245   ac_cv_emxos2=no
3246 fi
3247 rm -f conftest*
3248 fi
3249
3250 echo "$ac_t""$ac_cv_emxos2" 1>&6
3251 EMXOS2=
3252 test "$ac_cv_emxos2" = yes && EMXOS2=yes
3253 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3254 echo "configure:3255: checking how to run the C preprocessor" >&5
3255 # On Suns, sometimes $CPP names a directory.
3256 if test -n "$CPP" && test -d "$CPP"; then
3257   CPP=
3258 fi
3259 if test -z "$CPP"; then
3260 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3261   echo $ac_n "(cached) $ac_c" 1>&6
3262 else
3263     # This must be in double quotes, not single quotes, because CPP may get
3264   # substituted into the Makefile and "${CC-cc}" will confuse make.
3265   CPP="${CC-cc} -E"
3266   # On the NeXT, cc -E runs the code through the compiler's parser,
3267   # not just through cpp.
3268   cat > conftest.$ac_ext <<EOF
3269 #line 3270 "configure"
3270 #include "confdefs.h"
3271 #include <assert.h>
3272 Syntax Error
3273 EOF
3274 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3275 { (eval echo configure:3276: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3276 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3277 if test -z "$ac_err"; then
3278   :
3279 else
3280   echo "$ac_err" >&5
3281   echo "configure: failed program was:" >&5
3282   cat conftest.$ac_ext >&5
3283   rm -rf conftest*
3284   CPP="${CC-cc} -E -traditional-cpp"
3285   cat > conftest.$ac_ext <<EOF
3286 #line 3287 "configure"
3287 #include "confdefs.h"
3288 #include <assert.h>
3289 Syntax Error
3290 EOF
3291 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3292 { (eval echo configure:3293: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3293 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3294 if test -z "$ac_err"; then
3295   :
3296 else
3297   echo "$ac_err" >&5
3298   echo "configure: failed program was:" >&5
3299   cat conftest.$ac_ext >&5
3300   rm -rf conftest*
3301   CPP="${CC-cc} -nologo -E"
3302   cat > conftest.$ac_ext <<EOF
3303 #line 3304 "configure"
3304 #include "confdefs.h"
3305 #include <assert.h>
3306 Syntax Error
3307 EOF
3308 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3309 { (eval echo configure:3310: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3310 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3311 if test -z "$ac_err"; then
3312   :
3313 else
3314   echo "$ac_err" >&5
3315   echo "configure: failed program was:" >&5
3316   cat conftest.$ac_ext >&5
3317   rm -rf conftest*
3318   CPP=/lib/cpp
3319 fi
3320 rm -f conftest*
3321 fi
3322 rm -f conftest*
3323 fi
3324 rm -f conftest*
3325   ac_cv_prog_CPP="$CPP"
3326 fi
3327   CPP="$ac_cv_prog_CPP"
3328 else
3329   ac_cv_prog_CPP="$CPP"
3330 fi
3331 echo "$ac_t""$CPP" 1>&6
3332
3333 # Check whether --enable-fast-install or --disable-fast-install was given.
3334 if test "${enable_fast_install+set}" = set; then
3335   enableval="$enable_fast_install"
3336   p=${PACKAGE-default}
3337 case $enableval in
3338 yes) enable_fast_install=yes ;;
3339 no) enable_fast_install=no ;;
3340 *)
3341   enable_fast_install=no
3342   # Look at the argument we got.  We use all the common list separators.
3343   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3344   for pkg in $enableval; do
3345     if test "X$pkg" = "X$p"; then
3346       enable_fast_install=yes
3347     fi
3348   done
3349   IFS="$ac_save_ifs"
3350   ;;
3351 esac
3352 else
3353   enable_fast_install=yes
3354 fi
3355
3356 # Extract the first word of "gcc", so it can be a program name with args.
3357 set dummy gcc; ac_word=$2
3358 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3359 echo "configure:3360: checking for $ac_word" >&5
3360 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3361   echo $ac_n "(cached) $ac_c" 1>&6
3362 else
3363   if test -n "$CC"; then
3364   ac_cv_prog_CC="$CC" # Let the user override the test.
3365 else
3366   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3367   ac_dummy="$PATH"
3368   for ac_dir in $ac_dummy; do
3369     test -z "$ac_dir" && ac_dir=.
3370     if test -f $ac_dir/$ac_word; then
3371       ac_cv_prog_CC="gcc"
3372       break
3373     fi
3374   done
3375   IFS="$ac_save_ifs"
3376 fi
3377 fi
3378 CC="$ac_cv_prog_CC"
3379 if test -n "$CC"; then
3380   echo "$ac_t""$CC" 1>&6
3381 else
3382   echo "$ac_t""no" 1>&6
3383 fi
3384
3385 if test -z "$CC"; then
3386   # Extract the first word of "cc", so it can be a program name with args.
3387 set dummy cc; ac_word=$2
3388 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3389 echo "configure:3390: checking for $ac_word" >&5
3390 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3391   echo $ac_n "(cached) $ac_c" 1>&6
3392 else
3393   if test -n "$CC"; then
3394   ac_cv_prog_CC="$CC" # Let the user override the test.
3395 else
3396   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3397   ac_prog_rejected=no
3398   ac_dummy="$PATH"
3399   for ac_dir in $ac_dummy; do
3400     test -z "$ac_dir" && ac_dir=.
3401     if test -f $ac_dir/$ac_word; then
3402       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
3403         ac_prog_rejected=yes
3404         continue
3405       fi
3406       ac_cv_prog_CC="cc"
3407       break
3408     fi
3409   done
3410   IFS="$ac_save_ifs"
3411 if test $ac_prog_rejected = yes; then
3412   # We found a bogon in the path, so make sure we never use it.
3413   set dummy $ac_cv_prog_CC
3414   shift
3415   if test $# -gt 0; then
3416     # We chose a different compiler from the bogus one.
3417     # However, it has the same basename, so the bogon will be chosen
3418     # first if we set CC to just the basename; use the full file name.
3419     shift
3420     set dummy "$ac_dir/$ac_word" "$@"
3421     shift
3422     ac_cv_prog_CC="$@"
3423   fi
3424 fi
3425 fi
3426 fi
3427 CC="$ac_cv_prog_CC"
3428 if test -n "$CC"; then
3429   echo "$ac_t""$CC" 1>&6
3430 else
3431   echo "$ac_t""no" 1>&6
3432 fi
3433
3434   if test -z "$CC"; then
3435     case "`uname -s`" in
3436     *win32* | *WIN32* | *CYGWIN*)
3437       # Extract the first word of "cl", so it can be a program name with args.
3438 set dummy cl; ac_word=$2
3439 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3440 echo "configure:3441: checking for $ac_word" >&5
3441 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3442   echo $ac_n "(cached) $ac_c" 1>&6
3443 else
3444   if test -n "$CC"; then
3445   ac_cv_prog_CC="$CC" # Let the user override the test.
3446 else
3447   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3448   ac_dummy="$PATH"
3449   for ac_dir in $ac_dummy; do
3450     test -z "$ac_dir" && ac_dir=.
3451     if test -f $ac_dir/$ac_word; then
3452       ac_cv_prog_CC="cl"
3453       break
3454     fi
3455   done
3456   IFS="$ac_save_ifs"
3457 fi
3458 fi
3459 CC="$ac_cv_prog_CC"
3460 if test -n "$CC"; then
3461   echo "$ac_t""$CC" 1>&6
3462 else
3463   echo "$ac_t""no" 1>&6
3464 fi
3465  ;;
3466     esac
3467   fi
3468   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
3469 fi
3470
3471 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
3472 echo "configure:3473: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
3473
3474 ac_ext=c
3475 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3476 ac_cpp='$CPP $CPPFLAGS'
3477 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3478 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3479 cross_compiling=$ac_cv_prog_cc_cross
3480
3481 cat > conftest.$ac_ext << EOF
3482
3483 #line 3484 "configure"
3484 #include "confdefs.h"
3485
3486 main(){return(0);}
3487 EOF
3488 if { (eval echo configure:3489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3489   ac_cv_prog_cc_works=yes
3490   # If we can't run a trivial program, we are probably using a cross compiler.
3491   if (./conftest; exit) 2>/dev/null; then
3492     ac_cv_prog_cc_cross=no
3493   else
3494     ac_cv_prog_cc_cross=yes
3495   fi
3496 else
3497   echo "configure: failed program was:" >&5
3498   cat conftest.$ac_ext >&5
3499   ac_cv_prog_cc_works=no
3500 fi
3501 rm -fr conftest*
3502 ac_ext=c
3503 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3504 ac_cpp='$CPP $CPPFLAGS'
3505 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3506 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3507 cross_compiling=$ac_cv_prog_cc_cross
3508
3509 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
3510 if test $ac_cv_prog_cc_works = no; then
3511   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
3512 fi
3513 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
3514 echo "configure:3515: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
3515 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
3516 cross_compiling=$ac_cv_prog_cc_cross
3517
3518 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
3519 echo "configure:3520: checking whether we are using GNU C" >&5
3520 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
3521   echo $ac_n "(cached) $ac_c" 1>&6
3522 else
3523   cat > conftest.c <<EOF
3524 #ifdef __GNUC__
3525   yes;
3526 #endif
3527 EOF
3528 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3529: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
3529   ac_cv_prog_gcc=yes
3530 else
3531   ac_cv_prog_gcc=no
3532 fi
3533 fi
3534
3535 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
3536
3537 if test $ac_cv_prog_gcc = yes; then
3538   GCC=yes
3539 else
3540   GCC=
3541 fi
3542
3543 ac_test_CFLAGS="${CFLAGS+set}"
3544 ac_save_CFLAGS="$CFLAGS"
3545 CFLAGS=
3546 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
3547 echo "configure:3548: checking whether ${CC-cc} accepts -g" >&5
3548 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
3549   echo $ac_n "(cached) $ac_c" 1>&6
3550 else
3551   echo 'void f(){}' > conftest.c
3552 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
3553   ac_cv_prog_cc_g=yes
3554 else
3555   ac_cv_prog_cc_g=no
3556 fi
3557 rm -f conftest*
3558
3559 fi
3560
3561 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
3562 if test "$ac_test_CFLAGS" = set; then
3563   CFLAGS="$ac_save_CFLAGS"
3564 elif test $ac_cv_prog_cc_g = yes; then
3565   if test "$GCC" = yes; then
3566     CFLAGS="-g -O2"
3567   else
3568     CFLAGS="-g"
3569   fi
3570 else
3571   if test "$GCC" = yes; then
3572     CFLAGS="-O2"
3573   else
3574     CFLAGS=
3575   fi
3576 fi
3577
3578 # Check whether --with-gnu-ld or --without-gnu-ld was given.
3579 if test "${with_gnu_ld+set}" = set; then
3580   withval="$with_gnu_ld"
3581   test "$withval" = no || with_gnu_ld=yes
3582 else
3583   with_gnu_ld=no
3584 fi
3585
3586 ac_prog=ld
3587 if test "$GCC" = yes; then
3588   # Check if gcc -print-prog-name=ld gives a path.
3589   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
3590 echo "configure:3591: checking for ld used by GCC" >&5
3591   case $host in
3592   *-*-mingw*)
3593     # gcc leaves a trailing carriage return which upsets mingw
3594     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3595   *)
3596     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3597   esac
3598   case $ac_prog in
3599     # Accept absolute paths.
3600     [\\/]* | [A-Za-z]:[\\/]*)
3601       re_direlt='/[^/][^/]*/\.\./'
3602       # Canonicalize the path of ld
3603       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3604       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3605         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3606       done
3607       test -z "$LD" && LD="$ac_prog"
3608       ;;
3609   "")
3610     # If it fails, then pretend we aren't using GCC.
3611     ac_prog=ld
3612     ;;
3613   *)
3614     # If it is relative, then search for the first ld in PATH.
3615     with_gnu_ld=unknown
3616     ;;
3617   esac
3618 elif test "$with_gnu_ld" = yes; then
3619   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
3620 echo "configure:3621: checking for GNU ld" >&5
3621 else
3622   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
3623 echo "configure:3624: checking for non-GNU ld" >&5
3624 fi
3625 if eval "test \"\${lt_cv_path_LD+set}\" = set"; then
3626   echo $ac_n "(cached) $ac_c" 1>&6
3627 else
3628   if test -z "$LD"; then
3629   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3630   for ac_dir in $PATH; do
3631     test -z "$ac_dir" && ac_dir=.
3632     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3633       lt_cv_path_LD="$ac_dir/$ac_prog"
3634       # Check to see if the program is GNU ld.  I'd rather use --version,
3635       # but apparently some GNU ld's only accept -v.
3636       # Break only if it was the GNU/non-GNU ld that we prefer.
3637       if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3638         test "$with_gnu_ld" != no && break
3639       else
3640         test "$with_gnu_ld" != yes && break
3641       fi
3642     fi
3643   done
3644   IFS="$ac_save_ifs"
3645 else
3646   lt_cv_path_LD="$LD" # Let the user override the test with a path.
3647 fi
3648 fi
3649
3650 LD="$lt_cv_path_LD"
3651 if test -n "$LD"; then
3652   echo "$ac_t""$LD" 1>&6
3653 else
3654   echo "$ac_t""no" 1>&6
3655 fi
3656 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
3657 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
3658 echo "configure:3659: checking if the linker ($LD) is GNU ld" >&5
3659 if eval "test \"\${lt_cv_prog_gnu_ld+set}\" = set"; then
3660   echo $ac_n "(cached) $ac_c" 1>&6
3661 else
3662   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
3663 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3664   lt_cv_prog_gnu_ld=yes
3665 else
3666   lt_cv_prog_gnu_ld=no
3667 fi
3668 fi
3669
3670 echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
3671 with_gnu_ld=$lt_cv_prog_gnu_ld
3672
3673
3674 echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
3675 echo "configure:3676: checking for $LD option to reload object files" >&5
3676 if eval "test \"\${lt_cv_ld_reload_flag+set}\" = set"; then
3677   echo $ac_n "(cached) $ac_c" 1>&6
3678 else
3679   lt_cv_ld_reload_flag='-r'
3680 fi
3681
3682 echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6
3683 reload_flag=$lt_cv_ld_reload_flag
3684 test -n "$reload_flag" && reload_flag=" $reload_flag"
3685
3686 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
3687 echo "configure:3688: checking for BSD-compatible nm" >&5
3688 if eval "test \"\${lt_cv_path_NM+set}\" = set"; then
3689   echo $ac_n "(cached) $ac_c" 1>&6
3690 else
3691   if test -n "$NM"; then
3692   # Let the user override the test.
3693   lt_cv_path_NM="$NM"
3694 else
3695   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3696   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3697     test -z "$ac_dir" && ac_dir=.
3698     tmp_nm=$ac_dir/${ac_tool_prefix}nm
3699     if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
3700       # Check to see if the nm accepts a BSD-compat flag.
3701       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3702       #   nm: unknown option "B" ignored
3703       # Tru64's nm complains that /dev/null is an invalid object file
3704       if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
3705         lt_cv_path_NM="$tmp_nm -B"
3706         break
3707       elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3708         lt_cv_path_NM="$tmp_nm -p"
3709         break
3710       else
3711         lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3712         continue # so that we can try to find one that supports BSD flags
3713       fi
3714     fi
3715   done
3716   IFS="$ac_save_ifs"
3717   test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
3718 fi
3719 fi
3720
3721 NM="$lt_cv_path_NM"
3722 echo "$ac_t""$NM" 1>&6
3723
3724 echo $ac_n "checking for a sed that does not truncate output""... $ac_c" 1>&6
3725 echo "configure:3726: checking for a sed that does not truncate output" >&5
3726 if eval "test \"\${lt_cv_path_SED+set}\" = set"; then
3727   echo $ac_n "(cached) $ac_c" 1>&6
3728 else
3729   # Loop through the user's path and test for sed and gsed.
3730 # Then use that list of sed's as ones to test for truncation.
3731 as_executable_p="test -f"
3732 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3733 for as_dir in $PATH
3734 do
3735   IFS=$as_save_IFS
3736   test -z "$as_dir" && as_dir=.
3737   for ac_prog in sed gsed; do
3738     for ac_exec_ext in '' $ac_executable_extensions; do
3739       if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
3740         _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
3741       fi
3742     done
3743   done
3744 done
3745
3746   # Create a temporary directory, and hook for its removal unless debugging.
3747 $debug ||
3748 {
3749   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
3750   trap '{ (exit 1); exit 1; }' 1 2 13 15
3751 }
3752
3753 # Create a (secure) tmp directory for tmp files.
3754 : ${TMPDIR=/tmp}
3755 {
3756   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
3757   test -n "$tmp" && test -d "$tmp"
3758 }  ||
3759 {
3760   tmp=$TMPDIR/sed$$-$RANDOM
3761   (umask 077 && mkdir $tmp)
3762 } ||
3763 {
3764    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
3765    { (exit 1); exit 1; }
3766 }
3767   _max=0
3768   _count=0
3769   # Add /usr/xpg4/bin/sed as it is typically found on Solaris
3770   # along with /bin/sed that truncates output.
3771   for _sed in $_sed_list /usr/xpg4/bin/sed; do
3772     test ! -f ${_sed} && break
3773     cat /dev/null > "$tmp/sed.in"
3774     _count=0
3775     echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
3776     # Check for GNU sed and select it if it is found.
3777     if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
3778       lt_cv_path_SED=${_sed}
3779       break
3780     fi
3781     while true; do
3782       cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
3783       mv "$tmp/sed.tmp" "$tmp/sed.in"
3784       cp "$tmp/sed.in" "$tmp/sed.nl"
3785       echo >>"$tmp/sed.nl"
3786       ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
3787       cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
3788       # 40000 chars as input seems more than enough
3789       test $_count -gt 10 && break
3790       _count=`expr $_count + 1`
3791       if test $_count -gt $_max; then
3792         _max=$_count
3793         lt_cv_path_SED=$_sed
3794       fi
3795     done
3796   done
3797   rm -rf "$tmp"
3798
3799 fi
3800
3801 if test "X$SED" != "X"; then
3802   lt_cv_path_SED=$SED
3803 else
3804   SED=$lt_cv_path_SED
3805 fi
3806 echo "$ac_t""$SED" 1>&6
3807
3808 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3809 echo "configure:3810: checking whether ln -s works" >&5
3810 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3811   echo $ac_n "(cached) $ac_c" 1>&6
3812 else
3813   rm -f conftestdata
3814 if ln -s X conftestdata 2>/dev/null
3815 then
3816   rm -f conftestdata
3817   ac_cv_prog_LN_S="ln -s"
3818 else
3819   ac_cv_prog_LN_S=ln
3820 fi
3821 fi
3822 LN_S="$ac_cv_prog_LN_S"
3823 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3824   echo "$ac_t""yes" 1>&6
3825 else
3826   echo "$ac_t""no" 1>&6
3827 fi
3828
3829 echo $ac_n "checking how to recognise dependent libraries""... $ac_c" 1>&6
3830 echo "configure:3831: checking how to recognise dependent libraries" >&5
3831 if eval "test \"\${lt_cv_deplibs_check_method+set}\" = set"; then
3832   echo $ac_n "(cached) $ac_c" 1>&6
3833 else
3834   lt_cv_file_magic_cmd='$MAGIC_CMD'
3835 lt_cv_file_magic_test_file=
3836 lt_cv_deplibs_check_method='unknown'
3837 # Need to set the preceding variable on all platforms that support
3838 # interlibrary dependencies.
3839 # 'none' -- dependencies not supported.
3840 # `unknown' -- same as none, but documents that we really don't know.
3841 # 'pass_all' -- all dependencies passed with no checks.
3842 # 'test_compile' -- check by making test program.
3843 # 'file_magic [[regex]]' -- check by looking for files in library path
3844 # which responds to the $file_magic_cmd with a given egrep regex.
3845 # If you have `file' or equivalent on your system and you're not sure
3846 # whether `pass_all' will *always* work, you probably want this one.
3847
3848 case $host_os in
3849 aix4* | aix5*)
3850   lt_cv_deplibs_check_method=pass_all
3851   ;;
3852
3853 beos*)
3854   lt_cv_deplibs_check_method=pass_all
3855   ;;
3856
3857 bsdi4*)
3858   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
3859   lt_cv_file_magic_cmd='/usr/bin/file -L'
3860   lt_cv_file_magic_test_file=/shlib/libc.so
3861   ;;
3862
3863 cygwin* | mingw* | pw32*)
3864   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3865   lt_cv_file_magic_cmd='$OBJDUMP -f'
3866   ;;
3867
3868 darwin* | rhapsody*)
3869   lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
3870   lt_cv_file_magic_cmd='/usr/bin/file -L'
3871   case "$host_os" in
3872   rhapsody* | darwin1.[012])
3873     lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
3874     ;;
3875   *) # Darwin 1.3 on
3876     lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
3877     ;;
3878   esac
3879   ;;
3880
3881 freebsd*)
3882   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3883     case $host_cpu in
3884     i*86 )
3885       # Not sure whether the presence of OpenBSD here was a mistake.
3886       # Let's accept both of them until this is cleared up.
3887       lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
3888       lt_cv_file_magic_cmd=/usr/bin/file
3889       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3890       ;;
3891     esac
3892   else
3893     lt_cv_deplibs_check_method=pass_all
3894   fi
3895   ;;
3896
3897 gnu*)
3898   lt_cv_deplibs_check_method=pass_all
3899   ;;
3900
3901 hpux10.20*|hpux11*)
3902   lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
3903   lt_cv_file_magic_cmd=/usr/bin/file
3904   lt_cv_file_magic_test_file=/usr/lib/libc.sl
3905   ;;
3906
3907 irix5* | irix6* | nonstopux*)
3908   case $host_os in
3909   irix5* | nonstopux*)
3910     # this will be overridden with pass_all, but let us keep it just in case
3911     lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
3912     ;;
3913   *)
3914     case $LD in
3915     *-32|*"-32 ") libmagic=32-bit;;
3916     *-n32|*"-n32 ") libmagic=N32;;
3917     *-64|*"-64 ") libmagic=64-bit;;
3918     *) libmagic=never-match;;
3919     esac
3920     # this will be overridden with pass_all, but let us keep it just in case
3921     lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
3922     ;;
3923   esac
3924   lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
3925   lt_cv_deplibs_check_method=pass_all
3926   ;;
3927
3928 # This must be Linux ELF.
3929 linux-gnu*)
3930   case $host_cpu in
3931   alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64*)
3932     lt_cv_deplibs_check_method=pass_all ;;
3933   *)
3934     # glibc up to 2.1.1 does not perform some relocations on ARM
3935     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
3936   esac
3937   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
3938   ;;
3939
3940 netbsd*)
3941   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3942     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
3943   else
3944     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
3945   fi
3946   ;;
3947
3948 newos6*)
3949   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
3950   lt_cv_file_magic_cmd=/usr/bin/file
3951   lt_cv_file_magic_test_file=/usr/lib/libnls.so
3952   ;;
3953
3954 openbsd*)
3955   lt_cv_file_magic_cmd=/usr/bin/file
3956   lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3957   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3958     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
3959   else
3960     lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
3961   fi
3962   ;;
3963
3964 osf3* | osf4* | osf5*)
3965   # this will be overridden with pass_all, but let us keep it just in case
3966   lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
3967   lt_cv_file_magic_test_file=/shlib/libc.so
3968   lt_cv_deplibs_check_method=pass_all
3969   ;;
3970
3971 sco3.2v5*)
3972   lt_cv_deplibs_check_method=pass_all
3973   ;;
3974
3975 solaris*)
3976   lt_cv_deplibs_check_method=pass_all
3977   lt_cv_file_magic_test_file=/lib/libc.so
3978   ;;
3979
3980 sysv5uw[78]* | sysv4*uw2*)
3981   lt_cv_deplibs_check_method=pass_all
3982   ;;
3983
3984 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
3985   case $host_vendor in
3986   motorola)
3987     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
3988     lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3989     ;;
3990   ncr)
3991     lt_cv_deplibs_check_method=pass_all
3992     ;;
3993   sequent)
3994     lt_cv_file_magic_cmd='/bin/file'
3995     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
3996     ;;
3997   sni)
3998     lt_cv_file_magic_cmd='/bin/file'
3999     lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
4000     lt_cv_file_magic_test_file=/lib/libc.so
4001     ;;
4002   siemens)
4003     lt_cv_deplibs_check_method=pass_all
4004     ;;
4005   esac
4006   ;;
4007 esac
4008
4009 fi
4010
4011 echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6
4012 file_magic_cmd=$lt_cv_file_magic_cmd
4013 deplibs_check_method=$lt_cv_deplibs_check_method
4014
4015 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
4016 echo "configure:4017: checking for object suffix" >&5
4017 if eval "test \"\${ac_cv_objext+set}\" = set"; then
4018   echo $ac_n "(cached) $ac_c" 1>&6
4019 else
4020   rm -f conftest*
4021 echo 'int i = 1;' > conftest.$ac_ext
4022 if { (eval echo configure:4023: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4023   for ac_file in conftest.*; do
4024     case $ac_file in
4025     *.c) ;;
4026     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
4027     esac
4028   done
4029 else
4030   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
4031 fi
4032 rm -f conftest*
4033 fi
4034
4035 echo "$ac_t""$ac_cv_objext" 1>&6
4036 OBJEXT=$ac_cv_objext
4037 ac_objext=$ac_cv_objext
4038
4039
4040
4041
4042 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
4043 echo "configure:4044: checking for executable suffix" >&5
4044 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
4045   echo $ac_n "(cached) $ac_c" 1>&6
4046 else
4047   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
4048   ac_cv_exeext=.exe
4049 else
4050   rm -f conftest*
4051   echo 'int main () { return 0; }' > conftest.$ac_ext
4052   ac_cv_exeext=
4053   if { (eval echo configure:4054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
4054     for file in conftest.*; do
4055       case $file in
4056       *.c | *.C | *.o | *.obj | *.xcoff) ;;
4057       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
4058       esac
4059     done
4060   else
4061     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
4062   fi
4063   rm -f conftest*
4064   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
4065 fi
4066 fi
4067
4068 EXEEXT=""
4069 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
4070 echo "$ac_t""${ac_cv_exeext}" 1>&6
4071 ac_exeext=$EXEEXT
4072
4073 if test $host != $build; then
4074   ac_tool_prefix=${host_alias}-
4075 else
4076   ac_tool_prefix=
4077 fi
4078
4079
4080
4081
4082 # Check for command to grab the raw symbol name followed by C symbol from nm.
4083 echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
4084 echo "configure:4085: checking command to parse $NM output" >&5
4085 if eval "test \"\${lt_cv_sys_global_symbol_pipe+set}\" = set"; then
4086   echo $ac_n "(cached) $ac_c" 1>&6
4087 else
4088   
4089 # These are sane defaults that work on at least a few old systems.
4090 # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4091
4092 # Character class describing NM global symbol codes.
4093 symcode='[BCDEGRST]'
4094
4095 # Regexp to match symbols that can be accessed directly from C.
4096 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
4097
4098 # Transform the above into a raw symbol and a C symbol.
4099 symxfrm='\1 \2\3 \3'
4100
4101 # Transform an extracted symbol line into a proper C declaration
4102 lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
4103
4104 # Transform an extracted symbol line into symbol name and symbol address
4105 lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
4106
4107 # Define system-specific variables.
4108 case $host_os in
4109 aix*)
4110   symcode='[BCDT]'
4111   ;;
4112 cygwin* | mingw* | pw32*)
4113   symcode='[ABCDGISTW]'
4114   ;;
4115 hpux*) # Its linker distinguishes data from code symbols
4116   lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4117   lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
4118   ;;
4119 irix* | nonstopux*)
4120   symcode='[BCDEGRST]'
4121   ;;
4122 osf*)
4123   symcode='[BCDEGQRST]'
4124   ;;
4125 solaris* | sysv5*)
4126   symcode='[BDT]'
4127   ;;
4128 sysv4)
4129   symcode='[DFNSTU]'
4130   ;;
4131 esac
4132
4133 # Handle CRLF in mingw tool chain
4134 opt_cr=
4135 case $host_os in
4136 mingw*)
4137   opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4138   ;;
4139 esac
4140
4141 # If we're using GNU nm, then use its standard symbol codes.
4142 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
4143   symcode='[ABCDGISTW]'
4144 fi
4145
4146 # Try without a prefix undercore, then with it.
4147 for ac_symprfx in "" "_"; do
4148
4149   # Write the raw and C identifiers.
4150 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[         ]\($symcode$symcode*\)[         ][      ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
4151
4152   # Check to see that the pipe works correctly.
4153   pipe_works=no
4154   rm -f conftest*
4155   cat > conftest.$ac_ext <<EOF
4156 #ifdef __cplusplus
4157 extern "C" {
4158 #endif
4159 char nm_test_var;
4160 void nm_test_func(){}
4161 #ifdef __cplusplus
4162 }
4163 #endif
4164 int main(){nm_test_var='a';nm_test_func();return(0);}
4165 EOF
4166
4167   if { (eval echo configure:4168: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4168     # Now try to grab the symbols.
4169     nlist=conftest.nm
4170     if { (eval echo configure:4171: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then
4171       # Try sorting and uniquifying the output.
4172       if sort "$nlist" | uniq > "$nlist"T; then
4173         mv -f "$nlist"T "$nlist"
4174       else
4175         rm -f "$nlist"T
4176       fi
4177
4178       # Make sure that we snagged all the symbols we need.
4179       if egrep ' nm_test_var$' "$nlist" >/dev/null; then
4180         if egrep ' nm_test_func$' "$nlist" >/dev/null; then
4181           cat <<EOF > conftest.$ac_ext
4182 #ifdef __cplusplus
4183 extern "C" {
4184 #endif
4185
4186 EOF
4187           # Now generate the symbol file.
4188           eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
4189
4190           cat <<EOF >> conftest.$ac_ext
4191 #if defined (__STDC__) && __STDC__
4192 # define lt_ptr void *
4193 #else
4194 # define lt_ptr char *
4195 # define const
4196 #endif
4197
4198 /* The mapping between symbol names and symbols. */
4199 const struct {
4200   const char *name;
4201   lt_ptr address;
4202 }
4203 lt_preloaded_symbols[] =
4204 {
4205 EOF
4206           sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
4207           cat <<\EOF >> conftest.$ac_ext
4208   {0, (lt_ptr) 0}
4209 };
4210
4211 #ifdef __cplusplus
4212 }
4213 #endif
4214 EOF
4215           # Now try linking the two files.
4216           mv conftest.$ac_objext conftstm.$ac_objext
4217           save_LIBS="$LIBS"
4218           save_CFLAGS="$CFLAGS"
4219           LIBS="conftstm.$ac_objext"
4220           CFLAGS="$CFLAGS$no_builtin_flag"
4221           if { (eval echo configure:4222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest$ac_exeext; then
4222             pipe_works=yes
4223           fi
4224           LIBS="$save_LIBS"
4225           CFLAGS="$save_CFLAGS"
4226         else
4227           echo "cannot find nm_test_func in $nlist" >&5
4228         fi
4229       else
4230         echo "cannot find nm_test_var in $nlist" >&5
4231       fi
4232     else
4233       echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
4234     fi
4235   else
4236     echo "$progname: failed program was:" >&5
4237     cat conftest.$ac_ext >&5
4238   fi
4239   rm -f conftest* conftst*
4240
4241   # Do not use the global_symbol_pipe unless it works.
4242   if test "$pipe_works" = yes; then
4243     break
4244   else
4245     lt_cv_sys_global_symbol_pipe=
4246   fi
4247 done
4248
4249 fi
4250
4251 global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
4252 if test -z "$lt_cv_sys_global_symbol_pipe"; then
4253   global_symbol_to_cdecl=
4254   global_symbol_to_c_name_address=
4255 else
4256   global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
4257   global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
4258 fi
4259 if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
4260 then
4261   echo "$ac_t""failed" 1>&6
4262 else
4263   echo "$ac_t""ok" 1>&6
4264 fi
4265
4266 for ac_hdr in dlfcn.h
4267 do
4268 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4269 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4270 echo "configure:4271: checking for $ac_hdr" >&5
4271 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4272   echo $ac_n "(cached) $ac_c" 1>&6
4273 else
4274   cat > conftest.$ac_ext <<EOF
4275 #line 4276 "configure"
4276 #include "confdefs.h"
4277 #include <$ac_hdr>
4278 EOF
4279 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4280 { (eval echo configure:4281: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4281 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4282 if test -z "$ac_err"; then
4283   rm -rf conftest*
4284   eval "ac_cv_header_$ac_safe=yes"
4285 else
4286   echo "$ac_err" >&5
4287   echo "configure: failed program was:" >&5
4288   cat conftest.$ac_ext >&5
4289   rm -rf conftest*
4290   eval "ac_cv_header_$ac_safe=no"
4291 fi
4292 rm -f conftest*
4293 fi
4294 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4295   echo "$ac_t""yes" 1>&6
4296     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4297   cat >> confdefs.h <<EOF
4298 #define $ac_tr_hdr 1
4299 EOF
4300  
4301 else
4302   echo "$ac_t""no" 1>&6
4303 fi
4304 done
4305
4306
4307
4308
4309
4310
4311 # Only perform the check for file, if the check method requires it
4312 case $deplibs_check_method in
4313 file_magic*)
4314   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
4315     echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
4316 echo "configure:4317: checking for ${ac_tool_prefix}file" >&5
4317 if eval "test \"\${lt_cv_path_MAGIC_CMD+set}\" = set"; then
4318   echo $ac_n "(cached) $ac_c" 1>&6
4319 else
4320   case $MAGIC_CMD in
4321   /*)
4322   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4323   ;;
4324   ?:/*)
4325   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
4326   ;;
4327   *)
4328   ac_save_MAGIC_CMD="$MAGIC_CMD"
4329   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4330   ac_dummy="/usr/bin:$PATH"
4331   for ac_dir in $ac_dummy; do
4332     test -z "$ac_dir" && ac_dir=.
4333     if test -f $ac_dir/${ac_tool_prefix}file; then
4334       lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
4335       if test -n "$file_magic_test_file"; then
4336         case $deplibs_check_method in
4337         "file_magic "*)
4338           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
4339           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4340           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4341             egrep "$file_magic_regex" > /dev/null; then
4342             :
4343           else
4344             cat <<EOF 1>&2
4345
4346 *** Warning: the command libtool uses to detect shared libraries,
4347 *** $file_magic_cmd, produces output that libtool cannot recognize.
4348 *** The result is that libtool may fail to recognize shared libraries
4349 *** as such.  This will affect the creation of libtool libraries that
4350 *** depend on shared libraries, but programs linked with such libtool
4351 *** libraries will work regardless of this problem.  Nevertheless, you
4352 *** may want to report the problem to your system manager and/or to
4353 *** bug-libtool@gnu.org
4354
4355 EOF
4356           fi ;;
4357         esac
4358       fi
4359       break
4360     fi
4361   done
4362   IFS="$ac_save_ifs"
4363   MAGIC_CMD="$ac_save_MAGIC_CMD"
4364   ;;
4365 esac
4366 fi
4367
4368 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4369 if test -n "$MAGIC_CMD"; then
4370   echo "$ac_t""$MAGIC_CMD" 1>&6
4371 else
4372   echo "$ac_t""no" 1>&6
4373 fi
4374
4375 if test -z "$lt_cv_path_MAGIC_CMD"; then
4376   if test -n "$ac_tool_prefix"; then
4377     echo $ac_n "checking for file""... $ac_c" 1>&6
4378 echo "configure:4379: checking for file" >&5
4379 if eval "test \"\${lt_cv_path_MAGIC_CMD+set}\" = set"; then
4380   echo $ac_n "(cached) $ac_c" 1>&6
4381 else
4382   case $MAGIC_CMD in
4383   /*)
4384   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4385   ;;
4386   ?:/*)
4387   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
4388   ;;
4389   *)
4390   ac_save_MAGIC_CMD="$MAGIC_CMD"
4391   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4392   ac_dummy="/usr/bin:$PATH"
4393   for ac_dir in $ac_dummy; do
4394     test -z "$ac_dir" && ac_dir=.
4395     if test -f $ac_dir/file; then
4396       lt_cv_path_MAGIC_CMD="$ac_dir/file"
4397       if test -n "$file_magic_test_file"; then
4398         case $deplibs_check_method in
4399         "file_magic "*)
4400           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
4401           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4402           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4403             egrep "$file_magic_regex" > /dev/null; then
4404             :
4405           else
4406             cat <<EOF 1>&2
4407
4408 *** Warning: the command libtool uses to detect shared libraries,
4409 *** $file_magic_cmd, produces output that libtool cannot recognize.
4410 *** The result is that libtool may fail to recognize shared libraries
4411 *** as such.  This will affect the creation of libtool libraries that
4412 *** depend on shared libraries, but programs linked with such libtool
4413 *** libraries will work regardless of this problem.  Nevertheless, you
4414 *** may want to report the problem to your system manager and/or to
4415 *** bug-libtool@gnu.org
4416
4417 EOF
4418           fi ;;
4419         esac
4420       fi
4421       break
4422     fi
4423   done
4424   IFS="$ac_save_ifs"
4425   MAGIC_CMD="$ac_save_MAGIC_CMD"
4426   ;;
4427 esac
4428 fi
4429
4430 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4431 if test -n "$MAGIC_CMD"; then
4432   echo "$ac_t""$MAGIC_CMD" 1>&6
4433 else
4434   echo "$ac_t""no" 1>&6
4435 fi
4436
4437   else
4438     MAGIC_CMD=:
4439   fi
4440 fi
4441
4442   fi
4443   ;;
4444 esac
4445
4446 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
4447 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
4448 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4449 echo "configure:4450: checking for $ac_word" >&5
4450 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
4451   echo $ac_n "(cached) $ac_c" 1>&6
4452 else
4453   if test -n "$RANLIB"; then
4454   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
4455 else
4456   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4457   ac_dummy="$PATH"
4458   for ac_dir in $ac_dummy; do
4459     test -z "$ac_dir" && ac_dir=.
4460     if test -f $ac_dir/$ac_word; then
4461       ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
4462       break
4463     fi
4464   done
4465   IFS="$ac_save_ifs"
4466 fi
4467 fi
4468 RANLIB="$ac_cv_prog_RANLIB"
4469 if test -n "$RANLIB"; then
4470   echo "$ac_t""$RANLIB" 1>&6
4471 else
4472   echo "$ac_t""no" 1>&6
4473 fi
4474
4475
4476 if test -z "$ac_cv_prog_RANLIB"; then
4477 if test -n "$ac_tool_prefix"; then
4478   # Extract the first word of "ranlib", so it can be a program name with args.
4479 set dummy ranlib; ac_word=$2
4480 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4481 echo "configure:4482: checking for $ac_word" >&5
4482 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
4483   echo $ac_n "(cached) $ac_c" 1>&6
4484 else
4485   if test -n "$RANLIB"; then
4486   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
4487 else
4488   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4489   ac_dummy="$PATH"
4490   for ac_dir in $ac_dummy; do
4491     test -z "$ac_dir" && ac_dir=.
4492     if test -f $ac_dir/$ac_word; then
4493       ac_cv_prog_RANLIB="ranlib"
4494       break
4495     fi
4496   done
4497   IFS="$ac_save_ifs"
4498   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
4499 fi
4500 fi
4501 RANLIB="$ac_cv_prog_RANLIB"
4502 if test -n "$RANLIB"; then
4503   echo "$ac_t""$RANLIB" 1>&6
4504 else
4505   echo "$ac_t""no" 1>&6
4506 fi
4507
4508 else
4509   RANLIB=":"
4510 fi
4511 fi
4512
4513 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
4514 set dummy ${ac_tool_prefix}strip; ac_word=$2
4515 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4516 echo "configure:4517: checking for $ac_word" >&5
4517 if eval "test \"\${ac_cv_prog_STRIP+set}\" = set"; then
4518   echo $ac_n "(cached) $ac_c" 1>&6
4519 else
4520   if test -n "$STRIP"; then
4521   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
4522 else
4523   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4524   ac_dummy="$PATH"
4525   for ac_dir in $ac_dummy; do
4526     test -z "$ac_dir" && ac_dir=.
4527     if test -f $ac_dir/$ac_word; then
4528       ac_cv_prog_STRIP="${ac_tool_prefix}strip"
4529       break
4530     fi
4531   done
4532   IFS="$ac_save_ifs"
4533 fi
4534 fi
4535 STRIP="$ac_cv_prog_STRIP"
4536 if test -n "$STRIP"; then
4537   echo "$ac_t""$STRIP" 1>&6
4538 else
4539   echo "$ac_t""no" 1>&6
4540 fi
4541
4542
4543 if test -z "$ac_cv_prog_STRIP"; then
4544 if test -n "$ac_tool_prefix"; then
4545   # Extract the first word of "strip", so it can be a program name with args.
4546 set dummy strip; ac_word=$2
4547 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4548 echo "configure:4549: checking for $ac_word" >&5
4549 if eval "test \"\${ac_cv_prog_STRIP+set}\" = set"; then
4550   echo $ac_n "(cached) $ac_c" 1>&6
4551 else
4552   if test -n "$STRIP"; then
4553   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
4554 else
4555   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4556   ac_dummy="$PATH"
4557   for ac_dir in $ac_dummy; do
4558     test -z "$ac_dir" && ac_dir=.
4559     if test -f $ac_dir/$ac_word; then
4560       ac_cv_prog_STRIP="strip"
4561       break
4562     fi
4563   done
4564   IFS="$ac_save_ifs"
4565   test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
4566 fi
4567 fi
4568 STRIP="$ac_cv_prog_STRIP"
4569 if test -n "$STRIP"; then
4570   echo "$ac_t""$STRIP" 1>&6
4571 else
4572   echo "$ac_t""no" 1>&6
4573 fi
4574
4575 else
4576   STRIP=":"
4577 fi
4578 fi
4579
4580
4581 enable_dlopen=yes
4582 enable_win32_dll=yes
4583
4584 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
4585 if test "${enable_libtool_lock+set}" = set; then
4586   enableval="$enable_libtool_lock"
4587   :
4588 fi
4589
4590 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
4591
4592 # Some flags need to be propagated to the compiler or linker for good
4593 # libtool support.
4594 case $host in
4595 *-*-irix6*)
4596   # Find out which ABI we are using.
4597   echo '#line 4598 "configure"' > conftest.$ac_ext
4598   if { (eval echo configure:4599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4599     case `/usr/bin/file conftest.$ac_objext` in
4600     *32-bit*)
4601       LD="${LD-ld} -32"
4602       ;;
4603     *N32*)
4604       LD="${LD-ld} -n32"
4605       ;;
4606     *64-bit*)
4607       LD="${LD-ld} -64"
4608       ;;
4609     esac
4610   fi
4611   rm -rf conftest*
4612   ;;
4613
4614 *-*-sco3.2v5*)
4615   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
4616   SAVE_CFLAGS="$CFLAGS"
4617   CFLAGS="$CFLAGS -belf"
4618   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
4619 echo "configure:4620: checking whether the C compiler needs -belf" >&5
4620 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
4621   echo $ac_n "(cached) $ac_c" 1>&6
4622 else
4623   
4624      ac_ext=c
4625 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
4626 ac_cpp='$CPP $CPPFLAGS'
4627 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
4628 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
4629 cross_compiling=$ac_cv_prog_cc_cross
4630
4631      cat > conftest.$ac_ext <<EOF
4632 #line 4633 "configure"
4633 #include "confdefs.h"
4634
4635 int main() {
4636
4637 ; return 0; }
4638 EOF
4639 if { (eval echo configure:4640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4640   rm -rf conftest*
4641   lt_cv_cc_needs_belf=yes
4642 else
4643   echo "configure: failed program was:" >&5
4644   cat conftest.$ac_ext >&5
4645   rm -rf conftest*
4646   lt_cv_cc_needs_belf=no
4647 fi
4648 rm -f conftest*
4649      ac_ext=c
4650 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
4651 ac_cpp='$CPP $CPPFLAGS'
4652 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
4653 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
4654 cross_compiling=$ac_cv_prog_cc_cross
4655
4656 fi
4657
4658 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
4659   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
4660     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
4661     CFLAGS="$SAVE_CFLAGS"
4662   fi
4663   ;;
4664
4665 *-*-cygwin* | *-*-mingw* | *-*-pw32*)
4666   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
4667 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
4668 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4669 echo "configure:4670: checking for $ac_word" >&5
4670 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
4671   echo $ac_n "(cached) $ac_c" 1>&6
4672 else
4673   if test -n "$DLLTOOL"; then
4674   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
4675 else
4676   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4677   ac_dummy="$PATH"
4678   for ac_dir in $ac_dummy; do
4679     test -z "$ac_dir" && ac_dir=.
4680     if test -f $ac_dir/$ac_word; then
4681       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
4682       break
4683     fi
4684   done
4685   IFS="$ac_save_ifs"
4686 fi
4687 fi
4688 DLLTOOL="$ac_cv_prog_DLLTOOL"
4689 if test -n "$DLLTOOL"; then
4690   echo "$ac_t""$DLLTOOL" 1>&6
4691 else
4692   echo "$ac_t""no" 1>&6
4693 fi
4694
4695
4696 if test -z "$ac_cv_prog_DLLTOOL"; then
4697 if test -n "$ac_tool_prefix"; then
4698   # Extract the first word of "dlltool", so it can be a program name with args.
4699 set dummy dlltool; ac_word=$2
4700 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4701 echo "configure:4702: checking for $ac_word" >&5
4702 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
4703   echo $ac_n "(cached) $ac_c" 1>&6
4704 else
4705   if test -n "$DLLTOOL"; then
4706   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
4707 else
4708   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4709   ac_dummy="$PATH"
4710   for ac_dir in $ac_dummy; do
4711     test -z "$ac_dir" && ac_dir=.
4712     if test -f $ac_dir/$ac_word; then
4713       ac_cv_prog_DLLTOOL="dlltool"
4714       break
4715     fi
4716   done
4717   IFS="$ac_save_ifs"
4718   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
4719 fi
4720 fi
4721 DLLTOOL="$ac_cv_prog_DLLTOOL"
4722 if test -n "$DLLTOOL"; then
4723   echo "$ac_t""$DLLTOOL" 1>&6
4724 else
4725   echo "$ac_t""no" 1>&6
4726 fi
4727
4728 else
4729   DLLTOOL="false"
4730 fi
4731 fi
4732
4733   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
4734 set dummy ${ac_tool_prefix}as; ac_word=$2
4735 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4736 echo "configure:4737: checking for $ac_word" >&5
4737 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
4738   echo $ac_n "(cached) $ac_c" 1>&6
4739 else
4740   if test -n "$AS"; then
4741   ac_cv_prog_AS="$AS" # Let the user override the test.
4742 else
4743   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4744   ac_dummy="$PATH"
4745   for ac_dir in $ac_dummy; do
4746     test -z "$ac_dir" && ac_dir=.
4747     if test -f $ac_dir/$ac_word; then
4748       ac_cv_prog_AS="${ac_tool_prefix}as"
4749       break
4750     fi
4751   done
4752   IFS="$ac_save_ifs"
4753 fi
4754 fi
4755 AS="$ac_cv_prog_AS"
4756 if test -n "$AS"; then
4757   echo "$ac_t""$AS" 1>&6
4758 else
4759   echo "$ac_t""no" 1>&6
4760 fi
4761
4762
4763 if test -z "$ac_cv_prog_AS"; then
4764 if test -n "$ac_tool_prefix"; then
4765   # Extract the first word of "as", so it can be a program name with args.
4766 set dummy as; ac_word=$2
4767 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4768 echo "configure:4769: checking for $ac_word" >&5
4769 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
4770   echo $ac_n "(cached) $ac_c" 1>&6
4771 else
4772   if test -n "$AS"; then
4773   ac_cv_prog_AS="$AS" # Let the user override the test.
4774 else
4775   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4776   ac_dummy="$PATH"
4777   for ac_dir in $ac_dummy; do
4778     test -z "$ac_dir" && ac_dir=.
4779     if test -f $ac_dir/$ac_word; then
4780       ac_cv_prog_AS="as"
4781       break
4782     fi
4783   done
4784   IFS="$ac_save_ifs"
4785   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
4786 fi
4787 fi
4788 AS="$ac_cv_prog_AS"
4789 if test -n "$AS"; then
4790   echo "$ac_t""$AS" 1>&6
4791 else
4792   echo "$ac_t""no" 1>&6
4793 fi
4794
4795 else
4796   AS="false"
4797 fi
4798 fi
4799
4800   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
4801 set dummy ${ac_tool_prefix}objdump; ac_word=$2
4802 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4803 echo "configure:4804: checking for $ac_word" >&5
4804 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
4805   echo $ac_n "(cached) $ac_c" 1>&6
4806 else
4807   if test -n "$OBJDUMP"; then
4808   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
4809 else
4810   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4811   ac_dummy="$PATH"
4812   for ac_dir in $ac_dummy; do
4813     test -z "$ac_dir" && ac_dir=.
4814     if test -f $ac_dir/$ac_word; then
4815       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
4816       break
4817     fi
4818   done
4819   IFS="$ac_save_ifs"
4820 fi
4821 fi
4822 OBJDUMP="$ac_cv_prog_OBJDUMP"
4823 if test -n "$OBJDUMP"; then
4824   echo "$ac_t""$OBJDUMP" 1>&6
4825 else
4826   echo "$ac_t""no" 1>&6
4827 fi
4828
4829
4830 if test -z "$ac_cv_prog_OBJDUMP"; then
4831 if test -n "$ac_tool_prefix"; then
4832   # Extract the first word of "objdump", so it can be a program name with args.
4833 set dummy objdump; ac_word=$2
4834 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4835 echo "configure:4836: checking for $ac_word" >&5
4836 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
4837   echo $ac_n "(cached) $ac_c" 1>&6
4838 else
4839   if test -n "$OBJDUMP"; then
4840   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
4841 else
4842   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4843   ac_dummy="$PATH"
4844   for ac_dir in $ac_dummy; do
4845     test -z "$ac_dir" && ac_dir=.
4846     if test -f $ac_dir/$ac_word; then
4847       ac_cv_prog_OBJDUMP="objdump"
4848       break
4849     fi
4850   done
4851   IFS="$ac_save_ifs"
4852   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
4853 fi
4854 fi
4855 OBJDUMP="$ac_cv_prog_OBJDUMP"
4856 if test -n "$OBJDUMP"; then
4857   echo "$ac_t""$OBJDUMP" 1>&6
4858 else
4859   echo "$ac_t""no" 1>&6
4860 fi
4861
4862 else
4863   OBJDUMP="false"
4864 fi
4865 fi
4866
4867
4868   # recent cygwin and mingw systems supply a stub DllMain which the user
4869   # can override, but on older systems we have to supply one
4870   echo $ac_n "checking if libtool should supply DllMain function""... $ac_c" 1>&6
4871 echo "configure:4872: checking if libtool should supply DllMain function" >&5
4872 if eval "test \"\${lt_cv_need_dllmain+set}\" = set"; then
4873   echo $ac_n "(cached) $ac_c" 1>&6
4874 else
4875   cat > conftest.$ac_ext <<EOF
4876 #line 4877 "configure"
4877 #include "confdefs.h"
4878
4879 int main() {
4880 extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
4881       DllMain (0, 0, 0);
4882 ; return 0; }
4883 EOF
4884 if { (eval echo configure:4885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4885   rm -rf conftest*
4886   lt_cv_need_dllmain=no
4887 else
4888   echo "configure: failed program was:" >&5
4889   cat conftest.$ac_ext >&5
4890   rm -rf conftest*
4891   lt_cv_need_dllmain=yes
4892 fi
4893 rm -f conftest*
4894 fi
4895
4896 echo "$ac_t""$lt_cv_need_dllmain" 1>&6
4897
4898   case $host/$CC in
4899   *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
4900     # old mingw systems require "-dll" to link a DLL, while more recent ones
4901     # require "-mdll"
4902     SAVE_CFLAGS="$CFLAGS"
4903     CFLAGS="$CFLAGS -mdll"
4904     echo $ac_n "checking how to link DLLs""... $ac_c" 1>&6
4905 echo "configure:4906: checking how to link DLLs" >&5
4906 if eval "test \"\${lt_cv_cc_dll_switch+set}\" = set"; then
4907   echo $ac_n "(cached) $ac_c" 1>&6
4908 else
4909   cat > conftest.$ac_ext <<EOF
4910 #line 4911 "configure"
4911 #include "confdefs.h"
4912
4913 int main() {
4914
4915 ; return 0; }
4916 EOF
4917 if { (eval echo configure:4918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4918   rm -rf conftest*
4919   lt_cv_cc_dll_switch=-mdll
4920 else
4921   echo "configure: failed program was:" >&5
4922   cat conftest.$ac_ext >&5
4923   rm -rf conftest*
4924   lt_cv_cc_dll_switch=-dll
4925 fi
4926 rm -f conftest*
4927 fi
4928
4929 echo "$ac_t""$lt_cv_cc_dll_switch" 1>&6
4930     CFLAGS="$SAVE_CFLAGS" ;;
4931   *-*-cygwin* | *-*-pw32*)
4932     # cygwin systems need to pass --dll to the linker, and not link
4933     # crt.o which will require a WinMain@16 definition.
4934     lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
4935   esac
4936   ;;
4937   
4938 esac
4939
4940 # Sed substitution that helps us do robust quoting.  It backslashifies
4941 # metacharacters that are still active within double-quoted strings.
4942 Xsed='sed -e s/^X//'
4943 sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
4944
4945 # Same as above, but do not quote variable references.
4946 double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
4947
4948 # Sed substitution to delay expansion of an escaped shell variable in a
4949 # double_quote_subst'ed string.
4950 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
4951
4952 # Constants:
4953 rm="rm -f"
4954
4955 # Global variables:
4956 default_ofile=libtool
4957 can_build_shared=yes
4958
4959 # All known linkers require a `.a' archive for static linking (except M$VC,
4960 # which needs '.lib').
4961 libext=a
4962 ltmain="$ac_aux_dir/ltmain.sh"
4963 ofile="$default_ofile"
4964 with_gnu_ld="$lt_cv_prog_gnu_ld"
4965 need_locks="$enable_libtool_lock"
4966
4967 old_CC="$CC"
4968 old_CFLAGS="$CFLAGS"
4969
4970 # Set sane defaults for various variables
4971 test -z "$AR" && AR=ar
4972 test -z "$AR_FLAGS" && AR_FLAGS=cru
4973 test -z "$AS" && AS=as
4974 test -z "$CC" && CC=cc
4975 test -z "$DLLTOOL" && DLLTOOL=dlltool
4976 test -z "$LD" && LD=ld
4977 test -z "$LN_S" && LN_S="ln -s"
4978 test -z "$MAGIC_CMD" && MAGIC_CMD=file
4979 test -z "$NM" && NM=nm
4980 test -z "$OBJDUMP" && OBJDUMP=objdump
4981 test -z "$RANLIB" && RANLIB=:
4982 test -z "$STRIP" && STRIP=:
4983 test -z "$ac_objext" && ac_objext=o
4984
4985 if test x"$host" != x"$build"; then
4986   ac_tool_prefix=${host_alias}-
4987 else
4988   ac_tool_prefix=
4989 fi
4990
4991 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
4992 case $host_os in
4993 linux-gnu*) ;;
4994 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
4995 esac
4996
4997 case $host_os in
4998 aix3*)
4999   # AIX sometimes has problems with the GCC collect2 program.  For some
5000   # reason, if we set the COLLECT_NAMES environment variable, the problems
5001   # vanish in a puff of smoke.
5002   if test "X${COLLECT_NAMES+set}" != Xset; then
5003     COLLECT_NAMES=
5004     export COLLECT_NAMES
5005   fi
5006   ;;
5007 esac
5008
5009 # Determine commands to create old-style static archives.
5010 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
5011 old_postinstall_cmds='chmod 644 $oldlib'
5012 old_postuninstall_cmds=
5013
5014 if test -n "$RANLIB"; then
5015   case $host_os in
5016   openbsd*)
5017     old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
5018     ;;
5019   *)
5020     old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
5021     ;;
5022   esac
5023   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
5024 fi
5025
5026 # Allow CC to be a program name with arguments.
5027 set dummy $CC
5028 compiler="$2"
5029
5030 ## FIXME: this should be a separate macro
5031 ##
5032 echo $ac_n "checking for objdir""... $ac_c" 1>&6
5033 echo "configure:5034: checking for objdir" >&5
5034 rm -f .libs 2>/dev/null
5035 mkdir .libs 2>/dev/null
5036 if test -d .libs; then
5037   objdir=.libs
5038 else
5039   # MS-DOS does not allow filenames that begin with a dot.
5040   objdir=_libs
5041 fi
5042 rmdir .libs 2>/dev/null
5043 echo "$ac_t""$objdir" 1>&6
5044 ##
5045 ## END FIXME
5046
5047
5048 ## FIXME: this should be a separate macro
5049 ##
5050 # Check whether --with-pic or --without-pic was given.
5051 if test "${with_pic+set}" = set; then
5052   withval="$with_pic"
5053   pic_mode="$withval"
5054 else
5055   pic_mode=default
5056 fi
5057
5058 test -z "$pic_mode" && pic_mode=default
5059
5060 # We assume here that the value for lt_cv_prog_cc_pic will not be cached
5061 # in isolation, and that seeing it set (from the cache) indicates that
5062 # the associated values are set (in the cache) correctly too.
5063 echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6
5064 echo "configure:5065: checking for $compiler option to produce PIC" >&5
5065 if eval "test \"\${lt_cv_prog_cc_pic+set}\" = set"; then
5066   echo $ac_n "(cached) $ac_c" 1>&6
5067 else
5068    lt_cv_prog_cc_pic=
5069   lt_cv_prog_cc_shlib=
5070   lt_cv_prog_cc_wl=
5071   lt_cv_prog_cc_static=
5072   lt_cv_prog_cc_no_builtin=
5073   lt_cv_prog_cc_can_build_shared=$can_build_shared
5074
5075   if test "$GCC" = yes; then
5076     lt_cv_prog_cc_wl='-Wl,'
5077     lt_cv_prog_cc_static='-static'
5078
5079     case $host_os in
5080     aix*)
5081       # Below there is a dirty hack to force normal static linking with -ldl
5082       # The problem is because libdl dynamically linked with both libc and
5083       # libC (AIX C++ library), which obviously doesn't included in libraries
5084       # list by gcc. This cause undefined symbols with -static flags.
5085       # This hack allows C programs to be linked with "-static -ldl", but
5086       # not sure about C++ programs.
5087       lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
5088       ;;
5089     amigaos*)
5090       # FIXME: we need at least 68020 code to build shared libraries, but
5091       # adding the `-m68020' flag to GCC prevents building anything better,
5092       # like `-m68040'.
5093       lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
5094       ;;
5095     beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5096       # PIC is the default for these OSes.
5097       ;;
5098     darwin* | rhapsody*)
5099       # PIC is the default on this platform
5100       # Common symbols not allowed in MH_DYLIB files
5101       lt_cv_prog_cc_pic='-fno-common'
5102       ;;
5103     cygwin* | mingw* | pw32* | os2*)
5104       # This hack is so that the source file can tell whether it is being
5105       # built for inclusion in a dll (and should export symbols for example).
5106       lt_cv_prog_cc_pic='-DDLL_EXPORT'
5107       ;;
5108     sysv4*MP*)
5109       if test -d /usr/nec; then
5110          lt_cv_prog_cc_pic=-Kconform_pic
5111       fi
5112       ;;
5113     *)
5114       lt_cv_prog_cc_pic='-fPIC'
5115       ;;
5116     esac
5117   else
5118     # PORTME Check for PIC flags for the system compiler.
5119     case $host_os in
5120     aix3* | aix4* | aix5*)
5121       lt_cv_prog_cc_wl='-Wl,'
5122       # All AIX code is PIC.
5123       if test "$host_cpu" = ia64; then
5124         # AIX 5 now supports IA64 processor
5125         lt_cv_prog_cc_static='-Bstatic'
5126       else
5127         lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
5128       fi
5129       ;;
5130
5131     hpux9* | hpux10* | hpux11*)
5132       # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
5133       lt_cv_prog_cc_wl='-Wl,'
5134       lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
5135       lt_cv_prog_cc_pic='+Z'
5136       ;;
5137
5138     irix5* | irix6* | nonstopux*)
5139       lt_cv_prog_cc_wl='-Wl,'
5140       lt_cv_prog_cc_static='-non_shared'
5141       # PIC (with -KPIC) is the default.
5142       ;;
5143
5144     cygwin* | mingw* | pw32* | os2*)
5145       # This hack is so that the source file can tell whether it is being
5146       # built for inclusion in a dll (and should export symbols for example).
5147       lt_cv_prog_cc_pic='-DDLL_EXPORT'
5148       ;;
5149
5150     newsos6)
5151       lt_cv_prog_cc_pic='-KPIC'
5152       lt_cv_prog_cc_static='-Bstatic'
5153       ;;
5154
5155     osf3* | osf4* | osf5*)
5156       # All OSF/1 code is PIC.
5157       lt_cv_prog_cc_wl='-Wl,'
5158       lt_cv_prog_cc_static='-non_shared'
5159       ;;
5160
5161     sco3.2v5*)
5162       lt_cv_prog_cc_pic='-Kpic'
5163       lt_cv_prog_cc_static='-dn'
5164       lt_cv_prog_cc_shlib='-belf'
5165       ;;
5166
5167     solaris*)
5168       lt_cv_prog_cc_pic='-KPIC'
5169       lt_cv_prog_cc_static='-Bstatic'
5170       lt_cv_prog_cc_wl='-Wl,'
5171       ;;
5172
5173     sunos4*)
5174       lt_cv_prog_cc_pic='-PIC'
5175       lt_cv_prog_cc_static='-Bstatic'
5176       lt_cv_prog_cc_wl='-Qoption ld '
5177       ;;
5178
5179     sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5180       lt_cv_prog_cc_pic='-KPIC'
5181       lt_cv_prog_cc_static='-Bstatic'
5182       lt_cv_prog_cc_wl='-Wl,'
5183       ;;
5184
5185     uts4*)
5186       lt_cv_prog_cc_pic='-pic'
5187       lt_cv_prog_cc_static='-Bstatic'
5188       ;;
5189
5190     sysv4*MP*)
5191       if test -d /usr/nec ;then
5192         lt_cv_prog_cc_pic='-Kconform_pic'
5193         lt_cv_prog_cc_static='-Bstatic'
5194       fi
5195       ;;
5196
5197     *)
5198       lt_cv_prog_cc_can_build_shared=no
5199       ;;
5200     esac
5201   fi
5202
5203 fi
5204
5205 if test -z "$lt_cv_prog_cc_pic"; then
5206   echo "$ac_t""none" 1>&6
5207 else
5208   echo "$ac_t""$lt_cv_prog_cc_pic" 1>&6
5209
5210   # Check to make sure the pic_flag actually works.
5211   echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6
5212 echo "configure:5213: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
5213   if eval "test \"\${lt_cv_prog_cc_pic_works+set}\" = set"; then
5214   echo $ac_n "(cached) $ac_c" 1>&6
5215 else
5216       save_CFLAGS="$CFLAGS"
5217     CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
5218     cat > conftest.$ac_ext <<EOF
5219 #line 5220 "configure"
5220 #include "confdefs.h"
5221
5222 int main() {
5223
5224 ; return 0; }
5225 EOF
5226 if { (eval echo configure:5227: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5227   rm -rf conftest*
5228         case $host_os in
5229       hpux9* | hpux10* | hpux11*)
5230         # On HP-UX, both CC and GCC only warn that PIC is supported... then
5231         # they create non-PIC objects.  So, if there were any warnings, we
5232         # assume that PIC is not supported.
5233         if test -s conftest.err; then
5234           lt_cv_prog_cc_pic_works=no
5235         else
5236           lt_cv_prog_cc_pic_works=yes
5237         fi
5238         ;;
5239       *)
5240         lt_cv_prog_cc_pic_works=yes
5241         ;;
5242       esac
5243     
5244 else
5245   echo "configure: failed program was:" >&5
5246   cat conftest.$ac_ext >&5
5247   rm -rf conftest*
5248         lt_cv_prog_cc_pic_works=no
5249     
5250 fi
5251 rm -f conftest*
5252     CFLAGS="$save_CFLAGS"
5253   
5254 fi
5255
5256
5257   if test "X$lt_cv_prog_cc_pic_works" = Xno; then
5258     lt_cv_prog_cc_pic=
5259     lt_cv_prog_cc_can_build_shared=no
5260   else
5261     lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
5262   fi
5263
5264   echo "$ac_t""$lt_cv_prog_cc_pic_works" 1>&6
5265 fi
5266 ##
5267 ## END FIXME
5268
5269 # Check for any special shared library compilation flags.
5270 if test -n "$lt_cv_prog_cc_shlib"; then
5271   echo "configure: warning: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" 1>&2
5272   if echo "$old_CC $old_CFLAGS " | egrep -e "[  ]$lt_cv_prog_cc_shlib[  ]" >/dev/null; then :
5273   else
5274    echo "configure: warning: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2
5275     lt_cv_prog_cc_can_build_shared=no
5276   fi
5277 fi
5278
5279 ## FIXME: this should be a separate macro
5280 ##
5281 echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6
5282 echo "configure:5283: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
5283 if eval "test \"\${lt_cv_prog_cc_static_works+set}\" = set"; then
5284   echo $ac_n "(cached) $ac_c" 1>&6
5285 else
5286     lt_cv_prog_cc_static_works=no
5287   save_LDFLAGS="$LDFLAGS"
5288   LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
5289   cat > conftest.$ac_ext <<EOF
5290 #line 5291 "configure"
5291 #include "confdefs.h"
5292
5293 int main() {
5294
5295 ; return 0; }
5296 EOF
5297 if { (eval echo configure:5298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5298   rm -rf conftest*
5299   lt_cv_prog_cc_static_works=yes
5300 else
5301   echo "configure: failed program was:" >&5
5302   cat conftest.$ac_ext >&5
5303 fi
5304 rm -f conftest*
5305   LDFLAGS="$save_LDFLAGS"
5306
5307 fi
5308
5309
5310 # Belt *and* braces to stop my trousers falling down:
5311 test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
5312 echo "$ac_t""$lt_cv_prog_cc_static_works" 1>&6
5313
5314 pic_flag="$lt_cv_prog_cc_pic"
5315 special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
5316 wl="$lt_cv_prog_cc_wl"
5317 link_static_flag="$lt_cv_prog_cc_static"
5318 no_builtin_flag="$lt_cv_prog_cc_no_builtin"
5319 can_build_shared="$lt_cv_prog_cc_can_build_shared"
5320 ##
5321 ## END FIXME
5322
5323
5324 ## FIXME: this should be a separate macro
5325 ##
5326 # Check to see if options -o and -c are simultaneously supported by compiler
5327 echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6
5328 echo "configure:5329: checking if $compiler supports -c -o file.$ac_objext" >&5
5329 if eval "test \"\${lt_cv_compiler_c_o+set}\" = set"; then
5330   echo $ac_n "(cached) $ac_c" 1>&6
5331 else
5332   
5333 $rm -r conftest 2>/dev/null
5334 mkdir conftest
5335 cd conftest
5336 echo "int some_variable = 0;" > conftest.$ac_ext
5337 mkdir out
5338 # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
5339 # that will create temporary files in the current directory regardless of
5340 # the output directory.  Thus, making CWD read-only will cause this test
5341 # to fail, enabling locking or at least warning the user not to do parallel
5342 # builds.
5343 chmod -w .
5344 save_CFLAGS="$CFLAGS"
5345 CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
5346 compiler_c_o=no
5347 if { (eval echo configure:5348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
5348   # The compiler can only warn and ignore the option if not recognized
5349   # So say no if there are warnings
5350   if test -s out/conftest.err; then
5351     lt_cv_compiler_c_o=no
5352   else
5353     lt_cv_compiler_c_o=yes
5354   fi
5355 else
5356   # Append any errors to the config.log.
5357   cat out/conftest.err 1>&5
5358   lt_cv_compiler_c_o=no
5359 fi
5360 CFLAGS="$save_CFLAGS"
5361 chmod u+w .
5362 $rm conftest* out/*
5363 rmdir out
5364 cd ..
5365 rmdir conftest
5366 $rm -r conftest 2>/dev/null
5367
5368 fi
5369
5370 compiler_c_o=$lt_cv_compiler_c_o
5371 echo "$ac_t""$compiler_c_o" 1>&6
5372
5373 if test x"$compiler_c_o" = x"yes"; then
5374   # Check to see if we can write to a .lo
5375   echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6
5376 echo "configure:5377: checking if $compiler supports -c -o file.lo" >&5
5377   if eval "test \"\${lt_cv_compiler_o_lo+set}\" = set"; then
5378   echo $ac_n "(cached) $ac_c" 1>&6
5379 else
5380   
5381   lt_cv_compiler_o_lo=no
5382   save_CFLAGS="$CFLAGS"
5383   CFLAGS="$CFLAGS -c -o conftest.lo"
5384   save_objext="$ac_objext"
5385   ac_objext=lo
5386   cat > conftest.$ac_ext <<EOF
5387 #line 5388 "configure"
5388 #include "confdefs.h"
5389
5390 int main() {
5391 int some_variable = 0;
5392 ; return 0; }
5393 EOF
5394 if { (eval echo configure:5395: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5395   rm -rf conftest*
5396       # The compiler can only warn and ignore the option if not recognized
5397     # So say no if there are warnings
5398     if test -s conftest.err; then
5399       lt_cv_compiler_o_lo=no
5400     else
5401       lt_cv_compiler_o_lo=yes
5402     fi
5403   
5404 else
5405   echo "configure: failed program was:" >&5
5406   cat conftest.$ac_ext >&5
5407 fi
5408 rm -f conftest*
5409   ac_objext="$save_objext"
5410   CFLAGS="$save_CFLAGS"
5411   
5412 fi
5413
5414   compiler_o_lo=$lt_cv_compiler_o_lo
5415   echo "$ac_t""$compiler_o_lo" 1>&6
5416 else
5417   compiler_o_lo=no
5418 fi
5419 ##
5420 ## END FIXME
5421
5422 ## FIXME: this should be a separate macro
5423 ##
5424 # Check to see if we can do hard links to lock some files if needed
5425 hard_links="nottested"
5426 if test "$compiler_c_o" = no && test "$need_locks" != no; then
5427   # do not overwrite the value of need_locks provided by the user
5428   echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6
5429 echo "configure:5430: checking if we can lock with hard links" >&5
5430   hard_links=yes
5431   $rm conftest*
5432   ln conftest.a conftest.b 2>/dev/null && hard_links=no
5433   touch conftest.a
5434   ln conftest.a conftest.b 2>&5 || hard_links=no
5435   ln conftest.a conftest.b 2>/dev/null && hard_links=no
5436   echo "$ac_t""$hard_links" 1>&6
5437   if test "$hard_links" = no; then
5438     echo "configure: warning: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" 1>&2
5439     need_locks=warn
5440   fi
5441 else
5442   need_locks=no
5443 fi
5444 ##
5445 ## END FIXME
5446
5447 ## FIXME: this should be a separate macro
5448 ##
5449 if test "$GCC" = yes; then
5450   # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
5451   echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6
5452 echo "configure:5453: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
5453   echo "int some_variable = 0;" > conftest.$ac_ext
5454   save_CFLAGS="$CFLAGS"
5455   CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
5456   compiler_rtti_exceptions=no
5457   cat > conftest.$ac_ext <<EOF
5458 #line 5459 "configure"
5459 #include "confdefs.h"
5460
5461 int main() {
5462 int some_variable = 0;
5463 ; return 0; }
5464 EOF
5465 if { (eval echo configure:5466: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5466   rm -rf conftest*
5467       # The compiler can only warn and ignore the option if not recognized
5468     # So say no if there are warnings
5469     if test -s conftest.err; then
5470       compiler_rtti_exceptions=no
5471     else
5472       compiler_rtti_exceptions=yes
5473     fi
5474   
5475 else
5476   echo "configure: failed program was:" >&5
5477   cat conftest.$ac_ext >&5
5478 fi
5479 rm -f conftest*
5480   CFLAGS="$save_CFLAGS"
5481   echo "$ac_t""$compiler_rtti_exceptions" 1>&6
5482
5483   if test "$compiler_rtti_exceptions" = "yes"; then
5484     no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
5485   else
5486     no_builtin_flag=' -fno-builtin'
5487   fi
5488 fi
5489 ##
5490 ## END FIXME
5491
5492 ## FIXME: this should be a separate macro
5493 ##
5494 # See if the linker supports building shared libraries.
5495 echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6
5496 echo "configure:5497: checking whether the linker ($LD) supports shared libraries" >&5
5497
5498 allow_undefined_flag=
5499 no_undefined_flag=
5500 need_lib_prefix=unknown
5501 need_version=unknown
5502 # when you set need_version to no, make sure it does not cause -set_version
5503 # flags to be left without arguments
5504 archive_cmds=
5505 archive_expsym_cmds=
5506 old_archive_from_new_cmds=
5507 old_archive_from_expsyms_cmds=
5508 export_dynamic_flag_spec=
5509 whole_archive_flag_spec=
5510 thread_safe_flag_spec=
5511 hardcode_into_libs=no
5512 hardcode_libdir_flag_spec=
5513 hardcode_libdir_separator=
5514 hardcode_direct=no
5515 hardcode_minus_L=no
5516 hardcode_shlibpath_var=unsupported
5517 runpath_var=
5518 link_all_deplibs=unknown
5519 always_export_symbols=no
5520 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
5521 # include_expsyms should be a list of space-separated symbols to be *always*
5522 # included in the symbol list
5523 include_expsyms=
5524 # exclude_expsyms can be an egrep regular expression of symbols to exclude
5525 # it will be wrapped by ` (' and `)$', so one must not match beginning or
5526 # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5527 # as well as any symbol that contains `d'.
5528 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
5529 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5530 # platforms (ab)use it in PIC code, but their linkers get confused if
5531 # the symbol is explicitly referenced.  Since portable code cannot
5532 # rely on this symbol name, it's probably fine to never include it in
5533 # preloaded symbol tables.
5534 extract_expsyms_cmds=
5535
5536 case $host_os in
5537 cygwin* | mingw* | pw32*)
5538   # FIXME: the MSVC++ port hasn't been tested in a loooong time
5539   # When not using gcc, we currently assume that we are using
5540   # Microsoft Visual C++.
5541   if test "$GCC" != yes; then
5542     with_gnu_ld=no
5543   fi
5544   ;;
5545 openbsd*)
5546   with_gnu_ld=no
5547   ;;
5548 esac
5549
5550 ld_shlibs=yes
5551 if test "$with_gnu_ld" = yes; then
5552   # If archive_cmds runs LD, not CC, wlarc should be empty
5553   wlarc='${wl}'
5554
5555   # See if GNU ld supports shared libraries.
5556   case $host_os in
5557   aix3* | aix4* | aix5*)
5558     # On AIX, the GNU linker is very broken
5559     # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
5560     ld_shlibs=no
5561     cat <<EOF 1>&2
5562
5563 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
5564 *** to be unable to reliably create shared libraries on AIX.
5565 *** Therefore, libtool is disabling shared libraries support.  If you
5566 *** really care for shared libraries, you may want to modify your PATH
5567 *** so that a non-GNU linker is found, and then restart.
5568
5569 EOF
5570     ;;
5571
5572   amigaos*)
5573     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)'
5574     hardcode_libdir_flag_spec='-L$libdir'
5575     hardcode_minus_L=yes
5576
5577     # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
5578     # that the semantics of dynamic libraries on AmigaOS, at least up
5579     # to version 4, is to share data among multiple programs linked
5580     # with the same dynamic library.  Since this doesn't match the
5581     # behavior of shared libraries on other platforms, we can use
5582     # them.
5583     ld_shlibs=no
5584     ;;
5585
5586   beos*)
5587     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5588       allow_undefined_flag=unsupported
5589       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5590       # support --undefined.  This deserves some investigation.  FIXME
5591       archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5592     else
5593       ld_shlibs=no
5594     fi
5595     ;;
5596
5597   cygwin* | mingw* | pw32*)
5598     # hardcode_libdir_flag_spec is actually meaningless, as there is
5599     # no search path for DLLs.
5600     hardcode_libdir_flag_spec='-L$libdir'
5601     allow_undefined_flag=unsupported
5602     always_export_symbols=yes
5603
5604     extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
5605       sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
5606       test -f $output_objdir/impgen.exe || (cd $output_objdir && \
5607       if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
5608       else $CC -o impgen impgen.c ; fi)~
5609       $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
5610
5611     old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
5612
5613     # cygwin and mingw dlls have different entry points and sets of symbols
5614     # to exclude.
5615     # FIXME: what about values for MSVC?
5616     dll_entry=__cygwin_dll_entry@12
5617     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
5618     case $host_os in
5619     mingw*)
5620       # mingw values
5621       dll_entry=_DllMainCRTStartup@12
5622       dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
5623       ;;
5624     esac
5625
5626     # mingw and cygwin differ, and it's simplest to just exclude the union
5627     # of the two symbol sets.
5628     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
5629
5630     # recent cygwin and mingw systems supply a stub DllMain which the user
5631     # can override, but on older systems we have to supply one (in ltdll.c)
5632     if test "x$lt_cv_need_dllmain" = "xyes"; then
5633       ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
5634       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~
5635         test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
5636     else
5637       ltdll_obj=
5638       ltdll_cmds=
5639     fi
5640
5641     # Extract the symbol export list from an `--export-all' def file,
5642     # then regenerate the def file from the symbol export list, so that
5643     # the compiled dll only exports the symbol export list.
5644     # Be careful not to strip the DATA tag left be newer dlltools.
5645     export_symbols_cmds="$ltdll_cmds"'
5646       $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
5647       sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
5648
5649     # If the export-symbols file already is a .def file (1st line
5650     # is EXPORTS), use it as is.
5651     # If DATA tags from a recent dlltool are present, honour them!
5652     archive_expsym_cmds='if test "x`sed 1q $export_symbols`" = xEXPORTS; then
5653         cp $export_symbols $output_objdir/$soname-def;
5654       else
5655         echo EXPORTS > $output_objdir/$soname-def;
5656         _lt_hint=1;
5657         cat $export_symbols | while read symbol; do
5658          set dummy \$symbol;
5659          case \$# in
5660            2) echo "   \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
5661            4) echo "   \$2 \$3 \$4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
5662            *) echo "     \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
5663          esac;
5664          _lt_hint=`expr 1 + \$_lt_hint`;
5665         done;
5666       fi~
5667       '"$ltdll_cmds"'
5668       $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~
5669       $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~
5670       $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~
5671       $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~
5672       $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
5673     ;;
5674
5675   netbsd*)
5676     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5677       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5678       wlarc=
5679     else
5680       archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5681       archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5682     fi
5683     ;;
5684
5685   solaris* | sysv5*)
5686     if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
5687       ld_shlibs=no
5688       cat <<EOF 1>&2
5689
5690 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
5691 *** create shared libraries on Solaris systems.  Therefore, libtool
5692 *** is disabling shared libraries support.  We urge you to upgrade GNU
5693 *** binutils to release 2.9.1 or newer.  Another option is to modify
5694 *** your PATH or compiler configuration so that the native linker is
5695 *** used, and then restart.
5696
5697 EOF
5698     elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5699       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5700       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5701     else
5702       ld_shlibs=no
5703     fi
5704     ;;
5705
5706   sunos4*)
5707     archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5708     wlarc=
5709     hardcode_direct=yes
5710     hardcode_shlibpath_var=no
5711     ;;
5712
5713   *)
5714     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5715       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5716       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5717     else
5718       ld_shlibs=no
5719     fi
5720     ;;
5721   esac
5722
5723   if test "$ld_shlibs" = yes; then
5724     runpath_var=LD_RUN_PATH
5725     hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
5726     export_dynamic_flag_spec='${wl}--export-dynamic'
5727     case $host_os in
5728     cygwin* | mingw* | pw32*)
5729       # dlltool doesn't understand --whole-archive et. al.
5730       whole_archive_flag_spec=
5731       ;;
5732     *)
5733       # ancient GNU ld didn't support --whole-archive et. al.
5734       if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
5735         whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5736       else
5737         whole_archive_flag_spec=
5738       fi
5739       ;;
5740     esac
5741   fi
5742 else
5743   # PORTME fill in a description of your system's linker (not GNU ld)
5744   case $host_os in
5745   aix3*)
5746     allow_undefined_flag=unsupported
5747     always_export_symbols=yes
5748     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'
5749     # Note: this linker hardcodes the directories in LIBPATH if there
5750     # are no directories specified by -L.
5751     hardcode_minus_L=yes
5752     if test "$GCC" = yes && test -z "$link_static_flag"; then
5753       # Neither direct hardcoding nor static linking is supported with a
5754       # broken collect2.
5755       hardcode_direct=unsupported
5756     fi
5757     ;;
5758
5759   aix4* | aix5*)
5760     if test "$host_cpu" = ia64; then
5761       # On IA64, the linker does run time linking by default, so we don't
5762       # have to do anything special.
5763       aix_use_runtimelinking=no
5764       exp_sym_flag='-Bexport'
5765       no_entry_flag=""
5766     else
5767       aix_use_runtimelinking=no
5768
5769       # Test if we are trying to use run time linking or normal
5770       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5771       # need to do runtime linking.
5772       case $host_os in aix4.[23]|aix4.[23].*|aix5*)
5773         for ld_flag in $LDFLAGS; do
5774           case $ld_flag in
5775           *-brtl*)
5776             aix_use_runtimelinking=yes
5777             break
5778           ;;
5779           esac
5780         done
5781       esac
5782
5783       exp_sym_flag='-bexport'
5784       no_entry_flag='-bnoentry'
5785     fi
5786
5787     # When large executables or shared objects are built, AIX ld can
5788     # have problems creating the table of contents.  If linking a library
5789     # or program results in "error TOC overflow" add -mminimal-toc to
5790     # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5791     # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5792
5793     hardcode_direct=yes
5794     archive_cmds=''
5795     hardcode_libdir_separator=':'
5796     if test "$GCC" = yes; then
5797       case $host_os in aix4.[012]|aix4.[012].*)
5798         collect2name=`${CC} -print-prog-name=collect2`
5799         if test -f "$collect2name" && \
5800           strings "$collect2name" | grep resolve_lib_name >/dev/null
5801         then
5802           # We have reworked collect2
5803           hardcode_direct=yes
5804         else
5805           # We have old collect2
5806           hardcode_direct=unsupported
5807           # It fails to find uninstalled libraries when the uninstalled
5808           # path is not listed in the libpath.  Setting hardcode_minus_L
5809           # to unsupported forces relinking
5810           hardcode_minus_L=yes
5811           hardcode_libdir_flag_spec='-L$libdir'
5812           hardcode_libdir_separator=
5813         fi
5814       esac
5815
5816       shared_flag='-shared'
5817     else
5818       # not using gcc
5819       if test "$host_cpu" = ia64; then
5820         shared_flag='${wl}-G'
5821       else
5822         if test "$aix_use_runtimelinking" = yes; then
5823           shared_flag='${wl}-G'
5824         else
5825           shared_flag='${wl}-bM:SRE'
5826         fi
5827       fi
5828     fi
5829
5830     # It seems that -bexpall can do strange things, so it is better to
5831     # generate a list of symbols to export.
5832     always_export_symbols=yes
5833     if test "$aix_use_runtimelinking" = yes; then
5834       # Warning - without using the other runtime loading flags (-brtl),
5835       # -berok will link without error, but may produce a broken library.
5836       allow_undefined_flag='-berok'
5837       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
5838       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"
5839     else
5840       if test "$host_cpu" = ia64; then
5841         hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
5842         allow_undefined_flag="-z nodefs"
5843         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"
5844       else
5845         hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
5846         # Warning - without using the other run time loading flags,
5847         # -berok will link without error, but may produce a broken library.
5848         allow_undefined_flag='${wl}-berok'
5849         # This is a bit strange, but is similar to how AIX traditionally builds
5850         # it's shared libraries.
5851         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'
5852       fi
5853     fi
5854     ;;
5855
5856   amigaos*)
5857     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)'
5858     hardcode_libdir_flag_spec='-L$libdir'
5859     hardcode_minus_L=yes
5860     # see comment about different semantics on the GNU ld section
5861     ld_shlibs=no
5862     ;;
5863
5864   cygwin* | mingw* | pw32*)
5865     # When not using gcc, we currently assume that we are using
5866     # Microsoft Visual C++.
5867     # hardcode_libdir_flag_spec is actually meaningless, as there is
5868     # no search path for DLLs.
5869     hardcode_libdir_flag_spec=' '
5870     allow_undefined_flag=unsupported
5871     # Tell ltmain to make .lib files, not .a files.
5872     libext=lib
5873     # FIXME: Setting linknames here is a bad hack.
5874     archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
5875     # The linker will automatically build a .lib file if we build a DLL.
5876     old_archive_from_new_cmds='true'
5877     # FIXME: Should let the user specify the lib program.
5878     old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
5879     fix_srcfile_path='`cygpath -w "$srcfile"`'
5880     ;;
5881
5882   darwin* | rhapsody*)
5883     case "$host_os" in
5884     rhapsody* | darwin1.[012])
5885       allow_undefined_flag='-undefined suppress'
5886       ;;
5887     *) # Darwin 1.3 on
5888       allow_undefined_flag='-flat_namespace -undefined suppress'
5889       ;;
5890     esac
5891     # FIXME: Relying on posixy $() will cause problems for
5892     #        cross-compilation, but unfortunately the echo tests do not
5893     #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
5894     #        `"' quotes if we put them in here... so don't!
5895     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)'
5896     # We need to add '_' to the symbols in $export_symbols first
5897     #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
5898     hardcode_direct=yes
5899     hardcode_shlibpath_var=no
5900     whole_archive_flag_spec='-all_load $convenience'
5901     ;;
5902
5903   freebsd1*)
5904     ld_shlibs=no
5905     ;;
5906
5907   # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5908   # support.  Future versions do this automatically, but an explicit c++rt0.o
5909   # does not break anything, and helps significantly (at the cost of a little
5910   # extra space).
5911   freebsd2.2*)
5912     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5913     hardcode_libdir_flag_spec='-R$libdir'
5914     hardcode_direct=yes
5915     hardcode_shlibpath_var=no
5916     ;;
5917
5918   # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5919   freebsd2*)
5920     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5921     hardcode_direct=yes
5922     hardcode_minus_L=yes
5923     hardcode_shlibpath_var=no
5924     ;;
5925
5926   # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5927   freebsd*)
5928     archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
5929     hardcode_libdir_flag_spec='-R$libdir'
5930     hardcode_direct=yes
5931     hardcode_shlibpath_var=no
5932     ;;
5933
5934   hpux9* | hpux10* | hpux11*)
5935     case $host_os in
5936     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' ;;
5937     *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
5938     esac
5939     hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
5940     hardcode_libdir_separator=:
5941     hardcode_direct=yes
5942     hardcode_minus_L=yes # Not in the search PATH, but as the default
5943                          # location of the library.
5944     export_dynamic_flag_spec='${wl}-E'
5945     ;;
5946
5947   irix5* | irix6* | nonstopux*)
5948     if test "$GCC" = yes; then
5949       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'
5950       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5951     else
5952       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'
5953       hardcode_libdir_flag_spec='-rpath $libdir'
5954     fi
5955     hardcode_libdir_separator=:
5956     link_all_deplibs=yes
5957     ;;
5958
5959   netbsd*)
5960     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5961       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5962     else
5963       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5964     fi
5965     hardcode_libdir_flag_spec='-R$libdir'
5966     hardcode_direct=yes
5967     hardcode_shlibpath_var=no
5968     ;;
5969
5970   newsos6)
5971     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5972     hardcode_direct=yes
5973     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5974     hardcode_libdir_separator=:
5975     hardcode_shlibpath_var=no
5976     ;;
5977
5978   openbsd*)
5979     hardcode_direct=yes
5980     hardcode_shlibpath_var=no
5981     if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5982       archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5983       hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
5984       export_dynamic_flag_spec='${wl}-E'
5985     else
5986       case "$host_os" in
5987       openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
5988         archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5989         hardcode_libdir_flag_spec='-R$libdir'
5990         ;;
5991       *)
5992         archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5993         hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
5994         ;;
5995       esac
5996     fi
5997     ;;
5998
5999   os2*)
6000     hardcode_libdir_flag_spec='-L$libdir'
6001     hardcode_minus_L=yes
6002     allow_undefined_flag=unsupported
6003     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'
6004     old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
6005     ;;
6006
6007   osf3*)
6008     if test "$GCC" = yes; then
6009       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
6010       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'
6011     else
6012       allow_undefined_flag=' -expect_unresolved \*'
6013       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'
6014     fi
6015     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
6016     hardcode_libdir_separator=:
6017     ;;
6018
6019   osf4* | osf5*)        # as osf3* with the addition of -msym flag
6020     if test "$GCC" = yes; then
6021       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
6022       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'
6023       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
6024     else
6025       allow_undefined_flag=' -expect_unresolved \*'
6026       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'
6027       archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
6028       $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'
6029
6030       #Both c and cxx compiler support -rpath directly
6031       hardcode_libdir_flag_spec='-rpath $libdir'
6032     fi
6033     hardcode_libdir_separator=:
6034     ;;
6035
6036   sco3.2v5*)
6037     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6038     hardcode_shlibpath_var=no
6039     runpath_var=LD_RUN_PATH
6040     hardcode_runpath_var=yes
6041     export_dynamic_flag_spec='${wl}-Bexport'
6042     ;;
6043
6044   solaris*)
6045     # gcc --version < 3.0 without binutils cannot create self contained
6046     # shared libraries reliably, requiring libgcc.a to resolve some of
6047     # the object symbols generated in some cases.  Libraries that use
6048     # assert need libgcc.a to resolve __eprintf, for example.  Linking
6049     # a copy of libgcc.a into every shared library to guarantee resolving
6050     # such symbols causes other problems:  According to Tim Van Holder
6051     # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
6052     # (to the application) exception stack for one thing.
6053     no_undefined_flag=' -z defs'
6054     if test "$GCC" = yes; then
6055       case `$CC --version 2>/dev/null` in
6056       [12].*)
6057         cat <<EOF 1>&2
6058
6059 *** Warning: Releases of GCC earlier than version 3.0 cannot reliably
6060 *** create self contained shared libraries on Solaris systems, without
6061 *** introducing a dependency on libgcc.a.  Therefore, libtool is disabling
6062 *** -no-undefined support, which will at least allow you to build shared
6063 *** libraries.  However, you may find that when you link such libraries
6064 *** into an application without using GCC, you have to manually add
6065 *** \`gcc --print-libgcc-file-name\` to the link command.  We urge you to
6066 *** upgrade to a newer version of GCC.  Another option is to rebuild your
6067 *** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
6068
6069 EOF
6070         no_undefined_flag=
6071         ;;
6072       esac
6073     fi
6074     # $CC -shared without GNU ld will not create a library from C++
6075     # object files and a static libstdc++, better avoid it by now
6076     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6077     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6078                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
6079     hardcode_libdir_flag_spec='-R$libdir'
6080     hardcode_shlibpath_var=no
6081     case $host_os in
6082     solaris2.[0-5] | solaris2.[0-5].*) ;;
6083     *) # Supported since Solaris 2.6 (maybe 2.5.1?)
6084       whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
6085     esac
6086     link_all_deplibs=yes
6087     ;;
6088
6089   sunos4*)
6090     if test "x$host_vendor" = xsequent; then
6091       # Use $CC to link under sequent, because it throws in some extra .o
6092       # files that make .init and .fini sections work.
6093       archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
6094     else
6095       archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
6096     fi
6097     hardcode_libdir_flag_spec='-L$libdir'
6098     hardcode_direct=yes
6099     hardcode_minus_L=yes
6100     hardcode_shlibpath_var=no
6101     ;;
6102
6103   sysv4)
6104     case $host_vendor in
6105       sni)
6106         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6107         hardcode_direct=yes # is this really true???
6108         ;;
6109       siemens)
6110         ## LD is ld it makes a PLAMLIB
6111         ## CC just makes a GrossModule.
6112         archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6113         reload_cmds='$CC -r -o $output$reload_objs'
6114         hardcode_direct=no
6115         ;;
6116       motorola)
6117         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6118         hardcode_direct=no #Motorola manual says yes, but my tests say they lie
6119         ;;
6120     esac
6121     runpath_var='LD_RUN_PATH'
6122     hardcode_shlibpath_var=no
6123     ;;
6124
6125   sysv4.3*)
6126     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6127     hardcode_shlibpath_var=no
6128     export_dynamic_flag_spec='-Bexport'
6129     ;;
6130
6131   sysv5*)
6132     no_undefined_flag=' -z text'
6133     # $CC -shared without GNU ld will not create a library from C++
6134     # object files and a static libstdc++, better avoid it by now
6135     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6136     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6137                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
6138     hardcode_libdir_flag_spec=
6139     hardcode_shlibpath_var=no
6140     runpath_var='LD_RUN_PATH'
6141     ;;
6142
6143   uts4*)
6144     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6145     hardcode_libdir_flag_spec='-L$libdir'
6146     hardcode_shlibpath_var=no
6147     ;;
6148
6149   dgux*)
6150     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6151     hardcode_libdir_flag_spec='-L$libdir'
6152     hardcode_shlibpath_var=no
6153     ;;
6154
6155   sysv4*MP*)
6156     if test -d /usr/nec; then
6157       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6158       hardcode_shlibpath_var=no
6159       runpath_var=LD_RUN_PATH
6160       hardcode_runpath_var=yes
6161       ld_shlibs=yes
6162     fi
6163     ;;
6164
6165   sysv4.2uw2*)
6166     archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6167     hardcode_direct=yes
6168     hardcode_minus_L=no
6169     hardcode_shlibpath_var=no
6170     hardcode_runpath_var=yes
6171     runpath_var=LD_RUN_PATH
6172     ;;
6173
6174   sysv5uw7* | unixware7*)
6175     no_undefined_flag='${wl}-z ${wl}text'
6176     if test "$GCC" = yes; then
6177       archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6178     else
6179       archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6180     fi
6181     runpath_var='LD_RUN_PATH'
6182     hardcode_shlibpath_var=no
6183     ;;
6184
6185   *)
6186     ld_shlibs=no
6187     ;;
6188   esac
6189 fi
6190 echo "$ac_t""$ld_shlibs" 1>&6
6191 test "$ld_shlibs" = no && can_build_shared=no
6192 ##
6193 ## END FIXME
6194
6195 ## FIXME: this should be a separate macro
6196 ##
6197 # Check hardcoding attributes.
6198 echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6
6199 echo "configure:6200: checking how to hardcode library paths into programs" >&5
6200 hardcode_action=
6201 if test -n "$hardcode_libdir_flag_spec" || \
6202    test -n "$runpath_var"; then
6203
6204   # We can hardcode non-existant directories.
6205   if test "$hardcode_direct" != no &&
6206      # If the only mechanism to avoid hardcoding is shlibpath_var, we
6207      # have to relink, otherwise we might link with an installed library
6208      # when we should be linking with a yet-to-be-installed one
6209      ## test "$hardcode_shlibpath_var" != no &&
6210      test "$hardcode_minus_L" != no; then
6211     # Linking always hardcodes the temporary library directory.
6212     hardcode_action=relink
6213   else
6214     # We can link without hardcoding, and we can hardcode nonexisting dirs.
6215     hardcode_action=immediate
6216   fi
6217 else
6218   # We cannot hardcode anything, or else we can only hardcode existing
6219   # directories.
6220   hardcode_action=unsupported
6221 fi
6222 echo "$ac_t""$hardcode_action" 1>&6
6223 ##
6224 ## END FIXME
6225
6226 ## FIXME: this should be a separate macro
6227 ##
6228 striplib=
6229 old_striplib=
6230 echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6
6231 echo "configure:6232: checking whether stripping libraries is possible" >&5
6232 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
6233   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
6234   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
6235   echo "$ac_t""yes" 1>&6
6236 else
6237   echo "$ac_t""no" 1>&6
6238 fi
6239 ##
6240 ## END FIXME
6241
6242 reload_cmds='$LD$reload_flag -o $output$reload_objs'
6243 test -z "$deplibs_check_method" && deplibs_check_method=unknown
6244
6245 ## FIXME: this should be a separate macro
6246 ##
6247 # PORTME Fill in your ld.so characteristics
6248 echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6
6249 echo "configure:6250: checking dynamic linker characteristics" >&5
6250 library_names_spec=
6251 libname_spec='lib$name'
6252 soname_spec=
6253 postinstall_cmds=
6254 postuninstall_cmds=
6255 finish_cmds=
6256 finish_eval=
6257 shlibpath_var=
6258 shlibpath_overrides_runpath=unknown
6259 version_type=none
6260 dynamic_linker="$host_os ld.so"
6261 sys_lib_dlsearch_path_spec="/lib /usr/lib"
6262 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
6263
6264 case $host_os in
6265 aix3*)
6266   version_type=linux
6267   library_names_spec='${libname}${release}.so$versuffix $libname.a'
6268   shlibpath_var=LIBPATH
6269
6270   # AIX has no versioning support, so we append a major version to the name.
6271   soname_spec='${libname}${release}.so$major'
6272   ;;
6273
6274 aix4* | aix5*)
6275   version_type=linux
6276   need_lib_prefix=no
6277   need_version=no
6278   hardcode_into_libs=yes
6279   if test "$host_cpu" = ia64; then
6280     # AIX 5 supports IA64
6281     library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
6282     shlibpath_var=LD_LIBRARY_PATH
6283   else
6284     # With GCC up to 2.95.x, collect2 would create an import file
6285     # for dependence libraries.  The import file would start with
6286     # the line `#! .'.  This would cause the generated library to
6287     # depend on `.', always an invalid library.  This was fixed in
6288     # development snapshots of GCC prior to 3.0.
6289     case $host_os in
6290       aix4 | aix4.[01] | aix4.[01].*)
6291         if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
6292              echo ' yes '
6293              echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
6294           :
6295         else
6296           can_build_shared=no
6297         fi
6298         ;;
6299     esac
6300     # AIX (on Power*) has no versioning support, so currently we can
6301     # not hardcode correct soname into executable. Probably we can
6302     # add versioning support to collect2, so additional links can
6303     # be useful in future.
6304     if test "$aix_use_runtimelinking" = yes; then
6305       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
6306       # instead of lib<name>.a to let people know that these are not
6307       # typical AIX shared libraries.
6308       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6309     else
6310       # We preserve .a as extension for shared libraries through AIX4.2
6311       # and later when we are not doing run time linking.
6312       library_names_spec='${libname}${release}.a $libname.a'
6313       soname_spec='${libname}${release}.so$major'
6314     fi
6315     shlibpath_var=LIBPATH
6316   fi
6317   hardcode_into_libs=yes
6318   ;;
6319
6320 amigaos*)
6321   library_names_spec='$libname.ixlibrary $libname.a'
6322   # Create ${libname}_ixlibrary.a entries in /sys/libs.
6323   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'
6324   ;;
6325
6326 beos*)
6327   library_names_spec='${libname}.so'
6328   dynamic_linker="$host_os ld.so"
6329   shlibpath_var=LIBRARY_PATH
6330   ;;
6331
6332 bsdi4*)
6333   version_type=linux
6334   need_version=no
6335   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6336   soname_spec='${libname}${release}.so$major'
6337   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
6338   shlibpath_var=LD_LIBRARY_PATH
6339   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
6340   sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
6341   export_dynamic_flag_spec=-rdynamic
6342   # the default ld.so.conf also contains /usr/contrib/lib and
6343   # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
6344   # libtool to hard-code these into programs
6345   ;;
6346
6347 cygwin* | mingw* | pw32*)
6348   version_type=windows
6349   need_version=no
6350   need_lib_prefix=no
6351   case $GCC,$host_os in
6352   yes,cygwin*)
6353     library_names_spec='$libname.dll.a'
6354     soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
6355     postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
6356       dldir=$destdir/`dirname \$dlpath`~
6357       test -d \$dldir || mkdir -p \$dldir~
6358       $install_prog .libs/$dlname \$dldir/$dlname'
6359     postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
6360       dlpath=$dir/\$dldll~
6361        $rm \$dlpath'
6362     ;;
6363   yes,mingw*)
6364     library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
6365     sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
6366     ;;
6367   yes,pw32*)
6368     library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll'
6369     ;;
6370   *)
6371     library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
6372     ;;
6373   esac
6374   dynamic_linker='Win32 ld.exe'
6375   # FIXME: first we should search . and the directory the executable is in
6376   shlibpath_var=PATH
6377   ;;
6378
6379 darwin* | rhapsody*)
6380   dynamic_linker="$host_os dyld"
6381   version_type=darwin
6382   need_lib_prefix=no
6383   need_version=no
6384   # FIXME: Relying on posixy $() will cause problems for
6385   #        cross-compilation, but unfortunately the echo tests do not
6386   #        yet detect zsh echo's removal of \ escapes.
6387   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)'
6388   soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
6389   shlibpath_overrides_runpath=yes
6390   shlibpath_var=DYLD_LIBRARY_PATH
6391   ;;
6392
6393 freebsd1*)
6394   dynamic_linker=no
6395   ;;
6396
6397 freebsd*)
6398   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
6399   version_type=freebsd-$objformat
6400   case $version_type in
6401     freebsd-elf*)
6402       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
6403       need_version=no
6404       need_lib_prefix=no
6405       ;;
6406     freebsd-*)
6407       library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
6408       need_version=yes
6409       ;;
6410   esac
6411   shlibpath_var=LD_LIBRARY_PATH
6412   case $host_os in
6413   freebsd2*)
6414     shlibpath_overrides_runpath=yes
6415     ;;
6416   *)
6417     shlibpath_overrides_runpath=no
6418     hardcode_into_libs=yes
6419     ;;
6420   esac
6421   ;;
6422
6423 gnu*)
6424   version_type=linux
6425   need_lib_prefix=no
6426   need_version=no
6427   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
6428   soname_spec='${libname}${release}.so$major'
6429   shlibpath_var=LD_LIBRARY_PATH
6430   hardcode_into_libs=yes
6431   ;;
6432
6433 hpux9* | hpux10* | hpux11*)
6434   # Give a soname corresponding to the major version so that dld.sl refuses to
6435   # link against other versions.
6436   dynamic_linker="$host_os dld.sl"
6437   version_type=sunos
6438   need_lib_prefix=no
6439   need_version=no
6440   shlibpath_var=SHLIB_PATH
6441   shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
6442   library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
6443   soname_spec='${libname}${release}.sl$major'
6444   # HP-UX runs *really* slowly unless shared libraries are mode 555.
6445   postinstall_cmds='chmod 555 $lib'
6446   ;;
6447
6448 irix5* | irix6* | nonstopux*)
6449   case $host_os in
6450     nonstopux*) version_type=nonstopux ;;
6451     *)          version_type=irix ;;
6452   esac
6453   need_lib_prefix=no
6454   need_version=no
6455   soname_spec='${libname}${release}.so$major'
6456   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
6457   case $host_os in
6458   irix5* | nonstopux*)
6459     libsuff= shlibsuff=
6460     ;;
6461   *)
6462     case $LD in # libtool.m4 will add one of these switches to LD
6463     *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
6464     *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
6465     *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
6466     *) libsuff= shlibsuff= libmagic=never-match;;
6467     esac
6468     ;;
6469   esac
6470   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
6471   shlibpath_overrides_runpath=no
6472   sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
6473   sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
6474   ;;
6475
6476 # No shared lib support for Linux oldld, aout, or coff.
6477 linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
6478   dynamic_linker=no
6479   ;;
6480
6481 # This must be Linux ELF.
6482 linux-gnu*)
6483   version_type=linux
6484   need_lib_prefix=no
6485   need_version=no
6486   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6487   soname_spec='${libname}${release}.so$major'
6488   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
6489   shlibpath_var=LD_LIBRARY_PATH
6490   shlibpath_overrides_runpath=no
6491   # This implies no fast_install, which is unacceptable.
6492   # Some rework will be needed to allow for fast_install
6493   # before this can be enabled.
6494   hardcode_into_libs=yes
6495
6496   # We used to test for /lib/ld.so.1 and disable shared libraries on
6497   # powerpc, because MkLinux only supported shared libraries with the
6498   # GNU dynamic linker.  Since this was broken with cross compilers,
6499   # most powerpc-linux boxes support dynamic linking these days and
6500   # people can always --disable-shared, the test was removed, and we
6501   # assume the GNU/Linux dynamic linker is in use.
6502   dynamic_linker='GNU/Linux ld.so'
6503   ;;
6504
6505 netbsd*)
6506   version_type=sunos
6507   need_lib_prefix=no
6508   need_version=no
6509   if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6510     library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6511     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6512     dynamic_linker='NetBSD (a.out) ld.so'
6513   else
6514     library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
6515     soname_spec='${libname}${release}.so$major'
6516     dynamic_linker='NetBSD ld.elf_so'
6517   fi
6518   shlibpath_var=LD_LIBRARY_PATH
6519   shlibpath_overrides_runpath=yes
6520   hardcode_into_libs=yes
6521   ;;
6522
6523 newsos6)
6524   version_type=linux
6525   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6526   shlibpath_var=LD_LIBRARY_PATH
6527   shlibpath_overrides_runpath=yes
6528   ;;
6529
6530 openbsd*)
6531   version_type=sunos
6532   need_lib_prefix=no
6533   need_version=no
6534   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6535     case "$host_os" in
6536     openbsd2.[89] | openbsd2.[89].*)
6537       shlibpath_overrides_runpath=no
6538       ;;
6539     *)
6540       shlibpath_overrides_runpath=yes
6541       ;;
6542     esac
6543   else
6544     shlibpath_overrides_runpath=yes
6545   fi
6546   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6547   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6548   shlibpath_var=LD_LIBRARY_PATH
6549   ;;
6550
6551 os2*)
6552   libname_spec='$name'
6553   need_lib_prefix=no
6554   library_names_spec='$libname.dll $libname.a'
6555   dynamic_linker='OS/2 ld.exe'
6556   shlibpath_var=LIBPATH
6557   ;;
6558
6559 osf3* | osf4* | osf5*)
6560   version_type=osf
6561   need_version=no
6562   soname_spec='${libname}${release}.so$major'
6563   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6564   shlibpath_var=LD_LIBRARY_PATH
6565   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
6566   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
6567   hardcode_into_libs=yes
6568   ;;
6569
6570 sco3.2v5*)
6571   version_type=osf
6572   soname_spec='${libname}${release}.so$major'
6573   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6574   shlibpath_var=LD_LIBRARY_PATH
6575   ;;
6576
6577 solaris*)
6578   version_type=linux
6579   need_lib_prefix=no
6580   need_version=no
6581   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6582   soname_spec='${libname}${release}.so$major'
6583   shlibpath_var=LD_LIBRARY_PATH
6584   shlibpath_overrides_runpath=yes
6585   hardcode_into_libs=yes
6586   # ldd complains unless libraries are executable
6587   postinstall_cmds='chmod +x $lib'
6588   ;;
6589
6590 sunos4*)
6591   version_type=sunos
6592   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6593   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
6594   shlibpath_var=LD_LIBRARY_PATH
6595   shlibpath_overrides_runpath=yes
6596   if test "$with_gnu_ld" = yes; then
6597     need_lib_prefix=no
6598   fi
6599   need_version=yes
6600   ;;
6601
6602 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6603   version_type=linux
6604   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6605   soname_spec='${libname}${release}.so$major'
6606   shlibpath_var=LD_LIBRARY_PATH
6607   case $host_vendor in
6608     sni)
6609       shlibpath_overrides_runpath=no
6610       need_lib_prefix=no
6611       export_dynamic_flag_spec='${wl}-Blargedynsym'
6612       runpath_var=LD_RUN_PATH
6613       ;;
6614     siemens)
6615       need_lib_prefix=no
6616       ;;
6617     motorola)
6618       need_lib_prefix=no
6619       need_version=no
6620       shlibpath_overrides_runpath=no
6621       sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
6622       ;;
6623   esac
6624   ;;
6625
6626 uts4*)
6627   version_type=linux
6628   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6629   soname_spec='${libname}${release}.so$major'
6630   shlibpath_var=LD_LIBRARY_PATH
6631   ;;
6632
6633 dgux*)
6634   version_type=linux
6635   need_lib_prefix=no
6636   need_version=no
6637   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6638   soname_spec='${libname}${release}.so$major'
6639   shlibpath_var=LD_LIBRARY_PATH
6640   ;;
6641
6642 sysv4*MP*)
6643   if test -d /usr/nec ;then
6644     version_type=linux
6645     library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
6646     soname_spec='$libname.so.$major'
6647     shlibpath_var=LD_LIBRARY_PATH
6648   fi
6649   ;;
6650
6651 *)
6652   dynamic_linker=no
6653   ;;
6654 esac
6655 echo "$ac_t""$dynamic_linker" 1>&6
6656 test "$dynamic_linker" = no && can_build_shared=no
6657 ##
6658 ## END FIXME
6659
6660 ## FIXME: this should be a separate macro
6661 ##
6662 # Report the final consequences.
6663 echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6
6664 echo "configure:6665: checking if libtool supports shared libraries" >&5
6665 echo "$ac_t""$can_build_shared" 1>&6
6666 ##
6667 ## END FIXME
6668
6669 ## FIXME: this should be a separate macro
6670 ##
6671 echo $ac_n "checking whether to build shared libraries""... $ac_c" 1>&6
6672 echo "configure:6673: checking whether to build shared libraries" >&5
6673 test "$can_build_shared" = "no" && enable_shared=no
6674
6675 # On AIX, shared libraries and static libraries use the same namespace, and
6676 # are all built from PIC.
6677 case "$host_os" in
6678 aix3*)
6679   test "$enable_shared" = yes && enable_static=no
6680   if test -n "$RANLIB"; then
6681     archive_cmds="$archive_cmds~\$RANLIB \$lib"
6682     postinstall_cmds='$RANLIB $lib'
6683   fi
6684   ;;
6685
6686 aix4*)
6687   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6688     test "$enable_shared" = yes && enable_static=no
6689   fi
6690   ;;
6691 esac
6692 echo "$ac_t""$enable_shared" 1>&6
6693 ##
6694 ## END FIXME
6695
6696 ## FIXME: this should be a separate macro
6697 ##
6698 echo $ac_n "checking whether to build static libraries""... $ac_c" 1>&6
6699 echo "configure:6700: checking whether to build static libraries" >&5
6700 # Make sure either enable_shared or enable_static is yes.
6701 test "$enable_shared" = yes || enable_static=yes
6702 echo "$ac_t""$enable_static" 1>&6
6703 ##
6704 ## END FIXME
6705
6706 if test "$hardcode_action" = relink; then
6707   # Fast installation is not supported
6708   enable_fast_install=no
6709 elif test "$shlibpath_overrides_runpath" = yes ||
6710      test "$enable_shared" = no; then
6711   # Fast installation is not necessary
6712   enable_fast_install=needless
6713 fi
6714
6715 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
6716 if test "$GCC" = yes; then
6717   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
6718 fi
6719
6720 if test "x$enable_dlopen" != xyes; then
6721   enable_dlopen=unknown
6722   enable_dlopen_self=unknown
6723   enable_dlopen_self_static=unknown
6724 else
6725   lt_cv_dlopen=no
6726   lt_cv_dlopen_libs=
6727
6728   case $host_os in
6729   beos*)
6730     lt_cv_dlopen="load_add_on"
6731     lt_cv_dlopen_libs=
6732     lt_cv_dlopen_self=yes
6733     ;;
6734
6735   cygwin* | mingw* | pw32*)
6736     lt_cv_dlopen="LoadLibrary"
6737     lt_cv_dlopen_libs=
6738    ;;
6739
6740   *)
6741     echo $ac_n "checking for shl_load""... $ac_c" 1>&6
6742 echo "configure:6743: checking for shl_load" >&5
6743 if eval "test \"\${ac_cv_func_shl_load+set}\" = set"; then
6744   echo $ac_n "(cached) $ac_c" 1>&6
6745 else
6746   cat > conftest.$ac_ext <<EOF
6747 #line 6748 "configure"
6748 #include "confdefs.h"
6749 /* System header to define __stub macros and hopefully few prototypes,
6750     which can conflict with char shl_load(); below.  */
6751 #include <assert.h>
6752 /* Override any gcc2 internal prototype to avoid an error.  */
6753 /* We use char because int might match the return type of a gcc2
6754     builtin and then its argument prototype would still apply.  */
6755 char shl_load();
6756 char (*f)();
6757
6758 int main() {
6759
6760 /* The GNU C library defines this for functions which it implements
6761     to always fail with ENOSYS.  Some functions are actually named
6762     something starting with __ and the normal name is an alias.  */
6763 #if defined (__stub_shl_load) || defined (__stub___shl_load)
6764 choke me
6765 #else
6766 f = shl_load;
6767 #endif
6768
6769 ; return 0; }
6770 EOF
6771 if { (eval echo configure:6772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6772   rm -rf conftest*
6773   eval "ac_cv_func_shl_load=yes"
6774 else
6775   echo "configure: failed program was:" >&5
6776   cat conftest.$ac_ext >&5
6777   rm -rf conftest*
6778   eval "ac_cv_func_shl_load=no"
6779 fi
6780 rm -f conftest*
6781 fi
6782
6783 if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
6784   echo "$ac_t""yes" 1>&6
6785   lt_cv_dlopen="shl_load"
6786 else
6787   echo "$ac_t""no" 1>&6
6788 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
6789 echo "configure:6790: checking for shl_load in -ldld" >&5
6790 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-:%__p__%'`
6791 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6792   echo $ac_n "(cached) $ac_c" 1>&6
6793 else
6794   ac_save_LIBS="$LIBS"
6795 LIBS="-ldld  $LIBS"
6796 cat > conftest.$ac_ext <<EOF
6797 #line 6798 "configure"
6798 #include "confdefs.h"
6799 /* Override any gcc2 internal prototype to avoid an error.  */
6800 /* We use char because int might match the return type of a gcc2
6801     builtin and then its argument prototype would still apply.  */
6802 char shl_load();
6803
6804 int main() {
6805 shl_load()
6806 ; return 0; }
6807 EOF
6808 if { (eval echo configure:6809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6809   rm -rf conftest*
6810   eval "ac_cv_lib_$ac_lib_var=yes"
6811 else
6812   echo "configure: failed program was:" >&5
6813   cat conftest.$ac_ext >&5
6814   rm -rf conftest*
6815   eval "ac_cv_lib_$ac_lib_var=no"
6816 fi
6817 rm -f conftest*
6818 LIBS="$ac_save_LIBS"
6819
6820 fi
6821 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6822   echo "$ac_t""yes" 1>&6
6823   lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
6824 else
6825   echo "$ac_t""no" 1>&6
6826 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
6827 echo "configure:6828: checking for dlopen" >&5
6828 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
6829   echo $ac_n "(cached) $ac_c" 1>&6
6830 else
6831   cat > conftest.$ac_ext <<EOF
6832 #line 6833 "configure"
6833 #include "confdefs.h"
6834 /* System header to define __stub macros and hopefully few prototypes,
6835     which can conflict with char dlopen(); below.  */
6836 #include <assert.h>
6837 /* Override any gcc2 internal prototype to avoid an error.  */
6838 /* We use char because int might match the return type of a gcc2
6839     builtin and then its argument prototype would still apply.  */
6840 char dlopen();
6841 char (*f)();
6842
6843 int main() {
6844
6845 /* The GNU C library defines this for functions which it implements
6846     to always fail with ENOSYS.  Some functions are actually named
6847     something starting with __ and the normal name is an alias.  */
6848 #if defined (__stub_dlopen) || defined (__stub___dlopen)
6849 choke me
6850 #else
6851 f = dlopen;
6852 #endif
6853
6854 ; return 0; }
6855 EOF
6856 if { (eval echo configure:6857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6857   rm -rf conftest*
6858   eval "ac_cv_func_dlopen=yes"
6859 else
6860   echo "configure: failed program was:" >&5
6861   cat conftest.$ac_ext >&5
6862   rm -rf conftest*
6863   eval "ac_cv_func_dlopen=no"
6864 fi
6865 rm -f conftest*
6866 fi
6867
6868 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
6869   echo "$ac_t""yes" 1>&6
6870   lt_cv_dlopen="dlopen"
6871 else
6872   echo "$ac_t""no" 1>&6
6873 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
6874 echo "configure:6875: checking for dlopen in -ldl" >&5
6875 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
6876 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6877   echo $ac_n "(cached) $ac_c" 1>&6
6878 else
6879   ac_save_LIBS="$LIBS"
6880 LIBS="-ldl  $LIBS"
6881 cat > conftest.$ac_ext <<EOF
6882 #line 6883 "configure"
6883 #include "confdefs.h"
6884 /* Override any gcc2 internal prototype to avoid an error.  */
6885 /* We use char because int might match the return type of a gcc2
6886     builtin and then its argument prototype would still apply.  */
6887 char dlopen();
6888
6889 int main() {
6890 dlopen()
6891 ; return 0; }
6892 EOF
6893 if { (eval echo configure:6894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6894   rm -rf conftest*
6895   eval "ac_cv_lib_$ac_lib_var=yes"
6896 else
6897   echo "configure: failed program was:" >&5
6898   cat conftest.$ac_ext >&5
6899   rm -rf conftest*
6900   eval "ac_cv_lib_$ac_lib_var=no"
6901 fi
6902 rm -f conftest*
6903 LIBS="$ac_save_LIBS"
6904
6905 fi
6906 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6907   echo "$ac_t""yes" 1>&6
6908   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
6909 else
6910   echo "$ac_t""no" 1>&6
6911 echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
6912 echo "configure:6913: checking for dlopen in -lsvld" >&5
6913 ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-:%__p__%'`
6914 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6915   echo $ac_n "(cached) $ac_c" 1>&6
6916 else
6917   ac_save_LIBS="$LIBS"
6918 LIBS="-lsvld  $LIBS"
6919 cat > conftest.$ac_ext <<EOF
6920 #line 6921 "configure"
6921 #include "confdefs.h"
6922 /* Override any gcc2 internal prototype to avoid an error.  */
6923 /* We use char because int might match the return type of a gcc2
6924     builtin and then its argument prototype would still apply.  */
6925 char dlopen();
6926
6927 int main() {
6928 dlopen()
6929 ; return 0; }
6930 EOF
6931 if { (eval echo configure:6932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6932   rm -rf conftest*
6933   eval "ac_cv_lib_$ac_lib_var=yes"
6934 else
6935   echo "configure: failed program was:" >&5
6936   cat conftest.$ac_ext >&5
6937   rm -rf conftest*
6938   eval "ac_cv_lib_$ac_lib_var=no"
6939 fi
6940 rm -f conftest*
6941 LIBS="$ac_save_LIBS"
6942
6943 fi
6944 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6945   echo "$ac_t""yes" 1>&6
6946   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
6947 else
6948   echo "$ac_t""no" 1>&6
6949 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
6950 echo "configure:6951: checking for dld_link in -ldld" >&5
6951 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-:%__p__%'`
6952 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6953   echo $ac_n "(cached) $ac_c" 1>&6
6954 else
6955   ac_save_LIBS="$LIBS"
6956 LIBS="-ldld  $LIBS"
6957 cat > conftest.$ac_ext <<EOF
6958 #line 6959 "configure"
6959 #include "confdefs.h"
6960 /* Override any gcc2 internal prototype to avoid an error.  */
6961 /* We use char because int might match the return type of a gcc2
6962     builtin and then its argument prototype would still apply.  */
6963 char dld_link();
6964
6965 int main() {
6966 dld_link()
6967 ; return 0; }
6968 EOF
6969 if { (eval echo configure:6970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6970   rm -rf conftest*
6971   eval "ac_cv_lib_$ac_lib_var=yes"
6972 else
6973   echo "configure: failed program was:" >&5
6974   cat conftest.$ac_ext >&5
6975   rm -rf conftest*
6976   eval "ac_cv_lib_$ac_lib_var=no"
6977 fi
6978 rm -f conftest*
6979 LIBS="$ac_save_LIBS"
6980
6981 fi
6982 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6983   echo "$ac_t""yes" 1>&6
6984   lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
6985 else
6986   echo "$ac_t""no" 1>&6
6987 fi
6988
6989               
6990 fi
6991
6992             
6993 fi
6994
6995           
6996 fi
6997
6998         
6999 fi
7000
7001       
7002 fi
7003
7004     ;;
7005   esac
7006
7007   if test "x$lt_cv_dlopen" != xno; then
7008     enable_dlopen=yes
7009   else
7010     enable_dlopen=no
7011   fi
7012
7013   case $lt_cv_dlopen in
7014   dlopen)
7015     save_CPPFLAGS="$CPPFLAGS"
7016         test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
7017
7018     save_LDFLAGS="$LDFLAGS"
7019     eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
7020
7021     save_LIBS="$LIBS"
7022     LIBS="$lt_cv_dlopen_libs $LIBS"
7023
7024     echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
7025 echo "configure:7026: checking whether a program can dlopen itself" >&5
7026 if eval "test \"\${lt_cv_dlopen_self+set}\" = set"; then
7027   echo $ac_n "(cached) $ac_c" 1>&6
7028 else
7029           if test "$cross_compiling" = yes; then :
7030   lt_cv_dlopen_self=cross
7031 else
7032     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
7033   lt_status=$lt_dlunknown
7034   cat > conftest.$ac_ext <<EOF
7035 #line 7036 "configure"
7036 #include "confdefs.h"
7037
7038 #if HAVE_DLFCN_H
7039 #include <dlfcn.h>
7040 #endif
7041
7042 #include <stdio.h>
7043
7044 #ifdef RTLD_GLOBAL
7045 #  define LT_DLGLOBAL           RTLD_GLOBAL
7046 #else
7047 #  ifdef DL_GLOBAL
7048 #    define LT_DLGLOBAL         DL_GLOBAL
7049 #  else
7050 #    define LT_DLGLOBAL         0
7051 #  endif
7052 #endif
7053
7054 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
7055    find out it does not work in some platform. */
7056 #ifndef LT_DLLAZY_OR_NOW
7057 #  ifdef RTLD_LAZY
7058 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
7059 #  else
7060 #    ifdef DL_LAZY
7061 #      define LT_DLLAZY_OR_NOW          DL_LAZY
7062 #    else
7063 #      ifdef RTLD_NOW
7064 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
7065 #      else
7066 #        ifdef DL_NOW
7067 #          define LT_DLLAZY_OR_NOW      DL_NOW
7068 #        else
7069 #          define LT_DLLAZY_OR_NOW      0
7070 #        endif
7071 #      endif
7072 #    endif
7073 #  endif
7074 #endif
7075
7076 #ifdef __cplusplus
7077 extern "C" void exit (int);
7078 #endif
7079
7080 void fnord() { int i=42;}
7081 int main ()
7082 {
7083   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
7084   int status = $lt_dlunknown;
7085
7086   if (self)
7087     {
7088       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
7089       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
7090       /* dlclose (self); */
7091     }
7092
7093     exit (status);
7094 }
7095 EOF
7096   if { (eval echo configure:7097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
7097     (./conftest; exit; ) 2>/dev/null
7098     lt_status=$?
7099     case x$lt_status in
7100       x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
7101       x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
7102       x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
7103     esac
7104   else :
7105     # compilation failed
7106     lt_cv_dlopen_self=no
7107   fi
7108 fi
7109 rm -fr conftest*
7110
7111     
7112 fi
7113
7114 echo "$ac_t""$lt_cv_dlopen_self" 1>&6
7115
7116     if test "x$lt_cv_dlopen_self" = xyes; then
7117       LDFLAGS="$LDFLAGS $link_static_flag"
7118       echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
7119 echo "configure:7120: checking whether a statically linked program can dlopen itself" >&5
7120 if eval "test \"\${lt_cv_dlopen_self_static+set}\" = set"; then
7121   echo $ac_n "(cached) $ac_c" 1>&6
7122 else
7123           if test "$cross_compiling" = yes; then :
7124   lt_cv_dlopen_self_static=cross
7125 else
7126     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
7127   lt_status=$lt_dlunknown
7128   cat > conftest.$ac_ext <<EOF
7129 #line 7130 "configure"
7130 #include "confdefs.h"
7131
7132 #if HAVE_DLFCN_H
7133 #include <dlfcn.h>
7134 #endif
7135
7136 #include <stdio.h>
7137
7138 #ifdef RTLD_GLOBAL
7139 #  define LT_DLGLOBAL           RTLD_GLOBAL
7140 #else
7141 #  ifdef DL_GLOBAL
7142 #    define LT_DLGLOBAL         DL_GLOBAL
7143 #  else
7144 #    define LT_DLGLOBAL         0
7145 #  endif
7146 #endif
7147
7148 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
7149    find out it does not work in some platform. */
7150 #ifndef LT_DLLAZY_OR_NOW
7151 #  ifdef RTLD_LAZY
7152 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
7153 #  else
7154 #    ifdef DL_LAZY
7155 #      define LT_DLLAZY_OR_NOW          DL_LAZY
7156 #    else
7157 #      ifdef RTLD_NOW
7158 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
7159 #      else
7160 #        ifdef DL_NOW
7161 #          define LT_DLLAZY_OR_NOW      DL_NOW
7162 #        else
7163 #          define LT_DLLAZY_OR_NOW      0
7164 #        endif
7165 #      endif
7166 #    endif
7167 #  endif
7168 #endif
7169
7170 #ifdef __cplusplus
7171 extern "C" void exit (int);
7172 #endif
7173
7174 void fnord() { int i=42;}
7175 int main ()
7176 {
7177   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
7178   int status = $lt_dlunknown;
7179
7180   if (self)
7181     {
7182       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
7183       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
7184       /* dlclose (self); */
7185     }
7186
7187     exit (status);
7188 }
7189 EOF
7190   if { (eval echo configure:7191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
7191     (./conftest; exit; ) 2>/dev/null
7192     lt_status=$?
7193     case x$lt_status in
7194       x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
7195       x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
7196       x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
7197     esac
7198   else :
7199     # compilation failed
7200     lt_cv_dlopen_self_static=no
7201   fi
7202 fi
7203 rm -fr conftest*
7204
7205       
7206 fi
7207
7208 echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
7209     fi
7210
7211     CPPFLAGS="$save_CPPFLAGS"
7212     LDFLAGS="$save_LDFLAGS"
7213     LIBS="$save_LIBS"
7214     ;;
7215   esac
7216
7217   case $lt_cv_dlopen_self in
7218   yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
7219   *) enable_dlopen_self=unknown ;;
7220   esac
7221
7222   case $lt_cv_dlopen_self_static in
7223   yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
7224   *) enable_dlopen_self_static=unknown ;;
7225   esac
7226 fi
7227
7228
7229 ## FIXME: this should be a separate macro
7230 ##
7231 if test "$enable_shared" = yes && test "$GCC" = yes; then
7232   case $archive_cmds in
7233   *'~'*)
7234     # FIXME: we may have to deal with multi-command sequences.
7235     ;;
7236   '$CC '*)
7237     # Test whether the compiler implicitly links with -lc since on some
7238     # systems, -lgcc has to come before -lc. If gcc already passes -lc
7239     # to ld, don't add -lc before -lgcc.
7240     echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6
7241 echo "configure:7242: checking whether -lc should be explicitly linked in" >&5
7242     if eval "test \"\${lt_cv_archive_cmds_need_lc+set}\" = set"; then
7243   echo $ac_n "(cached) $ac_c" 1>&6
7244 else
7245   $rm conftest*
7246     echo 'static int dummy;' > conftest.$ac_ext
7247
7248     if { (eval echo configure:7249: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7249       soname=conftest
7250       lib=conftest
7251       libobjs=conftest.$ac_objext
7252       deplibs=
7253       wl=$lt_cv_prog_cc_wl
7254       compiler_flags=-v
7255       linker_flags=-v
7256       verstring=
7257       output_objdir=.
7258       libname=conftest
7259       save_allow_undefined_flag=$allow_undefined_flag
7260       allow_undefined_flag=
7261       if { (eval echo configure:7262: \"$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; }
7262       then
7263         lt_cv_archive_cmds_need_lc=no
7264       else
7265         lt_cv_archive_cmds_need_lc=yes
7266       fi
7267       allow_undefined_flag=$save_allow_undefined_flag
7268     else
7269       cat conftest.err 1>&5
7270     fi
7271 fi
7272
7273     echo "$ac_t""$lt_cv_archive_cmds_need_lc" 1>&6
7274     ;;
7275   esac
7276 fi
7277 need_lc=${lt_cv_archive_cmds_need_lc-yes}
7278 ##
7279 ## END FIXME
7280
7281 ## FIXME: this should be a separate macro
7282 ##
7283 # The second clause should only fire when bootstrapping the
7284 # libtool distribution, otherwise you forgot to ship ltmain.sh
7285 # with your package, and you will get complaints that there are
7286 # no rules to generate ltmain.sh.
7287 if test -f "$ltmain"; then
7288   :
7289 else
7290   # If there is no Makefile yet, we rely on a make rule to execute
7291   # `config.status --recheck' to rerun these tests and create the
7292   # libtool script then.
7293   test -f Makefile && make "$ltmain"
7294 fi
7295
7296 if test -f "$ltmain"; then
7297   trap "$rm \"${ofile}T\"; exit 1" 1 2 15
7298   $rm -f "${ofile}T"
7299
7300   echo creating $ofile
7301
7302   # Now quote all the things that may contain metacharacters while being
7303   # careful not to overquote the AC_SUBSTed values.  We take copies of the
7304   # variables and quote the copies for generation of the libtool script.
7305   for var in echo old_CC old_CFLAGS SED \
7306     AR AR_FLAGS CC LD LN_S NM SHELL \
7307     reload_flag reload_cmds wl \
7308     pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
7309     thread_safe_flag_spec whole_archive_flag_spec libname_spec \
7310     library_names_spec soname_spec \
7311     RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
7312     old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
7313     postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
7314     old_striplib striplib file_magic_cmd export_symbols_cmds \
7315     deplibs_check_method allow_undefined_flag no_undefined_flag \
7316     finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
7317     global_symbol_to_c_name_address \
7318     hardcode_libdir_flag_spec hardcode_libdir_separator  \
7319     sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
7320     compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
7321
7322     case $var in
7323     reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
7324     old_postinstall_cmds | old_postuninstall_cmds | \
7325     export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
7326     extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
7327     postinstall_cmds | postuninstall_cmds | \
7328     finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
7329       # Double-quote double-evaled strings.
7330       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
7331       ;;
7332     *)
7333       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
7334       ;;
7335     esac
7336   done
7337
7338   cat <<__EOF__ > "${ofile}T"
7339 #! $SHELL
7340
7341 # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
7342 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
7343 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
7344 #
7345 # Copyright (C) 1996-2000 Free Software Foundation, Inc.
7346 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7347 #
7348 # This program is free software; you can redistribute it and/or modify
7349 # it under the terms of the GNU General Public License as published by
7350 # the Free Software Foundation; either version 2 of the License, or
7351 # (at your option) any later version.
7352 #
7353 # This program is distributed in the hope that it will be useful, but
7354 # WITHOUT ANY WARRANTY; without even the implied warranty of
7355 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
7356 # General Public License for more details.
7357 #
7358 # You should have received a copy of the GNU General Public License
7359 # along with this program; if not, write to the Free Software
7360 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
7361 #
7362 # As a special exception to the GNU General Public License, if you
7363 # distribute this file as part of a program that contains a
7364 # configuration script generated by Autoconf, you may include it under
7365 # the same distribution terms that you use for the rest of that program.
7366
7367 # A sed that does not truncate output.
7368 SED=$lt_SED
7369
7370 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
7371 Xsed="${SED} -e s/^X//"
7372
7373 # The HP-UX ksh and POSIX shell print the target directory to stdout
7374 # if CDPATH is set.
7375 if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
7376
7377 # ### BEGIN LIBTOOL CONFIG
7378
7379 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
7380
7381 # Shell to use when invoking shell scripts.
7382 SHELL=$lt_SHELL
7383
7384 # Whether or not to build shared libraries.
7385 build_libtool_libs=$enable_shared
7386
7387 # Whether or not to build static libraries.
7388 build_old_libs=$enable_static
7389
7390 # Whether or not to add -lc for building shared libraries.
7391 build_libtool_need_lc=$need_lc
7392
7393 # Whether or not to optimize for fast installation.
7394 fast_install=$enable_fast_install
7395
7396 # The host system.
7397 host_alias=$host_alias
7398 host=$host
7399
7400 # An echo program that does not interpret backslashes.
7401 echo=$lt_echo
7402
7403 # The archiver.
7404 AR=$lt_AR
7405 AR_FLAGS=$lt_AR_FLAGS
7406
7407 # The default C compiler.
7408 CC=$lt_CC
7409
7410 # Is the compiler the GNU C compiler?
7411 with_gcc=$GCC
7412
7413 # The linker used to build libraries.
7414 LD=$lt_LD
7415
7416 # Whether we need hard or soft links.
7417 LN_S=$lt_LN_S
7418
7419 # A BSD-compatible nm program.
7420 NM=$lt_NM
7421
7422 # A symbol stripping program
7423 STRIP=$STRIP
7424
7425 # Used to examine libraries when file_magic_cmd begins "file"
7426 MAGIC_CMD=$MAGIC_CMD
7427
7428 # Used on cygwin: DLL creation program.
7429 DLLTOOL="$DLLTOOL"
7430
7431 # Used on cygwin: object dumper.
7432 OBJDUMP="$OBJDUMP"
7433
7434 # Used on cygwin: assembler.
7435 AS="$AS"
7436
7437 # The name of the directory that contains temporary libtool files.
7438 objdir=$objdir
7439
7440 # How to create reloadable object files.
7441 reload_flag=$lt_reload_flag
7442 reload_cmds=$lt_reload_cmds
7443
7444 # How to pass a linker flag through the compiler.
7445 wl=$lt_wl
7446
7447 # Object file suffix (normally "o").
7448 objext="$ac_objext"
7449
7450 # Old archive suffix (normally "a").
7451 libext="$libext"
7452
7453 # Executable file suffix (normally "").
7454 exeext="$exeext"
7455
7456 # Additional compiler flags for building library objects.
7457 pic_flag=$lt_pic_flag
7458 pic_mode=$pic_mode
7459
7460 # Does compiler simultaneously support -c and -o options?
7461 compiler_c_o=$lt_compiler_c_o
7462
7463 # Can we write directly to a .lo ?
7464 compiler_o_lo=$lt_compiler_o_lo
7465
7466 # Must we lock files when doing compilation ?
7467 need_locks=$lt_need_locks
7468
7469 # Do we need the lib prefix for modules?
7470 need_lib_prefix=$need_lib_prefix
7471
7472 # Do we need a version for libraries?
7473 need_version=$need_version
7474
7475 # Whether dlopen is supported.
7476 dlopen_support=$enable_dlopen
7477
7478 # Whether dlopen of programs is supported.
7479 dlopen_self=$enable_dlopen_self
7480
7481 # Whether dlopen of statically linked programs is supported.
7482 dlopen_self_static=$enable_dlopen_self_static
7483
7484 # Compiler flag to prevent dynamic linking.
7485 link_static_flag=$lt_link_static_flag
7486
7487 # Compiler flag to turn off builtin functions.
7488 no_builtin_flag=$lt_no_builtin_flag
7489
7490 # Compiler flag to allow reflexive dlopens.
7491 export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
7492
7493 # Compiler flag to generate shared objects directly from archives.
7494 whole_archive_flag_spec=$lt_whole_archive_flag_spec
7495
7496 # Compiler flag to generate thread-safe objects.
7497 thread_safe_flag_spec=$lt_thread_safe_flag_spec
7498
7499 # Library versioning type.
7500 version_type=$version_type
7501
7502 # Format of library name prefix.
7503 libname_spec=$lt_libname_spec
7504
7505 # List of archive names.  First name is the real one, the rest are links.
7506 # The last name is the one that the linker finds with -lNAME.
7507 library_names_spec=$lt_library_names_spec
7508
7509 # The coded name of the library, if different from the real name.
7510 soname_spec=$lt_soname_spec
7511
7512 # Commands used to build and install an old-style archive.
7513 RANLIB=$lt_RANLIB
7514 old_archive_cmds=$lt_old_archive_cmds
7515 old_postinstall_cmds=$lt_old_postinstall_cmds
7516 old_postuninstall_cmds=$lt_old_postuninstall_cmds
7517
7518 # Create an old-style archive from a shared archive.
7519 old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
7520
7521 # Create a temporary old-style archive to link instead of a shared archive.
7522 old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
7523
7524 # Commands used to build and install a shared archive.
7525 archive_cmds=$lt_archive_cmds
7526 archive_expsym_cmds=$lt_archive_expsym_cmds
7527 postinstall_cmds=$lt_postinstall_cmds
7528 postuninstall_cmds=$lt_postuninstall_cmds
7529
7530 # Commands to strip libraries.
7531 old_striplib=$lt_old_striplib
7532 striplib=$lt_striplib
7533
7534 # Method to check whether dependent libraries are shared objects.
7535 deplibs_check_method=$lt_deplibs_check_method
7536
7537 # Command to use when deplibs_check_method == file_magic.
7538 file_magic_cmd=$lt_file_magic_cmd
7539
7540 # Flag that allows shared libraries with undefined symbols to be built.
7541 allow_undefined_flag=$lt_allow_undefined_flag
7542
7543 # Flag that forces no undefined symbols.
7544 no_undefined_flag=$lt_no_undefined_flag
7545
7546 # Commands used to finish a libtool library installation in a directory.
7547 finish_cmds=$lt_finish_cmds
7548
7549 # Same as above, but a single script fragment to be evaled but not shown.
7550 finish_eval=$lt_finish_eval
7551
7552 # Take the output of nm and produce a listing of raw symbols and C names.
7553 global_symbol_pipe=$lt_global_symbol_pipe
7554
7555 # Transform the output of nm in a proper C declaration
7556 global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
7557
7558 # Transform the output of nm in a C name address pair
7559 global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
7560
7561 # This is the shared library runtime path variable.
7562 runpath_var=$runpath_var
7563
7564 # This is the shared library path variable.
7565 shlibpath_var=$shlibpath_var
7566
7567 # Is shlibpath searched before the hard-coded library search path?
7568 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
7569
7570 # How to hardcode a shared library path into an executable.
7571 hardcode_action=$hardcode_action
7572
7573 # Whether we should hardcode library paths into libraries.
7574 hardcode_into_libs=$hardcode_into_libs
7575
7576 # Flag to hardcode \$libdir into a binary during linking.
7577 # This must work even if \$libdir does not exist.
7578 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
7579
7580 # Whether we need a single -rpath flag with a separated argument.
7581 hardcode_libdir_separator=$lt_hardcode_libdir_separator
7582
7583 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
7584 # resulting binary.
7585 hardcode_direct=$hardcode_direct
7586
7587 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7588 # resulting binary.
7589 hardcode_minus_L=$hardcode_minus_L
7590
7591 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7592 # the resulting binary.
7593 hardcode_shlibpath_var=$hardcode_shlibpath_var
7594
7595 # Variables whose values should be saved in libtool wrapper scripts and
7596 # restored at relink time.
7597 variables_saved_for_relink="$variables_saved_for_relink"
7598
7599 # Whether libtool must link a program against all its dependency libraries.
7600 link_all_deplibs=$link_all_deplibs
7601
7602 # Compile-time system search path for libraries
7603 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
7604
7605 # Run-time system search path for libraries
7606 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
7607
7608 # Fix the shell variable \$srcfile for the compiler.
7609 fix_srcfile_path="$fix_srcfile_path"
7610
7611 # Set to yes if exported symbols are required.
7612 always_export_symbols=$always_export_symbols
7613
7614 # The commands to list exported symbols.
7615 export_symbols_cmds=$lt_export_symbols_cmds
7616
7617 # The commands to extract the exported symbol list from a shared archive.
7618 extract_expsyms_cmds=$lt_extract_expsyms_cmds
7619
7620 # Symbols that should not be listed in the preloaded symbols.
7621 exclude_expsyms=$lt_exclude_expsyms
7622
7623 # Symbols that must always be exported.
7624 include_expsyms=$lt_include_expsyms
7625
7626 # ### END LIBTOOL CONFIG
7627
7628 __EOF__
7629
7630   case $host_os in
7631   aix3*)
7632     cat <<\EOF >> "${ofile}T"
7633
7634 # AIX sometimes has problems with the GCC collect2 program.  For some
7635 # reason, if we set the COLLECT_NAMES environment variable, the problems
7636 # vanish in a puff of smoke.
7637 if test "X${COLLECT_NAMES+set}" != Xset; then
7638   COLLECT_NAMES=
7639   export COLLECT_NAMES
7640 fi
7641 EOF
7642     ;;
7643   esac
7644
7645   case $host_os in
7646   cygwin* | mingw* | pw32* | os2*)
7647     cat <<'EOF' >> "${ofile}T"
7648       # This is a source program that is used to create dlls on Windows
7649       # Don't remove nor modify the starting and closing comments
7650 # /* ltdll.c starts here */
7651 # #define WIN32_LEAN_AND_MEAN
7652 # #include <windows.h>
7653 # #undef WIN32_LEAN_AND_MEAN
7654 # #include <stdio.h>
7655 #
7656 # #ifndef __CYGWIN__
7657 # #  ifdef __CYGWIN32__
7658 # #    define __CYGWIN__ __CYGWIN32__
7659 # #  endif
7660 # #endif
7661 #
7662 # #ifdef __cplusplus
7663 # extern "C" {
7664 # #endif
7665 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
7666 # #ifdef __cplusplus
7667 # }
7668 # #endif
7669 #
7670 # #ifdef __CYGWIN__
7671 # #include <cygwin/cygwin_dll.h>
7672 # DECLARE_CYGWIN_DLL( DllMain );
7673 # #endif
7674 # HINSTANCE __hDllInstance_base;
7675 #
7676 # BOOL APIENTRY
7677 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
7678 # {
7679 #   __hDllInstance_base = hInst;
7680 #   return TRUE;
7681 # }
7682 # /* ltdll.c ends here */
7683         # This is a source program that is used to create import libraries
7684         # on Windows for dlls which lack them. Don't remove nor modify the
7685         # starting and closing comments
7686 # /* impgen.c starts here */
7687 # /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
7688 #
7689 #  This file is part of GNU libtool.
7690 #
7691 #  This program is free software; you can redistribute it and/or modify
7692 #  it under the terms of the GNU General Public License as published by
7693 #  the Free Software Foundation; either version 2 of the License, or
7694 #  (at your option) any later version.
7695 #
7696 #  This program is distributed in the hope that it will be useful,
7697 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
7698 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
7699 #  GNU General Public License for more details.
7700 #
7701 #  You should have received a copy of the GNU General Public License
7702 #  along with this program; if not, write to the Free Software
7703 #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
7704 #  */
7705 #
7706 # #include <stdio.h>            /* for printf() */
7707 # #include <unistd.h>           /* for open(), lseek(), read() */
7708 # #include <fcntl.h>            /* for O_RDONLY, O_BINARY */
7709 # #include <string.h>           /* for strdup() */
7710 #
7711 # /* O_BINARY isn't required (or even defined sometimes) under Unix */
7712 # #ifndef O_BINARY
7713 # #define O_BINARY 0
7714 # #endif
7715 #
7716 # static unsigned int
7717 # pe_get16 (fd, offset)
7718 #      int fd;
7719 #      int offset;
7720 # {
7721 #   unsigned char b[2];
7722 #   lseek (fd, offset, SEEK_SET);
7723 #   read (fd, b, 2);
7724 #   return b[0] + (b[1]<<8);
7725 # }
7726 #
7727 # static unsigned int
7728 # pe_get32 (fd, offset)
7729 #     int fd;
7730 #     int offset;
7731 # {
7732 #   unsigned char b[4];
7733 #   lseek (fd, offset, SEEK_SET);
7734 #   read (fd, b, 4);
7735 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
7736 # }
7737 #
7738 # static unsigned int
7739 # pe_as32 (ptr)
7740 #      void *ptr;
7741 # {
7742 #   unsigned char *b = ptr;
7743 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
7744 # }
7745 #
7746 # int
7747 # main (argc, argv)
7748 #     int argc;
7749 #     char *argv[];
7750 # {
7751 #     int dll;
7752 #     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
7753 #     unsigned long export_rva, export_size, nsections, secptr, expptr;
7754 #     unsigned long name_rvas, nexp;
7755 #     unsigned char *expdata, *erva;
7756 #     char *filename, *dll_name;
7757 #
7758 #     filename = argv[1];
7759 #
7760 #     dll = open(filename, O_RDONLY|O_BINARY);
7761 #     if (dll < 1)
7762 #       return 1;
7763 #
7764 #     dll_name = filename;
7765 #
7766 #     for (i=0; filename[i]; i++)
7767 #       if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
7768 #           dll_name = filename + i +1;
7769 #
7770 #     pe_header_offset = pe_get32 (dll, 0x3c);
7771 #     opthdr_ofs = pe_header_offset + 4 + 20;
7772 #     num_entries = pe_get32 (dll, opthdr_ofs + 92);
7773 #
7774 #     if (num_entries < 1) /* no exports */
7775 #       return 1;
7776 #
7777 #     export_rva = pe_get32 (dll, opthdr_ofs + 96);
7778 #     export_size = pe_get32 (dll, opthdr_ofs + 100);
7779 #     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
7780 #     secptr = (pe_header_offset + 4 + 20 +
7781 #             pe_get16 (dll, pe_header_offset + 4 + 16));
7782 #
7783 #     expptr = 0;
7784 #     for (i = 0; i < nsections; i++)
7785 #     {
7786 #       char sname[8];
7787 #       unsigned long secptr1 = secptr + 40 * i;
7788 #       unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
7789 #       unsigned long vsize = pe_get32 (dll, secptr1 + 16);
7790 #       unsigned long fptr = pe_get32 (dll, secptr1 + 20);
7791 #       lseek(dll, secptr1, SEEK_SET);
7792 #       read(dll, sname, 8);
7793 #       if (vaddr <= export_rva && vaddr+vsize > export_rva)
7794 #       {
7795 #           expptr = fptr + (export_rva - vaddr);
7796 #           if (export_rva + export_size > vaddr + vsize)
7797 #               export_size = vsize - (export_rva - vaddr);
7798 #           break;
7799 #       }
7800 #     }
7801 #
7802 #     expdata = (unsigned char*)malloc(export_size);
7803 #     lseek (dll, expptr, SEEK_SET);
7804 #     read (dll, expdata, export_size);
7805 #     erva = expdata - export_rva;
7806 #
7807 #     nexp = pe_as32 (expdata+24);
7808 #     name_rvas = pe_as32 (expdata+32);
7809 #
7810 #     printf ("EXPORTS\n");
7811 #     for (i = 0; i<nexp; i++)
7812 #     {
7813 #       unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
7814 #       printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
7815 #     }
7816 #
7817 #     return 0;
7818 # }
7819 # /* impgen.c ends here */
7820
7821 EOF
7822     ;;
7823   esac
7824
7825   # We use sed instead of cat because bash on DJGPP gets confused if
7826   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
7827   # text mode, it properly converts lines to CR/LF.  This bash problem
7828   # is reportedly fixed, but why not run on old versions too?
7829   sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
7830
7831   mv -f "${ofile}T" "$ofile" || \
7832     (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
7833   chmod +x "$ofile"
7834 fi
7835 ##
7836 ## END FIXME
7837
7838
7839
7840
7841
7842 # This can be used to rebuild libtool when needed
7843 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
7844
7845 # Always use our own libtool.
7846 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
7847
7848 # Prevent multiple expansion
7849
7850
7851
7852 # test for ln hardlink support
7853 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
7854 echo "configure:7855: checking whether ln works" >&5
7855 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
7856   echo $ac_n "(cached) $ac_c" 1>&6
7857 else
7858   rm -f conftest.src conftest.dst
7859 echo "conftest" > conftest.src
7860 if ln conftest.src conftest.dst 2>/dev/null
7861 then
7862   ol_cv_prog_LN_H="ln"
7863 else
7864   ol_cv_prog_LN_H="cp"
7865 fi
7866 rm -f conftest.src conftest.dst
7867
7868 fi
7869 LN_H="$ol_cv_prog_LN_H"
7870 if test "$ol_cv_prog_LN_H" = "ln"; then
7871         echo "$ac_t""yes" 1>&6
7872 else
7873         echo "$ac_t""no" 1>&6
7874 fi
7875
7876 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
7877 echo "configure:7878: checking whether ln -s works" >&5
7878 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
7879   echo $ac_n "(cached) $ac_c" 1>&6
7880 else
7881   rm -f conftestdata
7882 if ln -s X conftestdata 2>/dev/null
7883 then
7884   rm -f conftestdata
7885   ac_cv_prog_LN_S="ln -s"
7886 else
7887   ac_cv_prog_LN_S=ln
7888 fi
7889 fi
7890 LN_S="$ac_cv_prog_LN_S"
7891 if test "$ac_cv_prog_LN_S" = "ln -s"; then
7892   echo "$ac_t""yes" 1>&6
7893 else
7894   echo "$ac_t""no" 1>&6
7895 fi
7896
7897
7898 ol_link_perl=no
7899 if test $ol_enable_perl != no ; then
7900         # Extract the first word of "perl", so it can be a program name with args.
7901 set dummy perl; ac_word=$2
7902 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7903 echo "configure:7904: checking for $ac_word" >&5
7904 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
7905   echo $ac_n "(cached) $ac_c" 1>&6
7906 else
7907   case "$PERLBIN" in
7908   /*)
7909   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
7910   ;;
7911   ?:/*)
7912   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
7913   ;;
7914   *)
7915   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7916   ac_dummy="$PATH"
7917   for ac_dir in $ac_dummy; do 
7918     test -z "$ac_dir" && ac_dir=.
7919     if test -f $ac_dir/$ac_word; then
7920       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
7921       break
7922     fi
7923   done
7924   IFS="$ac_save_ifs"
7925   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
7926   ;;
7927 esac
7928 fi
7929 PERLBIN="$ac_cv_path_PERLBIN"
7930 if test -n "$PERLBIN"; then
7931   echo "$ac_t""$PERLBIN" 1>&6
7932 else
7933   echo "$ac_t""no" 1>&6
7934 fi
7935
7936
7937         if test "no$PERLBIN" = "no" ; then
7938                 if test $ol_enable_perl = yes ; then
7939                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
7940                 fi
7941
7942         else
7943                 PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
7944                 if test x"$ol_with_perl_module" = "xstatic" ; then
7945                         SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
7946                 else
7947                         MOD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
7948                 fi
7949                                 ol_link_perl=yes
7950         fi
7951 fi
7952
7953 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
7954 echo "configure:7955: checking how to run the C preprocessor" >&5
7955 # On Suns, sometimes $CPP names a directory.
7956 if test -n "$CPP" && test -d "$CPP"; then
7957   CPP=
7958 fi
7959 if test -z "$CPP"; then
7960 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
7961   echo $ac_n "(cached) $ac_c" 1>&6
7962 else
7963     # This must be in double quotes, not single quotes, because CPP may get
7964   # substituted into the Makefile and "${CC-cc}" will confuse make.
7965   CPP="${CC-cc} -E"
7966   # On the NeXT, cc -E runs the code through the compiler's parser,
7967   # not just through cpp.
7968   cat > conftest.$ac_ext <<EOF
7969 #line 7970 "configure"
7970 #include "confdefs.h"
7971 #include <assert.h>
7972 Syntax Error
7973 EOF
7974 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7975 { (eval echo configure:7976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7976 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7977 if test -z "$ac_err"; then
7978   :
7979 else
7980   echo "$ac_err" >&5
7981   echo "configure: failed program was:" >&5
7982   cat conftest.$ac_ext >&5
7983   rm -rf conftest*
7984   CPP="${CC-cc} -E -traditional-cpp"
7985   cat > conftest.$ac_ext <<EOF
7986 #line 7987 "configure"
7987 #include "confdefs.h"
7988 #include <assert.h>
7989 Syntax Error
7990 EOF
7991 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7992 { (eval echo configure:7993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7993 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7994 if test -z "$ac_err"; then
7995   :
7996 else
7997   echo "$ac_err" >&5
7998   echo "configure: failed program was:" >&5
7999   cat conftest.$ac_ext >&5
8000   rm -rf conftest*
8001   CPP="${CC-cc} -nologo -E"
8002   cat > conftest.$ac_ext <<EOF
8003 #line 8004 "configure"
8004 #include "confdefs.h"
8005 #include <assert.h>
8006 Syntax Error
8007 EOF
8008 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8009 { (eval echo configure:8010: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8010 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8011 if test -z "$ac_err"; then
8012   :
8013 else
8014   echo "$ac_err" >&5
8015   echo "configure: failed program was:" >&5
8016   cat conftest.$ac_ext >&5
8017   rm -rf conftest*
8018   CPP=/lib/cpp
8019 fi
8020 rm -f conftest*
8021 fi
8022 rm -f conftest*
8023 fi
8024 rm -f conftest*
8025   ac_cv_prog_CPP="$CPP"
8026 fi
8027   CPP="$ac_cv_prog_CPP"
8028 else
8029   ac_cv_prog_CPP="$CPP"
8030 fi
8031 echo "$ac_t""$CPP" 1>&6
8032
8033
8034 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
8035         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
8036
8037 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
8038         echo "configure: warning: programs compiled here do run here..." 1>&2
8039         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
8040
8041 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
8042         echo "configure: warning: programs compiled here do not run here..." 1>&2
8043         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
8044 fi
8045
8046
8047 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
8048 echo "configure:8049: checking for Cygwin environment" >&5
8049 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
8050   echo $ac_n "(cached) $ac_c" 1>&6
8051 else
8052   cat > conftest.$ac_ext <<EOF
8053 #line 8054 "configure"
8054 #include "confdefs.h"
8055
8056 int main() {
8057
8058 #ifndef __CYGWIN__
8059 #define __CYGWIN__ __CYGWIN32__
8060 #endif
8061 return __CYGWIN__;
8062 ; return 0; }
8063 EOF
8064 if { (eval echo configure:8065: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8065   rm -rf conftest*
8066   ac_cv_cygwin=yes
8067 else
8068   echo "configure: failed program was:" >&5
8069   cat conftest.$ac_ext >&5
8070   rm -rf conftest*
8071   ac_cv_cygwin=no
8072 fi
8073 rm -f conftest*
8074 fi
8075
8076 echo "$ac_t""$ac_cv_cygwin" 1>&6
8077 CYGWIN=
8078 test "$ac_cv_cygwin" = yes && CYGWIN=yes
8079 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
8080 echo "configure:8081: checking for mingw32 environment" >&5
8081 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
8082   echo $ac_n "(cached) $ac_c" 1>&6
8083 else
8084   cat > conftest.$ac_ext <<EOF
8085 #line 8086 "configure"
8086 #include "confdefs.h"
8087
8088 int main() {
8089 return __MINGW32__;
8090 ; return 0; }
8091 EOF
8092 if { (eval echo configure:8093: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8093   rm -rf conftest*
8094   ac_cv_mingw32=yes
8095 else
8096   echo "configure: failed program was:" >&5
8097   cat conftest.$ac_ext >&5
8098   rm -rf conftest*
8099   ac_cv_mingw32=no
8100 fi
8101 rm -f conftest*
8102 fi
8103
8104 echo "$ac_t""$ac_cv_mingw32" 1>&6
8105 MINGW32=
8106 test "$ac_cv_mingw32" = yes && MINGW32=yes
8107
8108
8109
8110 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
8111 echo "configure:8112: checking for executable suffix" >&5
8112 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
8113   echo $ac_n "(cached) $ac_c" 1>&6
8114 else
8115   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
8116   ac_cv_exeext=.exe
8117 else
8118   rm -f conftest*
8119   echo 'int main () { return 0; }' > conftest.$ac_ext
8120   ac_cv_exeext=
8121   if { (eval echo configure:8122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
8122     for file in conftest.*; do
8123       case $file in
8124       *.c | *.C | *.o | *.obj | *.xcoff) ;;
8125       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
8126       esac
8127     done
8128   else
8129     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
8130   fi
8131   rm -f conftest*
8132   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
8133 fi
8134 fi
8135
8136 EXEEXT=""
8137 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
8138 echo "$ac_t""${ac_cv_exeext}" 1>&6
8139 ac_exeext=$EXEEXT
8140
8141 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
8142 echo "configure:8143: checking for object suffix" >&5
8143 if eval "test \"\${ac_cv_objext+set}\" = set"; then
8144   echo $ac_n "(cached) $ac_c" 1>&6
8145 else
8146   rm -f conftest*
8147 echo 'int i = 1;' > conftest.$ac_ext
8148 if { (eval echo configure:8149: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8149   for ac_file in conftest.*; do
8150     case $ac_file in
8151     *.c) ;;
8152     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
8153     esac
8154   done
8155 else
8156   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
8157 fi
8158 rm -f conftest*
8159 fi
8160
8161 echo "$ac_t""$ac_cv_objext" 1>&6
8162 OBJEXT=$ac_cv_objext
8163 ac_objext=$ac_cv_objext
8164
8165
8166 cat >> confdefs.h <<EOF
8167 #define EXEEXT "${EXEEXT}"
8168 EOF
8169
8170
8171 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
8172 echo "configure:8173: checking for be_app in -lbe" >&5
8173 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
8174 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8175   echo $ac_n "(cached) $ac_c" 1>&6
8176 else
8177   ac_save_LIBS="$LIBS"
8178 LIBS="-lbe -lroot -lnet $LIBS"
8179 cat > conftest.$ac_ext <<EOF
8180 #line 8181 "configure"
8181 #include "confdefs.h"
8182 /* Override any gcc2 internal prototype to avoid an error.  */
8183 /* We use char because int might match the return type of a gcc2
8184     builtin and then its argument prototype would still apply.  */
8185 char be_app();
8186
8187 int main() {
8188 be_app()
8189 ; return 0; }
8190 EOF
8191 if { (eval echo configure:8192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8192   rm -rf conftest*
8193   eval "ac_cv_lib_$ac_lib_var=yes"
8194 else
8195   echo "configure: failed program was:" >&5
8196   cat conftest.$ac_ext >&5
8197   rm -rf conftest*
8198   eval "ac_cv_lib_$ac_lib_var=no"
8199 fi
8200 rm -f conftest*
8201 LIBS="$ac_save_LIBS"
8202
8203 fi
8204 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8205   echo "$ac_t""yes" 1>&6
8206   LIBS="$LIBS -lbe -lroot -lnet"
8207 else
8208   echo "$ac_t""no" 1>&6
8209 :
8210 fi
8211
8212
8213
8214
8215
8216 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
8217 echo "configure:8218: checking for ${CC-cc} option to accept ANSI C" >&5
8218 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
8219   echo $ac_n "(cached) $ac_c" 1>&6
8220 else
8221   am_cv_prog_cc_stdc=no
8222 ac_save_CC="$CC"
8223 # Don't try gcc -ansi; that turns off useful extensions and
8224 # breaks some systems' header files.
8225 # AIX                   -qlanglvl=ansi
8226 # Ultrix and OSF/1      -std1
8227 # HP-UX 10.20 and later -Ae
8228 # HP-UX older versions  -Aa -D_HPUX_SOURCE
8229 # SVR4                  -Xc -D__EXTENSIONS__
8230 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
8231 do
8232   CC="$ac_save_CC $ac_arg"
8233   cat > conftest.$ac_ext <<EOF
8234 #line 8235 "configure"
8235 #include "confdefs.h"
8236 #include <stdarg.h>
8237 #include <stdio.h>
8238 #include <sys/types.h>
8239 #include <sys/stat.h>
8240 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
8241 struct buf { int x; };
8242 FILE * (*rcsopen) (struct buf *, struct stat *, int);
8243 static char *e (p, i)
8244      char **p;
8245      int i;
8246 {
8247   return p[i];
8248 }
8249 static char *f (char * (*g) (char **, int), char **p, ...)
8250 {
8251   char *s;
8252   va_list v;
8253   va_start (v,p);
8254   s = g (p, va_arg (v,int));
8255   va_end (v);
8256   return s;
8257 }
8258 int test (int i, double x);
8259 struct s1 {int (*f) (int a);};
8260 struct s2 {int (*f) (double a);};
8261 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
8262 int argc;
8263 char **argv;
8264
8265 int main() {
8266
8267 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
8268
8269 ; return 0; }
8270 EOF
8271 if { (eval echo configure:8272: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8272   rm -rf conftest*
8273   am_cv_prog_cc_stdc="$ac_arg"; break
8274 else
8275   echo "configure: failed program was:" >&5
8276   cat conftest.$ac_ext >&5
8277 fi
8278 rm -f conftest*
8279 done
8280 CC="$ac_save_CC"
8281
8282 fi
8283
8284 if test -z "$am_cv_prog_cc_stdc"; then
8285   echo "$ac_t""none needed" 1>&6
8286 else
8287   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
8288 fi
8289 case "x$am_cv_prog_cc_stdc" in
8290   x|xno) ;;
8291   *) CC="$CC $am_cv_prog_cc_stdc" ;;
8292 esac
8293
8294 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
8295         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
8296 fi
8297
8298 # test for make depend flag
8299 OL_MKDEP=
8300 OL_MKDEP_FLAGS=
8301 if test -z "${MKDEP}"; then
8302         OL_MKDEP="${CC-cc}"
8303         if test -z "${MKDEP_FLAGS}"; then
8304                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
8305 echo "configure:8306: checking for ${OL_MKDEP} depend flag" >&5
8306 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
8307   echo $ac_n "(cached) $ac_c" 1>&6
8308 else
8309   
8310                         ol_cv_mkdep=no
8311                         for flag in "-M" "-xM"; do
8312                                 cat > conftest.c <<EOF
8313  noCode;
8314 EOF
8315                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:8316: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
8316                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
8317                                 then
8318                                         if test ! -f conftest."${ac_object}" ; then
8319                                                 ol_cv_mkdep=$flag
8320                                                 OL_MKDEP_FLAGS="$flag"
8321                                                 break
8322                                         fi
8323                                 fi
8324                         done
8325                         rm -f conftest*
8326                 
8327 fi
8328
8329 echo "$ac_t""$ol_cv_mkdep" 1>&6
8330         else
8331                 cc_cv_mkdep=yes
8332                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
8333         fi
8334 else
8335         cc_cv_mkdep=yes
8336         OL_MKDEP="${MKDEP}"
8337         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
8338 fi
8339
8340
8341
8342 if test "${ol_cv_mkdep}" = no ; then
8343         # this will soon become an error
8344         echo "configure: warning: do not know how to generate dependencies" 1>&2
8345 fi
8346
8347 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
8348 echo "configure:8349: checking for afopen in -ls" >&5
8349 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
8350 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8351   echo $ac_n "(cached) $ac_c" 1>&6
8352 else
8353   ac_save_LIBS="$LIBS"
8354 LIBS="-ls  $LIBS"
8355 cat > conftest.$ac_ext <<EOF
8356 #line 8357 "configure"
8357 #include "confdefs.h"
8358 /* Override any gcc2 internal prototype to avoid an error.  */
8359 /* We use char because int might match the return type of a gcc2
8360     builtin and then its argument prototype would still apply.  */
8361 char afopen();
8362
8363 int main() {
8364 afopen()
8365 ; return 0; }
8366 EOF
8367 if { (eval echo configure:8368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8368   rm -rf conftest*
8369   eval "ac_cv_lib_$ac_lib_var=yes"
8370 else
8371   echo "configure: failed program was:" >&5
8372   cat conftest.$ac_ext >&5
8373   rm -rf conftest*
8374   eval "ac_cv_lib_$ac_lib_var=no"
8375 fi
8376 rm -f conftest*
8377 LIBS="$ac_save_LIBS"
8378
8379 fi
8380 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8381   echo "$ac_t""yes" 1>&6
8382   
8383         AUTH_LIBS=-ls
8384         cat >> confdefs.h <<\EOF
8385 #define HAVE_AIX_SECURITY 1
8386 EOF
8387
8388
8389 else
8390   echo "$ac_t""no" 1>&6
8391 fi
8392
8393
8394 case "$target" in
8395 *-ibm-openedition)
8396         ac_cv_func_getopt=no
8397         cat >> confdefs.h <<\EOF
8398 #define BOTH_STRINGS_H 1
8399 EOF
8400
8401         ;;
8402 esac
8403
8404 ol_link_modules=no
8405 if test $ol_enable_modules != no ; then
8406         for ac_hdr in ltdl.h
8407 do
8408 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8409 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8410 echo "configure:8411: checking for $ac_hdr" >&5
8411 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8412   echo $ac_n "(cached) $ac_c" 1>&6
8413 else
8414   cat > conftest.$ac_ext <<EOF
8415 #line 8416 "configure"
8416 #include "confdefs.h"
8417 #include <$ac_hdr>
8418 EOF
8419 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8420 { (eval echo configure:8421: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8421 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8422 if test -z "$ac_err"; then
8423   rm -rf conftest*
8424   eval "ac_cv_header_$ac_safe=yes"
8425 else
8426   echo "$ac_err" >&5
8427   echo "configure: failed program was:" >&5
8428   cat conftest.$ac_ext >&5
8429   rm -rf conftest*
8430   eval "ac_cv_header_$ac_safe=no"
8431 fi
8432 rm -f conftest*
8433 fi
8434 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8435   echo "$ac_t""yes" 1>&6
8436     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8437   cat >> confdefs.h <<EOF
8438 #define $ac_tr_hdr 1
8439 EOF
8440  
8441 else
8442   echo "$ac_t""no" 1>&6
8443 fi
8444 done
8445
8446
8447         if test $ac_cv_header_ltdl_h = no ; then
8448                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
8449         fi
8450
8451         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
8452 echo "configure:8453: checking for lt_dlinit in -lltdl" >&5
8453 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
8454 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8455   echo $ac_n "(cached) $ac_c" 1>&6
8456 else
8457   ac_save_LIBS="$LIBS"
8458 LIBS="-lltdl  $LIBS"
8459 cat > conftest.$ac_ext <<EOF
8460 #line 8461 "configure"
8461 #include "confdefs.h"
8462 /* Override any gcc2 internal prototype to avoid an error.  */
8463 /* We use char because int might match the return type of a gcc2
8464     builtin and then its argument prototype would still apply.  */
8465 char lt_dlinit();
8466
8467 int main() {
8468 lt_dlinit()
8469 ; return 0; }
8470 EOF
8471 if { (eval echo configure:8472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8472   rm -rf conftest*
8473   eval "ac_cv_lib_$ac_lib_var=yes"
8474 else
8475   echo "configure: failed program was:" >&5
8476   cat conftest.$ac_ext >&5
8477   rm -rf conftest*
8478   eval "ac_cv_lib_$ac_lib_var=no"
8479 fi
8480 rm -f conftest*
8481 LIBS="$ac_save_LIBS"
8482
8483 fi
8484 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8485   echo "$ac_t""yes" 1>&6
8486   
8487                 MODULES_LIBS=-lltdl
8488                 cat >> confdefs.h <<\EOF
8489 #define HAVE_LIBLTDL 1
8490 EOF
8491
8492         
8493 else
8494   echo "$ac_t""no" 1>&6
8495 fi
8496
8497
8498         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
8499                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
8500         fi
8501         ol_link_modules=yes
8502 else
8503         ol_with_bdb_module=static
8504         ol_with_dnssrv_module=static
8505         ol_with_ldap_module=static
8506         ol_with_ldbm_module=static
8507         ol_with_meta_module=static
8508         ol_with_monitor_module=static
8509         ol_with_null_module=static
8510         ol_with_passwd_module=static
8511         ol_with_perl_module=static
8512         ol_with_shell_module=static
8513         ol_with_tcl_module=static
8514         ol_with_sql_module=static
8515 fi
8516
8517 # test for EBCDIC
8518 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
8519 echo "configure:8520: checking for EBCDIC" >&5
8520 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
8521   echo $ac_n "(cached) $ac_c" 1>&6
8522 else
8523   
8524         cat > conftest.$ac_ext <<EOF
8525 #line 8526 "configure"
8526 #include "confdefs.h"
8527
8528 #if !('M' == 0xd4)
8529 #include <__ASCII__/generate_error.h>
8530 #endif
8531
8532 EOF
8533 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8534 { (eval echo configure:8535: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8535 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8536 if test -z "$ac_err"; then
8537   rm -rf conftest*
8538   ol_cv_cpp_ebcdic=yes
8539 else
8540   echo "$ac_err" >&5
8541   echo "configure: failed program was:" >&5
8542   cat conftest.$ac_ext >&5
8543   rm -rf conftest*
8544   ol_cv_cpp_ebcdic=no
8545 fi
8546 rm -f conftest*
8547 fi
8548
8549 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
8550 if test $ol_cv_cpp_ebcdic = yes ; then
8551         cat >> confdefs.h <<\EOF
8552 #define HAVE_EBCDIC 1
8553 EOF
8554
8555 fi
8556
8557 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
8558 echo "configure:8559: checking for ANSI C header files" >&5
8559 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
8560   echo $ac_n "(cached) $ac_c" 1>&6
8561 else
8562   cat > conftest.$ac_ext <<EOF
8563 #line 8564 "configure"
8564 #include "confdefs.h"
8565 #include <stdlib.h>
8566 #include <stdarg.h>
8567 #include <string.h>
8568 #include <float.h>
8569 EOF
8570 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8571 { (eval echo configure:8572: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8572 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8573 if test -z "$ac_err"; then
8574   rm -rf conftest*
8575   ol_cv_header_stdc=yes
8576 else
8577   echo "$ac_err" >&5
8578   echo "configure: failed program was:" >&5
8579   cat conftest.$ac_ext >&5
8580   rm -rf conftest*
8581   ol_cv_header_stdc=no
8582 fi
8583 rm -f conftest*
8584
8585 if test $ol_cv_header_stdc = yes; then
8586   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
8587 cat > conftest.$ac_ext <<EOF
8588 #line 8589 "configure"
8589 #include "confdefs.h"
8590 #include <string.h>
8591 EOF
8592 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8593   egrep "memchr" >/dev/null 2>&1; then
8594   :
8595 else
8596   rm -rf conftest*
8597   ol_cv_header_stdc=no
8598 fi
8599 rm -f conftest*
8600
8601 fi
8602
8603 if test $ol_cv_header_stdc = yes; then
8604   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
8605 cat > conftest.$ac_ext <<EOF
8606 #line 8607 "configure"
8607 #include "confdefs.h"
8608 #include <stdlib.h>
8609 EOF
8610 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8611   egrep "free" >/dev/null 2>&1; then
8612   :
8613 else
8614   rm -rf conftest*
8615   ol_cv_header_stdc=no
8616 fi
8617 rm -f conftest*
8618
8619 fi
8620
8621 if test $ol_cv_header_stdc = yes; then
8622   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
8623 if test "$cross_compiling" = yes; then
8624   :
8625 else
8626   cat > conftest.$ac_ext <<EOF
8627 #line 8628 "configure"
8628 #include "confdefs.h"
8629 #include <ctype.h>
8630 #ifndef HAVE_EBCDIC
8631 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
8632 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
8633 #else
8634 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
8635                 || ('j' <= (c) && (c) <= 'r') \
8636                 || ('s' <= (c) && (c) <= 'z'))
8637 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
8638 #endif
8639 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
8640 int main () { int i; for (i = 0; i < 256; i++)
8641 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
8642 exit (0); }
8643
8644 EOF
8645 if { (eval echo configure:8646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8646 then
8647   :
8648 else
8649   echo "configure: failed program was:" >&5
8650   cat conftest.$ac_ext >&5
8651   rm -fr conftest*
8652   ol_cv_header_stdc=no
8653 fi
8654 rm -fr conftest*
8655 fi
8656
8657 fi
8658 fi
8659
8660 echo "$ac_t""$ol_cv_header_stdc" 1>&6
8661 if test $ol_cv_header_stdc = yes; then
8662   cat >> confdefs.h <<\EOF
8663 #define STDC_HEADERS 1
8664 EOF
8665
8666 fi
8667 ac_cv_header_stdc=disable
8668
8669
8670 if test $ol_cv_header_stdc != yes; then
8671         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
8672 fi
8673
8674 ac_header_dirent=no
8675 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
8676 do
8677 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8678 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
8679 echo "configure:8680: checking for $ac_hdr that defines DIR" >&5
8680 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
8681   echo $ac_n "(cached) $ac_c" 1>&6
8682 else
8683   cat > conftest.$ac_ext <<EOF
8684 #line 8685 "configure"
8685 #include "confdefs.h"
8686 #include <sys/types.h>
8687 #include <$ac_hdr>
8688 int main() {
8689 DIR *dirp = 0;
8690 ; return 0; }
8691 EOF
8692 if { (eval echo configure:8693: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8693   rm -rf conftest*
8694   eval "ac_cv_header_dirent_$ac_safe=yes"
8695 else
8696   echo "configure: failed program was:" >&5
8697   cat conftest.$ac_ext >&5
8698   rm -rf conftest*
8699   eval "ac_cv_header_dirent_$ac_safe=no"
8700 fi
8701 rm -f conftest*
8702 fi
8703 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
8704   echo "$ac_t""yes" 1>&6
8705     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8706   cat >> confdefs.h <<EOF
8707 #define $ac_tr_hdr 1
8708 EOF
8709  ac_header_dirent=$ac_hdr; break
8710 else
8711   echo "$ac_t""no" 1>&6
8712 fi
8713 done
8714 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
8715 if test $ac_header_dirent = dirent.h; then
8716 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
8717 echo "configure:8718: checking for opendir in -ldir" >&5
8718 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
8719 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8720   echo $ac_n "(cached) $ac_c" 1>&6
8721 else
8722   ac_save_LIBS="$LIBS"
8723 LIBS="-ldir  $LIBS"
8724 cat > conftest.$ac_ext <<EOF
8725 #line 8726 "configure"
8726 #include "confdefs.h"
8727 /* Override any gcc2 internal prototype to avoid an error.  */
8728 /* We use char because int might match the return type of a gcc2
8729     builtin and then its argument prototype would still apply.  */
8730 char opendir();
8731
8732 int main() {
8733 opendir()
8734 ; return 0; }
8735 EOF
8736 if { (eval echo configure:8737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8737   rm -rf conftest*
8738   eval "ac_cv_lib_$ac_lib_var=yes"
8739 else
8740   echo "configure: failed program was:" >&5
8741   cat conftest.$ac_ext >&5
8742   rm -rf conftest*
8743   eval "ac_cv_lib_$ac_lib_var=no"
8744 fi
8745 rm -f conftest*
8746 LIBS="$ac_save_LIBS"
8747
8748 fi
8749 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8750   echo "$ac_t""yes" 1>&6
8751   LIBS="$LIBS -ldir"
8752 else
8753   echo "$ac_t""no" 1>&6
8754 fi
8755
8756 else
8757 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
8758 echo "configure:8759: checking for opendir in -lx" >&5
8759 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
8760 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8761   echo $ac_n "(cached) $ac_c" 1>&6
8762 else
8763   ac_save_LIBS="$LIBS"
8764 LIBS="-lx  $LIBS"
8765 cat > conftest.$ac_ext <<EOF
8766 #line 8767 "configure"
8767 #include "confdefs.h"
8768 /* Override any gcc2 internal prototype to avoid an error.  */
8769 /* We use char because int might match the return type of a gcc2
8770     builtin and then its argument prototype would still apply.  */
8771 char opendir();
8772
8773 int main() {
8774 opendir()
8775 ; return 0; }
8776 EOF
8777 if { (eval echo configure:8778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8778   rm -rf conftest*
8779   eval "ac_cv_lib_$ac_lib_var=yes"
8780 else
8781   echo "configure: failed program was:" >&5
8782   cat conftest.$ac_ext >&5
8783   rm -rf conftest*
8784   eval "ac_cv_lib_$ac_lib_var=no"
8785 fi
8786 rm -f conftest*
8787 LIBS="$ac_save_LIBS"
8788
8789 fi
8790 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8791   echo "$ac_t""yes" 1>&6
8792   LIBS="$LIBS -lx"
8793 else
8794   echo "$ac_t""no" 1>&6
8795 fi
8796
8797 fi
8798
8799 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
8800 echo "configure:8801: checking for sys/wait.h that is POSIX.1 compatible" >&5
8801 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
8802   echo $ac_n "(cached) $ac_c" 1>&6
8803 else
8804   cat > conftest.$ac_ext <<EOF
8805 #line 8806 "configure"
8806 #include "confdefs.h"
8807 #include <sys/types.h>
8808 #include <sys/wait.h>
8809 #ifndef WEXITSTATUS
8810 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
8811 #endif
8812 #ifndef WIFEXITED
8813 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
8814 #endif
8815 int main() {
8816 int s;
8817 wait (&s);
8818 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
8819 ; return 0; }
8820 EOF
8821 if { (eval echo configure:8822: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8822   rm -rf conftest*
8823   ac_cv_header_sys_wait_h=yes
8824 else
8825   echo "configure: failed program was:" >&5
8826   cat conftest.$ac_ext >&5
8827   rm -rf conftest*
8828   ac_cv_header_sys_wait_h=no
8829 fi
8830 rm -f conftest*
8831 fi
8832
8833 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
8834 if test $ac_cv_header_sys_wait_h = yes; then
8835   cat >> confdefs.h <<\EOF
8836 #define HAVE_SYS_WAIT_H 1
8837 EOF
8838
8839 fi
8840
8841 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
8842 echo "configure:8843: checking POSIX termios" >&5
8843 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
8844   echo $ac_n "(cached) $ac_c" 1>&6
8845 else
8846   cat > conftest.$ac_ext <<EOF
8847 #line 8848 "configure"
8848 #include "confdefs.h"
8849 #include <sys/types.h>
8850 #include <unistd.h>
8851 #include <termios.h>
8852 int main() {
8853 /* SunOS 4.0.3 has termios.h but not the library calls.  */
8854    tcgetattr(0, 0);
8855 ; return 0; }
8856 EOF
8857 if { (eval echo configure:8858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8858   rm -rf conftest*
8859   am_cv_sys_posix_termios=yes
8860 else
8861   echo "configure: failed program was:" >&5
8862   cat conftest.$ac_ext >&5
8863   rm -rf conftest*
8864   am_cv_sys_posix_termios=no
8865 fi
8866 rm -f conftest*
8867 fi
8868
8869 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
8870
8871
8872  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
8873 echo "configure:8874: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
8874 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
8875   echo $ac_n "(cached) $ac_c" 1>&6
8876 else
8877   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
8878
8879   gwinsz_in_termios_h=no
8880   if test $am_cv_sys_posix_termios = yes; then
8881     cat > conftest.$ac_ext <<EOF
8882 #line 8883 "configure"
8883 #include "confdefs.h"
8884 #include <sys/types.h>
8885 #     include <termios.h>
8886 #     ifdef TIOCGWINSZ
8887         yes
8888 #     endif
8889     
8890 EOF
8891 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8892   egrep "yes" >/dev/null 2>&1; then
8893   rm -rf conftest*
8894   gwinsz_in_termios_h=yes
8895 fi
8896 rm -f conftest*
8897
8898   fi
8899
8900   if test $gwinsz_in_termios_h = no; then
8901     cat > conftest.$ac_ext <<EOF
8902 #line 8903 "configure"
8903 #include "confdefs.h"
8904 #include <sys/types.h>
8905 #     include <sys/ioctl.h>
8906 #     ifdef TIOCGWINSZ
8907         yes
8908 #     endif
8909     
8910 EOF
8911 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8912   egrep "yes" >/dev/null 2>&1; then
8913   rm -rf conftest*
8914   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
8915 fi
8916 rm -f conftest*
8917
8918   fi
8919   
8920 fi
8921
8922 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
8923   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
8924     cat >> confdefs.h <<\EOF
8925 #define GWINSZ_IN_SYS_IOCTL 1
8926 EOF
8927
8928   fi
8929
8930 if test $am_cv_sys_posix_termios = yes ; then
8931         cat >> confdefs.h <<\EOF
8932 #define HAVE_POSIX_TERMIOS 1
8933 EOF
8934
8935 fi
8936
8937 for ac_hdr in \
8938         arpa/inet.h             \
8939         arpa/nameser.h  \
8940         assert.h                \
8941         conio.h                 \
8942         crypt.h                 \
8943         direct.h                \
8944         errno.h                 \
8945         fcntl.h                 \
8946         filio.h                 \
8947         getopt.h                \
8948         grp.h                   \
8949         io.h                    \
8950         libutil.h               \
8951         limits.h                \
8952         locale.h                \
8953         netinet/tcp.h   \
8954         malloc.h                \
8955         memory.h                \
8956         psap.h                  \
8957         pwd.h                   \
8958         process.h               \
8959         resolv.h                \
8960         sgtty.h                 \
8961         shadow.h                \
8962         stddef.h                \
8963         string.h                \
8964         strings.h               \
8965         sysexits.h              \
8966         sys/file.h              \
8967         sys/filio.h             \
8968         sys/errno.h             \
8969         sys/ioctl.h             \
8970         sys/param.h             \
8971         sys/resource.h  \
8972         sys/select.h    \
8973         sys/socket.h    \
8974         sys/stat.h              \
8975         sys/syslog.h    \
8976         sys/time.h              \
8977         sys/types.h             \
8978         sys/ucred.h             \
8979         sys/uio.h               \
8980         syslog.h                \
8981         termios.h               \
8982         unistd.h                \
8983         winsock.h               \
8984         winsock2.h              \
8985
8986 do
8987 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8988 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8989 echo "configure:8990: checking for $ac_hdr" >&5
8990 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8991   echo $ac_n "(cached) $ac_c" 1>&6
8992 else
8993   cat > conftest.$ac_ext <<EOF
8994 #line 8995 "configure"
8995 #include "confdefs.h"
8996 #include <$ac_hdr>
8997 EOF
8998 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8999 { (eval echo configure:9000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9000 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9001 if test -z "$ac_err"; then
9002   rm -rf conftest*
9003   eval "ac_cv_header_$ac_safe=yes"
9004 else
9005   echo "$ac_err" >&5
9006   echo "configure: failed program was:" >&5
9007   cat conftest.$ac_ext >&5
9008   rm -rf conftest*
9009   eval "ac_cv_header_$ac_safe=no"
9010 fi
9011 rm -f conftest*
9012 fi
9013 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9014   echo "$ac_t""yes" 1>&6
9015     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9016   cat >> confdefs.h <<EOF
9017 #define $ac_tr_hdr 1
9018 EOF
9019  
9020 else
9021   echo "$ac_t""no" 1>&6
9022 fi
9023 done
9024
9025
9026
9027
9028 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
9029 echo "configure:9030: checking for dlopen" >&5
9030 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
9031   echo $ac_n "(cached) $ac_c" 1>&6
9032 else
9033   cat > conftest.$ac_ext <<EOF
9034 #line 9035 "configure"
9035 #include "confdefs.h"
9036 /* System header to define __stub macros and hopefully few prototypes,
9037     which can conflict with char dlopen(); below.  */
9038 #include <assert.h>
9039 /* Override any gcc2 internal prototype to avoid an error.  */
9040 /* We use char because int might match the return type of a gcc2
9041     builtin and then its argument prototype would still apply.  */
9042 char dlopen();
9043 char (*f)();
9044
9045 int main() {
9046
9047 /* The GNU C library defines this for functions which it implements
9048     to always fail with ENOSYS.  Some functions are actually named
9049     something starting with __ and the normal name is an alias.  */
9050 #if defined (__stub_dlopen) || defined (__stub___dlopen)
9051 choke me
9052 #else
9053 f = dlopen;
9054 #endif
9055
9056 ; return 0; }
9057 EOF
9058 if { (eval echo configure:9059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9059   rm -rf conftest*
9060   eval "ac_cv_func_dlopen=yes"
9061 else
9062   echo "configure: failed program was:" >&5
9063   cat conftest.$ac_ext >&5
9064   rm -rf conftest*
9065   eval "ac_cv_func_dlopen=no"
9066 fi
9067 rm -f conftest*
9068 fi
9069
9070 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
9071   echo "$ac_t""yes" 1>&6
9072   :
9073 else
9074   echo "$ac_t""no" 1>&6
9075 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
9076 echo "configure:9077: checking for dlopen in -ldl" >&5
9077 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
9078 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9079   echo $ac_n "(cached) $ac_c" 1>&6
9080 else
9081   ac_save_LIBS="$LIBS"
9082 LIBS="-ldl  $LIBS"
9083 cat > conftest.$ac_ext <<EOF
9084 #line 9085 "configure"
9085 #include "confdefs.h"
9086 /* Override any gcc2 internal prototype to avoid an error.  */
9087 /* We use char because int might match the return type of a gcc2
9088     builtin and then its argument prototype would still apply.  */
9089 char dlopen();
9090
9091 int main() {
9092 dlopen()
9093 ; return 0; }
9094 EOF
9095 if { (eval echo configure:9096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9096   rm -rf conftest*
9097   eval "ac_cv_lib_$ac_lib_var=yes"
9098 else
9099   echo "configure: failed program was:" >&5
9100   cat conftest.$ac_ext >&5
9101   rm -rf conftest*
9102   eval "ac_cv_lib_$ac_lib_var=no"
9103 fi
9104 rm -f conftest*
9105 LIBS="$ac_save_LIBS"
9106
9107 fi
9108 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9109   echo "$ac_t""yes" 1>&6
9110     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9111     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9112   cat >> confdefs.h <<EOF
9113 #define $ac_tr_lib 1
9114 EOF
9115
9116   LIBS="-ldl $LIBS"
9117
9118 else
9119   echo "$ac_t""no" 1>&6
9120 fi
9121
9122 fi
9123
9124
9125 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
9126 echo "configure:9127: checking for sigset in -lV3" >&5
9127 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
9128 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9129   echo $ac_n "(cached) $ac_c" 1>&6
9130 else
9131   ac_save_LIBS="$LIBS"
9132 LIBS="-lV3  $LIBS"
9133 cat > conftest.$ac_ext <<EOF
9134 #line 9135 "configure"
9135 #include "confdefs.h"
9136 /* Override any gcc2 internal prototype to avoid an error.  */
9137 /* We use char because int might match the return type of a gcc2
9138     builtin and then its argument prototype would still apply.  */
9139 char sigset();
9140
9141 int main() {
9142 sigset()
9143 ; return 0; }
9144 EOF
9145 if { (eval echo configure:9146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9146   rm -rf conftest*
9147   eval "ac_cv_lib_$ac_lib_var=yes"
9148 else
9149   echo "configure: failed program was:" >&5
9150   cat conftest.$ac_ext >&5
9151   rm -rf conftest*
9152   eval "ac_cv_lib_$ac_lib_var=no"
9153 fi
9154 rm -f conftest*
9155 LIBS="$ac_save_LIBS"
9156
9157 fi
9158 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9159   echo "$ac_t""yes" 1>&6
9160     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9161     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9162   cat >> confdefs.h <<EOF
9163 #define $ac_tr_lib 1
9164 EOF
9165
9166   LIBS="-lV3 $LIBS"
9167
9168 else
9169   echo "$ac_t""no" 1>&6
9170 fi
9171
9172
9173 echo $ac_n "checking for winsock""... $ac_c" 1>&6
9174 echo "configure:9175: checking for winsock" >&5
9175 save_LIBS="$LIBS"
9176 for curlib in ws2_32 wsock32; do
9177         LIBS="$LIBS -l$curlib"
9178         cat > conftest.$ac_ext <<EOF
9179 #line 9180 "configure"
9180 #include "confdefs.h"
9181
9182                         char socket@12();
9183                         char select@20();
9184                         char closesocket@4();
9185                         char gethostname@8();
9186                         
9187 int main() {
9188
9189                         socket@12();
9190                         select@20();
9191                         closesocket@4();
9192                         gethostname@8();
9193                         
9194 ; return 0; }
9195 EOF
9196 if { (eval echo configure:9197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9197   rm -rf conftest*
9198   have_winsock=yes
9199 else
9200   echo "configure: failed program was:" >&5
9201   cat conftest.$ac_ext >&5
9202   rm -rf conftest*
9203   have_winsock=no
9204 fi
9205 rm -f conftest*
9206
9207         if test $have_winsock = yes; then
9208                 cat >> confdefs.h <<\EOF
9209 #define HAVE_WINSOCK 1
9210 EOF
9211
9212                 ac_cv_func_socket=yes
9213                 ac_cv_func_select=yes
9214                 ac_cv_func_closesocket=yes
9215                 ac_cv_func_gethostname=yes
9216                 if test $curlib = ws2_32; then
9217                         have_winsock=winsock2
9218                         cat >> confdefs.h <<\EOF
9219 #define HAVE_WINSOCK2 1
9220 EOF
9221
9222                 fi
9223                 break
9224         fi
9225         LIBS="$save_LIBS"
9226 done
9227 echo "$ac_t""$have_winsock" 1>&6
9228
9229
9230 echo $ac_n "checking for socket""... $ac_c" 1>&6
9231 echo "configure:9232: checking for socket" >&5
9232 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
9233   echo $ac_n "(cached) $ac_c" 1>&6
9234 else
9235   cat > conftest.$ac_ext <<EOF
9236 #line 9237 "configure"
9237 #include "confdefs.h"
9238 /* System header to define __stub macros and hopefully few prototypes,
9239     which can conflict with char socket(); below.  */
9240 #include <assert.h>
9241 /* Override any gcc2 internal prototype to avoid an error.  */
9242 /* We use char because int might match the return type of a gcc2
9243     builtin and then its argument prototype would still apply.  */
9244 char socket();
9245 char (*f)();
9246
9247 int main() {
9248
9249 /* The GNU C library defines this for functions which it implements
9250     to always fail with ENOSYS.  Some functions are actually named
9251     something starting with __ and the normal name is an alias.  */
9252 #if defined (__stub_socket) || defined (__stub___socket)
9253 choke me
9254 #else
9255 f = socket;
9256 #endif
9257
9258 ; return 0; }
9259 EOF
9260 if { (eval echo configure:9261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9261   rm -rf conftest*
9262   eval "ac_cv_func_socket=yes"
9263 else
9264   echo "configure: failed program was:" >&5
9265   cat conftest.$ac_ext >&5
9266   rm -rf conftest*
9267   eval "ac_cv_func_socket=no"
9268 fi
9269 rm -f conftest*
9270 fi
9271
9272 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
9273   echo "$ac_t""yes" 1>&6
9274   :
9275 else
9276   echo "$ac_t""no" 1>&6
9277         
9278         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
9279 echo "configure:9280: checking for main in -lsocket" >&5
9280 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
9281 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9282   echo $ac_n "(cached) $ac_c" 1>&6
9283 else
9284   ac_save_LIBS="$LIBS"
9285 LIBS="-lsocket  $LIBS"
9286 cat > conftest.$ac_ext <<EOF
9287 #line 9288 "configure"
9288 #include "confdefs.h"
9289
9290 int main() {
9291 main()
9292 ; return 0; }
9293 EOF
9294 if { (eval echo configure:9295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9295   rm -rf conftest*
9296   eval "ac_cv_lib_$ac_lib_var=yes"
9297 else
9298   echo "configure: failed program was:" >&5
9299   cat conftest.$ac_ext >&5
9300   rm -rf conftest*
9301   eval "ac_cv_lib_$ac_lib_var=no"
9302 fi
9303 rm -f conftest*
9304 LIBS="$ac_save_LIBS"
9305
9306 fi
9307 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9308   echo "$ac_t""yes" 1>&6
9309     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9310     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9311   cat >> confdefs.h <<EOF
9312 #define $ac_tr_lib 1
9313 EOF
9314
9315   LIBS="-lsocket $LIBS"
9316
9317 else
9318   echo "$ac_t""no" 1>&6
9319 fi
9320
9321         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
9322 echo "configure:9323: checking for main in -lnet" >&5
9323 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
9324 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9325   echo $ac_n "(cached) $ac_c" 1>&6
9326 else
9327   ac_save_LIBS="$LIBS"
9328 LIBS="-lnet  $LIBS"
9329 cat > conftest.$ac_ext <<EOF
9330 #line 9331 "configure"
9331 #include "confdefs.h"
9332
9333 int main() {
9334 main()
9335 ; return 0; }
9336 EOF
9337 if { (eval echo configure:9338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9338   rm -rf conftest*
9339   eval "ac_cv_lib_$ac_lib_var=yes"
9340 else
9341   echo "configure: failed program was:" >&5
9342   cat conftest.$ac_ext >&5
9343   rm -rf conftest*
9344   eval "ac_cv_lib_$ac_lib_var=no"
9345 fi
9346 rm -f conftest*
9347 LIBS="$ac_save_LIBS"
9348
9349 fi
9350 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9351   echo "$ac_t""yes" 1>&6
9352     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9353     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9354   cat >> confdefs.h <<EOF
9355 #define $ac_tr_lib 1
9356 EOF
9357
9358   LIBS="-lnet $LIBS"
9359
9360 else
9361   echo "$ac_t""no" 1>&6
9362 fi
9363
9364         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
9365 echo "configure:9366: checking for main in -lnsl_s" >&5
9366 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
9367 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9368   echo $ac_n "(cached) $ac_c" 1>&6
9369 else
9370   ac_save_LIBS="$LIBS"
9371 LIBS="-lnsl_s  $LIBS"
9372 cat > conftest.$ac_ext <<EOF
9373 #line 9374 "configure"
9374 #include "confdefs.h"
9375
9376 int main() {
9377 main()
9378 ; return 0; }
9379 EOF
9380 if { (eval echo configure:9381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9381   rm -rf conftest*
9382   eval "ac_cv_lib_$ac_lib_var=yes"
9383 else
9384   echo "configure: failed program was:" >&5
9385   cat conftest.$ac_ext >&5
9386   rm -rf conftest*
9387   eval "ac_cv_lib_$ac_lib_var=no"
9388 fi
9389 rm -f conftest*
9390 LIBS="$ac_save_LIBS"
9391
9392 fi
9393 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9394   echo "$ac_t""yes" 1>&6
9395     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9396     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9397   cat >> confdefs.h <<EOF
9398 #define $ac_tr_lib 1
9399 EOF
9400
9401   LIBS="-lnsl_s $LIBS"
9402
9403 else
9404   echo "$ac_t""no" 1>&6
9405 fi
9406
9407         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
9408 echo "configure:9409: checking for main in -lnsl" >&5
9409 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
9410 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9411   echo $ac_n "(cached) $ac_c" 1>&6
9412 else
9413   ac_save_LIBS="$LIBS"
9414 LIBS="-lnsl  $LIBS"
9415 cat > conftest.$ac_ext <<EOF
9416 #line 9417 "configure"
9417 #include "confdefs.h"
9418
9419 int main() {
9420 main()
9421 ; return 0; }
9422 EOF
9423 if { (eval echo configure:9424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9424   rm -rf conftest*
9425   eval "ac_cv_lib_$ac_lib_var=yes"
9426 else
9427   echo "configure: failed program was:" >&5
9428   cat conftest.$ac_ext >&5
9429   rm -rf conftest*
9430   eval "ac_cv_lib_$ac_lib_var=no"
9431 fi
9432 rm -f conftest*
9433 LIBS="$ac_save_LIBS"
9434
9435 fi
9436 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9437   echo "$ac_t""yes" 1>&6
9438     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9439     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9440   cat >> confdefs.h <<EOF
9441 #define $ac_tr_lib 1
9442 EOF
9443
9444   LIBS="-lnsl $LIBS"
9445
9446 else
9447   echo "$ac_t""no" 1>&6
9448 fi
9449
9450         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
9451 echo "configure:9452: checking for socket in -linet" >&5
9452 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
9453 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9454   echo $ac_n "(cached) $ac_c" 1>&6
9455 else
9456   ac_save_LIBS="$LIBS"
9457 LIBS="-linet  $LIBS"
9458 cat > conftest.$ac_ext <<EOF
9459 #line 9460 "configure"
9460 #include "confdefs.h"
9461 /* Override any gcc2 internal prototype to avoid an error.  */
9462 /* We use char because int might match the return type of a gcc2
9463     builtin and then its argument prototype would still apply.  */
9464 char socket();
9465
9466 int main() {
9467 socket()
9468 ; return 0; }
9469 EOF
9470 if { (eval echo configure:9471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9471   rm -rf conftest*
9472   eval "ac_cv_lib_$ac_lib_var=yes"
9473 else
9474   echo "configure: failed program was:" >&5
9475   cat conftest.$ac_ext >&5
9476   rm -rf conftest*
9477   eval "ac_cv_lib_$ac_lib_var=no"
9478 fi
9479 rm -f conftest*
9480 LIBS="$ac_save_LIBS"
9481
9482 fi
9483 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9484   echo "$ac_t""yes" 1>&6
9485     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9486     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9487   cat >> confdefs.h <<EOF
9488 #define $ac_tr_lib 1
9489 EOF
9490
9491   LIBS="-linet $LIBS"
9492
9493 else
9494   echo "$ac_t""no" 1>&6
9495 fi
9496
9497         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
9498 echo "configure:9499: checking for main in -lgen" >&5
9499 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
9500 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9501   echo $ac_n "(cached) $ac_c" 1>&6
9502 else
9503   ac_save_LIBS="$LIBS"
9504 LIBS="-lgen  $LIBS"
9505 cat > conftest.$ac_ext <<EOF
9506 #line 9507 "configure"
9507 #include "confdefs.h"
9508
9509 int main() {
9510 main()
9511 ; return 0; }
9512 EOF
9513 if { (eval echo configure:9514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9514   rm -rf conftest*
9515   eval "ac_cv_lib_$ac_lib_var=yes"
9516 else
9517   echo "configure: failed program was:" >&5
9518   cat conftest.$ac_ext >&5
9519   rm -rf conftest*
9520   eval "ac_cv_lib_$ac_lib_var=no"
9521 fi
9522 rm -f conftest*
9523 LIBS="$ac_save_LIBS"
9524
9525 fi
9526 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9527   echo "$ac_t""yes" 1>&6
9528     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9529     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9530   cat >> confdefs.h <<EOF
9531 #define $ac_tr_lib 1
9532 EOF
9533
9534   LIBS="-lgen $LIBS"
9535
9536 else
9537   echo "$ac_t""no" 1>&6
9538 fi
9539
9540
9541 fi
9542
9543
9544 echo $ac_n "checking for select""... $ac_c" 1>&6
9545 echo "configure:9546: checking for select" >&5
9546 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
9547   echo $ac_n "(cached) $ac_c" 1>&6
9548 else
9549   cat > conftest.$ac_ext <<EOF
9550 #line 9551 "configure"
9551 #include "confdefs.h"
9552 /* System header to define __stub macros and hopefully few prototypes,
9553     which can conflict with char select(); below.  */
9554 #include <assert.h>
9555 /* Override any gcc2 internal prototype to avoid an error.  */
9556 /* We use char because int might match the return type of a gcc2
9557     builtin and then its argument prototype would still apply.  */
9558 char select();
9559 char (*f)();
9560
9561 int main() {
9562
9563 /* The GNU C library defines this for functions which it implements
9564     to always fail with ENOSYS.  Some functions are actually named
9565     something starting with __ and the normal name is an alias.  */
9566 #if defined (__stub_select) || defined (__stub___select)
9567 choke me
9568 #else
9569 f = select;
9570 #endif
9571
9572 ; return 0; }
9573 EOF
9574 if { (eval echo configure:9575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9575   rm -rf conftest*
9576   eval "ac_cv_func_select=yes"
9577 else
9578   echo "configure: failed program was:" >&5
9579   cat conftest.$ac_ext >&5
9580   rm -rf conftest*
9581   eval "ac_cv_func_select=no"
9582 fi
9583 rm -f conftest*
9584 fi
9585
9586 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
9587   echo "$ac_t""yes" 1>&6
9588   :
9589 else
9590   echo "$ac_t""no" 1>&6
9591 { echo "configure: error: select() required." 1>&2; exit 1; }
9592 fi
9593
9594
9595 if test "${ac_cv_header_winsock_h}" != yes; then
9596                                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
9597 echo "configure:9598: checking types of arguments for select()" >&5
9598  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
9599   echo $ac_n "(cached) $ac_c" 1>&6
9600 else
9601    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
9602   echo $ac_n "(cached) $ac_c" 1>&6
9603 else
9604     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
9605   echo $ac_n "(cached) $ac_c" 1>&6
9606 else
9607      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
9608      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
9609       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
9610        cat > conftest.$ac_ext <<EOF
9611 #line 9612 "configure"
9612 #include "confdefs.h"
9613 #ifdef HAVE_SYS_TYPES_H
9614 #include <sys/types.h>
9615 #endif
9616 #ifdef HAVE_SYS_TIME_H
9617 #include <sys/time.h>
9618 #endif
9619 #ifdef HAVE_SYS_SELECT_H
9620 #include <sys/select.h>
9621 #endif
9622 #ifdef HAVE_SYS_SOCKET_H
9623 #include <sys/socket.h>
9624 #endif
9625 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);
9626 int main() {
9627
9628 ; return 0; }
9629 EOF
9630 if { (eval echo configure:9631: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9631   rm -rf conftest*
9632           ac_not_found=no ; break 3
9633 else
9634   echo "configure: failed program was:" >&5
9635   cat conftest.$ac_ext >&5
9636   rm -rf conftest*
9637   ac_not_found=yes
9638 fi
9639 rm -f conftest*
9640       done
9641      done
9642     done
9643    
9644 fi
9645   
9646 fi
9647  
9648 fi
9649  if test "$ac_not_found" = yes; then
9650   ac_cv_func_select_arg1=int 
9651   ac_cv_func_select_arg234='int *' 
9652   ac_cv_func_select_arg5='struct timeval *'
9653  fi
9654  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
9655  cat >> confdefs.h <<EOF
9656 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
9657 EOF
9658
9659  cat >> confdefs.h <<EOF
9660 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
9661 EOF
9662
9663  cat >> confdefs.h <<EOF
9664 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
9665 EOF
9666
9667
9668 fi
9669
9670
9671 for ac_hdr in regex.h 
9672 do
9673 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9674 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9675 echo "configure:9676: checking for $ac_hdr" >&5
9676 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9677   echo $ac_n "(cached) $ac_c" 1>&6
9678 else
9679   cat > conftest.$ac_ext <<EOF
9680 #line 9681 "configure"
9681 #include "confdefs.h"
9682 #include <$ac_hdr>
9683 EOF
9684 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9685 { (eval echo configure:9686: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9686 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9687 if test -z "$ac_err"; then
9688   rm -rf conftest*
9689   eval "ac_cv_header_$ac_safe=yes"
9690 else
9691   echo "$ac_err" >&5
9692   echo "configure: failed program was:" >&5
9693   cat conftest.$ac_ext >&5
9694   rm -rf conftest*
9695   eval "ac_cv_header_$ac_safe=no"
9696 fi
9697 rm -f conftest*
9698 fi
9699 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9700   echo "$ac_t""yes" 1>&6
9701     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9702   cat >> confdefs.h <<EOF
9703 #define $ac_tr_hdr 1
9704 EOF
9705  
9706 else
9707   echo "$ac_t""no" 1>&6
9708 fi
9709 done
9710
9711 if test "$ac_cv_header_regex_h" != yes ; then
9712         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
9713 fi
9714
9715 echo $ac_n "checking for library containing regfree""... $ac_c" 1>&6
9716 echo "configure:9717: checking for library containing regfree" >&5
9717 if eval "test \"\${ac_cv_search_regfree+set}\" = set"; then
9718   echo $ac_n "(cached) $ac_c" 1>&6
9719 else
9720   ac_func_search_save_LIBS="$LIBS"
9721 ac_cv_search_regfree="no"
9722 cat > conftest.$ac_ext <<EOF
9723 #line 9724 "configure"
9724 #include "confdefs.h"
9725 /* Override any gcc2 internal prototype to avoid an error.  */
9726 /* We use char because int might match the return type of a gcc2
9727     builtin and then its argument prototype would still apply.  */
9728 char regfree();
9729
9730 int main() {
9731 regfree()
9732 ; return 0; }
9733 EOF
9734 if { (eval echo configure:9735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9735   rm -rf conftest*
9736   ac_cv_search_regfree="none required"
9737 else
9738   echo "configure: failed program was:" >&5
9739   cat conftest.$ac_ext >&5
9740 fi
9741 rm -f conftest*
9742 test "$ac_cv_search_regfree" = "no" && for ac_lib in regex gnuregex; do
9743 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9744 cat > conftest.$ac_ext <<EOF
9745 #line 9746 "configure"
9746 #include "confdefs.h"
9747 /* Override any gcc2 internal prototype to avoid an error.  */
9748 /* We use char because int might match the return type of a gcc2
9749     builtin and then its argument prototype would still apply.  */
9750 char regfree();
9751
9752 int main() {
9753 regfree()
9754 ; return 0; }
9755 EOF
9756 if { (eval echo configure:9757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9757   rm -rf conftest*
9758   ac_cv_search_regfree="-l$ac_lib"
9759 break
9760 else
9761   echo "configure: failed program was:" >&5
9762   cat conftest.$ac_ext >&5
9763 fi
9764 rm -f conftest*
9765 done
9766 LIBS="$ac_func_search_save_LIBS"
9767 fi
9768
9769 echo "$ac_t""$ac_cv_search_regfree" 1>&6
9770 if test "$ac_cv_search_regfree" != "no"; then
9771   test "$ac_cv_search_regfree" = "none required" || LIBS="$ac_cv_search_regfree $LIBS"
9772   :
9773 else :
9774   { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
9775 fi
9776
9777
9778 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
9779 echo "configure:9780: checking for compatible POSIX regex" >&5
9780 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
9781   echo $ac_n "(cached) $ac_c" 1>&6
9782 else
9783   
9784         if test "$cross_compiling" = yes; then
9785   ol_cv_c_posix_regex=cross
9786 else
9787   cat > conftest.$ac_ext <<EOF
9788 #line 9789 "configure"
9789 #include "confdefs.h"
9790
9791 #include <sys/types.h>
9792 #include <regex.h>
9793 static char *pattern, *string;
9794 main()
9795 {
9796         int rc;
9797         regex_t re;
9798
9799         pattern = "^A";
9800
9801         if(regcomp(&re, pattern, 0)) {
9802                 return -1;
9803         }
9804         
9805         string = "ALL MATCH";
9806         
9807         rc = regexec(&re, string, 0, (void*)0, 0);
9808
9809         regfree(&re);
9810
9811         return rc;
9812 }
9813 EOF
9814 if { (eval echo configure:9815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9815 then
9816   ol_cv_c_posix_regex=yes
9817 else
9818   echo "configure: failed program was:" >&5
9819   cat conftest.$ac_ext >&5
9820   rm -fr conftest*
9821   ol_cv_c_posix_regex=no
9822 fi
9823 rm -fr conftest*
9824 fi
9825
9826 fi
9827
9828 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
9829
9830 if test "$ol_cv_c_posix_regex" = no ; then
9831         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
9832 fi
9833
9834
9835 have_uuid=no
9836 for ac_hdr in sys/uuid.h
9837 do
9838 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9839 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9840 echo "configure:9841: checking for $ac_hdr" >&5
9841 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9842   echo $ac_n "(cached) $ac_c" 1>&6
9843 else
9844   cat > conftest.$ac_ext <<EOF
9845 #line 9846 "configure"
9846 #include "confdefs.h"
9847 #include <$ac_hdr>
9848 EOF
9849 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9850 { (eval echo configure:9851: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9851 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9852 if test -z "$ac_err"; then
9853   rm -rf conftest*
9854   eval "ac_cv_header_$ac_safe=yes"
9855 else
9856   echo "$ac_err" >&5
9857   echo "configure: failed program was:" >&5
9858   cat conftest.$ac_ext >&5
9859   rm -rf conftest*
9860   eval "ac_cv_header_$ac_safe=no"
9861 fi
9862 rm -f conftest*
9863 fi
9864 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9865   echo "$ac_t""yes" 1>&6
9866     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9867   cat >> confdefs.h <<EOF
9868 #define $ac_tr_hdr 1
9869 EOF
9870  
9871 else
9872   echo "$ac_t""no" 1>&6
9873 fi
9874 done
9875
9876 if test $ac_cv_header_sys_uuid_h = yes ; then
9877         save_LIBS="$LIBS"
9878         
9879 echo $ac_n "checking for library containing uuid_to_str""... $ac_c" 1>&6
9880 echo "configure:9881: checking for library containing uuid_to_str" >&5
9881 if eval "test \"\${ac_cv_search_uuid_to_str+set}\" = set"; then
9882   echo $ac_n "(cached) $ac_c" 1>&6
9883 else
9884   ac_func_search_save_LIBS="$LIBS"
9885 ac_cv_search_uuid_to_str="no"
9886 cat > conftest.$ac_ext <<EOF
9887 #line 9888 "configure"
9888 #include "confdefs.h"
9889 /* Override any gcc2 internal prototype to avoid an error.  */
9890 /* We use char because int might match the return type of a gcc2
9891     builtin and then its argument prototype would still apply.  */
9892 char uuid_to_str();
9893
9894 int main() {
9895 uuid_to_str()
9896 ; return 0; }
9897 EOF
9898 if { (eval echo configure:9899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9899   rm -rf conftest*
9900   ac_cv_search_uuid_to_str="none required"
9901 else
9902   echo "configure: failed program was:" >&5
9903   cat conftest.$ac_ext >&5
9904 fi
9905 rm -f conftest*
9906 test "$ac_cv_search_uuid_to_str" = "no" && for ac_lib in uuid; do
9907 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9908 cat > conftest.$ac_ext <<EOF
9909 #line 9910 "configure"
9910 #include "confdefs.h"
9911 /* Override any gcc2 internal prototype to avoid an error.  */
9912 /* We use char because int might match the return type of a gcc2
9913     builtin and then its argument prototype would still apply.  */
9914 char uuid_to_str();
9915
9916 int main() {
9917 uuid_to_str()
9918 ; return 0; }
9919 EOF
9920 if { (eval echo configure:9921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9921   rm -rf conftest*
9922   ac_cv_search_uuid_to_str="-l$ac_lib"
9923 break
9924 else
9925   echo "configure: failed program was:" >&5
9926   cat conftest.$ac_ext >&5
9927 fi
9928 rm -f conftest*
9929 done
9930 LIBS="$ac_func_search_save_LIBS"
9931 fi
9932
9933 echo "$ac_t""$ac_cv_search_uuid_to_str" 1>&6
9934 if test "$ac_cv_search_uuid_to_str" != "no"; then
9935   test "$ac_cv_search_uuid_to_str" = "none required" || LIBS="$ac_cv_search_uuid_to_str $LIBS"
9936   have_uuid=yes
9937 else :
9938   :
9939 fi
9940         LIBS="$save_LIBS"
9941
9942         if test have_uuid = yes ; then
9943                 cat >> confdefs.h <<\EOF
9944 #define HAVE_UUID_TO_STR 1
9945 EOF
9946
9947
9948                 test "$ac_cv_search_uuid_to_str" = "none required" || \
9949                         SLAPD_LIBS="$SLAPD_LIBS $ac_cv_search_uuid_to_str"
9950         fi
9951 fi
9952
9953 if test $have_uuid = no ; then
9954         echo $ac_n "checking to see if -lrpcrt4 is needed for win32 UUID support""... $ac_c" 1>&6
9955 echo "configure:9956: checking to see if -lrpcrt4 is needed for win32 UUID support" >&5
9956         save_LIBS="$LIBS"
9957         LIBS="$LIBS -lrpcrt4"
9958         cat > conftest.$ac_ext <<EOF
9959 #line 9960 "configure"
9960 #include "confdefs.h"
9961
9962                 char UuidCreate@4();
9963                 char UuidToStringA@8();
9964                 
9965 int main() {
9966
9967                 UuidCreate@4();
9968                 UuidToStringA@8();
9969                 
9970 ; return 0; }
9971 EOF
9972 if { (eval echo configure:9973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9973   rm -rf conftest*
9974   need_rpcrt=yes
9975 else
9976   echo "configure: failed program was:" >&5
9977   cat conftest.$ac_ext >&5
9978   rm -rf conftest*
9979   need_rpcrt=no
9980 fi
9981 rm -f conftest*
9982         if test $need_rpcrt = yes; then
9983                 SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
9984         fi
9985         LIBS="$save_LIBS"
9986         echo "$ac_t""$need_rpcrt" 1>&6
9987 fi
9988
9989 ol_link_dnssrv=no
9990 echo $ac_n "checking for res_query""... $ac_c" 1>&6
9991 echo "configure:9992: checking for res_query" >&5
9992 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
9993   echo $ac_n "(cached) $ac_c" 1>&6
9994 else
9995   cat > conftest.$ac_ext <<EOF
9996 #line 9997 "configure"
9997 #include "confdefs.h"
9998 /* System header to define __stub macros and hopefully few prototypes,
9999     which can conflict with char res_query(); below.  */
10000 #include <assert.h>
10001 /* Override any gcc2 internal prototype to avoid an error.  */
10002 /* We use char because int might match the return type of a gcc2
10003     builtin and then its argument prototype would still apply.  */
10004 char res_query();
10005 char (*f)();
10006
10007 int main() {
10008
10009 /* The GNU C library defines this for functions which it implements
10010     to always fail with ENOSYS.  Some functions are actually named
10011     something starting with __ and the normal name is an alias.  */
10012 #if defined (__stub_res_query) || defined (__stub___res_query)
10013 choke me
10014 #else
10015 f = res_query;
10016 #endif
10017
10018 ; return 0; }
10019 EOF
10020 if { (eval echo configure:10021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10021   rm -rf conftest*
10022   eval "ac_cv_func_res_query=yes"
10023 else
10024   echo "configure: failed program was:" >&5
10025   cat conftest.$ac_ext >&5
10026   rm -rf conftest*
10027   eval "ac_cv_func_res_query=no"
10028 fi
10029 rm -f conftest*
10030 fi
10031
10032 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
10033   echo "$ac_t""yes" 1>&6
10034   :
10035 else
10036   echo "$ac_t""no" 1>&6
10037 fi
10038
10039 if test $ac_cv_func_res_query = no ; then 
10040         echo $ac_n "checking for __res_query""... $ac_c" 1>&6
10041 echo "configure:10042: checking for __res_query" >&5
10042 if eval "test \"\${ac_cv_func___res_query+set}\" = set"; then
10043   echo $ac_n "(cached) $ac_c" 1>&6
10044 else
10045   cat > conftest.$ac_ext <<EOF
10046 #line 10047 "configure"
10047 #include "confdefs.h"
10048 /* System header to define __stub macros and hopefully few prototypes,
10049     which can conflict with char __res_query(); below.  */
10050 #include <assert.h>
10051 /* Override any gcc2 internal prototype to avoid an error.  */
10052 /* We use char because int might match the return type of a gcc2
10053     builtin and then its argument prototype would still apply.  */
10054 char __res_query();
10055 char (*f)();
10056
10057 int main() {
10058
10059 /* The GNU C library defines this for functions which it implements
10060     to always fail with ENOSYS.  Some functions are actually named
10061     something starting with __ and the normal name is an alias.  */
10062 #if defined (__stub___res_query) || defined (__stub_____res_query)
10063 choke me
10064 #else
10065 f = __res_query;
10066 #endif
10067
10068 ; return 0; }
10069 EOF
10070 if { (eval echo configure:10071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10071   rm -rf conftest*
10072   eval "ac_cv_func___res_query=yes"
10073 else
10074   echo "configure: failed program was:" >&5
10075   cat conftest.$ac_ext >&5
10076   rm -rf conftest*
10077   eval "ac_cv_func___res_query=no"
10078 fi
10079 rm -f conftest*
10080 fi
10081
10082 if eval "test \"`echo '$ac_cv_func_'__res_query`\" = yes"; then
10083   echo "$ac_t""yes" 1>&6
10084   :
10085 else
10086   echo "$ac_t""no" 1>&6
10087 fi
10088
10089         ac_cv_func_res_query=$ac_cv_func___res_query
10090 fi
10091
10092 if test $ac_cv_func_res_query = no ; then 
10093         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
10094 echo "configure:10095: checking for res_query in -lbind" >&5
10095 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
10096 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10097   echo $ac_n "(cached) $ac_c" 1>&6
10098 else
10099   ac_save_LIBS="$LIBS"
10100 LIBS="-lbind  $LIBS"
10101 cat > conftest.$ac_ext <<EOF
10102 #line 10103 "configure"
10103 #include "confdefs.h"
10104 /* Override any gcc2 internal prototype to avoid an error.  */
10105 /* We use char because int might match the return type of a gcc2
10106     builtin and then its argument prototype would still apply.  */
10107 char res_query();
10108
10109 int main() {
10110 res_query()
10111 ; return 0; }
10112 EOF
10113 if { (eval echo configure:10114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10114   rm -rf conftest*
10115   eval "ac_cv_lib_$ac_lib_var=yes"
10116 else
10117   echo "configure: failed program was:" >&5
10118   cat conftest.$ac_ext >&5
10119   rm -rf conftest*
10120   eval "ac_cv_lib_$ac_lib_var=no"
10121 fi
10122 rm -f conftest*
10123 LIBS="$ac_save_LIBS"
10124
10125 fi
10126 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10127   echo "$ac_t""yes" 1>&6
10128     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10129     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10130   cat >> confdefs.h <<EOF
10131 #define $ac_tr_lib 1
10132 EOF
10133
10134   LIBS="-lbind $LIBS"
10135
10136 else
10137   echo "$ac_t""no" 1>&6
10138 fi
10139
10140         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
10141 fi
10142
10143 if test $ac_cv_func_res_query = no ; then 
10144         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
10145 echo "configure:10146: checking for __res_query in -lbind" >&5
10146 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
10147 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10148   echo $ac_n "(cached) $ac_c" 1>&6
10149 else
10150   ac_save_LIBS="$LIBS"
10151 LIBS="-lbind  $LIBS"
10152 cat > conftest.$ac_ext <<EOF
10153 #line 10154 "configure"
10154 #include "confdefs.h"
10155 /* Override any gcc2 internal prototype to avoid an error.  */
10156 /* We use char because int might match the return type of a gcc2
10157     builtin and then its argument prototype would still apply.  */
10158 char __res_query();
10159
10160 int main() {
10161 __res_query()
10162 ; return 0; }
10163 EOF
10164 if { (eval echo configure:10165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10165   rm -rf conftest*
10166   eval "ac_cv_lib_$ac_lib_var=yes"
10167 else
10168   echo "configure: failed program was:" >&5
10169   cat conftest.$ac_ext >&5
10170   rm -rf conftest*
10171   eval "ac_cv_lib_$ac_lib_var=no"
10172 fi
10173 rm -f conftest*
10174 LIBS="$ac_save_LIBS"
10175
10176 fi
10177 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10178   echo "$ac_t""yes" 1>&6
10179     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10180     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10181   cat >> confdefs.h <<EOF
10182 #define $ac_tr_lib 1
10183 EOF
10184
10185   LIBS="-lbind $LIBS"
10186
10187 else
10188   echo "$ac_t""no" 1>&6
10189 fi
10190
10191         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
10192 fi
10193
10194 if test $ac_cv_func_res_query = no ; then 
10195         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
10196 echo "configure:10197: checking for res_query in -lresolv" >&5
10197 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
10198 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10199   echo $ac_n "(cached) $ac_c" 1>&6
10200 else
10201   ac_save_LIBS="$LIBS"
10202 LIBS="-lresolv  $LIBS"
10203 cat > conftest.$ac_ext <<EOF
10204 #line 10205 "configure"
10205 #include "confdefs.h"
10206 /* Override any gcc2 internal prototype to avoid an error.  */
10207 /* We use char because int might match the return type of a gcc2
10208     builtin and then its argument prototype would still apply.  */
10209 char res_query();
10210
10211 int main() {
10212 res_query()
10213 ; return 0; }
10214 EOF
10215 if { (eval echo configure:10216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10216   rm -rf conftest*
10217   eval "ac_cv_lib_$ac_lib_var=yes"
10218 else
10219   echo "configure: failed program was:" >&5
10220   cat conftest.$ac_ext >&5
10221   rm -rf conftest*
10222   eval "ac_cv_lib_$ac_lib_var=no"
10223 fi
10224 rm -f conftest*
10225 LIBS="$ac_save_LIBS"
10226
10227 fi
10228 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10229   echo "$ac_t""yes" 1>&6
10230     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10231     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10232   cat >> confdefs.h <<EOF
10233 #define $ac_tr_lib 1
10234 EOF
10235
10236   LIBS="-lresolv $LIBS"
10237
10238 else
10239   echo "$ac_t""no" 1>&6
10240 fi
10241
10242         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
10243 fi
10244
10245 if test $ac_cv_func_res_query = no ; then 
10246         echo $ac_n "checking for __res_query in -lresolv""... $ac_c" 1>&6
10247 echo "configure:10248: checking for __res_query in -lresolv" >&5
10248 ac_lib_var=`echo resolv'_'__res_query | sed 'y%./+-:%__p__%'`
10249 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10250   echo $ac_n "(cached) $ac_c" 1>&6
10251 else
10252   ac_save_LIBS="$LIBS"
10253 LIBS="-lresolv  $LIBS"
10254 cat > conftest.$ac_ext <<EOF
10255 #line 10256 "configure"
10256 #include "confdefs.h"
10257 /* Override any gcc2 internal prototype to avoid an error.  */
10258 /* We use char because int might match the return type of a gcc2
10259     builtin and then its argument prototype would still apply.  */
10260 char __res_query();
10261
10262 int main() {
10263 __res_query()
10264 ; return 0; }
10265 EOF
10266 if { (eval echo configure:10267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10267   rm -rf conftest*
10268   eval "ac_cv_lib_$ac_lib_var=yes"
10269 else
10270   echo "configure: failed program was:" >&5
10271   cat conftest.$ac_ext >&5
10272   rm -rf conftest*
10273   eval "ac_cv_lib_$ac_lib_var=no"
10274 fi
10275 rm -f conftest*
10276 LIBS="$ac_save_LIBS"
10277
10278 fi
10279 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10280   echo "$ac_t""yes" 1>&6
10281     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10282     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10283   cat >> confdefs.h <<EOF
10284 #define $ac_tr_lib 1
10285 EOF
10286
10287   LIBS="-lresolv $LIBS"
10288
10289 else
10290   echo "$ac_t""no" 1>&6
10291 fi
10292
10293         ac_cv_func_res_query=$ac_cv_lib_resolv___res_query
10294 fi
10295
10296 if test "$ac_cv_func_res_query" = yes ; then
10297         cat >> confdefs.h <<\EOF
10298 #define HAVE_RES_QUERY 1
10299 EOF
10300
10301
10302         if test $ol_enable_dnssrv != no ; then
10303                 ol_link_dnssrv=yes
10304         fi
10305 fi
10306
10307 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
10308         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
10309 fi
10310
10311 for ac_func in getaddrinfo gai_strerror inet_ntop 
10312 do
10313 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10314 echo "configure:10315: checking for $ac_func" >&5
10315 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10316   echo $ac_n "(cached) $ac_c" 1>&6
10317 else
10318   cat > conftest.$ac_ext <<EOF
10319 #line 10320 "configure"
10320 #include "confdefs.h"
10321 /* System header to define __stub macros and hopefully few prototypes,
10322     which can conflict with char $ac_func(); below.  */
10323 #include <assert.h>
10324 /* Override any gcc2 internal prototype to avoid an error.  */
10325 /* We use char because int might match the return type of a gcc2
10326     builtin and then its argument prototype would still apply.  */
10327 char $ac_func();
10328 char (*f)();
10329
10330 int main() {
10331
10332 /* The GNU C library defines this for functions which it implements
10333     to always fail with ENOSYS.  Some functions are actually named
10334     something starting with __ and the normal name is an alias.  */
10335 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10336 choke me
10337 #else
10338 f = $ac_func;
10339 #endif
10340
10341 ; return 0; }
10342 EOF
10343 if { (eval echo configure:10344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10344   rm -rf conftest*
10345   eval "ac_cv_func_$ac_func=yes"
10346 else
10347   echo "configure: failed program was:" >&5
10348   cat conftest.$ac_ext >&5
10349   rm -rf conftest*
10350   eval "ac_cv_func_$ac_func=no"
10351 fi
10352 rm -f conftest*
10353 fi
10354
10355 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10356   echo "$ac_t""yes" 1>&6
10357     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10358   cat >> confdefs.h <<EOF
10359 #define $ac_tr_func 1
10360 EOF
10361  
10362 else
10363   echo "$ac_t""no" 1>&6
10364 fi
10365 done
10366
10367
10368 ol_link_ipv6=no
10369 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
10370         if test $ol_enable_ipv6 = yes ; then
10371                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
10372         fi
10373 elif test $ol_enable_ipv6 != no ; then
10374         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
10375 echo "configure:10376: checking INET6_ADDRSTRLEN" >&5
10376 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
10377   echo $ac_n "(cached) $ac_c" 1>&6
10378 else
10379   
10380                 cat > conftest.$ac_ext <<EOF
10381 #line 10382 "configure"
10382 #include "confdefs.h"
10383
10384 #                       include <netinet/in.h>
10385 #                       ifdef INET6_ADDRSTRLEN
10386                                 __has_inet6_addrstrlen__;
10387 #                       endif
10388                 
10389 EOF
10390 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10391   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
10392   rm -rf conftest*
10393   ol_cv_inet6_addrstrlen=yes
10394 else
10395   rm -rf conftest*
10396   ol_cv_inet6_addrstrlen=no
10397 fi
10398 rm -f conftest*
10399
10400 fi
10401
10402 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
10403
10404
10405         echo $ac_n "checking struct sockaddr_storage""... $ac_c" 1>&6
10406 echo "configure:10407: checking struct sockaddr_storage" >&5
10407 if eval "test \"\${ol_cv_struct_sockaddr_storage+set}\" = set"; then
10408   echo $ac_n "(cached) $ac_c" 1>&6
10409 else
10410   
10411                 cat > conftest.$ac_ext <<EOF
10412 #line 10413 "configure"
10413 #include "confdefs.h"
10414
10415 #include <sys/types.h>
10416 #include <sys/socket.h>
10417
10418 int main() {
10419
10420                         struct sockaddr_storage ss;
10421
10422 ; return 0; }
10423 EOF
10424 if { (eval echo configure:10425: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10425   rm -rf conftest*
10426   ol_cv_struct_sockaddr_storage=yes
10427 else
10428   echo "configure: failed program was:" >&5
10429   cat conftest.$ac_ext >&5
10430   rm -rf conftest*
10431   ol_cv_struct_sockaddr_storage=no
10432 fi
10433 rm -f conftest*
10434 fi
10435
10436 echo "$ac_t""$ol_cv_struct_sockaddr_storage" 1>&6
10437
10438         if test $ol_cv_inet6_addrstrlen = yes \
10439                 -a $ol_cv_struct_sockaddr_storage = yes ; then
10440                 ol_link_ipv6=yes
10441         elif test $ol_enable_ipv6 = yes \
10442                         -a $ol_cv_inet6_addrstrlen = no ; then
10443                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
10444         elif test $ol_enable_ipv6 = yes \
10445                         -a $ol_cv_struct_sockaddr_storage = no ; then
10446                 { echo "configure: error: IPv6 support requires struct sockaddr_storage" 1>&2; exit 1; }
10447         fi
10448 fi
10449
10450 if test $ol_enable_local != no ; then
10451         for ac_hdr in sys/un.h 
10452 do
10453 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10454 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10455 echo "configure:10456: checking for $ac_hdr" >&5
10456 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10457   echo $ac_n "(cached) $ac_c" 1>&6
10458 else
10459   cat > conftest.$ac_ext <<EOF
10460 #line 10461 "configure"
10461 #include "confdefs.h"
10462 #include <$ac_hdr>
10463 EOF
10464 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10465 { (eval echo configure:10466: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10466 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10467 if test -z "$ac_err"; then
10468   rm -rf conftest*
10469   eval "ac_cv_header_$ac_safe=yes"
10470 else
10471   echo "$ac_err" >&5
10472   echo "configure: failed program was:" >&5
10473   cat conftest.$ac_ext >&5
10474   rm -rf conftest*
10475   eval "ac_cv_header_$ac_safe=no"
10476 fi
10477 rm -f conftest*
10478 fi
10479 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10480   echo "$ac_t""yes" 1>&6
10481     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10482   cat >> confdefs.h <<EOF
10483 #define $ac_tr_hdr 1
10484 EOF
10485  
10486 else
10487   echo "$ac_t""no" 1>&6
10488 fi
10489 done
10490
10491
10492         if test $ol_enable_local = auto ; then
10493                 ol_enable_local=$ac_cv_header_sys_un_h
10494         elif test $ac_cv_header_sys_un_h = no ; then
10495                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
10496         fi
10497 fi
10498
10499 ol_link_kbind=no
10500 ol_link_kpasswd=no
10501 ol_link_krb5=no
10502 ol_link_krb4=no
10503
10504 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
10505         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
10506         -o $ol_with_kerberos = k425 ; then
10507
10508         for ac_hdr in krb5.h
10509 do
10510 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10511 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10512 echo "configure:10513: checking for $ac_hdr" >&5
10513 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10514   echo $ac_n "(cached) $ac_c" 1>&6
10515 else
10516   cat > conftest.$ac_ext <<EOF
10517 #line 10518 "configure"
10518 #include "confdefs.h"
10519 #include <$ac_hdr>
10520 EOF
10521 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10522 { (eval echo configure:10523: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10523 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10524 if test -z "$ac_err"; then
10525   rm -rf conftest*
10526   eval "ac_cv_header_$ac_safe=yes"
10527 else
10528   echo "$ac_err" >&5
10529   echo "configure: failed program was:" >&5
10530   cat conftest.$ac_ext >&5
10531   rm -rf conftest*
10532   eval "ac_cv_header_$ac_safe=no"
10533 fi
10534 rm -f conftest*
10535 fi
10536 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10537   echo "$ac_t""yes" 1>&6
10538     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10539   cat >> confdefs.h <<EOF
10540 #define $ac_tr_hdr 1
10541 EOF
10542  
10543 else
10544   echo "$ac_t""no" 1>&6
10545 fi
10546 done
10547
10548
10549         if test $ac_cv_header_krb5_h = yes ; then
10550                                 for ac_hdr in heim_err.h
10551 do
10552 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10553 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10554 echo "configure:10555: checking for $ac_hdr" >&5
10555 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10556   echo $ac_n "(cached) $ac_c" 1>&6
10557 else
10558   cat > conftest.$ac_ext <<EOF
10559 #line 10560 "configure"
10560 #include "confdefs.h"
10561 #include <$ac_hdr>
10562 EOF
10563 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10564 { (eval echo configure:10565: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10565 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10566 if test -z "$ac_err"; then
10567   rm -rf conftest*
10568   eval "ac_cv_header_$ac_safe=yes"
10569 else
10570   echo "$ac_err" >&5
10571   echo "configure: failed program was:" >&5
10572   cat conftest.$ac_ext >&5
10573   rm -rf conftest*
10574   eval "ac_cv_header_$ac_safe=no"
10575 fi
10576 rm -f conftest*
10577 fi
10578 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10579   echo "$ac_t""yes" 1>&6
10580     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10581   cat >> confdefs.h <<EOF
10582 #define $ac_tr_hdr 1
10583 EOF
10584  
10585 else
10586   echo "$ac_t""no" 1>&6
10587 fi
10588 done
10589
10590                 if test $ac_cv_header_heim_err_h = yes ; then
10591                         krb5_impl=heimdal
10592                 else
10593                         krb5_impl=mit
10594                 fi
10595
10596                 if test $krb5_impl = mit; then
10597                         echo $ac_n "checking for main in -lk5crypto""... $ac_c" 1>&6
10598 echo "configure:10599: checking for main in -lk5crypto" >&5
10599 ac_lib_var=`echo k5crypto'_'main | sed 'y%./+-:%__p__%'`
10600 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10601   echo $ac_n "(cached) $ac_c" 1>&6
10602 else
10603   ac_save_LIBS="$LIBS"
10604 LIBS="-lk5crypto  $LIBS"
10605 cat > conftest.$ac_ext <<EOF
10606 #line 10607 "configure"
10607 #include "confdefs.h"
10608
10609 int main() {
10610 main()
10611 ; return 0; }
10612 EOF
10613 if { (eval echo configure:10614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10614   rm -rf conftest*
10615   eval "ac_cv_lib_$ac_lib_var=yes"
10616 else
10617   echo "configure: failed program was:" >&5
10618   cat conftest.$ac_ext >&5
10619   rm -rf conftest*
10620   eval "ac_cv_lib_$ac_lib_var=no"
10621 fi
10622 rm -f conftest*
10623 LIBS="$ac_save_LIBS"
10624
10625 fi
10626 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10627   echo "$ac_t""yes" 1>&6
10628   krb5crypto=k5crypto
10629 else
10630   echo "$ac_t""no" 1>&6
10631 krb5crypto=crypto
10632 fi
10633
10634
10635                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
10636 echo "configure:10637: checking for main in -lkrb5" >&5
10637 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
10638 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10639   echo $ac_n "(cached) $ac_c" 1>&6
10640 else
10641   ac_save_LIBS="$LIBS"
10642 LIBS="-lkrb5 -l$krb5crypto -lcom_err $LIBS"
10643 cat > conftest.$ac_ext <<EOF
10644 #line 10645 "configure"
10645 #include "confdefs.h"
10646
10647 int main() {
10648 main()
10649 ; return 0; }
10650 EOF
10651 if { (eval echo configure:10652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10652   rm -rf conftest*
10653   eval "ac_cv_lib_$ac_lib_var=yes"
10654 else
10655   echo "configure: failed program was:" >&5
10656   cat conftest.$ac_ext >&5
10657   rm -rf conftest*
10658   eval "ac_cv_lib_$ac_lib_var=no"
10659 fi
10660 rm -f conftest*
10661 LIBS="$ac_save_LIBS"
10662
10663 fi
10664 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10665   echo "$ac_t""yes" 1>&6
10666   have_krb5=yes
10667                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lcom_err"
10668 else
10669   echo "$ac_t""no" 1>&6
10670 have_krb5=no
10671 fi
10672
10673
10674                 elif test $krb5_impl = heimdal; then
10675                         echo $ac_n "checking for main in -ldes""... $ac_c" 1>&6
10676 echo "configure:10677: checking for main in -ldes" >&5
10677 ac_lib_var=`echo des'_'main | sed 'y%./+-:%__p__%'`
10678 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10679   echo $ac_n "(cached) $ac_c" 1>&6
10680 else
10681   ac_save_LIBS="$LIBS"
10682 LIBS="-ldes  $LIBS"
10683 cat > conftest.$ac_ext <<EOF
10684 #line 10685 "configure"
10685 #include "confdefs.h"
10686
10687 int main() {
10688 main()
10689 ; return 0; }
10690 EOF
10691 if { (eval echo configure:10692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10692   rm -rf conftest*
10693   eval "ac_cv_lib_$ac_lib_var=yes"
10694 else
10695   echo "configure: failed program was:" >&5
10696   cat conftest.$ac_ext >&5
10697   rm -rf conftest*
10698   eval "ac_cv_lib_$ac_lib_var=no"
10699 fi
10700 rm -f conftest*
10701 LIBS="$ac_save_LIBS"
10702
10703 fi
10704 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10705   echo "$ac_t""yes" 1>&6
10706   krb5crypto=des
10707 else
10708   echo "$ac_t""no" 1>&6
10709 krb5crypto=crypto
10710 fi
10711
10712
10713                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
10714 echo "configure:10715: checking for main in -lkrb5" >&5
10715 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
10716 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10717   echo $ac_n "(cached) $ac_c" 1>&6
10718 else
10719   ac_save_LIBS="$LIBS"
10720 LIBS="-lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err $LIBS"
10721 cat > conftest.$ac_ext <<EOF
10722 #line 10723 "configure"
10723 #include "confdefs.h"
10724
10725 int main() {
10726 main()
10727 ; return 0; }
10728 EOF
10729 if { (eval echo configure:10730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10730   rm -rf conftest*
10731   eval "ac_cv_lib_$ac_lib_var=yes"
10732 else
10733   echo "configure: failed program was:" >&5
10734   cat conftest.$ac_ext >&5
10735   rm -rf conftest*
10736   eval "ac_cv_lib_$ac_lib_var=no"
10737 fi
10738 rm -f conftest*
10739 LIBS="$ac_save_LIBS"
10740
10741 fi
10742 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10743   echo "$ac_t""yes" 1>&6
10744   have_krb5=yes
10745                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err"
10746 else
10747   echo "$ac_t""no" 1>&6
10748 have_krb5=no
10749 fi
10750
10751
10752                         cat >> confdefs.h <<\EOF
10753 #define HAVE_HEIMDAL_KERBEROS 1
10754 EOF
10755
10756
10757                 else
10758                         have_krb5=no
10759                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
10760                 fi
10761
10762                 if test $have_krb5 = yes ; then
10763                         ol_link_krb5=yes
10764
10765                         cat >> confdefs.h <<\EOF
10766 #define HAVE_KRB5 1
10767 EOF
10768
10769
10770                         if test $ol_enable_kpasswd != no ; then
10771                                 ol_link_kpasswd=yes;
10772                         fi
10773
10774                         if test $ol_with_kerberos = k5only ; then
10775                                 ol_with_kerberos=found
10776                         fi
10777
10778                 elif test $ol_with_kerberos != auto ; then
10779                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
10780                 fi
10781
10782         fi
10783 fi
10784
10785 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
10786         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
10787
10788         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
10789 do
10790 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10791 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10792 echo "configure:10793: checking for $ac_hdr" >&5
10793 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10794   echo $ac_n "(cached) $ac_c" 1>&6
10795 else
10796   cat > conftest.$ac_ext <<EOF
10797 #line 10798 "configure"
10798 #include "confdefs.h"
10799 #include <$ac_hdr>
10800 EOF
10801 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10802 { (eval echo configure:10803: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10803 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10804 if test -z "$ac_err"; then
10805   rm -rf conftest*
10806   eval "ac_cv_header_$ac_safe=yes"
10807 else
10808   echo "$ac_err" >&5
10809   echo "configure: failed program was:" >&5
10810   cat conftest.$ac_ext >&5
10811   rm -rf conftest*
10812   eval "ac_cv_header_$ac_safe=no"
10813 fi
10814 rm -f conftest*
10815 fi
10816 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10817   echo "$ac_t""yes" 1>&6
10818     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10819   cat >> confdefs.h <<EOF
10820 #define $ac_tr_hdr 1
10821 EOF
10822  
10823 else
10824   echo "$ac_t""no" 1>&6
10825 fi
10826 done
10827
10828
10829         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
10830                 if test $krb5_impl = mit; then
10831                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
10832 echo "configure:10833: checking for main in -lkrb4" >&5
10833 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
10834 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10835   echo $ac_n "(cached) $ac_c" 1>&6
10836 else
10837   ac_save_LIBS="$LIBS"
10838 LIBS="-lkrb4 -ldes425 -lkrb5 -l$krb5crypto -lcom_err $LIBS"
10839 cat > conftest.$ac_ext <<EOF
10840 #line 10841 "configure"
10841 #include "confdefs.h"
10842
10843 int main() {
10844 main()
10845 ; return 0; }
10846 EOF
10847 if { (eval echo configure:10848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10848   rm -rf conftest*
10849   eval "ac_cv_lib_$ac_lib_var=yes"
10850 else
10851   echo "configure: failed program was:" >&5
10852   cat conftest.$ac_ext >&5
10853   rm -rf conftest*
10854   eval "ac_cv_lib_$ac_lib_var=no"
10855 fi
10856 rm -f conftest*
10857 LIBS="$ac_save_LIBS"
10858
10859 fi
10860 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10861   echo "$ac_t""yes" 1>&6
10862   have_k425=yes
10863                                 KRB4_LIBS="-lkrb4 -ldes425"
10864 else
10865   echo "$ac_t""no" 1>&6
10866 have_k425=no
10867 fi
10868
10869
10870                 elif test $krb5_impl = heimdal; then
10871                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
10872 echo "configure:10873: checking for main in -lkrb4" >&5
10873 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
10874 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10875   echo $ac_n "(cached) $ac_c" 1>&6
10876 else
10877   ac_save_LIBS="$LIBS"
10878 LIBS="-lkrb4 -lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err $LIBS"
10879 cat > conftest.$ac_ext <<EOF
10880 #line 10881 "configure"
10881 #include "confdefs.h"
10882
10883 int main() {
10884 main()
10885 ; return 0; }
10886 EOF
10887 if { (eval echo configure:10888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10888   rm -rf conftest*
10889   eval "ac_cv_lib_$ac_lib_var=yes"
10890 else
10891   echo "configure: failed program was:" >&5
10892   cat conftest.$ac_ext >&5
10893   rm -rf conftest*
10894   eval "ac_cv_lib_$ac_lib_var=no"
10895 fi
10896 rm -f conftest*
10897 LIBS="$ac_save_LIBS"
10898
10899 fi
10900 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10901   echo "$ac_t""yes" 1>&6
10902   have_k425=yes
10903                                 KRB4_LIBS="-lkrb4"
10904 else
10905   echo "$ac_t""no" 1>&6
10906 have_k425=no
10907 fi
10908
10909
10910                 else
10911                         have_425=no
10912                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
10913                 fi
10914
10915                 if test $have_k425 = yes ; then
10916                         ol_with_kerberos=found
10917                         ol_link_krb4=yes
10918
10919                         cat >> confdefs.h <<\EOF
10920 #define HAVE_KRB425 1
10921 EOF
10922
10923                         cat >> confdefs.h <<\EOF
10924 #define HAVE_KRB4 1
10925 EOF
10926
10927
10928                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
10929 echo "configure:10930: checking for des_debug in Kerberos libraries" >&5
10930 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
10931   echo $ac_n "(cached) $ac_c" 1>&6
10932 else
10933   
10934                                                                 save_LIBS="$LIBS"
10935                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
10936                                 cat > conftest.$ac_ext <<EOF
10937 #line 10938 "configure"
10938 #include "confdefs.h"
10939
10940 #include <kerberosIV/krb.h>
10941 #include <kerberosIV/des.h>
10942 extern int des_debug;
10943
10944 int main() {
10945
10946 des_debug = 1;
10947
10948 ; return 0; }
10949 EOF
10950 if { (eval echo configure:10951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10951   rm -rf conftest*
10952   ol_cv_var_des_debug=yes
10953 else
10954   echo "configure: failed program was:" >&5
10955   cat conftest.$ac_ext >&5
10956   rm -rf conftest*
10957   ol_cv_var_des_debug=no
10958 fi
10959 rm -f conftest*
10960                                                                 LIBS="$save_LIBS"
10961                         
10962 fi
10963
10964 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
10965
10966                         if test $ol_cv_var_des_debug = yes ; then
10967                                 cat >> confdefs.h <<\EOF
10968 #define HAVE_DES_DEBUG 1
10969 EOF
10970
10971                         fi
10972
10973                         LIBS="$save_LIBS"
10974                 fi
10975         fi
10976 fi
10977
10978 if test $ol_link_krb5 = yes ; then
10979         ol_with_kerberos=found
10980 fi
10981
10982 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
10983         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
10984
10985         for ac_hdr in krb.h des.h krb-archaeology.h 
10986 do
10987 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10988 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10989 echo "configure:10990: checking for $ac_hdr" >&5
10990 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10991   echo $ac_n "(cached) $ac_c" 1>&6
10992 else
10993   cat > conftest.$ac_ext <<EOF
10994 #line 10995 "configure"
10995 #include "confdefs.h"
10996 #include <$ac_hdr>
10997 EOF
10998 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10999 { (eval echo configure:11000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11000 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11001 if test -z "$ac_err"; then
11002   rm -rf conftest*
11003   eval "ac_cv_header_$ac_safe=yes"
11004 else
11005   echo "$ac_err" >&5
11006   echo "configure: failed program was:" >&5
11007   cat conftest.$ac_ext >&5
11008   rm -rf conftest*
11009   eval "ac_cv_header_$ac_safe=no"
11010 fi
11011 rm -f conftest*
11012 fi
11013 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11014   echo "$ac_t""yes" 1>&6
11015     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11016   cat >> confdefs.h <<EOF
11017 #define $ac_tr_hdr 1
11018 EOF
11019  
11020 else
11021   echo "$ac_t""no" 1>&6
11022 fi
11023 done
11024
11025
11026         if test $ac_cv_header_krb_h = yes ; then
11027                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
11028 echo "configure:11029: checking for main in -lkrb" >&5
11029 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
11030 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11031   echo $ac_n "(cached) $ac_c" 1>&6
11032 else
11033   ac_save_LIBS="$LIBS"
11034 LIBS="-lkrb -ldes $LIBS"
11035 cat > conftest.$ac_ext <<EOF
11036 #line 11037 "configure"
11037 #include "confdefs.h"
11038
11039 int main() {
11040 main()
11041 ; return 0; }
11042 EOF
11043 if { (eval echo configure:11044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11044   rm -rf conftest*
11045   eval "ac_cv_lib_$ac_lib_var=yes"
11046 else
11047   echo "configure: failed program was:" >&5
11048   cat conftest.$ac_ext >&5
11049   rm -rf conftest*
11050   eval "ac_cv_lib_$ac_lib_var=no"
11051 fi
11052 rm -f conftest*
11053 LIBS="$ac_save_LIBS"
11054
11055 fi
11056 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11057   echo "$ac_t""yes" 1>&6
11058   have_k4=yes
11059 else
11060   echo "$ac_t""no" 1>&6
11061 have_k4=no
11062 fi
11063
11064
11065                 if test $have_k4 = yes ; then
11066                         ol_with_kerberos=found
11067                         ol_link_krb4=yes
11068
11069                         cat >> confdefs.h <<\EOF
11070 #define HAVE_KRB4 1
11071 EOF
11072
11073
11074                         KRB4_LIBS="-lkrb -ldes"
11075
11076                         if test $ac_cv_header_krb_archaeology_h = yes ; then
11077                                 cat >> confdefs.h <<\EOF
11078 #define HAVE_KTH_KERBEROS 1
11079 EOF
11080
11081                         fi
11082                 fi
11083         fi
11084 fi
11085
11086 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
11087         ol_link_kpasswd=yes
11088 fi
11089
11090 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
11091         ol_link_kbind=yes
11092
11093 elif test $ol_enable_kbind = yes ; then
11094         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
11095 fi
11096
11097 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
11098         cat >> confdefs.h <<\EOF
11099 #define HAVE_KERBEROS 1
11100 EOF
11101
11102
11103 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
11104         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
11105 fi
11106
11107 ol_link_tls=no
11108 if test $ol_with_tls != no ; then
11109         for ac_hdr in openssl/ssl.h ssl.h
11110 do
11111 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11112 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11113 echo "configure:11114: checking for $ac_hdr" >&5
11114 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11115   echo $ac_n "(cached) $ac_c" 1>&6
11116 else
11117   cat > conftest.$ac_ext <<EOF
11118 #line 11119 "configure"
11119 #include "confdefs.h"
11120 #include <$ac_hdr>
11121 EOF
11122 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11123 { (eval echo configure:11124: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11124 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11125 if test -z "$ac_err"; then
11126   rm -rf conftest*
11127   eval "ac_cv_header_$ac_safe=yes"
11128 else
11129   echo "$ac_err" >&5
11130   echo "configure: failed program was:" >&5
11131   cat conftest.$ac_ext >&5
11132   rm -rf conftest*
11133   eval "ac_cv_header_$ac_safe=no"
11134 fi
11135 rm -f conftest*
11136 fi
11137 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11138   echo "$ac_t""yes" 1>&6
11139     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11140   cat >> confdefs.h <<EOF
11141 #define $ac_tr_hdr 1
11142 EOF
11143  
11144 else
11145   echo "$ac_t""no" 1>&6
11146 fi
11147 done
11148
11149         
11150         if test $ac_cv_header_openssl_ssl_h = yes \
11151                 -o $ac_cv_header_ssl_h = yes ; then
11152                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
11153 echo "configure:11154: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
11154 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
11155 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11156   echo $ac_n "(cached) $ac_c" 1>&6
11157 else
11158   ac_save_LIBS="$LIBS"
11159 LIBS="-lssl -lcrypto $LIBS"
11160 cat > conftest.$ac_ext <<EOF
11161 #line 11162 "configure"
11162 #include "confdefs.h"
11163 /* Override any gcc2 internal prototype to avoid an error.  */
11164 /* We use char because int might match the return type of a gcc2
11165     builtin and then its argument prototype would still apply.  */
11166 char SSLeay_add_ssl_algorithms();
11167
11168 int main() {
11169 SSLeay_add_ssl_algorithms()
11170 ; return 0; }
11171 EOF
11172 if { (eval echo configure:11173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11173   rm -rf conftest*
11174   eval "ac_cv_lib_$ac_lib_var=yes"
11175 else
11176   echo "configure: failed program was:" >&5
11177   cat conftest.$ac_ext >&5
11178   rm -rf conftest*
11179   eval "ac_cv_lib_$ac_lib_var=no"
11180 fi
11181 rm -f conftest*
11182 LIBS="$ac_save_LIBS"
11183
11184 fi
11185 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11186   echo "$ac_t""yes" 1>&6
11187   have_ssleay=yes
11188                         need_rsaref=no
11189 else
11190   echo "$ac_t""no" 1>&6
11191 have_ssleay=no
11192 fi
11193
11194                         
11195                 if test $have_ssleay = no ; then
11196                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
11197 echo "configure:11198: checking for SSL_library_init in -lssl" >&5
11198 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
11199 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11200   echo $ac_n "(cached) $ac_c" 1>&6
11201 else
11202   ac_save_LIBS="$LIBS"
11203 LIBS="-lssl -lcrypto $LIBS"
11204 cat > conftest.$ac_ext <<EOF
11205 #line 11206 "configure"
11206 #include "confdefs.h"
11207 /* Override any gcc2 internal prototype to avoid an error.  */
11208 /* We use char because int might match the return type of a gcc2
11209     builtin and then its argument prototype would still apply.  */
11210 char SSL_library_init();
11211
11212 int main() {
11213 SSL_library_init()
11214 ; return 0; }
11215 EOF
11216 if { (eval echo configure:11217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11217   rm -rf conftest*
11218   eval "ac_cv_lib_$ac_lib_var=yes"
11219 else
11220   echo "configure: failed program was:" >&5
11221   cat conftest.$ac_ext >&5
11222   rm -rf conftest*
11223   eval "ac_cv_lib_$ac_lib_var=no"
11224 fi
11225 rm -f conftest*
11226 LIBS="$ac_save_LIBS"
11227
11228 fi
11229 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11230   echo "$ac_t""yes" 1>&6
11231   have_ssleay=yes
11232                                 need_rsaref=no
11233 else
11234   echo "$ac_t""no" 1>&6
11235 have_ssleay=no
11236 fi
11237
11238                 fi
11239
11240                 if test $have_ssleay = no ; then
11241                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
11242 echo "configure:11243: checking for ssl3_accept in -lssl" >&5
11243 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
11244 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11245   echo $ac_n "(cached) $ac_c" 1>&6
11246 else
11247   ac_save_LIBS="$LIBS"
11248 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
11249 cat > conftest.$ac_ext <<EOF
11250 #line 11251 "configure"
11251 #include "confdefs.h"
11252 /* Override any gcc2 internal prototype to avoid an error.  */
11253 /* We use char because int might match the return type of a gcc2
11254     builtin and then its argument prototype would still apply.  */
11255 char ssl3_accept();
11256
11257 int main() {
11258 ssl3_accept()
11259 ; return 0; }
11260 EOF
11261 if { (eval echo configure:11262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11262   rm -rf conftest*
11263   eval "ac_cv_lib_$ac_lib_var=yes"
11264 else
11265   echo "configure: failed program was:" >&5
11266   cat conftest.$ac_ext >&5
11267   rm -rf conftest*
11268   eval "ac_cv_lib_$ac_lib_var=no"
11269 fi
11270 rm -f conftest*
11271 LIBS="$ac_save_LIBS"
11272
11273 fi
11274 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11275   echo "$ac_t""yes" 1>&6
11276   have_ssleay=yes
11277                                 need_rsaref=yes
11278 else
11279   echo "$ac_t""no" 1>&6
11280 have_ssleay=no
11281 fi
11282
11283                 fi
11284
11285                 if test $have_ssleay = yes ; then
11286                         ol_with_tls=found
11287                         ol_link_tls=yes
11288
11289                         cat >> confdefs.h <<\EOF
11290 #define HAVE_SSLEAY 1
11291 EOF
11292
11293
11294                         if test $need_rsaref = yes; then
11295                                 cat >> confdefs.h <<\EOF
11296 #define HAVE_RSAREF 1
11297 EOF
11298
11299
11300                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
11301                         else
11302                                 TLS_LIBS="-lssl -lcrypto"
11303                         fi
11304                 fi
11305         fi
11306
11307 else
11308         echo "configure: warning: TLS data protection not supported!" 1>&2
11309 fi
11310
11311 if test $ol_link_tls = yes ; then
11312         cat >> confdefs.h <<\EOF
11313 #define HAVE_TLS 1
11314 EOF
11315
11316
11317 elif test $ol_with_tls = auto ; then
11318         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
11319         echo "configure: warning: TLS data protection not supported!" 1>&2
11320
11321 elif test $ol_with_tls != no ; then
11322         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
11323 fi
11324
11325 if test $ol_enable_lmpasswd != no; then
11326         if test $ol_link_tls != yes ; then
11327                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
11328         fi
11329
11330         cat >> confdefs.h <<\EOF
11331 #define SLAPD_LMHASH 1
11332 EOF
11333
11334 fi
11335
11336 ol_link_threads=no
11337
11338 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11339         -o $ol_with_threads = nt ; then
11340
11341         
11342         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
11343 echo "configure:11344: checking for _beginthread" >&5
11344 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
11345   echo $ac_n "(cached) $ac_c" 1>&6
11346 else
11347   cat > conftest.$ac_ext <<EOF
11348 #line 11349 "configure"
11349 #include "confdefs.h"
11350 /* System header to define __stub macros and hopefully few prototypes,
11351     which can conflict with char _beginthread(); below.  */
11352 #include <assert.h>
11353 /* Override any gcc2 internal prototype to avoid an error.  */
11354 /* We use char because int might match the return type of a gcc2
11355     builtin and then its argument prototype would still apply.  */
11356 char _beginthread();
11357 char (*f)();
11358
11359 int main() {
11360
11361 /* The GNU C library defines this for functions which it implements
11362     to always fail with ENOSYS.  Some functions are actually named
11363     something starting with __ and the normal name is an alias.  */
11364 #if defined (__stub__beginthread) || defined (__stub____beginthread)
11365 choke me
11366 #else
11367 f = _beginthread;
11368 #endif
11369
11370 ; return 0; }
11371 EOF
11372 if { (eval echo configure:11373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11373   rm -rf conftest*
11374   eval "ac_cv_func__beginthread=yes"
11375 else
11376   echo "configure: failed program was:" >&5
11377   cat conftest.$ac_ext >&5
11378   rm -rf conftest*
11379   eval "ac_cv_func__beginthread=no"
11380 fi
11381 rm -f conftest*
11382 fi
11383
11384 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
11385   echo "$ac_t""yes" 1>&6
11386   :
11387 else
11388   echo "$ac_t""no" 1>&6
11389 fi
11390
11391
11392         if test $ac_cv_func__beginthread = yes ; then
11393                 cat >> confdefs.h <<\EOF
11394 #define HAVE_NT_THREADS 1
11395 EOF
11396
11397                 ol_cv_nt_threads=yes
11398         fi
11399
11400
11401         if test "$ol_cv_nt_threads" = yes ; then
11402                 ol_link_threads=nt
11403                 ol_with_threads=found
11404                 ol_with_yielding_select=yes
11405
11406                 cat >> confdefs.h <<\EOF
11407 #define HAVE_NT_SERVICE_MANAGER 1
11408 EOF
11409
11410                 cat >> confdefs.h <<\EOF
11411 #define HAVE_NT_EVENT_LOG 1
11412 EOF
11413
11414         fi
11415
11416         if test $ol_with_threads = nt ; then
11417                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
11418         fi
11419 fi
11420
11421 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11422         -o $ol_with_threads = posix ; then
11423
11424         for ac_hdr in pthread.h
11425 do
11426 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11427 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11428 echo "configure:11429: checking for $ac_hdr" >&5
11429 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11430   echo $ac_n "(cached) $ac_c" 1>&6
11431 else
11432   cat > conftest.$ac_ext <<EOF
11433 #line 11434 "configure"
11434 #include "confdefs.h"
11435 #include <$ac_hdr>
11436 EOF
11437 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11438 { (eval echo configure:11439: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11439 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11440 if test -z "$ac_err"; then
11441   rm -rf conftest*
11442   eval "ac_cv_header_$ac_safe=yes"
11443 else
11444   echo "$ac_err" >&5
11445   echo "configure: failed program was:" >&5
11446   cat conftest.$ac_ext >&5
11447   rm -rf conftest*
11448   eval "ac_cv_header_$ac_safe=no"
11449 fi
11450 rm -f conftest*
11451 fi
11452 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11453   echo "$ac_t""yes" 1>&6
11454     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11455   cat >> confdefs.h <<EOF
11456 #define $ac_tr_hdr 1
11457 EOF
11458  
11459 else
11460   echo "$ac_t""no" 1>&6
11461 fi
11462 done
11463
11464
11465         if test $ac_cv_header_pthread_h = yes ; then
11466                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
11467 echo "configure:11468: checking POSIX thread version" >&5
11468 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
11469   echo $ac_n "(cached) $ac_c" 1>&6
11470 else
11471   
11472         cat > conftest.$ac_ext <<EOF
11473 #line 11474 "configure"
11474 #include "confdefs.h"
11475
11476 #               include <pthread.h>
11477         
11478 int main() {
11479
11480                 int i = PTHREAD_CREATE_JOINABLE;
11481         
11482 ; return 0; }
11483 EOF
11484 if { (eval echo configure:11485: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11485   rm -rf conftest*
11486   
11487         cat > conftest.$ac_ext <<EOF
11488 #line 11489 "configure"
11489 #include "confdefs.h"
11490 #include <pthread.h>
11491 EOF
11492 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11493   egrep "pthread_detach" >/dev/null 2>&1; then
11494   rm -rf conftest*
11495   ol_cv_pthread_version=10
11496 else
11497   rm -rf conftest*
11498   ol_cv_pthread_version=8
11499 fi
11500 rm -f conftest*
11501
11502 else
11503   echo "configure: failed program was:" >&5
11504   cat conftest.$ac_ext >&5
11505   rm -rf conftest*
11506   
11507         cat > conftest.$ac_ext <<EOF
11508 #line 11509 "configure"
11509 #include "confdefs.h"
11510
11511 #               include <pthread.h>
11512 #               ifdef PTHREAD_CREATE_UNDETACHED
11513                 draft7
11514 #               endif
11515         
11516 EOF
11517 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11518   egrep "draft7" >/dev/null 2>&1; then
11519   rm -rf conftest*
11520   ol_cv_pthread_version=7
11521 else
11522   rm -rf conftest*
11523   
11524         cat > conftest.$ac_ext <<EOF
11525 #line 11526 "configure"
11526 #include "confdefs.h"
11527 #include <pthread.h>
11528 EOF
11529 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11530   egrep "pthread_attr_init" >/dev/null 2>&1; then
11531   rm -rf conftest*
11532   ol_cv_pthread_version=6
11533 else
11534   rm -rf conftest*
11535   
11536         cat > conftest.$ac_ext <<EOF
11537 #line 11538 "configure"
11538 #include "confdefs.h"
11539
11540 #               include <pthread.h>
11541 #ifdef          PTHREAD_MUTEX_INITIALIZER
11542                 draft5
11543 #endif
11544         
11545 EOF
11546 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11547   egrep "draft5" >/dev/null 2>&1; then
11548   rm -rf conftest*
11549   ol_cv_pthread_version=5
11550 else
11551   rm -rf conftest*
11552   ol_cv_pthread_version=4
11553 fi
11554 rm -f conftest*
11555  
11556 fi
11557 rm -f conftest*
11558  
11559 fi
11560 rm -f conftest*
11561  
11562 fi
11563 rm -f conftest*
11564
11565 fi
11566
11567 echo "$ac_t""$ol_cv_pthread_version" 1>&6
11568
11569
11570                 if test $ol_cv_pthread_version != 0 ; then
11571                         cat >> confdefs.h <<EOF
11572 #define HAVE_PTHREADS $ol_cv_pthread_version
11573 EOF
11574
11575                 else
11576                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
11577                 fi
11578
11579                 # consider threads found
11580                 ol_with_threads=found
11581
11582                 
11583         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
11584 echo "configure:11585: checking for LinuxThreads pthread.h" >&5
11585 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
11586   echo $ac_n "(cached) $ac_c" 1>&6
11587 else
11588   cat > conftest.$ac_ext <<EOF
11589 #line 11590 "configure"
11590 #include "confdefs.h"
11591 #include <pthread.h>
11592 EOF
11593 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11594   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
11595   rm -rf conftest*
11596   ol_cv_header_linux_threads=yes
11597 else
11598   rm -rf conftest*
11599   ol_cv_header_linux_threads=no
11600 fi
11601 rm -f conftest*
11602
11603                 
11604 fi
11605
11606 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
11607         if test $ol_cv_header_linux_threads = yes; then
11608                 cat >> confdefs.h <<\EOF
11609 #define HAVE_LINUX_THREADS 1
11610 EOF
11611
11612         fi
11613
11614                 
11615         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
11616 echo "configure:11617: checking for GNU Pth pthread.h" >&5
11617 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
11618   echo $ac_n "(cached) $ac_c" 1>&6
11619 else
11620   cat > conftest.$ac_ext <<EOF
11621 #line 11622 "configure"
11622 #include "confdefs.h"
11623 #include <pthread.h>
11624 #ifdef _POSIX_THREAD_IS_GNU_PTH
11625         __gnu_pth__;
11626 #endif
11627
11628 EOF
11629 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11630   egrep "__gnu_pth__" >/dev/null 2>&1; then
11631   rm -rf conftest*
11632   ol_cv_header_gnu_pth_pthread_h=yes
11633 else
11634   rm -rf conftest*
11635   ol_cv_header_gnu_pth_pthread_h=no
11636 fi
11637 rm -f conftest*
11638
11639                 
11640 fi
11641
11642 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
11643
11644
11645                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
11646                         for ac_hdr in sched.h
11647 do
11648 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11649 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11650 echo "configure:11651: checking for $ac_hdr" >&5
11651 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11652   echo $ac_n "(cached) $ac_c" 1>&6
11653 else
11654   cat > conftest.$ac_ext <<EOF
11655 #line 11656 "configure"
11656 #include "confdefs.h"
11657 #include <$ac_hdr>
11658 EOF
11659 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11660 { (eval echo configure:11661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11661 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11662 if test -z "$ac_err"; then
11663   rm -rf conftest*
11664   eval "ac_cv_header_$ac_safe=yes"
11665 else
11666   echo "$ac_err" >&5
11667   echo "configure: failed program was:" >&5
11668   cat conftest.$ac_ext >&5
11669   rm -rf conftest*
11670   eval "ac_cv_header_$ac_safe=no"
11671 fi
11672 rm -f conftest*
11673 fi
11674 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11675   echo "$ac_t""yes" 1>&6
11676     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11677   cat >> confdefs.h <<EOF
11678 #define $ac_tr_hdr 1
11679 EOF
11680  
11681 else
11682   echo "$ac_t""no" 1>&6
11683 fi
11684 done
11685
11686                 fi
11687
11688                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
11689                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
11690 echo "configure:11691: checking for pthread_create in default libraries" >&5
11691 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
11692   echo $ac_n "(cached) $ac_c" 1>&6
11693 else
11694   
11695                 if test "$cross_compiling" = yes; then
11696   cat > conftest.$ac_ext <<EOF
11697 #line 11698 "configure"
11698 #include "confdefs.h"
11699 /* pthread test headers */
11700 #include <pthread.h>
11701 #if HAVE_PTHREADS < 7
11702 #include <errno.h>
11703 #endif
11704 #ifndef NULL
11705 #define NULL (void*)0
11706 #endif
11707
11708 static void *task(p)
11709         void *p;
11710 {
11711         return (void *) (p == NULL);
11712 }
11713
11714 int main() {
11715
11716         /* pthread test function */
11717 #ifndef PTHREAD_CREATE_DETACHED
11718 #define PTHREAD_CREATE_DETACHED 1
11719 #endif
11720         pthread_t t;
11721         int status;
11722         int detach = PTHREAD_CREATE_DETACHED;
11723
11724 #if HAVE_PTHREADS > 4
11725         /* Final pthreads */
11726         pthread_attr_t attr;
11727
11728         status = pthread_attr_init(&attr);
11729         if( status ) return status;
11730
11731 #if HAVE_PTHREADS < 7
11732         status = pthread_attr_setdetachstate(&attr, &detach);
11733         if( status < 0 ) status = errno;
11734 #else
11735         status = pthread_attr_setdetachstate(&attr, detach);
11736 #endif
11737         if( status ) return status;
11738         status = pthread_create( &t, &attr, task, NULL );
11739 #if HAVE_PTHREADS < 7
11740         if( status < 0 ) status = errno;
11741 #endif
11742         if( status ) return status;
11743 #else
11744         /* Draft 4 pthreads */
11745         status = pthread_create( &t, pthread_attr_default, task, NULL );
11746         if( status ) return errno;
11747
11748         /* give thread a chance to complete */
11749         /* it should remain joinable and hence detachable */
11750         sleep( 1 );
11751
11752         status = pthread_detach( &t );
11753         if( status ) return errno;
11754 #endif
11755
11756 #ifdef HAVE_LINUX_THREADS
11757         pthread_kill_other_threads_np();
11758 #endif
11759
11760         return 0;
11761
11762 ; return 0; }
11763 EOF
11764 if { (eval echo configure:11765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11765   rm -rf conftest*
11766   ol_cv_pthread_create=yes
11767 else
11768   echo "configure: failed program was:" >&5
11769   cat conftest.$ac_ext >&5
11770   rm -rf conftest*
11771   ol_cv_pthread_create=no
11772 fi
11773 rm -f conftest*
11774 else
11775   cat > conftest.$ac_ext <<EOF
11776 #line 11777 "configure"
11777 #include "confdefs.h"
11778 /* pthread test headers */
11779 #include <pthread.h>
11780 #if HAVE_PTHREADS < 7
11781 #include <errno.h>
11782 #endif
11783 #ifndef NULL
11784 #define NULL (void*)0
11785 #endif
11786
11787 static void *task(p)
11788         void *p;
11789 {
11790         return (void *) (p == NULL);
11791 }
11792
11793
11794 int main(argc, argv)
11795         int argc;
11796         char **argv;
11797 {
11798
11799         /* pthread test function */
11800 #ifndef PTHREAD_CREATE_DETACHED
11801 #define PTHREAD_CREATE_DETACHED 1
11802 #endif
11803         pthread_t t;
11804         int status;
11805         int detach = PTHREAD_CREATE_DETACHED;
11806
11807 #if HAVE_PTHREADS > 4
11808         /* Final pthreads */
11809         pthread_attr_t attr;
11810
11811         status = pthread_attr_init(&attr);
11812         if( status ) return status;
11813
11814 #if HAVE_PTHREADS < 7
11815         status = pthread_attr_setdetachstate(&attr, &detach);
11816         if( status < 0 ) status = errno;
11817 #else
11818         status = pthread_attr_setdetachstate(&attr, detach);
11819 #endif
11820         if( status ) return status;
11821         status = pthread_create( &t, &attr, task, NULL );
11822 #if HAVE_PTHREADS < 7
11823         if( status < 0 ) status = errno;
11824 #endif
11825         if( status ) return status;
11826 #else
11827         /* Draft 4 pthreads */
11828         status = pthread_create( &t, pthread_attr_default, task, NULL );
11829         if( status ) return errno;
11830
11831         /* give thread a chance to complete */
11832         /* it should remain joinable and hence detachable */
11833         sleep( 1 );
11834
11835         status = pthread_detach( &t );
11836         if( status ) return errno;
11837 #endif
11838
11839 #ifdef HAVE_LINUX_THREADS
11840         pthread_kill_other_threads_np();
11841 #endif
11842
11843         return 0;
11844
11845 }
11846
11847 EOF
11848 if { (eval echo configure:11849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11849 then
11850   ol_cv_pthread_create=yes
11851 else
11852   echo "configure: failed program was:" >&5
11853   cat conftest.$ac_ext >&5
11854   rm -fr conftest*
11855   ol_cv_pthread_create=no
11856 fi
11857 rm -fr conftest*
11858 fi
11859
11860 fi
11861
11862 echo "$ac_t""$ol_cv_pthread_create" 1>&6
11863
11864                 if test $ol_cv_pthread_create != no ; then
11865                         ol_link_threads=posix
11866                         ol_link_pthreads=""
11867                 fi
11868                 
11869                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
11870 if test "$ol_link_threads" = no ; then
11871         # try -kthread
11872         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
11873 echo "configure:11874: checking for pthread link with -kthread" >&5
11874 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
11875   echo $ac_n "(cached) $ac_c" 1>&6
11876 else
11877   
11878                 # save the flags
11879                 ol_LIBS="$LIBS"
11880                 LIBS="-kthread $LIBS"
11881
11882                 if test "$cross_compiling" = yes; then
11883   cat > conftest.$ac_ext <<EOF
11884 #line 11885 "configure"
11885 #include "confdefs.h"
11886 /* pthread test headers */
11887 #include <pthread.h>
11888 #if HAVE_PTHREADS < 7
11889 #include <errno.h>
11890 #endif
11891 #ifndef NULL
11892 #define NULL (void*)0
11893 #endif
11894
11895 static void *task(p)
11896         void *p;
11897 {
11898         return (void *) (p == NULL);
11899 }
11900
11901 int main() {
11902
11903         /* pthread test function */
11904 #ifndef PTHREAD_CREATE_DETACHED
11905 #define PTHREAD_CREATE_DETACHED 1
11906 #endif
11907         pthread_t t;
11908         int status;
11909         int detach = PTHREAD_CREATE_DETACHED;
11910
11911 #if HAVE_PTHREADS > 4
11912         /* Final pthreads */
11913         pthread_attr_t attr;
11914
11915         status = pthread_attr_init(&attr);
11916         if( status ) return status;
11917
11918 #if HAVE_PTHREADS < 7
11919         status = pthread_attr_setdetachstate(&attr, &detach);
11920         if( status < 0 ) status = errno;
11921 #else
11922         status = pthread_attr_setdetachstate(&attr, detach);
11923 #endif
11924         if( status ) return status;
11925         status = pthread_create( &t, &attr, task, NULL );
11926 #if HAVE_PTHREADS < 7
11927         if( status < 0 ) status = errno;
11928 #endif
11929         if( status ) return status;
11930 #else
11931         /* Draft 4 pthreads */
11932         status = pthread_create( &t, pthread_attr_default, task, NULL );
11933         if( status ) return errno;
11934
11935         /* give thread a chance to complete */
11936         /* it should remain joinable and hence detachable */
11937         sleep( 1 );
11938
11939         status = pthread_detach( &t );
11940         if( status ) return errno;
11941 #endif
11942
11943 #ifdef HAVE_LINUX_THREADS
11944         pthread_kill_other_threads_np();
11945 #endif
11946
11947         return 0;
11948
11949 ; return 0; }
11950 EOF
11951 if { (eval echo configure:11952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11952   rm -rf conftest*
11953   ol_cv_pthread_kthread=yes
11954 else
11955   echo "configure: failed program was:" >&5
11956   cat conftest.$ac_ext >&5
11957   rm -rf conftest*
11958   ol_cv_pthread_kthread=no
11959 fi
11960 rm -f conftest*
11961 else
11962   cat > conftest.$ac_ext <<EOF
11963 #line 11964 "configure"
11964 #include "confdefs.h"
11965 /* pthread test headers */
11966 #include <pthread.h>
11967 #if HAVE_PTHREADS < 7
11968 #include <errno.h>
11969 #endif
11970 #ifndef NULL
11971 #define NULL (void*)0
11972 #endif
11973
11974 static void *task(p)
11975         void *p;
11976 {
11977         return (void *) (p == NULL);
11978 }
11979
11980
11981 int main(argc, argv)
11982         int argc;
11983         char **argv;
11984 {
11985
11986         /* pthread test function */
11987 #ifndef PTHREAD_CREATE_DETACHED
11988 #define PTHREAD_CREATE_DETACHED 1
11989 #endif
11990         pthread_t t;
11991         int status;
11992         int detach = PTHREAD_CREATE_DETACHED;
11993
11994 #if HAVE_PTHREADS > 4
11995         /* Final pthreads */
11996         pthread_attr_t attr;
11997
11998         status = pthread_attr_init(&attr);
11999         if( status ) return status;
12000
12001 #if HAVE_PTHREADS < 7
12002         status = pthread_attr_setdetachstate(&attr, &detach);
12003         if( status < 0 ) status = errno;
12004 #else
12005         status = pthread_attr_setdetachstate(&attr, detach);
12006 #endif
12007         if( status ) return status;
12008         status = pthread_create( &t, &attr, task, NULL );
12009 #if HAVE_PTHREADS < 7
12010         if( status < 0 ) status = errno;
12011 #endif
12012         if( status ) return status;
12013 #else
12014         /* Draft 4 pthreads */
12015         status = pthread_create( &t, pthread_attr_default, task, NULL );
12016         if( status ) return errno;
12017
12018         /* give thread a chance to complete */
12019         /* it should remain joinable and hence detachable */
12020         sleep( 1 );
12021
12022         status = pthread_detach( &t );
12023         if( status ) return errno;
12024 #endif
12025
12026 #ifdef HAVE_LINUX_THREADS
12027         pthread_kill_other_threads_np();
12028 #endif
12029
12030         return 0;
12031
12032 }
12033
12034 EOF
12035 if { (eval echo configure:12036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12036 then
12037   ol_cv_pthread_kthread=yes
12038 else
12039   echo "configure: failed program was:" >&5
12040   cat conftest.$ac_ext >&5
12041   rm -fr conftest*
12042   ol_cv_pthread_kthread=no
12043 fi
12044 rm -fr conftest*
12045 fi
12046
12047
12048                 # restore the LIBS
12049                 LIBS="$ol_LIBS"
12050         
12051 fi
12052
12053 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
12054
12055         if test $ol_cv_pthread_kthread = yes ; then
12056                 ol_link_pthreads="-kthread"
12057                 ol_link_threads=posix
12058         fi
12059 fi
12060
12061                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
12062 if test "$ol_link_threads" = no ; then
12063         # try -pthread
12064         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
12065 echo "configure:12066: checking for pthread link with -pthread" >&5
12066 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
12067   echo $ac_n "(cached) $ac_c" 1>&6
12068 else
12069   
12070                 # save the flags
12071                 ol_LIBS="$LIBS"
12072                 LIBS="-pthread $LIBS"
12073
12074                 if test "$cross_compiling" = yes; then
12075   cat > conftest.$ac_ext <<EOF
12076 #line 12077 "configure"
12077 #include "confdefs.h"
12078 /* pthread test headers */
12079 #include <pthread.h>
12080 #if HAVE_PTHREADS < 7
12081 #include <errno.h>
12082 #endif
12083 #ifndef NULL
12084 #define NULL (void*)0
12085 #endif
12086
12087 static void *task(p)
12088         void *p;
12089 {
12090         return (void *) (p == NULL);
12091 }
12092
12093 int main() {
12094
12095         /* pthread test function */
12096 #ifndef PTHREAD_CREATE_DETACHED
12097 #define PTHREAD_CREATE_DETACHED 1
12098 #endif
12099         pthread_t t;
12100         int status;
12101         int detach = PTHREAD_CREATE_DETACHED;
12102
12103 #if HAVE_PTHREADS > 4
12104         /* Final pthreads */
12105         pthread_attr_t attr;
12106
12107         status = pthread_attr_init(&attr);
12108         if( status ) return status;
12109
12110 #if HAVE_PTHREADS < 7
12111         status = pthread_attr_setdetachstate(&attr, &detach);
12112         if( status < 0 ) status = errno;
12113 #else
12114         status = pthread_attr_setdetachstate(&attr, detach);
12115 #endif
12116         if( status ) return status;
12117         status = pthread_create( &t, &attr, task, NULL );
12118 #if HAVE_PTHREADS < 7
12119         if( status < 0 ) status = errno;
12120 #endif
12121         if( status ) return status;
12122 #else
12123         /* Draft 4 pthreads */
12124         status = pthread_create( &t, pthread_attr_default, task, NULL );
12125         if( status ) return errno;
12126
12127         /* give thread a chance to complete */
12128         /* it should remain joinable and hence detachable */
12129         sleep( 1 );
12130
12131         status = pthread_detach( &t );
12132         if( status ) return errno;
12133 #endif
12134
12135 #ifdef HAVE_LINUX_THREADS
12136         pthread_kill_other_threads_np();
12137 #endif
12138
12139         return 0;
12140
12141 ; return 0; }
12142 EOF
12143 if { (eval echo configure:12144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12144   rm -rf conftest*
12145   ol_cv_pthread_pthread=yes
12146 else
12147   echo "configure: failed program was:" >&5
12148   cat conftest.$ac_ext >&5
12149   rm -rf conftest*
12150   ol_cv_pthread_pthread=no
12151 fi
12152 rm -f conftest*
12153 else
12154   cat > conftest.$ac_ext <<EOF
12155 #line 12156 "configure"
12156 #include "confdefs.h"
12157 /* pthread test headers */
12158 #include <pthread.h>
12159 #if HAVE_PTHREADS < 7
12160 #include <errno.h>
12161 #endif
12162 #ifndef NULL
12163 #define NULL (void*)0
12164 #endif
12165
12166 static void *task(p)
12167         void *p;
12168 {
12169         return (void *) (p == NULL);
12170 }
12171
12172
12173 int main(argc, argv)
12174         int argc;
12175         char **argv;
12176 {
12177
12178         /* pthread test function */
12179 #ifndef PTHREAD_CREATE_DETACHED
12180 #define PTHREAD_CREATE_DETACHED 1
12181 #endif
12182         pthread_t t;
12183         int status;
12184         int detach = PTHREAD_CREATE_DETACHED;
12185
12186 #if HAVE_PTHREADS > 4
12187         /* Final pthreads */
12188         pthread_attr_t attr;
12189
12190         status = pthread_attr_init(&attr);
12191         if( status ) return status;
12192
12193 #if HAVE_PTHREADS < 7
12194         status = pthread_attr_setdetachstate(&attr, &detach);
12195         if( status < 0 ) status = errno;
12196 #else
12197         status = pthread_attr_setdetachstate(&attr, detach);
12198 #endif
12199         if( status ) return status;
12200         status = pthread_create( &t, &attr, task, NULL );
12201 #if HAVE_PTHREADS < 7
12202         if( status < 0 ) status = errno;
12203 #endif
12204         if( status ) return status;
12205 #else
12206         /* Draft 4 pthreads */
12207         status = pthread_create( &t, pthread_attr_default, task, NULL );
12208         if( status ) return errno;
12209
12210         /* give thread a chance to complete */
12211         /* it should remain joinable and hence detachable */
12212         sleep( 1 );
12213
12214         status = pthread_detach( &t );
12215         if( status ) return errno;
12216 #endif
12217
12218 #ifdef HAVE_LINUX_THREADS
12219         pthread_kill_other_threads_np();
12220 #endif
12221
12222         return 0;
12223
12224 }
12225
12226 EOF
12227 if { (eval echo configure:12228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12228 then
12229   ol_cv_pthread_pthread=yes
12230 else
12231   echo "configure: failed program was:" >&5
12232   cat conftest.$ac_ext >&5
12233   rm -fr conftest*
12234   ol_cv_pthread_pthread=no
12235 fi
12236 rm -fr conftest*
12237 fi
12238
12239
12240                 # restore the LIBS
12241                 LIBS="$ol_LIBS"
12242         
12243 fi
12244
12245 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
12246
12247         if test $ol_cv_pthread_pthread = yes ; then
12248                 ol_link_pthreads="-pthread"
12249                 ol_link_threads=posix
12250         fi
12251 fi
12252
12253                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
12254 if test "$ol_link_threads" = no ; then
12255         # try -pthreads
12256         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
12257 echo "configure:12258: checking for pthread link with -pthreads" >&5
12258 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
12259   echo $ac_n "(cached) $ac_c" 1>&6
12260 else
12261   
12262                 # save the flags
12263                 ol_LIBS="$LIBS"
12264                 LIBS="-pthreads $LIBS"
12265
12266                 if test "$cross_compiling" = yes; then
12267   cat > conftest.$ac_ext <<EOF
12268 #line 12269 "configure"
12269 #include "confdefs.h"
12270 /* pthread test headers */
12271 #include <pthread.h>
12272 #if HAVE_PTHREADS < 7
12273 #include <errno.h>
12274 #endif
12275 #ifndef NULL
12276 #define NULL (void*)0
12277 #endif
12278
12279 static void *task(p)
12280         void *p;
12281 {
12282         return (void *) (p == NULL);
12283 }
12284
12285 int main() {
12286
12287         /* pthread test function */
12288 #ifndef PTHREAD_CREATE_DETACHED
12289 #define PTHREAD_CREATE_DETACHED 1
12290 #endif
12291         pthread_t t;
12292         int status;
12293         int detach = PTHREAD_CREATE_DETACHED;
12294
12295 #if HAVE_PTHREADS > 4
12296         /* Final pthreads */
12297         pthread_attr_t attr;
12298
12299         status = pthread_attr_init(&attr);
12300         if( status ) return status;
12301
12302 #if HAVE_PTHREADS < 7
12303         status = pthread_attr_setdetachstate(&attr, &detach);
12304         if( status < 0 ) status = errno;
12305 #else
12306         status = pthread_attr_setdetachstate(&attr, detach);
12307 #endif
12308         if( status ) return status;
12309         status = pthread_create( &t, &attr, task, NULL );
12310 #if HAVE_PTHREADS < 7
12311         if( status < 0 ) status = errno;
12312 #endif
12313         if( status ) return status;
12314 #else
12315         /* Draft 4 pthreads */
12316         status = pthread_create( &t, pthread_attr_default, task, NULL );
12317         if( status ) return errno;
12318
12319         /* give thread a chance to complete */
12320         /* it should remain joinable and hence detachable */
12321         sleep( 1 );
12322
12323         status = pthread_detach( &t );
12324         if( status ) return errno;
12325 #endif
12326
12327 #ifdef HAVE_LINUX_THREADS
12328         pthread_kill_other_threads_np();
12329 #endif
12330
12331         return 0;
12332
12333 ; return 0; }
12334 EOF
12335 if { (eval echo configure:12336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12336   rm -rf conftest*
12337   ol_cv_pthread_pthreads=yes
12338 else
12339   echo "configure: failed program was:" >&5
12340   cat conftest.$ac_ext >&5
12341   rm -rf conftest*
12342   ol_cv_pthread_pthreads=no
12343 fi
12344 rm -f conftest*
12345 else
12346   cat > conftest.$ac_ext <<EOF
12347 #line 12348 "configure"
12348 #include "confdefs.h"
12349 /* pthread test headers */
12350 #include <pthread.h>
12351 #if HAVE_PTHREADS < 7
12352 #include <errno.h>
12353 #endif
12354 #ifndef NULL
12355 #define NULL (void*)0
12356 #endif
12357
12358 static void *task(p)
12359         void *p;
12360 {
12361         return (void *) (p == NULL);
12362 }
12363
12364
12365 int main(argc, argv)
12366         int argc;
12367         char **argv;
12368 {
12369
12370         /* pthread test function */
12371 #ifndef PTHREAD_CREATE_DETACHED
12372 #define PTHREAD_CREATE_DETACHED 1
12373 #endif
12374         pthread_t t;
12375         int status;
12376         int detach = PTHREAD_CREATE_DETACHED;
12377
12378 #if HAVE_PTHREADS > 4
12379         /* Final pthreads */
12380         pthread_attr_t attr;
12381
12382         status = pthread_attr_init(&attr);
12383         if( status ) return status;
12384
12385 #if HAVE_PTHREADS < 7
12386         status = pthread_attr_setdetachstate(&attr, &detach);
12387         if( status < 0 ) status = errno;
12388 #else
12389         status = pthread_attr_setdetachstate(&attr, detach);
12390 #endif
12391         if( status ) return status;
12392         status = pthread_create( &t, &attr, task, NULL );
12393 #if HAVE_PTHREADS < 7
12394         if( status < 0 ) status = errno;
12395 #endif
12396         if( status ) return status;
12397 #else
12398         /* Draft 4 pthreads */
12399         status = pthread_create( &t, pthread_attr_default, task, NULL );
12400         if( status ) return errno;
12401
12402         /* give thread a chance to complete */
12403         /* it should remain joinable and hence detachable */
12404         sleep( 1 );
12405
12406         status = pthread_detach( &t );
12407         if( status ) return errno;
12408 #endif
12409
12410 #ifdef HAVE_LINUX_THREADS
12411         pthread_kill_other_threads_np();
12412 #endif
12413
12414         return 0;
12415
12416 }
12417
12418 EOF
12419 if { (eval echo configure:12420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12420 then
12421   ol_cv_pthread_pthreads=yes
12422 else
12423   echo "configure: failed program was:" >&5
12424   cat conftest.$ac_ext >&5
12425   rm -fr conftest*
12426   ol_cv_pthread_pthreads=no
12427 fi
12428 rm -fr conftest*
12429 fi
12430
12431
12432                 # restore the LIBS
12433                 LIBS="$ol_LIBS"
12434         
12435 fi
12436
12437 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
12438
12439         if test $ol_cv_pthread_pthreads = yes ; then
12440                 ol_link_pthreads="-pthreads"
12441                 ol_link_threads=posix
12442         fi
12443 fi
12444
12445                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
12446 if test "$ol_link_threads" = no ; then
12447         # try -mthreads
12448         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
12449 echo "configure:12450: checking for pthread link with -mthreads" >&5
12450 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
12451   echo $ac_n "(cached) $ac_c" 1>&6
12452 else
12453   
12454                 # save the flags
12455                 ol_LIBS="$LIBS"
12456                 LIBS="-mthreads $LIBS"
12457
12458                 if test "$cross_compiling" = yes; then
12459   cat > conftest.$ac_ext <<EOF
12460 #line 12461 "configure"
12461 #include "confdefs.h"
12462 /* pthread test headers */
12463 #include <pthread.h>
12464 #if HAVE_PTHREADS < 7
12465 #include <errno.h>
12466 #endif
12467 #ifndef NULL
12468 #define NULL (void*)0
12469 #endif
12470
12471 static void *task(p)
12472         void *p;
12473 {
12474         return (void *) (p == NULL);
12475 }
12476
12477 int main() {
12478
12479         /* pthread test function */
12480 #ifndef PTHREAD_CREATE_DETACHED
12481 #define PTHREAD_CREATE_DETACHED 1
12482 #endif
12483         pthread_t t;
12484         int status;
12485         int detach = PTHREAD_CREATE_DETACHED;
12486
12487 #if HAVE_PTHREADS > 4
12488         /* Final pthreads */
12489         pthread_attr_t attr;
12490
12491         status = pthread_attr_init(&attr);
12492         if( status ) return status;
12493
12494 #if HAVE_PTHREADS < 7
12495         status = pthread_attr_setdetachstate(&attr, &detach);
12496         if( status < 0 ) status = errno;
12497 #else
12498         status = pthread_attr_setdetachstate(&attr, detach);
12499 #endif
12500         if( status ) return status;
12501         status = pthread_create( &t, &attr, task, NULL );
12502 #if HAVE_PTHREADS < 7
12503         if( status < 0 ) status = errno;
12504 #endif
12505         if( status ) return status;
12506 #else
12507         /* Draft 4 pthreads */
12508         status = pthread_create( &t, pthread_attr_default, task, NULL );
12509         if( status ) return errno;
12510
12511         /* give thread a chance to complete */
12512         /* it should remain joinable and hence detachable */
12513         sleep( 1 );
12514
12515         status = pthread_detach( &t );
12516         if( status ) return errno;
12517 #endif
12518
12519 #ifdef HAVE_LINUX_THREADS
12520         pthread_kill_other_threads_np();
12521 #endif
12522
12523         return 0;
12524
12525 ; return 0; }
12526 EOF
12527 if { (eval echo configure:12528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12528   rm -rf conftest*
12529   ol_cv_pthread_mthreads=yes
12530 else
12531   echo "configure: failed program was:" >&5
12532   cat conftest.$ac_ext >&5
12533   rm -rf conftest*
12534   ol_cv_pthread_mthreads=no
12535 fi
12536 rm -f conftest*
12537 else
12538   cat > conftest.$ac_ext <<EOF
12539 #line 12540 "configure"
12540 #include "confdefs.h"
12541 /* pthread test headers */
12542 #include <pthread.h>
12543 #if HAVE_PTHREADS < 7
12544 #include <errno.h>
12545 #endif
12546 #ifndef NULL
12547 #define NULL (void*)0
12548 #endif
12549
12550 static void *task(p)
12551         void *p;
12552 {
12553         return (void *) (p == NULL);
12554 }
12555
12556
12557 int main(argc, argv)
12558         int argc;
12559         char **argv;
12560 {
12561
12562         /* pthread test function */
12563 #ifndef PTHREAD_CREATE_DETACHED
12564 #define PTHREAD_CREATE_DETACHED 1
12565 #endif
12566         pthread_t t;
12567         int status;
12568         int detach = PTHREAD_CREATE_DETACHED;
12569
12570 #if HAVE_PTHREADS > 4
12571         /* Final pthreads */
12572         pthread_attr_t attr;
12573
12574         status = pthread_attr_init(&attr);
12575         if( status ) return status;
12576
12577 #if HAVE_PTHREADS < 7
12578         status = pthread_attr_setdetachstate(&attr, &detach);
12579         if( status < 0 ) status = errno;
12580 #else
12581         status = pthread_attr_setdetachstate(&attr, detach);
12582 #endif
12583         if( status ) return status;
12584         status = pthread_create( &t, &attr, task, NULL );
12585 #if HAVE_PTHREADS < 7
12586         if( status < 0 ) status = errno;
12587 #endif
12588         if( status ) return status;
12589 #else
12590         /* Draft 4 pthreads */
12591         status = pthread_create( &t, pthread_attr_default, task, NULL );
12592         if( status ) return errno;
12593
12594         /* give thread a chance to complete */
12595         /* it should remain joinable and hence detachable */
12596         sleep( 1 );
12597
12598         status = pthread_detach( &t );
12599         if( status ) return errno;
12600 #endif
12601
12602 #ifdef HAVE_LINUX_THREADS
12603         pthread_kill_other_threads_np();
12604 #endif
12605
12606         return 0;
12607
12608 }
12609
12610 EOF
12611 if { (eval echo configure:12612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12612 then
12613   ol_cv_pthread_mthreads=yes
12614 else
12615   echo "configure: failed program was:" >&5
12616   cat conftest.$ac_ext >&5
12617   rm -fr conftest*
12618   ol_cv_pthread_mthreads=no
12619 fi
12620 rm -fr conftest*
12621 fi
12622
12623
12624                 # restore the LIBS
12625                 LIBS="$ol_LIBS"
12626         
12627 fi
12628
12629 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
12630
12631         if test $ol_cv_pthread_mthreads = yes ; then
12632                 ol_link_pthreads="-mthreads"
12633                 ol_link_threads=posix
12634         fi
12635 fi
12636
12637                 # Pthread try link: -thread (ol_cv_pthread_thread)
12638 if test "$ol_link_threads" = no ; then
12639         # try -thread
12640         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
12641 echo "configure:12642: checking for pthread link with -thread" >&5
12642 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
12643   echo $ac_n "(cached) $ac_c" 1>&6
12644 else
12645   
12646                 # save the flags
12647                 ol_LIBS="$LIBS"
12648                 LIBS="-thread $LIBS"
12649
12650                 if test "$cross_compiling" = yes; then
12651   cat > conftest.$ac_ext <<EOF
12652 #line 12653 "configure"
12653 #include "confdefs.h"
12654 /* pthread test headers */
12655 #include <pthread.h>
12656 #if HAVE_PTHREADS < 7
12657 #include <errno.h>
12658 #endif
12659 #ifndef NULL
12660 #define NULL (void*)0
12661 #endif
12662
12663 static void *task(p)
12664         void *p;
12665 {
12666         return (void *) (p == NULL);
12667 }
12668
12669 int main() {
12670
12671         /* pthread test function */
12672 #ifndef PTHREAD_CREATE_DETACHED
12673 #define PTHREAD_CREATE_DETACHED 1
12674 #endif
12675         pthread_t t;
12676         int status;
12677         int detach = PTHREAD_CREATE_DETACHED;
12678
12679 #if HAVE_PTHREADS > 4
12680         /* Final pthreads */
12681         pthread_attr_t attr;
12682
12683         status = pthread_attr_init(&attr);
12684         if( status ) return status;
12685
12686 #if HAVE_PTHREADS < 7
12687         status = pthread_attr_setdetachstate(&attr, &detach);
12688         if( status < 0 ) status = errno;
12689 #else
12690         status = pthread_attr_setdetachstate(&attr, detach);
12691 #endif
12692         if( status ) return status;
12693         status = pthread_create( &t, &attr, task, NULL );
12694 #if HAVE_PTHREADS < 7
12695         if( status < 0 ) status = errno;
12696 #endif
12697         if( status ) return status;
12698 #else
12699         /* Draft 4 pthreads */
12700         status = pthread_create( &t, pthread_attr_default, task, NULL );
12701         if( status ) return errno;
12702
12703         /* give thread a chance to complete */
12704         /* it should remain joinable and hence detachable */
12705         sleep( 1 );
12706
12707         status = pthread_detach( &t );
12708         if( status ) return errno;
12709 #endif
12710
12711 #ifdef HAVE_LINUX_THREADS
12712         pthread_kill_other_threads_np();
12713 #endif
12714
12715         return 0;
12716
12717 ; return 0; }
12718 EOF
12719 if { (eval echo configure:12720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12720   rm -rf conftest*
12721   ol_cv_pthread_thread=yes
12722 else
12723   echo "configure: failed program was:" >&5
12724   cat conftest.$ac_ext >&5
12725   rm -rf conftest*
12726   ol_cv_pthread_thread=no
12727 fi
12728 rm -f conftest*
12729 else
12730   cat > conftest.$ac_ext <<EOF
12731 #line 12732 "configure"
12732 #include "confdefs.h"
12733 /* pthread test headers */
12734 #include <pthread.h>
12735 #if HAVE_PTHREADS < 7
12736 #include <errno.h>
12737 #endif
12738 #ifndef NULL
12739 #define NULL (void*)0
12740 #endif
12741
12742 static void *task(p)
12743         void *p;
12744 {
12745         return (void *) (p == NULL);
12746 }
12747
12748
12749 int main(argc, argv)
12750         int argc;
12751         char **argv;
12752 {
12753
12754         /* pthread test function */
12755 #ifndef PTHREAD_CREATE_DETACHED
12756 #define PTHREAD_CREATE_DETACHED 1
12757 #endif
12758         pthread_t t;
12759         int status;
12760         int detach = PTHREAD_CREATE_DETACHED;
12761
12762 #if HAVE_PTHREADS > 4
12763         /* Final pthreads */
12764         pthread_attr_t attr;
12765
12766         status = pthread_attr_init(&attr);
12767         if( status ) return status;
12768
12769 #if HAVE_PTHREADS < 7
12770         status = pthread_attr_setdetachstate(&attr, &detach);
12771         if( status < 0 ) status = errno;
12772 #else
12773         status = pthread_attr_setdetachstate(&attr, detach);
12774 #endif
12775         if( status ) return status;
12776         status = pthread_create( &t, &attr, task, NULL );
12777 #if HAVE_PTHREADS < 7
12778         if( status < 0 ) status = errno;
12779 #endif
12780         if( status ) return status;
12781 #else
12782         /* Draft 4 pthreads */
12783         status = pthread_create( &t, pthread_attr_default, task, NULL );
12784         if( status ) return errno;
12785
12786         /* give thread a chance to complete */
12787         /* it should remain joinable and hence detachable */
12788         sleep( 1 );
12789
12790         status = pthread_detach( &t );
12791         if( status ) return errno;
12792 #endif
12793
12794 #ifdef HAVE_LINUX_THREADS
12795         pthread_kill_other_threads_np();
12796 #endif
12797
12798         return 0;
12799
12800 }
12801
12802 EOF
12803 if { (eval echo configure:12804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12804 then
12805   ol_cv_pthread_thread=yes
12806 else
12807   echo "configure: failed program was:" >&5
12808   cat conftest.$ac_ext >&5
12809   rm -fr conftest*
12810   ol_cv_pthread_thread=no
12811 fi
12812 rm -fr conftest*
12813 fi
12814
12815
12816                 # restore the LIBS
12817                 LIBS="$ol_LIBS"
12818         
12819 fi
12820
12821 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
12822
12823         if test $ol_cv_pthread_thread = yes ; then
12824                 ol_link_pthreads="-thread"
12825                 ol_link_threads=posix
12826         fi
12827 fi
12828
12829
12830                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
12831 if test "$ol_link_threads" = no ; then
12832         # try -lpthread -lmach -lexc -lc_r
12833         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
12834 echo "configure:12835: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
12835 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
12836   echo $ac_n "(cached) $ac_c" 1>&6
12837 else
12838   
12839                 # save the flags
12840                 ol_LIBS="$LIBS"
12841                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
12842
12843                 if test "$cross_compiling" = yes; then
12844   cat > conftest.$ac_ext <<EOF
12845 #line 12846 "configure"
12846 #include "confdefs.h"
12847 /* pthread test headers */
12848 #include <pthread.h>
12849 #if HAVE_PTHREADS < 7
12850 #include <errno.h>
12851 #endif
12852 #ifndef NULL
12853 #define NULL (void*)0
12854 #endif
12855
12856 static void *task(p)
12857         void *p;
12858 {
12859         return (void *) (p == NULL);
12860 }
12861
12862 int main() {
12863
12864         /* pthread test function */
12865 #ifndef PTHREAD_CREATE_DETACHED
12866 #define PTHREAD_CREATE_DETACHED 1
12867 #endif
12868         pthread_t t;
12869         int status;
12870         int detach = PTHREAD_CREATE_DETACHED;
12871
12872 #if HAVE_PTHREADS > 4
12873         /* Final pthreads */
12874         pthread_attr_t attr;
12875
12876         status = pthread_attr_init(&attr);
12877         if( status ) return status;
12878
12879 #if HAVE_PTHREADS < 7
12880         status = pthread_attr_setdetachstate(&attr, &detach);
12881         if( status < 0 ) status = errno;
12882 #else
12883         status = pthread_attr_setdetachstate(&attr, detach);
12884 #endif
12885         if( status ) return status;
12886         status = pthread_create( &t, &attr, task, NULL );
12887 #if HAVE_PTHREADS < 7
12888         if( status < 0 ) status = errno;
12889 #endif
12890         if( status ) return status;
12891 #else
12892         /* Draft 4 pthreads */
12893         status = pthread_create( &t, pthread_attr_default, task, NULL );
12894         if( status ) return errno;
12895
12896         /* give thread a chance to complete */
12897         /* it should remain joinable and hence detachable */
12898         sleep( 1 );
12899
12900         status = pthread_detach( &t );
12901         if( status ) return errno;
12902 #endif
12903
12904 #ifdef HAVE_LINUX_THREADS
12905         pthread_kill_other_threads_np();
12906 #endif
12907
12908         return 0;
12909
12910 ; return 0; }
12911 EOF
12912 if { (eval echo configure:12913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12913   rm -rf conftest*
12914   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
12915 else
12916   echo "configure: failed program was:" >&5
12917   cat conftest.$ac_ext >&5
12918   rm -rf conftest*
12919   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
12920 fi
12921 rm -f conftest*
12922 else
12923   cat > conftest.$ac_ext <<EOF
12924 #line 12925 "configure"
12925 #include "confdefs.h"
12926 /* pthread test headers */
12927 #include <pthread.h>
12928 #if HAVE_PTHREADS < 7
12929 #include <errno.h>
12930 #endif
12931 #ifndef NULL
12932 #define NULL (void*)0
12933 #endif
12934
12935 static void *task(p)
12936         void *p;
12937 {
12938         return (void *) (p == NULL);
12939 }
12940
12941
12942 int main(argc, argv)
12943         int argc;
12944         char **argv;
12945 {
12946
12947         /* pthread test function */
12948 #ifndef PTHREAD_CREATE_DETACHED
12949 #define PTHREAD_CREATE_DETACHED 1
12950 #endif
12951         pthread_t t;
12952         int status;
12953         int detach = PTHREAD_CREATE_DETACHED;
12954
12955 #if HAVE_PTHREADS > 4
12956         /* Final pthreads */
12957         pthread_attr_t attr;
12958
12959         status = pthread_attr_init(&attr);
12960         if( status ) return status;
12961
12962 #if HAVE_PTHREADS < 7
12963         status = pthread_attr_setdetachstate(&attr, &detach);
12964         if( status < 0 ) status = errno;
12965 #else
12966         status = pthread_attr_setdetachstate(&attr, detach);
12967 #endif
12968         if( status ) return status;
12969         status = pthread_create( &t, &attr, task, NULL );
12970 #if HAVE_PTHREADS < 7
12971         if( status < 0 ) status = errno;
12972 #endif
12973         if( status ) return status;
12974 #else
12975         /* Draft 4 pthreads */
12976         status = pthread_create( &t, pthread_attr_default, task, NULL );
12977         if( status ) return errno;
12978
12979         /* give thread a chance to complete */
12980         /* it should remain joinable and hence detachable */
12981         sleep( 1 );
12982
12983         status = pthread_detach( &t );
12984         if( status ) return errno;
12985 #endif
12986
12987 #ifdef HAVE_LINUX_THREADS
12988         pthread_kill_other_threads_np();
12989 #endif
12990
12991         return 0;
12992
12993 }
12994
12995 EOF
12996 if { (eval echo configure:12997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12997 then
12998   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
12999 else
13000   echo "configure: failed program was:" >&5
13001   cat conftest.$ac_ext >&5
13002   rm -fr conftest*
13003   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
13004 fi
13005 rm -fr conftest*
13006 fi
13007
13008
13009                 # restore the LIBS
13010                 LIBS="$ol_LIBS"
13011         
13012 fi
13013
13014 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
13015
13016         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
13017                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
13018                 ol_link_threads=posix
13019         fi
13020 fi
13021
13022                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
13023 if test "$ol_link_threads" = no ; then
13024         # try -lpthread -lmach -lexc
13025         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
13026 echo "configure:13027: checking for pthread link with -lpthread -lmach -lexc" >&5
13027 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
13028   echo $ac_n "(cached) $ac_c" 1>&6
13029 else
13030   
13031                 # save the flags
13032                 ol_LIBS="$LIBS"
13033                 LIBS="-lpthread -lmach -lexc $LIBS"
13034
13035                 if test "$cross_compiling" = yes; then
13036   cat > conftest.$ac_ext <<EOF
13037 #line 13038 "configure"
13038 #include "confdefs.h"
13039 /* pthread test headers */
13040 #include <pthread.h>
13041 #if HAVE_PTHREADS < 7
13042 #include <errno.h>
13043 #endif
13044 #ifndef NULL
13045 #define NULL (void*)0
13046 #endif
13047
13048 static void *task(p)
13049         void *p;
13050 {
13051         return (void *) (p == NULL);
13052 }
13053
13054 int main() {
13055
13056         /* pthread test function */
13057 #ifndef PTHREAD_CREATE_DETACHED
13058 #define PTHREAD_CREATE_DETACHED 1
13059 #endif
13060         pthread_t t;
13061         int status;
13062         int detach = PTHREAD_CREATE_DETACHED;
13063
13064 #if HAVE_PTHREADS > 4
13065         /* Final pthreads */
13066         pthread_attr_t attr;
13067
13068         status = pthread_attr_init(&attr);
13069         if( status ) return status;
13070
13071 #if HAVE_PTHREADS < 7
13072         status = pthread_attr_setdetachstate(&attr, &detach);
13073         if( status < 0 ) status = errno;
13074 #else
13075         status = pthread_attr_setdetachstate(&attr, detach);
13076 #endif
13077         if( status ) return status;
13078         status = pthread_create( &t, &attr, task, NULL );
13079 #if HAVE_PTHREADS < 7
13080         if( status < 0 ) status = errno;
13081 #endif
13082         if( status ) return status;
13083 #else
13084         /* Draft 4 pthreads */
13085         status = pthread_create( &t, pthread_attr_default, task, NULL );
13086         if( status ) return errno;
13087
13088         /* give thread a chance to complete */
13089         /* it should remain joinable and hence detachable */
13090         sleep( 1 );
13091
13092         status = pthread_detach( &t );
13093         if( status ) return errno;
13094 #endif
13095
13096 #ifdef HAVE_LINUX_THREADS
13097         pthread_kill_other_threads_np();
13098 #endif
13099
13100         return 0;
13101
13102 ; return 0; }
13103 EOF
13104 if { (eval echo configure:13105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13105   rm -rf conftest*
13106   ol_cv_pthread_lpthread_lmach_lexc=yes
13107 else
13108   echo "configure: failed program was:" >&5
13109   cat conftest.$ac_ext >&5
13110   rm -rf conftest*
13111   ol_cv_pthread_lpthread_lmach_lexc=no
13112 fi
13113 rm -f conftest*
13114 else
13115   cat > conftest.$ac_ext <<EOF
13116 #line 13117 "configure"
13117 #include "confdefs.h"
13118 /* pthread test headers */
13119 #include <pthread.h>
13120 #if HAVE_PTHREADS < 7
13121 #include <errno.h>
13122 #endif
13123 #ifndef NULL
13124 #define NULL (void*)0
13125 #endif
13126
13127 static void *task(p)
13128         void *p;
13129 {
13130         return (void *) (p == NULL);
13131 }
13132
13133
13134 int main(argc, argv)
13135         int argc;
13136         char **argv;
13137 {
13138
13139         /* pthread test function */
13140 #ifndef PTHREAD_CREATE_DETACHED
13141 #define PTHREAD_CREATE_DETACHED 1
13142 #endif
13143         pthread_t t;
13144         int status;
13145         int detach = PTHREAD_CREATE_DETACHED;
13146
13147 #if HAVE_PTHREADS > 4
13148         /* Final pthreads */
13149         pthread_attr_t attr;
13150
13151         status = pthread_attr_init(&attr);
13152         if( status ) return status;
13153
13154 #if HAVE_PTHREADS < 7
13155         status = pthread_attr_setdetachstate(&attr, &detach);
13156         if( status < 0 ) status = errno;
13157 #else
13158         status = pthread_attr_setdetachstate(&attr, detach);
13159 #endif
13160         if( status ) return status;
13161         status = pthread_create( &t, &attr, task, NULL );
13162 #if HAVE_PTHREADS < 7
13163         if( status < 0 ) status = errno;
13164 #endif
13165         if( status ) return status;
13166 #else
13167         /* Draft 4 pthreads */
13168         status = pthread_create( &t, pthread_attr_default, task, NULL );
13169         if( status ) return errno;
13170
13171         /* give thread a chance to complete */
13172         /* it should remain joinable and hence detachable */
13173         sleep( 1 );
13174
13175         status = pthread_detach( &t );
13176         if( status ) return errno;
13177 #endif
13178
13179 #ifdef HAVE_LINUX_THREADS
13180         pthread_kill_other_threads_np();
13181 #endif
13182
13183         return 0;
13184
13185 }
13186
13187 EOF
13188 if { (eval echo configure:13189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13189 then
13190   ol_cv_pthread_lpthread_lmach_lexc=yes
13191 else
13192   echo "configure: failed program was:" >&5
13193   cat conftest.$ac_ext >&5
13194   rm -fr conftest*
13195   ol_cv_pthread_lpthread_lmach_lexc=no
13196 fi
13197 rm -fr conftest*
13198 fi
13199
13200
13201                 # restore the LIBS
13202                 LIBS="$ol_LIBS"
13203         
13204 fi
13205
13206 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
13207
13208         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
13209                 ol_link_pthreads="-lpthread -lmach -lexc"
13210                 ol_link_threads=posix
13211         fi
13212 fi
13213
13214
13215                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
13216 if test "$ol_link_threads" = no ; then
13217         # try -lpthread -Wl,-woff,85
13218         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
13219 echo "configure:13220: checking for pthread link with -lpthread -Wl,-woff,85" >&5
13220 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
13221   echo $ac_n "(cached) $ac_c" 1>&6
13222 else
13223   
13224                 # save the flags
13225                 ol_LIBS="$LIBS"
13226                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
13227
13228                 if test "$cross_compiling" = yes; then
13229   cat > conftest.$ac_ext <<EOF
13230 #line 13231 "configure"
13231 #include "confdefs.h"
13232 /* pthread test headers */
13233 #include <pthread.h>
13234 #if HAVE_PTHREADS < 7
13235 #include <errno.h>
13236 #endif
13237 #ifndef NULL
13238 #define NULL (void*)0
13239 #endif
13240
13241 static void *task(p)
13242         void *p;
13243 {
13244         return (void *) (p == NULL);
13245 }
13246
13247 int main() {
13248
13249         /* pthread test function */
13250 #ifndef PTHREAD_CREATE_DETACHED
13251 #define PTHREAD_CREATE_DETACHED 1
13252 #endif
13253         pthread_t t;
13254         int status;
13255         int detach = PTHREAD_CREATE_DETACHED;
13256
13257 #if HAVE_PTHREADS > 4
13258         /* Final pthreads */
13259         pthread_attr_t attr;
13260
13261         status = pthread_attr_init(&attr);
13262         if( status ) return status;
13263
13264 #if HAVE_PTHREADS < 7
13265         status = pthread_attr_setdetachstate(&attr, &detach);
13266         if( status < 0 ) status = errno;
13267 #else
13268         status = pthread_attr_setdetachstate(&attr, detach);
13269 #endif
13270         if( status ) return status;
13271         status = pthread_create( &t, &attr, task, NULL );
13272 #if HAVE_PTHREADS < 7
13273         if( status < 0 ) status = errno;
13274 #endif
13275         if( status ) return status;
13276 #else
13277         /* Draft 4 pthreads */
13278         status = pthread_create( &t, pthread_attr_default, task, NULL );
13279         if( status ) return errno;
13280
13281         /* give thread a chance to complete */
13282         /* it should remain joinable and hence detachable */
13283         sleep( 1 );
13284
13285         status = pthread_detach( &t );
13286         if( status ) return errno;
13287 #endif
13288
13289 #ifdef HAVE_LINUX_THREADS
13290         pthread_kill_other_threads_np();
13291 #endif
13292
13293         return 0;
13294
13295 ; return 0; }
13296 EOF
13297 if { (eval echo configure:13298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13298   rm -rf conftest*
13299   ol_cv_pthread_lib_lpthread_woff=yes
13300 else
13301   echo "configure: failed program was:" >&5
13302   cat conftest.$ac_ext >&5
13303   rm -rf conftest*
13304   ol_cv_pthread_lib_lpthread_woff=no
13305 fi
13306 rm -f conftest*
13307 else
13308   cat > conftest.$ac_ext <<EOF
13309 #line 13310 "configure"
13310 #include "confdefs.h"
13311 /* pthread test headers */
13312 #include <pthread.h>
13313 #if HAVE_PTHREADS < 7
13314 #include <errno.h>
13315 #endif
13316 #ifndef NULL
13317 #define NULL (void*)0
13318 #endif
13319
13320 static void *task(p)
13321         void *p;
13322 {
13323         return (void *) (p == NULL);
13324 }
13325
13326
13327 int main(argc, argv)
13328         int argc;
13329         char **argv;
13330 {
13331
13332         /* pthread test function */
13333 #ifndef PTHREAD_CREATE_DETACHED
13334 #define PTHREAD_CREATE_DETACHED 1
13335 #endif
13336         pthread_t t;
13337         int status;
13338         int detach = PTHREAD_CREATE_DETACHED;
13339
13340 #if HAVE_PTHREADS > 4
13341         /* Final pthreads */
13342         pthread_attr_t attr;
13343
13344         status = pthread_attr_init(&attr);
13345         if( status ) return status;
13346
13347 #if HAVE_PTHREADS < 7
13348         status = pthread_attr_setdetachstate(&attr, &detach);
13349         if( status < 0 ) status = errno;
13350 #else
13351         status = pthread_attr_setdetachstate(&attr, detach);
13352 #endif
13353         if( status ) return status;
13354         status = pthread_create( &t, &attr, task, NULL );
13355 #if HAVE_PTHREADS < 7
13356         if( status < 0 ) status = errno;
13357 #endif
13358         if( status ) return status;
13359 #else
13360         /* Draft 4 pthreads */
13361         status = pthread_create( &t, pthread_attr_default, task, NULL );
13362         if( status ) return errno;
13363
13364         /* give thread a chance to complete */
13365         /* it should remain joinable and hence detachable */
13366         sleep( 1 );
13367
13368         status = pthread_detach( &t );
13369         if( status ) return errno;
13370 #endif
13371
13372 #ifdef HAVE_LINUX_THREADS
13373         pthread_kill_other_threads_np();
13374 #endif
13375
13376         return 0;
13377
13378 }
13379
13380 EOF
13381 if { (eval echo configure:13382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13382 then
13383   ol_cv_pthread_lib_lpthread_woff=yes
13384 else
13385   echo "configure: failed program was:" >&5
13386   cat conftest.$ac_ext >&5
13387   rm -fr conftest*
13388   ol_cv_pthread_lib_lpthread_woff=no
13389 fi
13390 rm -fr conftest*
13391 fi
13392
13393
13394                 # restore the LIBS
13395                 LIBS="$ol_LIBS"
13396         
13397 fi
13398
13399 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
13400
13401         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
13402                 ol_link_pthreads="-lpthread -Wl,-woff,85"
13403                 ol_link_threads=posix
13404         fi
13405 fi
13406
13407
13408                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
13409 if test "$ol_link_threads" = no ; then
13410         # try -lpthread
13411         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
13412 echo "configure:13413: checking for pthread link with -lpthread" >&5
13413 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
13414   echo $ac_n "(cached) $ac_c" 1>&6
13415 else
13416   
13417                 # save the flags
13418                 ol_LIBS="$LIBS"
13419                 LIBS="-lpthread $LIBS"
13420
13421                 if test "$cross_compiling" = yes; then
13422   cat > conftest.$ac_ext <<EOF
13423 #line 13424 "configure"
13424 #include "confdefs.h"
13425 /* pthread test headers */
13426 #include <pthread.h>
13427 #if HAVE_PTHREADS < 7
13428 #include <errno.h>
13429 #endif
13430 #ifndef NULL
13431 #define NULL (void*)0
13432 #endif
13433
13434 static void *task(p)
13435         void *p;
13436 {
13437         return (void *) (p == NULL);
13438 }
13439
13440 int main() {
13441
13442         /* pthread test function */
13443 #ifndef PTHREAD_CREATE_DETACHED
13444 #define PTHREAD_CREATE_DETACHED 1
13445 #endif
13446         pthread_t t;
13447         int status;
13448         int detach = PTHREAD_CREATE_DETACHED;
13449
13450 #if HAVE_PTHREADS > 4
13451         /* Final pthreads */
13452         pthread_attr_t attr;
13453
13454         status = pthread_attr_init(&attr);
13455         if( status ) return status;
13456
13457 #if HAVE_PTHREADS < 7
13458         status = pthread_attr_setdetachstate(&attr, &detach);
13459         if( status < 0 ) status = errno;
13460 #else
13461         status = pthread_attr_setdetachstate(&attr, detach);
13462 #endif
13463         if( status ) return status;
13464         status = pthread_create( &t, &attr, task, NULL );
13465 #if HAVE_PTHREADS < 7
13466         if( status < 0 ) status = errno;
13467 #endif
13468         if( status ) return status;
13469 #else
13470         /* Draft 4 pthreads */
13471         status = pthread_create( &t, pthread_attr_default, task, NULL );
13472         if( status ) return errno;
13473
13474         /* give thread a chance to complete */
13475         /* it should remain joinable and hence detachable */
13476         sleep( 1 );
13477
13478         status = pthread_detach( &t );
13479         if( status ) return errno;
13480 #endif
13481
13482 #ifdef HAVE_LINUX_THREADS
13483         pthread_kill_other_threads_np();
13484 #endif
13485
13486         return 0;
13487
13488 ; return 0; }
13489 EOF
13490 if { (eval echo configure:13491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13491   rm -rf conftest*
13492   ol_cv_pthread_lpthread=yes
13493 else
13494   echo "configure: failed program was:" >&5
13495   cat conftest.$ac_ext >&5
13496   rm -rf conftest*
13497   ol_cv_pthread_lpthread=no
13498 fi
13499 rm -f conftest*
13500 else
13501   cat > conftest.$ac_ext <<EOF
13502 #line 13503 "configure"
13503 #include "confdefs.h"
13504 /* pthread test headers */
13505 #include <pthread.h>
13506 #if HAVE_PTHREADS < 7
13507 #include <errno.h>
13508 #endif
13509 #ifndef NULL
13510 #define NULL (void*)0
13511 #endif
13512
13513 static void *task(p)
13514         void *p;
13515 {
13516         return (void *) (p == NULL);
13517 }
13518
13519
13520 int main(argc, argv)
13521         int argc;
13522         char **argv;
13523 {
13524
13525         /* pthread test function */
13526 #ifndef PTHREAD_CREATE_DETACHED
13527 #define PTHREAD_CREATE_DETACHED 1
13528 #endif
13529         pthread_t t;
13530         int status;
13531         int detach = PTHREAD_CREATE_DETACHED;
13532
13533 #if HAVE_PTHREADS > 4
13534         /* Final pthreads */
13535         pthread_attr_t attr;
13536
13537         status = pthread_attr_init(&attr);
13538         if( status ) return status;
13539
13540 #if HAVE_PTHREADS < 7
13541         status = pthread_attr_setdetachstate(&attr, &detach);
13542         if( status < 0 ) status = errno;
13543 #else
13544         status = pthread_attr_setdetachstate(&attr, detach);
13545 #endif
13546         if( status ) return status;
13547         status = pthread_create( &t, &attr, task, NULL );
13548 #if HAVE_PTHREADS < 7
13549         if( status < 0 ) status = errno;
13550 #endif
13551         if( status ) return status;
13552 #else
13553         /* Draft 4 pthreads */
13554         status = pthread_create( &t, pthread_attr_default, task, NULL );
13555         if( status ) return errno;
13556
13557         /* give thread a chance to complete */
13558         /* it should remain joinable and hence detachable */
13559         sleep( 1 );
13560
13561         status = pthread_detach( &t );
13562         if( status ) return errno;
13563 #endif
13564
13565 #ifdef HAVE_LINUX_THREADS
13566         pthread_kill_other_threads_np();
13567 #endif
13568
13569         return 0;
13570
13571 }
13572
13573 EOF
13574 if { (eval echo configure:13575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13575 then
13576   ol_cv_pthread_lpthread=yes
13577 else
13578   echo "configure: failed program was:" >&5
13579   cat conftest.$ac_ext >&5
13580   rm -fr conftest*
13581   ol_cv_pthread_lpthread=no
13582 fi
13583 rm -fr conftest*
13584 fi
13585
13586
13587                 # restore the LIBS
13588                 LIBS="$ol_LIBS"
13589         
13590 fi
13591
13592 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
13593
13594         if test $ol_cv_pthread_lpthread = yes ; then
13595                 ol_link_pthreads="-lpthread"
13596                 ol_link_threads=posix
13597         fi
13598 fi
13599
13600                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
13601 if test "$ol_link_threads" = no ; then
13602         # try -lc_r
13603         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
13604 echo "configure:13605: checking for pthread link with -lc_r" >&5
13605 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
13606   echo $ac_n "(cached) $ac_c" 1>&6
13607 else
13608   
13609                 # save the flags
13610                 ol_LIBS="$LIBS"
13611                 LIBS="-lc_r $LIBS"
13612
13613                 if test "$cross_compiling" = yes; then
13614   cat > conftest.$ac_ext <<EOF
13615 #line 13616 "configure"
13616 #include "confdefs.h"
13617 /* pthread test headers */
13618 #include <pthread.h>
13619 #if HAVE_PTHREADS < 7
13620 #include <errno.h>
13621 #endif
13622 #ifndef NULL
13623 #define NULL (void*)0
13624 #endif
13625
13626 static void *task(p)
13627         void *p;
13628 {
13629         return (void *) (p == NULL);
13630 }
13631
13632 int main() {
13633
13634         /* pthread test function */
13635 #ifndef PTHREAD_CREATE_DETACHED
13636 #define PTHREAD_CREATE_DETACHED 1
13637 #endif
13638         pthread_t t;
13639         int status;
13640         int detach = PTHREAD_CREATE_DETACHED;
13641
13642 #if HAVE_PTHREADS > 4
13643         /* Final pthreads */
13644         pthread_attr_t attr;
13645
13646         status = pthread_attr_init(&attr);
13647         if( status ) return status;
13648
13649 #if HAVE_PTHREADS < 7
13650         status = pthread_attr_setdetachstate(&attr, &detach);
13651         if( status < 0 ) status = errno;
13652 #else
13653         status = pthread_attr_setdetachstate(&attr, detach);
13654 #endif
13655         if( status ) return status;
13656         status = pthread_create( &t, &attr, task, NULL );
13657 #if HAVE_PTHREADS < 7
13658         if( status < 0 ) status = errno;
13659 #endif
13660         if( status ) return status;
13661 #else
13662         /* Draft 4 pthreads */
13663         status = pthread_create( &t, pthread_attr_default, task, NULL );
13664         if( status ) return errno;
13665
13666         /* give thread a chance to complete */
13667         /* it should remain joinable and hence detachable */
13668         sleep( 1 );
13669
13670         status = pthread_detach( &t );
13671         if( status ) return errno;
13672 #endif
13673
13674 #ifdef HAVE_LINUX_THREADS
13675         pthread_kill_other_threads_np();
13676 #endif
13677
13678         return 0;
13679
13680 ; return 0; }
13681 EOF
13682 if { (eval echo configure:13683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13683   rm -rf conftest*
13684   ol_cv_pthread_lc_r=yes
13685 else
13686   echo "configure: failed program was:" >&5
13687   cat conftest.$ac_ext >&5
13688   rm -rf conftest*
13689   ol_cv_pthread_lc_r=no
13690 fi
13691 rm -f conftest*
13692 else
13693   cat > conftest.$ac_ext <<EOF
13694 #line 13695 "configure"
13695 #include "confdefs.h"
13696 /* pthread test headers */
13697 #include <pthread.h>
13698 #if HAVE_PTHREADS < 7
13699 #include <errno.h>
13700 #endif
13701 #ifndef NULL
13702 #define NULL (void*)0
13703 #endif
13704
13705 static void *task(p)
13706         void *p;
13707 {
13708         return (void *) (p == NULL);
13709 }
13710
13711
13712 int main(argc, argv)
13713         int argc;
13714         char **argv;
13715 {
13716
13717         /* pthread test function */
13718 #ifndef PTHREAD_CREATE_DETACHED
13719 #define PTHREAD_CREATE_DETACHED 1
13720 #endif
13721         pthread_t t;
13722         int status;
13723         int detach = PTHREAD_CREATE_DETACHED;
13724
13725 #if HAVE_PTHREADS > 4
13726         /* Final pthreads */
13727         pthread_attr_t attr;
13728
13729         status = pthread_attr_init(&attr);
13730         if( status ) return status;
13731
13732 #if HAVE_PTHREADS < 7
13733         status = pthread_attr_setdetachstate(&attr, &detach);
13734         if( status < 0 ) status = errno;
13735 #else
13736         status = pthread_attr_setdetachstate(&attr, detach);
13737 #endif
13738         if( status ) return status;
13739         status = pthread_create( &t, &attr, task, NULL );
13740 #if HAVE_PTHREADS < 7
13741         if( status < 0 ) status = errno;
13742 #endif
13743         if( status ) return status;
13744 #else
13745         /* Draft 4 pthreads */
13746         status = pthread_create( &t, pthread_attr_default, task, NULL );
13747         if( status ) return errno;
13748
13749         /* give thread a chance to complete */
13750         /* it should remain joinable and hence detachable */
13751         sleep( 1 );
13752
13753         status = pthread_detach( &t );
13754         if( status ) return errno;
13755 #endif
13756
13757 #ifdef HAVE_LINUX_THREADS
13758         pthread_kill_other_threads_np();
13759 #endif
13760
13761         return 0;
13762
13763 }
13764
13765 EOF
13766 if { (eval echo configure:13767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13767 then
13768   ol_cv_pthread_lc_r=yes
13769 else
13770   echo "configure: failed program was:" >&5
13771   cat conftest.$ac_ext >&5
13772   rm -fr conftest*
13773   ol_cv_pthread_lc_r=no
13774 fi
13775 rm -fr conftest*
13776 fi
13777
13778
13779                 # restore the LIBS
13780                 LIBS="$ol_LIBS"
13781         
13782 fi
13783
13784 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
13785
13786         if test $ol_cv_pthread_lc_r = yes ; then
13787                 ol_link_pthreads="-lc_r"
13788                 ol_link_threads=posix
13789         fi
13790 fi
13791
13792
13793                 # Pthread try link: -threads (ol_cv_pthread_threads)
13794 if test "$ol_link_threads" = no ; then
13795         # try -threads
13796         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
13797 echo "configure:13798: checking for pthread link with -threads" >&5
13798 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
13799   echo $ac_n "(cached) $ac_c" 1>&6
13800 else
13801   
13802                 # save the flags
13803                 ol_LIBS="$LIBS"
13804                 LIBS="-threads $LIBS"
13805
13806                 if test "$cross_compiling" = yes; then
13807   cat > conftest.$ac_ext <<EOF
13808 #line 13809 "configure"
13809 #include "confdefs.h"
13810 /* pthread test headers */
13811 #include <pthread.h>
13812 #if HAVE_PTHREADS < 7
13813 #include <errno.h>
13814 #endif
13815 #ifndef NULL
13816 #define NULL (void*)0
13817 #endif
13818
13819 static void *task(p)
13820         void *p;
13821 {
13822         return (void *) (p == NULL);
13823 }
13824
13825 int main() {
13826
13827         /* pthread test function */
13828 #ifndef PTHREAD_CREATE_DETACHED
13829 #define PTHREAD_CREATE_DETACHED 1
13830 #endif
13831         pthread_t t;
13832         int status;
13833         int detach = PTHREAD_CREATE_DETACHED;
13834
13835 #if HAVE_PTHREADS > 4
13836         /* Final pthreads */
13837         pthread_attr_t attr;
13838
13839         status = pthread_attr_init(&attr);
13840         if( status ) return status;
13841
13842 #if HAVE_PTHREADS < 7
13843         status = pthread_attr_setdetachstate(&attr, &detach);
13844         if( status < 0 ) status = errno;
13845 #else
13846         status = pthread_attr_setdetachstate(&attr, detach);
13847 #endif
13848         if( status ) return status;
13849         status = pthread_create( &t, &attr, task, NULL );
13850 #if HAVE_PTHREADS < 7
13851         if( status < 0 ) status = errno;
13852 #endif
13853         if( status ) return status;
13854 #else
13855         /* Draft 4 pthreads */
13856         status = pthread_create( &t, pthread_attr_default, task, NULL );
13857         if( status ) return errno;
13858
13859         /* give thread a chance to complete */
13860         /* it should remain joinable and hence detachable */
13861         sleep( 1 );
13862
13863         status = pthread_detach( &t );
13864         if( status ) return errno;
13865 #endif
13866
13867 #ifdef HAVE_LINUX_THREADS
13868         pthread_kill_other_threads_np();
13869 #endif
13870
13871         return 0;
13872
13873 ; return 0; }
13874 EOF
13875 if { (eval echo configure:13876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13876   rm -rf conftest*
13877   ol_cv_pthread_threads=yes
13878 else
13879   echo "configure: failed program was:" >&5
13880   cat conftest.$ac_ext >&5
13881   rm -rf conftest*
13882   ol_cv_pthread_threads=no
13883 fi
13884 rm -f conftest*
13885 else
13886   cat > conftest.$ac_ext <<EOF
13887 #line 13888 "configure"
13888 #include "confdefs.h"
13889 /* pthread test headers */
13890 #include <pthread.h>
13891 #if HAVE_PTHREADS < 7
13892 #include <errno.h>
13893 #endif
13894 #ifndef NULL
13895 #define NULL (void*)0
13896 #endif
13897
13898 static void *task(p)
13899         void *p;
13900 {
13901         return (void *) (p == NULL);
13902 }
13903
13904
13905 int main(argc, argv)
13906         int argc;
13907         char **argv;
13908 {
13909
13910         /* pthread test function */
13911 #ifndef PTHREAD_CREATE_DETACHED
13912 #define PTHREAD_CREATE_DETACHED 1
13913 #endif
13914         pthread_t t;
13915         int status;
13916         int detach = PTHREAD_CREATE_DETACHED;
13917
13918 #if HAVE_PTHREADS > 4
13919         /* Final pthreads */
13920         pthread_attr_t attr;
13921
13922         status = pthread_attr_init(&attr);
13923         if( status ) return status;
13924
13925 #if HAVE_PTHREADS < 7
13926         status = pthread_attr_setdetachstate(&attr, &detach);
13927         if( status < 0 ) status = errno;
13928 #else
13929         status = pthread_attr_setdetachstate(&attr, detach);
13930 #endif
13931         if( status ) return status;
13932         status = pthread_create( &t, &attr, task, NULL );
13933 #if HAVE_PTHREADS < 7
13934         if( status < 0 ) status = errno;
13935 #endif
13936         if( status ) return status;
13937 #else
13938         /* Draft 4 pthreads */
13939         status = pthread_create( &t, pthread_attr_default, task, NULL );
13940         if( status ) return errno;
13941
13942         /* give thread a chance to complete */
13943         /* it should remain joinable and hence detachable */
13944         sleep( 1 );
13945
13946         status = pthread_detach( &t );
13947         if( status ) return errno;
13948 #endif
13949
13950 #ifdef HAVE_LINUX_THREADS
13951         pthread_kill_other_threads_np();
13952 #endif
13953
13954         return 0;
13955
13956 }
13957
13958 EOF
13959 if { (eval echo configure:13960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13960 then
13961   ol_cv_pthread_threads=yes
13962 else
13963   echo "configure: failed program was:" >&5
13964   cat conftest.$ac_ext >&5
13965   rm -fr conftest*
13966   ol_cv_pthread_threads=no
13967 fi
13968 rm -fr conftest*
13969 fi
13970
13971
13972                 # restore the LIBS
13973                 LIBS="$ol_LIBS"
13974         
13975 fi
13976
13977 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
13978
13979         if test $ol_cv_pthread_threads = yes ; then
13980                 ol_link_pthreads="-threads"
13981                 ol_link_threads=posix
13982         fi
13983 fi
13984
13985
13986                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
13987 if test "$ol_link_threads" = no ; then
13988         # try -lpthreads -lmach -lexc -lc_r
13989         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
13990 echo "configure:13991: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
13991 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
13992   echo $ac_n "(cached) $ac_c" 1>&6
13993 else
13994   
13995                 # save the flags
13996                 ol_LIBS="$LIBS"
13997                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
13998
13999                 if test "$cross_compiling" = yes; then
14000   cat > conftest.$ac_ext <<EOF
14001 #line 14002 "configure"
14002 #include "confdefs.h"
14003 /* pthread test headers */
14004 #include <pthread.h>
14005 #if HAVE_PTHREADS < 7
14006 #include <errno.h>
14007 #endif
14008 #ifndef NULL
14009 #define NULL (void*)0
14010 #endif
14011
14012 static void *task(p)
14013         void *p;
14014 {
14015         return (void *) (p == NULL);
14016 }
14017
14018 int main() {
14019
14020         /* pthread test function */
14021 #ifndef PTHREAD_CREATE_DETACHED
14022 #define PTHREAD_CREATE_DETACHED 1
14023 #endif
14024         pthread_t t;
14025         int status;
14026         int detach = PTHREAD_CREATE_DETACHED;
14027
14028 #if HAVE_PTHREADS > 4
14029         /* Final pthreads */
14030         pthread_attr_t attr;
14031
14032         status = pthread_attr_init(&attr);
14033         if( status ) return status;
14034
14035 #if HAVE_PTHREADS < 7
14036         status = pthread_attr_setdetachstate(&attr, &detach);
14037         if( status < 0 ) status = errno;
14038 #else
14039         status = pthread_attr_setdetachstate(&attr, detach);
14040 #endif
14041         if( status ) return status;
14042         status = pthread_create( &t, &attr, task, NULL );
14043 #if HAVE_PTHREADS < 7
14044         if( status < 0 ) status = errno;
14045 #endif
14046         if( status ) return status;
14047 #else
14048         /* Draft 4 pthreads */
14049         status = pthread_create( &t, pthread_attr_default, task, NULL );
14050         if( status ) return errno;
14051
14052         /* give thread a chance to complete */
14053         /* it should remain joinable and hence detachable */
14054         sleep( 1 );
14055
14056         status = pthread_detach( &t );
14057         if( status ) return errno;
14058 #endif
14059
14060 #ifdef HAVE_LINUX_THREADS
14061         pthread_kill_other_threads_np();
14062 #endif
14063
14064         return 0;
14065
14066 ; return 0; }
14067 EOF
14068 if { (eval echo configure:14069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14069   rm -rf conftest*
14070   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
14071 else
14072   echo "configure: failed program was:" >&5
14073   cat conftest.$ac_ext >&5
14074   rm -rf conftest*
14075   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
14076 fi
14077 rm -f conftest*
14078 else
14079   cat > conftest.$ac_ext <<EOF
14080 #line 14081 "configure"
14081 #include "confdefs.h"
14082 /* pthread test headers */
14083 #include <pthread.h>
14084 #if HAVE_PTHREADS < 7
14085 #include <errno.h>
14086 #endif
14087 #ifndef NULL
14088 #define NULL (void*)0
14089 #endif
14090
14091 static void *task(p)
14092         void *p;
14093 {
14094         return (void *) (p == NULL);
14095 }
14096
14097
14098 int main(argc, argv)
14099         int argc;
14100         char **argv;
14101 {
14102
14103         /* pthread test function */
14104 #ifndef PTHREAD_CREATE_DETACHED
14105 #define PTHREAD_CREATE_DETACHED 1
14106 #endif
14107         pthread_t t;
14108         int status;
14109         int detach = PTHREAD_CREATE_DETACHED;
14110
14111 #if HAVE_PTHREADS > 4
14112         /* Final pthreads */
14113         pthread_attr_t attr;
14114
14115         status = pthread_attr_init(&attr);
14116         if( status ) return status;
14117
14118 #if HAVE_PTHREADS < 7
14119         status = pthread_attr_setdetachstate(&attr, &detach);
14120         if( status < 0 ) status = errno;
14121 #else
14122         status = pthread_attr_setdetachstate(&attr, detach);
14123 #endif
14124         if( status ) return status;
14125         status = pthread_create( &t, &attr, task, NULL );
14126 #if HAVE_PTHREADS < 7
14127         if( status < 0 ) status = errno;
14128 #endif
14129         if( status ) return status;
14130 #else
14131         /* Draft 4 pthreads */
14132         status = pthread_create( &t, pthread_attr_default, task, NULL );
14133         if( status ) return errno;
14134
14135         /* give thread a chance to complete */
14136         /* it should remain joinable and hence detachable */
14137         sleep( 1 );
14138
14139         status = pthread_detach( &t );
14140         if( status ) return errno;
14141 #endif
14142
14143 #ifdef HAVE_LINUX_THREADS
14144         pthread_kill_other_threads_np();
14145 #endif
14146
14147         return 0;
14148
14149 }
14150
14151 EOF
14152 if { (eval echo configure:14153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14153 then
14154   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
14155 else
14156   echo "configure: failed program was:" >&5
14157   cat conftest.$ac_ext >&5
14158   rm -fr conftest*
14159   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
14160 fi
14161 rm -fr conftest*
14162 fi
14163
14164
14165                 # restore the LIBS
14166                 LIBS="$ol_LIBS"
14167         
14168 fi
14169
14170 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
14171
14172         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
14173                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
14174                 ol_link_threads=posix
14175         fi
14176 fi
14177
14178                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
14179 if test "$ol_link_threads" = no ; then
14180         # try -lpthreads -lmach -lexc
14181         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
14182 echo "configure:14183: checking for pthread link with -lpthreads -lmach -lexc" >&5
14183 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
14184   echo $ac_n "(cached) $ac_c" 1>&6
14185 else
14186   
14187                 # save the flags
14188                 ol_LIBS="$LIBS"
14189                 LIBS="-lpthreads -lmach -lexc $LIBS"
14190
14191                 if test "$cross_compiling" = yes; then
14192   cat > conftest.$ac_ext <<EOF
14193 #line 14194 "configure"
14194 #include "confdefs.h"
14195 /* pthread test headers */
14196 #include <pthread.h>
14197 #if HAVE_PTHREADS < 7
14198 #include <errno.h>
14199 #endif
14200 #ifndef NULL
14201 #define NULL (void*)0
14202 #endif
14203
14204 static void *task(p)
14205         void *p;
14206 {
14207         return (void *) (p == NULL);
14208 }
14209
14210 int main() {
14211
14212         /* pthread test function */
14213 #ifndef PTHREAD_CREATE_DETACHED
14214 #define PTHREAD_CREATE_DETACHED 1
14215 #endif
14216         pthread_t t;
14217         int status;
14218         int detach = PTHREAD_CREATE_DETACHED;
14219
14220 #if HAVE_PTHREADS > 4
14221         /* Final pthreads */
14222         pthread_attr_t attr;
14223
14224         status = pthread_attr_init(&attr);
14225         if( status ) return status;
14226
14227 #if HAVE_PTHREADS < 7
14228         status = pthread_attr_setdetachstate(&attr, &detach);
14229         if( status < 0 ) status = errno;
14230 #else
14231         status = pthread_attr_setdetachstate(&attr, detach);
14232 #endif
14233         if( status ) return status;
14234         status = pthread_create( &t, &attr, task, NULL );
14235 #if HAVE_PTHREADS < 7
14236         if( status < 0 ) status = errno;
14237 #endif
14238         if( status ) return status;
14239 #else
14240         /* Draft 4 pthreads */
14241         status = pthread_create( &t, pthread_attr_default, task, NULL );
14242         if( status ) return errno;
14243
14244         /* give thread a chance to complete */
14245         /* it should remain joinable and hence detachable */
14246         sleep( 1 );
14247
14248         status = pthread_detach( &t );
14249         if( status ) return errno;
14250 #endif
14251
14252 #ifdef HAVE_LINUX_THREADS
14253         pthread_kill_other_threads_np();
14254 #endif
14255
14256         return 0;
14257
14258 ; return 0; }
14259 EOF
14260 if { (eval echo configure:14261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14261   rm -rf conftest*
14262   ol_cv_pthread_lpthreads_lmach_lexc=yes
14263 else
14264   echo "configure: failed program was:" >&5
14265   cat conftest.$ac_ext >&5
14266   rm -rf conftest*
14267   ol_cv_pthread_lpthreads_lmach_lexc=no
14268 fi
14269 rm -f conftest*
14270 else
14271   cat > conftest.$ac_ext <<EOF
14272 #line 14273 "configure"
14273 #include "confdefs.h"
14274 /* pthread test headers */
14275 #include <pthread.h>
14276 #if HAVE_PTHREADS < 7
14277 #include <errno.h>
14278 #endif
14279 #ifndef NULL
14280 #define NULL (void*)0
14281 #endif
14282
14283 static void *task(p)
14284         void *p;
14285 {
14286         return (void *) (p == NULL);
14287 }
14288
14289
14290 int main(argc, argv)
14291         int argc;
14292         char **argv;
14293 {
14294
14295         /* pthread test function */
14296 #ifndef PTHREAD_CREATE_DETACHED
14297 #define PTHREAD_CREATE_DETACHED 1
14298 #endif
14299         pthread_t t;
14300         int status;
14301         int detach = PTHREAD_CREATE_DETACHED;
14302
14303 #if HAVE_PTHREADS > 4
14304         /* Final pthreads */
14305         pthread_attr_t attr;
14306
14307         status = pthread_attr_init(&attr);
14308         if( status ) return status;
14309
14310 #if HAVE_PTHREADS < 7
14311         status = pthread_attr_setdetachstate(&attr, &detach);
14312         if( status < 0 ) status = errno;
14313 #else
14314         status = pthread_attr_setdetachstate(&attr, detach);
14315 #endif
14316         if( status ) return status;
14317         status = pthread_create( &t, &attr, task, NULL );
14318 #if HAVE_PTHREADS < 7
14319         if( status < 0 ) status = errno;
14320 #endif
14321         if( status ) return status;
14322 #else
14323         /* Draft 4 pthreads */
14324         status = pthread_create( &t, pthread_attr_default, task, NULL );
14325         if( status ) return errno;
14326
14327         /* give thread a chance to complete */
14328         /* it should remain joinable and hence detachable */
14329         sleep( 1 );
14330
14331         status = pthread_detach( &t );
14332         if( status ) return errno;
14333 #endif
14334
14335 #ifdef HAVE_LINUX_THREADS
14336         pthread_kill_other_threads_np();
14337 #endif
14338
14339         return 0;
14340
14341 }
14342
14343 EOF
14344 if { (eval echo configure:14345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14345 then
14346   ol_cv_pthread_lpthreads_lmach_lexc=yes
14347 else
14348   echo "configure: failed program was:" >&5
14349   cat conftest.$ac_ext >&5
14350   rm -fr conftest*
14351   ol_cv_pthread_lpthreads_lmach_lexc=no
14352 fi
14353 rm -fr conftest*
14354 fi
14355
14356
14357                 # restore the LIBS
14358                 LIBS="$ol_LIBS"
14359         
14360 fi
14361
14362 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
14363
14364         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
14365                 ol_link_pthreads="-lpthreads -lmach -lexc"
14366                 ol_link_threads=posix
14367         fi
14368 fi
14369
14370                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
14371 if test "$ol_link_threads" = no ; then
14372         # try -lpthreads -lexc
14373         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
14374 echo "configure:14375: checking for pthread link with -lpthreads -lexc" >&5
14375 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
14376   echo $ac_n "(cached) $ac_c" 1>&6
14377 else
14378   
14379                 # save the flags
14380                 ol_LIBS="$LIBS"
14381                 LIBS="-lpthreads -lexc $LIBS"
14382
14383                 if test "$cross_compiling" = yes; then
14384   cat > conftest.$ac_ext <<EOF
14385 #line 14386 "configure"
14386 #include "confdefs.h"
14387 /* pthread test headers */
14388 #include <pthread.h>
14389 #if HAVE_PTHREADS < 7
14390 #include <errno.h>
14391 #endif
14392 #ifndef NULL
14393 #define NULL (void*)0
14394 #endif
14395
14396 static void *task(p)
14397         void *p;
14398 {
14399         return (void *) (p == NULL);
14400 }
14401
14402 int main() {
14403
14404         /* pthread test function */
14405 #ifndef PTHREAD_CREATE_DETACHED
14406 #define PTHREAD_CREATE_DETACHED 1
14407 #endif
14408         pthread_t t;
14409         int status;
14410         int detach = PTHREAD_CREATE_DETACHED;
14411
14412 #if HAVE_PTHREADS > 4
14413         /* Final pthreads */
14414         pthread_attr_t attr;
14415
14416         status = pthread_attr_init(&attr);
14417         if( status ) return status;
14418
14419 #if HAVE_PTHREADS < 7
14420         status = pthread_attr_setdetachstate(&attr, &detach);
14421         if( status < 0 ) status = errno;
14422 #else
14423         status = pthread_attr_setdetachstate(&attr, detach);
14424 #endif
14425         if( status ) return status;
14426         status = pthread_create( &t, &attr, task, NULL );
14427 #if HAVE_PTHREADS < 7
14428         if( status < 0 ) status = errno;
14429 #endif
14430         if( status ) return status;
14431 #else
14432         /* Draft 4 pthreads */
14433         status = pthread_create( &t, pthread_attr_default, task, NULL );
14434         if( status ) return errno;
14435
14436         /* give thread a chance to complete */
14437         /* it should remain joinable and hence detachable */
14438         sleep( 1 );
14439
14440         status = pthread_detach( &t );
14441         if( status ) return errno;
14442 #endif
14443
14444 #ifdef HAVE_LINUX_THREADS
14445         pthread_kill_other_threads_np();
14446 #endif
14447
14448         return 0;
14449
14450 ; return 0; }
14451 EOF
14452 if { (eval echo configure:14453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14453   rm -rf conftest*
14454   ol_cv_pthread_lpthreads_lexc=yes
14455 else
14456   echo "configure: failed program was:" >&5
14457   cat conftest.$ac_ext >&5
14458   rm -rf conftest*
14459   ol_cv_pthread_lpthreads_lexc=no
14460 fi
14461 rm -f conftest*
14462 else
14463   cat > conftest.$ac_ext <<EOF
14464 #line 14465 "configure"
14465 #include "confdefs.h"
14466 /* pthread test headers */
14467 #include <pthread.h>
14468 #if HAVE_PTHREADS < 7
14469 #include <errno.h>
14470 #endif
14471 #ifndef NULL
14472 #define NULL (void*)0
14473 #endif
14474
14475 static void *task(p)
14476         void *p;
14477 {
14478         return (void *) (p == NULL);
14479 }
14480
14481
14482 int main(argc, argv)
14483         int argc;
14484         char **argv;
14485 {
14486
14487         /* pthread test function */
14488 #ifndef PTHREAD_CREATE_DETACHED
14489 #define PTHREAD_CREATE_DETACHED 1
14490 #endif
14491         pthread_t t;
14492         int status;
14493         int detach = PTHREAD_CREATE_DETACHED;
14494
14495 #if HAVE_PTHREADS > 4
14496         /* Final pthreads */
14497         pthread_attr_t attr;
14498
14499         status = pthread_attr_init(&attr);
14500         if( status ) return status;
14501
14502 #if HAVE_PTHREADS < 7
14503         status = pthread_attr_setdetachstate(&attr, &detach);
14504         if( status < 0 ) status = errno;
14505 #else
14506         status = pthread_attr_setdetachstate(&attr, detach);
14507 #endif
14508         if( status ) return status;
14509         status = pthread_create( &t, &attr, task, NULL );
14510 #if HAVE_PTHREADS < 7
14511         if( status < 0 ) status = errno;
14512 #endif
14513         if( status ) return status;
14514 #else
14515         /* Draft 4 pthreads */
14516         status = pthread_create( &t, pthread_attr_default, task, NULL );
14517         if( status ) return errno;
14518
14519         /* give thread a chance to complete */
14520         /* it should remain joinable and hence detachable */
14521         sleep( 1 );
14522
14523         status = pthread_detach( &t );
14524         if( status ) return errno;
14525 #endif
14526
14527 #ifdef HAVE_LINUX_THREADS
14528         pthread_kill_other_threads_np();
14529 #endif
14530
14531         return 0;
14532
14533 }
14534
14535 EOF
14536 if { (eval echo configure:14537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14537 then
14538   ol_cv_pthread_lpthreads_lexc=yes
14539 else
14540   echo "configure: failed program was:" >&5
14541   cat conftest.$ac_ext >&5
14542   rm -fr conftest*
14543   ol_cv_pthread_lpthreads_lexc=no
14544 fi
14545 rm -fr conftest*
14546 fi
14547
14548
14549                 # restore the LIBS
14550                 LIBS="$ol_LIBS"
14551         
14552 fi
14553
14554 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
14555
14556         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
14557                 ol_link_pthreads="-lpthreads -lexc"
14558                 ol_link_threads=posix
14559         fi
14560 fi
14561
14562
14563                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
14564 if test "$ol_link_threads" = no ; then
14565         # try -lpthreads
14566         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
14567 echo "configure:14568: checking for pthread link with -lpthreads" >&5
14568 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
14569   echo $ac_n "(cached) $ac_c" 1>&6
14570 else
14571   
14572                 # save the flags
14573                 ol_LIBS="$LIBS"
14574                 LIBS="-lpthreads $LIBS"
14575
14576                 if test "$cross_compiling" = yes; then
14577   cat > conftest.$ac_ext <<EOF
14578 #line 14579 "configure"
14579 #include "confdefs.h"
14580 /* pthread test headers */
14581 #include <pthread.h>
14582 #if HAVE_PTHREADS < 7
14583 #include <errno.h>
14584 #endif
14585 #ifndef NULL
14586 #define NULL (void*)0
14587 #endif
14588
14589 static void *task(p)
14590         void *p;
14591 {
14592         return (void *) (p == NULL);
14593 }
14594
14595 int main() {
14596
14597         /* pthread test function */
14598 #ifndef PTHREAD_CREATE_DETACHED
14599 #define PTHREAD_CREATE_DETACHED 1
14600 #endif
14601         pthread_t t;
14602         int status;
14603         int detach = PTHREAD_CREATE_DETACHED;
14604
14605 #if HAVE_PTHREADS > 4
14606         /* Final pthreads */
14607         pthread_attr_t attr;
14608
14609         status = pthread_attr_init(&attr);
14610         if( status ) return status;
14611
14612 #if HAVE_PTHREADS < 7
14613         status = pthread_attr_setdetachstate(&attr, &detach);
14614         if( status < 0 ) status = errno;
14615 #else
14616         status = pthread_attr_setdetachstate(&attr, detach);
14617 #endif
14618         if( status ) return status;
14619         status = pthread_create( &t, &attr, task, NULL );
14620 #if HAVE_PTHREADS < 7
14621         if( status < 0 ) status = errno;
14622 #endif
14623         if( status ) return status;
14624 #else
14625         /* Draft 4 pthreads */
14626         status = pthread_create( &t, pthread_attr_default, task, NULL );
14627         if( status ) return errno;
14628
14629         /* give thread a chance to complete */
14630         /* it should remain joinable and hence detachable */
14631         sleep( 1 );
14632
14633         status = pthread_detach( &t );
14634         if( status ) return errno;
14635 #endif
14636
14637 #ifdef HAVE_LINUX_THREADS
14638         pthread_kill_other_threads_np();
14639 #endif
14640
14641         return 0;
14642
14643 ; return 0; }
14644 EOF
14645 if { (eval echo configure:14646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14646   rm -rf conftest*
14647   ol_cv_pthread_lib_lpthreads=yes
14648 else
14649   echo "configure: failed program was:" >&5
14650   cat conftest.$ac_ext >&5
14651   rm -rf conftest*
14652   ol_cv_pthread_lib_lpthreads=no
14653 fi
14654 rm -f conftest*
14655 else
14656   cat > conftest.$ac_ext <<EOF
14657 #line 14658 "configure"
14658 #include "confdefs.h"
14659 /* pthread test headers */
14660 #include <pthread.h>
14661 #if HAVE_PTHREADS < 7
14662 #include <errno.h>
14663 #endif
14664 #ifndef NULL
14665 #define NULL (void*)0
14666 #endif
14667
14668 static void *task(p)
14669         void *p;
14670 {
14671         return (void *) (p == NULL);
14672 }
14673
14674
14675 int main(argc, argv)
14676         int argc;
14677         char **argv;
14678 {
14679
14680         /* pthread test function */
14681 #ifndef PTHREAD_CREATE_DETACHED
14682 #define PTHREAD_CREATE_DETACHED 1
14683 #endif
14684         pthread_t t;
14685         int status;
14686         int detach = PTHREAD_CREATE_DETACHED;
14687
14688 #if HAVE_PTHREADS > 4
14689         /* Final pthreads */
14690         pthread_attr_t attr;
14691
14692         status = pthread_attr_init(&attr);
14693         if( status ) return status;
14694
14695 #if HAVE_PTHREADS < 7
14696         status = pthread_attr_setdetachstate(&attr, &detach);
14697         if( status < 0 ) status = errno;
14698 #else
14699         status = pthread_attr_setdetachstate(&attr, detach);
14700 #endif
14701         if( status ) return status;
14702         status = pthread_create( &t, &attr, task, NULL );
14703 #if HAVE_PTHREADS < 7
14704         if( status < 0 ) status = errno;
14705 #endif
14706         if( status ) return status;
14707 #else
14708         /* Draft 4 pthreads */
14709         status = pthread_create( &t, pthread_attr_default, task, NULL );
14710         if( status ) return errno;
14711
14712         /* give thread a chance to complete */
14713         /* it should remain joinable and hence detachable */
14714         sleep( 1 );
14715
14716         status = pthread_detach( &t );
14717         if( status ) return errno;
14718 #endif
14719
14720 #ifdef HAVE_LINUX_THREADS
14721         pthread_kill_other_threads_np();
14722 #endif
14723
14724         return 0;
14725
14726 }
14727
14728 EOF
14729 if { (eval echo configure:14730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14730 then
14731   ol_cv_pthread_lib_lpthreads=yes
14732 else
14733   echo "configure: failed program was:" >&5
14734   cat conftest.$ac_ext >&5
14735   rm -fr conftest*
14736   ol_cv_pthread_lib_lpthreads=no
14737 fi
14738 rm -fr conftest*
14739 fi
14740
14741
14742                 # restore the LIBS
14743                 LIBS="$ol_LIBS"
14744         
14745 fi
14746
14747 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
14748
14749         if test $ol_cv_pthread_lib_lpthreads = yes ; then
14750                 ol_link_pthreads="-lpthreads"
14751                 ol_link_threads=posix
14752         fi
14753 fi
14754
14755
14756                 if test $ol_link_threads != no ; then
14757                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
14758
14759                                                 save_CPPFLAGS="$CPPFLAGS"
14760                         save_LIBS="$LIBS"
14761                         LIBS="$LTHREAD_LIBS $LIBS"
14762
14763                                                                                                 for ac_func in sched_yield pthread_yield thr_yield
14764 do
14765 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14766 echo "configure:14767: checking for $ac_func" >&5
14767 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14768   echo $ac_n "(cached) $ac_c" 1>&6
14769 else
14770   cat > conftest.$ac_ext <<EOF
14771 #line 14772 "configure"
14772 #include "confdefs.h"
14773 /* System header to define __stub macros and hopefully few prototypes,
14774     which can conflict with char $ac_func(); below.  */
14775 #include <assert.h>
14776 /* Override any gcc2 internal prototype to avoid an error.  */
14777 /* We use char because int might match the return type of a gcc2
14778     builtin and then its argument prototype would still apply.  */
14779 char $ac_func();
14780 char (*f)();
14781
14782 int main() {
14783
14784 /* The GNU C library defines this for functions which it implements
14785     to always fail with ENOSYS.  Some functions are actually named
14786     something starting with __ and the normal name is an alias.  */
14787 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14788 choke me
14789 #else
14790 f = $ac_func;
14791 #endif
14792
14793 ; return 0; }
14794 EOF
14795 if { (eval echo configure:14796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14796   rm -rf conftest*
14797   eval "ac_cv_func_$ac_func=yes"
14798 else
14799   echo "configure: failed program was:" >&5
14800   cat conftest.$ac_ext >&5
14801   rm -rf conftest*
14802   eval "ac_cv_func_$ac_func=no"
14803 fi
14804 rm -f conftest*
14805 fi
14806
14807 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14808   echo "$ac_t""yes" 1>&6
14809     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14810   cat >> confdefs.h <<EOF
14811 #define $ac_tr_func 1
14812 EOF
14813  
14814 else
14815   echo "$ac_t""no" 1>&6
14816 fi
14817 done
14818
14819
14820                         if test $ac_cv_func_sched_yield = no -a \
14821                                 $ac_cv_func_pthread_yield = no -a \
14822                                 $ac_cv_func_thr_yield = no ; then
14823                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
14824 echo "configure:14825: checking for sched_yield in -lrt" >&5
14825 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
14826 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14827   echo $ac_n "(cached) $ac_c" 1>&6
14828 else
14829   ac_save_LIBS="$LIBS"
14830 LIBS="-lrt  $LIBS"
14831 cat > conftest.$ac_ext <<EOF
14832 #line 14833 "configure"
14833 #include "confdefs.h"
14834 /* Override any gcc2 internal prototype to avoid an error.  */
14835 /* We use char because int might match the return type of a gcc2
14836     builtin and then its argument prototype would still apply.  */
14837 char sched_yield();
14838
14839 int main() {
14840 sched_yield()
14841 ; return 0; }
14842 EOF
14843 if { (eval echo configure:14844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14844   rm -rf conftest*
14845   eval "ac_cv_lib_$ac_lib_var=yes"
14846 else
14847   echo "configure: failed program was:" >&5
14848   cat conftest.$ac_ext >&5
14849   rm -rf conftest*
14850   eval "ac_cv_lib_$ac_lib_var=no"
14851 fi
14852 rm -f conftest*
14853 LIBS="$ac_save_LIBS"
14854
14855 fi
14856 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14857   echo "$ac_t""yes" 1>&6
14858   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
14859                                         cat >> confdefs.h <<\EOF
14860 #define HAVE_SCHED_YIELD 1
14861 EOF
14862
14863                                         ac_cv_func_sched_yield=yes
14864 else
14865   echo "$ac_t""no" 1>&6
14866 ac_cv_func_sched_yield=no
14867 fi
14868
14869                         fi
14870                         if test $ac_cv_func_sched_yield = no -a \
14871                                 $ac_cv_func_pthread_yield = no -a \
14872                                 "$ac_cv_func_thr_yield" = no ; then
14873                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
14874                         fi
14875
14876                                                 for ac_func in pthread_kill pthread_rwlock_destroy
14877 do
14878 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14879 echo "configure:14880: checking for $ac_func" >&5
14880 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14881   echo $ac_n "(cached) $ac_c" 1>&6
14882 else
14883   cat > conftest.$ac_ext <<EOF
14884 #line 14885 "configure"
14885 #include "confdefs.h"
14886 /* System header to define __stub macros and hopefully few prototypes,
14887     which can conflict with char $ac_func(); below.  */
14888 #include <assert.h>
14889 /* Override any gcc2 internal prototype to avoid an error.  */
14890 /* We use char because int might match the return type of a gcc2
14891     builtin and then its argument prototype would still apply.  */
14892 char $ac_func();
14893 char (*f)();
14894
14895 int main() {
14896
14897 /* The GNU C library defines this for functions which it implements
14898     to always fail with ENOSYS.  Some functions are actually named
14899     something starting with __ and the normal name is an alias.  */
14900 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14901 choke me
14902 #else
14903 f = $ac_func;
14904 #endif
14905
14906 ; return 0; }
14907 EOF
14908 if { (eval echo configure:14909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14909   rm -rf conftest*
14910   eval "ac_cv_func_$ac_func=yes"
14911 else
14912   echo "configure: failed program was:" >&5
14913   cat conftest.$ac_ext >&5
14914   rm -rf conftest*
14915   eval "ac_cv_func_$ac_func=no"
14916 fi
14917 rm -f conftest*
14918 fi
14919
14920 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14921   echo "$ac_t""yes" 1>&6
14922     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14923   cat >> confdefs.h <<EOF
14924 #define $ac_tr_func 1
14925 EOF
14926  
14927 else
14928   echo "$ac_t""no" 1>&6
14929 fi
14930 done
14931
14932
14933                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
14934 echo "configure:14935: checking for pthread_detach with <pthread.h>" >&5
14935 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
14936   echo $ac_n "(cached) $ac_c" 1>&6
14937 else
14938   
14939                                                                 cat > conftest.$ac_ext <<EOF
14940 #line 14941 "configure"
14941 #include "confdefs.h"
14942
14943 #include <pthread.h>
14944 #ifndef NULL
14945 #define NULL (void*)0
14946 #endif
14947
14948 int main() {
14949 pthread_detach(NULL);
14950 ; return 0; }
14951 EOF
14952 if { (eval echo configure:14953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14953   rm -rf conftest*
14954   ol_cv_func_pthread_detach=yes
14955 else
14956   echo "configure: failed program was:" >&5
14957   cat conftest.$ac_ext >&5
14958   rm -rf conftest*
14959   ol_cv_func_pthread_detach=no
14960 fi
14961 rm -f conftest*
14962                         
14963 fi
14964
14965 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
14966
14967                         if test $ol_cv_func_pthread_detach = no ; then
14968                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
14969                         fi
14970
14971                         cat >> confdefs.h <<\EOF
14972 #define HAVE_PTHREAD_DETACH 1
14973 EOF
14974
14975
14976                                                 for ac_func in \
14977                                 pthread_setconcurrency \
14978                                 pthread_getconcurrency \
14979                                 thr_setconcurrency \
14980                                 thr_getconcurrency \
14981                         
14982 do
14983 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14984 echo "configure:14985: checking for $ac_func" >&5
14985 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14986   echo $ac_n "(cached) $ac_c" 1>&6
14987 else
14988   cat > conftest.$ac_ext <<EOF
14989 #line 14990 "configure"
14990 #include "confdefs.h"
14991 /* System header to define __stub macros and hopefully few prototypes,
14992     which can conflict with char $ac_func(); below.  */
14993 #include <assert.h>
14994 /* Override any gcc2 internal prototype to avoid an error.  */
14995 /* We use char because int might match the return type of a gcc2
14996     builtin and then its argument prototype would still apply.  */
14997 char $ac_func();
14998 char (*f)();
14999
15000 int main() {
15001
15002 /* The GNU C library defines this for functions which it implements
15003     to always fail with ENOSYS.  Some functions are actually named
15004     something starting with __ and the normal name is an alias.  */
15005 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15006 choke me
15007 #else
15008 f = $ac_func;
15009 #endif
15010
15011 ; return 0; }
15012 EOF
15013 if { (eval echo configure:15014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15014   rm -rf conftest*
15015   eval "ac_cv_func_$ac_func=yes"
15016 else
15017   echo "configure: failed program was:" >&5
15018   cat conftest.$ac_ext >&5
15019   rm -rf conftest*
15020   eval "ac_cv_func_$ac_func=no"
15021 fi
15022 rm -f conftest*
15023 fi
15024
15025 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15026   echo "$ac_t""yes" 1>&6
15027     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15028   cat >> confdefs.h <<EOF
15029 #define $ac_tr_func 1
15030 EOF
15031  
15032 else
15033   echo "$ac_t""no" 1>&6
15034 fi
15035 done
15036
15037
15038                         
15039         for ac_func in pthread_kill_other_threads_np
15040 do
15041 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15042 echo "configure:15043: checking for $ac_func" >&5
15043 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15044   echo $ac_n "(cached) $ac_c" 1>&6
15045 else
15046   cat > conftest.$ac_ext <<EOF
15047 #line 15048 "configure"
15048 #include "confdefs.h"
15049 /* System header to define __stub macros and hopefully few prototypes,
15050     which can conflict with char $ac_func(); below.  */
15051 #include <assert.h>
15052 /* Override any gcc2 internal prototype to avoid an error.  */
15053 /* We use char because int might match the return type of a gcc2
15054     builtin and then its argument prototype would still apply.  */
15055 char $ac_func();
15056 char (*f)();
15057
15058 int main() {
15059
15060 /* The GNU C library defines this for functions which it implements
15061     to always fail with ENOSYS.  Some functions are actually named
15062     something starting with __ and the normal name is an alias.  */
15063 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15064 choke me
15065 #else
15066 f = $ac_func;
15067 #endif
15068
15069 ; return 0; }
15070 EOF
15071 if { (eval echo configure:15072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15072   rm -rf conftest*
15073   eval "ac_cv_func_$ac_func=yes"
15074 else
15075   echo "configure: failed program was:" >&5
15076   cat conftest.$ac_ext >&5
15077   rm -rf conftest*
15078   eval "ac_cv_func_$ac_func=no"
15079 fi
15080 rm -f conftest*
15081 fi
15082
15083 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15084   echo "$ac_t""yes" 1>&6
15085     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15086   cat >> confdefs.h <<EOF
15087 #define $ac_tr_func 1
15088 EOF
15089  
15090 else
15091   echo "$ac_t""no" 1>&6
15092 fi
15093 done
15094
15095         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
15096 echo "configure:15097: checking for LinuxThreads implementation" >&5
15097 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
15098   echo $ac_n "(cached) $ac_c" 1>&6
15099 else
15100   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
15101 fi
15102
15103 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
15104
15105                         
15106         
15107         
15108         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
15109 echo "configure:15110: checking for LinuxThreads consistency" >&5
15110 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
15111   echo $ac_n "(cached) $ac_c" 1>&6
15112 else
15113   
15114                 if test $ol_cv_header_linux_threads = yes -a \
15115                         $ol_cv_sys_linux_threads = yes; then
15116                         ol_cv_linux_threads=yes
15117                 elif test $ol_cv_header_linux_threads = no -a \
15118                         $ol_cv_sys_linux_threads = no; then
15119                         ol_cv_linux_threads=no
15120                 else
15121                         ol_cv_linux_threads=error
15122                 fi
15123         
15124 fi
15125
15126 echo "$ac_t""$ol_cv_linux_threads" 1>&6
15127
15128
15129                         if test $ol_cv_linux_threads = error; then
15130                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
15131                         fi
15132
15133                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
15134 echo "configure:15135: checking if pthread_create() works" >&5
15135 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
15136   echo $ac_n "(cached) $ac_c" 1>&6
15137 else
15138   
15139                         if test "$cross_compiling" = yes; then
15140                                 ol_cv_pthread_create_works=yes
15141 else
15142   cat > conftest.$ac_ext <<EOF
15143 #line 15144 "configure"
15144 #include "confdefs.h"
15145 /* pthread test headers */
15146 #include <pthread.h>
15147 #if HAVE_PTHREADS < 7
15148 #include <errno.h>
15149 #endif
15150 #ifndef NULL
15151 #define NULL (void*)0
15152 #endif
15153
15154 static void *task(p)
15155         void *p;
15156 {
15157         return (void *) (p == NULL);
15158 }
15159
15160
15161 int main(argc, argv)
15162         int argc;
15163         char **argv;
15164 {
15165
15166         /* pthread test function */
15167 #ifndef PTHREAD_CREATE_DETACHED
15168 #define PTHREAD_CREATE_DETACHED 1
15169 #endif
15170         pthread_t t;
15171         int status;
15172         int detach = PTHREAD_CREATE_DETACHED;
15173
15174 #if HAVE_PTHREADS > 4
15175         /* Final pthreads */
15176         pthread_attr_t attr;
15177
15178         status = pthread_attr_init(&attr);
15179         if( status ) return status;
15180
15181 #if HAVE_PTHREADS < 7
15182         status = pthread_attr_setdetachstate(&attr, &detach);
15183         if( status < 0 ) status = errno;
15184 #else
15185         status = pthread_attr_setdetachstate(&attr, detach);
15186 #endif
15187         if( status ) return status;
15188         status = pthread_create( &t, &attr, task, NULL );
15189 #if HAVE_PTHREADS < 7
15190         if( status < 0 ) status = errno;
15191 #endif
15192         if( status ) return status;
15193 #else
15194         /* Draft 4 pthreads */
15195         status = pthread_create( &t, pthread_attr_default, task, NULL );
15196         if( status ) return errno;
15197
15198         /* give thread a chance to complete */
15199         /* it should remain joinable and hence detachable */
15200         sleep( 1 );
15201
15202         status = pthread_detach( &t );
15203         if( status ) return errno;
15204 #endif
15205
15206 #ifdef HAVE_LINUX_THREADS
15207         pthread_kill_other_threads_np();
15208 #endif
15209
15210         return 0;
15211
15212 }
15213
15214 EOF
15215 if { (eval echo configure:15216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15216 then
15217   ol_cv_pthread_create_works=yes
15218 else
15219   echo "configure: failed program was:" >&5
15220   cat conftest.$ac_ext >&5
15221   rm -fr conftest*
15222   ol_cv_pthread_create_works=no
15223 fi
15224 rm -fr conftest*
15225 fi
15226
15227 fi
15228
15229 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
15230
15231                         if test $ol_cv_pthread_create_works = no ; then
15232                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
15233                         fi
15234
15235                                                 if test $ol_with_yielding_select = auto ; then
15236                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
15237 echo "configure:15238: checking if select yields when using pthreads" >&5
15238 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
15239   echo $ac_n "(cached) $ac_c" 1>&6
15240 else
15241   
15242                                 if test "$cross_compiling" = yes; then
15243   ol_cv_pthread_select_yields=cross
15244 else
15245   cat > conftest.$ac_ext <<EOF
15246 #line 15247 "configure"
15247 #include "confdefs.h"
15248
15249 #include <sys/types.h>
15250 #include <sys/time.h>
15251 #include <unistd.h>
15252 #include <pthread.h>
15253 #ifndef NULL
15254 #define NULL (void*) 0
15255 #endif
15256
15257 static int fildes[2];
15258
15259 static void *task(p)
15260         void *p;
15261 {
15262         int i;
15263         struct timeval tv;
15264
15265         fd_set rfds;
15266
15267         tv.tv_sec=10;
15268         tv.tv_usec=0;
15269
15270         FD_ZERO(&rfds);
15271         FD_SET(fildes[0], &rfds);
15272
15273         /* we're not interested in any fds */
15274         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
15275
15276         if(i < 0) {
15277                 perror("select");
15278                 exit(10);
15279         }
15280
15281         exit(0); /* if we exit here, the select blocked the whole process */
15282 }
15283
15284 int main(argc, argv)
15285         int argc;
15286         char **argv;
15287 {
15288         pthread_t t;
15289
15290         /* create a pipe to select */
15291         if(pipe(&fildes[0])) {
15292                 perror("select");
15293                 exit(1);
15294         }
15295
15296 #ifdef HAVE_PTHREAD_SETCONCURRENCY
15297         (void) pthread_setconcurrency(2);
15298 #else
15299 #ifdef HAVE_THR_SETCONCURRENCY
15300         /* Set Solaris LWP concurrency to 2 */
15301         thr_setconcurrency(2);
15302 #endif
15303 #endif
15304
15305 #if HAVE_PTHREADS < 6
15306         pthread_create(&t, pthread_attr_default, task, NULL);
15307 #else
15308         pthread_create(&t, NULL, task, NULL);
15309 #endif
15310
15311         /* make sure task runs first */
15312 #if HAVE_THR_YIELD
15313         thr_yield();
15314 #elif defined( HAVE_SCHED_YIELD )
15315         sched_yield();
15316 #elif defined( HAVE_PTHREAD_YIELD )
15317         pthread_yield();
15318 #endif
15319
15320         exit(2);
15321 }
15322 EOF
15323 if { (eval echo configure:15324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15324 then
15325   ol_cv_pthread_select_yields=no
15326 else
15327   echo "configure: failed program was:" >&5
15328   cat conftest.$ac_ext >&5
15329   rm -fr conftest*
15330   ol_cv_pthread_select_yields=yes
15331 fi
15332 rm -fr conftest*
15333 fi
15334
15335 fi
15336
15337 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
15338
15339                                 if test $ol_cv_pthread_select_yields = cross ; then
15340                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
15341                                 fi
15342
15343                                 if test $ol_cv_pthread_select_yields = yes ; then
15344                                         ol_with_yielding_select=yes
15345                                 fi
15346                         fi
15347
15348                                                 CPPFLAGS="$save_CPPFLAGS"
15349                         LIBS="$save_LIBS"
15350                 else
15351                         { echo "configure: error: could not locate usable POSIX Threads" 1>&2; exit 1; }
15352                 fi
15353         fi
15354
15355         if test $ol_with_threads = posix ; then
15356                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
15357         fi
15358 fi
15359
15360 if test $ol_with_threads = auto -o $ol_with_threads = yes \
15361         -o $ol_with_threads = mach ; then
15362
15363                 for ac_hdr in mach/cthreads.h cthreads.h
15364 do
15365 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15366 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15367 echo "configure:15368: checking for $ac_hdr" >&5
15368 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15369   echo $ac_n "(cached) $ac_c" 1>&6
15370 else
15371   cat > conftest.$ac_ext <<EOF
15372 #line 15373 "configure"
15373 #include "confdefs.h"
15374 #include <$ac_hdr>
15375 EOF
15376 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15377 { (eval echo configure:15378: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15378 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15379 if test -z "$ac_err"; then
15380   rm -rf conftest*
15381   eval "ac_cv_header_$ac_safe=yes"
15382 else
15383   echo "$ac_err" >&5
15384   echo "configure: failed program was:" >&5
15385   cat conftest.$ac_ext >&5
15386   rm -rf conftest*
15387   eval "ac_cv_header_$ac_safe=no"
15388 fi
15389 rm -f conftest*
15390 fi
15391 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15392   echo "$ac_t""yes" 1>&6
15393     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15394   cat >> confdefs.h <<EOF
15395 #define $ac_tr_hdr 1
15396 EOF
15397  
15398 else
15399   echo "$ac_t""no" 1>&6
15400 fi
15401 done
15402
15403         if test $ac_cv_header_mach_cthreads_h = yes ; then
15404                 ol_with_threads=found
15405
15406                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
15407 echo "configure:15408: checking for cthread_fork" >&5
15408 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
15409   echo $ac_n "(cached) $ac_c" 1>&6
15410 else
15411   cat > conftest.$ac_ext <<EOF
15412 #line 15413 "configure"
15413 #include "confdefs.h"
15414 /* System header to define __stub macros and hopefully few prototypes,
15415     which can conflict with char cthread_fork(); below.  */
15416 #include <assert.h>
15417 /* Override any gcc2 internal prototype to avoid an error.  */
15418 /* We use char because int might match the return type of a gcc2
15419     builtin and then its argument prototype would still apply.  */
15420 char cthread_fork();
15421 char (*f)();
15422
15423 int main() {
15424
15425 /* The GNU C library defines this for functions which it implements
15426     to always fail with ENOSYS.  Some functions are actually named
15427     something starting with __ and the normal name is an alias.  */
15428 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
15429 choke me
15430 #else
15431 f = cthread_fork;
15432 #endif
15433
15434 ; return 0; }
15435 EOF
15436 if { (eval echo configure:15437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15437   rm -rf conftest*
15438   eval "ac_cv_func_cthread_fork=yes"
15439 else
15440   echo "configure: failed program was:" >&5
15441   cat conftest.$ac_ext >&5
15442   rm -rf conftest*
15443   eval "ac_cv_func_cthread_fork=no"
15444 fi
15445 rm -f conftest*
15446 fi
15447
15448 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
15449   echo "$ac_t""yes" 1>&6
15450   ol_link_threads=yes
15451 else
15452   echo "$ac_t""no" 1>&6
15453 fi
15454
15455
15456                 if test $ol_link_threads = no ; then
15457                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
15458 echo "configure:15459: checking for cthread_fork with -all_load" >&5
15459 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
15460   echo $ac_n "(cached) $ac_c" 1>&6
15461 else
15462   
15463                                                                 save_LIBS="$LIBS"
15464                                 LIBS="-all_load $LIBS"
15465                                 cat > conftest.$ac_ext <<EOF
15466 #line 15467 "configure"
15467 #include "confdefs.h"
15468 #include <mach/cthreads.h>
15469 int main() {
15470
15471                                         cthread_fork((void *)0, (void *)0);
15472                                         
15473 ; return 0; }
15474 EOF
15475 if { (eval echo configure:15476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15476   rm -rf conftest*
15477   ol_cv_cthread_all_load=yes
15478 else
15479   echo "configure: failed program was:" >&5
15480   cat conftest.$ac_ext >&5
15481   rm -rf conftest*
15482   ol_cv_cthread_all_load=no
15483 fi
15484 rm -f conftest*
15485                                                                 LIBS="$save_LIBS"
15486                         
15487 fi
15488
15489 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
15490
15491                         if test $ol_cv_cthread_all_load = yes ; then
15492                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
15493                                 ol_link_threads=mach
15494                                 ol_with_threads=found
15495                         fi
15496                 fi
15497
15498         elif test $ac_cv_header_cthreads_h = yes ; then
15499                                 
15500                 ol_with_threads=found
15501  
15502                                 save_LIBS="$LIBS"
15503                 LIBS="$LIBS -lthreads"
15504                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
15505 echo "configure:15506: checking for cthread_fork" >&5
15506 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
15507   echo $ac_n "(cached) $ac_c" 1>&6
15508 else
15509   cat > conftest.$ac_ext <<EOF
15510 #line 15511 "configure"
15511 #include "confdefs.h"
15512 /* System header to define __stub macros and hopefully few prototypes,
15513     which can conflict with char cthread_fork(); below.  */
15514 #include <assert.h>
15515 /* Override any gcc2 internal prototype to avoid an error.  */
15516 /* We use char because int might match the return type of a gcc2
15517     builtin and then its argument prototype would still apply.  */
15518 char cthread_fork();
15519 char (*f)();
15520
15521 int main() {
15522
15523 /* The GNU C library defines this for functions which it implements
15524     to always fail with ENOSYS.  Some functions are actually named
15525     something starting with __ and the normal name is an alias.  */
15526 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
15527 choke me
15528 #else
15529 f = cthread_fork;
15530 #endif
15531
15532 ; return 0; }
15533 EOF
15534 if { (eval echo configure:15535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15535   rm -rf conftest*
15536   eval "ac_cv_func_cthread_fork=yes"
15537 else
15538   echo "configure: failed program was:" >&5
15539   cat conftest.$ac_ext >&5
15540   rm -rf conftest*
15541   eval "ac_cv_func_cthread_fork=no"
15542 fi
15543 rm -f conftest*
15544 fi
15545
15546 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
15547   echo "$ac_t""yes" 1>&6
15548   ol_link_threads=yes
15549 else
15550   echo "$ac_t""no" 1>&6
15551 fi
15552
15553                 LIBS="$save_LIBS"
15554
15555                 if test $ol_link_threads = yes ; then
15556                         LTHREAD_LIBS="-lthreads"
15557                         ol_link_threads=mach
15558                         ol_with_threads=found
15559                 else
15560                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
15561                 fi
15562
15563         elif test $ol_with_threads = mach ; then
15564                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
15565         fi
15566
15567         if test $ol_link_threads = mach ; then
15568                 cat >> confdefs.h <<\EOF
15569 #define HAVE_MACH_CTHREADS 1
15570 EOF
15571
15572         elif test $ol_with_threads = found ; then
15573                 { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
15574         fi
15575 fi
15576
15577 if test $ol_with_threads = auto -o $ol_with_threads = yes \
15578         -o $ol_with_threads = pth ; then
15579
15580         for ac_hdr in pth.h
15581 do
15582 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15583 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15584 echo "configure:15585: checking for $ac_hdr" >&5
15585 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15586   echo $ac_n "(cached) $ac_c" 1>&6
15587 else
15588   cat > conftest.$ac_ext <<EOF
15589 #line 15590 "configure"
15590 #include "confdefs.h"
15591 #include <$ac_hdr>
15592 EOF
15593 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15594 { (eval echo configure:15595: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15595 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15596 if test -z "$ac_err"; then
15597   rm -rf conftest*
15598   eval "ac_cv_header_$ac_safe=yes"
15599 else
15600   echo "$ac_err" >&5
15601   echo "configure: failed program was:" >&5
15602   cat conftest.$ac_ext >&5
15603   rm -rf conftest*
15604   eval "ac_cv_header_$ac_safe=no"
15605 fi
15606 rm -f conftest*
15607 fi
15608 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15609   echo "$ac_t""yes" 1>&6
15610     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15611   cat >> confdefs.h <<EOF
15612 #define $ac_tr_hdr 1
15613 EOF
15614  
15615 else
15616   echo "$ac_t""no" 1>&6
15617 fi
15618 done
15619
15620
15621         if test $ac_cv_header_pth_h = yes ; then
15622                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
15623 echo "configure:15624: checking for pth_version in -lpth" >&5
15624 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
15625 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15626   echo $ac_n "(cached) $ac_c" 1>&6
15627 else
15628   ac_save_LIBS="$LIBS"
15629 LIBS="-lpth  $LIBS"
15630 cat > conftest.$ac_ext <<EOF
15631 #line 15632 "configure"
15632 #include "confdefs.h"
15633 /* Override any gcc2 internal prototype to avoid an error.  */
15634 /* We use char because int might match the return type of a gcc2
15635     builtin and then its argument prototype would still apply.  */
15636 char pth_version();
15637
15638 int main() {
15639 pth_version()
15640 ; return 0; }
15641 EOF
15642 if { (eval echo configure:15643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15643   rm -rf conftest*
15644   eval "ac_cv_lib_$ac_lib_var=yes"
15645 else
15646   echo "configure: failed program was:" >&5
15647   cat conftest.$ac_ext >&5
15648   rm -rf conftest*
15649   eval "ac_cv_lib_$ac_lib_var=no"
15650 fi
15651 rm -f conftest*
15652 LIBS="$ac_save_LIBS"
15653
15654 fi
15655 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15656   echo "$ac_t""yes" 1>&6
15657   have_pth=yes
15658 else
15659   echo "$ac_t""no" 1>&6
15660 have_pth=no
15661 fi
15662
15663
15664                 if test $have_pth = yes ; then
15665                         cat >> confdefs.h <<\EOF
15666 #define HAVE_GNU_PTH 1
15667 EOF
15668
15669                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
15670                         ol_link_threads=pth
15671                         ol_with_threads=found
15672
15673                         if test $ol_with_yielding_select = auto ; then
15674                                 ol_with_yielding_select=yes
15675                         fi
15676                 fi
15677         fi
15678 fi
15679
15680 if test $ol_with_threads = auto -o $ol_with_threads = yes \
15681         -o $ol_with_threads = lwp ; then
15682
15683                 for ac_hdr in thread.h synch.h
15684 do
15685 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15686 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15687 echo "configure:15688: checking for $ac_hdr" >&5
15688 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15689   echo $ac_n "(cached) $ac_c" 1>&6
15690 else
15691   cat > conftest.$ac_ext <<EOF
15692 #line 15693 "configure"
15693 #include "confdefs.h"
15694 #include <$ac_hdr>
15695 EOF
15696 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15697 { (eval echo configure:15698: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15698 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15699 if test -z "$ac_err"; then
15700   rm -rf conftest*
15701   eval "ac_cv_header_$ac_safe=yes"
15702 else
15703   echo "$ac_err" >&5
15704   echo "configure: failed program was:" >&5
15705   cat conftest.$ac_ext >&5
15706   rm -rf conftest*
15707   eval "ac_cv_header_$ac_safe=no"
15708 fi
15709 rm -f conftest*
15710 fi
15711 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15712   echo "$ac_t""yes" 1>&6
15713     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15714   cat >> confdefs.h <<EOF
15715 #define $ac_tr_hdr 1
15716 EOF
15717  
15718 else
15719   echo "$ac_t""no" 1>&6
15720 fi
15721 done
15722
15723         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
15724                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
15725 echo "configure:15726: checking for thr_create in -lthread" >&5
15726 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
15727 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15728   echo $ac_n "(cached) $ac_c" 1>&6
15729 else
15730   ac_save_LIBS="$LIBS"
15731 LIBS="-lthread  $LIBS"
15732 cat > conftest.$ac_ext <<EOF
15733 #line 15734 "configure"
15734 #include "confdefs.h"
15735 /* Override any gcc2 internal prototype to avoid an error.  */
15736 /* We use char because int might match the return type of a gcc2
15737     builtin and then its argument prototype would still apply.  */
15738 char thr_create();
15739
15740 int main() {
15741 thr_create()
15742 ; return 0; }
15743 EOF
15744 if { (eval echo configure:15745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15745   rm -rf conftest*
15746   eval "ac_cv_lib_$ac_lib_var=yes"
15747 else
15748   echo "configure: failed program was:" >&5
15749   cat conftest.$ac_ext >&5
15750   rm -rf conftest*
15751   eval "ac_cv_lib_$ac_lib_var=no"
15752 fi
15753 rm -f conftest*
15754 LIBS="$ac_save_LIBS"
15755
15756 fi
15757 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15758   echo "$ac_t""yes" 1>&6
15759   have_thr=yes
15760 else
15761   echo "$ac_t""no" 1>&6
15762 have_thr=no
15763 fi
15764
15765
15766                 if test $have_thr = yes ; then
15767                         cat >> confdefs.h <<\EOF
15768 #define HAVE_THR 1
15769 EOF
15770
15771                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
15772                         ol_link_threads=thr
15773
15774                         if test $ol_with_yielding_select = auto ; then
15775                                 ol_with_yielding_select=yes
15776                         fi
15777
15778                                                 for ac_func in \
15779                                 thr_setconcurrency \
15780                                 thr_getconcurrency \
15781                         
15782 do
15783 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15784 echo "configure:15785: checking for $ac_func" >&5
15785 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15786   echo $ac_n "(cached) $ac_c" 1>&6
15787 else
15788   cat > conftest.$ac_ext <<EOF
15789 #line 15790 "configure"
15790 #include "confdefs.h"
15791 /* System header to define __stub macros and hopefully few prototypes,
15792     which can conflict with char $ac_func(); below.  */
15793 #include <assert.h>
15794 /* Override any gcc2 internal prototype to avoid an error.  */
15795 /* We use char because int might match the return type of a gcc2
15796     builtin and then its argument prototype would still apply.  */
15797 char $ac_func();
15798 char (*f)();
15799
15800 int main() {
15801
15802 /* The GNU C library defines this for functions which it implements
15803     to always fail with ENOSYS.  Some functions are actually named
15804     something starting with __ and the normal name is an alias.  */
15805 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15806 choke me
15807 #else
15808 f = $ac_func;
15809 #endif
15810
15811 ; return 0; }
15812 EOF
15813 if { (eval echo configure:15814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15814   rm -rf conftest*
15815   eval "ac_cv_func_$ac_func=yes"
15816 else
15817   echo "configure: failed program was:" >&5
15818   cat conftest.$ac_ext >&5
15819   rm -rf conftest*
15820   eval "ac_cv_func_$ac_func=no"
15821 fi
15822 rm -f conftest*
15823 fi
15824
15825 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15826   echo "$ac_t""yes" 1>&6
15827     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15828   cat >> confdefs.h <<EOF
15829 #define $ac_tr_func 1
15830 EOF
15831  
15832 else
15833   echo "$ac_t""no" 1>&6
15834 fi
15835 done
15836
15837                 fi
15838         fi
15839
15840                 for ac_hdr in lwp/lwp.h
15841 do
15842 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15843 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15844 echo "configure:15845: checking for $ac_hdr" >&5
15845 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15846   echo $ac_n "(cached) $ac_c" 1>&6
15847 else
15848   cat > conftest.$ac_ext <<EOF
15849 #line 15850 "configure"
15850 #include "confdefs.h"
15851 #include <$ac_hdr>
15852 EOF
15853 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15854 { (eval echo configure:15855: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15855 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15856 if test -z "$ac_err"; then
15857   rm -rf conftest*
15858   eval "ac_cv_header_$ac_safe=yes"
15859 else
15860   echo "$ac_err" >&5
15861   echo "configure: failed program was:" >&5
15862   cat conftest.$ac_ext >&5
15863   rm -rf conftest*
15864   eval "ac_cv_header_$ac_safe=no"
15865 fi
15866 rm -f conftest*
15867 fi
15868 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15869   echo "$ac_t""yes" 1>&6
15870     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15871   cat >> confdefs.h <<EOF
15872 #define $ac_tr_hdr 1
15873 EOF
15874  
15875 else
15876   echo "$ac_t""no" 1>&6
15877 fi
15878 done
15879
15880         if test $ac_cv_header_lwp_lwp_h = yes ; then
15881                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
15882 echo "configure:15883: checking for lwp_create in -llwp" >&5
15883 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
15884 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15885   echo $ac_n "(cached) $ac_c" 1>&6
15886 else
15887   ac_save_LIBS="$LIBS"
15888 LIBS="-llwp  $LIBS"
15889 cat > conftest.$ac_ext <<EOF
15890 #line 15891 "configure"
15891 #include "confdefs.h"
15892 /* Override any gcc2 internal prototype to avoid an error.  */
15893 /* We use char because int might match the return type of a gcc2
15894     builtin and then its argument prototype would still apply.  */
15895 char lwp_create();
15896
15897 int main() {
15898 lwp_create()
15899 ; return 0; }
15900 EOF
15901 if { (eval echo configure:15902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15902   rm -rf conftest*
15903   eval "ac_cv_lib_$ac_lib_var=yes"
15904 else
15905   echo "configure: failed program was:" >&5
15906   cat conftest.$ac_ext >&5
15907   rm -rf conftest*
15908   eval "ac_cv_lib_$ac_lib_var=no"
15909 fi
15910 rm -f conftest*
15911 LIBS="$ac_save_LIBS"
15912
15913 fi
15914 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15915   echo "$ac_t""yes" 1>&6
15916   have_lwp=yes
15917 else
15918   echo "$ac_t""no" 1>&6
15919 have_lwp=no
15920 fi
15921
15922
15923                 if test $have_lwp = yes ; then
15924                         cat >> confdefs.h <<\EOF
15925 #define HAVE_LWP 1
15926 EOF
15927
15928                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
15929                         ol_link_threads=lwp
15930
15931                         if test $ol_with_yielding_select = auto ; then
15932                                 ol_with_yielding_select=no
15933                         fi
15934                 fi
15935         fi
15936 fi
15937
15938 if test $ol_with_yielding_select = yes ; then
15939         cat >> confdefs.h <<\EOF
15940 #define HAVE_YIELDING_SELECT 1
15941 EOF
15942
15943 fi
15944
15945 if test $ol_with_threads = manual ; then
15946                 ol_link_threads=yes
15947
15948         echo "configure: warning: thread defines and link options must be set manually" 1>&2
15949
15950         for ac_hdr in pthread.h sched.h
15951 do
15952 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15953 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15954 echo "configure:15955: checking for $ac_hdr" >&5
15955 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15956   echo $ac_n "(cached) $ac_c" 1>&6
15957 else
15958   cat > conftest.$ac_ext <<EOF
15959 #line 15960 "configure"
15960 #include "confdefs.h"
15961 #include <$ac_hdr>
15962 EOF
15963 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15964 { (eval echo configure:15965: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15965 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15966 if test -z "$ac_err"; then
15967   rm -rf conftest*
15968   eval "ac_cv_header_$ac_safe=yes"
15969 else
15970   echo "$ac_err" >&5
15971   echo "configure: failed program was:" >&5
15972   cat conftest.$ac_ext >&5
15973   rm -rf conftest*
15974   eval "ac_cv_header_$ac_safe=no"
15975 fi
15976 rm -f conftest*
15977 fi
15978 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15979   echo "$ac_t""yes" 1>&6
15980     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15981   cat >> confdefs.h <<EOF
15982 #define $ac_tr_hdr 1
15983 EOF
15984  
15985 else
15986   echo "$ac_t""no" 1>&6
15987 fi
15988 done
15989
15990         for ac_func in sched_yield pthread_yield
15991 do
15992 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15993 echo "configure:15994: checking for $ac_func" >&5
15994 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15995   echo $ac_n "(cached) $ac_c" 1>&6
15996 else
15997   cat > conftest.$ac_ext <<EOF
15998 #line 15999 "configure"
15999 #include "confdefs.h"
16000 /* System header to define __stub macros and hopefully few prototypes,
16001     which can conflict with char $ac_func(); below.  */
16002 #include <assert.h>
16003 /* Override any gcc2 internal prototype to avoid an error.  */
16004 /* We use char because int might match the return type of a gcc2
16005     builtin and then its argument prototype would still apply.  */
16006 char $ac_func();
16007 char (*f)();
16008
16009 int main() {
16010
16011 /* The GNU C library defines this for functions which it implements
16012     to always fail with ENOSYS.  Some functions are actually named
16013     something starting with __ and the normal name is an alias.  */
16014 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16015 choke me
16016 #else
16017 f = $ac_func;
16018 #endif
16019
16020 ; return 0; }
16021 EOF
16022 if { (eval echo configure:16023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16023   rm -rf conftest*
16024   eval "ac_cv_func_$ac_func=yes"
16025 else
16026   echo "configure: failed program was:" >&5
16027   cat conftest.$ac_ext >&5
16028   rm -rf conftest*
16029   eval "ac_cv_func_$ac_func=no"
16030 fi
16031 rm -f conftest*
16032 fi
16033
16034 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16035   echo "$ac_t""yes" 1>&6
16036     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16037   cat >> confdefs.h <<EOF
16038 #define $ac_tr_func 1
16039 EOF
16040  
16041 else
16042   echo "$ac_t""no" 1>&6
16043 fi
16044 done
16045
16046         
16047         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
16048 echo "configure:16049: checking for LinuxThreads pthread.h" >&5
16049 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
16050   echo $ac_n "(cached) $ac_c" 1>&6
16051 else
16052   cat > conftest.$ac_ext <<EOF
16053 #line 16054 "configure"
16054 #include "confdefs.h"
16055 #include <pthread.h>
16056 EOF
16057 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16058   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
16059   rm -rf conftest*
16060   ol_cv_header_linux_threads=yes
16061 else
16062   rm -rf conftest*
16063   ol_cv_header_linux_threads=no
16064 fi
16065 rm -f conftest*
16066
16067                 
16068 fi
16069
16070 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
16071         if test $ol_cv_header_linux_threads = yes; then
16072                 cat >> confdefs.h <<\EOF
16073 #define HAVE_LINUX_THREADS 1
16074 EOF
16075
16076         fi
16077
16078
16079         for ac_hdr in mach/cthreads.h
16080 do
16081 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16082 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16083 echo "configure:16084: checking for $ac_hdr" >&5
16084 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16085   echo $ac_n "(cached) $ac_c" 1>&6
16086 else
16087   cat > conftest.$ac_ext <<EOF
16088 #line 16089 "configure"
16089 #include "confdefs.h"
16090 #include <$ac_hdr>
16091 EOF
16092 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16093 { (eval echo configure:16094: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16094 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16095 if test -z "$ac_err"; then
16096   rm -rf conftest*
16097   eval "ac_cv_header_$ac_safe=yes"
16098 else
16099   echo "$ac_err" >&5
16100   echo "configure: failed program was:" >&5
16101   cat conftest.$ac_ext >&5
16102   rm -rf conftest*
16103   eval "ac_cv_header_$ac_safe=no"
16104 fi
16105 rm -f conftest*
16106 fi
16107 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16108   echo "$ac_t""yes" 1>&6
16109     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16110   cat >> confdefs.h <<EOF
16111 #define $ac_tr_hdr 1
16112 EOF
16113  
16114 else
16115   echo "$ac_t""no" 1>&6
16116 fi
16117 done
16118
16119         for ac_hdr in lwp/lwp.h
16120 do
16121 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16122 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16123 echo "configure:16124: checking for $ac_hdr" >&5
16124 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16125   echo $ac_n "(cached) $ac_c" 1>&6
16126 else
16127   cat > conftest.$ac_ext <<EOF
16128 #line 16129 "configure"
16129 #include "confdefs.h"
16130 #include <$ac_hdr>
16131 EOF
16132 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16133 { (eval echo configure:16134: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16134 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16135 if test -z "$ac_err"; then
16136   rm -rf conftest*
16137   eval "ac_cv_header_$ac_safe=yes"
16138 else
16139   echo "$ac_err" >&5
16140   echo "configure: failed program was:" >&5
16141   cat conftest.$ac_ext >&5
16142   rm -rf conftest*
16143   eval "ac_cv_header_$ac_safe=no"
16144 fi
16145 rm -f conftest*
16146 fi
16147 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16148   echo "$ac_t""yes" 1>&6
16149     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16150   cat >> confdefs.h <<EOF
16151 #define $ac_tr_hdr 1
16152 EOF
16153  
16154 else
16155   echo "$ac_t""no" 1>&6
16156 fi
16157 done
16158
16159         for ac_hdr in thread.h synch.h
16160 do
16161 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16162 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16163 echo "configure:16164: checking for $ac_hdr" >&5
16164 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16165   echo $ac_n "(cached) $ac_c" 1>&6
16166 else
16167   cat > conftest.$ac_ext <<EOF
16168 #line 16169 "configure"
16169 #include "confdefs.h"
16170 #include <$ac_hdr>
16171 EOF
16172 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16173 { (eval echo configure:16174: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16174 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16175 if test -z "$ac_err"; then
16176   rm -rf conftest*
16177   eval "ac_cv_header_$ac_safe=yes"
16178 else
16179   echo "$ac_err" >&5
16180   echo "configure: failed program was:" >&5
16181   cat conftest.$ac_ext >&5
16182   rm -rf conftest*
16183   eval "ac_cv_header_$ac_safe=no"
16184 fi
16185 rm -f conftest*
16186 fi
16187 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16188   echo "$ac_t""yes" 1>&6
16189     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16190   cat >> confdefs.h <<EOF
16191 #define $ac_tr_hdr 1
16192 EOF
16193  
16194 else
16195   echo "$ac_t""no" 1>&6
16196 fi
16197 done
16198
16199 fi
16200
16201 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
16202                         cat >> confdefs.h <<\EOF
16203 #define REENTRANT 1
16204 EOF
16205
16206         cat >> confdefs.h <<\EOF
16207 #define _REENTRANT 1
16208 EOF
16209
16210         cat >> confdefs.h <<\EOF
16211 #define THREAD_SAFE 1
16212 EOF
16213
16214         cat >> confdefs.h <<\EOF
16215 #define _THREAD_SAFE 1
16216 EOF
16217
16218         cat >> confdefs.h <<\EOF
16219 #define THREADSAFE 1
16220 EOF
16221
16222         cat >> confdefs.h <<\EOF
16223 #define _THREADSAFE 1
16224 EOF
16225
16226         cat >> confdefs.h <<\EOF
16227 #define _SGI_MP_SOURCE 1
16228 EOF
16229
16230
16231                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
16232 echo "configure:16233: checking for thread specific errno" >&5
16233 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
16234   echo $ac_n "(cached) $ac_c" 1>&6
16235 else
16236   
16237                 cat > conftest.$ac_ext <<EOF
16238 #line 16239 "configure"
16239 #include "confdefs.h"
16240 #include <errno.h>
16241 int main() {
16242 errno = 0;
16243 ; return 0; }
16244 EOF
16245 if { (eval echo configure:16246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16246   rm -rf conftest*
16247   ol_cv_errno_thread_specific=yes
16248 else
16249   echo "configure: failed program was:" >&5
16250   cat conftest.$ac_ext >&5
16251   rm -rf conftest*
16252   ol_cv_errno_thread_specific=no
16253 fi
16254 rm -f conftest*
16255         
16256 fi
16257
16258 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
16259
16260                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
16261 echo "configure:16262: checking for thread specific h_errno" >&5
16262 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
16263   echo $ac_n "(cached) $ac_c" 1>&6
16264 else
16265   
16266                 cat > conftest.$ac_ext <<EOF
16267 #line 16268 "configure"
16268 #include "confdefs.h"
16269 #include <netdb.h>
16270 int main() {
16271 h_errno = 0;
16272 ; return 0; }
16273 EOF
16274 if { (eval echo configure:16275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16275   rm -rf conftest*
16276   ol_cv_h_errno_thread_specific=yes
16277 else
16278   echo "configure: failed program was:" >&5
16279   cat conftest.$ac_ext >&5
16280   rm -rf conftest*
16281   ol_cv_h_errno_thread_specific=no
16282 fi
16283 rm -f conftest*
16284         
16285 fi
16286
16287 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
16288
16289         if test $ol_cv_errno_thread_specific != yes \
16290                 -o $ol_cv_h_errno_thread_specific != yes ; then
16291                 LIBS="$LTHREAD_LIBS $LIBS"
16292                 LTHREAD_LIBS=""
16293         fi
16294
16295 fi  
16296
16297 if test $ol_link_threads = no ; then
16298         if test $ol_with_threads = yes ; then
16299                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
16300         fi
16301
16302         if test $ol_with_threads = auto ; then
16303                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
16304                 ol_with_threads=no
16305         fi
16306
16307         cat >> confdefs.h <<\EOF
16308 #define NO_THREADS 1
16309 EOF
16310
16311         LTHREAD_LIBS=""
16312 fi
16313
16314 if test $ol_link_threads != no ; then
16315         cat >> confdefs.h <<\EOF
16316 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
16317 EOF
16318
16319 fi
16320
16321 for ac_func in \
16322         ctime_r                 \
16323         gethostbyname_r gethostbyaddr_r \
16324
16325 do
16326 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16327 echo "configure:16328: checking for $ac_func" >&5
16328 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16329   echo $ac_n "(cached) $ac_c" 1>&6
16330 else
16331   cat > conftest.$ac_ext <<EOF
16332 #line 16333 "configure"
16333 #include "confdefs.h"
16334 /* System header to define __stub macros and hopefully few prototypes,
16335     which can conflict with char $ac_func(); below.  */
16336 #include <assert.h>
16337 /* Override any gcc2 internal prototype to avoid an error.  */
16338 /* We use char because int might match the return type of a gcc2
16339     builtin and then its argument prototype would still apply.  */
16340 char $ac_func();
16341 char (*f)();
16342
16343 int main() {
16344
16345 /* The GNU C library defines this for functions which it implements
16346     to always fail with ENOSYS.  Some functions are actually named
16347     something starting with __ and the normal name is an alias.  */
16348 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16349 choke me
16350 #else
16351 f = $ac_func;
16352 #endif
16353
16354 ; return 0; }
16355 EOF
16356 if { (eval echo configure:16357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16357   rm -rf conftest*
16358   eval "ac_cv_func_$ac_func=yes"
16359 else
16360   echo "configure: failed program was:" >&5
16361   cat conftest.$ac_ext >&5
16362   rm -rf conftest*
16363   eval "ac_cv_func_$ac_func=no"
16364 fi
16365 rm -f conftest*
16366 fi
16367
16368 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16369   echo "$ac_t""yes" 1>&6
16370     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16371   cat >> confdefs.h <<EOF
16372 #define $ac_tr_func 1
16373 EOF
16374  
16375 else
16376   echo "$ac_t""no" 1>&6
16377 fi
16378 done
16379
16380
16381 if test "$ac_cv_func_ctime_r" = no ; then
16382         ol_cv_func_ctime_r_nargs=0
16383 else
16384         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
16385 echo "configure:16386: checking number of arguments of ctime_r" >&5
16386 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
16387   echo $ac_n "(cached) $ac_c" 1>&6
16388 else
16389   cat > conftest.$ac_ext <<EOF
16390 #line 16391 "configure"
16391 #include "confdefs.h"
16392 #include <time.h>
16393 int main() {
16394 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
16395 ; return 0; }
16396 EOF
16397 if { (eval echo configure:16398: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16398   rm -rf conftest*
16399   ol_cv_func_ctime_r_nargs3=yes
16400 else
16401   echo "configure: failed program was:" >&5
16402   cat conftest.$ac_ext >&5
16403   rm -rf conftest*
16404   ol_cv_func_ctime_r_nargs3=no
16405 fi
16406 rm -f conftest*
16407
16408         cat > conftest.$ac_ext <<EOF
16409 #line 16410 "configure"
16410 #include "confdefs.h"
16411 #include <time.h>
16412 int main() {
16413 time_t ti; char *buffer; ctime_r(&ti,buffer);
16414 ; return 0; }
16415 EOF
16416 if { (eval echo configure:16417: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16417   rm -rf conftest*
16418   ol_cv_func_ctime_r_nargs2=yes
16419 else
16420   echo "configure: failed program was:" >&5
16421   cat conftest.$ac_ext >&5
16422   rm -rf conftest*
16423   ol_cv_func_ctime_r_nargs2=no
16424 fi
16425 rm -f conftest*
16426
16427         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
16428                 $ol_cv_func_ctime_r_nargs2 = no ; then
16429
16430                 ol_cv_func_ctime_r_nargs=3
16431
16432         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
16433                 $ol_cv_func_ctime_r_nargs2 = yes ; then
16434
16435                 ol_cv_func_ctime_r_nargs=2
16436
16437         else
16438                 ol_cv_func_ctime_r_nargs=0
16439         fi
16440   
16441 fi
16442
16443 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
16444
16445   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
16446         cat >> confdefs.h <<EOF
16447 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
16448 EOF
16449
16450   fi
16451
16452 fi
16453
16454 if test "$ac_cv_func_gethostbyname_r" = yes ; then
16455         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
16456 echo "configure:16457: checking number of arguments of gethostbyname_r" >&5
16457 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
16458   echo $ac_n "(cached) $ac_c" 1>&6
16459 else
16460   cat > conftest.$ac_ext <<EOF
16461 #line 16462 "configure"
16462 #include "confdefs.h"
16463 #include <sys/types.h>
16464 #include <sys/socket.h>
16465 #include <netinet/in.h>
16466 #include <netdb.h>
16467 #define BUFSIZE (sizeof(struct hostent)+10)
16468 int main() {
16469 struct hostent hent; char buffer[BUFSIZE];
16470                 int bufsize=BUFSIZE;int h_errno;
16471                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
16472                         buffer, bufsize, &h_errno);
16473 ; return 0; }
16474 EOF
16475 if { (eval echo configure:16476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16476   rm -rf conftest*
16477   ol_cv_func_gethostbyname_r_nargs5=yes
16478 else
16479   echo "configure: failed program was:" >&5
16480   cat conftest.$ac_ext >&5
16481   rm -rf conftest*
16482   ol_cv_func_gethostbyname_r_nargs5=no
16483 fi
16484 rm -f conftest*
16485
16486         cat > conftest.$ac_ext <<EOF
16487 #line 16488 "configure"
16488 #include "confdefs.h"
16489 #include <sys/types.h>
16490 #include <sys/socket.h>
16491 #include <netinet/in.h>
16492 #include <netdb.h>
16493 #define BUFSIZE (sizeof(struct hostent)+10)
16494 int main() {
16495 struct hostent hent;struct hostent *rhent;
16496                 char buffer[BUFSIZE];
16497                 int bufsize=BUFSIZE;int h_errno;
16498                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
16499                         &rhent, &h_errno);
16500 ; return 0; }
16501 EOF
16502 if { (eval echo configure:16503: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16503   rm -rf conftest*
16504   ol_cv_func_gethostbyname_r_nargs6=yes
16505 else
16506   echo "configure: failed program was:" >&5
16507   cat conftest.$ac_ext >&5
16508   rm -rf conftest*
16509   ol_cv_func_gethostbyname_r_nargs6=no
16510 fi
16511 rm -f conftest*
16512
16513         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
16514                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
16515
16516                 ol_cv_func_gethostbyname_r_nargs=5
16517
16518         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
16519                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
16520
16521                 ol_cv_func_gethostbyname_r_nargs=6
16522
16523         else
16524                 ol_cv_func_gethostbyname_r_nargs=0
16525         fi
16526   
16527 fi
16528
16529 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
16530   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
16531         cat >> confdefs.h <<EOF
16532 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
16533 EOF
16534
16535   fi
16536
16537 else
16538         ol_cv_func_gethostbyname_r_nargs=0
16539 fi
16540  
16541 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
16542         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
16543 echo "configure:16544: checking number of arguments of gethostbyaddr_r" >&5
16544 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
16545   echo $ac_n "(cached) $ac_c" 1>&6
16546 else
16547   cat > conftest.$ac_ext <<EOF
16548 #line 16549 "configure"
16549 #include "confdefs.h"
16550 #include <sys/types.h>
16551 #include <sys/socket.h>
16552 #include <netinet/in.h>
16553 #include <netdb.h>
16554 #define BUFSIZE (sizeof(struct hostent)+10)
16555 int main() {
16556 struct hostent hent; char buffer[BUFSIZE]; 
16557             struct in_addr add;
16558             size_t alen=sizeof(struct in_addr);
16559             int bufsize=BUFSIZE;int h_errno;
16560                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
16561                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
16562 ; return 0; }
16563 EOF
16564 if { (eval echo configure:16565: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16565   rm -rf conftest*
16566   ol_cv_func_gethostbyaddr_r_nargs7=yes
16567 else
16568   echo "configure: failed program was:" >&5
16569   cat conftest.$ac_ext >&5
16570   rm -rf conftest*
16571   ol_cv_func_gethostbyaddr_r_nargs7=no
16572 fi
16573 rm -f conftest*
16574
16575         cat > conftest.$ac_ext <<EOF
16576 #line 16577 "configure"
16577 #include "confdefs.h"
16578 #include <sys/types.h>
16579 #include <sys/socket.h>
16580 #include <netinet/in.h>
16581 #include <netdb.h>
16582 #define BUFSIZE (sizeof(struct hostent)+10)
16583 int main() {
16584 struct hostent hent;
16585                 struct hostent *rhent; char buffer[BUFSIZE]; 
16586                 struct in_addr add;
16587                 size_t alen=sizeof(struct in_addr);
16588                 int bufsize=BUFSIZE;int h_errno;
16589                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
16590                         alen, AF_INET, &hent, buffer, bufsize, 
16591                         &rhent, &h_errno);
16592 ; return 0; }
16593 EOF
16594 if { (eval echo configure:16595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16595   rm -rf conftest*
16596   ol_cv_func_gethostbyaddr_r_nargs8=yes
16597 else
16598   echo "configure: failed program was:" >&5
16599   cat conftest.$ac_ext >&5
16600   rm -rf conftest*
16601   ol_cv_func_gethostbyaddr_r_nargs8=no
16602 fi
16603 rm -f conftest*
16604
16605         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
16606                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
16607
16608                 ol_cv_func_gethostbyaddr_r_nargs=7
16609
16610         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
16611                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
16612
16613                 ol_cv_func_gethostbyaddr_r_nargs=8
16614
16615         else
16616                 ol_cv_func_gethostbyaddr_r_nargs=0
16617         fi
16618   
16619 fi
16620
16621 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
16622   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
16623     cat >> confdefs.h <<EOF
16624 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
16625 EOF
16626
16627   fi
16628
16629 else
16630         ol_cv_func_gethostbyaddr_r_nargs=0
16631 fi
16632
16633 ol_link_ldbm=no 
16634
16635 if test $ol_with_ldbm_api = auto \
16636         -o $ol_with_ldbm_api = berkeley \
16637         -o $ol_with_ldbm_api = bcompat ; then
16638
16639         if test $ol_with_ldbm_api = bcompat; then \
16640                 for ac_hdr in db_185.h db.h
16641 do
16642 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16643 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16644 echo "configure:16645: checking for $ac_hdr" >&5
16645 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16646   echo $ac_n "(cached) $ac_c" 1>&6
16647 else
16648   cat > conftest.$ac_ext <<EOF
16649 #line 16650 "configure"
16650 #include "confdefs.h"
16651 #include <$ac_hdr>
16652 EOF
16653 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16654 { (eval echo configure:16655: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16655 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16656 if test -z "$ac_err"; then
16657   rm -rf conftest*
16658   eval "ac_cv_header_$ac_safe=yes"
16659 else
16660   echo "$ac_err" >&5
16661   echo "configure: failed program was:" >&5
16662   cat conftest.$ac_ext >&5
16663   rm -rf conftest*
16664   eval "ac_cv_header_$ac_safe=no"
16665 fi
16666 rm -f conftest*
16667 fi
16668 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16669   echo "$ac_t""yes" 1>&6
16670     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16671   cat >> confdefs.h <<EOF
16672 #define $ac_tr_hdr 1
16673 EOF
16674  
16675 else
16676   echo "$ac_t""no" 1>&6
16677 fi
16678 done
16679
16680 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
16681         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
16682 echo "configure:16683: checking if Berkeley DB header compatibility" >&5
16683 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
16684   echo $ac_n "(cached) $ac_c" 1>&6
16685 else
16686   
16687                 cat > conftest.$ac_ext <<EOF
16688 #line 16689 "configure"
16689 #include "confdefs.h"
16690
16691 #if HAVE_DB_185_H
16692 #       include <db_185.h>
16693 #else
16694 #       include <db.h>
16695 #endif
16696
16697  /* this check could be improved */
16698 #ifndef DB_VERSION_MAJOR
16699 #       define DB_VERSION_MAJOR 1
16700 #endif
16701
16702 #if DB_VERSION_MAJOR == 1 
16703         __db_version_1
16704 #endif
16705
16706 EOF
16707 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16708   egrep "__db_version_1" >/dev/null 2>&1; then
16709   rm -rf conftest*
16710   ol_cv_header_db1=yes
16711 else
16712   rm -rf conftest*
16713   ol_cv_header_db1=no
16714 fi
16715 rm -f conftest*
16716
16717 fi
16718
16719 echo "$ac_t""$ol_cv_header_db1" 1>&6
16720
16721         if test $ol_cv_header_db1 = yes ; then
16722                 ol_cv_lib_db=no
16723 if test $ol_cv_lib_db = no ; then
16724         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
16725 echo "configure:16726: checking for Berkeley DB link (default)" >&5
16726 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
16727   echo $ac_n "(cached) $ac_c" 1>&6
16728 else
16729   
16730         ol_DB_LIB=
16731         ol_LIBS=$LIBS
16732         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16733
16734         cat > conftest.$ac_ext <<EOF
16735 #line 16736 "configure"
16736 #include "confdefs.h"
16737
16738 #ifdef HAVE_DB_185_H
16739 # include <db_185.h>
16740 #else
16741 # include <db.h>
16742 #endif
16743
16744 #ifndef DB_VERSION_MAJOR
16745 # define DB_VERSION_MAJOR 1
16746 #endif
16747
16748 #ifndef NULL
16749 #define NULL ((void*)0)
16750 #endif
16751
16752 int main() {
16753
16754 #if DB_VERSION_MAJOR > 1
16755         {
16756                 char *version;
16757                 int major, minor, patch;
16758
16759                 version = db_version( &major, &minor, &patch );
16760
16761                 if( major != DB_VERSION_MAJOR ||
16762                         minor < DB_VERSION_MINOR )
16763                 {
16764                         printf("Berkeley DB version mismatch\n"
16765                                 "\texpected: %s\n\tgot: %s\n",
16766                                 DB_VERSION_STRING, version);
16767                         return 1;
16768                 }
16769         }
16770 #endif
16771
16772 #if DB_VERSION_MAJOR > 2
16773         db_env_create( NULL, 0 );
16774 #elif DB_VERSION_MAJOR > 1
16775         db_appexit( NULL );
16776 #else
16777         (void) dbopen( NULL, 0, 0, 0, NULL);
16778 #endif
16779
16780 ; return 0; }
16781 EOF
16782 if { (eval echo configure:16783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16783   rm -rf conftest*
16784   ol_cv_db_none=yes
16785 else
16786   echo "configure: failed program was:" >&5
16787   cat conftest.$ac_ext >&5
16788   rm -rf conftest*
16789   ol_cv_db_none=no
16790 fi
16791 rm -f conftest*
16792
16793         LIBS="$ol_LIBS"
16794
16795 fi
16796
16797 echo "$ac_t""$ol_cv_db_none" 1>&6
16798
16799         if test $ol_cv_db_none = yes ; then
16800                 ol_cv_lib_db=yes
16801         fi
16802 fi
16803
16804 if test $ol_cv_lib_db = no ; then
16805         echo $ac_n "checking for Berkeley DB link (-ldb41)""... $ac_c" 1>&6
16806 echo "configure:16807: checking for Berkeley DB link (-ldb41)" >&5
16807 if eval "test \"\${ol_cv_db_db41+set}\" = set"; then
16808   echo $ac_n "(cached) $ac_c" 1>&6
16809 else
16810   
16811         ol_DB_LIB=-ldb41
16812         ol_LIBS=$LIBS
16813         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16814
16815         cat > conftest.$ac_ext <<EOF
16816 #line 16817 "configure"
16817 #include "confdefs.h"
16818
16819 #ifdef HAVE_DB_185_H
16820 # include <db_185.h>
16821 #else
16822 # include <db.h>
16823 #endif
16824
16825 #ifndef DB_VERSION_MAJOR
16826 # define DB_VERSION_MAJOR 1
16827 #endif
16828
16829 #ifndef NULL
16830 #define NULL ((void*)0)
16831 #endif
16832
16833 int main() {
16834
16835 #if DB_VERSION_MAJOR > 1
16836         {
16837                 char *version;
16838                 int major, minor, patch;
16839
16840                 version = db_version( &major, &minor, &patch );
16841
16842                 if( major != DB_VERSION_MAJOR ||
16843                         minor < DB_VERSION_MINOR )
16844                 {
16845                         printf("Berkeley DB version mismatch\n"
16846                                 "\texpected: %s\n\tgot: %s\n",
16847                                 DB_VERSION_STRING, version);
16848                         return 1;
16849                 }
16850         }
16851 #endif
16852
16853 #if DB_VERSION_MAJOR > 2
16854         db_env_create( NULL, 0 );
16855 #elif DB_VERSION_MAJOR > 1
16856         db_appexit( NULL );
16857 #else
16858         (void) dbopen( NULL, 0, 0, 0, NULL);
16859 #endif
16860
16861 ; return 0; }
16862 EOF
16863 if { (eval echo configure:16864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16864   rm -rf conftest*
16865   ol_cv_db_db41=yes
16866 else
16867   echo "configure: failed program was:" >&5
16868   cat conftest.$ac_ext >&5
16869   rm -rf conftest*
16870   ol_cv_db_db41=no
16871 fi
16872 rm -f conftest*
16873
16874         LIBS="$ol_LIBS"
16875
16876 fi
16877
16878 echo "$ac_t""$ol_cv_db_db41" 1>&6
16879
16880         if test $ol_cv_db_db41 = yes ; then
16881                 ol_cv_lib_db=-ldb41
16882         fi
16883 fi
16884
16885 if test $ol_cv_lib_db = no ; then
16886         echo $ac_n "checking for Berkeley DB link (-ldb-41)""... $ac_c" 1>&6
16887 echo "configure:16888: checking for Berkeley DB link (-ldb-41)" >&5
16888 if eval "test \"\${ol_cv_db_db_41+set}\" = set"; then
16889   echo $ac_n "(cached) $ac_c" 1>&6
16890 else
16891   
16892         ol_DB_LIB=-ldb-41
16893         ol_LIBS=$LIBS
16894         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16895
16896         cat > conftest.$ac_ext <<EOF
16897 #line 16898 "configure"
16898 #include "confdefs.h"
16899
16900 #ifdef HAVE_DB_185_H
16901 # include <db_185.h>
16902 #else
16903 # include <db.h>
16904 #endif
16905
16906 #ifndef DB_VERSION_MAJOR
16907 # define DB_VERSION_MAJOR 1
16908 #endif
16909
16910 #ifndef NULL
16911 #define NULL ((void*)0)
16912 #endif
16913
16914 int main() {
16915
16916 #if DB_VERSION_MAJOR > 1
16917         {
16918                 char *version;
16919                 int major, minor, patch;
16920
16921                 version = db_version( &major, &minor, &patch );
16922
16923                 if( major != DB_VERSION_MAJOR ||
16924                         minor < DB_VERSION_MINOR )
16925                 {
16926                         printf("Berkeley DB version mismatch\n"
16927                                 "\texpected: %s\n\tgot: %s\n",
16928                                 DB_VERSION_STRING, version);
16929                         return 1;
16930                 }
16931         }
16932 #endif
16933
16934 #if DB_VERSION_MAJOR > 2
16935         db_env_create( NULL, 0 );
16936 #elif DB_VERSION_MAJOR > 1
16937         db_appexit( NULL );
16938 #else
16939         (void) dbopen( NULL, 0, 0, 0, NULL);
16940 #endif
16941
16942 ; return 0; }
16943 EOF
16944 if { (eval echo configure:16945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16945   rm -rf conftest*
16946   ol_cv_db_db_41=yes
16947 else
16948   echo "configure: failed program was:" >&5
16949   cat conftest.$ac_ext >&5
16950   rm -rf conftest*
16951   ol_cv_db_db_41=no
16952 fi
16953 rm -f conftest*
16954
16955         LIBS="$ol_LIBS"
16956
16957 fi
16958
16959 echo "$ac_t""$ol_cv_db_db_41" 1>&6
16960
16961         if test $ol_cv_db_db_41 = yes ; then
16962                 ol_cv_lib_db=-ldb-41
16963         fi
16964 fi
16965
16966 if test $ol_cv_lib_db = no ; then
16967         echo $ac_n "checking for Berkeley DB link (-ldb-4.1)""... $ac_c" 1>&6
16968 echo "configure:16969: checking for Berkeley DB link (-ldb-4.1)" >&5
16969 if eval "test \"\${ol_cv_db_db_4_dot_1+set}\" = set"; then
16970   echo $ac_n "(cached) $ac_c" 1>&6
16971 else
16972   
16973         ol_DB_LIB=-ldb-4.1
16974         ol_LIBS=$LIBS
16975         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
16976
16977         cat > conftest.$ac_ext <<EOF
16978 #line 16979 "configure"
16979 #include "confdefs.h"
16980
16981 #ifdef HAVE_DB_185_H
16982 # include <db_185.h>
16983 #else
16984 # include <db.h>
16985 #endif
16986
16987 #ifndef DB_VERSION_MAJOR
16988 # define DB_VERSION_MAJOR 1
16989 #endif
16990
16991 #ifndef NULL
16992 #define NULL ((void*)0)
16993 #endif
16994
16995 int main() {
16996
16997 #if DB_VERSION_MAJOR > 1
16998         {
16999                 char *version;
17000                 int major, minor, patch;
17001
17002                 version = db_version( &major, &minor, &patch );
17003
17004                 if( major != DB_VERSION_MAJOR ||
17005                         minor < DB_VERSION_MINOR )
17006                 {
17007                         printf("Berkeley DB version mismatch\n"
17008                                 "\texpected: %s\n\tgot: %s\n",
17009                                 DB_VERSION_STRING, version);
17010                         return 1;
17011                 }
17012         }
17013 #endif
17014
17015 #if DB_VERSION_MAJOR > 2
17016         db_env_create( NULL, 0 );
17017 #elif DB_VERSION_MAJOR > 1
17018         db_appexit( NULL );
17019 #else
17020         (void) dbopen( NULL, 0, 0, 0, NULL);
17021 #endif
17022
17023 ; return 0; }
17024 EOF
17025 if { (eval echo configure:17026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17026   rm -rf conftest*
17027   ol_cv_db_db_4_dot_1=yes
17028 else
17029   echo "configure: failed program was:" >&5
17030   cat conftest.$ac_ext >&5
17031   rm -rf conftest*
17032   ol_cv_db_db_4_dot_1=no
17033 fi
17034 rm -f conftest*
17035
17036         LIBS="$ol_LIBS"
17037
17038 fi
17039
17040 echo "$ac_t""$ol_cv_db_db_4_dot_1" 1>&6
17041
17042         if test $ol_cv_db_db_4_dot_1 = yes ; then
17043                 ol_cv_lib_db=-ldb-4.1
17044         fi
17045 fi
17046
17047 if test $ol_cv_lib_db = no ; then
17048         echo $ac_n "checking for Berkeley DB link (-ldb-4-1)""... $ac_c" 1>&6
17049 echo "configure:17050: checking for Berkeley DB link (-ldb-4-1)" >&5
17050 if eval "test \"\${ol_cv_db_db_4_1+set}\" = set"; then
17051   echo $ac_n "(cached) $ac_c" 1>&6
17052 else
17053   
17054         ol_DB_LIB=-ldb-4-1
17055         ol_LIBS=$LIBS
17056         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17057
17058         cat > conftest.$ac_ext <<EOF
17059 #line 17060 "configure"
17060 #include "confdefs.h"
17061
17062 #ifdef HAVE_DB_185_H
17063 # include <db_185.h>
17064 #else
17065 # include <db.h>
17066 #endif
17067
17068 #ifndef DB_VERSION_MAJOR
17069 # define DB_VERSION_MAJOR 1
17070 #endif
17071
17072 #ifndef NULL
17073 #define NULL ((void*)0)
17074 #endif
17075
17076 int main() {
17077
17078 #if DB_VERSION_MAJOR > 1
17079         {
17080                 char *version;
17081                 int major, minor, patch;
17082
17083                 version = db_version( &major, &minor, &patch );
17084
17085                 if( major != DB_VERSION_MAJOR ||
17086                         minor < DB_VERSION_MINOR )
17087                 {
17088                         printf("Berkeley DB version mismatch\n"
17089                                 "\texpected: %s\n\tgot: %s\n",
17090                                 DB_VERSION_STRING, version);
17091                         return 1;
17092                 }
17093         }
17094 #endif
17095
17096 #if DB_VERSION_MAJOR > 2
17097         db_env_create( NULL, 0 );
17098 #elif DB_VERSION_MAJOR > 1
17099         db_appexit( NULL );
17100 #else
17101         (void) dbopen( NULL, 0, 0, 0, NULL);
17102 #endif
17103
17104 ; return 0; }
17105 EOF
17106 if { (eval echo configure:17107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17107   rm -rf conftest*
17108   ol_cv_db_db_4_1=yes
17109 else
17110   echo "configure: failed program was:" >&5
17111   cat conftest.$ac_ext >&5
17112   rm -rf conftest*
17113   ol_cv_db_db_4_1=no
17114 fi
17115 rm -f conftest*
17116
17117         LIBS="$ol_LIBS"
17118
17119 fi
17120
17121 echo "$ac_t""$ol_cv_db_db_4_1" 1>&6
17122
17123         if test $ol_cv_db_db_4_1 = yes ; then
17124                 ol_cv_lib_db=-ldb-4-1
17125         fi
17126 fi
17127
17128 if test $ol_cv_lib_db = no ; then
17129         echo $ac_n "checking for Berkeley DB link (-ldb-4)""... $ac_c" 1>&6
17130 echo "configure:17131: checking for Berkeley DB link (-ldb-4)" >&5
17131 if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then
17132   echo $ac_n "(cached) $ac_c" 1>&6
17133 else
17134   
17135         ol_DB_LIB=-ldb-4
17136         ol_LIBS=$LIBS
17137         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17138
17139         cat > conftest.$ac_ext <<EOF
17140 #line 17141 "configure"
17141 #include "confdefs.h"
17142
17143 #ifdef HAVE_DB_185_H
17144 # include <db_185.h>
17145 #else
17146 # include <db.h>
17147 #endif
17148
17149 #ifndef DB_VERSION_MAJOR
17150 # define DB_VERSION_MAJOR 1
17151 #endif
17152
17153 #ifndef NULL
17154 #define NULL ((void*)0)
17155 #endif
17156
17157 int main() {
17158
17159 #if DB_VERSION_MAJOR > 1
17160         {
17161                 char *version;
17162                 int major, minor, patch;
17163
17164                 version = db_version( &major, &minor, &patch );
17165
17166                 if( major != DB_VERSION_MAJOR ||
17167                         minor < DB_VERSION_MINOR )
17168                 {
17169                         printf("Berkeley DB version mismatch\n"
17170                                 "\texpected: %s\n\tgot: %s\n",
17171                                 DB_VERSION_STRING, version);
17172                         return 1;
17173                 }
17174         }
17175 #endif
17176
17177 #if DB_VERSION_MAJOR > 2
17178         db_env_create( NULL, 0 );
17179 #elif DB_VERSION_MAJOR > 1
17180         db_appexit( NULL );
17181 #else
17182         (void) dbopen( NULL, 0, 0, 0, NULL);
17183 #endif
17184
17185 ; return 0; }
17186 EOF
17187 if { (eval echo configure:17188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17188   rm -rf conftest*
17189   ol_cv_db_db_4=yes
17190 else
17191   echo "configure: failed program was:" >&5
17192   cat conftest.$ac_ext >&5
17193   rm -rf conftest*
17194   ol_cv_db_db_4=no
17195 fi
17196 rm -f conftest*
17197
17198         LIBS="$ol_LIBS"
17199
17200 fi
17201
17202 echo "$ac_t""$ol_cv_db_db_4" 1>&6
17203
17204         if test $ol_cv_db_db_4 = yes ; then
17205                 ol_cv_lib_db=-ldb-4
17206         fi
17207 fi
17208
17209 if test $ol_cv_lib_db = no ; then
17210         echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
17211 echo "configure:17212: checking for Berkeley DB link (-ldb4)" >&5
17212 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
17213   echo $ac_n "(cached) $ac_c" 1>&6
17214 else
17215   
17216         ol_DB_LIB=-ldb4
17217         ol_LIBS=$LIBS
17218         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17219
17220         cat > conftest.$ac_ext <<EOF
17221 #line 17222 "configure"
17222 #include "confdefs.h"
17223
17224 #ifdef HAVE_DB_185_H
17225 # include <db_185.h>
17226 #else
17227 # include <db.h>
17228 #endif
17229
17230 #ifndef DB_VERSION_MAJOR
17231 # define DB_VERSION_MAJOR 1
17232 #endif
17233
17234 #ifndef NULL
17235 #define NULL ((void*)0)
17236 #endif
17237
17238 int main() {
17239
17240 #if DB_VERSION_MAJOR > 1
17241         {
17242                 char *version;
17243                 int major, minor, patch;
17244
17245                 version = db_version( &major, &minor, &patch );
17246
17247                 if( major != DB_VERSION_MAJOR ||
17248                         minor < DB_VERSION_MINOR )
17249                 {
17250                         printf("Berkeley DB version mismatch\n"
17251                                 "\texpected: %s\n\tgot: %s\n",
17252                                 DB_VERSION_STRING, version);
17253                         return 1;
17254                 }
17255         }
17256 #endif
17257
17258 #if DB_VERSION_MAJOR > 2
17259         db_env_create( NULL, 0 );
17260 #elif DB_VERSION_MAJOR > 1
17261         db_appexit( NULL );
17262 #else
17263         (void) dbopen( NULL, 0, 0, 0, NULL);
17264 #endif
17265
17266 ; return 0; }
17267 EOF
17268 if { (eval echo configure:17269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17269   rm -rf conftest*
17270   ol_cv_db_db4=yes
17271 else
17272   echo "configure: failed program was:" >&5
17273   cat conftest.$ac_ext >&5
17274   rm -rf conftest*
17275   ol_cv_db_db4=no
17276 fi
17277 rm -f conftest*
17278
17279         LIBS="$ol_LIBS"
17280
17281 fi
17282
17283 echo "$ac_t""$ol_cv_db_db4" 1>&6
17284
17285         if test $ol_cv_db_db4 = yes ; then
17286                 ol_cv_lib_db=-ldb4
17287         fi
17288 fi
17289
17290 if test $ol_cv_lib_db = no ; then
17291         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
17292 echo "configure:17293: checking for Berkeley DB link (-ldb)" >&5
17293 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
17294   echo $ac_n "(cached) $ac_c" 1>&6
17295 else
17296   
17297         ol_DB_LIB=-ldb
17298         ol_LIBS=$LIBS
17299         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17300
17301         cat > conftest.$ac_ext <<EOF
17302 #line 17303 "configure"
17303 #include "confdefs.h"
17304
17305 #ifdef HAVE_DB_185_H
17306 # include <db_185.h>
17307 #else
17308 # include <db.h>
17309 #endif
17310
17311 #ifndef DB_VERSION_MAJOR
17312 # define DB_VERSION_MAJOR 1
17313 #endif
17314
17315 #ifndef NULL
17316 #define NULL ((void*)0)
17317 #endif
17318
17319 int main() {
17320
17321 #if DB_VERSION_MAJOR > 1
17322         {
17323                 char *version;
17324                 int major, minor, patch;
17325
17326                 version = db_version( &major, &minor, &patch );
17327
17328                 if( major != DB_VERSION_MAJOR ||
17329                         minor < DB_VERSION_MINOR )
17330                 {
17331                         printf("Berkeley DB version mismatch\n"
17332                                 "\texpected: %s\n\tgot: %s\n",
17333                                 DB_VERSION_STRING, version);
17334                         return 1;
17335                 }
17336         }
17337 #endif
17338
17339 #if DB_VERSION_MAJOR > 2
17340         db_env_create( NULL, 0 );
17341 #elif DB_VERSION_MAJOR > 1
17342         db_appexit( NULL );
17343 #else
17344         (void) dbopen( NULL, 0, 0, 0, NULL);
17345 #endif
17346
17347 ; return 0; }
17348 EOF
17349 if { (eval echo configure:17350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17350   rm -rf conftest*
17351   ol_cv_db_db=yes
17352 else
17353   echo "configure: failed program was:" >&5
17354   cat conftest.$ac_ext >&5
17355   rm -rf conftest*
17356   ol_cv_db_db=no
17357 fi
17358 rm -f conftest*
17359
17360         LIBS="$ol_LIBS"
17361
17362 fi
17363
17364 echo "$ac_t""$ol_cv_db_db" 1>&6
17365
17366         if test $ol_cv_db_db = yes ; then
17367                 ol_cv_lib_db=-ldb
17368         fi
17369 fi
17370
17371 if test $ol_cv_lib_db = no ; then
17372         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
17373 echo "configure:17374: checking for Berkeley DB link (-ldb3)" >&5
17374 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
17375   echo $ac_n "(cached) $ac_c" 1>&6
17376 else
17377   
17378         ol_DB_LIB=-ldb3
17379         ol_LIBS=$LIBS
17380         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17381
17382         cat > conftest.$ac_ext <<EOF
17383 #line 17384 "configure"
17384 #include "confdefs.h"
17385
17386 #ifdef HAVE_DB_185_H
17387 # include <db_185.h>
17388 #else
17389 # include <db.h>
17390 #endif
17391
17392 #ifndef DB_VERSION_MAJOR
17393 # define DB_VERSION_MAJOR 1
17394 #endif
17395
17396 #ifndef NULL
17397 #define NULL ((void*)0)
17398 #endif
17399
17400 int main() {
17401
17402 #if DB_VERSION_MAJOR > 1
17403         {
17404                 char *version;
17405                 int major, minor, patch;
17406
17407                 version = db_version( &major, &minor, &patch );
17408
17409                 if( major != DB_VERSION_MAJOR ||
17410                         minor < DB_VERSION_MINOR )
17411                 {
17412                         printf("Berkeley DB version mismatch\n"
17413                                 "\texpected: %s\n\tgot: %s\n",
17414                                 DB_VERSION_STRING, version);
17415                         return 1;
17416                 }
17417         }
17418 #endif
17419
17420 #if DB_VERSION_MAJOR > 2
17421         db_env_create( NULL, 0 );
17422 #elif DB_VERSION_MAJOR > 1
17423         db_appexit( NULL );
17424 #else
17425         (void) dbopen( NULL, 0, 0, 0, NULL);
17426 #endif
17427
17428 ; return 0; }
17429 EOF
17430 if { (eval echo configure:17431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17431   rm -rf conftest*
17432   ol_cv_db_db3=yes
17433 else
17434   echo "configure: failed program was:" >&5
17435   cat conftest.$ac_ext >&5
17436   rm -rf conftest*
17437   ol_cv_db_db3=no
17438 fi
17439 rm -f conftest*
17440
17441         LIBS="$ol_LIBS"
17442
17443 fi
17444
17445 echo "$ac_t""$ol_cv_db_db3" 1>&6
17446
17447         if test $ol_cv_db_db3 = yes ; then
17448                 ol_cv_lib_db=-ldb3
17449         fi
17450 fi
17451
17452 if test $ol_cv_lib_db = no ; then
17453         echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6
17454 echo "configure:17455: checking for Berkeley DB link (-ldb-3)" >&5
17455 if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then
17456   echo $ac_n "(cached) $ac_c" 1>&6
17457 else
17458   
17459         ol_DB_LIB=-ldb-3
17460         ol_LIBS=$LIBS
17461         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17462
17463         cat > conftest.$ac_ext <<EOF
17464 #line 17465 "configure"
17465 #include "confdefs.h"
17466
17467 #ifdef HAVE_DB_185_H
17468 # include <db_185.h>
17469 #else
17470 # include <db.h>
17471 #endif
17472
17473 #ifndef DB_VERSION_MAJOR
17474 # define DB_VERSION_MAJOR 1
17475 #endif
17476
17477 #ifndef NULL
17478 #define NULL ((void*)0)
17479 #endif
17480
17481 int main() {
17482
17483 #if DB_VERSION_MAJOR > 1
17484         {
17485                 char *version;
17486                 int major, minor, patch;
17487
17488                 version = db_version( &major, &minor, &patch );
17489
17490                 if( major != DB_VERSION_MAJOR ||
17491                         minor < DB_VERSION_MINOR )
17492                 {
17493                         printf("Berkeley DB version mismatch\n"
17494                                 "\texpected: %s\n\tgot: %s\n",
17495                                 DB_VERSION_STRING, version);
17496                         return 1;
17497                 }
17498         }
17499 #endif
17500
17501 #if DB_VERSION_MAJOR > 2
17502         db_env_create( NULL, 0 );
17503 #elif DB_VERSION_MAJOR > 1
17504         db_appexit( NULL );
17505 #else
17506         (void) dbopen( NULL, 0, 0, 0, NULL);
17507 #endif
17508
17509 ; return 0; }
17510 EOF
17511 if { (eval echo configure:17512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17512   rm -rf conftest*
17513   ol_cv_db_db_3=yes
17514 else
17515   echo "configure: failed program was:" >&5
17516   cat conftest.$ac_ext >&5
17517   rm -rf conftest*
17518   ol_cv_db_db_3=no
17519 fi
17520 rm -f conftest*
17521
17522         LIBS="$ol_LIBS"
17523
17524 fi
17525
17526 echo "$ac_t""$ol_cv_db_db_3" 1>&6
17527
17528         if test $ol_cv_db_db_3 = yes ; then
17529                 ol_cv_lib_db=-ldb-3
17530         fi
17531 fi
17532
17533 if test $ol_cv_lib_db = no ; then
17534         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
17535 echo "configure:17536: checking for Berkeley DB link (-ldb2)" >&5
17536 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
17537   echo $ac_n "(cached) $ac_c" 1>&6
17538 else
17539   
17540         ol_DB_LIB=-ldb2
17541         ol_LIBS=$LIBS
17542         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17543
17544         cat > conftest.$ac_ext <<EOF
17545 #line 17546 "configure"
17546 #include "confdefs.h"
17547
17548 #ifdef HAVE_DB_185_H
17549 # include <db_185.h>
17550 #else
17551 # include <db.h>
17552 #endif
17553
17554 #ifndef DB_VERSION_MAJOR
17555 # define DB_VERSION_MAJOR 1
17556 #endif
17557
17558 #ifndef NULL
17559 #define NULL ((void*)0)
17560 #endif
17561
17562 int main() {
17563
17564 #if DB_VERSION_MAJOR > 1
17565         {
17566                 char *version;
17567                 int major, minor, patch;
17568
17569                 version = db_version( &major, &minor, &patch );
17570
17571                 if( major != DB_VERSION_MAJOR ||
17572                         minor < DB_VERSION_MINOR )
17573                 {
17574                         printf("Berkeley DB version mismatch\n"
17575                                 "\texpected: %s\n\tgot: %s\n",
17576                                 DB_VERSION_STRING, version);
17577                         return 1;
17578                 }
17579         }
17580 #endif
17581
17582 #if DB_VERSION_MAJOR > 2
17583         db_env_create( NULL, 0 );
17584 #elif DB_VERSION_MAJOR > 1
17585         db_appexit( NULL );
17586 #else
17587         (void) dbopen( NULL, 0, 0, 0, NULL);
17588 #endif
17589
17590 ; return 0; }
17591 EOF
17592 if { (eval echo configure:17593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17593   rm -rf conftest*
17594   ol_cv_db_db2=yes
17595 else
17596   echo "configure: failed program was:" >&5
17597   cat conftest.$ac_ext >&5
17598   rm -rf conftest*
17599   ol_cv_db_db2=no
17600 fi
17601 rm -f conftest*
17602
17603         LIBS="$ol_LIBS"
17604
17605 fi
17606
17607 echo "$ac_t""$ol_cv_db_db2" 1>&6
17608
17609         if test $ol_cv_db_db2 = yes ; then
17610                 ol_cv_lib_db=-ldb2
17611         fi
17612 fi
17613
17614 if test $ol_cv_lib_db = no ; then
17615         echo $ac_n "checking for Berkeley DB link (-ldb-2)""... $ac_c" 1>&6
17616 echo "configure:17617: checking for Berkeley DB link (-ldb-2)" >&5
17617 if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then
17618   echo $ac_n "(cached) $ac_c" 1>&6
17619 else
17620   
17621         ol_DB_LIB=-ldb-2
17622         ol_LIBS=$LIBS
17623         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17624
17625         cat > conftest.$ac_ext <<EOF
17626 #line 17627 "configure"
17627 #include "confdefs.h"
17628
17629 #ifdef HAVE_DB_185_H
17630 # include <db_185.h>
17631 #else
17632 # include <db.h>
17633 #endif
17634
17635 #ifndef DB_VERSION_MAJOR
17636 # define DB_VERSION_MAJOR 1
17637 #endif
17638
17639 #ifndef NULL
17640 #define NULL ((void*)0)
17641 #endif
17642
17643 int main() {
17644
17645 #if DB_VERSION_MAJOR > 1
17646         {
17647                 char *version;
17648                 int major, minor, patch;
17649
17650                 version = db_version( &major, &minor, &patch );
17651
17652                 if( major != DB_VERSION_MAJOR ||
17653                         minor < DB_VERSION_MINOR )
17654                 {
17655                         printf("Berkeley DB version mismatch\n"
17656                                 "\texpected: %s\n\tgot: %s\n",
17657                                 DB_VERSION_STRING, version);
17658                         return 1;
17659                 }
17660         }
17661 #endif
17662
17663 #if DB_VERSION_MAJOR > 2
17664         db_env_create( NULL, 0 );
17665 #elif DB_VERSION_MAJOR > 1
17666         db_appexit( NULL );
17667 #else
17668         (void) dbopen( NULL, 0, 0, 0, NULL);
17669 #endif
17670
17671 ; return 0; }
17672 EOF
17673 if { (eval echo configure:17674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17674   rm -rf conftest*
17675   ol_cv_db_db_2=yes
17676 else
17677   echo "configure: failed program was:" >&5
17678   cat conftest.$ac_ext >&5
17679   rm -rf conftest*
17680   ol_cv_db_db_2=no
17681 fi
17682 rm -f conftest*
17683
17684         LIBS="$ol_LIBS"
17685
17686 fi
17687
17688 echo "$ac_t""$ol_cv_db_db_2" 1>&6
17689
17690         if test $ol_cv_db_db_2 = yes ; then
17691                 ol_cv_lib_db=-ldb-2
17692         fi
17693 fi
17694
17695 if test $ol_cv_lib_db = no ; then
17696         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
17697 echo "configure:17698: checking for Berkeley DB link (-ldb1)" >&5
17698 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
17699   echo $ac_n "(cached) $ac_c" 1>&6
17700 else
17701   
17702         ol_DB_LIB=-ldb1
17703         ol_LIBS=$LIBS
17704         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17705
17706         cat > conftest.$ac_ext <<EOF
17707 #line 17708 "configure"
17708 #include "confdefs.h"
17709
17710 #ifdef HAVE_DB_185_H
17711 # include <db_185.h>
17712 #else
17713 # include <db.h>
17714 #endif
17715
17716 #ifndef DB_VERSION_MAJOR
17717 # define DB_VERSION_MAJOR 1
17718 #endif
17719
17720 #ifndef NULL
17721 #define NULL ((void*)0)
17722 #endif
17723
17724 int main() {
17725
17726 #if DB_VERSION_MAJOR > 1
17727         {
17728                 char *version;
17729                 int major, minor, patch;
17730
17731                 version = db_version( &major, &minor, &patch );
17732
17733                 if( major != DB_VERSION_MAJOR ||
17734                         minor < DB_VERSION_MINOR )
17735                 {
17736                         printf("Berkeley DB version mismatch\n"
17737                                 "\texpected: %s\n\tgot: %s\n",
17738                                 DB_VERSION_STRING, version);
17739                         return 1;
17740                 }
17741         }
17742 #endif
17743
17744 #if DB_VERSION_MAJOR > 2
17745         db_env_create( NULL, 0 );
17746 #elif DB_VERSION_MAJOR > 1
17747         db_appexit( NULL );
17748 #else
17749         (void) dbopen( NULL, 0, 0, 0, NULL);
17750 #endif
17751
17752 ; return 0; }
17753 EOF
17754 if { (eval echo configure:17755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17755   rm -rf conftest*
17756   ol_cv_db_db1=yes
17757 else
17758   echo "configure: failed program was:" >&5
17759   cat conftest.$ac_ext >&5
17760   rm -rf conftest*
17761   ol_cv_db_db1=no
17762 fi
17763 rm -f conftest*
17764
17765         LIBS="$ol_LIBS"
17766
17767 fi
17768
17769 echo "$ac_t""$ol_cv_db_db1" 1>&6
17770
17771         if test $ol_cv_db_db1 = yes ; then
17772                 ol_cv_lib_db=-ldb1
17773         fi
17774 fi
17775
17776 if test $ol_cv_lib_db = no ; then
17777         echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6
17778 echo "configure:17779: checking for Berkeley DB link (-ldb-1)" >&5
17779 if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then
17780   echo $ac_n "(cached) $ac_c" 1>&6
17781 else
17782   
17783         ol_DB_LIB=-ldb-1
17784         ol_LIBS=$LIBS
17785         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17786
17787         cat > conftest.$ac_ext <<EOF
17788 #line 17789 "configure"
17789 #include "confdefs.h"
17790
17791 #ifdef HAVE_DB_185_H
17792 # include <db_185.h>
17793 #else
17794 # include <db.h>
17795 #endif
17796
17797 #ifndef DB_VERSION_MAJOR
17798 # define DB_VERSION_MAJOR 1
17799 #endif
17800
17801 #ifndef NULL
17802 #define NULL ((void*)0)
17803 #endif
17804
17805 int main() {
17806
17807 #if DB_VERSION_MAJOR > 1
17808         {
17809                 char *version;
17810                 int major, minor, patch;
17811
17812                 version = db_version( &major, &minor, &patch );
17813
17814                 if( major != DB_VERSION_MAJOR ||
17815                         minor < DB_VERSION_MINOR )
17816                 {
17817                         printf("Berkeley DB version mismatch\n"
17818                                 "\texpected: %s\n\tgot: %s\n",
17819                                 DB_VERSION_STRING, version);
17820                         return 1;
17821                 }
17822         }
17823 #endif
17824
17825 #if DB_VERSION_MAJOR > 2
17826         db_env_create( NULL, 0 );
17827 #elif DB_VERSION_MAJOR > 1
17828         db_appexit( NULL );
17829 #else
17830         (void) dbopen( NULL, 0, 0, 0, NULL);
17831 #endif
17832
17833 ; return 0; }
17834 EOF
17835 if { (eval echo configure:17836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17836   rm -rf conftest*
17837   ol_cv_db_db_1=yes
17838 else
17839   echo "configure: failed program was:" >&5
17840   cat conftest.$ac_ext >&5
17841   rm -rf conftest*
17842   ol_cv_db_db_1=no
17843 fi
17844 rm -f conftest*
17845
17846         LIBS="$ol_LIBS"
17847
17848 fi
17849
17850 echo "$ac_t""$ol_cv_db_db_1" 1>&6
17851
17852         if test $ol_cv_db_db_1 = yes ; then
17853                 ol_cv_lib_db=-ldb-1
17854         fi
17855 fi
17856
17857
17858                 if test "$ol_cv_lib_db" != no ; then
17859                         ol_cv_berkeley_db=yes
17860                 fi
17861         fi
17862 fi
17863
17864         else
17865                 ol_cv_berkeley_db=no
17866 for ac_hdr in db.h
17867 do
17868 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
17869 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
17870 echo "configure:17871: checking for $ac_hdr" >&5
17871 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
17872   echo $ac_n "(cached) $ac_c" 1>&6
17873 else
17874   cat > conftest.$ac_ext <<EOF
17875 #line 17876 "configure"
17876 #include "confdefs.h"
17877 #include <$ac_hdr>
17878 EOF
17879 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
17880 { (eval echo configure:17881: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
17881 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
17882 if test -z "$ac_err"; then
17883   rm -rf conftest*
17884   eval "ac_cv_header_$ac_safe=yes"
17885 else
17886   echo "$ac_err" >&5
17887   echo "configure: failed program was:" >&5
17888   cat conftest.$ac_ext >&5
17889   rm -rf conftest*
17890   eval "ac_cv_header_$ac_safe=no"
17891 fi
17892 rm -f conftest*
17893 fi
17894 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
17895   echo "$ac_t""yes" 1>&6
17896     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
17897   cat >> confdefs.h <<EOF
17898 #define $ac_tr_hdr 1
17899 EOF
17900  
17901 else
17902   echo "$ac_t""no" 1>&6
17903 fi
17904 done
17905
17906 if test $ac_cv_header_db_h = yes; then
17907         ol_cv_lib_db=no
17908 if test $ol_cv_lib_db = no ; then
17909         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
17910 echo "configure:17911: checking for Berkeley DB link (default)" >&5
17911 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
17912   echo $ac_n "(cached) $ac_c" 1>&6
17913 else
17914   
17915         ol_DB_LIB=
17916         ol_LIBS=$LIBS
17917         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17918
17919         cat > conftest.$ac_ext <<EOF
17920 #line 17921 "configure"
17921 #include "confdefs.h"
17922
17923 #ifdef HAVE_DB_185_H
17924 # include <db_185.h>
17925 #else
17926 # include <db.h>
17927 #endif
17928
17929 #ifndef DB_VERSION_MAJOR
17930 # define DB_VERSION_MAJOR 1
17931 #endif
17932
17933 #ifndef NULL
17934 #define NULL ((void*)0)
17935 #endif
17936
17937 int main() {
17938
17939 #if DB_VERSION_MAJOR > 1
17940         {
17941                 char *version;
17942                 int major, minor, patch;
17943
17944                 version = db_version( &major, &minor, &patch );
17945
17946                 if( major != DB_VERSION_MAJOR ||
17947                         minor < DB_VERSION_MINOR )
17948                 {
17949                         printf("Berkeley DB version mismatch\n"
17950                                 "\texpected: %s\n\tgot: %s\n",
17951                                 DB_VERSION_STRING, version);
17952                         return 1;
17953                 }
17954         }
17955 #endif
17956
17957 #if DB_VERSION_MAJOR > 2
17958         db_env_create( NULL, 0 );
17959 #elif DB_VERSION_MAJOR > 1
17960         db_appexit( NULL );
17961 #else
17962         (void) dbopen( NULL, 0, 0, 0, NULL);
17963 #endif
17964
17965 ; return 0; }
17966 EOF
17967 if { (eval echo configure:17968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17968   rm -rf conftest*
17969   ol_cv_db_none=yes
17970 else
17971   echo "configure: failed program was:" >&5
17972   cat conftest.$ac_ext >&5
17973   rm -rf conftest*
17974   ol_cv_db_none=no
17975 fi
17976 rm -f conftest*
17977
17978         LIBS="$ol_LIBS"
17979
17980 fi
17981
17982 echo "$ac_t""$ol_cv_db_none" 1>&6
17983
17984         if test $ol_cv_db_none = yes ; then
17985                 ol_cv_lib_db=yes
17986         fi
17987 fi
17988
17989 if test $ol_cv_lib_db = no ; then
17990         echo $ac_n "checking for Berkeley DB link (-ldb41)""... $ac_c" 1>&6
17991 echo "configure:17992: checking for Berkeley DB link (-ldb41)" >&5
17992 if eval "test \"\${ol_cv_db_db41+set}\" = set"; then
17993   echo $ac_n "(cached) $ac_c" 1>&6
17994 else
17995   
17996         ol_DB_LIB=-ldb41
17997         ol_LIBS=$LIBS
17998         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
17999
18000         cat > conftest.$ac_ext <<EOF
18001 #line 18002 "configure"
18002 #include "confdefs.h"
18003
18004 #ifdef HAVE_DB_185_H
18005 # include <db_185.h>
18006 #else
18007 # include <db.h>
18008 #endif
18009
18010 #ifndef DB_VERSION_MAJOR
18011 # define DB_VERSION_MAJOR 1
18012 #endif
18013
18014 #ifndef NULL
18015 #define NULL ((void*)0)
18016 #endif
18017
18018 int main() {
18019
18020 #if DB_VERSION_MAJOR > 1
18021         {
18022                 char *version;
18023                 int major, minor, patch;
18024
18025                 version = db_version( &major, &minor, &patch );
18026
18027                 if( major != DB_VERSION_MAJOR ||
18028                         minor < DB_VERSION_MINOR )
18029                 {
18030                         printf("Berkeley DB version mismatch\n"
18031                                 "\texpected: %s\n\tgot: %s\n",
18032                                 DB_VERSION_STRING, version);
18033                         return 1;
18034                 }
18035         }
18036 #endif
18037
18038 #if DB_VERSION_MAJOR > 2
18039         db_env_create( NULL, 0 );
18040 #elif DB_VERSION_MAJOR > 1
18041         db_appexit( NULL );
18042 #else
18043         (void) dbopen( NULL, 0, 0, 0, NULL);
18044 #endif
18045
18046 ; return 0; }
18047 EOF
18048 if { (eval echo configure:18049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18049   rm -rf conftest*
18050   ol_cv_db_db41=yes
18051 else
18052   echo "configure: failed program was:" >&5
18053   cat conftest.$ac_ext >&5
18054   rm -rf conftest*
18055   ol_cv_db_db41=no
18056 fi
18057 rm -f conftest*
18058
18059         LIBS="$ol_LIBS"
18060
18061 fi
18062
18063 echo "$ac_t""$ol_cv_db_db41" 1>&6
18064
18065         if test $ol_cv_db_db41 = yes ; then
18066                 ol_cv_lib_db=-ldb41
18067         fi
18068 fi
18069
18070 if test $ol_cv_lib_db = no ; then
18071         echo $ac_n "checking for Berkeley DB link (-ldb-41)""... $ac_c" 1>&6
18072 echo "configure:18073: checking for Berkeley DB link (-ldb-41)" >&5
18073 if eval "test \"\${ol_cv_db_db_41+set}\" = set"; then
18074   echo $ac_n "(cached) $ac_c" 1>&6
18075 else
18076   
18077         ol_DB_LIB=-ldb-41
18078         ol_LIBS=$LIBS
18079         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18080
18081         cat > conftest.$ac_ext <<EOF
18082 #line 18083 "configure"
18083 #include "confdefs.h"
18084
18085 #ifdef HAVE_DB_185_H
18086 # include <db_185.h>
18087 #else
18088 # include <db.h>
18089 #endif
18090
18091 #ifndef DB_VERSION_MAJOR
18092 # define DB_VERSION_MAJOR 1
18093 #endif
18094
18095 #ifndef NULL
18096 #define NULL ((void*)0)
18097 #endif
18098
18099 int main() {
18100
18101 #if DB_VERSION_MAJOR > 1
18102         {
18103                 char *version;
18104                 int major, minor, patch;
18105
18106                 version = db_version( &major, &minor, &patch );
18107
18108                 if( major != DB_VERSION_MAJOR ||
18109                         minor < DB_VERSION_MINOR )
18110                 {
18111                         printf("Berkeley DB version mismatch\n"
18112                                 "\texpected: %s\n\tgot: %s\n",
18113                                 DB_VERSION_STRING, version);
18114                         return 1;
18115                 }
18116         }
18117 #endif
18118
18119 #if DB_VERSION_MAJOR > 2
18120         db_env_create( NULL, 0 );
18121 #elif DB_VERSION_MAJOR > 1
18122         db_appexit( NULL );
18123 #else
18124         (void) dbopen( NULL, 0, 0, 0, NULL);
18125 #endif
18126
18127 ; return 0; }
18128 EOF
18129 if { (eval echo configure:18130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18130   rm -rf conftest*
18131   ol_cv_db_db_41=yes
18132 else
18133   echo "configure: failed program was:" >&5
18134   cat conftest.$ac_ext >&5
18135   rm -rf conftest*
18136   ol_cv_db_db_41=no
18137 fi
18138 rm -f conftest*
18139
18140         LIBS="$ol_LIBS"
18141
18142 fi
18143
18144 echo "$ac_t""$ol_cv_db_db_41" 1>&6
18145
18146         if test $ol_cv_db_db_41 = yes ; then
18147                 ol_cv_lib_db=-ldb-41
18148         fi
18149 fi
18150
18151 if test $ol_cv_lib_db = no ; then
18152         echo $ac_n "checking for Berkeley DB link (-ldb-4.1)""... $ac_c" 1>&6
18153 echo "configure:18154: checking for Berkeley DB link (-ldb-4.1)" >&5
18154 if eval "test \"\${ol_cv_db_db_4_dot_1+set}\" = set"; then
18155   echo $ac_n "(cached) $ac_c" 1>&6
18156 else
18157   
18158         ol_DB_LIB=-ldb-4.1
18159         ol_LIBS=$LIBS
18160         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18161
18162         cat > conftest.$ac_ext <<EOF
18163 #line 18164 "configure"
18164 #include "confdefs.h"
18165
18166 #ifdef HAVE_DB_185_H
18167 # include <db_185.h>
18168 #else
18169 # include <db.h>
18170 #endif
18171
18172 #ifndef DB_VERSION_MAJOR
18173 # define DB_VERSION_MAJOR 1
18174 #endif
18175
18176 #ifndef NULL
18177 #define NULL ((void*)0)
18178 #endif
18179
18180 int main() {
18181
18182 #if DB_VERSION_MAJOR > 1
18183         {
18184                 char *version;
18185                 int major, minor, patch;
18186
18187                 version = db_version( &major, &minor, &patch );
18188
18189                 if( major != DB_VERSION_MAJOR ||
18190                         minor < DB_VERSION_MINOR )
18191                 {
18192                         printf("Berkeley DB version mismatch\n"
18193                                 "\texpected: %s\n\tgot: %s\n",
18194                                 DB_VERSION_STRING, version);
18195                         return 1;
18196                 }
18197         }
18198 #endif
18199
18200 #if DB_VERSION_MAJOR > 2
18201         db_env_create( NULL, 0 );
18202 #elif DB_VERSION_MAJOR > 1
18203         db_appexit( NULL );
18204 #else
18205         (void) dbopen( NULL, 0, 0, 0, NULL);
18206 #endif
18207
18208 ; return 0; }
18209 EOF
18210 if { (eval echo configure:18211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18211   rm -rf conftest*
18212   ol_cv_db_db_4_dot_1=yes
18213 else
18214   echo "configure: failed program was:" >&5
18215   cat conftest.$ac_ext >&5
18216   rm -rf conftest*
18217   ol_cv_db_db_4_dot_1=no
18218 fi
18219 rm -f conftest*
18220
18221         LIBS="$ol_LIBS"
18222
18223 fi
18224
18225 echo "$ac_t""$ol_cv_db_db_4_dot_1" 1>&6
18226
18227         if test $ol_cv_db_db_4_dot_1 = yes ; then
18228                 ol_cv_lib_db=-ldb-4.1
18229         fi
18230 fi
18231
18232 if test $ol_cv_lib_db = no ; then
18233         echo $ac_n "checking for Berkeley DB link (-ldb-4-1)""... $ac_c" 1>&6
18234 echo "configure:18235: checking for Berkeley DB link (-ldb-4-1)" >&5
18235 if eval "test \"\${ol_cv_db_db_4_1+set}\" = set"; then
18236   echo $ac_n "(cached) $ac_c" 1>&6
18237 else
18238   
18239         ol_DB_LIB=-ldb-4-1
18240         ol_LIBS=$LIBS
18241         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18242
18243         cat > conftest.$ac_ext <<EOF
18244 #line 18245 "configure"
18245 #include "confdefs.h"
18246
18247 #ifdef HAVE_DB_185_H
18248 # include <db_185.h>
18249 #else
18250 # include <db.h>
18251 #endif
18252
18253 #ifndef DB_VERSION_MAJOR
18254 # define DB_VERSION_MAJOR 1
18255 #endif
18256
18257 #ifndef NULL
18258 #define NULL ((void*)0)
18259 #endif
18260
18261 int main() {
18262
18263 #if DB_VERSION_MAJOR > 1
18264         {
18265                 char *version;
18266                 int major, minor, patch;
18267
18268                 version = db_version( &major, &minor, &patch );
18269
18270                 if( major != DB_VERSION_MAJOR ||
18271                         minor < DB_VERSION_MINOR )
18272                 {
18273                         printf("Berkeley DB version mismatch\n"
18274                                 "\texpected: %s\n\tgot: %s\n",
18275                                 DB_VERSION_STRING, version);
18276                         return 1;
18277                 }
18278         }
18279 #endif
18280
18281 #if DB_VERSION_MAJOR > 2
18282         db_env_create( NULL, 0 );
18283 #elif DB_VERSION_MAJOR > 1
18284         db_appexit( NULL );
18285 #else
18286         (void) dbopen( NULL, 0, 0, 0, NULL);
18287 #endif
18288
18289 ; return 0; }
18290 EOF
18291 if { (eval echo configure:18292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18292   rm -rf conftest*
18293   ol_cv_db_db_4_1=yes
18294 else
18295   echo "configure: failed program was:" >&5
18296   cat conftest.$ac_ext >&5
18297   rm -rf conftest*
18298   ol_cv_db_db_4_1=no
18299 fi
18300 rm -f conftest*
18301
18302         LIBS="$ol_LIBS"
18303
18304 fi
18305
18306 echo "$ac_t""$ol_cv_db_db_4_1" 1>&6
18307
18308         if test $ol_cv_db_db_4_1 = yes ; then
18309                 ol_cv_lib_db=-ldb-4-1
18310         fi
18311 fi
18312
18313 if test $ol_cv_lib_db = no ; then
18314         echo $ac_n "checking for Berkeley DB link (-ldb-4)""... $ac_c" 1>&6
18315 echo "configure:18316: checking for Berkeley DB link (-ldb-4)" >&5
18316 if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then
18317   echo $ac_n "(cached) $ac_c" 1>&6
18318 else
18319   
18320         ol_DB_LIB=-ldb-4
18321         ol_LIBS=$LIBS
18322         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18323
18324         cat > conftest.$ac_ext <<EOF
18325 #line 18326 "configure"
18326 #include "confdefs.h"
18327
18328 #ifdef HAVE_DB_185_H
18329 # include <db_185.h>
18330 #else
18331 # include <db.h>
18332 #endif
18333
18334 #ifndef DB_VERSION_MAJOR
18335 # define DB_VERSION_MAJOR 1
18336 #endif
18337
18338 #ifndef NULL
18339 #define NULL ((void*)0)
18340 #endif
18341
18342 int main() {
18343
18344 #if DB_VERSION_MAJOR > 1
18345         {
18346                 char *version;
18347                 int major, minor, patch;
18348
18349                 version = db_version( &major, &minor, &patch );
18350
18351                 if( major != DB_VERSION_MAJOR ||
18352                         minor < DB_VERSION_MINOR )
18353                 {
18354                         printf("Berkeley DB version mismatch\n"
18355                                 "\texpected: %s\n\tgot: %s\n",
18356                                 DB_VERSION_STRING, version);
18357                         return 1;
18358                 }
18359         }
18360 #endif
18361
18362 #if DB_VERSION_MAJOR > 2
18363         db_env_create( NULL, 0 );
18364 #elif DB_VERSION_MAJOR > 1
18365         db_appexit( NULL );
18366 #else
18367         (void) dbopen( NULL, 0, 0, 0, NULL);
18368 #endif
18369
18370 ; return 0; }
18371 EOF
18372 if { (eval echo configure:18373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18373   rm -rf conftest*
18374   ol_cv_db_db_4=yes
18375 else
18376   echo "configure: failed program was:" >&5
18377   cat conftest.$ac_ext >&5
18378   rm -rf conftest*
18379   ol_cv_db_db_4=no
18380 fi
18381 rm -f conftest*
18382
18383         LIBS="$ol_LIBS"
18384
18385 fi
18386
18387 echo "$ac_t""$ol_cv_db_db_4" 1>&6
18388
18389         if test $ol_cv_db_db_4 = yes ; then
18390                 ol_cv_lib_db=-ldb-4
18391         fi
18392 fi
18393
18394 if test $ol_cv_lib_db = no ; then
18395         echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
18396 echo "configure:18397: checking for Berkeley DB link (-ldb4)" >&5
18397 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
18398   echo $ac_n "(cached) $ac_c" 1>&6
18399 else
18400   
18401         ol_DB_LIB=-ldb4
18402         ol_LIBS=$LIBS
18403         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18404
18405         cat > conftest.$ac_ext <<EOF
18406 #line 18407 "configure"
18407 #include "confdefs.h"
18408
18409 #ifdef HAVE_DB_185_H
18410 # include <db_185.h>
18411 #else
18412 # include <db.h>
18413 #endif
18414
18415 #ifndef DB_VERSION_MAJOR
18416 # define DB_VERSION_MAJOR 1
18417 #endif
18418
18419 #ifndef NULL
18420 #define NULL ((void*)0)
18421 #endif
18422
18423 int main() {
18424
18425 #if DB_VERSION_MAJOR > 1
18426         {
18427                 char *version;
18428                 int major, minor, patch;
18429
18430                 version = db_version( &major, &minor, &patch );
18431
18432                 if( major != DB_VERSION_MAJOR ||
18433                         minor < DB_VERSION_MINOR )
18434                 {
18435                         printf("Berkeley DB version mismatch\n"
18436                                 "\texpected: %s\n\tgot: %s\n",
18437                                 DB_VERSION_STRING, version);
18438                         return 1;
18439                 }
18440         }
18441 #endif
18442
18443 #if DB_VERSION_MAJOR > 2
18444         db_env_create( NULL, 0 );
18445 #elif DB_VERSION_MAJOR > 1
18446         db_appexit( NULL );
18447 #else
18448         (void) dbopen( NULL, 0, 0, 0, NULL);
18449 #endif
18450
18451 ; return 0; }
18452 EOF
18453 if { (eval echo configure:18454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18454   rm -rf conftest*
18455   ol_cv_db_db4=yes
18456 else
18457   echo "configure: failed program was:" >&5
18458   cat conftest.$ac_ext >&5
18459   rm -rf conftest*
18460   ol_cv_db_db4=no
18461 fi
18462 rm -f conftest*
18463
18464         LIBS="$ol_LIBS"
18465
18466 fi
18467
18468 echo "$ac_t""$ol_cv_db_db4" 1>&6
18469
18470         if test $ol_cv_db_db4 = yes ; then
18471                 ol_cv_lib_db=-ldb4
18472         fi
18473 fi
18474
18475 if test $ol_cv_lib_db = no ; then
18476         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
18477 echo "configure:18478: checking for Berkeley DB link (-ldb)" >&5
18478 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
18479   echo $ac_n "(cached) $ac_c" 1>&6
18480 else
18481   
18482         ol_DB_LIB=-ldb
18483         ol_LIBS=$LIBS
18484         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18485
18486         cat > conftest.$ac_ext <<EOF
18487 #line 18488 "configure"
18488 #include "confdefs.h"
18489
18490 #ifdef HAVE_DB_185_H
18491 # include <db_185.h>
18492 #else
18493 # include <db.h>
18494 #endif
18495
18496 #ifndef DB_VERSION_MAJOR
18497 # define DB_VERSION_MAJOR 1
18498 #endif
18499
18500 #ifndef NULL
18501 #define NULL ((void*)0)
18502 #endif
18503
18504 int main() {
18505
18506 #if DB_VERSION_MAJOR > 1
18507         {
18508                 char *version;
18509                 int major, minor, patch;
18510
18511                 version = db_version( &major, &minor, &patch );
18512
18513                 if( major != DB_VERSION_MAJOR ||
18514                         minor < DB_VERSION_MINOR )
18515                 {
18516                         printf("Berkeley DB version mismatch\n"
18517                                 "\texpected: %s\n\tgot: %s\n",
18518                                 DB_VERSION_STRING, version);
18519                         return 1;
18520                 }
18521         }
18522 #endif
18523
18524 #if DB_VERSION_MAJOR > 2
18525         db_env_create( NULL, 0 );
18526 #elif DB_VERSION_MAJOR > 1
18527         db_appexit( NULL );
18528 #else
18529         (void) dbopen( NULL, 0, 0, 0, NULL);
18530 #endif
18531
18532 ; return 0; }
18533 EOF
18534 if { (eval echo configure:18535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18535   rm -rf conftest*
18536   ol_cv_db_db=yes
18537 else
18538   echo "configure: failed program was:" >&5
18539   cat conftest.$ac_ext >&5
18540   rm -rf conftest*
18541   ol_cv_db_db=no
18542 fi
18543 rm -f conftest*
18544
18545         LIBS="$ol_LIBS"
18546
18547 fi
18548
18549 echo "$ac_t""$ol_cv_db_db" 1>&6
18550
18551         if test $ol_cv_db_db = yes ; then
18552                 ol_cv_lib_db=-ldb
18553         fi
18554 fi
18555
18556 if test $ol_cv_lib_db = no ; then
18557         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
18558 echo "configure:18559: checking for Berkeley DB link (-ldb3)" >&5
18559 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
18560   echo $ac_n "(cached) $ac_c" 1>&6
18561 else
18562   
18563         ol_DB_LIB=-ldb3
18564         ol_LIBS=$LIBS
18565         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18566
18567         cat > conftest.$ac_ext <<EOF
18568 #line 18569 "configure"
18569 #include "confdefs.h"
18570
18571 #ifdef HAVE_DB_185_H
18572 # include <db_185.h>
18573 #else
18574 # include <db.h>
18575 #endif
18576
18577 #ifndef DB_VERSION_MAJOR
18578 # define DB_VERSION_MAJOR 1
18579 #endif
18580
18581 #ifndef NULL
18582 #define NULL ((void*)0)
18583 #endif
18584
18585 int main() {
18586
18587 #if DB_VERSION_MAJOR > 1
18588         {
18589                 char *version;
18590                 int major, minor, patch;
18591
18592                 version = db_version( &major, &minor, &patch );
18593
18594                 if( major != DB_VERSION_MAJOR ||
18595                         minor < DB_VERSION_MINOR )
18596                 {
18597                         printf("Berkeley DB version mismatch\n"
18598                                 "\texpected: %s\n\tgot: %s\n",
18599                                 DB_VERSION_STRING, version);
18600                         return 1;
18601                 }
18602         }
18603 #endif
18604
18605 #if DB_VERSION_MAJOR > 2
18606         db_env_create( NULL, 0 );
18607 #elif DB_VERSION_MAJOR > 1
18608         db_appexit( NULL );
18609 #else
18610         (void) dbopen( NULL, 0, 0, 0, NULL);
18611 #endif
18612
18613 ; return 0; }
18614 EOF
18615 if { (eval echo configure:18616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18616   rm -rf conftest*
18617   ol_cv_db_db3=yes
18618 else
18619   echo "configure: failed program was:" >&5
18620   cat conftest.$ac_ext >&5
18621   rm -rf conftest*
18622   ol_cv_db_db3=no
18623 fi
18624 rm -f conftest*
18625
18626         LIBS="$ol_LIBS"
18627
18628 fi
18629
18630 echo "$ac_t""$ol_cv_db_db3" 1>&6
18631
18632         if test $ol_cv_db_db3 = yes ; then
18633                 ol_cv_lib_db=-ldb3
18634         fi
18635 fi
18636
18637 if test $ol_cv_lib_db = no ; then
18638         echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6
18639 echo "configure:18640: checking for Berkeley DB link (-ldb-3)" >&5
18640 if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then
18641   echo $ac_n "(cached) $ac_c" 1>&6
18642 else
18643   
18644         ol_DB_LIB=-ldb-3
18645         ol_LIBS=$LIBS
18646         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18647
18648         cat > conftest.$ac_ext <<EOF
18649 #line 18650 "configure"
18650 #include "confdefs.h"
18651
18652 #ifdef HAVE_DB_185_H
18653 # include <db_185.h>
18654 #else
18655 # include <db.h>
18656 #endif
18657
18658 #ifndef DB_VERSION_MAJOR
18659 # define DB_VERSION_MAJOR 1
18660 #endif
18661
18662 #ifndef NULL
18663 #define NULL ((void*)0)
18664 #endif
18665
18666 int main() {
18667
18668 #if DB_VERSION_MAJOR > 1
18669         {
18670                 char *version;
18671                 int major, minor, patch;
18672
18673                 version = db_version( &major, &minor, &patch );
18674
18675                 if( major != DB_VERSION_MAJOR ||
18676                         minor < DB_VERSION_MINOR )
18677                 {
18678                         printf("Berkeley DB version mismatch\n"
18679                                 "\texpected: %s\n\tgot: %s\n",
18680                                 DB_VERSION_STRING, version);
18681                         return 1;
18682                 }
18683         }
18684 #endif
18685
18686 #if DB_VERSION_MAJOR > 2
18687         db_env_create( NULL, 0 );
18688 #elif DB_VERSION_MAJOR > 1
18689         db_appexit( NULL );
18690 #else
18691         (void) dbopen( NULL, 0, 0, 0, NULL);
18692 #endif
18693
18694 ; return 0; }
18695 EOF
18696 if { (eval echo configure:18697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18697   rm -rf conftest*
18698   ol_cv_db_db_3=yes
18699 else
18700   echo "configure: failed program was:" >&5
18701   cat conftest.$ac_ext >&5
18702   rm -rf conftest*
18703   ol_cv_db_db_3=no
18704 fi
18705 rm -f conftest*
18706
18707         LIBS="$ol_LIBS"
18708
18709 fi
18710
18711 echo "$ac_t""$ol_cv_db_db_3" 1>&6
18712
18713         if test $ol_cv_db_db_3 = yes ; then
18714                 ol_cv_lib_db=-ldb-3
18715         fi
18716 fi
18717
18718 if test $ol_cv_lib_db = no ; then
18719         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
18720 echo "configure:18721: checking for Berkeley DB link (-ldb2)" >&5
18721 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
18722   echo $ac_n "(cached) $ac_c" 1>&6
18723 else
18724   
18725         ol_DB_LIB=-ldb2
18726         ol_LIBS=$LIBS
18727         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18728
18729         cat > conftest.$ac_ext <<EOF
18730 #line 18731 "configure"
18731 #include "confdefs.h"
18732
18733 #ifdef HAVE_DB_185_H
18734 # include <db_185.h>
18735 #else
18736 # include <db.h>
18737 #endif
18738
18739 #ifndef DB_VERSION_MAJOR
18740 # define DB_VERSION_MAJOR 1
18741 #endif
18742
18743 #ifndef NULL
18744 #define NULL ((void*)0)
18745 #endif
18746
18747 int main() {
18748
18749 #if DB_VERSION_MAJOR > 1
18750         {
18751                 char *version;
18752                 int major, minor, patch;
18753
18754                 version = db_version( &major, &minor, &patch );
18755
18756                 if( major != DB_VERSION_MAJOR ||
18757                         minor < DB_VERSION_MINOR )
18758                 {
18759                         printf("Berkeley DB version mismatch\n"
18760                                 "\texpected: %s\n\tgot: %s\n",
18761                                 DB_VERSION_STRING, version);
18762                         return 1;
18763                 }
18764         }
18765 #endif
18766
18767 #if DB_VERSION_MAJOR > 2
18768         db_env_create( NULL, 0 );
18769 #elif DB_VERSION_MAJOR > 1
18770         db_appexit( NULL );
18771 #else
18772         (void) dbopen( NULL, 0, 0, 0, NULL);
18773 #endif
18774
18775 ; return 0; }
18776 EOF
18777 if { (eval echo configure:18778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18778   rm -rf conftest*
18779   ol_cv_db_db2=yes
18780 else
18781   echo "configure: failed program was:" >&5
18782   cat conftest.$ac_ext >&5
18783   rm -rf conftest*
18784   ol_cv_db_db2=no
18785 fi
18786 rm -f conftest*
18787
18788         LIBS="$ol_LIBS"
18789
18790 fi
18791
18792 echo "$ac_t""$ol_cv_db_db2" 1>&6
18793
18794         if test $ol_cv_db_db2 = yes ; then
18795                 ol_cv_lib_db=-ldb2
18796         fi
18797 fi
18798
18799 if test $ol_cv_lib_db = no ; then
18800         echo $ac_n "checking for Berkeley DB link (-ldb-2)""... $ac_c" 1>&6
18801 echo "configure:18802: checking for Berkeley DB link (-ldb-2)" >&5
18802 if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then
18803   echo $ac_n "(cached) $ac_c" 1>&6
18804 else
18805   
18806         ol_DB_LIB=-ldb-2
18807         ol_LIBS=$LIBS
18808         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18809
18810         cat > conftest.$ac_ext <<EOF
18811 #line 18812 "configure"
18812 #include "confdefs.h"
18813
18814 #ifdef HAVE_DB_185_H
18815 # include <db_185.h>
18816 #else
18817 # include <db.h>
18818 #endif
18819
18820 #ifndef DB_VERSION_MAJOR
18821 # define DB_VERSION_MAJOR 1
18822 #endif
18823
18824 #ifndef NULL
18825 #define NULL ((void*)0)
18826 #endif
18827
18828 int main() {
18829
18830 #if DB_VERSION_MAJOR > 1
18831         {
18832                 char *version;
18833                 int major, minor, patch;
18834
18835                 version = db_version( &major, &minor, &patch );
18836
18837                 if( major != DB_VERSION_MAJOR ||
18838                         minor < DB_VERSION_MINOR )
18839                 {
18840                         printf("Berkeley DB version mismatch\n"
18841                                 "\texpected: %s\n\tgot: %s\n",
18842                                 DB_VERSION_STRING, version);
18843                         return 1;
18844                 }
18845         }
18846 #endif
18847
18848 #if DB_VERSION_MAJOR > 2
18849         db_env_create( NULL, 0 );
18850 #elif DB_VERSION_MAJOR > 1
18851         db_appexit( NULL );
18852 #else
18853         (void) dbopen( NULL, 0, 0, 0, NULL);
18854 #endif
18855
18856 ; return 0; }
18857 EOF
18858 if { (eval echo configure:18859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18859   rm -rf conftest*
18860   ol_cv_db_db_2=yes
18861 else
18862   echo "configure: failed program was:" >&5
18863   cat conftest.$ac_ext >&5
18864   rm -rf conftest*
18865   ol_cv_db_db_2=no
18866 fi
18867 rm -f conftest*
18868
18869         LIBS="$ol_LIBS"
18870
18871 fi
18872
18873 echo "$ac_t""$ol_cv_db_db_2" 1>&6
18874
18875         if test $ol_cv_db_db_2 = yes ; then
18876                 ol_cv_lib_db=-ldb-2
18877         fi
18878 fi
18879
18880 if test $ol_cv_lib_db = no ; then
18881         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
18882 echo "configure:18883: checking for Berkeley DB link (-ldb1)" >&5
18883 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
18884   echo $ac_n "(cached) $ac_c" 1>&6
18885 else
18886   
18887         ol_DB_LIB=-ldb1
18888         ol_LIBS=$LIBS
18889         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18890
18891         cat > conftest.$ac_ext <<EOF
18892 #line 18893 "configure"
18893 #include "confdefs.h"
18894
18895 #ifdef HAVE_DB_185_H
18896 # include <db_185.h>
18897 #else
18898 # include <db.h>
18899 #endif
18900
18901 #ifndef DB_VERSION_MAJOR
18902 # define DB_VERSION_MAJOR 1
18903 #endif
18904
18905 #ifndef NULL
18906 #define NULL ((void*)0)
18907 #endif
18908
18909 int main() {
18910
18911 #if DB_VERSION_MAJOR > 1
18912         {
18913                 char *version;
18914                 int major, minor, patch;
18915
18916                 version = db_version( &major, &minor, &patch );
18917
18918                 if( major != DB_VERSION_MAJOR ||
18919                         minor < DB_VERSION_MINOR )
18920                 {
18921                         printf("Berkeley DB version mismatch\n"
18922                                 "\texpected: %s\n\tgot: %s\n",
18923                                 DB_VERSION_STRING, version);
18924                         return 1;
18925                 }
18926         }
18927 #endif
18928
18929 #if DB_VERSION_MAJOR > 2
18930         db_env_create( NULL, 0 );
18931 #elif DB_VERSION_MAJOR > 1
18932         db_appexit( NULL );
18933 #else
18934         (void) dbopen( NULL, 0, 0, 0, NULL);
18935 #endif
18936
18937 ; return 0; }
18938 EOF
18939 if { (eval echo configure:18940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18940   rm -rf conftest*
18941   ol_cv_db_db1=yes
18942 else
18943   echo "configure: failed program was:" >&5
18944   cat conftest.$ac_ext >&5
18945   rm -rf conftest*
18946   ol_cv_db_db1=no
18947 fi
18948 rm -f conftest*
18949
18950         LIBS="$ol_LIBS"
18951
18952 fi
18953
18954 echo "$ac_t""$ol_cv_db_db1" 1>&6
18955
18956         if test $ol_cv_db_db1 = yes ; then
18957                 ol_cv_lib_db=-ldb1
18958         fi
18959 fi
18960
18961 if test $ol_cv_lib_db = no ; then
18962         echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6
18963 echo "configure:18964: checking for Berkeley DB link (-ldb-1)" >&5
18964 if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then
18965   echo $ac_n "(cached) $ac_c" 1>&6
18966 else
18967   
18968         ol_DB_LIB=-ldb-1
18969         ol_LIBS=$LIBS
18970         LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
18971
18972         cat > conftest.$ac_ext <<EOF
18973 #line 18974 "configure"
18974 #include "confdefs.h"
18975
18976 #ifdef HAVE_DB_185_H
18977 # include <db_185.h>
18978 #else
18979 # include <db.h>
18980 #endif
18981
18982 #ifndef DB_VERSION_MAJOR
18983 # define DB_VERSION_MAJOR 1
18984 #endif
18985
18986 #ifndef NULL
18987 #define NULL ((void*)0)
18988 #endif
18989
18990 int main() {
18991
18992 #if DB_VERSION_MAJOR > 1
18993         {
18994                 char *version;
18995                 int major, minor, patch;
18996
18997                 version = db_version( &major, &minor, &patch );
18998
18999                 if( major != DB_VERSION_MAJOR ||
19000                         minor < DB_VERSION_MINOR )
19001                 {
19002                         printf("Berkeley DB version mismatch\n"
19003                                 "\texpected: %s\n\tgot: %s\n",
19004                                 DB_VERSION_STRING, version);
19005                         return 1;
19006                 }
19007         }
19008 #endif
19009
19010 #if DB_VERSION_MAJOR > 2
19011         db_env_create( NULL, 0 );
19012 #elif DB_VERSION_MAJOR > 1
19013         db_appexit( NULL );
19014 #else
19015         (void) dbopen( NULL, 0, 0, 0, NULL);
19016 #endif
19017
19018 ; return 0; }
19019 EOF
19020 if { (eval echo configure:19021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19021   rm -rf conftest*
19022   ol_cv_db_db_1=yes
19023 else
19024   echo "configure: failed program was:" >&5
19025   cat conftest.$ac_ext >&5
19026   rm -rf conftest*
19027   ol_cv_db_db_1=no
19028 fi
19029 rm -f conftest*
19030
19031         LIBS="$ol_LIBS"
19032
19033 fi
19034
19035 echo "$ac_t""$ol_cv_db_db_1" 1>&6
19036
19037         if test $ol_cv_db_db_1 = yes ; then
19038                 ol_cv_lib_db=-ldb-1
19039         fi
19040 fi
19041
19042
19043         if test "$ol_cv_lib_db" != no ; then
19044                 ol_cv_berkeley_db=yes
19045                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
19046 echo "configure:19047: checking for Berkeley DB thread support" >&5
19047 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
19048   echo $ac_n "(cached) $ac_c" 1>&6
19049 else
19050   
19051         ol_LIBS="$LIBS"
19052         LIBS="$LTHREAD_LIBS $LIBS"
19053         if test $ol_cv_lib_db != yes ; then
19054                 LIBS="$ol_cv_lib_db $LIBS"
19055         fi
19056
19057         if test "$cross_compiling" = yes; then
19058   ol_cv_berkeley_db_thread=cross
19059 else
19060   cat > conftest.$ac_ext <<EOF
19061 #line 19062 "configure"
19062 #include "confdefs.h"
19063
19064 #ifdef HAVE_DB_185_H
19065         choke me;
19066 #else
19067 #include <db.h>
19068 #endif
19069 #ifndef NULL
19070 #define NULL ((void *)0)
19071 #endif
19072 main()
19073 {
19074         int rc;
19075         u_int32_t flags = DB_CREATE |
19076 #ifdef DB_PRIVATE
19077                 DB_PRIVATE |
19078 #endif
19079                 DB_THREAD;
19080
19081 #if DB_VERSION_MAJOR > 2
19082         DB_ENV *env = NULL;
19083
19084         rc = db_env_create( &env, 0 );
19085
19086         flags |= DB_INIT_MPOOL;
19087 #ifdef DB_MPOOL_PRIVATE
19088         flags |= DB_MPOOL_PRIVATE;
19089 #endif
19090
19091         if( rc ) {
19092                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
19093                 return rc;
19094         }
19095
19096 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
19097         rc = env->open( env, NULL, flags, 0 );
19098 #else
19099         rc = env->open( env, NULL, NULL, flags, 0 );
19100 #endif
19101
19102         if ( rc == 0 ) {
19103                 rc = env->close( env, 0 );
19104         }
19105
19106         if( rc ) {
19107                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
19108                 return rc;
19109         }
19110
19111 #else
19112         DB_ENV env;
19113         memset( &env, '\0', sizeof(env) );
19114
19115         rc = db_appinit( NULL, NULL, &env, flags );
19116
19117         if( rc == 0 ) {
19118                 db_appexit( &env );
19119         }
19120
19121         unlink("__db_mpool.share");
19122         unlink("__db_lock.share");
19123 #endif
19124
19125         return rc;
19126 }
19127 EOF
19128 if { (eval echo configure:19129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
19129 then
19130   ol_cv_berkeley_db_thread=yes
19131 else
19132   echo "configure: failed program was:" >&5
19133   cat conftest.$ac_ext >&5
19134   rm -fr conftest*
19135   ol_cv_berkeley_db_thread=no
19136 fi
19137 rm -fr conftest*
19138 fi
19139
19140
19141         LIBS="$ol_LIBS"
19142
19143 fi
19144
19145 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
19146
19147         if test $ol_cv_berkeley_db_thread != no ; then
19148                 cat >> confdefs.h <<\EOF
19149 #define HAVE_BERKELEY_DB_THREAD 1
19150 EOF
19151
19152         fi
19153
19154         fi
19155 fi
19156
19157         fi
19158
19159         if test $ol_cv_berkeley_db != no ; then
19160                 cat >> confdefs.h <<\EOF
19161 #define HAVE_BERKELEY_DB 1
19162 EOF
19163
19164
19165                 ol_link_ldbm=berkeley
19166                 ol_with_ldbm_api=berkeley
19167
19168                 if test $ol_with_ldbm_type = hash ; then
19169                         cat >> confdefs.h <<\EOF
19170 #define LDBM_USE_DBHASH 1
19171 EOF
19172
19173                 else
19174                         cat >> confdefs.h <<\EOF
19175 #define LDBM_USE_DBBTREE 1
19176 EOF
19177
19178                 fi
19179
19180                                                 if test $ol_cv_lib_db != yes ; then
19181                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
19182                 fi
19183         fi
19184 fi
19185
19186 if test $ol_enable_bdb = yes -a $ol_link_ldbm != berkeley ; then
19187         { echo "configure: error: BDB: BerkeleyDB not available" 1>&2; exit 1; }
19188 elif test $ol_enable_bdb != no -a $ol_link_ldbm = berkeley ; then
19189         echo $ac_n "checking Berkeley DB version for BDB backend""... $ac_c" 1>&6
19190 echo "configure:19191: checking Berkeley DB version for BDB backend" >&5
19191 if eval "test \"\${ol_cv_bdb_compat+set}\" = set"; then
19192   echo $ac_n "(cached) $ac_c" 1>&6
19193 else
19194   
19195         cat > conftest.$ac_ext <<EOF
19196 #line 19197 "configure"
19197 #include "confdefs.h"
19198
19199 #include <db.h>
19200
19201  /* this check could be improved */
19202 #ifndef DB_VERSION_MAJOR
19203 #       define DB_VERSION_MAJOR 1
19204 #endif
19205 #ifndef DB_VERSION_MINOR
19206 #       define DB_VERSION_MINOR 0
19207 #endif
19208
19209 /* require 4.0 or later */
19210 #if (DB_VERSION_MAJOR >= 4) && (DB_VERSION_MINOR >= 1)
19211         __db_version_compat
19212 #endif
19213         
19214 EOF
19215 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
19216   egrep "__db_version_compat" >/dev/null 2>&1; then
19217   rm -rf conftest*
19218   ol_cv_bdb_compat=yes
19219 else
19220   rm -rf conftest*
19221   ol_cv_bdb_compat=no
19222 fi
19223 rm -f conftest*
19224
19225 fi
19226
19227 echo "$ac_t""$ol_cv_bdb_compat" 1>&6
19228
19229
19230         if test $ol_cv_bdb_compat = yes ; then
19231                 ol_enable_bdb=yes
19232         elif test $ol_enable_bdb = yes ; then
19233                 { echo "configure: error: BDB: BerkeleyDB version incompatible" 1>&2; exit 1; }
19234         else
19235                 ol_enable_bdb=no
19236         fi
19237 fi
19238
19239 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
19240         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
19241         ol_with_ldbm_api=none
19242 fi
19243
19244 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
19245         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
19246 echo "configure:19247: checking for MDBM library" >&5
19247 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
19248   echo $ac_n "(cached) $ac_c" 1>&6
19249 else
19250         ol_LIBS="$LIBS"
19251         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
19252 echo "configure:19253: checking for mdbm_set_chain" >&5
19253 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
19254   echo $ac_n "(cached) $ac_c" 1>&6
19255 else
19256   cat > conftest.$ac_ext <<EOF
19257 #line 19258 "configure"
19258 #include "confdefs.h"
19259 /* System header to define __stub macros and hopefully few prototypes,
19260     which can conflict with char mdbm_set_chain(); below.  */
19261 #include <assert.h>
19262 /* Override any gcc2 internal prototype to avoid an error.  */
19263 /* We use char because int might match the return type of a gcc2
19264     builtin and then its argument prototype would still apply.  */
19265 char mdbm_set_chain();
19266 char (*f)();
19267
19268 int main() {
19269
19270 /* The GNU C library defines this for functions which it implements
19271     to always fail with ENOSYS.  Some functions are actually named
19272     something starting with __ and the normal name is an alias.  */
19273 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
19274 choke me
19275 #else
19276 f = mdbm_set_chain;
19277 #endif
19278
19279 ; return 0; }
19280 EOF
19281 if { (eval echo configure:19282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19282   rm -rf conftest*
19283   eval "ac_cv_func_mdbm_set_chain=yes"
19284 else
19285   echo "configure: failed program was:" >&5
19286   cat conftest.$ac_ext >&5
19287   rm -rf conftest*
19288   eval "ac_cv_func_mdbm_set_chain=no"
19289 fi
19290 rm -f conftest*
19291 fi
19292
19293 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
19294   echo "$ac_t""yes" 1>&6
19295   ol_cv_lib_mdbm=yes
19296 else
19297   echo "$ac_t""no" 1>&6
19298
19299                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
19300 echo "configure:19301: checking for mdbm_set_chain in -lmdbm" >&5
19301 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
19302 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19303   echo $ac_n "(cached) $ac_c" 1>&6
19304 else
19305   ac_save_LIBS="$LIBS"
19306 LIBS="-lmdbm  $LIBS"
19307 cat > conftest.$ac_ext <<EOF
19308 #line 19309 "configure"
19309 #include "confdefs.h"
19310 /* Override any gcc2 internal prototype to avoid an error.  */
19311 /* We use char because int might match the return type of a gcc2
19312     builtin and then its argument prototype would still apply.  */
19313 char mdbm_set_chain();
19314
19315 int main() {
19316 mdbm_set_chain()
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   eval "ac_cv_lib_$ac_lib_var=yes"
19322 else
19323   echo "configure: failed program was:" >&5
19324   cat conftest.$ac_ext >&5
19325   rm -rf conftest*
19326   eval "ac_cv_lib_$ac_lib_var=no"
19327 fi
19328 rm -f conftest*
19329 LIBS="$ac_save_LIBS"
19330
19331 fi
19332 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19333   echo "$ac_t""yes" 1>&6
19334   ol_cv_lib_mdbm=-lmdbm
19335 else
19336   echo "$ac_t""no" 1>&6
19337 ol_cv_lib_mdbm=no
19338 fi
19339
19340         
19341 fi
19342
19343         LIBS="$ol_LIBS"
19344
19345 fi
19346
19347 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
19348
19349
19350  for ac_hdr in mdbm.h
19351 do
19352 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19353 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19354 echo "configure:19355: checking for $ac_hdr" >&5
19355 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19356   echo $ac_n "(cached) $ac_c" 1>&6
19357 else
19358   cat > conftest.$ac_ext <<EOF
19359 #line 19360 "configure"
19360 #include "confdefs.h"
19361 #include <$ac_hdr>
19362 EOF
19363 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19364 { (eval echo configure:19365: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19365 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19366 if test -z "$ac_err"; then
19367   rm -rf conftest*
19368   eval "ac_cv_header_$ac_safe=yes"
19369 else
19370   echo "$ac_err" >&5
19371   echo "configure: failed program was:" >&5
19372   cat conftest.$ac_ext >&5
19373   rm -rf conftest*
19374   eval "ac_cv_header_$ac_safe=no"
19375 fi
19376 rm -f conftest*
19377 fi
19378 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19379   echo "$ac_t""yes" 1>&6
19380     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19381   cat >> confdefs.h <<EOF
19382 #define $ac_tr_hdr 1
19383 EOF
19384  
19385 else
19386   echo "$ac_t""no" 1>&6
19387 fi
19388 done
19389
19390  echo $ac_n "checking for db""... $ac_c" 1>&6
19391 echo "configure:19392: checking for db" >&5
19392 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
19393   echo $ac_n "(cached) $ac_c" 1>&6
19394 else
19395   
19396         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
19397                 ol_cv_mdbm=no
19398         else
19399                 ol_cv_mdbm=yes
19400         fi
19401
19402 fi
19403
19404 echo "$ac_t""$ol_cv_mdbm" 1>&6
19405  if test $ol_cv_mdbm = yes ; then
19406         cat >> confdefs.h <<\EOF
19407 #define HAVE_MDBM 1
19408 EOF
19409
19410  fi
19411
19412
19413         if test $ol_cv_mdbm = yes ; then
19414                 ol_link_ldbm=mdbm
19415                 ol_with_ldbm_api=mdbm
19416                 if test $ol_cv_lib_mdbm != yes ; then
19417                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
19418                 fi
19419         fi
19420 fi
19421
19422 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
19423         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
19424 echo "configure:19425: checking for GDBM library" >&5
19425 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
19426   echo $ac_n "(cached) $ac_c" 1>&6
19427 else
19428         ol_LIBS="$LIBS"
19429         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
19430 echo "configure:19431: checking for gdbm_open" >&5
19431 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
19432   echo $ac_n "(cached) $ac_c" 1>&6
19433 else
19434   cat > conftest.$ac_ext <<EOF
19435 #line 19436 "configure"
19436 #include "confdefs.h"
19437 /* System header to define __stub macros and hopefully few prototypes,
19438     which can conflict with char gdbm_open(); below.  */
19439 #include <assert.h>
19440 /* Override any gcc2 internal prototype to avoid an error.  */
19441 /* We use char because int might match the return type of a gcc2
19442     builtin and then its argument prototype would still apply.  */
19443 char gdbm_open();
19444 char (*f)();
19445
19446 int main() {
19447
19448 /* The GNU C library defines this for functions which it implements
19449     to always fail with ENOSYS.  Some functions are actually named
19450     something starting with __ and the normal name is an alias.  */
19451 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
19452 choke me
19453 #else
19454 f = gdbm_open;
19455 #endif
19456
19457 ; return 0; }
19458 EOF
19459 if { (eval echo configure:19460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19460   rm -rf conftest*
19461   eval "ac_cv_func_gdbm_open=yes"
19462 else
19463   echo "configure: failed program was:" >&5
19464   cat conftest.$ac_ext >&5
19465   rm -rf conftest*
19466   eval "ac_cv_func_gdbm_open=no"
19467 fi
19468 rm -f conftest*
19469 fi
19470
19471 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
19472   echo "$ac_t""yes" 1>&6
19473   ol_cv_lib_gdbm=yes
19474 else
19475   echo "$ac_t""no" 1>&6
19476
19477                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
19478 echo "configure:19479: checking for gdbm_open in -lgdbm" >&5
19479 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
19480 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19481   echo $ac_n "(cached) $ac_c" 1>&6
19482 else
19483   ac_save_LIBS="$LIBS"
19484 LIBS="-lgdbm  $LIBS"
19485 cat > conftest.$ac_ext <<EOF
19486 #line 19487 "configure"
19487 #include "confdefs.h"
19488 /* Override any gcc2 internal prototype to avoid an error.  */
19489 /* We use char because int might match the return type of a gcc2
19490     builtin and then its argument prototype would still apply.  */
19491 char gdbm_open();
19492
19493 int main() {
19494 gdbm_open()
19495 ; return 0; }
19496 EOF
19497 if { (eval echo configure:19498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19498   rm -rf conftest*
19499   eval "ac_cv_lib_$ac_lib_var=yes"
19500 else
19501   echo "configure: failed program was:" >&5
19502   cat conftest.$ac_ext >&5
19503   rm -rf conftest*
19504   eval "ac_cv_lib_$ac_lib_var=no"
19505 fi
19506 rm -f conftest*
19507 LIBS="$ac_save_LIBS"
19508
19509 fi
19510 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19511   echo "$ac_t""yes" 1>&6
19512   ol_cv_lib_gdbm=-lgdbm
19513 else
19514   echo "$ac_t""no" 1>&6
19515 ol_cv_lib_gdbm=no
19516 fi
19517
19518         
19519 fi
19520
19521         LIBS="$ol_LIBS"
19522
19523 fi
19524
19525 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
19526
19527
19528  for ac_hdr in gdbm.h
19529 do
19530 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19531 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19532 echo "configure:19533: checking for $ac_hdr" >&5
19533 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19534   echo $ac_n "(cached) $ac_c" 1>&6
19535 else
19536   cat > conftest.$ac_ext <<EOF
19537 #line 19538 "configure"
19538 #include "confdefs.h"
19539 #include <$ac_hdr>
19540 EOF
19541 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19542 { (eval echo configure:19543: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19543 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19544 if test -z "$ac_err"; then
19545   rm -rf conftest*
19546   eval "ac_cv_header_$ac_safe=yes"
19547 else
19548   echo "$ac_err" >&5
19549   echo "configure: failed program was:" >&5
19550   cat conftest.$ac_ext >&5
19551   rm -rf conftest*
19552   eval "ac_cv_header_$ac_safe=no"
19553 fi
19554 rm -f conftest*
19555 fi
19556 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19557   echo "$ac_t""yes" 1>&6
19558     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19559   cat >> confdefs.h <<EOF
19560 #define $ac_tr_hdr 1
19561 EOF
19562  
19563 else
19564   echo "$ac_t""no" 1>&6
19565 fi
19566 done
19567
19568  echo $ac_n "checking for db""... $ac_c" 1>&6
19569 echo "configure:19570: checking for db" >&5
19570 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
19571   echo $ac_n "(cached) $ac_c" 1>&6
19572 else
19573   
19574         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
19575                 ol_cv_gdbm=no
19576         else
19577                 ol_cv_gdbm=yes
19578         fi
19579
19580 fi
19581
19582 echo "$ac_t""$ol_cv_gdbm" 1>&6
19583  if test $ol_cv_gdbm = yes ; then
19584         cat >> confdefs.h <<\EOF
19585 #define HAVE_GDBM 1
19586 EOF
19587
19588  fi
19589
19590
19591         if test $ol_cv_gdbm = yes ; then
19592                 ol_link_ldbm=gdbm
19593                 ol_with_ldbm_api=gdbm
19594
19595                 if test $ol_cv_lib_gdbm != yes ; then
19596                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
19597                 fi
19598         fi
19599 fi
19600
19601 if test $ol_with_ldbm_api = ndbm ; then
19602         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
19603 echo "configure:19604: checking for NDBM library" >&5
19604 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
19605   echo $ac_n "(cached) $ac_c" 1>&6
19606 else
19607         ol_LIBS="$LIBS"
19608         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
19609 echo "configure:19610: checking for dbm_open" >&5
19610 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
19611   echo $ac_n "(cached) $ac_c" 1>&6
19612 else
19613   cat > conftest.$ac_ext <<EOF
19614 #line 19615 "configure"
19615 #include "confdefs.h"
19616 /* System header to define __stub macros and hopefully few prototypes,
19617     which can conflict with char dbm_open(); below.  */
19618 #include <assert.h>
19619 /* Override any gcc2 internal prototype to avoid an error.  */
19620 /* We use char because int might match the return type of a gcc2
19621     builtin and then its argument prototype would still apply.  */
19622 char dbm_open();
19623 char (*f)();
19624
19625 int main() {
19626
19627 /* The GNU C library defines this for functions which it implements
19628     to always fail with ENOSYS.  Some functions are actually named
19629     something starting with __ and the normal name is an alias.  */
19630 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
19631 choke me
19632 #else
19633 f = dbm_open;
19634 #endif
19635
19636 ; return 0; }
19637 EOF
19638 if { (eval echo configure:19639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19639   rm -rf conftest*
19640   eval "ac_cv_func_dbm_open=yes"
19641 else
19642   echo "configure: failed program was:" >&5
19643   cat conftest.$ac_ext >&5
19644   rm -rf conftest*
19645   eval "ac_cv_func_dbm_open=no"
19646 fi
19647 rm -f conftest*
19648 fi
19649
19650 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
19651   echo "$ac_t""yes" 1>&6
19652   ol_cv_lib_ndbm=yes
19653 else
19654   echo "$ac_t""no" 1>&6
19655
19656                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
19657 echo "configure:19658: checking for dbm_open in -lndbm" >&5
19658 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
19659 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19660   echo $ac_n "(cached) $ac_c" 1>&6
19661 else
19662   ac_save_LIBS="$LIBS"
19663 LIBS="-lndbm  $LIBS"
19664 cat > conftest.$ac_ext <<EOF
19665 #line 19666 "configure"
19666 #include "confdefs.h"
19667 /* Override any gcc2 internal prototype to avoid an error.  */
19668 /* We use char because int might match the return type of a gcc2
19669     builtin and then its argument prototype would still apply.  */
19670 char dbm_open();
19671
19672 int main() {
19673 dbm_open()
19674 ; return 0; }
19675 EOF
19676 if { (eval echo configure:19677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19677   rm -rf conftest*
19678   eval "ac_cv_lib_$ac_lib_var=yes"
19679 else
19680   echo "configure: failed program was:" >&5
19681   cat conftest.$ac_ext >&5
19682   rm -rf conftest*
19683   eval "ac_cv_lib_$ac_lib_var=no"
19684 fi
19685 rm -f conftest*
19686 LIBS="$ac_save_LIBS"
19687
19688 fi
19689 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19690   echo "$ac_t""yes" 1>&6
19691   ol_cv_lib_ndbm=-lndbm
19692 else
19693   echo "$ac_t""no" 1>&6
19694
19695                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
19696 echo "configure:19697: checking for dbm_open in -ldbm" >&5
19697 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
19698 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19699   echo $ac_n "(cached) $ac_c" 1>&6
19700 else
19701   ac_save_LIBS="$LIBS"
19702 LIBS="-ldbm  $LIBS"
19703 cat > conftest.$ac_ext <<EOF
19704 #line 19705 "configure"
19705 #include "confdefs.h"
19706 /* Override any gcc2 internal prototype to avoid an error.  */
19707 /* We use char because int might match the return type of a gcc2
19708     builtin and then its argument prototype would still apply.  */
19709 char dbm_open();
19710
19711 int main() {
19712 dbm_open()
19713 ; return 0; }
19714 EOF
19715 if { (eval echo configure:19716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19716   rm -rf conftest*
19717   eval "ac_cv_lib_$ac_lib_var=yes"
19718 else
19719   echo "configure: failed program was:" >&5
19720   cat conftest.$ac_ext >&5
19721   rm -rf conftest*
19722   eval "ac_cv_lib_$ac_lib_var=no"
19723 fi
19724 rm -f conftest*
19725 LIBS="$ac_save_LIBS"
19726
19727 fi
19728 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19729   echo "$ac_t""yes" 1>&6
19730   ol_cv_lib_ndbm=-ldbm
19731 else
19732   echo "$ac_t""no" 1>&6
19733 ol_cv_lib_ndbm=no
19734 fi
19735                 
19736 fi
19737
19738         
19739 fi
19740
19741         LIBS="$ol_LIBS"
19742
19743 fi
19744
19745 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
19746
19747
19748  for ac_hdr in ndbm.h
19749 do
19750 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19751 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19752 echo "configure:19753: checking for $ac_hdr" >&5
19753 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19754   echo $ac_n "(cached) $ac_c" 1>&6
19755 else
19756   cat > conftest.$ac_ext <<EOF
19757 #line 19758 "configure"
19758 #include "confdefs.h"
19759 #include <$ac_hdr>
19760 EOF
19761 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19762 { (eval echo configure:19763: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19763 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19764 if test -z "$ac_err"; then
19765   rm -rf conftest*
19766   eval "ac_cv_header_$ac_safe=yes"
19767 else
19768   echo "$ac_err" >&5
19769   echo "configure: failed program was:" >&5
19770   cat conftest.$ac_ext >&5
19771   rm -rf conftest*
19772   eval "ac_cv_header_$ac_safe=no"
19773 fi
19774 rm -f conftest*
19775 fi
19776 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19777   echo "$ac_t""yes" 1>&6
19778     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19779   cat >> confdefs.h <<EOF
19780 #define $ac_tr_hdr 1
19781 EOF
19782  
19783 else
19784   echo "$ac_t""no" 1>&6
19785 fi
19786 done
19787
19788  echo $ac_n "checking for db""... $ac_c" 1>&6
19789 echo "configure:19790: checking for db" >&5
19790 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
19791   echo $ac_n "(cached) $ac_c" 1>&6
19792 else
19793   
19794         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
19795                 ol_cv_ndbm=no
19796         else
19797                 ol_cv_ndbm=yes
19798         fi
19799
19800 fi
19801
19802 echo "$ac_t""$ol_cv_ndbm" 1>&6
19803  if test $ol_cv_ndbm = yes ; then
19804         cat >> confdefs.h <<\EOF
19805 #define HAVE_NDBM 1
19806 EOF
19807
19808  fi
19809
19810
19811         if test $ol_cv_ndbm = yes ; then
19812                 ol_link_ldbm=ndbm
19813                 ol_with_ldbm_api=ndbm
19814
19815                 if test $ol_cv_lib_ndbm != yes ; then
19816                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
19817                 fi
19818         fi
19819 fi
19820
19821 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
19822         echo "configure: warning: could not find suitable LDBM backend" 1>&2
19823         if test $ol_enable_ldbm = yes ; then
19824                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
19825         fi
19826
19827         echo "configure: warning: disabling LDBM" 1>&2
19828         ol_enable_ldbm=no
19829 fi
19830
19831
19832 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
19833         BUILD_LIBS_DYNAMIC=shared
19834         cat >> confdefs.h <<\EOF
19835 #define LDAP_LIBS_DYNAMIC 1
19836 EOF
19837
19838         LTSTATIC=""
19839 else
19840         BUILD_LIBS_DYNAMIC=static
19841         LTSTATIC="-static"
19842 fi
19843
19844 if test $ol_enable_wrappers != no ; then
19845         for ac_hdr in tcpd.h
19846 do
19847 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19848 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19849 echo "configure:19850: checking for $ac_hdr" >&5
19850 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19851   echo $ac_n "(cached) $ac_c" 1>&6
19852 else
19853   cat > conftest.$ac_ext <<EOF
19854 #line 19855 "configure"
19855 #include "confdefs.h"
19856 #include <$ac_hdr>
19857 EOF
19858 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19859 { (eval echo configure:19860: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19860 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19861 if test -z "$ac_err"; then
19862   rm -rf conftest*
19863   eval "ac_cv_header_$ac_safe=yes"
19864 else
19865   echo "$ac_err" >&5
19866   echo "configure: failed program was:" >&5
19867   cat conftest.$ac_ext >&5
19868   rm -rf conftest*
19869   eval "ac_cv_header_$ac_safe=no"
19870 fi
19871 rm -f conftest*
19872 fi
19873 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19874   echo "$ac_t""yes" 1>&6
19875     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19876   cat >> confdefs.h <<EOF
19877 #define $ac_tr_hdr 1
19878 EOF
19879  
19880                 echo $ac_n "checking for TCP wrappers library""... $ac_c" 1>&6
19881 echo "configure:19882: checking for TCP wrappers library" >&5
19882                 save_LIBS="$LIBS"
19883                 LIBS="$LIBS -lwrap"
19884                 cat > conftest.$ac_ext <<EOF
19885 #line 19886 "configure"
19886 #include "confdefs.h"
19887
19888 #include <tcpd.h>
19889 int allow_severity = 0;
19890 int deny_severity  = 0;
19891
19892 struct request_info *req;
19893                 
19894 int main() {
19895
19896 hosts_access(req)
19897                 
19898 ; return 0; }
19899 EOF
19900 if { (eval echo configure:19901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19901   rm -rf conftest*
19902   echo "$ac_t""-lwrap" 1>&6
19903                 have_wrappers=yes
19904                 LIBS="$save_LIBS"
19905 else
19906   echo "configure: failed program was:" >&5
19907   cat conftest.$ac_ext >&5
19908   rm -rf conftest*
19909   
19910                                 LIBS="$LIBS -lnsl"
19911                 cat > conftest.$ac_ext <<EOF
19912 #line 19913 "configure"
19913 #include "confdefs.h"
19914
19915 #include <tcpd.h>
19916 int allow_severity = 0;
19917 int deny_severity  = 0;
19918
19919 struct request_info *req;
19920                 
19921 int main() {
19922
19923 hosts_access(req)
19924                 
19925 ; return 0; }
19926 EOF
19927 if { (eval echo configure:19928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19928   rm -rf conftest*
19929   echo "$ac_t""-lwrap -lnsl" 1>&6
19930                 have_wrappers=yes
19931                 LIBS="$save_LIBS -lnsl"
19932 else
19933   echo "configure: failed program was:" >&5
19934   cat conftest.$ac_ext >&5
19935   rm -rf conftest*
19936   
19937                 echo "$ac_t""no" 1>&6
19938                 have_wrappers=no
19939                 LIBS=$save_LIBS
19940 fi
19941 rm -f conftest*
19942 fi
19943 rm -f conftest*
19944 else
19945   echo "$ac_t""no" 1>&6
19946 have_wrappers=no
19947 fi
19948 done
19949
19950
19951         if test $have_wrappers = yes ; then
19952                 cat >> confdefs.h <<\EOF
19953 #define HAVE_TCPD 1
19954 EOF
19955
19956                 WRAP_LIBS="-lwrap"
19957         elif test $ol_enable_wrappers = yes ; then
19958                 { echo "configure: error: could not find TCP wrappers, select apppropriate options ore disable" 1>&2; exit 1; }
19959         else
19960                 echo "configure: warning: could not find TCP wrappers, support disabled" 1>&2
19961                 WRAP_LIBS=""
19962         fi
19963 fi
19964
19965 if test $ol_enable_syslog != no ; then
19966         echo $ac_n "checking for openlog""... $ac_c" 1>&6
19967 echo "configure:19968: checking for openlog" >&5
19968 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
19969   echo $ac_n "(cached) $ac_c" 1>&6
19970 else
19971   cat > conftest.$ac_ext <<EOF
19972 #line 19973 "configure"
19973 #include "confdefs.h"
19974 /* System header to define __stub macros and hopefully few prototypes,
19975     which can conflict with char openlog(); below.  */
19976 #include <assert.h>
19977 /* Override any gcc2 internal prototype to avoid an error.  */
19978 /* We use char because int might match the return type of a gcc2
19979     builtin and then its argument prototype would still apply.  */
19980 char openlog();
19981 char (*f)();
19982
19983 int main() {
19984
19985 /* The GNU C library defines this for functions which it implements
19986     to always fail with ENOSYS.  Some functions are actually named
19987     something starting with __ and the normal name is an alias.  */
19988 #if defined (__stub_openlog) || defined (__stub___openlog)
19989 choke me
19990 #else
19991 f = openlog;
19992 #endif
19993
19994 ; return 0; }
19995 EOF
19996 if { (eval echo configure:19997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19997   rm -rf conftest*
19998   eval "ac_cv_func_openlog=yes"
19999 else
20000   echo "configure: failed program was:" >&5
20001   cat conftest.$ac_ext >&5
20002   rm -rf conftest*
20003   eval "ac_cv_func_openlog=no"
20004 fi
20005 rm -f conftest*
20006 fi
20007
20008 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
20009   echo "$ac_t""yes" 1>&6
20010   :
20011 else
20012   echo "$ac_t""no" 1>&6
20013 fi
20014
20015         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
20016                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
20017         fi
20018         ol_enable_syslog=$ac_cv_func_openlog
20019 fi
20020
20021
20022 ol_link_sql=no
20023 if test $ol_enable_sql != no ; then
20024         for ac_hdr in sql.h sqlext.h
20025 do
20026 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20027 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20028 echo "configure:20029: checking for $ac_hdr" >&5
20029 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20030   echo $ac_n "(cached) $ac_c" 1>&6
20031 else
20032   cat > conftest.$ac_ext <<EOF
20033 #line 20034 "configure"
20034 #include "confdefs.h"
20035 #include <$ac_hdr>
20036 EOF
20037 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20038 { (eval echo configure:20039: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20039 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20040 if test -z "$ac_err"; then
20041   rm -rf conftest*
20042   eval "ac_cv_header_$ac_safe=yes"
20043 else
20044   echo "$ac_err" >&5
20045   echo "configure: failed program was:" >&5
20046   cat conftest.$ac_ext >&5
20047   rm -rf conftest*
20048   eval "ac_cv_header_$ac_safe=no"
20049 fi
20050 rm -f conftest*
20051 fi
20052 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20053   echo "$ac_t""yes" 1>&6
20054     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20055   cat >> confdefs.h <<EOF
20056 #define $ac_tr_hdr 1
20057 EOF
20058  
20059 else
20060   echo "$ac_t""no" 1>&6
20061 { echo "configure: error: could not locate SQL headers" 1>&2; exit 1; }
20062         
20063 fi
20064 done
20065
20066
20067         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
20068 echo "configure:20069: checking for SQLDriverConnect in -liodbc" >&5
20069 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
20070 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20071   echo $ac_n "(cached) $ac_c" 1>&6
20072 else
20073   ac_save_LIBS="$LIBS"
20074 LIBS="-liodbc  $LIBS"
20075 cat > conftest.$ac_ext <<EOF
20076 #line 20077 "configure"
20077 #include "confdefs.h"
20078 /* Override any gcc2 internal prototype to avoid an error.  */
20079 /* We use char because int might match the return type of a gcc2
20080     builtin and then its argument prototype would still apply.  */
20081 char SQLDriverConnect();
20082
20083 int main() {
20084 SQLDriverConnect()
20085 ; return 0; }
20086 EOF
20087 if { (eval echo configure:20088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20088   rm -rf conftest*
20089   eval "ac_cv_lib_$ac_lib_var=yes"
20090 else
20091   echo "configure: failed program was:" >&5
20092   cat conftest.$ac_ext >&5
20093   rm -rf conftest*
20094   eval "ac_cv_lib_$ac_lib_var=no"
20095 fi
20096 rm -f conftest*
20097 LIBS="$ac_save_LIBS"
20098
20099 fi
20100 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20101   echo "$ac_t""yes" 1>&6
20102   have_iodbc=yes
20103 else
20104   echo "$ac_t""no" 1>&6
20105 have_iodbc=no
20106 fi
20107
20108         if test $have_iodbc = yes ; then
20109                 ol_link_sql="-liodbc"
20110         else
20111                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
20112 echo "configure:20113: checking for SQLDriverConnect in -lodbc" >&5
20113 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
20114 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20115   echo $ac_n "(cached) $ac_c" 1>&6
20116 else
20117   ac_save_LIBS="$LIBS"
20118 LIBS="-lodbc  $LIBS"
20119 cat > conftest.$ac_ext <<EOF
20120 #line 20121 "configure"
20121 #include "confdefs.h"
20122 /* Override any gcc2 internal prototype to avoid an error.  */
20123 /* We use char because int might match the return type of a gcc2
20124     builtin and then its argument prototype would still apply.  */
20125 char SQLDriverConnect();
20126
20127 int main() {
20128 SQLDriverConnect()
20129 ; return 0; }
20130 EOF
20131 if { (eval echo configure:20132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20132   rm -rf conftest*
20133   eval "ac_cv_lib_$ac_lib_var=yes"
20134 else
20135   echo "configure: failed program was:" >&5
20136   cat conftest.$ac_ext >&5
20137   rm -rf conftest*
20138   eval "ac_cv_lib_$ac_lib_var=no"
20139 fi
20140 rm -f conftest*
20141 LIBS="$ac_save_LIBS"
20142
20143 fi
20144 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20145   echo "$ac_t""yes" 1>&6
20146   have_odbc=yes
20147 else
20148   echo "$ac_t""no" 1>&6
20149 have_odbc=no
20150 fi
20151
20152                 if test $have_odbc = yes ; then
20153                         ol_link_sql="-lodbc"
20154                 fi
20155         fi
20156
20157         if test $ol_link_sql != no ; then
20158                 SLAPD_SQL_LIBS="$ol_link_sql"
20159
20160         elif test $ol_enable_sql != auto ; then
20161                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
20162         fi
20163 fi
20164
20165 if test $ol_enable_tcl != no ; then
20166         for ac_hdr in tcl.h
20167 do
20168 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20169 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20170 echo "configure:20171: checking for $ac_hdr" >&5
20171 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20172   echo $ac_n "(cached) $ac_c" 1>&6
20173 else
20174   cat > conftest.$ac_ext <<EOF
20175 #line 20176 "configure"
20176 #include "confdefs.h"
20177 #include <$ac_hdr>
20178 EOF
20179 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20180 { (eval echo configure:20181: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20181 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20182 if test -z "$ac_err"; then
20183   rm -rf conftest*
20184   eval "ac_cv_header_$ac_safe=yes"
20185 else
20186   echo "$ac_err" >&5
20187   echo "configure: failed program was:" >&5
20188   cat conftest.$ac_ext >&5
20189   rm -rf conftest*
20190   eval "ac_cv_header_$ac_safe=no"
20191 fi
20192 rm -f conftest*
20193 fi
20194 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20195   echo "$ac_t""yes" 1>&6
20196     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20197   cat >> confdefs.h <<EOF
20198 #define $ac_tr_hdr 1
20199 EOF
20200  
20201 else
20202   echo "$ac_t""no" 1>&6
20203 fi
20204 done
20205
20206
20207         if test $ac_cv_header_tcl_h != yes ; then
20208                 have_tcl=no
20209         else
20210                 for lib in tcl tcl7.6 tcl8.0 tcl8.2 ; do
20211                         echo $ac_n "checking for main in -l$lib""... $ac_c" 1>&6
20212 echo "configure:20213: checking for main in -l$lib" >&5
20213 ac_lib_var=`echo $lib'_'main | sed 'y%./+-:%__p__%'`
20214 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20215   echo $ac_n "(cached) $ac_c" 1>&6
20216 else
20217   ac_save_LIBS="$LIBS"
20218 LIBS="-l$lib  $LIBS"
20219 cat > conftest.$ac_ext <<EOF
20220 #line 20221 "configure"
20221 #include "confdefs.h"
20222
20223 int main() {
20224 main()
20225 ; return 0; }
20226 EOF
20227 if { (eval echo configure:20228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20228   rm -rf conftest*
20229   eval "ac_cv_lib_$ac_lib_var=yes"
20230 else
20231   echo "configure: failed program was:" >&5
20232   cat conftest.$ac_ext >&5
20233   rm -rf conftest*
20234   eval "ac_cv_lib_$ac_lib_var=no"
20235 fi
20236 rm -f conftest*
20237 LIBS="$ac_save_LIBS"
20238
20239 fi
20240 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20241   echo "$ac_t""yes" 1>&6
20242   have_tcl=yes
20243                            if test x"$ol_with_tcl_module" = "xstatic" ; then
20244                                         SLAPD_LIBS="$SLAPD_LIBS -l${lib}"
20245                            else
20246                                         MOD_TCL_LIB="-l${lib}"
20247                            fi;break
20248 else
20249   echo "$ac_t""no" 1>&6
20250 have_tcl=no
20251 fi
20252
20253                 done
20254         fi
20255
20256         if test $have_tcl != yes ; then
20257                 echo "configure: warning: could not find -ltcl" 1>&2
20258                 if test $ol_enable_tcl = yes ; then
20259                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
20260                 fi
20261
20262                 ol_enable_tcl=no
20263         fi
20264 fi
20265
20266 ol_link_termcap=no
20267 for ac_hdr in termcap.h ncurses.h
20268 do
20269 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20270 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20271 echo "configure:20272: checking for $ac_hdr" >&5
20272 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20273   echo $ac_n "(cached) $ac_c" 1>&6
20274 else
20275   cat > conftest.$ac_ext <<EOF
20276 #line 20277 "configure"
20277 #include "confdefs.h"
20278 #include <$ac_hdr>
20279 EOF
20280 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20281 { (eval echo configure:20282: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20282 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20283 if test -z "$ac_err"; then
20284   rm -rf conftest*
20285   eval "ac_cv_header_$ac_safe=yes"
20286 else
20287   echo "$ac_err" >&5
20288   echo "configure: failed program was:" >&5
20289   cat conftest.$ac_ext >&5
20290   rm -rf conftest*
20291   eval "ac_cv_header_$ac_safe=no"
20292 fi
20293 rm -f conftest*
20294 fi
20295 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20296   echo "$ac_t""yes" 1>&6
20297     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20298   cat >> confdefs.h <<EOF
20299 #define $ac_tr_hdr 1
20300 EOF
20301  
20302 else
20303   echo "$ac_t""no" 1>&6
20304 fi
20305 done
20306
20307
20308 if test $ol_link_termcap = no ; then
20309         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
20310 echo "configure:20311: checking for tputs in -ltermcap" >&5
20311 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
20312 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20313   echo $ac_n "(cached) $ac_c" 1>&6
20314 else
20315   ac_save_LIBS="$LIBS"
20316 LIBS="-ltermcap  $LIBS"
20317 cat > conftest.$ac_ext <<EOF
20318 #line 20319 "configure"
20319 #include "confdefs.h"
20320 /* Override any gcc2 internal prototype to avoid an error.  */
20321 /* We use char because int might match the return type of a gcc2
20322     builtin and then its argument prototype would still apply.  */
20323 char tputs();
20324
20325 int main() {
20326 tputs()
20327 ; return 0; }
20328 EOF
20329 if { (eval echo configure:20330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20330   rm -rf conftest*
20331   eval "ac_cv_lib_$ac_lib_var=yes"
20332 else
20333   echo "configure: failed program was:" >&5
20334   cat conftest.$ac_ext >&5
20335   rm -rf conftest*
20336   eval "ac_cv_lib_$ac_lib_var=no"
20337 fi
20338 rm -f conftest*
20339 LIBS="$ac_save_LIBS"
20340
20341 fi
20342 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20343   echo "$ac_t""yes" 1>&6
20344   have_termcap=yes
20345 else
20346   echo "$ac_t""no" 1>&6
20347 have_termcap=no
20348 fi
20349
20350         if test $have_termcap = yes ; then
20351                 cat >> confdefs.h <<\EOF
20352 #define HAVE_TERMCAP 1
20353 EOF
20354
20355                 ol_link_termcap=yes
20356                 TERMCAP_LIBS=-ltermcap
20357         fi
20358 fi
20359
20360 if test $ol_link_termcap = no ; then
20361         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
20362 echo "configure:20363: checking for initscr in -lncurses" >&5
20363 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
20364 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20365   echo $ac_n "(cached) $ac_c" 1>&6
20366 else
20367   ac_save_LIBS="$LIBS"
20368 LIBS="-lncurses  $LIBS"
20369 cat > conftest.$ac_ext <<EOF
20370 #line 20371 "configure"
20371 #include "confdefs.h"
20372 /* Override any gcc2 internal prototype to avoid an error.  */
20373 /* We use char because int might match the return type of a gcc2
20374     builtin and then its argument prototype would still apply.  */
20375 char initscr();
20376
20377 int main() {
20378 initscr()
20379 ; return 0; }
20380 EOF
20381 if { (eval echo configure:20382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20382   rm -rf conftest*
20383   eval "ac_cv_lib_$ac_lib_var=yes"
20384 else
20385   echo "configure: failed program was:" >&5
20386   cat conftest.$ac_ext >&5
20387   rm -rf conftest*
20388   eval "ac_cv_lib_$ac_lib_var=no"
20389 fi
20390 rm -f conftest*
20391 LIBS="$ac_save_LIBS"
20392
20393 fi
20394 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20395   echo "$ac_t""yes" 1>&6
20396   have_ncurses=yes
20397 else
20398   echo "$ac_t""no" 1>&6
20399 have_ncurses=no
20400 fi
20401
20402         if test $have_ncurses = yes ; then
20403                 cat >> confdefs.h <<\EOF
20404 #define HAVE_NCURSES 1
20405 EOF
20406
20407                 ol_link_termcap=yes
20408                 TERMCAP_LIBS=-lncurses
20409         fi
20410 fi
20411
20412 if test $ol_link_termcap = no ; then
20413         cat >> confdefs.h <<\EOF
20414 #define NO_TERMCAP 1
20415 EOF
20416
20417         TERMCAP_LIBS=
20418 fi
20419
20420 ol_link_sasl=no
20421 ol_link_spasswd=no
20422 if test $ol_with_cyrus_sasl != no ; then
20423         for ac_hdr in sasl/sasl.h sasl.h
20424 do
20425 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20426 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20427 echo "configure:20428: checking for $ac_hdr" >&5
20428 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20429   echo $ac_n "(cached) $ac_c" 1>&6
20430 else
20431   cat > conftest.$ac_ext <<EOF
20432 #line 20433 "configure"
20433 #include "confdefs.h"
20434 #include <$ac_hdr>
20435 EOF
20436 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20437 { (eval echo configure:20438: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20438 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20439 if test -z "$ac_err"; then
20440   rm -rf conftest*
20441   eval "ac_cv_header_$ac_safe=yes"
20442 else
20443   echo "$ac_err" >&5
20444   echo "configure: failed program was:" >&5
20445   cat conftest.$ac_ext >&5
20446   rm -rf conftest*
20447   eval "ac_cv_header_$ac_safe=no"
20448 fi
20449 rm -f conftest*
20450 fi
20451 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20452   echo "$ac_t""yes" 1>&6
20453     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20454   cat >> confdefs.h <<EOF
20455 #define $ac_tr_hdr 1
20456 EOF
20457  
20458 else
20459   echo "$ac_t""no" 1>&6
20460 fi
20461 done
20462
20463
20464         if test $ac_cv_header_sasl_sasl_h = yes -o $ac_cv_header_sasl_h = yes; then
20465                 echo $ac_n "checking for sasl_client_init in -lsasl2""... $ac_c" 1>&6
20466 echo "configure:20467: checking for sasl_client_init in -lsasl2" >&5
20467 ac_lib_var=`echo sasl2'_'sasl_client_init | sed 'y%./+-:%__p__%'`
20468 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20469   echo $ac_n "(cached) $ac_c" 1>&6
20470 else
20471   ac_save_LIBS="$LIBS"
20472 LIBS="-lsasl2  $LIBS"
20473 cat > conftest.$ac_ext <<EOF
20474 #line 20475 "configure"
20475 #include "confdefs.h"
20476 /* Override any gcc2 internal prototype to avoid an error.  */
20477 /* We use char because int might match the return type of a gcc2
20478     builtin and then its argument prototype would still apply.  */
20479 char sasl_client_init();
20480
20481 int main() {
20482 sasl_client_init()
20483 ; return 0; }
20484 EOF
20485 if { (eval echo configure:20486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20486   rm -rf conftest*
20487   eval "ac_cv_lib_$ac_lib_var=yes"
20488 else
20489   echo "configure: failed program was:" >&5
20490   cat conftest.$ac_ext >&5
20491   rm -rf conftest*
20492   eval "ac_cv_lib_$ac_lib_var=no"
20493 fi
20494 rm -f conftest*
20495 LIBS="$ac_save_LIBS"
20496
20497 fi
20498 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20499   echo "$ac_t""yes" 1>&6
20500   ol_link_sasl="-lsasl2"
20501 else
20502   echo "$ac_t""no" 1>&6
20503 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
20504 echo "configure:20505: checking for sasl_client_init in -lsasl" >&5
20505 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
20506 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20507   echo $ac_n "(cached) $ac_c" 1>&6
20508 else
20509   ac_save_LIBS="$LIBS"
20510 LIBS="-lsasl  $LIBS"
20511 cat > conftest.$ac_ext <<EOF
20512 #line 20513 "configure"
20513 #include "confdefs.h"
20514 /* Override any gcc2 internal prototype to avoid an error.  */
20515 /* We use char because int might match the return type of a gcc2
20516     builtin and then its argument prototype would still apply.  */
20517 char sasl_client_init();
20518
20519 int main() {
20520 sasl_client_init()
20521 ; return 0; }
20522 EOF
20523 if { (eval echo configure:20524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20524   rm -rf conftest*
20525   eval "ac_cv_lib_$ac_lib_var=yes"
20526 else
20527   echo "configure: failed program was:" >&5
20528   cat conftest.$ac_ext >&5
20529   rm -rf conftest*
20530   eval "ac_cv_lib_$ac_lib_var=no"
20531 fi
20532 rm -f conftest*
20533 LIBS="$ac_save_LIBS"
20534
20535 fi
20536 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20537   echo "$ac_t""yes" 1>&6
20538   ol_link_sasl="-lsasl"
20539 else
20540   echo "$ac_t""no" 1>&6
20541 fi
20542
20543 fi
20544
20545         fi
20546
20547         if test $ol_link_sasl = no ; then
20548                 if test $ol_with_cyrus_sasl != auto ; then
20549                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
20550                 else
20551                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
20552                         echo "configure: warning: SASL authentication not supported!" 1>&2
20553                         if test $ol_link_tls = no ; then
20554                                 echo "configure: warning: Strong authentication not supported!" 1>&2
20555                         fi
20556                 fi
20557         else
20558                 echo $ac_n "checking Cyrus SASL library version""... $ac_c" 1>&6
20559 echo "configure:20560: checking Cyrus SASL library version" >&5
20560 if eval "test \"\${ol_cv_sasl_compat+set}\" = set"; then
20561   echo $ac_n "(cached) $ac_c" 1>&6
20562 else
20563   
20564         cat > conftest.$ac_ext <<EOF
20565 #line 20566 "configure"
20566 #include "confdefs.h"
20567
20568 #ifdef HAVE_SASL_SASL_H
20569 #include <sasl/sasl.h>
20570 #else
20571 #include <sasl.h>
20572 #endif
20573
20574 /* require 2.1.3 or later */
20575 #if SASL_VERSION_MAJOR == 1  && SASL_VERSION_MINOR >= 5
20576         char *__sasl_compat = "1.5.x okay";
20577 #elif SASL_VERSION_MAJOR == 2  && SASL_VERSION_MINOR > 1
20578         __sasl_compat "2.2+ or better okay (we guess)";
20579 #elif SASL_VERSION_MAJOR == 2  && SASL_VERSION_MINOR == 1 \
20580         && SASL_VERSION_STEP >=3
20581         __sasl_compat = "2.1.3+ or better okay";
20582 #endif
20583         
20584 EOF
20585 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20586   egrep "__sasl_compat" >/dev/null 2>&1; then
20587   rm -rf conftest*
20588   ol_cv_sasl_compat=yes
20589 else
20590   rm -rf conftest*
20591   ol_cv_sasl_compat=no
20592 fi
20593 rm -f conftest*
20594
20595 fi
20596
20597 echo "$ac_t""$ol_cv_sasl_compat" 1>&6
20598
20599                 if test $ol_cv_sasl_compat = no ; then
20600                         ol_link_sasl=no
20601                         { echo "configure: error: Cyrus SASL library located but incompatible" 1>&2; exit 1; }
20602                 fi
20603
20604                 cat >> confdefs.h <<\EOF
20605 #define HAVE_CYRUS_SASL 1
20606 EOF
20607
20608                 SASL_LIBS="$ol_link_sasl"
20609                 if test $ol_enable_spasswd != no ; then
20610                         ol_link_spasswd=yes
20611                 fi
20612
20613                 ac_save_LIBS="$LIBS"
20614                 LIBS="$LIBS $ol_link_sasl"
20615                 echo $ac_n "checking for sasl_version""... $ac_c" 1>&6
20616 echo "configure:20617: checking for sasl_version" >&5
20617 if eval "test \"\${ac_cv_func_sasl_version+set}\" = set"; then
20618   echo $ac_n "(cached) $ac_c" 1>&6
20619 else
20620   cat > conftest.$ac_ext <<EOF
20621 #line 20622 "configure"
20622 #include "confdefs.h"
20623 /* System header to define __stub macros and hopefully few prototypes,
20624     which can conflict with char sasl_version(); below.  */
20625 #include <assert.h>
20626 /* Override any gcc2 internal prototype to avoid an error.  */
20627 /* We use char because int might match the return type of a gcc2
20628     builtin and then its argument prototype would still apply.  */
20629 char sasl_version();
20630 char (*f)();
20631
20632 int main() {
20633
20634 /* The GNU C library defines this for functions which it implements
20635     to always fail with ENOSYS.  Some functions are actually named
20636     something starting with __ and the normal name is an alias.  */
20637 #if defined (__stub_sasl_version) || defined (__stub___sasl_version)
20638 choke me
20639 #else
20640 f = sasl_version;
20641 #endif
20642
20643 ; return 0; }
20644 EOF
20645 if { (eval echo configure:20646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20646   rm -rf conftest*
20647   eval "ac_cv_func_sasl_version=yes"
20648 else
20649   echo "configure: failed program was:" >&5
20650   cat conftest.$ac_ext >&5
20651   rm -rf conftest*
20652   eval "ac_cv_func_sasl_version=no"
20653 fi
20654 rm -f conftest*
20655 fi
20656
20657 if eval "test \"`echo '$ac_cv_func_'sasl_version`\" = yes"; then
20658   echo "$ac_t""yes" 1>&6
20659   cat >> confdefs.h <<\EOF
20660 #define HAVE_SASL_VERSION 1
20661 EOF
20662
20663 else
20664   echo "$ac_t""no" 1>&6
20665 fi
20666
20667                 LIBS="$ac_save_LIBS"
20668         fi
20669
20670 else
20671         echo "configure: warning: SASL authentication not supported!" 1>&2
20672         if test $ol_link_tls = no ; then
20673                 echo "configure: warning: Strong authentication not supported!" 1>&2
20674         fi
20675 fi
20676
20677 if test $cross_compiling != yes -a "$ac_cv_mingw32" != yes ; then
20678         dev=no
20679         if test -r /dev/urandom ; then
20680                 dev="/dev/urandom";
20681         elif test -r /idev/urandom ; then
20682                 dev="/idev/urandom";
20683         elif test -r /dev/srandom ; then
20684                 dev="/dev/srandom";
20685         elif test -r /dev/random ; then
20686                 dev="/dev/random";
20687         elif test -r /idev/random ; then
20688                 dev="/idev/random";
20689         fi
20690
20691         if test $dev != no ; then
20692                 cat >> confdefs.h <<EOF
20693 #define URANDOM_DEVICE "$dev"
20694 EOF
20695
20696         fi
20697 fi
20698
20699 ol_link_fetch=no
20700 if test $ol_with_fetch != no ; then
20701         ol_LIBS=$LIBS
20702 LIBS="-lfetch -lcom_err $LIBS"
20703 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
20704 echo "configure:20705: checking fetch(3) library" >&5
20705 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
20706   echo $ac_n "(cached) $ac_c" 1>&6
20707 else
20708   
20709         cat > conftest.$ac_ext <<EOF
20710 #line 20711 "configure"
20711 #include "confdefs.h"
20712
20713 #include <sys/param.h>
20714 #include <stdio.h>
20715 #include <fetch.h>
20716 int main() {
20717 struct url *u = fetchParseURL("file:///"); 
20718 ; return 0; }
20719 EOF
20720 if { (eval echo configure:20721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20721   rm -rf conftest*
20722   ol_cv_lib_fetch=yes
20723 else
20724   echo "configure: failed program was:" >&5
20725   cat conftest.$ac_ext >&5
20726   rm -rf conftest*
20727   ol_cv_lib_fetch=no
20728 fi
20729 rm -f conftest*
20730 fi
20731
20732 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
20733 LIBS=$ol_LIBS
20734 if test $ol_cv_lib_fetch != no ; then
20735         ol_link_fetch="-lfetch -lcom_err"
20736         cat >> confdefs.h <<\EOF
20737 #define HAVE_FETCH 1
20738 EOF
20739
20740 fi
20741
20742
20743         if test $ol_cv_lib_fetch != no ; then
20744                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
20745                 ol_link_fetch=freebsd
20746
20747         elif test $ol_with_fetch != auto ; then
20748                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
20749         fi 
20750 fi
20751
20752 ol_link_readline=no
20753 if test $ol_with_readline != no ; then
20754         for ac_hdr in readline/readline.h readline/history.h
20755 do
20756 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20757 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20758 echo "configure:20759: checking for $ac_hdr" >&5
20759 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20760   echo $ac_n "(cached) $ac_c" 1>&6
20761 else
20762   cat > conftest.$ac_ext <<EOF
20763 #line 20764 "configure"
20764 #include "confdefs.h"
20765 #include <$ac_hdr>
20766 EOF
20767 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20768 { (eval echo configure:20769: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20769 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20770 if test -z "$ac_err"; then
20771   rm -rf conftest*
20772   eval "ac_cv_header_$ac_safe=yes"
20773 else
20774   echo "$ac_err" >&5
20775   echo "configure: failed program was:" >&5
20776   cat conftest.$ac_ext >&5
20777   rm -rf conftest*
20778   eval "ac_cv_header_$ac_safe=no"
20779 fi
20780 rm -f conftest*
20781 fi
20782 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20783   echo "$ac_t""yes" 1>&6
20784     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20785   cat >> confdefs.h <<EOF
20786 #define $ac_tr_hdr 1
20787 EOF
20788  
20789 else
20790   echo "$ac_t""no" 1>&6
20791 fi
20792 done
20793
20794
20795         if test $ac_cv_header_readline_readline_h = yes ; then
20796                 save_LIBS="$LIBS"
20797                 LIBS="$TERMCAP_LIBS $LIBS"
20798                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
20799 echo "configure:20800: checking for readline in -lreadline" >&5
20800 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
20801 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20802   echo $ac_n "(cached) $ac_c" 1>&6
20803 else
20804   ac_save_LIBS="$LIBS"
20805 LIBS="-lreadline  $LIBS"
20806 cat > conftest.$ac_ext <<EOF
20807 #line 20808 "configure"
20808 #include "confdefs.h"
20809 /* Override any gcc2 internal prototype to avoid an error.  */
20810 /* We use char because int might match the return type of a gcc2
20811     builtin and then its argument prototype would still apply.  */
20812 char readline();
20813
20814 int main() {
20815 readline()
20816 ; return 0; }
20817 EOF
20818 if { (eval echo configure:20819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20819   rm -rf conftest*
20820   eval "ac_cv_lib_$ac_lib_var=yes"
20821 else
20822   echo "configure: failed program was:" >&5
20823   cat conftest.$ac_ext >&5
20824   rm -rf conftest*
20825   eval "ac_cv_lib_$ac_lib_var=no"
20826 fi
20827 rm -f conftest*
20828 LIBS="$ac_save_LIBS"
20829
20830 fi
20831 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20832   echo "$ac_t""yes" 1>&6
20833   have_readline=yes
20834 else
20835   echo "$ac_t""no" 1>&6
20836 have_readline=no
20837 fi
20838
20839                 LIBS="$save_LIBS"
20840                         
20841                 if test $have_readline = yes ; then
20842                         ol_with_readline=found
20843                         ol_link_readline=yes
20844
20845                         READLINE_LIBS="-lreadline"
20846                 fi
20847         fi
20848 fi
20849
20850 if test $ol_link_readline = yes ; then
20851         cat >> confdefs.h <<\EOF
20852 #define HAVE_READLINE 1
20853 EOF
20854
20855 fi
20856
20857
20858 if test $ol_enable_crypt != no ; then
20859         save_LIBS="$LIBS"
20860         LIBS="$TLS_LIBS $LIBS"
20861
20862         echo $ac_n "checking for crypt""... $ac_c" 1>&6
20863 echo "configure:20864: checking for crypt" >&5
20864 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
20865   echo $ac_n "(cached) $ac_c" 1>&6
20866 else
20867   cat > conftest.$ac_ext <<EOF
20868 #line 20869 "configure"
20869 #include "confdefs.h"
20870 /* System header to define __stub macros and hopefully few prototypes,
20871     which can conflict with char crypt(); below.  */
20872 #include <assert.h>
20873 /* Override any gcc2 internal prototype to avoid an error.  */
20874 /* We use char because int might match the return type of a gcc2
20875     builtin and then its argument prototype would still apply.  */
20876 char crypt();
20877 char (*f)();
20878
20879 int main() {
20880
20881 /* The GNU C library defines this for functions which it implements
20882     to always fail with ENOSYS.  Some functions are actually named
20883     something starting with __ and the normal name is an alias.  */
20884 #if defined (__stub_crypt) || defined (__stub___crypt)
20885 choke me
20886 #else
20887 f = crypt;
20888 #endif
20889
20890 ; return 0; }
20891 EOF
20892 if { (eval echo configure:20893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20893   rm -rf conftest*
20894   eval "ac_cv_func_crypt=yes"
20895 else
20896   echo "configure: failed program was:" >&5
20897   cat conftest.$ac_ext >&5
20898   rm -rf conftest*
20899   eval "ac_cv_func_crypt=no"
20900 fi
20901 rm -f conftest*
20902 fi
20903
20904 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
20905   echo "$ac_t""yes" 1>&6
20906   have_crypt=yes
20907 else
20908   echo "$ac_t""no" 1>&6
20909
20910                 LIBS="$save_LIBS"
20911                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
20912 echo "configure:20913: checking for crypt in -lcrypt" >&5
20913 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
20914 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20915   echo $ac_n "(cached) $ac_c" 1>&6
20916 else
20917   ac_save_LIBS="$LIBS"
20918 LIBS="-lcrypt  $LIBS"
20919 cat > conftest.$ac_ext <<EOF
20920 #line 20921 "configure"
20921 #include "confdefs.h"
20922 /* Override any gcc2 internal prototype to avoid an error.  */
20923 /* We use char because int might match the return type of a gcc2
20924     builtin and then its argument prototype would still apply.  */
20925 char crypt();
20926
20927 int main() {
20928 crypt()
20929 ; return 0; }
20930 EOF
20931 if { (eval echo configure:20932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20932   rm -rf conftest*
20933   eval "ac_cv_lib_$ac_lib_var=yes"
20934 else
20935   echo "configure: failed program was:" >&5
20936   cat conftest.$ac_ext >&5
20937   rm -rf conftest*
20938   eval "ac_cv_lib_$ac_lib_var=no"
20939 fi
20940 rm -f conftest*
20941 LIBS="$ac_save_LIBS"
20942
20943 fi
20944 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20945   echo "$ac_t""yes" 1>&6
20946   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
20947                         have_crypt=yes
20948 else
20949   echo "$ac_t""no" 1>&6
20950 have_crypt=no
20951 fi
20952
20953 fi
20954
20955
20956         LIBS="$save_LIBS"
20957
20958         if test $have_crypt = yes ; then
20959                 cat >> confdefs.h <<\EOF
20960 #define HAVE_CRYPT 1
20961 EOF
20962
20963         else
20964                 echo "configure: warning: could not find crypt" 1>&2
20965                 if test $ol_enable_crypt = yes ; then
20966                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
20967                 fi
20968
20969                 echo "configure: warning: disabling crypt support" 1>&2
20970                 ol_enable_crypt=no
20971         fi
20972 fi
20973
20974 if test $ol_enable_proctitle != no ; then
20975         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
20976 echo "configure:20977: checking for setproctitle" >&5
20977 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
20978   echo $ac_n "(cached) $ac_c" 1>&6
20979 else
20980   cat > conftest.$ac_ext <<EOF
20981 #line 20982 "configure"
20982 #include "confdefs.h"
20983 /* System header to define __stub macros and hopefully few prototypes,
20984     which can conflict with char setproctitle(); below.  */
20985 #include <assert.h>
20986 /* Override any gcc2 internal prototype to avoid an error.  */
20987 /* We use char because int might match the return type of a gcc2
20988     builtin and then its argument prototype would still apply.  */
20989 char setproctitle();
20990 char (*f)();
20991
20992 int main() {
20993
20994 /* The GNU C library defines this for functions which it implements
20995     to always fail with ENOSYS.  Some functions are actually named
20996     something starting with __ and the normal name is an alias.  */
20997 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
20998 choke me
20999 #else
21000 f = setproctitle;
21001 #endif
21002
21003 ; return 0; }
21004 EOF
21005 if { (eval echo configure:21006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21006   rm -rf conftest*
21007   eval "ac_cv_func_setproctitle=yes"
21008 else
21009   echo "configure: failed program was:" >&5
21010   cat conftest.$ac_ext >&5
21011   rm -rf conftest*
21012   eval "ac_cv_func_setproctitle=no"
21013 fi
21014 rm -f conftest*
21015 fi
21016
21017 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
21018   echo "$ac_t""yes" 1>&6
21019   have_setproctitle=yes
21020 else
21021   echo "$ac_t""no" 1>&6
21022
21023                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
21024 echo "configure:21025: checking for setproctitle in -lutil" >&5
21025 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
21026 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
21027   echo $ac_n "(cached) $ac_c" 1>&6
21028 else
21029   ac_save_LIBS="$LIBS"
21030 LIBS="-lutil  $LIBS"
21031 cat > conftest.$ac_ext <<EOF
21032 #line 21033 "configure"
21033 #include "confdefs.h"
21034 /* Override any gcc2 internal prototype to avoid an error.  */
21035 /* We use char because int might match the return type of a gcc2
21036     builtin and then its argument prototype would still apply.  */
21037 char setproctitle();
21038
21039 int main() {
21040 setproctitle()
21041 ; return 0; }
21042 EOF
21043 if { (eval echo configure:21044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21044   rm -rf conftest*
21045   eval "ac_cv_lib_$ac_lib_var=yes"
21046 else
21047   echo "configure: failed program was:" >&5
21048   cat conftest.$ac_ext >&5
21049   rm -rf conftest*
21050   eval "ac_cv_lib_$ac_lib_var=no"
21051 fi
21052 rm -f conftest*
21053 LIBS="$ac_save_LIBS"
21054
21055 fi
21056 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
21057   echo "$ac_t""yes" 1>&6
21058   have_setproctitle=yes
21059                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
21060 else
21061   echo "$ac_t""no" 1>&6
21062 have_setproctitle=no
21063                         LIBOBJS="$LIBOBJS setproctitle.o"
21064                         LIBSRCS="$LIBSRCS setproctitle.c"
21065 fi
21066
21067 fi
21068
21069
21070         if test $have_setproctitle = yes ; then
21071                 cat >> confdefs.h <<\EOF
21072 #define HAVE_SETPROCTITLE 1
21073 EOF
21074
21075         fi
21076 fi
21077
21078 if test $ol_enable_slp != no ; then
21079         for ac_hdr in slp.h 
21080 do
21081 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
21082 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
21083 echo "configure:21084: checking for $ac_hdr" >&5
21084 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
21085   echo $ac_n "(cached) $ac_c" 1>&6
21086 else
21087   cat > conftest.$ac_ext <<EOF
21088 #line 21089 "configure"
21089 #include "confdefs.h"
21090 #include <$ac_hdr>
21091 EOF
21092 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
21093 { (eval echo configure:21094: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
21094 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
21095 if test -z "$ac_err"; then
21096   rm -rf conftest*
21097   eval "ac_cv_header_$ac_safe=yes"
21098 else
21099   echo "$ac_err" >&5
21100   echo "configure: failed program was:" >&5
21101   cat conftest.$ac_ext >&5
21102   rm -rf conftest*
21103   eval "ac_cv_header_$ac_safe=no"
21104 fi
21105 rm -f conftest*
21106 fi
21107 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
21108   echo "$ac_t""yes" 1>&6
21109     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
21110   cat >> confdefs.h <<EOF
21111 #define $ac_tr_hdr 1
21112 EOF
21113  
21114 else
21115   echo "$ac_t""no" 1>&6
21116 fi
21117 done
21118
21119
21120         if test $ac_cv_header_slp_h = yes ; then
21121                 echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
21122 echo "configure:21123: checking for SLPOpen in -lslp" >&5
21123 ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-:%__p__%'`
21124 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
21125   echo $ac_n "(cached) $ac_c" 1>&6
21126 else
21127   ac_save_LIBS="$LIBS"
21128 LIBS="-lslp  $LIBS"
21129 cat > conftest.$ac_ext <<EOF
21130 #line 21131 "configure"
21131 #include "confdefs.h"
21132 /* Override any gcc2 internal prototype to avoid an error.  */
21133 /* We use char because int might match the return type of a gcc2
21134     builtin and then its argument prototype would still apply.  */
21135 char SLPOpen();
21136
21137 int main() {
21138 SLPOpen()
21139 ; return 0; }
21140 EOF
21141 if { (eval echo configure:21142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21142   rm -rf conftest*
21143   eval "ac_cv_lib_$ac_lib_var=yes"
21144 else
21145   echo "configure: failed program was:" >&5
21146   cat conftest.$ac_ext >&5
21147   rm -rf conftest*
21148   eval "ac_cv_lib_$ac_lib_var=no"
21149 fi
21150 rm -f conftest*
21151 LIBS="$ac_save_LIBS"
21152
21153 fi
21154 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
21155   echo "$ac_t""yes" 1>&6
21156   have_slp=yes
21157 else
21158   echo "$ac_t""no" 1>&6
21159 have_slp=no
21160 fi
21161
21162                 if test $have_slp = yes ; then
21163                         cat >> confdefs.h <<\EOF
21164 #define HAVE_SLP 1
21165 EOF
21166
21167                         SLAPD_SLP_LIBS=-lslp
21168                 fi
21169
21170         elif test $ol_enable_slp = yes ; then
21171                 { echo "configure: error: SLP not found" 1>&2; exit 1; }
21172         fi
21173 fi
21174
21175 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
21176 echo "configure:21177: checking for ANSI C header files" >&5
21177 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
21178   echo $ac_n "(cached) $ac_c" 1>&6
21179 else
21180   cat > conftest.$ac_ext <<EOF
21181 #line 21182 "configure"
21182 #include "confdefs.h"
21183 #include <stdlib.h>
21184 #include <stdarg.h>
21185 #include <string.h>
21186 #include <float.h>
21187 EOF
21188 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
21189 { (eval echo configure:21190: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
21190 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
21191 if test -z "$ac_err"; then
21192   rm -rf conftest*
21193   ac_cv_header_stdc=yes
21194 else
21195   echo "$ac_err" >&5
21196   echo "configure: failed program was:" >&5
21197   cat conftest.$ac_ext >&5
21198   rm -rf conftest*
21199   ac_cv_header_stdc=no
21200 fi
21201 rm -f conftest*
21202
21203 if test $ac_cv_header_stdc = yes; then
21204   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
21205 cat > conftest.$ac_ext <<EOF
21206 #line 21207 "configure"
21207 #include "confdefs.h"
21208 #include <string.h>
21209 EOF
21210 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21211   egrep "memchr" >/dev/null 2>&1; then
21212   :
21213 else
21214   rm -rf conftest*
21215   ac_cv_header_stdc=no
21216 fi
21217 rm -f conftest*
21218
21219 fi
21220
21221 if test $ac_cv_header_stdc = yes; then
21222   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
21223 cat > conftest.$ac_ext <<EOF
21224 #line 21225 "configure"
21225 #include "confdefs.h"
21226 #include <stdlib.h>
21227 EOF
21228 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21229   egrep "free" >/dev/null 2>&1; then
21230   :
21231 else
21232   rm -rf conftest*
21233   ac_cv_header_stdc=no
21234 fi
21235 rm -f conftest*
21236
21237 fi
21238
21239 if test $ac_cv_header_stdc = yes; then
21240   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
21241 if test "$cross_compiling" = yes; then
21242   :
21243 else
21244   cat > conftest.$ac_ext <<EOF
21245 #line 21246 "configure"
21246 #include "confdefs.h"
21247 #include <ctype.h>
21248 #if ((' ' & 0x0FF) == 0x020)
21249 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
21250 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
21251 #else
21252 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
21253  || ('j' <= (c) && (c) <= 'r') \
21254  || ('s' <= (c) && (c) <= 'z'))
21255 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
21256 #endif
21257 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
21258 int main () { int i; for (i = 0; i < 256; i++)
21259 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
21260 exit (0); }
21261
21262 EOF
21263 if { (eval echo configure:21264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
21264 then
21265   :
21266 else
21267   echo "configure: failed program was:" >&5
21268   cat conftest.$ac_ext >&5
21269   rm -fr conftest*
21270   ac_cv_header_stdc=no
21271 fi
21272 rm -fr conftest*
21273 fi
21274
21275 fi
21276 fi
21277
21278 echo "$ac_t""$ac_cv_header_stdc" 1>&6
21279 if test $ac_cv_header_stdc = yes; then
21280   cat >> confdefs.h <<\EOF
21281 #define STDC_HEADERS 1
21282 EOF
21283
21284 fi
21285
21286 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
21287 echo "configure:21288: checking for mode_t" >&5
21288 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
21289   echo $ac_n "(cached) $ac_c" 1>&6
21290 else
21291   cat > conftest.$ac_ext <<EOF
21292 #line 21293 "configure"
21293 #include "confdefs.h"
21294 #include <sys/types.h>
21295 #if STDC_HEADERS
21296 #include <stdlib.h>
21297 #include <stddef.h>
21298 #endif
21299
21300 EOF
21301 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21302   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21303   rm -rf conftest*
21304   eval "ac_cv_type_mode_t=yes"
21305 else
21306   rm -rf conftest*
21307   eval "ac_cv_type_mode_t=no"
21308 fi
21309 rm -f conftest*
21310
21311 fi
21312 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
21313   echo "$ac_t""yes" 1>&6
21314 else
21315   echo "$ac_t""no" 1>&6
21316   cat >> confdefs.h <<EOF
21317 #define mode_t int
21318 EOF
21319
21320 fi
21321
21322 echo $ac_n "checking for off_t""... $ac_c" 1>&6
21323 echo "configure:21324: checking for off_t" >&5
21324 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
21325   echo $ac_n "(cached) $ac_c" 1>&6
21326 else
21327   cat > conftest.$ac_ext <<EOF
21328 #line 21329 "configure"
21329 #include "confdefs.h"
21330 #include <sys/types.h>
21331 #if STDC_HEADERS
21332 #include <stdlib.h>
21333 #include <stddef.h>
21334 #endif
21335
21336 EOF
21337 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21338   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21339   rm -rf conftest*
21340   eval "ac_cv_type_off_t=yes"
21341 else
21342   rm -rf conftest*
21343   eval "ac_cv_type_off_t=no"
21344 fi
21345 rm -f conftest*
21346
21347 fi
21348 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
21349   echo "$ac_t""yes" 1>&6
21350 else
21351   echo "$ac_t""no" 1>&6
21352   cat >> confdefs.h <<EOF
21353 #define off_t long
21354 EOF
21355
21356 fi
21357
21358 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
21359 echo "configure:21360: checking for pid_t" >&5
21360 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
21361   echo $ac_n "(cached) $ac_c" 1>&6
21362 else
21363   cat > conftest.$ac_ext <<EOF
21364 #line 21365 "configure"
21365 #include "confdefs.h"
21366 #include <sys/types.h>
21367 #if STDC_HEADERS
21368 #include <stdlib.h>
21369 #include <stddef.h>
21370 #endif
21371
21372 EOF
21373 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21374   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21375   rm -rf conftest*
21376   eval "ac_cv_type_pid_t=yes"
21377 else
21378   rm -rf conftest*
21379   eval "ac_cv_type_pid_t=no"
21380 fi
21381 rm -f conftest*
21382
21383 fi
21384 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
21385   echo "$ac_t""yes" 1>&6
21386 else
21387   echo "$ac_t""no" 1>&6
21388   cat >> confdefs.h <<EOF
21389 #define pid_t int
21390 EOF
21391
21392 fi
21393
21394 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
21395 echo "configure:21396: checking for ptrdiff_t" >&5
21396 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
21397   echo $ac_n "(cached) $ac_c" 1>&6
21398 else
21399   cat > conftest.$ac_ext <<EOF
21400 #line 21401 "configure"
21401 #include "confdefs.h"
21402 #include <stddef.h>
21403 int main() {
21404 ptrdiff_t p
21405 ; return 0; }
21406 EOF
21407 if { (eval echo configure:21408: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21408   rm -rf conftest*
21409   am_cv_type_ptrdiff_t=yes
21410 else
21411   echo "configure: failed program was:" >&5
21412   cat conftest.$ac_ext >&5
21413   rm -rf conftest*
21414   am_cv_type_ptrdiff_t=no
21415 fi
21416 rm -f conftest*
21417 fi
21418
21419 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
21420    if test $am_cv_type_ptrdiff_t = yes; then
21421      cat >> confdefs.h <<\EOF
21422 #define HAVE_PTRDIFF_T 1
21423 EOF
21424
21425    fi
21426
21427 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
21428 echo "configure:21429: checking return type of signal handlers" >&5
21429 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
21430   echo $ac_n "(cached) $ac_c" 1>&6
21431 else
21432   cat > conftest.$ac_ext <<EOF
21433 #line 21434 "configure"
21434 #include "confdefs.h"
21435 #include <sys/types.h>
21436 #include <signal.h>
21437 #ifdef signal
21438 #undef signal
21439 #endif
21440 #ifdef __cplusplus
21441 extern "C" void (*signal (int, void (*)(int)))(int);
21442 #else
21443 void (*signal ()) ();
21444 #endif
21445
21446 int main() {
21447 int i;
21448 ; return 0; }
21449 EOF
21450 if { (eval echo configure:21451: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21451   rm -rf conftest*
21452   ac_cv_type_signal=void
21453 else
21454   echo "configure: failed program was:" >&5
21455   cat conftest.$ac_ext >&5
21456   rm -rf conftest*
21457   ac_cv_type_signal=int
21458 fi
21459 rm -f conftest*
21460 fi
21461
21462 echo "$ac_t""$ac_cv_type_signal" 1>&6
21463 cat >> confdefs.h <<EOF
21464 #define RETSIGTYPE $ac_cv_type_signal
21465 EOF
21466
21467
21468 echo $ac_n "checking for size_t""... $ac_c" 1>&6
21469 echo "configure:21470: checking for size_t" >&5
21470 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
21471   echo $ac_n "(cached) $ac_c" 1>&6
21472 else
21473   cat > conftest.$ac_ext <<EOF
21474 #line 21475 "configure"
21475 #include "confdefs.h"
21476 #include <sys/types.h>
21477 #if STDC_HEADERS
21478 #include <stdlib.h>
21479 #include <stddef.h>
21480 #endif
21481
21482 EOF
21483 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21484   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21485   rm -rf conftest*
21486   eval "ac_cv_type_size_t=yes"
21487 else
21488   rm -rf conftest*
21489   eval "ac_cv_type_size_t=no"
21490 fi
21491 rm -f conftest*
21492
21493 fi
21494 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
21495   echo "$ac_t""yes" 1>&6
21496 else
21497   echo "$ac_t""no" 1>&6
21498   cat >> confdefs.h <<EOF
21499 #define size_t unsigned
21500 EOF
21501
21502 fi
21503
21504
21505 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
21506 echo "configure:21507: checking for ssize_t" >&5
21507 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
21508   echo $ac_n "(cached) $ac_c" 1>&6
21509 else
21510   cat > conftest.$ac_ext <<EOF
21511 #line 21512 "configure"
21512 #include "confdefs.h"
21513 #include <sys/types.h>
21514 #if STDC_HEADERS
21515 #include <stdlib.h>
21516 #include <stddef.h>
21517 #endif
21518
21519 EOF
21520 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21521   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21522   rm -rf conftest*
21523   eval "ac_cv_type_ssize_t=yes"
21524 else
21525   rm -rf conftest*
21526   eval "ac_cv_type_ssize_t=no"
21527 fi
21528 rm -f conftest*
21529
21530 fi
21531 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
21532   echo "$ac_t""yes" 1>&6
21533 else
21534   echo "$ac_t""no" 1>&6
21535   cat >> confdefs.h <<EOF
21536 #define ssize_t signed int
21537 EOF
21538
21539 fi
21540
21541 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
21542 echo "configure:21543: checking for caddr_t" >&5
21543 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
21544   echo $ac_n "(cached) $ac_c" 1>&6
21545 else
21546   cat > conftest.$ac_ext <<EOF
21547 #line 21548 "configure"
21548 #include "confdefs.h"
21549 #include <sys/types.h>
21550 #if STDC_HEADERS
21551 #include <stdlib.h>
21552 #include <stddef.h>
21553 #endif
21554
21555 EOF
21556 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21557   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21558   rm -rf conftest*
21559   eval "ac_cv_type_caddr_t=yes"
21560 else
21561   rm -rf conftest*
21562   eval "ac_cv_type_caddr_t=no"
21563 fi
21564 rm -f conftest*
21565
21566 fi
21567 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
21568   echo "$ac_t""yes" 1>&6
21569 else
21570   echo "$ac_t""no" 1>&6
21571   cat >> confdefs.h <<EOF
21572 #define caddr_t char *
21573 EOF
21574
21575 fi
21576
21577
21578 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
21579 echo "configure:21580: checking for socklen_t" >&5
21580 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
21581   echo $ac_n "(cached) $ac_c" 1>&6
21582 else
21583   cat > conftest.$ac_ext <<EOF
21584 #line 21585 "configure"
21585 #include "confdefs.h"
21586
21587 #ifdef HAVE_SYS_TYPES_H
21588 #include <sys/types.h>
21589 #endif
21590 #ifdef HAVE_SYS_SOCKET_H
21591 #include <sys/socket.h>
21592 #endif
21593
21594 int main() {
21595 socklen_t len;
21596 ; return 0; }
21597 EOF
21598 if { (eval echo configure:21599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21599   rm -rf conftest*
21600   ol_cv_type_socklen_t=yes
21601 else
21602   echo "configure: failed program was:" >&5
21603   cat conftest.$ac_ext >&5
21604   rm -rf conftest*
21605   ol_cv_type_socklen_t=no
21606 fi
21607 rm -f conftest*
21608 fi
21609
21610 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
21611   if test $ol_cv_type_socklen_t = no; then
21612     cat >> confdefs.h <<\EOF
21613 #define socklen_t int
21614 EOF
21615
21616   fi
21617  
21618 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
21619 echo "configure:21620: checking for member st_blksize in aggregate type struct stat" >&5
21620 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
21621   echo $ac_n "(cached) $ac_c" 1>&6
21622 else
21623   cat > conftest.$ac_ext <<EOF
21624 #line 21625 "configure"
21625 #include "confdefs.h"
21626 #include <sys/types.h>
21627 #include <sys/stat.h>
21628 int main() {
21629 struct stat foo; foo.st_blksize;
21630 ; return 0; }
21631 EOF
21632 if { (eval echo configure:21633: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21633   rm -rf conftest*
21634   ac_cv_c_struct_member_st_blksize=yes
21635 else
21636   echo "configure: failed program was:" >&5
21637   cat conftest.$ac_ext >&5
21638   rm -rf conftest*
21639   ac_cv_c_struct_member_st_blksize=no
21640 fi
21641 rm -f conftest*
21642 fi
21643
21644 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
21645 st_blksize="$ac_cv_c_struct_member_st_blksize"
21646 if test $ac_cv_c_struct_member_st_blksize = yes; then
21647   cat >> confdefs.h <<\EOF
21648 #define HAVE_ST_BLKSIZE 1
21649 EOF
21650
21651 fi
21652
21653 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
21654 echo "configure:21655: checking whether time.h and sys/time.h may both be included" >&5
21655 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
21656   echo $ac_n "(cached) $ac_c" 1>&6
21657 else
21658   cat > conftest.$ac_ext <<EOF
21659 #line 21660 "configure"
21660 #include "confdefs.h"
21661 #include <sys/types.h>
21662 #include <sys/time.h>
21663 #include <time.h>
21664 int main() {
21665 struct tm *tp;
21666 ; return 0; }
21667 EOF
21668 if { (eval echo configure:21669: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21669   rm -rf conftest*
21670   ac_cv_header_time=yes
21671 else
21672   echo "configure: failed program was:" >&5
21673   cat conftest.$ac_ext >&5
21674   rm -rf conftest*
21675   ac_cv_header_time=no
21676 fi
21677 rm -f conftest*
21678 fi
21679
21680 echo "$ac_t""$ac_cv_header_time" 1>&6
21681 if test $ac_cv_header_time = yes; then
21682   cat >> confdefs.h <<\EOF
21683 #define TIME_WITH_SYS_TIME 1
21684 EOF
21685
21686 fi
21687
21688 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
21689 echo "configure:21690: checking whether struct tm is in sys/time.h or time.h" >&5
21690 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
21691   echo $ac_n "(cached) $ac_c" 1>&6
21692 else
21693   cat > conftest.$ac_ext <<EOF
21694 #line 21695 "configure"
21695 #include "confdefs.h"
21696 #include <sys/types.h>
21697 #include <time.h>
21698 int main() {
21699 struct tm *tp; tp->tm_sec;
21700 ; return 0; }
21701 EOF
21702 if { (eval echo configure:21703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21703   rm -rf conftest*
21704   ac_cv_struct_tm=time.h
21705 else
21706   echo "configure: failed program was:" >&5
21707   cat conftest.$ac_ext >&5
21708   rm -rf conftest*
21709   ac_cv_struct_tm=sys/time.h
21710 fi
21711 rm -f conftest*
21712 fi
21713
21714 echo "$ac_t""$ac_cv_struct_tm" 1>&6
21715 if test $ac_cv_struct_tm = sys/time.h; then
21716   cat >> confdefs.h <<\EOF
21717 #define TM_IN_SYS_TIME 1
21718 EOF
21719
21720 fi
21721
21722 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
21723 echo "configure:21724: checking for uid_t in sys/types.h" >&5
21724 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
21725   echo $ac_n "(cached) $ac_c" 1>&6
21726 else
21727   cat > conftest.$ac_ext <<EOF
21728 #line 21729 "configure"
21729 #include "confdefs.h"
21730 #include <sys/types.h>
21731 EOF
21732 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21733   egrep "uid_t" >/dev/null 2>&1; then
21734   rm -rf conftest*
21735   ac_cv_type_uid_t=yes
21736 else
21737   rm -rf conftest*
21738   ac_cv_type_uid_t=no
21739 fi
21740 rm -f conftest*
21741
21742 fi
21743
21744 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
21745 if test $ac_cv_type_uid_t = no; then
21746   cat >> confdefs.h <<\EOF
21747 #define uid_t int
21748 EOF
21749
21750   cat >> confdefs.h <<\EOF
21751 #define gid_t int
21752 EOF
21753
21754 fi
21755
21756 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
21757 echo "configure:21758: checking for sig_atomic_t" >&5
21758 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
21759   echo $ac_n "(cached) $ac_c" 1>&6
21760 else
21761   cat > conftest.$ac_ext <<EOF
21762 #line 21763 "configure"
21763 #include "confdefs.h"
21764 #include <signal.h>
21765 int main() {
21766 sig_atomic_t atomic;
21767 ; return 0; }
21768 EOF
21769 if { (eval echo configure:21770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21770   rm -rf conftest*
21771   ol_cv_type_sig_atomic_t=yes
21772 else
21773   echo "configure: failed program was:" >&5
21774   cat conftest.$ac_ext >&5
21775   rm -rf conftest*
21776   ol_cv_type_sig_atomic_t=no
21777 fi
21778 rm -f conftest*
21779 fi
21780
21781 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
21782   if test $ol_cv_type_sig_atomic_t = no; then
21783     cat >> confdefs.h <<\EOF
21784 #define sig_atomic_t int
21785 EOF
21786
21787   fi
21788  
21789
21790
21791 # test for pw_gecos in struct passwd
21792 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
21793 echo "configure:21794: checking struct passwd for pw_gecos" >&5
21794 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
21795   echo $ac_n "(cached) $ac_c" 1>&6
21796 else
21797   
21798         cat > conftest.$ac_ext <<EOF
21799 #line 21800 "configure"
21800 #include "confdefs.h"
21801 #include <pwd.h>
21802 int main() {
21803
21804         struct passwd pwd;
21805         pwd.pw_gecos = pwd.pw_name;
21806
21807 ; return 0; }
21808 EOF
21809 if { (eval echo configure:21810: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21810   rm -rf conftest*
21811   ol_cv_struct_passwd_pw_gecos=yes
21812 else
21813   echo "configure: failed program was:" >&5
21814   cat conftest.$ac_ext >&5
21815   rm -rf conftest*
21816   ol_cv_struct_passwd_pw_gecos=no
21817 fi
21818 rm -f conftest*
21819 fi
21820
21821 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
21822 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
21823         cat >> confdefs.h <<\EOF
21824 #define HAVE_PW_GECOS 1
21825 EOF
21826
21827 fi
21828
21829 # test for pw_passwd in struct passwd
21830 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
21831 echo "configure:21832: checking struct passwd for pw_passwd" >&5
21832 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
21833   echo $ac_n "(cached) $ac_c" 1>&6
21834 else
21835   
21836         cat > conftest.$ac_ext <<EOF
21837 #line 21838 "configure"
21838 #include "confdefs.h"
21839 #include <pwd.h>
21840 int main() {
21841
21842         struct passwd pwd;
21843         pwd.pw_passwd = pwd.pw_name;
21844
21845 ; return 0; }
21846 EOF
21847 if { (eval echo configure:21848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21848   rm -rf conftest*
21849   ol_cv_struct_passwd_pw_passwd=yes
21850 else
21851   echo "configure: failed program was:" >&5
21852   cat conftest.$ac_ext >&5
21853   rm -rf conftest*
21854   ol_cv_struct_passwd_pw_passwd=no
21855 fi
21856 rm -f conftest*
21857 fi
21858
21859 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
21860 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
21861         cat >> confdefs.h <<\EOF
21862 #define HAVE_PW_PASSWD 1
21863 EOF
21864
21865 fi
21866
21867
21868 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
21869 echo "configure:21870: checking if toupper() requires islower()" >&5
21870 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
21871   echo $ac_n "(cached) $ac_c" 1>&6
21872 else
21873   
21874         if test "$cross_compiling" = yes; then
21875   ol_cv_c_upper_lower=safe
21876 else
21877   cat > conftest.$ac_ext <<EOF
21878 #line 21879 "configure"
21879 #include "confdefs.h"
21880
21881 #include <ctype.h>
21882 main()
21883 {
21884         if ('C' == toupper('C'))
21885                 exit(0);
21886         else
21887                 exit(1);
21888 }
21889 EOF
21890 if { (eval echo configure:21891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
21891 then
21892   ol_cv_c_upper_lower=no
21893 else
21894   echo "configure: failed program was:" >&5
21895   cat conftest.$ac_ext >&5
21896   rm -fr conftest*
21897   ol_cv_c_upper_lower=yes
21898 fi
21899 rm -fr conftest*
21900 fi
21901
21902 fi
21903
21904 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
21905 if test $ol_cv_c_upper_lower != no ; then
21906         cat >> confdefs.h <<\EOF
21907 #define C_UPPER_LOWER 1
21908 EOF
21909
21910 fi
21911
21912 echo $ac_n "checking for working const""... $ac_c" 1>&6
21913 echo "configure:21914: checking for working const" >&5
21914 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
21915   echo $ac_n "(cached) $ac_c" 1>&6
21916 else
21917   cat > conftest.$ac_ext <<EOF
21918 #line 21919 "configure"
21919 #include "confdefs.h"
21920
21921 int main() {
21922
21923 /* Ultrix mips cc rejects this.  */
21924 typedef int charset[2]; const charset x;
21925 /* SunOS 4.1.1 cc rejects this.  */
21926 char const *const *ccp;
21927 char **p;
21928 /* NEC SVR4.0.2 mips cc rejects this.  */
21929 struct point {int x, y;};
21930 static struct point const zero = {0,0};
21931 /* AIX XL C 1.02.0.0 rejects this.
21932    It does not let you subtract one const X* pointer from another in an arm
21933    of an if-expression whose if-part is not a constant expression */
21934 const char *g = "string";
21935 ccp = &g + (g ? g-g : 0);
21936 /* HPUX 7.0 cc rejects these. */
21937 ++ccp;
21938 p = (char**) ccp;
21939 ccp = (char const *const *) p;
21940 { /* SCO 3.2v4 cc rejects this.  */
21941   char *t;
21942   char const *s = 0 ? (char *) 0 : (char const *) 0;
21943
21944   *t++ = 0;
21945 }
21946 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
21947   int x[] = {25, 17};
21948   const int *foo = &x[0];
21949   ++foo;
21950 }
21951 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
21952   typedef const int *iptr;
21953   iptr p = 0;
21954   ++p;
21955 }
21956 { /* AIX XL C 1.02.0.0 rejects this saying
21957      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
21958   struct s { int j; const int *ap[3]; };
21959   struct s *b; b->j = 5;
21960 }
21961 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
21962   const int foo = 10;
21963 }
21964
21965 ; return 0; }
21966 EOF
21967 if { (eval echo configure:21968: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21968   rm -rf conftest*
21969   ac_cv_c_const=yes
21970 else
21971   echo "configure: failed program was:" >&5
21972   cat conftest.$ac_ext >&5
21973   rm -rf conftest*
21974   ac_cv_c_const=no
21975 fi
21976 rm -f conftest*
21977 fi
21978
21979 echo "$ac_t""$ac_cv_c_const" 1>&6
21980 if test $ac_cv_c_const = no; then
21981   cat >> confdefs.h <<\EOF
21982 #define const 
21983 EOF
21984
21985 fi
21986
21987 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
21988 echo "configure:21989: checking if compiler understands volatile" >&5
21989 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
21990   echo $ac_n "(cached) $ac_c" 1>&6
21991 else
21992   cat > conftest.$ac_ext <<EOF
21993 #line 21994 "configure"
21994 #include "confdefs.h"
21995 int x, y, z;
21996 int main() {
21997 volatile int a; int * volatile b = x ? &y : &z;
21998       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
21999       *b = 0;
22000 ; return 0; }
22001 EOF
22002 if { (eval echo configure:22003: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22003   rm -rf conftest*
22004   ol_cv_c_volatile=yes
22005 else
22006   echo "configure: failed program was:" >&5
22007   cat conftest.$ac_ext >&5
22008   rm -rf conftest*
22009   ol_cv_c_volatile=no
22010 fi
22011 rm -f conftest*
22012 fi
22013
22014 echo "$ac_t""$ol_cv_c_volatile" 1>&6
22015   if test $ol_cv_c_volatile = yes; then
22016     : 
22017   else
22018     cat >> confdefs.h <<\EOF
22019 #define volatile 
22020 EOF
22021
22022   fi
22023  
22024
22025 if test $cross_compiling = yes ; then
22026         cat >> confdefs.h <<\EOF
22027 #define CROSS_COMPILING 1
22028 EOF
22029
22030 else
22031         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
22032 echo "configure:22033: checking whether byte ordering is bigendian" >&5
22033 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
22034   echo $ac_n "(cached) $ac_c" 1>&6
22035 else
22036   ac_cv_c_bigendian=unknown
22037 # See if sys/param.h defines the BYTE_ORDER macro.
22038 cat > conftest.$ac_ext <<EOF
22039 #line 22040 "configure"
22040 #include "confdefs.h"
22041 #include <sys/types.h>
22042 #include <sys/param.h>
22043 int main() {
22044
22045 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
22046  bogus endian macros
22047 #endif
22048 ; return 0; }
22049 EOF
22050 if { (eval echo configure:22051: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22051   rm -rf conftest*
22052   # It does; now see whether it defined to BIG_ENDIAN or not.
22053 cat > conftest.$ac_ext <<EOF
22054 #line 22055 "configure"
22055 #include "confdefs.h"
22056 #include <sys/types.h>
22057 #include <sys/param.h>
22058 int main() {
22059
22060 #if BYTE_ORDER != BIG_ENDIAN
22061  not big endian
22062 #endif
22063 ; return 0; }
22064 EOF
22065 if { (eval echo configure:22066: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22066   rm -rf conftest*
22067   ac_cv_c_bigendian=yes
22068 else
22069   echo "configure: failed program was:" >&5
22070   cat conftest.$ac_ext >&5
22071   rm -rf conftest*
22072   ac_cv_c_bigendian=no
22073 fi
22074 rm -f conftest*
22075 else
22076   echo "configure: failed program was:" >&5
22077   cat conftest.$ac_ext >&5
22078 fi
22079 rm -f conftest*
22080 if test $ac_cv_c_bigendian = unknown; then
22081 if test "$cross_compiling" = yes; then
22082     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
22083 else
22084   cat > conftest.$ac_ext <<EOF
22085 #line 22086 "configure"
22086 #include "confdefs.h"
22087 main () {
22088   /* Are we little or big endian?  From Harbison&Steele.  */
22089   union
22090   {
22091     long l;
22092     char c[sizeof (long)];
22093   } u;
22094   u.l = 1;
22095   exit (u.c[sizeof (long) - 1] == 1);
22096 }
22097 EOF
22098 if { (eval echo configure:22099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
22099 then
22100   ac_cv_c_bigendian=no
22101 else
22102   echo "configure: failed program was:" >&5
22103   cat conftest.$ac_ext >&5
22104   rm -fr conftest*
22105   ac_cv_c_bigendian=yes
22106 fi
22107 rm -fr conftest*
22108 fi
22109
22110 fi
22111 fi
22112
22113 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
22114 if test $ac_cv_c_bigendian = yes; then
22115   cat >> confdefs.h <<\EOF
22116 #define WORDS_BIGENDIAN 1
22117 EOF
22118
22119 fi
22120
22121 fi
22122
22123 echo $ac_n "checking size of short""... $ac_c" 1>&6
22124 echo "configure:22125: checking size of short" >&5 
22125 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
22126   echo $ac_n "(cached) $ac_c" 1>&6
22127 else
22128   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
22129   cat > conftest.$ac_ext <<EOF
22130 #line 22131 "configure"
22131 #include "confdefs.h"
22132 #include "confdefs.h" 
22133 #include <sys/types.h> 
22134  
22135
22136 int main() {
22137 switch (0) case 0: case (sizeof (short) == $ac_size):;
22138 ; return 0; }
22139 EOF
22140 if { (eval echo configure:22141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22141   rm -rf conftest*
22142   ac_cv_sizeof_short=$ac_size
22143 else
22144   echo "configure: failed program was:" >&5
22145   cat conftest.$ac_ext >&5
22146 fi
22147 rm -f conftest* 
22148   if test x$ac_cv_sizeof_short != x ; then break; fi 
22149 done 
22150
22151 fi
22152  
22153 if test x$ac_cv_sizeof_short = x ; then 
22154   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
22155 fi 
22156 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
22157 cat >> confdefs.h <<EOF
22158 #define SIZEOF_SHORT $ac_cv_sizeof_short
22159 EOF
22160  
22161  
22162 echo $ac_n "checking size of int""... $ac_c" 1>&6
22163 echo "configure:22164: checking size of int" >&5 
22164 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
22165   echo $ac_n "(cached) $ac_c" 1>&6
22166 else
22167   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
22168   cat > conftest.$ac_ext <<EOF
22169 #line 22170 "configure"
22170 #include "confdefs.h"
22171 #include "confdefs.h" 
22172 #include <sys/types.h> 
22173  
22174
22175 int main() {
22176 switch (0) case 0: case (sizeof (int) == $ac_size):;
22177 ; return 0; }
22178 EOF
22179 if { (eval echo configure:22180: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22180   rm -rf conftest*
22181   ac_cv_sizeof_int=$ac_size
22182 else
22183   echo "configure: failed program was:" >&5
22184   cat conftest.$ac_ext >&5
22185 fi
22186 rm -f conftest* 
22187   if test x$ac_cv_sizeof_int != x ; then break; fi 
22188 done 
22189
22190 fi
22191  
22192 if test x$ac_cv_sizeof_int = x ; then 
22193   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
22194 fi 
22195 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
22196 cat >> confdefs.h <<EOF
22197 #define SIZEOF_INT $ac_cv_sizeof_int
22198 EOF
22199  
22200  
22201 echo $ac_n "checking size of long""... $ac_c" 1>&6
22202 echo "configure:22203: checking size of long" >&5 
22203 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
22204   echo $ac_n "(cached) $ac_c" 1>&6
22205 else
22206   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
22207   cat > conftest.$ac_ext <<EOF
22208 #line 22209 "configure"
22209 #include "confdefs.h"
22210 #include "confdefs.h" 
22211 #include <sys/types.h> 
22212  
22213
22214 int main() {
22215 switch (0) case 0: case (sizeof (long) == $ac_size):;
22216 ; return 0; }
22217 EOF
22218 if { (eval echo configure:22219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22219   rm -rf conftest*
22220   ac_cv_sizeof_long=$ac_size
22221 else
22222   echo "configure: failed program was:" >&5
22223   cat conftest.$ac_ext >&5
22224 fi
22225 rm -f conftest* 
22226   if test x$ac_cv_sizeof_long != x ; then break; fi 
22227 done 
22228
22229 fi
22230  
22231 if test x$ac_cv_sizeof_long = x ; then 
22232   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
22233 fi 
22234 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
22235 cat >> confdefs.h <<EOF
22236 #define SIZEOF_LONG $ac_cv_sizeof_long
22237 EOF
22238  
22239
22240
22241 if test "$ac_cv_sizeof_int" -lt 4 ; then
22242         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
22243
22244         cat >> confdefs.h <<\EOF
22245 #define LBER_INT_T long
22246 EOF
22247
22248 else
22249         cat >> confdefs.h <<\EOF
22250 #define LBER_INT_T int
22251 EOF
22252
22253 fi
22254
22255 cat >> confdefs.h <<\EOF
22256 #define LBER_LEN_T long
22257 EOF
22258
22259 cat >> confdefs.h <<\EOF
22260 #define LBER_SOCKET_T int
22261 EOF
22262
22263 cat >> confdefs.h <<\EOF
22264 #define LBER_TAG_T long
22265 EOF
22266
22267
22268 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
22269 echo "configure:22270: checking for 8-bit clean memcmp" >&5
22270 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
22271   echo $ac_n "(cached) $ac_c" 1>&6
22272 else
22273   if test "$cross_compiling" = yes; then
22274   ac_cv_func_memcmp_clean=no
22275 else
22276   cat > conftest.$ac_ext <<EOF
22277 #line 22278 "configure"
22278 #include "confdefs.h"
22279
22280 main()
22281 {
22282   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
22283   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
22284 }
22285
22286 EOF
22287 if { (eval echo configure:22288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
22288 then
22289   ac_cv_func_memcmp_clean=yes
22290 else
22291   echo "configure: failed program was:" >&5
22292   cat conftest.$ac_ext >&5
22293   rm -fr conftest*
22294   ac_cv_func_memcmp_clean=no
22295 fi
22296 rm -fr conftest*
22297 fi
22298
22299 fi
22300
22301 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
22302 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
22303
22304 echo $ac_n "checking for strftime""... $ac_c" 1>&6
22305 echo "configure:22306: checking for strftime" >&5
22306 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
22307   echo $ac_n "(cached) $ac_c" 1>&6
22308 else
22309   cat > conftest.$ac_ext <<EOF
22310 #line 22311 "configure"
22311 #include "confdefs.h"
22312 /* System header to define __stub macros and hopefully few prototypes,
22313     which can conflict with char strftime(); below.  */
22314 #include <assert.h>
22315 /* Override any gcc2 internal prototype to avoid an error.  */
22316 /* We use char because int might match the return type of a gcc2
22317     builtin and then its argument prototype would still apply.  */
22318 char strftime();
22319 char (*f)();
22320
22321 int main() {
22322
22323 /* The GNU C library defines this for functions which it implements
22324     to always fail with ENOSYS.  Some functions are actually named
22325     something starting with __ and the normal name is an alias.  */
22326 #if defined (__stub_strftime) || defined (__stub___strftime)
22327 choke me
22328 #else
22329 f = strftime;
22330 #endif
22331
22332 ; return 0; }
22333 EOF
22334 if { (eval echo configure:22335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22335   rm -rf conftest*
22336   eval "ac_cv_func_strftime=yes"
22337 else
22338   echo "configure: failed program was:" >&5
22339   cat conftest.$ac_ext >&5
22340   rm -rf conftest*
22341   eval "ac_cv_func_strftime=no"
22342 fi
22343 rm -f conftest*
22344 fi
22345
22346 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
22347   echo "$ac_t""yes" 1>&6
22348   cat >> confdefs.h <<\EOF
22349 #define HAVE_STRFTIME 1
22350 EOF
22351
22352 else
22353   echo "$ac_t""no" 1>&6
22354 # strftime is in -lintl on SCO UNIX.
22355 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
22356 echo "configure:22357: checking for strftime in -lintl" >&5
22357 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
22358 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
22359   echo $ac_n "(cached) $ac_c" 1>&6
22360 else
22361   ac_save_LIBS="$LIBS"
22362 LIBS="-lintl  $LIBS"
22363 cat > conftest.$ac_ext <<EOF
22364 #line 22365 "configure"
22365 #include "confdefs.h"
22366 /* Override any gcc2 internal prototype to avoid an error.  */
22367 /* We use char because int might match the return type of a gcc2
22368     builtin and then its argument prototype would still apply.  */
22369 char strftime();
22370
22371 int main() {
22372 strftime()
22373 ; return 0; }
22374 EOF
22375 if { (eval echo configure:22376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22376   rm -rf conftest*
22377   eval "ac_cv_lib_$ac_lib_var=yes"
22378 else
22379   echo "configure: failed program was:" >&5
22380   cat conftest.$ac_ext >&5
22381   rm -rf conftest*
22382   eval "ac_cv_lib_$ac_lib_var=no"
22383 fi
22384 rm -f conftest*
22385 LIBS="$ac_save_LIBS"
22386
22387 fi
22388 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
22389   echo "$ac_t""yes" 1>&6
22390   cat >> confdefs.h <<\EOF
22391 #define HAVE_STRFTIME 1
22392 EOF
22393
22394 LIBS="-lintl $LIBS"
22395 else
22396   echo "$ac_t""no" 1>&6
22397 fi
22398
22399 fi
22400
22401
22402 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
22403 echo "configure:22404: checking for inet_aton()" >&5
22404 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
22405   echo $ac_n "(cached) $ac_c" 1>&6
22406 else
22407   cat > conftest.$ac_ext <<EOF
22408 #line 22409 "configure"
22409 #include "confdefs.h"
22410
22411 #ifdef HAVE_SYS_TYPES_H
22412 #       include <sys/types.h>
22413 #endif
22414 #ifdef HAVE_SYS_SOCKET_H
22415 #       include <sys/socket.h>
22416 #       ifdef HAVE_SYS_SELECT_H
22417 #               include <sys/select.h>
22418 #       endif
22419 #       include <netinet/in.h>
22420 #       ifdef HAVE_ARPA_INET_H
22421 #               include <arpa/inet.h>
22422 #       endif
22423 #endif
22424
22425 int main() {
22426 struct in_addr in;
22427 int rc = inet_aton( "255.255.255.255", &in );
22428 ; return 0; }
22429 EOF
22430 if { (eval echo configure:22431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22431   rm -rf conftest*
22432   ol_cv_func_inet_aton=yes
22433 else
22434   echo "configure: failed program was:" >&5
22435   cat conftest.$ac_ext >&5
22436   rm -rf conftest*
22437   ol_cv_func_inet_aton=no
22438 fi
22439 rm -f conftest*
22440 fi
22441
22442 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
22443   if test $ol_cv_func_inet_aton != no; then
22444     cat >> confdefs.h <<\EOF
22445 #define HAVE_INET_ATON 1
22446 EOF
22447
22448   fi
22449  
22450
22451 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
22452 echo "configure:22453: checking for _spawnlp" >&5
22453 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
22454   echo $ac_n "(cached) $ac_c" 1>&6
22455 else
22456   cat > conftest.$ac_ext <<EOF
22457 #line 22458 "configure"
22458 #include "confdefs.h"
22459 /* System header to define __stub macros and hopefully few prototypes,
22460     which can conflict with char _spawnlp(); below.  */
22461 #include <assert.h>
22462 /* Override any gcc2 internal prototype to avoid an error.  */
22463 /* We use char because int might match the return type of a gcc2
22464     builtin and then its argument prototype would still apply.  */
22465 char _spawnlp();
22466 char (*f)();
22467
22468 int main() {
22469
22470 /* The GNU C library defines this for functions which it implements
22471     to always fail with ENOSYS.  Some functions are actually named
22472     something starting with __ and the normal name is an alias.  */
22473 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
22474 choke me
22475 #else
22476 f = _spawnlp;
22477 #endif
22478
22479 ; return 0; }
22480 EOF
22481 if { (eval echo configure:22482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22482   rm -rf conftest*
22483   eval "ac_cv_func__spawnlp=yes"
22484 else
22485   echo "configure: failed program was:" >&5
22486   cat conftest.$ac_ext >&5
22487   rm -rf conftest*
22488   eval "ac_cv_func__spawnlp=no"
22489 fi
22490 rm -f conftest*
22491 fi
22492
22493 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
22494   echo "$ac_t""yes" 1>&6
22495   cat >> confdefs.h <<\EOF
22496 #define HAVE_SPAWNLP 1
22497 EOF
22498
22499 else
22500   echo "$ac_t""no" 1>&6
22501 fi
22502
22503
22504 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
22505 echo "configure:22506: checking for _snprintf" >&5
22506 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
22507   echo $ac_n "(cached) $ac_c" 1>&6
22508 else
22509   cat > conftest.$ac_ext <<EOF
22510 #line 22511 "configure"
22511 #include "confdefs.h"
22512 /* System header to define __stub macros and hopefully few prototypes,
22513     which can conflict with char _snprintf(); below.  */
22514 #include <assert.h>
22515 /* Override any gcc2 internal prototype to avoid an error.  */
22516 /* We use char because int might match the return type of a gcc2
22517     builtin and then its argument prototype would still apply.  */
22518 char _snprintf();
22519 char (*f)();
22520
22521 int main() {
22522
22523 /* The GNU C library defines this for functions which it implements
22524     to always fail with ENOSYS.  Some functions are actually named
22525     something starting with __ and the normal name is an alias.  */
22526 #if defined (__stub__snprintf) || defined (__stub____snprintf)
22527 choke me
22528 #else
22529 f = _snprintf;
22530 #endif
22531
22532 ; return 0; }
22533 EOF
22534 if { (eval echo configure:22535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22535   rm -rf conftest*
22536   eval "ac_cv_func__snprintf=yes"
22537 else
22538   echo "configure: failed program was:" >&5
22539   cat conftest.$ac_ext >&5
22540   rm -rf conftest*
22541   eval "ac_cv_func__snprintf=no"
22542 fi
22543 rm -f conftest*
22544 fi
22545
22546 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
22547   echo "$ac_t""yes" 1>&6
22548   ac_cv_func_snprintf=yes
22549         cat >> confdefs.h <<\EOF
22550 #define snprintf _snprintf
22551 EOF
22552
22553
22554 else
22555   echo "$ac_t""no" 1>&6
22556 fi
22557
22558
22559 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
22560 echo "configure:22561: checking for _vsnprintf" >&5
22561 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
22562   echo $ac_n "(cached) $ac_c" 1>&6
22563 else
22564   cat > conftest.$ac_ext <<EOF
22565 #line 22566 "configure"
22566 #include "confdefs.h"
22567 /* System header to define __stub macros and hopefully few prototypes,
22568     which can conflict with char _vsnprintf(); below.  */
22569 #include <assert.h>
22570 /* Override any gcc2 internal prototype to avoid an error.  */
22571 /* We use char because int might match the return type of a gcc2
22572     builtin and then its argument prototype would still apply.  */
22573 char _vsnprintf();
22574 char (*f)();
22575
22576 int main() {
22577
22578 /* The GNU C library defines this for functions which it implements
22579     to always fail with ENOSYS.  Some functions are actually named
22580     something starting with __ and the normal name is an alias.  */
22581 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
22582 choke me
22583 #else
22584 f = _vsnprintf;
22585 #endif
22586
22587 ; return 0; }
22588 EOF
22589 if { (eval echo configure:22590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22590   rm -rf conftest*
22591   eval "ac_cv_func__vsnprintf=yes"
22592 else
22593   echo "configure: failed program was:" >&5
22594   cat conftest.$ac_ext >&5
22595   rm -rf conftest*
22596   eval "ac_cv_func__vsnprintf=no"
22597 fi
22598 rm -f conftest*
22599 fi
22600
22601 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
22602   echo "$ac_t""yes" 1>&6
22603   ac_cv_func_vsnprintf=yes
22604         cat >> confdefs.h <<\EOF
22605 #define vsnprintf _vsnprintf
22606 EOF
22607
22608
22609 else
22610   echo "$ac_t""no" 1>&6
22611 fi
22612
22613
22614 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
22615 echo "configure:22616: checking for vprintf" >&5
22616 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
22617   echo $ac_n "(cached) $ac_c" 1>&6
22618 else
22619   cat > conftest.$ac_ext <<EOF
22620 #line 22621 "configure"
22621 #include "confdefs.h"
22622 /* System header to define __stub macros and hopefully few prototypes,
22623     which can conflict with char vprintf(); below.  */
22624 #include <assert.h>
22625 /* Override any gcc2 internal prototype to avoid an error.  */
22626 /* We use char because int might match the return type of a gcc2
22627     builtin and then its argument prototype would still apply.  */
22628 char vprintf();
22629 char (*f)();
22630
22631 int main() {
22632
22633 /* The GNU C library defines this for functions which it implements
22634     to always fail with ENOSYS.  Some functions are actually named
22635     something starting with __ and the normal name is an alias.  */
22636 #if defined (__stub_vprintf) || defined (__stub___vprintf)
22637 choke me
22638 #else
22639 f = vprintf;
22640 #endif
22641
22642 ; return 0; }
22643 EOF
22644 if { (eval echo configure:22645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22645   rm -rf conftest*
22646   eval "ac_cv_func_vprintf=yes"
22647 else
22648   echo "configure: failed program was:" >&5
22649   cat conftest.$ac_ext >&5
22650   rm -rf conftest*
22651   eval "ac_cv_func_vprintf=no"
22652 fi
22653 rm -f conftest*
22654 fi
22655
22656 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
22657   echo "$ac_t""yes" 1>&6
22658   cat >> confdefs.h <<\EOF
22659 #define HAVE_VPRINTF 1
22660 EOF
22661
22662 else
22663   echo "$ac_t""no" 1>&6
22664 fi
22665
22666 if test "$ac_cv_func_vprintf" != yes; then
22667 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
22668 echo "configure:22669: checking for _doprnt" >&5
22669 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
22670   echo $ac_n "(cached) $ac_c" 1>&6
22671 else
22672   cat > conftest.$ac_ext <<EOF
22673 #line 22674 "configure"
22674 #include "confdefs.h"
22675 /* System header to define __stub macros and hopefully few prototypes,
22676     which can conflict with char _doprnt(); below.  */
22677 #include <assert.h>
22678 /* Override any gcc2 internal prototype to avoid an error.  */
22679 /* We use char because int might match the return type of a gcc2
22680     builtin and then its argument prototype would still apply.  */
22681 char _doprnt();
22682 char (*f)();
22683
22684 int main() {
22685
22686 /* The GNU C library defines this for functions which it implements
22687     to always fail with ENOSYS.  Some functions are actually named
22688     something starting with __ and the normal name is an alias.  */
22689 #if defined (__stub__doprnt) || defined (__stub____doprnt)
22690 choke me
22691 #else
22692 f = _doprnt;
22693 #endif
22694
22695 ; return 0; }
22696 EOF
22697 if { (eval echo configure:22698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22698   rm -rf conftest*
22699   eval "ac_cv_func__doprnt=yes"
22700 else
22701   echo "configure: failed program was:" >&5
22702   cat conftest.$ac_ext >&5
22703   rm -rf conftest*
22704   eval "ac_cv_func__doprnt=no"
22705 fi
22706 rm -f conftest*
22707 fi
22708
22709 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
22710   echo "$ac_t""yes" 1>&6
22711   cat >> confdefs.h <<\EOF
22712 #define HAVE_DOPRNT 1
22713 EOF
22714
22715 else
22716   echo "$ac_t""no" 1>&6
22717 fi
22718
22719 fi
22720
22721
22722 if test $ac_cv_func_vprintf = yes ; then
22723                 for ac_func in snprintf vsnprintf
22724 do
22725 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
22726 echo "configure:22727: checking for $ac_func" >&5
22727 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
22728   echo $ac_n "(cached) $ac_c" 1>&6
22729 else
22730   cat > conftest.$ac_ext <<EOF
22731 #line 22732 "configure"
22732 #include "confdefs.h"
22733 /* System header to define __stub macros and hopefully few prototypes,
22734     which can conflict with char $ac_func(); below.  */
22735 #include <assert.h>
22736 /* Override any gcc2 internal prototype to avoid an error.  */
22737 /* We use char because int might match the return type of a gcc2
22738     builtin and then its argument prototype would still apply.  */
22739 char $ac_func();
22740 char (*f)();
22741
22742 int main() {
22743
22744 /* The GNU C library defines this for functions which it implements
22745     to always fail with ENOSYS.  Some functions are actually named
22746     something starting with __ and the normal name is an alias.  */
22747 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
22748 choke me
22749 #else
22750 f = $ac_func;
22751 #endif
22752
22753 ; return 0; }
22754 EOF
22755 if { (eval echo configure:22756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22756   rm -rf conftest*
22757   eval "ac_cv_func_$ac_func=yes"
22758 else
22759   echo "configure: failed program was:" >&5
22760   cat conftest.$ac_ext >&5
22761   rm -rf conftest*
22762   eval "ac_cv_func_$ac_func=no"
22763 fi
22764 rm -f conftest*
22765 fi
22766
22767 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
22768   echo "$ac_t""yes" 1>&6
22769     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
22770   cat >> confdefs.h <<EOF
22771 #define $ac_tr_func 1
22772 EOF
22773  
22774 else
22775   echo "$ac_t""no" 1>&6
22776 fi
22777 done
22778
22779 fi
22780
22781 for ac_func in \
22782         bcopy                   \
22783         closesocket             \
22784         chroot                  \
22785         endgrent                \
22786         endpwent                \
22787         fcntl                   \
22788         flock                   \
22789         fstat                   \
22790         getdtablesize   \
22791         getgrgid                \
22792         gethostname             \
22793         getpass                 \
22794         getpassphrase   \
22795         getpwuid                \
22796         getpwnam                \
22797         getspnam                \
22798         gettimeofday    \
22799         initgroups              \
22800         lockf                   \
22801         memcpy                  \
22802         memmove                 \
22803         mkstemp                 \
22804         mktemp                  \
22805         pipe                    \
22806         read                    \
22807         recv                    \
22808         recvfrom                \
22809         setpwfile               \
22810         setgid                  \
22811         setegid                 \
22812         setsid                  \
22813         setuid                  \
22814         seteuid                 \
22815         sigaction               \
22816         signal                  \
22817         sigset                  \
22818         strdup                  \
22819         strerror                \
22820         strpbrk                 \
22821         strrchr                 \
22822         strsep                  \
22823         strstr                  \
22824         strtol                  \
22825         strtoul                 \
22826         strspn                  \
22827         sysconf                 \
22828         usleep                  \
22829         waitpid                 \
22830         wait4                   \
22831         write                   \
22832         send                    \
22833         sendmsg                 \
22834         sendto                  \
22835
22836 do
22837 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
22838 echo "configure:22839: checking for $ac_func" >&5
22839 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
22840   echo $ac_n "(cached) $ac_c" 1>&6
22841 else
22842   cat > conftest.$ac_ext <<EOF
22843 #line 22844 "configure"
22844 #include "confdefs.h"
22845 /* System header to define __stub macros and hopefully few prototypes,
22846     which can conflict with char $ac_func(); below.  */
22847 #include <assert.h>
22848 /* Override any gcc2 internal prototype to avoid an error.  */
22849 /* We use char because int might match the return type of a gcc2
22850     builtin and then its argument prototype would still apply.  */
22851 char $ac_func();
22852 char (*f)();
22853
22854 int main() {
22855
22856 /* The GNU C library defines this for functions which it implements
22857     to always fail with ENOSYS.  Some functions are actually named
22858     something starting with __ and the normal name is an alias.  */
22859 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
22860 choke me
22861 #else
22862 f = $ac_func;
22863 #endif
22864
22865 ; return 0; }
22866 EOF
22867 if { (eval echo configure:22868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22868   rm -rf conftest*
22869   eval "ac_cv_func_$ac_func=yes"
22870 else
22871   echo "configure: failed program was:" >&5
22872   cat conftest.$ac_ext >&5
22873   rm -rf conftest*
22874   eval "ac_cv_func_$ac_func=no"
22875 fi
22876 rm -f conftest*
22877 fi
22878
22879 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
22880   echo "$ac_t""yes" 1>&6
22881     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
22882   cat >> confdefs.h <<EOF
22883 #define $ac_tr_func 1
22884 EOF
22885  
22886 else
22887   echo "$ac_t""no" 1>&6
22888 fi
22889 done
22890
22891
22892 for ac_func in getopt getpeereid
22893 do
22894 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
22895 echo "configure:22896: checking for $ac_func" >&5
22896 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
22897   echo $ac_n "(cached) $ac_c" 1>&6
22898 else
22899   cat > conftest.$ac_ext <<EOF
22900 #line 22901 "configure"
22901 #include "confdefs.h"
22902 /* System header to define __stub macros and hopefully few prototypes,
22903     which can conflict with char $ac_func(); below.  */
22904 #include <assert.h>
22905 /* Override any gcc2 internal prototype to avoid an error.  */
22906 /* We use char because int might match the return type of a gcc2
22907     builtin and then its argument prototype would still apply.  */
22908 char $ac_func();
22909 char (*f)();
22910
22911 int main() {
22912
22913 /* The GNU C library defines this for functions which it implements
22914     to always fail with ENOSYS.  Some functions are actually named
22915     something starting with __ and the normal name is an alias.  */
22916 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
22917 choke me
22918 #else
22919 f = $ac_func;
22920 #endif
22921
22922 ; return 0; }
22923 EOF
22924 if { (eval echo configure:22925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22925   rm -rf conftest*
22926   eval "ac_cv_func_$ac_func=yes"
22927 else
22928   echo "configure: failed program was:" >&5
22929   cat conftest.$ac_ext >&5
22930   rm -rf conftest*
22931   eval "ac_cv_func_$ac_func=no"
22932 fi
22933 rm -f conftest*
22934 fi
22935
22936 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
22937   echo "$ac_t""yes" 1>&6
22938     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
22939   cat >> confdefs.h <<EOF
22940 #define $ac_tr_func 1
22941 EOF
22942  
22943 else
22944   echo "$ac_t""no" 1>&6
22945 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
22946 fi
22947 done
22948
22949
22950
22951 if test "$ac_cv_func_getopt" != yes; then
22952         LIBSRCS="$LIBSRCS getopt.c"
22953 fi
22954 if test "$ac_cv_func_getpeereid" != yes; then
22955         echo $ac_n "checking msg_accrights in msghdr""... $ac_c" 1>&6
22956 echo "configure:22957: checking msg_accrights in msghdr" >&5
22957 if eval "test \"\${ol_cv_msghdr_msg_accrights+set}\" = set"; then
22958   echo $ac_n "(cached) $ac_c" 1>&6
22959 else
22960   cat > conftest.$ac_ext <<EOF
22961 #line 22962 "configure"
22962 #include "confdefs.h"
22963 #include <sys/socket.h>
22964 int main() {
22965 struct msghdr m; m.msg_accrightslen=0
22966 ; return 0; }
22967 EOF
22968 if { (eval echo configure:22969: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22969   rm -rf conftest*
22970   ol_cv_msghdr_msg_accrights=yes
22971 else
22972   echo "configure: failed program was:" >&5
22973   cat conftest.$ac_ext >&5
22974   rm -rf conftest*
22975   ol_cv_msghdr_msg_accrights=no
22976 fi
22977 rm -f conftest*
22978         
22979 fi
22980
22981 echo "$ac_t""$ol_cv_msghdr_msg_accrights" 1>&6
22982   if test $ol_cv_msghdr_msg_accrights = "yes" ; then
22983         cat >> confdefs.h <<\EOF
22984 #define HAVE_MSGHDR_MSG_ACCRIGHTS 1
22985 EOF
22986
22987   fi
22988
22989         LIBSRCS="$LIBSRCS getpeereid.c"
22990 fi
22991 if test "$ac_cv_func_snprintf" != yes -o "$ac_cv_func_vsnprintf" != yes; then
22992         if test "$ac_cv_func_snprintf" != yes; then
22993                 cat >> confdefs.h <<\EOF
22994 #define snprintf ber_pvt_snprintf
22995 EOF
22996
22997         fi
22998         if test "$ac_cv_func_vsnprintf" != yes; then
22999                 cat >> confdefs.h <<\EOF
23000 #define vsnprintf ber_pvt_vsnprintf
23001 EOF
23002
23003         fi
23004 fi
23005
23006 # Check Configuration
23007 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
23008 echo "configure:23009: checking declaration of sys_errlist" >&5
23009 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
23010   echo $ac_n "(cached) $ac_c" 1>&6
23011 else
23012   
23013         cat > conftest.$ac_ext <<EOF
23014 #line 23015 "configure"
23015 #include "confdefs.h"
23016
23017 #include <stdio.h>
23018 #include <sys/types.h>
23019 #include <errno.h>
23020 #ifdef WINNT
23021 #include <stdlib.h>
23022 #endif 
23023 int main() {
23024 char *c = (char *) *sys_errlist
23025 ; return 0; }
23026 EOF
23027 if { (eval echo configure:23028: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
23028   rm -rf conftest*
23029   ol_cv_dcl_sys_errlist=yes
23030         ol_cv_have_sys_errlist=yes
23031 else
23032   echo "configure: failed program was:" >&5
23033   cat conftest.$ac_ext >&5
23034   rm -rf conftest*
23035   ol_cv_dcl_sys_errlist=no
23036 fi
23037 rm -f conftest*
23038 fi
23039
23040 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
23041 #
23042 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
23043 if test $ol_cv_dcl_sys_errlist = no ; then
23044         cat >> confdefs.h <<\EOF
23045 #define DECL_SYS_ERRLIST 1
23046 EOF
23047
23048
23049         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
23050 echo "configure:23051: checking existence of sys_errlist" >&5
23051 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
23052   echo $ac_n "(cached) $ac_c" 1>&6
23053 else
23054   
23055                 cat > conftest.$ac_ext <<EOF
23056 #line 23057 "configure"
23057 #include "confdefs.h"
23058 #include <errno.h>
23059 int main() {
23060 char *c = (char *) *sys_errlist
23061 ; return 0; }
23062 EOF
23063 if { (eval echo configure:23064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
23064   rm -rf conftest*
23065   ol_cv_have_sys_errlist=yes
23066 else
23067   echo "configure: failed program was:" >&5
23068   cat conftest.$ac_ext >&5
23069   rm -rf conftest*
23070   ol_cv_have_sys_errlist=no
23071 fi
23072 rm -f conftest*
23073 fi
23074
23075 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
23076 fi
23077 if test $ol_cv_have_sys_errlist = yes ; then
23078         cat >> confdefs.h <<\EOF
23079 #define HAVE_SYS_ERRLIST 1
23080 EOF
23081
23082 fi
23083
23084
23085
23086 if test "$ol_enable_slapi" != no ; then
23087                         for ac_hdr in ltdl.h
23088 do
23089 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
23090 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
23091 echo "configure:23092: checking for $ac_hdr" >&5
23092 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
23093   echo $ac_n "(cached) $ac_c" 1>&6
23094 else
23095   cat > conftest.$ac_ext <<EOF
23096 #line 23097 "configure"
23097 #include "confdefs.h"
23098 #include <$ac_hdr>
23099 EOF
23100 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
23101 { (eval echo configure:23102: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
23102 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
23103 if test -z "$ac_err"; then
23104   rm -rf conftest*
23105   eval "ac_cv_header_$ac_safe=yes"
23106 else
23107   echo "$ac_err" >&5
23108   echo "configure: failed program was:" >&5
23109   cat conftest.$ac_ext >&5
23110   rm -rf conftest*
23111   eval "ac_cv_header_$ac_safe=no"
23112 fi
23113 rm -f conftest*
23114 fi
23115 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
23116   echo "$ac_t""yes" 1>&6
23117     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
23118   cat >> confdefs.h <<EOF
23119 #define $ac_tr_hdr 1
23120 EOF
23121  
23122 else
23123   echo "$ac_t""no" 1>&6
23124 fi
23125 done
23126
23127
23128         if test $ac_cv_header_ltdl_h != yes ; then
23129                 { echo "configure: error: could not locate <ltdl.h>" 1>&2; exit 1; }
23130         fi
23131         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
23132 echo "configure:23133: checking for lt_dlinit in -lltdl" >&5
23133 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
23134 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
23135   echo $ac_n "(cached) $ac_c" 1>&6
23136 else
23137   ac_save_LIBS="$LIBS"
23138 LIBS="-lltdl  $LIBS"
23139 cat > conftest.$ac_ext <<EOF
23140 #line 23141 "configure"
23141 #include "confdefs.h"
23142 /* Override any gcc2 internal prototype to avoid an error.  */
23143 /* We use char because int might match the return type of a gcc2
23144     builtin and then its argument prototype would still apply.  */
23145 char lt_dlinit();
23146
23147 int main() {
23148 lt_dlinit()
23149 ; return 0; }
23150 EOF
23151 if { (eval echo configure:23152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
23152   rm -rf conftest*
23153   eval "ac_cv_lib_$ac_lib_var=yes"
23154 else
23155   echo "configure: failed program was:" >&5
23156   cat conftest.$ac_ext >&5
23157   rm -rf conftest*
23158   eval "ac_cv_lib_$ac_lib_var=no"
23159 fi
23160 rm -f conftest*
23161 LIBS="$ac_save_LIBS"
23162
23163 fi
23164 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
23165   echo "$ac_t""yes" 1>&6
23166   
23167                 SLAPI_LIBS=-lltdl
23168                 LIBSLAPI=./libslapi.a
23169                 LIBSLAPITOOLS=../libslapi.a
23170                 cat >> confdefs.h <<\EOF
23171 #define HAVE_LIBLTDL 1
23172 EOF
23173
23174         
23175 else
23176   echo "$ac_t""no" 1>&6
23177 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
23178 fi
23179
23180
23181         cat >> confdefs.h <<\EOF
23182 #define LDAP_SLAPI 1
23183 EOF
23184
23185 fi
23186
23187 if test "$ol_enable_debug" != no ; then
23188         cat >> confdefs.h <<\EOF
23189 #define LDAP_DEBUG 1
23190 EOF
23191
23192 fi
23193 if test "$ol_enable_syslog" = yes ; then
23194         cat >> confdefs.h <<\EOF
23195 #define LDAP_SYSLOG 1
23196 EOF
23197
23198 fi
23199 if test "$ol_link_kbind" != no ; then
23200         cat >> confdefs.h <<\EOF
23201 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
23202 EOF
23203
23204 fi
23205 if test "$ol_enable_proctitle" != no ; then
23206         cat >> confdefs.h <<\EOF
23207 #define LDAP_PROCTITLE 1
23208 EOF
23209
23210 fi
23211 if test "$ol_enable_referrals" != no ; then
23212         cat >> confdefs.h <<\EOF
23213 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
23214 EOF
23215
23216 fi
23217 if test "$ol_enable_local" != no; then
23218         cat >> confdefs.h <<\EOF
23219 #define LDAP_PF_LOCAL 1
23220 EOF
23221
23222 fi
23223 if test "$ol_link_ipv6" != no; then
23224         cat >> confdefs.h <<\EOF
23225 #define LDAP_PF_INET6 1
23226 EOF
23227
23228 fi
23229 if test "$ol_enable_cleartext" != no ; then
23230         cat >> confdefs.h <<\EOF
23231 #define SLAPD_CLEARTEXT 1
23232 EOF
23233
23234 fi
23235 if test "$ol_enable_crypt" != no ; then
23236         cat >> confdefs.h <<\EOF
23237 #define SLAPD_CRYPT 1
23238 EOF
23239
23240 fi
23241 if test "$ol_link_kpasswd" != no ; then
23242         cat >> confdefs.h <<\EOF
23243 #define SLAPD_KPASSWD 1
23244 EOF
23245
23246 fi
23247 if test "$ol_link_spasswd" != no ; then
23248         cat >> confdefs.h <<\EOF
23249 #define SLAPD_SPASSWD 1
23250 EOF
23251
23252 fi
23253 if test "$ol_enable_multimaster" != no ; then
23254         cat >> confdefs.h <<\EOF
23255 #define SLAPD_MULTIMASTER 1
23256 EOF
23257
23258 fi
23259 if test "$ol_enable_phonetic" != no ; then
23260         cat >> confdefs.h <<\EOF
23261 #define SLAPD_PHONETIC 1
23262 EOF
23263
23264 fi
23265 if test "$ol_enable_rlookups" != no ; then
23266         cat >> confdefs.h <<\EOF
23267 #define SLAPD_RLOOKUPS 1
23268 EOF
23269
23270 fi
23271 if test "$ol_enable_aci" != no ; then
23272         cat >> confdefs.h <<\EOF
23273 #define SLAPD_ACI_ENABLED 1
23274 EOF
23275
23276 fi
23277
23278 if test "$ol_link_modules" != no ; then
23279         cat >> confdefs.h <<\EOF
23280 #define SLAPD_MODULES 1
23281 EOF
23282
23283         BUILD_SLAPD=yes
23284         SLAPD_MODULES_LDFLAGS="-dlopen self"
23285 fi
23286
23287 if test "$ol_enable_bdb" != no ; then
23288         cat >> confdefs.h <<\EOF
23289 #define SLAPD_BDB 1
23290 EOF
23291
23292         BUILD_SLAPD=yes
23293         BUILD_BDB=yes
23294         if test "$ol_with_bdb_module" != static ; then
23295                 cat >> confdefs.h <<\EOF
23296 #define SLAPD_BDB_DYNAMIC 1
23297 EOF
23298
23299                 BUILD_BDB=mod
23300                 BUILD_BDB_DYNAMIC=shared
23301                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-bdb"
23302         else
23303                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-bdb"
23304         fi
23305 fi
23306
23307 if test "$ol_link_dnssrv" != no ; then
23308         cat >> confdefs.h <<\EOF
23309 #define SLAPD_DNSSRV 1
23310 EOF
23311
23312         BUILD_SLAPD=yes
23313         BUILD_DNSSRV=yes
23314         if test "$ol_with_dnssrv_module" != static ; then
23315                 cat >> confdefs.h <<\EOF
23316 #define SLAPD_DNSSRV_DYNAMIC 1
23317 EOF
23318
23319                 BUILD_DNSSRV=mod
23320                 BUILD_DNSSRV_DYNAMIC=shared
23321                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-dnssrv"
23322         else
23323                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-dnssrv"
23324         fi
23325 fi
23326
23327 if test "$ol_enable_ldap" != no ; then
23328         cat >> confdefs.h <<\EOF
23329 #define SLAPD_LDAP 1
23330 EOF
23331
23332         BUILD_SLAPD=yes
23333         BUILD_LDAP=yes
23334         if test "$ol_with_ldap_module" != static ; then
23335                 cat >> confdefs.h <<\EOF
23336 #define SLAPD_LDAP_DYNAMIC 1
23337 EOF
23338
23339                 BUILD_LDAP=mod
23340                 BUILD_LDAP_DYNAMIC=shared
23341                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldap"
23342         else
23343                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldap"
23344         fi
23345 fi
23346
23347 if test "$ol_link_ldbm" != no -a $ol_enable_ldbm != no; then
23348         cat >> confdefs.h <<\EOF
23349 #define SLAPD_LDBM 1
23350 EOF
23351
23352         BUILD_SLAPD=yes
23353         BUILD_LDBM=yes
23354         if test "$ol_with_ldbm_module" != static ; then
23355                 cat >> confdefs.h <<\EOF
23356 #define SLAPD_LDBM_DYNAMIC 1
23357 EOF
23358
23359                 BUILD_LDBM=mod
23360                 BUILD_LDBM_DYNAMIC=shared
23361                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldbm"
23362         else
23363                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldbm"
23364         fi
23365 fi
23366
23367 if test "$ol_enable_meta" != no ; then
23368         if test "$ol_enable_ldap" = no ; then
23369                 { echo "configure: error: need --enable-ldap to use --enable-meta" 1>&2; exit 1; }
23370         fi
23371         if test "$ol_enable_rewrite" = no ; then
23372                 { echo "configure: error: need --enable-rewrite to use --enable-meta" 1>&2; exit 1; }
23373         fi
23374         cat >> confdefs.h <<\EOF
23375 #define SLAPD_META 1
23376 EOF
23377
23378         BUILD_SLAPD=yes
23379         BUILD_META=yes
23380         BUILD_LDAP=yes
23381         BUILD_REWRITE=yes
23382         if test "$ol_with_meta_module" != static ; then
23383                 cat >> confdefs.h <<\EOF
23384 #define SLAPD_META_DYNAMIC 1
23385 EOF
23386
23387                 BUILD_META=mod
23388                 BUILD_META_DYNAMIC=shared
23389                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-meta"
23390         else
23391                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-meta"
23392         fi
23393 fi
23394
23395 if test "$ol_enable_monitor" != no ; then
23396         cat >> confdefs.h <<\EOF
23397 #define SLAPD_MONITOR 1
23398 EOF
23399
23400         BUILD_SLAPD=yes
23401         BUILD_MONITOR=yes
23402         if test "$ol_with_monitor_module" != static ; then
23403                 cat >> confdefs.h <<\EOF
23404 #define SLAPD_MONITOR_DYNAMIC 1
23405 EOF
23406
23407                 BUILD_MONITOR=mod
23408                 BUILD_MONITOR_DYNAMIC=shared
23409                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-monitor"
23410         else
23411                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-monitor"
23412         fi
23413 fi
23414
23415 if test "$ol_enable_null" != no ; then
23416         cat >> confdefs.h <<\EOF
23417 #define SLAPD_NULL 1
23418 EOF
23419
23420         BUILD_SLAPD=yes
23421         BUILD_NULL=yes
23422         if test "$ol_with_null_module" != static ; then
23423                 cat >> confdefs.h <<\EOF
23424 #define SLAPD_NULL_DYNAMIC 1
23425 EOF
23426
23427                 BUILD_NULL=mod
23428                 BUILD_NULL_DYNAMIC=shared
23429                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-null"
23430         else
23431                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-null"
23432         fi
23433 fi
23434
23435 if test "$ol_enable_passwd" != no ; then
23436         cat >> confdefs.h <<\EOF
23437 #define SLAPD_PASSWD 1
23438 EOF
23439
23440         BUILD_SLAPD=yes
23441         BUILD_PASSWD=yes
23442         if test "$ol_with_passwd_module" != static ; then
23443                 cat >> confdefs.h <<\EOF
23444 #define SLAPD_PASSWD_DYNAMIC 1
23445 EOF
23446
23447                 BUILD_PASSWD=mod
23448                 BUILD_PASSWD_DYNAMIC=shared
23449                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-passwd"
23450         else
23451                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-passwd"
23452         fi
23453 fi
23454
23455 if test "$ol_link_perl" != no ; then
23456         cat >> confdefs.h <<\EOF
23457 #define SLAPD_PERL 1
23458 EOF
23459
23460         BUILD_SLAPD=yes
23461         BUILD_PERL=yes
23462         if test "$ol_with_perl_module" != static ; then
23463                 cat >> confdefs.h <<\EOF
23464 #define SLAPD_PERL_DYNAMIC 1
23465 EOF
23466
23467                 BUILD_PERL=mod
23468                 BUILD_PERL_DYNAMIC=shared
23469                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-perl"
23470         else
23471                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-perl"
23472         fi
23473 fi
23474
23475 if test "$ol_enable_shell" != no ; then
23476         if test "$ol_link_thread" != no ; then
23477                 echo "configure: warning: Use of --without-threads is recommended with back-shell" 1>&2
23478         fi
23479         cat >> confdefs.h <<\EOF
23480 #define SLAPD_SHELL 1
23481 EOF
23482
23483         BUILD_SLAPD=yes
23484         BUILD_SHELL=yes
23485         if test "$ol_with_shell_module" != static ; then
23486                 cat >> confdefs.h <<\EOF
23487 #define SLAPD_SHELL_DYNAMIC 1
23488 EOF
23489
23490                 BUILD_SHELL=mod
23491                 BUILD_SHELL_DYNAMIC=shared
23492                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-shell"
23493         else
23494                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-shell"
23495         fi
23496 fi
23497
23498 if test "$ol_enable_tcl" != no ; then
23499         cat >> confdefs.h <<\EOF
23500 #define SLAPD_TCL 1
23501 EOF
23502
23503         BUILD_SLAPD=yes
23504         BUILD_TCL=yes
23505         if test "$ol_with_tcl_module" != static; then
23506                 cat >> confdefs.h <<\EOF
23507 #define SLAPD_TCL_DYNAMIC 1
23508 EOF
23509
23510                 BUILD_TCL=mod
23511                 BUILD_TCL_DYNAMIC=shared
23512                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-tcl"
23513         else
23514                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-tcl"
23515         fi
23516 fi
23517
23518 if test "$ol_link_sql" != no ; then
23519         cat >> confdefs.h <<\EOF
23520 #define SLAPD_SQL 1
23521 EOF
23522
23523         BUILD_SLAPD=yes
23524         BUILD_SQL=yes
23525         if test "$ol_with_sql_module" != static; then
23526                 cat >> confdefs.h <<\EOF
23527 #define SLAPD_SQL_DYNAMIC 1
23528 EOF
23529
23530                 BUILD_SQL=mod
23531                 BUILD_SQL_DYNAMIC=shared
23532                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-sql"
23533         else
23534                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-sql"
23535         fi
23536 fi
23537
23538 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
23539         $BUILD_SLAPD = yes ; then
23540         BUILD_SLURPD=yes
23541 fi
23542
23543 if test "$ol_enable_rewrite" != no ; then
23544         cat >> confdefs.h <<\EOF
23545 #define ENABLE_REWRITE 1
23546 EOF
23547
23548         BUILD_REWRITE=yes
23549 fi
23550
23551 if test "$ol_enable_slapi" != no ; then
23552         cat >> confdefs.h <<\EOF
23553 #define ENABLE_SLAPI 1
23554 EOF
23555
23556         BUILD_SLAPI=yes
23557         SLAPD_SLAPI_DEPEND=libslapi.a
23558 fi
23559
23560
23561
23562 if test "$ac_cv_mingw32" = yes ; then
23563         PLAT=NT
23564         SLAPD_MODULES_LDFLAGS=
23565 else
23566         PLAT=UNIX
23567 fi
23568
23569 if test -z "$SLAPD_STATIC_BACKENDS"; then
23570         SLAPD_NO_STATIC='#'
23571 else
23572         SLAPD_NO_STATIC=
23573 fi
23574
23575
23576
23577
23578
23579
23580   
23581   
23582   
23583   
23584   
23585   
23586   
23587   
23588   
23589   
23590   
23591   
23592   
23593   
23594   
23595   
23596   
23597   
23598   
23599   
23600   
23601   
23602   
23603   
23604   
23605   
23606
23607
23608
23609
23610
23611
23612
23613
23614
23615
23616
23617
23618
23619
23620
23621
23622
23623
23624
23625
23626
23627
23628
23629
23630
23631
23632
23633
23634
23635
23636
23637
23638
23639
23640
23641
23642
23643
23644
23645
23646
23647 # Check whether --with-xxinstall or --without-xxinstall was given.
23648 if test "${with_xxinstall+set}" = set; then
23649   withval="$with_xxinstall"
23650   :
23651 fi
23652
23653
23654
23655 trap '' 1 2 15
23656
23657 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
23658
23659 test "x$prefix" = xNONE && prefix=$ac_default_prefix
23660 # Let make expand exec_prefix.
23661 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
23662
23663 # Any assignment to VPATH causes Sun make to only execute
23664 # the first set of double-colon rules, so remove it if not needed.
23665 # If there is a colon in the path, we need to keep it.
23666 if test "x$srcdir" = x.; then
23667   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
23668 fi
23669
23670 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
23671
23672 DEFS=-DHAVE_CONFIG_H
23673
23674 # Without the "./", some shells look in PATH for config.status.
23675 : ${CONFIG_STATUS=./config.status}
23676
23677 echo creating $CONFIG_STATUS
23678 rm -f $CONFIG_STATUS
23679 cat > $CONFIG_STATUS <<EOF
23680 #! /bin/sh
23681 # Generated automatically by configure.
23682 # Run this file to recreate the current configuration.
23683 # This directory was configured as follows,
23684 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
23685 #
23686 # $0 $ac_configure_args
23687 #
23688 # Compiler output produced by configure, useful for debugging
23689 # configure, is in ./config.log if it exists.
23690
23691 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
23692 for ac_option
23693 do
23694   case "\$ac_option" in
23695   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
23696     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
23697     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
23698   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
23699     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
23700     exit 0 ;;
23701   -help | --help | --hel | --he | --h)
23702     echo "\$ac_cs_usage"; exit 0 ;;
23703   *) echo "\$ac_cs_usage"; exit 1 ;;
23704   esac
23705 done
23706
23707 ac_given_srcdir=$srcdir
23708 ac_given_INSTALL="$INSTALL"
23709
23710 trap 'rm -fr `echo "\
23711 Makefile:build/top.mk:Makefile.in:build/dir.mk \
23712 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
23713 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
23714 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
23715 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
23716 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
23717 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
23718 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
23719 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
23720 include/Makefile:build/top.mk:include/Makefile.in \
23721 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
23722 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
23723 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23724 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23725 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
23726 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
23727 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
23728 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
23729 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
23730 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
23731 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
23732 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
23733 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
23734 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
23735 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
23736 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
23737 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
23738 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
23739 servers/slapd/back-null/Makefile:build/top.mk:servers/slapd/back-null/Makefile.in:build/mod.mk \
23740 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
23741 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
23742 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
23743 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
23744 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
23745 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
23746 servers/slapd/slapi/Makefile:build/top.mk:servers/slapd/slapi/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23747 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
23748 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
23749 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
23750 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
23751  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
23752 EOF
23753 cat >> $CONFIG_STATUS <<EOF
23754
23755 # Protect against being on the right side of a sed subst in config.status.
23756 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
23757  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
23758 $ac_vpsub
23759 $extrasub
23760 s%@SHELL@%$SHELL%g
23761 s%@CFLAGS@%$CFLAGS%g
23762 s%@CPPFLAGS@%$CPPFLAGS%g
23763 s%@CXXFLAGS@%$CXXFLAGS%g
23764 s%@FFLAGS@%$FFLAGS%g
23765 s%@DEFS@%$DEFS%g
23766 s%@LDFLAGS@%$LDFLAGS%g
23767 s%@LIBS@%$LIBS%g
23768 s%@exec_prefix@%$exec_prefix%g
23769 s%@prefix@%$prefix%g
23770 s%@program_transform_name@%$program_transform_name%g
23771 s%@bindir@%$bindir%g
23772 s%@sbindir@%$sbindir%g
23773 s%@libexecdir@%$libexecdir%g
23774 s%@datadir@%$datadir%g
23775 s%@sysconfdir@%$sysconfdir%g
23776 s%@sharedstatedir@%$sharedstatedir%g
23777 s%@localstatedir@%$localstatedir%g
23778 s%@libdir@%$libdir%g
23779 s%@includedir@%$includedir%g
23780 s%@oldincludedir@%$oldincludedir%g
23781 s%@infodir@%$infodir%g
23782 s%@mandir@%$mandir%g
23783 s%@host@%$host%g
23784 s%@host_alias@%$host_alias%g
23785 s%@host_cpu@%$host_cpu%g
23786 s%@host_vendor@%$host_vendor%g
23787 s%@host_os@%$host_os%g
23788 s%@target@%$target%g
23789 s%@target_alias@%$target_alias%g
23790 s%@target_cpu@%$target_cpu%g
23791 s%@target_vendor@%$target_vendor%g
23792 s%@target_os@%$target_os%g
23793 s%@build@%$build%g
23794 s%@build_alias@%$build_alias%g
23795 s%@build_cpu@%$build_cpu%g
23796 s%@build_vendor@%$build_vendor%g
23797 s%@build_os@%$build_os%g
23798 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
23799 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
23800 s%@INSTALL_DATA@%$INSTALL_DATA%g
23801 s%@PACKAGE@%$PACKAGE%g
23802 s%@VERSION@%$VERSION%g
23803 s%@ACLOCAL@%$ACLOCAL%g
23804 s%@AUTOCONF@%$AUTOCONF%g
23805 s%@AUTOMAKE@%$AUTOMAKE%g
23806 s%@AUTOHEADER@%$AUTOHEADER%g
23807 s%@MAKEINFO@%$MAKEINFO%g
23808 s%@install_sh@%$install_sh%g
23809 s%@AMTAR@%$AMTAR%g
23810 s%@AWK@%$AWK%g
23811 s%@AMTARFLAGS@%$AMTARFLAGS%g
23812 s%@SET_MAKE@%$SET_MAKE%g
23813 s%@OPENLDAP_LIBVERSION@%$OPENLDAP_LIBVERSION%g
23814 s%@OPENLDAP_RELEASE_DATE@%$OPENLDAP_RELEASE_DATE%g
23815 s%@top_builddir@%$top_builddir%g
23816 s%@ldap_subdir@%$ldap_subdir%g
23817 s%@CC@%$CC%g
23818 s%@AR@%$AR%g
23819 s%@LN_S@%$LN_S%g
23820 s%@OBJEXT@%$OBJEXT%g
23821 s%@EXEEXT@%$EXEEXT%g
23822 s%@ECHO@%$ECHO%g
23823 s%@RANLIB@%$RANLIB%g
23824 s%@STRIP@%$STRIP%g
23825 s%@DLLTOOL@%$DLLTOOL%g
23826 s%@AS@%$AS%g
23827 s%@OBJDUMP@%$OBJDUMP%g
23828 s%@CPP@%$CPP%g
23829 s%@LIBTOOL@%$LIBTOOL%g
23830 s%@LN_H@%$LN_H%g
23831 s%@PERLBIN@%$PERLBIN%g
23832 s%@OL_MKDEP@%$OL_MKDEP%g
23833 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
23834 s%@LTSTATIC@%$LTSTATIC%g
23835 s%@LIBOBJS@%$LIBOBJS%g
23836 s%@LIBSRCS@%$LIBSRCS%g
23837 s%@PLAT@%$PLAT%g
23838 s%@BUILD_LIBS_DYNAMIC@%$BUILD_LIBS_DYNAMIC%g
23839 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
23840 s%@BUILD_SLAPI@%$BUILD_SLAPI%g
23841 s%@SLAPD_SLAPI_DEPEND@%$SLAPD_SLAPI_DEPEND%g
23842 s%@BUILD_BDB@%$BUILD_BDB%g
23843 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
23844 s%@BUILD_LDAP@%$BUILD_LDAP%g
23845 s%@BUILD_LDBM@%$BUILD_LDBM%g
23846 s%@BUILD_META@%$BUILD_META%g
23847 s%@BUILD_MONITOR@%$BUILD_MONITOR%g
23848 s%@BUILD_NULL@%$BUILD_NULL%g
23849 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
23850 s%@BUILD_PERL@%$BUILD_PERL%g
23851 s%@BUILD_SHELL@%$BUILD_SHELL%g
23852 s%@BUILD_SQL@%$BUILD_SQL%g
23853 s%@BUILD_TCL@%$BUILD_TCL%g
23854 s%@BUILD_BDB_DYNAMIC@%$BUILD_BDB_DYNAMIC%g
23855 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
23856 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
23857 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
23858 s%@BUILD_META_DYNAMIC@%$BUILD_META_DYNAMIC%g
23859 s%@BUILD_MONITOR_DYNAMIC@%$BUILD_MONITOR_DYNAMIC%g
23860 s%@BUILD_NULL_DYNAMIC@%$BUILD_NULL_DYNAMIC%g
23861 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
23862 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
23863 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
23864 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
23865 s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g
23866 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
23867 s%@LDAP_LIBS@%$LDAP_LIBS%g
23868 s%@LDIF_LIBS@%$LDIF_LIBS%g
23869 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
23870 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
23871 s%@LDBM_LIBS@%$LDBM_LIBS%g
23872 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
23873 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
23874 s%@WRAP_LIBS@%$WRAP_LIBS%g
23875 s%@MOD_TCL_LIB@%$MOD_TCL_LIB%g
23876 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
23877 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
23878 s%@SLAPD_NO_STATIC@%$SLAPD_NO_STATIC%g
23879 s%@SLAPD_STATIC_BACKENDS@%$SLAPD_STATIC_BACKENDS%g
23880 s%@SLAPD_DYNAMIC_BACKENDS@%$SLAPD_DYNAMIC_BACKENDS%g
23881 s%@PERL_CPPFLAGS@%$PERL_CPPFLAGS%g
23882 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
23883 s%@MOD_PERL_LDFLAGS@%$MOD_PERL_LDFLAGS%g
23884 s%@KRB4_LIBS@%$KRB4_LIBS%g
23885 s%@KRB5_LIBS@%$KRB5_LIBS%g
23886 s%@READLINE_LIBS@%$READLINE_LIBS%g
23887 s%@SASL_LIBS@%$SASL_LIBS%g
23888 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
23889 s%@TLS_LIBS@%$TLS_LIBS%g
23890 s%@MODULES_LIBS@%$MODULES_LIBS%g
23891 s%@SLAPI_LIBS@%$SLAPI_LIBS%g
23892 s%@LIBSLAPI@%$LIBSLAPI%g
23893 s%@LIBSLAPITOOLS@%$LIBSLAPITOOLS%g
23894 s%@AUTH_LIBS@%$AUTH_LIBS%g
23895 s%@SLAPD_SLP_LIBS@%$SLAPD_SLP_LIBS%g
23896 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
23897 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
23898 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
23899
23900 CEOF
23901 EOF
23902
23903 cat >> $CONFIG_STATUS <<\EOF
23904
23905 # Split the substitutions into bite-sized pieces for seds with
23906 # small command number limits, like on Digital OSF/1 and HP-UX.
23907 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
23908 ac_file=1 # Number of current file.
23909 ac_beg=1 # First line for current file.
23910 ac_end=$ac_max_sed_cmds # Line after last line for current file.
23911 ac_more_lines=:
23912 ac_sed_cmds=""
23913 while $ac_more_lines; do
23914   if test $ac_beg -gt 1; then
23915     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
23916   else
23917     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
23918   fi
23919   if test ! -s conftest.s$ac_file; then
23920     ac_more_lines=false
23921     rm -f conftest.s$ac_file
23922   else
23923     if test -z "$ac_sed_cmds"; then
23924       ac_sed_cmds="sed -f conftest.s$ac_file"
23925     else
23926       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
23927     fi
23928     ac_file=`expr $ac_file + 1`
23929     ac_beg=$ac_end
23930     ac_end=`expr $ac_end + $ac_max_sed_cmds`
23931   fi
23932 done
23933 if test -z "$ac_sed_cmds"; then
23934   ac_sed_cmds=cat
23935 fi
23936 EOF
23937
23938 cat >> $CONFIG_STATUS <<EOF
23939
23940 CONFIG_FILES=\${CONFIG_FILES-"\
23941 Makefile:build/top.mk:Makefile.in:build/dir.mk \
23942 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
23943 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
23944 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
23945 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
23946 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
23947 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
23948 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
23949 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
23950 include/Makefile:build/top.mk:include/Makefile.in \
23951 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
23952 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
23953 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23954 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23955 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
23956 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
23957 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
23958 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
23959 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
23960 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
23961 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
23962 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
23963 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
23964 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
23965 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
23966 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
23967 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
23968 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
23969 servers/slapd/back-null/Makefile:build/top.mk:servers/slapd/back-null/Makefile.in:build/mod.mk \
23970 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
23971 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
23972 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
23973 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
23974 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
23975 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
23976 servers/slapd/slapi/Makefile:build/top.mk:servers/slapd/slapi/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23977 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
23978 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
23979 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
23980 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
23981 "}
23982 EOF
23983 cat >> $CONFIG_STATUS <<\EOF
23984 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
23985   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23986   case "$ac_file" in
23987   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
23988        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
23989   *) ac_file_in="${ac_file}.in" ;;
23990   esac
23991
23992   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
23993
23994   # Remove last slash and all that follows it.  Not all systems have dirname.
23995   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
23996   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23997     # The file is in a subdirectory.
23998     test ! -d "$ac_dir" && mkdir "$ac_dir"
23999     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
24000     # A "../" for each directory in $ac_dir_suffix.
24001     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
24002   else
24003     ac_dir_suffix= ac_dots=
24004   fi
24005
24006   case "$ac_given_srcdir" in
24007   .)  srcdir=.
24008       if test -z "$ac_dots"; then top_srcdir=.
24009       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
24010   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
24011   *) # Relative path.
24012     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
24013     top_srcdir="$ac_dots$ac_given_srcdir" ;;
24014   esac
24015
24016   case "$ac_given_INSTALL" in
24017   [/$]*) INSTALL="$ac_given_INSTALL" ;;
24018   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
24019   esac
24020
24021   echo creating "$ac_file"
24022   rm -f "$ac_file"
24023   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
24024   case "$ac_file" in
24025   *[Mm]akefile*) ac_comsub="1i\\
24026 # $configure_input" ;;
24027   *) ac_comsub= ;;
24028   esac
24029
24030   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
24031   sed -e "$ac_comsub
24032 s%@configure_input@%$configure_input%g
24033 s%@srcdir@%$srcdir%g
24034 s%@top_srcdir@%$top_srcdir%g
24035 s%@INSTALL@%$INSTALL%g
24036 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
24037 fi; done
24038 rm -f conftest.s*
24039
24040 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
24041 # NAME is the cpp macro being defined and VALUE is the value it is being given.
24042 #
24043 # ac_d sets the value in "#define NAME VALUE" lines.
24044 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
24045 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
24046 ac_dC='\3'
24047 ac_dD='%g'
24048 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
24049 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
24050 ac_uB='\([      ]\)%\1#\2define\3'
24051 ac_uC=' '
24052 ac_uD='\4%g'
24053 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
24054 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
24055 ac_eB='$%\1#\2define\3'
24056 ac_eC=' '
24057 ac_eD='%g'
24058
24059 if test "${CONFIG_HEADERS+set}" != set; then
24060 EOF
24061 cat >> $CONFIG_STATUS <<EOF
24062   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
24063 EOF
24064 cat >> $CONFIG_STATUS <<\EOF
24065 fi
24066 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
24067   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
24068   case "$ac_file" in
24069   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
24070        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
24071   *) ac_file_in="${ac_file}.in" ;;
24072   esac
24073
24074   echo creating $ac_file
24075
24076   rm -f conftest.frag conftest.in conftest.out
24077   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
24078   cat $ac_file_inputs > conftest.in
24079
24080 EOF
24081
24082 # Transform confdefs.h into a sed script conftest.vals that substitutes
24083 # the proper values into config.h.in to produce config.h.  And first:
24084 # Protect against being on the right side of a sed subst in config.status.
24085 # Protect against being in an unquoted here document in config.status.
24086 rm -f conftest.vals
24087 cat > conftest.hdr <<\EOF
24088 s/[\\&%]/\\&/g
24089 s%[\\$`]%\\&%g
24090 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
24091 s%ac_d%ac_u%gp
24092 s%ac_u%ac_e%gp
24093 EOF
24094 sed -n -f conftest.hdr confdefs.h > conftest.vals
24095 rm -f conftest.hdr
24096
24097 # This sed command replaces #undef with comments.  This is necessary, for
24098 # example, in the case of _POSIX_SOURCE, which is predefined and required
24099 # on some systems where configure will not decide to define it.
24100 cat >> conftest.vals <<\EOF
24101 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
24102 EOF
24103
24104 # Break up conftest.vals because some shells have a limit on
24105 # the size of here documents, and old seds have small limits too.
24106
24107 rm -f conftest.tail
24108 while :
24109 do
24110   ac_lines=`grep -c . conftest.vals`
24111   # grep -c gives empty output for an empty file on some AIX systems.
24112   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
24113   # Write a limited-size here document to conftest.frag.
24114   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
24115   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
24116   echo 'CEOF
24117   sed -f conftest.frag conftest.in > conftest.out
24118   rm -f conftest.in
24119   mv conftest.out conftest.in
24120 ' >> $CONFIG_STATUS
24121   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
24122   rm -f conftest.vals
24123   mv conftest.tail conftest.vals
24124 done
24125 rm -f conftest.vals
24126
24127 cat >> $CONFIG_STATUS <<\EOF
24128   rm -f conftest.frag conftest.h
24129   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
24130   cat conftest.in >> conftest.h
24131   rm -f conftest.in
24132   if cmp -s $ac_file conftest.h 2>/dev/null; then
24133     echo "$ac_file is unchanged"
24134     rm -f conftest.h
24135   else
24136     # Remove last slash and all that follows it.  Not all systems have dirname.
24137       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
24138       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
24139       # The file is in a subdirectory.
24140       test ! -d "$ac_dir" && mkdir "$ac_dir"
24141     fi
24142     rm -f $ac_file
24143     mv conftest.h $ac_file
24144   fi
24145 fi; done
24146
24147 EOF
24148 cat >> $CONFIG_STATUS <<EOF
24149
24150 EOF
24151 cat >> $CONFIG_STATUS <<\EOF
24152
24153 date > stamp-h
24154 echo Please run \"make depend\" to build dependencies
24155
24156 exit 0
24157 EOF
24158 chmod +x $CONFIG_STATUS
24159 rm -fr confdefs* $ac_clean_files
24160 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
24161