]> git.sur5r.net Git - openldap/blob - configure
Rebuild with cc missing test.
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.423 2002/06/25 00:18:50 kurt Exp  
4
5 # Copyright 1998-2002 The OpenLDAP Foundation.  All Rights Reserved.
6
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted only as authorized by the OpenLDAP
9 # Public License.  A copy of this license is available at
10 # http://www.OpenLDAP.org/license.html or in file LICENSE in the
11 # top-level directory of the distribution.
12
13 echo "Copyright 1998-2002 The OpenLDAP Foundation,  All Rights Reserved."
14 echo "  Restrictions apply, see COPYRIGHT and LICENSE files."
15
16 # Guess values for system-dependent variables and create Makefiles.
17 # Generated automatically using autoconf version 2.13.1 
18 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
19 #
20 # This configure script is free software; the Free Software Foundation
21 # gives unlimited permission to copy, distribute and modify it.
22
23 # Defaults:
24 ac_help=
25 ac_default_prefix=/usr/local
26 # Any additions from configure.in:
27 ac_default_prefix=/usr/local
28 ac_help="$ac_help
29   --with-subdir=DIR       change default subdirectory used for installs"
30 ac_help="$ac_help
31   --enable-debug          enable debugging [yes]"
32 ac_help="$ac_help
33   --enable-syslog         enable syslog support [auto]"
34 ac_help="$ac_help
35   --enable-proctitle      enable proctitle support [yes]"
36 ac_help="$ac_help
37   --enable-cache          enable caching (experimental) [no]"
38 ac_help="$ac_help
39   --enable-referrals      enable LDAPv2+ Referrals (experimental) [no]"
40 ac_help="$ac_help
41   --enable-ipv6           enable IPv6 support [auto]"
42 ac_help="$ac_help
43   --enable-local          enable AF_LOCAL (AF_UNIX) socket support [auto]"
44 ac_help="$ac_help
45   --enable-x-compile      enable cross compiling [no]"
46 ac_help="$ac_help
47   --with-cyrus-sasl       with Cyrus SASL support [auto]"
48 ac_help="$ac_help
49   --with-fetch            with freeBSD fetch URL support [auto]"
50 ac_help="$ac_help
51   --with-kerberos         with Kerberos support [auto]"
52 ac_help="$ac_help
53   --with-readline         with readline support [auto]"
54 ac_help="$ac_help
55   --with-threads          with threads [auto]"
56 ac_help="$ac_help
57   --with-tls              with TLS/SSL support [auto]"
58 ac_help="$ac_help
59   --with-yielding-select  with implicitly yielding select [auto]"
60 ac_help="$ac_help
61
62 SLAPD (Standalone LDAP Daemon) Options:"
63 ac_help="$ac_help
64   --enable-slapd          enable building slapd [yes]"
65 ac_help="$ac_help
66     --enable-aci          enable per-object ACIs (experimental) [no]"
67 ac_help="$ac_help
68     --enable-cleartext    enable cleartext passwords [yes]"
69 ac_help="$ac_help
70     --enable-crypt        enable crypt(3) passwords [no]"
71 ac_help="$ac_help
72     --enable-dynamic      enable linking built binaries with dynamic libs [no]"
73 ac_help="$ac_help
74     --enable-kpasswd      enable Kerberos password verification [no]"
75 ac_help="$ac_help
76     --enable-lmpasswd     enable LAN Manager passwords [no]"
77 ac_help="$ac_help
78     --enable-spasswd      enable (Cyrus) SASL password verification [no]"
79 ac_help="$ac_help
80     --enable-modules      enable dynamic module support [no]"
81 ac_help="$ac_help
82     --enable-phonetic     enable phonetic/soundex [no]"
83 ac_help="$ac_help
84     --enable-rewrite      enable DN rewriting in back-ldap and back-meta [no]"
85 ac_help="$ac_help
86     --enable-rlookups     enable reverse lookups of client hostnames [no]"
87 ac_help="$ac_help
88     --enable-slp          enable SLPv2 support [no]"
89 ac_help="$ac_help
90     --enable-wrappers     enable tcp wrapper support [no]"
91 ac_help="$ac_help
92     --enable-bdb          enable Berkeley DB backend [yes]"
93 ac_help="$ac_help
94     --with-bdb-module     module type static|dynamic [static]"
95 ac_help="$ac_help
96     --enable-dnssrv       enable dnssrv backend [no]"
97 ac_help="$ac_help
98     --with-dnssrv-module  module type static|dynamic [static]"
99 ac_help="$ac_help
100     --enable-ldap         enable ldap backend [no]"
101 ac_help="$ac_help
102     --with-ldap-module    module type static|dynamic [static]"
103 ac_help="$ac_help
104     --enable-ldbm         enable ldbm backend [no]"
105 ac_help="$ac_help
106     --with-ldbm-api       with LDBM API auto|berkeley|bcompat|mdbm|gdbm [auto]"
107 ac_help="$ac_help
108     --with-ldbm-module    module type static|dynamic [static]"
109 ac_help="$ac_help
110     --with-ldbm-type      use LDBM type auto|btree|hash [auto]"
111 ac_help="$ac_help
112     --enable-meta         enable metadirectory backend [no]"
113 ac_help="$ac_help
114     --with-meta-module    module type static|dynamic [static]"
115 ac_help="$ac_help
116     --enable-monitor      enable monitor backend [no]"
117 ac_help="$ac_help
118     --with-monitor-module module type static|dynamic [static]"
119 ac_help="$ac_help
120     --enable-null         enable null backend [no]"
121 ac_help="$ac_help
122     --with-null-module    module type static|dynamic [static]"
123 ac_help="$ac_help
124     --enable-passwd       enable passwd backend [no]"
125 ac_help="$ac_help
126     --with-passwd-module  module type static|dynamic [static]"
127 ac_help="$ac_help
128     --enable-perl         enable perl backend [no]"
129 ac_help="$ac_help
130     --with-perl-module    module type static|dynamic [static]"
131 ac_help="$ac_help
132     --enable-shell        enable shell backend [no]"
133 ac_help="$ac_help
134     --with-shell-module   module type static|dynamic [static]"
135 ac_help="$ac_help
136     --enable-sql          enable sql backend [no]"
137 ac_help="$ac_help
138     --with-sql-module     module type static|dynamic [static]"
139 ac_help="$ac_help
140     --enable-tcl          enable tcl backend [no]"
141 ac_help="$ac_help
142     --with-tcl-module     module type static|dynamic [static]"
143 ac_help="$ac_help
144
145 SLURPD (Replication Daemon) Options:"
146 ac_help="$ac_help
147   --enable-slurpd         enable building slurpd [auto]"
148 ac_help="$ac_help
149
150 Library Generation & Linking Options"
151 ac_help="$ac_help
152   --enable-static[=PKGS]  build static libraries [default=yes]"
153 ac_help="$ac_help
154   --enable-shared[=PKGS]  build shared libraries [default=yes]"
155 ac_help="$ac_help
156   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
157 ac_help="$ac_help
158   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
159
160 # Find the correct PATH separator.  Usually this is `:', but
161 # DJGPP uses `;' like DOS.
162 if test "X${PATH_SEPARATOR+set}" != Xset; then
163   UNAME=${UNAME-`uname 2>/dev/null`}
164   case X$UNAME in
165     *-DOS) lt_cv_sys_path_separator=';' ;;
166     *)     lt_cv_sys_path_separator=':' ;;
167   esac
168   PATH_SEPARATOR=$lt_cv_sys_path_separator
169 fi
170
171
172 # Check that we are running under the correct shell.
173 SHELL=${CONFIG_SHELL-/bin/sh}
174
175 case X$ECHO in
176 X*--fallback-echo)
177   # Remove one level of quotation (which was required for Make).
178   ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
179   ;;
180 esac
181
182 echo=${ECHO-echo}
183 if test "X$1" = X--no-reexec; then
184   # Discard the --no-reexec flag, and continue.
185   shift
186 elif test "X$1" = X--fallback-echo; then
187   # Avoid inline document here, it may be left over
188   :
189 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
190   # Yippee, $echo works!
191   :
192 else
193   # Restart under the correct shell.
194   exec $SHELL "$0" --no-reexec ${1+"$@"}
195 fi
196
197 if test "X$1" = X--fallback-echo; then
198   # used as fallback echo
199   shift
200   cat <<EOF
201
202 EOF
203   exit 0
204 fi
205
206 # The HP-UX ksh and POSIX shell print the target directory to stdout
207 # if CDPATH is set.
208 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
209
210 if test -z "$ECHO"; then
211 if test "X${echo_test_string+set}" != Xset; then
212 # find a string as large as possible, as long as the shell can cope with it
213   for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
214     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
215     if (echo_test_string="`eval $cmd`") 2>/dev/null &&
216        echo_test_string="`eval $cmd`" &&
217        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
218     then
219       break
220     fi
221   done
222 fi
223
224 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
225    echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
226    test "X$echo_testing_string" = "X$echo_test_string"; then
227   :
228 else
229   # The Solaris, AIX, and Digital Unix default echo programs unquote
230   # backslashes.  This makes it impossible to quote backslashes using
231   #   echo "$something" | sed 's/\\/\\\\/g'
232   #
233   # So, first we look for a working echo in the user's PATH.
234
235   IFS="${IFS=   }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
236   for dir in $PATH /usr/ucb; do
237     if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
238        test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
239        echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
240        test "X$echo_testing_string" = "X$echo_test_string"; then
241       echo="$dir/echo"
242       break
243     fi
244   done
245   IFS="$save_ifs"
246
247   if test "X$echo" = Xecho; then
248     # We didn't find a better echo, so look for alternatives.
249     if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
250        echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
251        test "X$echo_testing_string" = "X$echo_test_string"; then
252       # This shell has a builtin print -r that does the trick.
253       echo='print -r'
254     elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
255          test "X$CONFIG_SHELL" != X/bin/ksh; then
256       # If we have ksh, try running configure again with it.
257       ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
258       export ORIGINAL_CONFIG_SHELL
259       CONFIG_SHELL=/bin/ksh
260       export CONFIG_SHELL
261       exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
262     else
263       # Try using printf.
264       echo='printf %s\n'
265       if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
266          echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
267          test "X$echo_testing_string" = "X$echo_test_string"; then
268         # Cool, printf works
269         :
270       elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
271            test "X$echo_testing_string" = 'X\t' &&
272            echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
273            test "X$echo_testing_string" = "X$echo_test_string"; then
274         CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
275         export CONFIG_SHELL
276         SHELL="$CONFIG_SHELL"
277         export SHELL
278         echo="$CONFIG_SHELL $0 --fallback-echo"
279       elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
280            test "X$echo_testing_string" = 'X\t' &&
281            echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
282            test "X$echo_testing_string" = "X$echo_test_string"; then
283         echo="$CONFIG_SHELL $0 --fallback-echo"
284       else
285         # maybe with a smaller string...
286         prev=:
287
288         for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
289           if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
290           then
291             break
292           fi
293           prev="$cmd"
294         done
295
296         if test "$prev" != 'sed 50q "$0"'; then
297           echo_test_string=`eval $prev`
298           export echo_test_string
299           exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
300         else
301           # Oops.  We lost completely, so just stick with echo.
302           echo=echo
303         fi
304       fi
305     fi
306   fi
307 fi
308 fi
309
310 # Copy echo and quote the copy suitably for passing to libtool from
311 # the Makefile, instead of quoting the original, which is used later.
312 ECHO=$echo
313 if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
314    ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
315 fi
316
317
318 ac_help="$ac_help
319   --disable-libtool-lock  avoid locking (might break parallel builds)"
320 ac_help="$ac_help
321   --with-pic              try to use only PIC/non-PIC objects [default=use both]"
322 ac_help="$ac_help
323
324 See INSTALL file for further details."
325
326 # Initialize some variables set by options.
327 # The variables have the same names as the options, with
328 # dashes changed to underlines.
329 build=NONE
330 cache_file=./config.cache
331 exec_prefix=NONE
332 host=NONE
333 no_create=
334 nonopt=NONE
335 no_recursion=
336 prefix=NONE
337 program_prefix=NONE
338 program_suffix=NONE
339 program_transform_name=s,x,x,
340 silent=
341 site=
342 srcdir=
343 target=NONE
344 verbose=
345 x_includes=NONE
346 x_libraries=NONE
347 bindir='${exec_prefix}/bin'
348 sbindir='${exec_prefix}/sbin'
349 libexecdir='${exec_prefix}/libexec'
350 datadir='${prefix}/share'
351 sysconfdir='${prefix}/etc'
352 sharedstatedir='${prefix}/com'
353 localstatedir='${prefix}/var'
354 libdir='${exec_prefix}/lib'
355 includedir='${prefix}/include'
356 oldincludedir='/usr/include'
357 infodir='${prefix}/info'
358 mandir='${prefix}/man'
359
360 # Initialize some other variables.
361 subdirs=
362 MFLAGS= MAKEFLAGS=
363 SHELL=${CONFIG_SHELL-/bin/sh}
364 # Maximum number of lines to put in a shell here document.
365 ac_max_here_lines=12
366
367 ac_prev=
368 for ac_option
369 do
370
371   # If the previous option needs an argument, assign it.
372   if test -n "$ac_prev"; then
373     eval "$ac_prev=\$ac_option"
374     ac_prev=
375     continue
376   fi
377
378   case "$ac_option" in
379   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
380   *) ac_optarg= ;;
381   esac
382
383   # Accept the important Cygnus configure options, so we can diagnose typos.
384
385   case "$ac_option" in
386
387   -bindir | --bindir | --bindi | --bind | --bin | --bi)
388     ac_prev=bindir ;;
389   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
390     bindir="$ac_optarg" ;;
391
392   -build | --build | --buil | --bui | --bu)
393     ac_prev=build ;;
394   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
395     build="$ac_optarg" ;;
396
397   -cache-file | --cache-file | --cache-fil | --cache-fi \
398   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
399     ac_prev=cache_file ;;
400   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
401   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
402     cache_file="$ac_optarg" ;;
403
404   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
405     ac_prev=datadir ;;
406   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
407   | --da=*)
408     datadir="$ac_optarg" ;;
409
410   -disable-* | --disable-*)
411     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
412     # Reject names that are not valid shell variable names.
413     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
414       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
415     fi
416     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
417     eval "enable_${ac_feature}=no" ;;
418
419   -enable-* | --enable-*)
420     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
421     # Reject names that are not valid shell variable names.
422     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
423       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
424     fi
425     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
426     case "$ac_option" in
427       *=*) ;;
428       *) ac_optarg=yes ;;
429     esac
430     eval "enable_${ac_feature}='$ac_optarg'" ;;
431
432   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
433   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
434   | --exec | --exe | --ex)
435     ac_prev=exec_prefix ;;
436   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
437   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
438   | --exec=* | --exe=* | --ex=*)
439     exec_prefix="$ac_optarg" ;;
440
441   -gas | --gas | --ga | --g)
442     # Obsolete; use --with-gas.
443     with_gas=yes ;;
444
445   -help | --help | --hel | --he)
446     # Omit some internal or obsolete options to make the list less imposing.
447     # This message is too long to be a string in the A/UX 3.1 sh.
448     cat << EOF
449 Usage: configure [options] [host]
450 Options: [defaults in brackets after descriptions]
451 Configuration:
452   --cache-file=FILE       cache test results in FILE
453   --help                  print this message
454   --no-create             do not create output files
455   --quiet, --silent       do not print \`checking...' messages
456   --version               print the version of autoconf that created configure
457 Directory and file names:
458   --prefix=PREFIX         install architecture-independent files in PREFIX
459                           [$ac_default_prefix]
460   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
461                           [same as prefix]
462   --bindir=DIR            user executables in DIR [EPREFIX/bin]
463   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
464   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
465   --datadir=DIR           read-only architecture-independent data in DIR
466                           [PREFIX/share]
467   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
468   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
469                           [PREFIX/com]
470   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
471   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
472   --includedir=DIR        C header files in DIR [PREFIX/include]
473   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
474   --infodir=DIR           info documentation in DIR [PREFIX/info]
475   --mandir=DIR            man documentation in DIR [PREFIX/man]
476   --srcdir=DIR            find the sources in DIR [configure dir or ..]
477   --program-prefix=PREFIX prepend PREFIX to installed program names
478   --program-suffix=SUFFIX append SUFFIX to installed program names
479   --program-transform-name=PROGRAM
480                           run sed PROGRAM on installed program names
481 EOF
482     cat << EOF
483 Host type:
484   --build=BUILD           configure for building on BUILD [BUILD=HOST]
485   --host=HOST             configure for HOST [guessed]
486   --target=TARGET         configure for TARGET [TARGET=HOST]
487 Features and packages:
488   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
489   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
490   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
491   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
492   --x-includes=DIR        X include files are in DIR
493   --x-libraries=DIR       X library files are in DIR
494 EOF
495     if test -n "$ac_help"; then
496       echo "--enable and --with options recognized:$ac_help"
497     fi
498     exit 0 ;;
499
500   -host | --host | --hos | --ho)
501     ac_prev=host ;;
502   -host=* | --host=* | --hos=* | --ho=*)
503     host="$ac_optarg" ;;
504
505   -includedir | --includedir | --includedi | --included | --include \
506   | --includ | --inclu | --incl | --inc)
507     ac_prev=includedir ;;
508   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
509   | --includ=* | --inclu=* | --incl=* | --inc=*)
510     includedir="$ac_optarg" ;;
511
512   -infodir | --infodir | --infodi | --infod | --info | --inf)
513     ac_prev=infodir ;;
514   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
515     infodir="$ac_optarg" ;;
516
517   -libdir | --libdir | --libdi | --libd)
518     ac_prev=libdir ;;
519   -libdir=* | --libdir=* | --libdi=* | --libd=*)
520     libdir="$ac_optarg" ;;
521
522   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
523   | --libexe | --libex | --libe)
524     ac_prev=libexecdir ;;
525   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
526   | --libexe=* | --libex=* | --libe=*)
527     libexecdir="$ac_optarg" ;;
528
529   -localstatedir | --localstatedir | --localstatedi | --localstated \
530   | --localstate | --localstat | --localsta | --localst \
531   | --locals | --local | --loca | --loc | --lo)
532     ac_prev=localstatedir ;;
533   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
534   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
535   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
536     localstatedir="$ac_optarg" ;;
537
538   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
539     ac_prev=mandir ;;
540   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
541     mandir="$ac_optarg" ;;
542
543   -nfp | --nfp | --nf)
544     # Obsolete; use --without-fp.
545     with_fp=no ;;
546
547   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
548   | --no-cr | --no-c)
549     no_create=yes ;;
550
551   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
552   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
553     no_recursion=yes ;;
554
555   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
556   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
557   | --oldin | --oldi | --old | --ol | --o)
558     ac_prev=oldincludedir ;;
559   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
560   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
561   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
562     oldincludedir="$ac_optarg" ;;
563
564   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
565     ac_prev=prefix ;;
566   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
567     prefix="$ac_optarg" ;;
568
569   -program-prefix | --program-prefix | --program-prefi | --program-pref \
570   | --program-pre | --program-pr | --program-p)
571     ac_prev=program_prefix ;;
572   -program-prefix=* | --program-prefix=* | --program-prefi=* \
573   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
574     program_prefix="$ac_optarg" ;;
575
576   -program-suffix | --program-suffix | --program-suffi | --program-suff \
577   | --program-suf | --program-su | --program-s)
578     ac_prev=program_suffix ;;
579   -program-suffix=* | --program-suffix=* | --program-suffi=* \
580   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
581     program_suffix="$ac_optarg" ;;
582
583   -program-transform-name | --program-transform-name \
584   | --program-transform-nam | --program-transform-na \
585   | --program-transform-n | --program-transform- \
586   | --program-transform | --program-transfor \
587   | --program-transfo | --program-transf \
588   | --program-trans | --program-tran \
589   | --progr-tra | --program-tr | --program-t)
590     ac_prev=program_transform_name ;;
591   -program-transform-name=* | --program-transform-name=* \
592   | --program-transform-nam=* | --program-transform-na=* \
593   | --program-transform-n=* | --program-transform-=* \
594   | --program-transform=* | --program-transfor=* \
595   | --program-transfo=* | --program-transf=* \
596   | --program-trans=* | --program-tran=* \
597   | --progr-tra=* | --program-tr=* | --program-t=*)
598     program_transform_name="$ac_optarg" ;;
599
600   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
601   | -silent | --silent | --silen | --sile | --sil)
602     silent=yes ;;
603
604   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
605     ac_prev=sbindir ;;
606   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
607   | --sbi=* | --sb=*)
608     sbindir="$ac_optarg" ;;
609
610   -sharedstatedir | --sharedstatedir | --sharedstatedi \
611   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
612   | --sharedst | --shareds | --shared | --share | --shar \
613   | --sha | --sh)
614     ac_prev=sharedstatedir ;;
615   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
616   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
617   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
618   | --sha=* | --sh=*)
619     sharedstatedir="$ac_optarg" ;;
620
621   -site | --site | --sit)
622     ac_prev=site ;;
623   -site=* | --site=* | --sit=*)
624     site="$ac_optarg" ;;
625
626   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
627     ac_prev=srcdir ;;
628   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
629     srcdir="$ac_optarg" ;;
630
631   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
632   | --syscon | --sysco | --sysc | --sys | --sy)
633     ac_prev=sysconfdir ;;
634   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
635   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
636     sysconfdir="$ac_optarg" ;;
637
638   -target | --target | --targe | --targ | --tar | --ta | --t)
639     ac_prev=target ;;
640   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
641     target="$ac_optarg" ;;
642
643   -v | -verbose | --verbose | --verbos | --verbo | --verb)
644     verbose=yes ;;
645
646   -version | --version | --versio | --versi | --vers)
647     echo "configure generated by autoconf version 2.13.1"
648     exit 0 ;;
649
650   -with-* | --with-*)
651     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
652     # Reject names that are not valid shell variable names.
653     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
654       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
655     fi
656     ac_package=`echo $ac_package| sed 's/-/_/g'`
657     case "$ac_option" in
658       *=*) ;;
659       *) ac_optarg=yes ;;
660     esac
661     eval "with_${ac_package}='$ac_optarg'" ;;
662
663   -without-* | --without-*)
664     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
665     # Reject names that are not valid shell variable names.
666     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
667       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
668     fi
669     ac_package=`echo $ac_package| sed 's/-/_/g'`
670     eval "with_${ac_package}=no" ;;
671
672   --x)
673     # Obsolete; use --with-x.
674     with_x=yes ;;
675
676   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
677   | --x-incl | --x-inc | --x-in | --x-i)
678     ac_prev=x_includes ;;
679   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
680   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
681     x_includes="$ac_optarg" ;;
682
683   -x-libraries | --x-libraries | --x-librarie | --x-librari \
684   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
685     ac_prev=x_libraries ;;
686   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
687   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
688     x_libraries="$ac_optarg" ;;
689
690   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
691     ;;
692
693   *)
694     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
695       echo "configure: warning: $ac_option: invalid host type" 1>&2
696     fi
697     if test "x$nonopt" != xNONE; then
698       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
699     fi
700     nonopt="$ac_option"
701     ;;
702
703   esac
704 done
705
706 if test -n "$ac_prev"; then
707   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
708 fi
709
710 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
711
712 # File descriptor usage:
713 # 0 standard input
714 # 1 file creation
715 # 2 errors and warnings
716 # 3 some systems may open it to /dev/tty
717 # 4 used on the Kubota Titan
718 # 6 checking for... messages and results
719 # 5 compiler messages saved in config.log
720 if test "$silent" = yes; then
721   exec 6>/dev/null
722 else
723   exec 6>&1
724 fi
725 exec 5>./config.log
726
727 echo "\
728 This file contains any messages produced by compilers while
729 running configure, to aid debugging if configure makes a mistake.
730 " 1>&5
731
732 # Strip out --no-create and --no-recursion so they do not pile up.
733 # Also quote any args containing shell metacharacters.
734 ac_configure_args=
735 for ac_arg
736 do
737   case "$ac_arg" in
738   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
739   | --no-cr | --no-c) ;;
740   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
741   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
742   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
743   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
744   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
745   esac
746 done
747
748 # NLS nuisances.
749 # Only set these to C if already set.  These must not be set unconditionally
750 # because not all systems understand e.g. LANG=C (notably SCO).
751 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
752 # Non-C LC_CTYPE values break the ctype check.
753 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
754 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
755 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
756 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
757
758 # confdefs.h avoids OS command line length limits that DEFS can exceed.
759 rm -rf conftest* confdefs.h
760 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
761 echo > confdefs.h
762
763 # A filename unique to this package, relative to the directory that
764 # configure is in, which we can look for to find out if srcdir is correct.
765 ac_unique_file=build/version.sh
766
767 # Find the source files, if location was not specified.
768 if test -z "$srcdir"; then
769   ac_srcdir_defaulted=yes
770   # Try the directory containing this script, then its parent.
771   ac_prog=$0
772   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
773   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
774   srcdir=$ac_confdir
775   if test ! -r $srcdir/$ac_unique_file; then
776     srcdir=..
777   fi
778 else
779   ac_srcdir_defaulted=no
780 fi
781 if test ! -r $srcdir/$ac_unique_file; then
782   if test "$ac_srcdir_defaulted" = yes; then
783     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
784   else
785     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
786   fi
787 fi
788 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
789
790 # Prefer explicitly selected file to automatically selected ones.
791 if test -z "$CONFIG_SITE"; then
792   if test "x$prefix" != xNONE; then
793     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
794   else
795     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
796   fi
797 fi
798 for ac_site_file in $CONFIG_SITE; do
799   if test -r "$ac_site_file"; then
800     echo "loading site script $ac_site_file"
801     . "$ac_site_file"
802   fi
803 done
804
805
806 ac_ext=c
807 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
808 ac_cpp='$CPP $CPPFLAGS'
809 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
810 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
811 cross_compiling=$ac_cv_prog_cc_cross
812
813 ac_exeext=
814 ac_objext=o
815 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
816   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
817   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
818     ac_n= ac_c='
819 ' ac_t='        '
820   else
821     ac_n=-n ac_c= ac_t=
822   fi
823 else
824   ac_n= ac_c='\c' ac_t=
825 fi
826
827
828 # set unset (borrowed from autoconf 2.49c)
829 if (OL_FOO=OL_FOO; unset OL_FOO) >/dev/null 2>&1; then
830   ol_unset=unset
831 else
832   ol_unset=false
833 fi
834 # unset CDPATH
835 $ol_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
836
837 ac_aux_dir=
838 for ac_dir in build $srcdir/build; do
839   if test -f $ac_dir/install-sh; then
840     ac_aux_dir=$ac_dir
841     ac_install_sh="$ac_aux_dir/install-sh -c"
842     break
843   elif test -f $ac_dir/install.sh; then
844     ac_aux_dir=$ac_dir
845     ac_install_sh="$ac_aux_dir/install.sh -c"
846     break
847   elif test -f $ac_dir/shtool; then
848     ac_aux_dir=$ac_dir
849     ac_install_sh="$ac_aux_dir/shtool install -c"
850     break
851   fi
852 done
853 if test -z "$ac_aux_dir"; then
854   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
855 fi
856 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
857 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
858 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
859
860 eval `$ac_aux_dir/version.sh`
861 if test -z "$OL_STRING"; then
862         { echo "configure: error: could not determine version" 1>&2; exit 1; }
863 fi
864
865 if test -f "$ac_aux_dir/shtool" -a ! -d $ac_aux_dir/shtool; then
866         ac_cv_shtool="$ac_aux_dir/shtool"
867 else
868         { echo "configure: error: no shtool found in $ac_aux_dir" 1>&2; exit 1; }
869 fi
870
871 SHTOOL="$ac_cv_shtool"
872
873 TB=`$SHTOOL echo -e %B`
874 TN=`$SHTOOL echo -e %b`
875
876 echo "Configuring $TB$OL_STRING$TN ..."
877
878
879 echo $ac_n "checking host system type""... $ac_c" 1>&6
880 echo "configure:881: checking host system type" >&5
881 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
882
883 # Make sure we can run config.sub.
884   if $ac_config_sub sun4 >/dev/null 2>&1; then :
885     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
886   fi
887
888   ac_cv_host_alias=$host
889   case "$ac_cv_host_alias" in
890   NONE)
891     case $nonopt in
892     NONE)
893       if ac_cv_host_alias=`$ac_config_guess`; then :
894       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
895       fi ;;
896     *) ac_cv_host_alias=$nonopt ;;
897     esac ;;
898   esac
899
900   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
901   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
902   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
903   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
904 else
905   echo $ac_n "(cached) $ac_c" 1>&6
906 fi
907
908 echo "$ac_t""$ac_cv_host" 1>&6
909
910 host=$ac_cv_host
911 host_alias=$ac_cv_host_alias
912 host_cpu=$ac_cv_host_cpu
913 host_vendor=$ac_cv_host_vendor
914 host_os=$ac_cv_host_os
915
916
917
918
919
920 echo $ac_n "checking target system type""... $ac_c" 1>&6
921 echo "configure:922: checking target system type" >&5
922 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
923
924 # Make sure we can run config.sub.
925   if $ac_config_sub sun4 >/dev/null 2>&1; then :
926     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
927   fi
928
929   ac_cv_target_alias=$target
930   case "$ac_cv_target_alias" in
931   NONE)
932     case $nonopt in
933     NONE)
934       ac_cv_target_alias=$host_alias ;;
935
936     *) ac_cv_target_alias=$nonopt ;;
937     esac ;;
938   esac
939
940   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
941   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
942   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
943   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
944 else
945   echo $ac_n "(cached) $ac_c" 1>&6
946 fi
947
948 echo "$ac_t""$ac_cv_target" 1>&6
949
950 target=$ac_cv_target
951 target_alias=$ac_cv_target_alias
952 target_cpu=$ac_cv_target_cpu
953 target_vendor=$ac_cv_target_vendor
954 target_os=$ac_cv_target_os
955
956
957
958
959
960 echo $ac_n "checking build system type""... $ac_c" 1>&6
961 echo "configure:962: checking build system type" >&5
962 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
963
964 # Make sure we can run config.sub.
965   if $ac_config_sub sun4 >/dev/null 2>&1; then :
966     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
967   fi
968
969   ac_cv_build_alias=$build
970   case "$ac_cv_build_alias" in
971   NONE)
972     case $nonopt in
973     NONE)
974       ac_cv_build_alias=$host_alias ;;
975
976     *) ac_cv_build_alias=$nonopt ;;
977     esac ;;
978   esac
979
980   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
981   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
982   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
983   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
984 else
985   echo $ac_n "(cached) $ac_c" 1>&6
986 fi
987
988 echo "$ac_t""$ac_cv_build" 1>&6
989
990 build=$ac_cv_build
991 build_alias=$ac_cv_build_alias
992 build_cpu=$ac_cv_build_cpu
993 build_vendor=$ac_cv_build_vendor
994 build_os=$ac_cv_build_os
995
996
997
998
999
1000 # Do some error checking and defaulting for the host and target type.
1001 # The inputs are:
1002 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
1003 #
1004 # The rules are:
1005 # 1. You are not allowed to specify --host, --target, and nonopt at the
1006 #    same time.
1007 # 2. Host defaults to nonopt.
1008 # 3. If nonopt is not specified, then host defaults to the current host,
1009 #    as determined by config.guess.
1010 # 4. Target and build default to nonopt.
1011 # 5. If nonopt is not specified, then target and build default to host.
1012
1013 # The aliases save the names the user supplied, while $host etc.
1014 # will get canonicalized.
1015 case $host---$target---$nonopt in
1016 NONE---*---* | *---NONE---* | *---*---NONE) ;;
1017 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
1018 esac
1019
1020 test "$host_alias" != "$target_alias" &&
1021   test "$program_prefix$program_suffix$program_transform_name" = \
1022     NONENONEs,x,x, &&
1023   program_prefix=${target_alias}-
1024
1025
1026 # Find a good install program.  We prefer a C program (faster),
1027 # so one script is as good as another.  But avoid the broken or
1028 # incompatible versions:
1029 # SysV /etc/install, /usr/sbin/install
1030 # SunOS /usr/etc/install
1031 # IRIX /sbin/install
1032 # AIX /bin/install
1033 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1034 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1035 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1036 # ./install, which can be erroneously created by make from ./install.sh.
1037 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1038 echo "configure:1039: checking for a BSD compatible install" >&5
1039 if test -z "$INSTALL"; then
1040 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
1041   echo $ac_n "(cached) $ac_c" 1>&6
1042 else
1043     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1044   for ac_dir in $PATH; do
1045     # Account for people who put trailing slashes in PATH elements.
1046     case "$ac_dir/" in
1047     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1048     *)
1049       # OSF1 and SCO ODT 3.0 have their own names for install.
1050       # Don't use installbsd from OSF since it installs stuff as root
1051       # by default.
1052       for ac_prog in ginstall scoinst install; do
1053         if test -f $ac_dir/$ac_prog; then
1054           if test $ac_prog = install &&
1055             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1056             # AIX install.  It has an incompatible calling convention.
1057             :
1058           elif test $ac_prog = install &&
1059             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
1060             # program-specific install script used by HP pwplus--don't use.
1061             :
1062           else
1063             ac_cv_path_install="$ac_dir/$ac_prog -c"
1064             break 2
1065           fi
1066         fi
1067       done
1068       ;;
1069     esac
1070   done
1071   IFS="$ac_save_IFS"
1072
1073 fi
1074   if test "${ac_cv_path_install+set}" = set; then
1075     INSTALL="$ac_cv_path_install"
1076   else
1077     # As a last resort, use the slow shell script.  We don't cache a
1078     # path for INSTALL within a source directory, because that will
1079     # break other packages using the cache if that directory is
1080     # removed, or if the path is relative.
1081     INSTALL="$ac_install_sh"
1082   fi
1083 fi
1084 echo "$ac_t""$INSTALL" 1>&6
1085
1086 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1087 # It thinks the first close brace ends the variable substitution.
1088 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1089
1090 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
1091
1092 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1093
1094 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
1095 echo "configure:1096: checking whether build environment is sane" >&5
1096 # Just in case
1097 sleep 1
1098 echo timestamp > conftestfile
1099 # Do `set' in a subshell so we don't clobber the current shell's
1100 # arguments.  Must try -L first in case configure is actually a
1101 # symlink; some systems play weird games with the mod time of symlinks
1102 # (eg FreeBSD returns the mod time of the symlink's containing
1103 # directory).
1104 if (
1105    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1106    if test "$*" = "X"; then
1107       # -L didn't work.
1108       set X `ls -t $srcdir/configure conftestfile`
1109    fi
1110    if test "$*" != "X $srcdir/configure conftestfile" \
1111       && test "$*" != "X conftestfile $srcdir/configure"; then
1112
1113       # If neither matched, then we have a broken ls.  This can happen
1114       # if, for instance, CONFIG_SHELL is bash and it inherits a
1115       # broken ls alias from the environment.  This has actually
1116       # happened.  Such a system could not be considered "sane".
1117       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
1118 alias in your environment" 1>&2; exit 1; }
1119    fi
1120
1121    test "$2" = conftestfile
1122    )
1123 then
1124    # Ok.
1125    :
1126 else
1127    { echo "configure: error: newly created file is older than distributed files!
1128 Check your system clock" 1>&2; exit 1; }
1129 fi
1130 rm -f conftest*
1131 echo "$ac_t""yes" 1>&6
1132 if test "$program_transform_name" = s,x,x,; then
1133   program_transform_name=
1134 else
1135   # Double any \ or $.  echo might interpret backslashes.
1136   cat <<\EOF_SED > conftestsed
1137 s,\\,\\\\,g; s,\$,$$,g
1138 EOF_SED
1139   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
1140   rm -f conftestsed
1141 fi
1142 test "$program_prefix" != NONE &&
1143   program_transform_name="s,^,${program_prefix},;$program_transform_name"
1144 # Use a double $ so make ignores it.
1145 test "$program_suffix" != NONE &&
1146   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
1147
1148 # sed with no file args requires a program.
1149 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
1150
1151 for ac_prog in mawk gawk nawk awk
1152 do
1153 # Extract the first word of "$ac_prog", so it can be a program name with args.
1154 set dummy $ac_prog; ac_word=$2
1155 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1156 echo "configure:1157: checking for $ac_word" >&5
1157 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
1158   echo $ac_n "(cached) $ac_c" 1>&6
1159 else
1160   if test -n "$AWK"; then
1161   ac_cv_prog_AWK="$AWK" # Let the user override the test.
1162 else
1163   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1164   ac_dummy="$PATH"
1165   for ac_dir in $ac_dummy; do
1166     test -z "$ac_dir" && ac_dir=.
1167     if test -f $ac_dir/$ac_word; then
1168       ac_cv_prog_AWK="$ac_prog"
1169       break
1170     fi
1171   done
1172   IFS="$ac_save_ifs"
1173 fi
1174 fi
1175 AWK="$ac_cv_prog_AWK"
1176 if test -n "$AWK"; then
1177   echo "$ac_t""$AWK" 1>&6
1178 else
1179   echo "$ac_t""no" 1>&6
1180 fi
1181
1182 test -n "$AWK" && break
1183 done
1184
1185 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1186 echo "configure:1187: checking whether ${MAKE-make} sets \${MAKE}" >&5
1187 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1188 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1189   echo $ac_n "(cached) $ac_c" 1>&6
1190 else
1191   cat > conftestmake <<\EOF
1192 all:
1193         @echo 'ac_maketemp="${MAKE}"'
1194 EOF
1195 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1196 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1197 if test -n "$ac_maketemp"; then
1198   eval ac_cv_prog_make_${ac_make}_set=yes
1199 else
1200   eval ac_cv_prog_make_${ac_make}_set=no
1201 fi
1202 rm -f conftestmake
1203 fi
1204 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1205   echo "$ac_t""yes" 1>&6
1206   SET_MAKE=
1207 else
1208   echo "$ac_t""no" 1>&6
1209   SET_MAKE="MAKE=${MAKE-make}"
1210 fi
1211
1212
1213
1214 PACKAGE=$OL_PACKAGE
1215
1216 VERSION=$OL_VERSION
1217
1218 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1219   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
1220 fi
1221
1222
1223
1224 missing_dir=`cd $ac_aux_dir && pwd`
1225 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1226 echo "configure:1227: checking for working aclocal" >&5
1227 # Run test in a subshell; some versions of sh will print an error if
1228 # an executable is not found, even if stderr is redirected.
1229 # Redirect stdin to placate older versions of autoconf.  Sigh.
1230 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1231    ACLOCAL=aclocal
1232    echo "$ac_t""found" 1>&6
1233 else
1234    ACLOCAL="$missing_dir/missing aclocal"
1235    echo "$ac_t""missing" 1>&6
1236 fi
1237
1238 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1239 echo "configure:1240: checking for working autoconf" >&5
1240 # Run test in a subshell; some versions of sh will print an error if
1241 # an executable is not found, even if stderr is redirected.
1242 # Redirect stdin to placate older versions of autoconf.  Sigh.
1243 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1244    AUTOCONF=autoconf
1245    echo "$ac_t""found" 1>&6
1246 else
1247    AUTOCONF="$missing_dir/missing autoconf"
1248    echo "$ac_t""missing" 1>&6
1249 fi
1250
1251 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1252 echo "configure:1253: checking for working automake" >&5
1253 # Run test in a subshell; some versions of sh will print an error if
1254 # an executable is not found, even if stderr is redirected.
1255 # Redirect stdin to placate older versions of autoconf.  Sigh.
1256 if (automake --version) < /dev/null > /dev/null 2>&1; then
1257    AUTOMAKE=automake
1258    echo "$ac_t""found" 1>&6
1259 else
1260    AUTOMAKE="$missing_dir/missing automake"
1261    echo "$ac_t""missing" 1>&6
1262 fi
1263
1264 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1265 echo "configure:1266: checking for working autoheader" >&5
1266 # Run test in a subshell; some versions of sh will print an error if
1267 # an executable is not found, even if stderr is redirected.
1268 # Redirect stdin to placate older versions of autoconf.  Sigh.
1269 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1270    AUTOHEADER=autoheader
1271    echo "$ac_t""found" 1>&6
1272 else
1273    AUTOHEADER="$missing_dir/missing autoheader"
1274    echo "$ac_t""missing" 1>&6
1275 fi
1276
1277 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1278 echo "configure:1279: checking for working makeinfo" >&5
1279 # Run test in a subshell; some versions of sh will print an error if
1280 # an executable is not found, even if stderr is redirected.
1281 # Redirect stdin to placate older versions of autoconf.  Sigh.
1282 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1283    MAKEINFO=makeinfo
1284    echo "$ac_t""found" 1>&6
1285 else
1286    MAKEINFO="$missing_dir/missing makeinfo"
1287    echo "$ac_t""missing" 1>&6
1288 fi
1289
1290 install_sh="$missing_dir/install-sh"
1291 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1292
1293 for ac_prog in gnutar gtar tar
1294 do
1295 # Extract the first word of "$ac_prog", so it can be a program name with args.
1296 set dummy $ac_prog; ac_word=$2
1297 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1298 echo "configure:1299: checking for $ac_word" >&5
1299 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1300   echo $ac_n "(cached) $ac_c" 1>&6
1301 else
1302   if test -n "$AMTAR"; then
1303   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1304 else
1305   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1306   ac_dummy="$PATH"
1307   for ac_dir in $ac_dummy; do
1308     test -z "$ac_dir" && ac_dir=.
1309     if test -f $ac_dir/$ac_word; then
1310       ac_cv_prog_AMTAR="$ac_prog"
1311       break
1312     fi
1313   done
1314   IFS="$ac_save_ifs"
1315 fi
1316 fi
1317 AMTAR="$ac_cv_prog_AMTAR"
1318 if test -n "$AMTAR"; then
1319   echo "$ac_t""$AMTAR" 1>&6
1320 else
1321   echo "$ac_t""no" 1>&6
1322 fi
1323
1324 test -n "$AMTAR" && break
1325 done
1326
1327
1328 AMTARFLAGS=
1329 if test -n "$AMTAR"; then
1330   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1331         AMTARFLAGS=o
1332   fi
1333 fi
1334
1335 cat >> confdefs.h <<EOF
1336 #define OPENLDAP_PACKAGE "$PACKAGE"
1337 EOF
1338
1339 cat >> confdefs.h <<EOF
1340 #define OPENLDAP_VERSION "$VERSION"
1341 EOF
1342
1343
1344 cat >> confdefs.h <<EOF
1345 #define LDAP_VENDOR_VERSION $OL_API_INC
1346 EOF
1347
1348 cat >> confdefs.h <<EOF
1349 #define LDAP_VENDOR_VERSION_MAJOR $OL_MAJOR
1350 EOF
1351
1352 cat >> confdefs.h <<EOF
1353 #define LDAP_VENDOR_VERSION_MINOR $OL_MINOR
1354 EOF
1355
1356 cat >> confdefs.h <<EOF
1357 #define LDAP_VENDOR_VERSION_PATCH $OL_PATCH
1358 EOF
1359
1360
1361 OPENLDAP_LIBVERSION=$OL_API_LIB
1362
1363 OPENLDAP_RELEASE_DATE="$OL_RELEASE_DATE"
1364
1365
1366
1367 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1368 echo "configure:1369: checking configure arguments" >&5
1369
1370
1371 top_builddir=`pwd`
1372
1373 ldap_subdir="/openldap"
1374
1375 # Check whether --with-subdir or --without-subdir was given.
1376 if test "${with_subdir+set}" = set; then
1377   withval="$with_subdir"
1378   case "$withval" in
1379         no) ldap_subdir=""
1380                 ;;
1381         yes)
1382                 ;;
1383         /*|\\*)
1384                 ldap_subdir="$withval"
1385                 ;;
1386         *)
1387                 ldap_subdir="/$withval"
1388                 ;;
1389 esac
1390
1391 fi
1392
1393
1394 # OpenLDAP --enable-debug
1395         # Check whether --enable-debug or --disable-debug was given.
1396 if test "${enable_debug+set}" = set; then
1397   enableval="$enable_debug"
1398   
1399         ol_arg=invalid
1400         for ol_val in auto yes no ; do
1401                 if test "$enableval" = "$ol_val" ; then
1402                         ol_arg="$ol_val"
1403                 fi
1404         done
1405         if test "$ol_arg" = "invalid" ; then
1406                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1407         fi
1408         ol_enable_debug="$ol_arg"
1409
1410 else
1411         ol_enable_debug="yes"
1412 fi
1413 # end --enable-debug
1414 # OpenLDAP --enable-syslog
1415         # Check whether --enable-syslog or --disable-syslog was given.
1416 if test "${enable_syslog+set}" = set; then
1417   enableval="$enable_syslog"
1418   
1419         ol_arg=invalid
1420         for ol_val in auto yes no ; do
1421                 if test "$enableval" = "$ol_val" ; then
1422                         ol_arg="$ol_val"
1423                 fi
1424         done
1425         if test "$ol_arg" = "invalid" ; then
1426                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1427         fi
1428         ol_enable_syslog="$ol_arg"
1429
1430 else
1431         ol_enable_syslog="auto"
1432 fi
1433 # end --enable-syslog
1434 # OpenLDAP --enable-proctitle
1435         # Check whether --enable-proctitle or --disable-proctitle was given.
1436 if test "${enable_proctitle+set}" = set; then
1437   enableval="$enable_proctitle"
1438   
1439         ol_arg=invalid
1440         for ol_val in auto yes no ; do
1441                 if test "$enableval" = "$ol_val" ; then
1442                         ol_arg="$ol_val"
1443                 fi
1444         done
1445         if test "$ol_arg" = "invalid" ; then
1446                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1447         fi
1448         ol_enable_proctitle="$ol_arg"
1449
1450 else
1451         ol_enable_proctitle="yes"
1452 fi
1453 # end --enable-proctitle
1454 # OpenLDAP --enable-cache
1455         # Check whether --enable-cache or --disable-cache was given.
1456 if test "${enable_cache+set}" = set; then
1457   enableval="$enable_cache"
1458   
1459         ol_arg=invalid
1460         for ol_val in auto yes no ; do
1461                 if test "$enableval" = "$ol_val" ; then
1462                         ol_arg="$ol_val"
1463                 fi
1464         done
1465         if test "$ol_arg" = "invalid" ; then
1466                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
1467         fi
1468         ol_enable_cache="$ol_arg"
1469
1470 else
1471         ol_enable_cache="no"
1472 fi
1473 # end --enable-cache
1474 # OpenLDAP --enable-referrals
1475         # Check whether --enable-referrals or --disable-referrals was given.
1476 if test "${enable_referrals+set}" = set; then
1477   enableval="$enable_referrals"
1478   
1479         ol_arg=invalid
1480         for ol_val in auto yes no ; do
1481                 if test "$enableval" = "$ol_val" ; then
1482                         ol_arg="$ol_val"
1483                 fi
1484         done
1485         if test "$ol_arg" = "invalid" ; then
1486                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1487         fi
1488         ol_enable_referrals="$ol_arg"
1489
1490 else
1491         ol_enable_referrals="no"
1492 fi
1493 # end --enable-referrals
1494 ol_enable_kbind=${ol_enable_kbind-no}
1495 # OpenLDAP --enable-ipv6
1496         # Check whether --enable-ipv6 or --disable-ipv6 was given.
1497 if test "${enable_ipv6+set}" = set; then
1498   enableval="$enable_ipv6"
1499   
1500         ol_arg=invalid
1501         for ol_val in auto yes no ; do
1502                 if test "$enableval" = "$ol_val" ; then
1503                         ol_arg="$ol_val"
1504                 fi
1505         done
1506         if test "$ol_arg" = "invalid" ; then
1507                 { echo "configure: error: bad value $enableval for --enable-ipv6" 1>&2; exit 1; }
1508         fi
1509         ol_enable_ipv6="$ol_arg"
1510
1511 else
1512         ol_enable_ipv6="auto"
1513 fi
1514 # end --enable-ipv6
1515 # OpenLDAP --enable-local
1516         # Check whether --enable-local or --disable-local was given.
1517 if test "${enable_local+set}" = set; then
1518   enableval="$enable_local"
1519   
1520         ol_arg=invalid
1521         for ol_val in auto yes no ; do
1522                 if test "$enableval" = "$ol_val" ; then
1523                         ol_arg="$ol_val"
1524                 fi
1525         done
1526         if test "$ol_arg" = "invalid" ; then
1527                 { echo "configure: error: bad value $enableval for --enable-local" 1>&2; exit 1; }
1528         fi
1529         ol_enable_local="$ol_arg"
1530
1531 else
1532         ol_enable_local="auto"
1533 fi
1534 # end --enable-local
1535 # OpenLDAP --enable-x_compile
1536         # Check whether --enable-x_compile or --disable-x_compile was given.
1537 if test "${enable_x_compile+set}" = set; then
1538   enableval="$enable_x_compile"
1539   
1540         ol_arg=invalid
1541         for ol_val in yes no ; do
1542                 if test "$enableval" = "$ol_val" ; then
1543                         ol_arg="$ol_val"
1544                 fi
1545         done
1546         if test "$ol_arg" = "invalid" ; then
1547                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1548         fi
1549         ol_enable_x_compile="$ol_arg"
1550
1551 else
1552         ol_enable_x_compile="no"
1553 fi
1554 # end --enable-x_compile
1555
1556
1557 # OpenLDAP --with-cyrus_sasl
1558         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1559 if test "${with_cyrus_sasl+set}" = set; then
1560   withval="$with_cyrus_sasl"
1561   
1562         ol_arg=invalid
1563         for ol_val in auto yes no  ; do
1564                 if test "$withval" = "$ol_val" ; then
1565                         ol_arg="$ol_val"
1566                 fi
1567         done
1568         if test "$ol_arg" = "invalid" ; then
1569                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1570         fi
1571         ol_with_cyrus_sasl="$ol_arg"
1572
1573 else
1574         ol_with_cyrus_sasl="auto"
1575 fi
1576 # end --with-cyrus_sasl
1577
1578 # OpenLDAP --with-fetch
1579         # Check whether --with-fetch or --without-fetch was given.
1580 if test "${with_fetch+set}" = set; then
1581   withval="$with_fetch"
1582   
1583         ol_arg=invalid
1584         for ol_val in auto yes no  ; do
1585                 if test "$withval" = "$ol_val" ; then
1586                         ol_arg="$ol_val"
1587                 fi
1588         done
1589         if test "$ol_arg" = "invalid" ; then
1590                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1591         fi
1592         ol_with_fetch="$ol_arg"
1593
1594 else
1595         ol_with_fetch="auto"
1596 fi
1597 # end --with-fetch
1598
1599 # OpenLDAP --with-kerberos
1600         # Check whether --with-kerberos or --without-kerberos was given.
1601 if test "${with_kerberos+set}" = set; then
1602   withval="$with_kerberos"
1603   
1604         ol_arg=invalid
1605         for ol_val in auto k5 k5only k425 kth k4 afs yes no ; do
1606                 if test "$withval" = "$ol_val" ; then
1607                         ol_arg="$ol_val"
1608                 fi
1609         done
1610         if test "$ol_arg" = "invalid" ; then
1611                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1612         fi
1613         ol_with_kerberos="$ol_arg"
1614
1615 else
1616         ol_with_kerberos="auto"
1617 fi
1618 # end --with-kerberos
1619
1620 # OpenLDAP --with-readline
1621         # Check whether --with-readline or --without-readline was given.
1622 if test "${with_readline+set}" = set; then
1623   withval="$with_readline"
1624   
1625         ol_arg=invalid
1626         for ol_val in auto yes no  ; do
1627                 if test "$withval" = "$ol_val" ; then
1628                         ol_arg="$ol_val"
1629                 fi
1630         done
1631         if test "$ol_arg" = "invalid" ; then
1632                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1633         fi
1634         ol_with_readline="$ol_arg"
1635
1636 else
1637         ol_with_readline="auto"
1638 fi
1639 # end --with-readline
1640
1641 # OpenLDAP --with-threads
1642         # Check whether --with-threads or --without-threads was given.
1643 if test "${with_threads+set}" = set; then
1644   withval="$with_threads"
1645   
1646         ol_arg=invalid
1647         for ol_val in auto nt posix mach pth lwp yes no manual  ; do
1648                 if test "$withval" = "$ol_val" ; then
1649                         ol_arg="$ol_val"
1650                 fi
1651         done
1652         if test "$ol_arg" = "invalid" ; then
1653                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1654         fi
1655         ol_with_threads="$ol_arg"
1656
1657 else
1658         ol_with_threads="auto"
1659 fi
1660 # end --with-threads
1661
1662 # OpenLDAP --with-tls
1663         # Check whether --with-tls or --without-tls was given.
1664 if test "${with_tls+set}" = set; then
1665   withval="$with_tls"
1666   
1667         ol_arg=invalid
1668         for ol_val in auto ssleay openssl yes no  ; do
1669                 if test "$withval" = "$ol_val" ; then
1670                         ol_arg="$ol_val"
1671                 fi
1672         done
1673         if test "$ol_arg" = "invalid" ; then
1674                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1675         fi
1676         ol_with_tls="$ol_arg"
1677
1678 else
1679         ol_with_tls="auto"
1680 fi
1681 # end --with-tls
1682
1683 # OpenLDAP --with-yielding_select
1684         # Check whether --with-yielding_select or --without-yielding_select was given.
1685 if test "${with_yielding_select+set}" = set; then
1686   withval="$with_yielding_select"
1687   
1688         ol_arg=invalid
1689         for ol_val in auto yes no manual  ; do
1690                 if test "$withval" = "$ol_val" ; then
1691                         ol_arg="$ol_val"
1692                 fi
1693         done
1694         if test "$ol_arg" = "invalid" ; then
1695                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1696         fi
1697         ol_with_yielding_select="$ol_arg"
1698
1699 else
1700         ol_with_yielding_select="auto"
1701 fi
1702 # end --with-yielding_select
1703
1704
1705
1706 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1707 if test "${with_xxslapdoptions+set}" = set; then
1708   withval="$with_xxslapdoptions"
1709   :
1710 fi
1711
1712 # OpenLDAP --enable-slapd
1713         # Check whether --enable-slapd or --disable-slapd was given.
1714 if test "${enable_slapd+set}" = set; then
1715   enableval="$enable_slapd"
1716   
1717         ol_arg=invalid
1718         for ol_val in auto yes no ; do
1719                 if test "$enableval" = "$ol_val" ; then
1720                         ol_arg="$ol_val"
1721                 fi
1722         done
1723         if test "$ol_arg" = "invalid" ; then
1724                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1725         fi
1726         ol_enable_slapd="$ol_arg"
1727
1728 else
1729         ol_enable_slapd="yes"
1730 fi
1731 # end --enable-slapd
1732 # OpenLDAP --enable-aci
1733         # Check whether --enable-aci or --disable-aci was given.
1734 if test "${enable_aci+set}" = set; then
1735   enableval="$enable_aci"
1736   
1737         ol_arg=invalid
1738         for ol_val in auto yes no ; do
1739                 if test "$enableval" = "$ol_val" ; then
1740                         ol_arg="$ol_val"
1741                 fi
1742         done
1743         if test "$ol_arg" = "invalid" ; then
1744                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1745         fi
1746         ol_enable_aci="$ol_arg"
1747
1748 else
1749         ol_enable_aci="no"
1750 fi
1751 # end --enable-aci
1752 # OpenLDAP --enable-cleartext
1753         # Check whether --enable-cleartext or --disable-cleartext was given.
1754 if test "${enable_cleartext+set}" = set; then
1755   enableval="$enable_cleartext"
1756   
1757         ol_arg=invalid
1758         for ol_val in auto yes no ; do
1759                 if test "$enableval" = "$ol_val" ; then
1760                         ol_arg="$ol_val"
1761                 fi
1762         done
1763         if test "$ol_arg" = "invalid" ; then
1764                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1765         fi
1766         ol_enable_cleartext="$ol_arg"
1767
1768 else
1769         ol_enable_cleartext="yes"
1770 fi
1771 # end --enable-cleartext
1772 # OpenLDAP --enable-crypt
1773         # Check whether --enable-crypt or --disable-crypt was given.
1774 if test "${enable_crypt+set}" = set; then
1775   enableval="$enable_crypt"
1776   
1777         ol_arg=invalid
1778         for ol_val in auto yes no ; do
1779                 if test "$enableval" = "$ol_val" ; then
1780                         ol_arg="$ol_val"
1781                 fi
1782         done
1783         if test "$ol_arg" = "invalid" ; then
1784                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1785         fi
1786         ol_enable_crypt="$ol_arg"
1787
1788 else
1789         ol_enable_crypt="no"
1790 fi
1791 # end --enable-crypt
1792 # OpenLDAP --enable-dynamic
1793         # Check whether --enable-dynamic or --disable-dynamic was given.
1794 if test "${enable_dynamic+set}" = set; then
1795   enableval="$enable_dynamic"
1796   
1797         ol_arg=invalid
1798         for ol_val in auto yes no ; do
1799                 if test "$enableval" = "$ol_val" ; then
1800                         ol_arg="$ol_val"
1801                 fi
1802         done
1803         if test "$ol_arg" = "invalid" ; then
1804                 { echo "configure: error: bad value $enableval for --enable-dynamic" 1>&2; exit 1; }
1805         fi
1806         ol_enable_dynamic="$ol_arg"
1807
1808 else
1809         ol_enable_dynamic="no"
1810 fi
1811 # end --enable-dynamic
1812 # OpenLDAP --enable-kpasswd
1813         # Check whether --enable-kpasswd or --disable-kpasswd was given.
1814 if test "${enable_kpasswd+set}" = set; then
1815   enableval="$enable_kpasswd"
1816   
1817         ol_arg=invalid
1818         for ol_val in auto yes no ; do
1819                 if test "$enableval" = "$ol_val" ; then
1820                         ol_arg="$ol_val"
1821                 fi
1822         done
1823         if test "$ol_arg" = "invalid" ; then
1824                 { echo "configure: error: bad value $enableval for --enable-kpasswd" 1>&2; exit 1; }
1825         fi
1826         ol_enable_kpasswd="$ol_arg"
1827
1828 else
1829         ol_enable_kpasswd="no"
1830 fi
1831 # end --enable-kpasswd
1832 # OpenLDAP --enable-lmpasswd
1833         # Check whether --enable-lmpasswd or --disable-lmpasswd was given.
1834 if test "${enable_lmpasswd+set}" = set; then
1835   enableval="$enable_lmpasswd"
1836   
1837         ol_arg=invalid
1838         for ol_val in auto yes no ; do
1839                 if test "$enableval" = "$ol_val" ; then
1840                         ol_arg="$ol_val"
1841                 fi
1842         done
1843         if test "$ol_arg" = "invalid" ; then
1844                 { echo "configure: error: bad value $enableval for --enable-lmpasswd" 1>&2; exit 1; }
1845         fi
1846         ol_enable_lmpasswd="$ol_arg"
1847
1848 else
1849         ol_enable_lmpasswd="no"
1850 fi
1851 # end --enable-lmpasswd
1852 # OpenLDAP --enable-spasswd
1853         # Check whether --enable-spasswd or --disable-spasswd was given.
1854 if test "${enable_spasswd+set}" = set; then
1855   enableval="$enable_spasswd"
1856   
1857         ol_arg=invalid
1858         for ol_val in auto yes no ; do
1859                 if test "$enableval" = "$ol_val" ; then
1860                         ol_arg="$ol_val"
1861                 fi
1862         done
1863         if test "$ol_arg" = "invalid" ; then
1864                 { echo "configure: error: bad value $enableval for --enable-spasswd" 1>&2; exit 1; }
1865         fi
1866         ol_enable_spasswd="$ol_arg"
1867
1868 else
1869         ol_enable_spasswd="no"
1870 fi
1871 # end --enable-spasswd
1872 # OpenLDAP --enable-modules
1873         # Check whether --enable-modules or --disable-modules was given.
1874 if test "${enable_modules+set}" = set; then
1875   enableval="$enable_modules"
1876   
1877         ol_arg=invalid
1878         for ol_val in auto yes no ; do
1879                 if test "$enableval" = "$ol_val" ; then
1880                         ol_arg="$ol_val"
1881                 fi
1882         done
1883         if test "$ol_arg" = "invalid" ; then
1884                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1885         fi
1886         ol_enable_modules="$ol_arg"
1887
1888 else
1889         ol_enable_modules="no"
1890 fi
1891 # end --enable-modules
1892 ol_enable_multimaster=${ol_enable_multimaster-no}
1893 # OpenLDAP --enable-phonetic
1894         # Check whether --enable-phonetic or --disable-phonetic was given.
1895 if test "${enable_phonetic+set}" = set; then
1896   enableval="$enable_phonetic"
1897   
1898         ol_arg=invalid
1899         for ol_val in auto yes no ; do
1900                 if test "$enableval" = "$ol_val" ; then
1901                         ol_arg="$ol_val"
1902                 fi
1903         done
1904         if test "$ol_arg" = "invalid" ; then
1905                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1906         fi
1907         ol_enable_phonetic="$ol_arg"
1908
1909 else
1910         ol_enable_phonetic="no"
1911 fi
1912 # end --enable-phonetic
1913 # OpenLDAP --enable-rewrite
1914         # Check whether --enable-rewrite or --disable-rewrite was given.
1915 if test "${enable_rewrite+set}" = set; then
1916   enableval="$enable_rewrite"
1917   
1918         ol_arg=invalid
1919         for ol_val in auto yes no ; do
1920                 if test "$enableval" = "$ol_val" ; then
1921                         ol_arg="$ol_val"
1922                 fi
1923         done
1924         if test "$ol_arg" = "invalid" ; then
1925                 { echo "configure: error: bad value $enableval for --enable-rewrite" 1>&2; exit 1; }
1926         fi
1927         ol_enable_rewrite="$ol_arg"
1928
1929 else
1930         ol_enable_rewrite="no"
1931 fi
1932 # end --enable-rewrite
1933 # OpenLDAP --enable-rlookups
1934         # Check whether --enable-rlookups or --disable-rlookups was given.
1935 if test "${enable_rlookups+set}" = set; then
1936   enableval="$enable_rlookups"
1937   
1938         ol_arg=invalid
1939         for ol_val in auto yes no ; do
1940                 if test "$enableval" = "$ol_val" ; then
1941                         ol_arg="$ol_val"
1942                 fi
1943         done
1944         if test "$ol_arg" = "invalid" ; then
1945                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1946         fi
1947         ol_enable_rlookups="$ol_arg"
1948
1949 else
1950         ol_enable_rlookups="no"
1951 fi
1952 # end --enable-rlookups
1953 # OpenLDAP --enable-slp
1954         # Check whether --enable-slp or --disable-slp was given.
1955 if test "${enable_slp+set}" = set; then
1956   enableval="$enable_slp"
1957   
1958         ol_arg=invalid
1959         for ol_val in auto yes no ; do
1960                 if test "$enableval" = "$ol_val" ; then
1961                         ol_arg="$ol_val"
1962                 fi
1963         done
1964         if test "$ol_arg" = "invalid" ; then
1965                 { echo "configure: error: bad value $enableval for --enable-slp" 1>&2; exit 1; }
1966         fi
1967         ol_enable_slp="$ol_arg"
1968
1969 else
1970         ol_enable_slp="no"
1971 fi
1972 # end --enable-slp
1973 # OpenLDAP --enable-wrappers
1974         # Check whether --enable-wrappers or --disable-wrappers was given.
1975 if test "${enable_wrappers+set}" = set; then
1976   enableval="$enable_wrappers"
1977   
1978         ol_arg=invalid
1979         for ol_val in auto yes no ; do
1980                 if test "$enableval" = "$ol_val" ; then
1981                         ol_arg="$ol_val"
1982                 fi
1983         done
1984         if test "$ol_arg" = "invalid" ; then
1985                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1986         fi
1987         ol_enable_wrappers="$ol_arg"
1988
1989 else
1990         ol_enable_wrappers="no"
1991 fi
1992 # end --enable-wrappers
1993
1994 # OpenLDAP --enable-bdb
1995         # Check whether --enable-bdb or --disable-bdb was given.
1996 if test "${enable_bdb+set}" = set; then
1997   enableval="$enable_bdb"
1998   
1999         ol_arg=invalid
2000         for ol_val in auto yes no ; do
2001                 if test "$enableval" = "$ol_val" ; then
2002                         ol_arg="$ol_val"
2003                 fi
2004         done
2005         if test "$ol_arg" = "invalid" ; then
2006                 { echo "configure: error: bad value $enableval for --enable-bdb" 1>&2; exit 1; }
2007         fi
2008         ol_enable_bdb="$ol_arg"
2009
2010 else
2011         ol_enable_bdb="yes"
2012 fi
2013 # end --enable-bdb
2014 # OpenLDAP --with-bdb_module
2015         # Check whether --with-bdb_module or --without-bdb_module was given.
2016 if test "${with_bdb_module+set}" = set; then
2017   withval="$with_bdb_module"
2018   
2019         ol_arg=invalid
2020         for ol_val in static dynamic ; do
2021                 if test "$withval" = "$ol_val" ; then
2022                         ol_arg="$ol_val"
2023                 fi
2024         done
2025         if test "$ol_arg" = "invalid" ; then
2026                 { echo "configure: error: bad value $withval for --with-bdb_module" 1>&2; exit 1; }
2027         fi
2028         ol_with_bdb_module="$ol_arg"
2029
2030 else
2031         ol_with_bdb_module="static"
2032 fi
2033 # end --with-bdb_module
2034
2035 # OpenLDAP --enable-dnssrv
2036         # Check whether --enable-dnssrv or --disable-dnssrv was given.
2037 if test "${enable_dnssrv+set}" = set; then
2038   enableval="$enable_dnssrv"
2039   
2040         ol_arg=invalid
2041         for ol_val in auto yes no ; do
2042                 if test "$enableval" = "$ol_val" ; then
2043                         ol_arg="$ol_val"
2044                 fi
2045         done
2046         if test "$ol_arg" = "invalid" ; then
2047                 { echo "configure: error: bad value $enableval for --enable-dnssrv" 1>&2; exit 1; }
2048         fi
2049         ol_enable_dnssrv="$ol_arg"
2050
2051 else
2052         ol_enable_dnssrv="no"
2053 fi
2054 # end --enable-dnssrv
2055 # OpenLDAP --with-dnssrv_module
2056         # Check whether --with-dnssrv_module or --without-dnssrv_module was given.
2057 if test "${with_dnssrv_module+set}" = set; then
2058   withval="$with_dnssrv_module"
2059   
2060         ol_arg=invalid
2061         for ol_val in static dynamic ; do
2062                 if test "$withval" = "$ol_val" ; then
2063                         ol_arg="$ol_val"
2064                 fi
2065         done
2066         if test "$ol_arg" = "invalid" ; then
2067                 { echo "configure: error: bad value $withval for --with-dnssrv_module" 1>&2; exit 1; }
2068         fi
2069         ol_with_dnssrv_module="$ol_arg"
2070
2071 else
2072         ol_with_dnssrv_module="static"
2073 fi
2074 # end --with-dnssrv_module
2075
2076 # OpenLDAP --enable-ldap
2077         # Check whether --enable-ldap or --disable-ldap was given.
2078 if test "${enable_ldap+set}" = set; then
2079   enableval="$enable_ldap"
2080   
2081         ol_arg=invalid
2082         for ol_val in auto yes no ; do
2083                 if test "$enableval" = "$ol_val" ; then
2084                         ol_arg="$ol_val"
2085                 fi
2086         done
2087         if test "$ol_arg" = "invalid" ; then
2088                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
2089         fi
2090         ol_enable_ldap="$ol_arg"
2091
2092 else
2093         ol_enable_ldap="no"
2094 fi
2095 # end --enable-ldap
2096 # OpenLDAP --with-ldap_module
2097         # Check whether --with-ldap_module or --without-ldap_module was given.
2098 if test "${with_ldap_module+set}" = set; then
2099   withval="$with_ldap_module"
2100   
2101         ol_arg=invalid
2102         for ol_val in static dynamic ; do
2103                 if test "$withval" = "$ol_val" ; then
2104                         ol_arg="$ol_val"
2105                 fi
2106         done
2107         if test "$ol_arg" = "invalid" ; then
2108                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
2109         fi
2110         ol_with_ldap_module="$ol_arg"
2111
2112 else
2113         ol_with_ldap_module="static"
2114 fi
2115 # end --with-ldap_module
2116
2117 # OpenLDAP --enable-ldbm
2118         # Check whether --enable-ldbm or --disable-ldbm was given.
2119 if test "${enable_ldbm+set}" = set; then
2120   enableval="$enable_ldbm"
2121   
2122         ol_arg=invalid
2123         for ol_val in auto yes no ; do
2124                 if test "$enableval" = "$ol_val" ; then
2125                         ol_arg="$ol_val"
2126                 fi
2127         done
2128         if test "$ol_arg" = "invalid" ; then
2129                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
2130         fi
2131         ol_enable_ldbm="$ol_arg"
2132
2133 else
2134         ol_enable_ldbm="no"
2135 fi
2136 # end --enable-ldbm
2137 # OpenLDAP --with-ldbm_api
2138         # Check whether --with-ldbm_api or --without-ldbm_api was given.
2139 if test "${with_ldbm_api+set}" = set; then
2140   withval="$with_ldbm_api"
2141   
2142         ol_arg=invalid
2143         for ol_val in auto berkeley bcompat mdbm gdbm ; do
2144                 if test "$withval" = "$ol_val" ; then
2145                         ol_arg="$ol_val"
2146                 fi
2147         done
2148         if test "$ol_arg" = "invalid" ; then
2149                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
2150         fi
2151         ol_with_ldbm_api="$ol_arg"
2152
2153 else
2154         ol_with_ldbm_api="auto"
2155 fi
2156 # end --with-ldbm_api
2157
2158 # OpenLDAP --with-ldbm_module
2159         # Check whether --with-ldbm_module or --without-ldbm_module was given.
2160 if test "${with_ldbm_module+set}" = set; then
2161   withval="$with_ldbm_module"
2162   
2163         ol_arg=invalid
2164         for ol_val in static dynamic ; do
2165                 if test "$withval" = "$ol_val" ; then
2166                         ol_arg="$ol_val"
2167                 fi
2168         done
2169         if test "$ol_arg" = "invalid" ; then
2170                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
2171         fi
2172         ol_with_ldbm_module="$ol_arg"
2173
2174 else
2175         ol_with_ldbm_module="static"
2176 fi
2177 # end --with-ldbm_module
2178
2179 # OpenLDAP --with-ldbm_type
2180         # Check whether --with-ldbm_type or --without-ldbm_type was given.
2181 if test "${with_ldbm_type+set}" = set; then
2182   withval="$with_ldbm_type"
2183   
2184         ol_arg=invalid
2185         for ol_val in auto btree hash ; do
2186                 if test "$withval" = "$ol_val" ; then
2187                         ol_arg="$ol_val"
2188                 fi
2189         done
2190         if test "$ol_arg" = "invalid" ; then
2191                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
2192         fi
2193         ol_with_ldbm_type="$ol_arg"
2194
2195 else
2196         ol_with_ldbm_type="auto"
2197 fi
2198 # end --with-ldbm_type
2199
2200 # OpenLDAP --enable-meta
2201         # Check whether --enable-meta or --disable-meta was given.
2202 if test "${enable_meta+set}" = set; then
2203   enableval="$enable_meta"
2204   
2205         ol_arg=invalid
2206         for ol_val in auto yes no ; do
2207                 if test "$enableval" = "$ol_val" ; then
2208                         ol_arg="$ol_val"
2209                 fi
2210         done
2211         if test "$ol_arg" = "invalid" ; then
2212                 { echo "configure: error: bad value $enableval for --enable-meta" 1>&2; exit 1; }
2213         fi
2214         ol_enable_meta="$ol_arg"
2215
2216 else
2217         ol_enable_meta="no"
2218 fi
2219 # end --enable-meta
2220 # OpenLDAP --with-meta_module
2221         # Check whether --with-meta_module or --without-meta_module was given.
2222 if test "${with_meta_module+set}" = set; then
2223   withval="$with_meta_module"
2224   
2225         ol_arg=invalid
2226         for ol_val in static dynamic ; do
2227                 if test "$withval" = "$ol_val" ; then
2228                         ol_arg="$ol_val"
2229                 fi
2230         done
2231         if test "$ol_arg" = "invalid" ; then
2232                 { echo "configure: error: bad value $withval for --with-meta_module" 1>&2; exit 1; }
2233         fi
2234         ol_with_meta_module="$ol_arg"
2235
2236 else
2237         ol_with_meta_module="static"
2238 fi
2239 # end --with-meta_module
2240
2241 # OpenLDAP --enable-monitor
2242         # Check whether --enable-monitor or --disable-monitor was given.
2243 if test "${enable_monitor+set}" = set; then
2244   enableval="$enable_monitor"
2245   
2246         ol_arg=invalid
2247         for ol_val in auto yes no ; do
2248                 if test "$enableval" = "$ol_val" ; then
2249                         ol_arg="$ol_val"
2250                 fi
2251         done
2252         if test "$ol_arg" = "invalid" ; then
2253                 { echo "configure: error: bad value $enableval for --enable-monitor" 1>&2; exit 1; }
2254         fi
2255         ol_enable_monitor="$ol_arg"
2256
2257 else
2258         ol_enable_monitor="no"
2259 fi
2260 # end --enable-monitor
2261 # OpenLDAP --with-monitor_module
2262         # Check whether --with-monitor_module or --without-monitor_module was given.
2263 if test "${with_monitor_module+set}" = set; then
2264   withval="$with_monitor_module"
2265   
2266         ol_arg=invalid
2267         for ol_val in static dynamic ; do
2268                 if test "$withval" = "$ol_val" ; then
2269                         ol_arg="$ol_val"
2270                 fi
2271         done
2272         if test "$ol_arg" = "invalid" ; then
2273                 { echo "configure: error: bad value $withval for --with-monitor_module" 1>&2; exit 1; }
2274         fi
2275         ol_with_monitor_module="$ol_arg"
2276
2277 else
2278         ol_with_monitor_module="static"
2279 fi
2280 # end --with-monitor_module
2281
2282 # OpenLDAP --enable-null
2283         # Check whether --enable-null or --disable-null was given.
2284 if test "${enable_null+set}" = set; then
2285   enableval="$enable_null"
2286   
2287         ol_arg=invalid
2288         for ol_val in auto yes no ; do
2289                 if test "$enableval" = "$ol_val" ; then
2290                         ol_arg="$ol_val"
2291                 fi
2292         done
2293         if test "$ol_arg" = "invalid" ; then
2294                 { echo "configure: error: bad value $enableval for --enable-null" 1>&2; exit 1; }
2295         fi
2296         ol_enable_null="$ol_arg"
2297
2298 else
2299         ol_enable_null="no"
2300 fi
2301 # end --enable-null
2302 # OpenLDAP --with-null_module
2303         # Check whether --with-null_module or --without-null_module was given.
2304 if test "${with_null_module+set}" = set; then
2305   withval="$with_null_module"
2306   
2307         ol_arg=invalid
2308         for ol_val in static dynamic ; do
2309                 if test "$withval" = "$ol_val" ; then
2310                         ol_arg="$ol_val"
2311                 fi
2312         done
2313         if test "$ol_arg" = "invalid" ; then
2314                 { echo "configure: error: bad value $withval for --with-null_module" 1>&2; exit 1; }
2315         fi
2316         ol_with_null_module="$ol_arg"
2317
2318 else
2319         ol_with_null_module="static"
2320 fi
2321 # end --with-null_module
2322
2323 # OpenLDAP --enable-passwd
2324         # Check whether --enable-passwd or --disable-passwd was given.
2325 if test "${enable_passwd+set}" = set; then
2326   enableval="$enable_passwd"
2327   
2328         ol_arg=invalid
2329         for ol_val in auto yes no ; do
2330                 if test "$enableval" = "$ol_val" ; then
2331                         ol_arg="$ol_val"
2332                 fi
2333         done
2334         if test "$ol_arg" = "invalid" ; then
2335                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
2336         fi
2337         ol_enable_passwd="$ol_arg"
2338
2339 else
2340         ol_enable_passwd="no"
2341 fi
2342 # end --enable-passwd
2343 # OpenLDAP --with-passwd_module
2344         # Check whether --with-passwd_module or --without-passwd_module was given.
2345 if test "${with_passwd_module+set}" = set; then
2346   withval="$with_passwd_module"
2347   
2348         ol_arg=invalid
2349         for ol_val in static dynamic ; do
2350                 if test "$withval" = "$ol_val" ; then
2351                         ol_arg="$ol_val"
2352                 fi
2353         done
2354         if test "$ol_arg" = "invalid" ; then
2355                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
2356         fi
2357         ol_with_passwd_module="$ol_arg"
2358
2359 else
2360         ol_with_passwd_module="static"
2361 fi
2362 # end --with-passwd_module
2363
2364 # OpenLDAP --enable-perl
2365         # Check whether --enable-perl or --disable-perl was given.
2366 if test "${enable_perl+set}" = set; then
2367   enableval="$enable_perl"
2368   
2369         ol_arg=invalid
2370         for ol_val in auto yes no ; do
2371                 if test "$enableval" = "$ol_val" ; then
2372                         ol_arg="$ol_val"
2373                 fi
2374         done
2375         if test "$ol_arg" = "invalid" ; then
2376                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
2377         fi
2378         ol_enable_perl="$ol_arg"
2379
2380 else
2381         ol_enable_perl="no"
2382 fi
2383 # end --enable-perl
2384 # OpenLDAP --with-perl_module
2385         # Check whether --with-perl_module or --without-perl_module was given.
2386 if test "${with_perl_module+set}" = set; then
2387   withval="$with_perl_module"
2388   
2389         ol_arg=invalid
2390         for ol_val in static dynamic ; do
2391                 if test "$withval" = "$ol_val" ; then
2392                         ol_arg="$ol_val"
2393                 fi
2394         done
2395         if test "$ol_arg" = "invalid" ; then
2396                 { echo "configure: error: bad value $withval for --with-perl_module" 1>&2; exit 1; }
2397         fi
2398         ol_with_perl_module="$ol_arg"
2399
2400 else
2401         ol_with_perl_module="static"
2402 fi
2403 # end --with-perl_module
2404
2405 # OpenLDAP --enable-shell
2406         # Check whether --enable-shell or --disable-shell was given.
2407 if test "${enable_shell+set}" = set; then
2408   enableval="$enable_shell"
2409   
2410         ol_arg=invalid
2411         for ol_val in auto yes no ; do
2412                 if test "$enableval" = "$ol_val" ; then
2413                         ol_arg="$ol_val"
2414                 fi
2415         done
2416         if test "$ol_arg" = "invalid" ; then
2417                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
2418         fi
2419         ol_enable_shell="$ol_arg"
2420
2421 else
2422         ol_enable_shell="no"
2423 fi
2424 # end --enable-shell
2425 # OpenLDAP --with-shell_module
2426         # Check whether --with-shell_module or --without-shell_module was given.
2427 if test "${with_shell_module+set}" = set; then
2428   withval="$with_shell_module"
2429   
2430         ol_arg=invalid
2431         for ol_val in static dynamic ; do
2432                 if test "$withval" = "$ol_val" ; then
2433                         ol_arg="$ol_val"
2434                 fi
2435         done
2436         if test "$ol_arg" = "invalid" ; then
2437                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
2438         fi
2439         ol_with_shell_module="$ol_arg"
2440
2441 else
2442         ol_with_shell_module="static"
2443 fi
2444 # end --with-shell_module
2445
2446 # OpenLDAP --enable-sql
2447         # Check whether --enable-sql or --disable-sql was given.
2448 if test "${enable_sql+set}" = set; then
2449   enableval="$enable_sql"
2450   
2451         ol_arg=invalid
2452         for ol_val in auto yes no ; do
2453                 if test "$enableval" = "$ol_val" ; then
2454                         ol_arg="$ol_val"
2455                 fi
2456         done
2457         if test "$ol_arg" = "invalid" ; then
2458                 { echo "configure: error: bad value $enableval for --enable-sql" 1>&2; exit 1; }
2459         fi
2460         ol_enable_sql="$ol_arg"
2461
2462 else
2463         ol_enable_sql="no"
2464 fi
2465 # end --enable-sql
2466 # OpenLDAP --with-sql_module
2467         # Check whether --with-sql_module or --without-sql_module was given.
2468 if test "${with_sql_module+set}" = set; then
2469   withval="$with_sql_module"
2470   
2471         ol_arg=invalid
2472         for ol_val in static dynamic ; do
2473                 if test "$withval" = "$ol_val" ; then
2474                         ol_arg="$ol_val"
2475                 fi
2476         done
2477         if test "$ol_arg" = "invalid" ; then
2478                 { echo "configure: error: bad value $withval for --with-sql_module" 1>&2; exit 1; }
2479         fi
2480         ol_with_sql_module="$ol_arg"
2481
2482 else
2483         ol_with_sql_module="static"
2484 fi
2485 # end --with-sql_module
2486
2487 # OpenLDAP --enable-tcl
2488         # Check whether --enable-tcl or --disable-tcl was given.
2489 if test "${enable_tcl+set}" = set; then
2490   enableval="$enable_tcl"
2491   
2492         ol_arg=invalid
2493         for ol_val in auto yes no ; do
2494                 if test "$enableval" = "$ol_val" ; then
2495                         ol_arg="$ol_val"
2496                 fi
2497         done
2498         if test "$ol_arg" = "invalid" ; then
2499                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
2500         fi
2501         ol_enable_tcl="$ol_arg"
2502
2503 else
2504         ol_enable_tcl="no"
2505 fi
2506 # end --enable-tcl
2507 # OpenLDAP --with-tcl_module
2508         # Check whether --with-tcl_module or --without-tcl_module was given.
2509 if test "${with_tcl_module+set}" = set; then
2510   withval="$with_tcl_module"
2511   
2512         ol_arg=invalid
2513         for ol_val in static dynamic ; do
2514                 if test "$withval" = "$ol_val" ; then
2515                         ol_arg="$ol_val"
2516                 fi
2517         done
2518         if test "$ol_arg" = "invalid" ; then
2519                 { echo "configure: error: bad value $withval for --with-tcl_module" 1>&2; exit 1; }
2520         fi
2521         ol_with_tcl_module="$ol_arg"
2522
2523 else
2524         ol_with_tcl_module="static"
2525 fi
2526 # end --with-tcl_module
2527
2528
2529 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2530 if test "${with_xxslurpdoptions+set}" = set; then
2531   withval="$with_xxslurpdoptions"
2532   :
2533 fi
2534
2535 # OpenLDAP --enable-slurpd
2536         # Check whether --enable-slurpd or --disable-slurpd was given.
2537 if test "${enable_slurpd+set}" = set; then
2538   enableval="$enable_slurpd"
2539   
2540         ol_arg=invalid
2541         for ol_val in auto yes no ; do
2542                 if test "$enableval" = "$ol_val" ; then
2543                         ol_arg="$ol_val"
2544                 fi
2545         done
2546         if test "$ol_arg" = "invalid" ; then
2547                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2548         fi
2549         ol_enable_slurpd="$ol_arg"
2550
2551 else
2552         ol_enable_slurpd="auto"
2553 fi
2554 # end --enable-slurpd
2555
2556 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2557 if test "${with_xxliboptions+set}" = set; then
2558   withval="$with_xxliboptions"
2559   :
2560 fi
2561
2562 # Check whether --enable-static or --disable-static was given.
2563 if test "${enable_static+set}" = set; then
2564   enableval="$enable_static"
2565   p=${PACKAGE-default}
2566 case $enableval in
2567 yes) enable_static=yes ;;
2568 no) enable_static=no ;;
2569 *)
2570   enable_static=no
2571   # Look at the argument we got.  We use all the common list separators.
2572   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2573   for pkg in $enableval; do
2574     if test "X$pkg" = "X$p"; then
2575       enable_static=yes
2576     fi
2577   done
2578   IFS="$ac_save_ifs"
2579   ;;
2580 esac
2581 else
2582   enable_static=yes
2583 fi
2584
2585 # Check whether --enable-shared or --disable-shared was given.
2586 if test "${enable_shared+set}" = set; then
2587   enableval="$enable_shared"
2588   p=${PACKAGE-default}
2589 case $enableval in
2590 yes) enable_shared=yes ;;
2591 no) enable_shared=no ;;
2592 *)
2593   enable_shared=no
2594   # Look at the argument we got.  We use all the common list separators.
2595   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2596   for pkg in $enableval; do
2597     if test "X$pkg" = "X$p"; then
2598       enable_shared=yes
2599     fi
2600   done
2601   IFS="$ac_save_ifs"
2602   ;;
2603 esac
2604 else
2605   enable_shared=yes
2606 fi
2607
2608
2609
2610 # validate options
2611 if test $ol_enable_slapd = no ; then
2612                 if test $ol_enable_bdb = yes ; then
2613                 echo "configure: warning: slapd disabled, ignoring --enable-bdb argument" 1>&2
2614         fi
2615         if test $ol_enable_dnssrv = yes ; then
2616                 echo "configure: warning: slapd disabled, ignoring --enable-dnssrv argument" 1>&2
2617         fi
2618         if test $ol_enable_ldap = yes ; then
2619                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2620         fi
2621         if test $ol_enable_ldbm = yes ; then
2622                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2623         fi
2624         if test $ol_enable_meta = yes ; then
2625                 echo "configure: warning: slapd disabled, ignoring --enable-meta argument" 1>&2
2626         fi
2627         if test $ol_enable_monitor = yes ; then
2628                 echo "configure: warning: slapd disabled, ignoring --enable-monitor argument" 1>&2
2629         fi
2630         if test $ol_enable_null = yes ; then
2631                 echo "configure: warning: slapd disabled, ignoring --enable-null argument" 1>&2
2632         fi
2633         if test $ol_enable_passwd = yes ; then
2634                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2635         fi
2636         if test $ol_enable_perl = yes ; then
2637                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
2638         fi
2639         if test $ol_enable_shell = yes ; then
2640                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2641         fi
2642         if test $ol_enable_tcl = yes ; then
2643                 echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
2644         fi
2645         if test $ol_enable_sql = yes ; then
2646                 echo "configure: warning: slapd disabled, ignoring --enable-sql argument" 1>&2
2647         fi
2648         if test $ol_enable_modules = yes ; then
2649                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2650         fi
2651         if test $ol_enable_multimaster = yes ; then
2652                 echo "configure: warning: slapd disabled, ignoring --enable-multimaster argument" 1>&2
2653         fi
2654         if test $ol_enable_wrappers = yes ; then
2655                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2656         fi
2657         if test $ol_enable_phonetic = yes ; then
2658                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2659         fi
2660         if test $ol_enable_rlookups = yes ; then
2661                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2662         fi
2663         if test $ol_enable_aci = yes ; then
2664                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2665         fi
2666         if test $ol_with_ldbm_api != auto ; then
2667                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2668         fi
2669         if test $ol_with_ldbm_type != auto ; then
2670                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2671         fi
2672         if test $ol_with_bdb_module != static ; then
2673                 echo "configure: warning: slapd disabled, ignoring --with-bdb-module argument" 1>&2
2674         fi
2675         if test $ol_with_dnssrv_module != static ; then
2676                 echo "configure: warning: slapd disabled, ignoring --with-dnssrv-module argument" 1>&2
2677         fi
2678         if test $ol_with_ldap_module != static ; then
2679                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2680         fi
2681         if test $ol_with_ldbm_module != static ; then
2682                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2683         fi
2684         if test $ol_with_meta_module != static ; then
2685                 echo "configure: warning: slapd disabled, ignoring --with-meta-module argument" 1>&2
2686         fi
2687         if test $ol_with_monitor_module != static ; then
2688                 echo "configure: warning: slapd disabled, ignoring --with-monitor-module argument" 1>&2
2689         fi
2690         if test $ol_with_null_module != static ; then
2691                 echo "configure: warning: slapd disabled, ignoring --with-null-module argument" 1>&2
2692         fi
2693         if test $ol_with_passwd_module != static ; then
2694                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2695         fi
2696         if test $ol_with_perl_module != static ; then
2697                 echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2
2698         fi
2699         if test $ol_with_shell_module != static ; then
2700                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2701         fi
2702         if test $ol_with_tcl_module != static ; then
2703                 echo "configure: warning: slapd disabled, ignoring --with-tcl-module argument" 1>&2
2704         fi
2705         if test $ol_with_sql_module != static ; then
2706                 echo "configure: warning: slapd disabled, ignoring --with-sql-module argument" 1>&2
2707         fi
2708         if test $ol_enable_slurpd = yes ; then
2709                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2710         fi
2711         if test $ol_enable_rewrite = yes ; then
2712                 echo "configure: warning: slapd disabled, ignoring --enable-rewrite argument" 1>&2
2713         fi
2714
2715         # force settings to no
2716         ol_enable_bdb=no
2717         ol_enable_dnssrv=no
2718         ol_enable_ldap=no
2719         ol_enable_ldbm=no
2720         ol_enable_meta=no
2721         ol_enable_monitor=no
2722         ol_enable_null=no
2723         ol_enable_passwd=no
2724         ol_enable_perl=no
2725         ol_enable_shell=no
2726         ol_enable_tcl=no
2727         ol_enable_sql=no
2728
2729         ol_enable_modules=no
2730         ol_enable_multimaster=no
2731         ol_enable_phonetic=no
2732         ol_enable_rlookups=no
2733         ol_enable_aci=no
2734         ol_enable_wrappers=no
2735         ol_enable_dynamic=no
2736
2737         ol_with_ldbm_api=no
2738         ol_with_ldbm_type=no
2739
2740         ol_with_bdb_module=static
2741         ol_with_dnssrv_module=static
2742         ol_with_ldap_module=static
2743         ol_with_ldbm_module=static
2744         ol_with_meta_module=static
2745         ol_with_monitor_module=static
2746         ol_with_null_module=static
2747         ol_with_passwd_module=static
2748         ol_with_perl_module=static
2749         ol_with_shell_module=static
2750         ol_with_tcl_module=static
2751         ol_with_sql_module=static
2752
2753         ol_enable_slurpd=no
2754
2755         ol_enable_rewrite=no
2756
2757 elif test $ol_enable_ldbm = no ; then
2758         
2759         if test $ol_with_ldbm_api != auto ; then
2760                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2761         fi
2762
2763         if test $ol_with_ldbm_type != auto ; then
2764                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2765         fi
2766
2767         if test $ol_with_ldbm_module != static ; then
2768                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2769         fi
2770
2771         if test $ol_enable_modules != yes -a \
2772                 $ol_enable_bdb = no -a \
2773                 $ol_enable_dnssrv = no -a \
2774                 $ol_enable_ldap = no -a \
2775                 $ol_enable_meta = no -a \
2776                 $ol_enable_monitor = no -a \
2777                 $ol_enable_null = no -a \
2778                 $ol_enable_passwd = no -a \
2779                 $ol_enable_perl = no -a \
2780                 $ol_enable_shell = no -a \
2781                 $ol_enable_sql = no -a \
2782                 $ol_enable_tcl = no ; then
2783
2784                 if test $ol_enable_slapd = yes ; then
2785                         { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2786                 else
2787                         echo "configure: warning: skipping slapd, no backend specified" 1>&2
2788                         ol_enable_slapd=no
2789                 fi
2790         fi
2791
2792         ol_with_ldbm_api=no
2793         ol_with_ldbm_type=no
2794         ol_with_ldbm_module=static
2795
2796         if test $ol_enable_bdb != no ; then
2797                 ol_with_ldbm_api=berkeley
2798         fi
2799
2800 else
2801                 if test $ol_with_ldbm_api = gdbm -a \
2802                 $ol_with_ldbm_type = btree ; then
2803                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2804         fi
2805         if test $ol_with_ldbm_api = mdbm -a \
2806                 $ol_with_ldbm_type = btree ; then
2807                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2808         fi
2809         if test $ol_with_ldbm_api = ndbm -a \
2810                 $ol_with_ldbm_type = btree ; then
2811                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2812         fi
2813
2814         if test $ol_enable_bdb = yes ; then
2815                 if test $ol_with_ldbm_api = auto ; then
2816                         ol_with_ldbm_api=berkeley
2817                 elif test $ol_with_ldbm_api != berkeley ; then
2818                         { echo "configure: error: LDBM API not compatible with BDB" 1>&2; exit 1; }
2819                 fi
2820
2821         elif test $ol_enable_bdb = auto ; then
2822                 if test $ol_with_ldbm_api != berkeley \
2823                         -o $ol_with_ldbm_api != auto ; then
2824                         echo "configure: warning: LDBM API not compatible with BDB, disabling BDB" 1>&2
2825                         ol_enable_bdb=no
2826                 fi
2827         fi
2828 fi
2829
2830 if test $ol_enable_slurpd = yes ; then
2831                 if test $ol_with_threads = no ; then
2832                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2833         fi
2834 fi
2835
2836 if test $ol_enable_lmpasswd = yes ; then
2837         if test $ol_with_tls = no ; then
2838                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
2839         fi
2840 fi
2841
2842 if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
2843         if test $ol_with_kerberos = no ; then
2844                 { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
2845         elif test $ol_with_kerberos = auto ; then
2846                 ol_with_kerberos=yes
2847         fi
2848
2849 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
2850         if test $ol_with_kerberos = auto ; then
2851                 ol_with_kerberos=no
2852         elif test $ol_with_kerberos != no ; then
2853                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2854                 ol_with_kerberos=no
2855         fi
2856 fi
2857
2858 if test $ol_enable_spasswd = yes ; then
2859         if test $ol_with_cyrus_sasl = no ; then
2860                 { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
2861         fi
2862         ol_with_cyrus_sasl=yes
2863 fi
2864
2865 echo "$ac_t""done" 1>&6
2866
2867 LDAP_LIBS=
2868 LDIF_LIBS=
2869 LDBM_LIB=
2870 LDBM_LIBS=
2871 LTHREAD_LIBS=
2872 LUTIL_LIBS=
2873
2874 SLAPD_LIBS=
2875 SLURPD_LIBS=
2876
2877 BUILD_SLAPD=no
2878 BUILD_SLURPD=no
2879
2880 BUILD_THREAD=no
2881
2882 BUILD_BDB=no
2883 BUILD_DNSSRV=no
2884 BUILD_LDAP=no
2885 BUILD_LDBM=no
2886 BUILD_META=no
2887 BUILD_MONITOR=no
2888 BUILD_NULL=no
2889 BUILD_PASSWD=no
2890 BUILD_PERL=no
2891 BUILD_SHELL=no
2892 BUILD_SQL=no
2893 BUILD_TCL=no
2894
2895 BUILD_BDB_DYNAMIC=static
2896 BUILD_DNSSRV_DYNAMIC=static
2897 BUILD_LDAP_DYNAMIC=static
2898 BUILD_LDBM_DYNAMIC=static
2899 BUILD_META_DYNAMIC=static
2900 BUILD_MONITOR_DYNAMIC=static
2901 BUILD_NULL_DYNAMIC=static
2902 BUILD_PASSWD_DYNAMIC=static
2903 BUILD_PERL_DYNAMIC=static
2904 BUILD_SHELL_DYNAMIC=static
2905 BUILD_TCL_DYNAMIC=static
2906 BUILD_SQL_DYNAMIC=static
2907
2908 SLAPD_MODULES_LDFLAGS=
2909 SLAPD_MODULES_CPPFLAGS=
2910
2911 SLAPD_STATIC_BACKENDS=
2912 SLAPD_DYNAMIC_BACKENDS=
2913
2914 SLAPD_PERL_LDFLAGS=
2915 MOD_PERL_LDFLAGS=
2916 PERL_CPPFLAGS=
2917
2918 SLAPD_SQL_LDFLAGS=
2919 SLAPD_SQL_LIBS=
2920 SLAPD_SQL_INCLUDES=
2921
2922 MOD_TCL_LIB=
2923 KRB4_LIBS=
2924 KRB5_LIBS=
2925 READLINE_LIBS=
2926 SASL_LIBS=
2927 TERMCAP_LIBS=
2928 TLS_LIBS=
2929 MODULES_LIBS=
2930 AUTH_LIBS=
2931
2932 SLAPD_SLP_LIBS=
2933
2934
2935 # Find a good install program.  We prefer a C program (faster),
2936 # so one script is as good as another.  But avoid the broken or
2937 # incompatible versions:
2938 # SysV /etc/install, /usr/sbin/install
2939 # SunOS /usr/etc/install
2940 # IRIX /sbin/install
2941 # AIX /bin/install
2942 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2943 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2944 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2945 # ./install, which can be erroneously created by make from ./install.sh.
2946 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
2947 echo "configure:2948: checking for a BSD compatible install" >&5
2948 if test -z "$INSTALL"; then
2949 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
2950   echo $ac_n "(cached) $ac_c" 1>&6
2951 else
2952     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
2953   for ac_dir in $PATH; do
2954     # Account for people who put trailing slashes in PATH elements.
2955     case "$ac_dir/" in
2956     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
2957     *)
2958       # OSF1 and SCO ODT 3.0 have their own names for install.
2959       # Don't use installbsd from OSF since it installs stuff as root
2960       # by default.
2961       for ac_prog in ginstall scoinst install; do
2962         if test -f $ac_dir/$ac_prog; then
2963           if test $ac_prog = install &&
2964             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
2965             # AIX install.  It has an incompatible calling convention.
2966             :
2967           elif test $ac_prog = install &&
2968             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
2969             # program-specific install script used by HP pwplus--don't use.
2970             :
2971           else
2972             ac_cv_path_install="$ac_dir/$ac_prog -c"
2973             break 2
2974           fi
2975         fi
2976       done
2977       ;;
2978     esac
2979   done
2980   IFS="$ac_save_IFS"
2981
2982 fi
2983   if test "${ac_cv_path_install+set}" = set; then
2984     INSTALL="$ac_cv_path_install"
2985   else
2986     # As a last resort, use the slow shell script.  We don't cache a
2987     # path for INSTALL within a source directory, because that will
2988     # break other packages using the cache if that directory is
2989     # removed, or if the path is relative.
2990     INSTALL="$ac_install_sh"
2991   fi
2992 fi
2993 echo "$ac_t""$INSTALL" 1>&6
2994
2995 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2996 # It thinks the first close brace ends the variable substitution.
2997 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2998
2999 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
3000
3001 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
3002
3003
3004 cat >> confdefs.h <<\EOF
3005 #define HAVE_MKVERSION 1
3006 EOF
3007
3008
3009
3010
3011 ol_aix_threads=no
3012 case "$target" in
3013 *-*-aix*)       if test -z "$CC" ; then
3014                 case "$ol_with_threads" in
3015                 auto | yes |  posix) ol_aix_threads=yes ;;
3016                 esac
3017         fi
3018 ;;
3019 esac
3020
3021 if test $ol_aix_threads = yes ; then
3022         if test -z "${CC}" ; then
3023                 for ac_prog in cc_r xlc_r cc
3024 do
3025 # Extract the first word of "$ac_prog", so it can be a program name with args.
3026 set dummy $ac_prog; ac_word=$2
3027 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3028 echo "configure:3029: checking for $ac_word" >&5
3029 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3030   echo $ac_n "(cached) $ac_c" 1>&6
3031 else
3032   if test -n "$CC"; then
3033   ac_cv_prog_CC="$CC" # Let the user override the test.
3034 else
3035   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3036   ac_dummy="$PATH"
3037   for ac_dir in $ac_dummy; do
3038     test -z "$ac_dir" && ac_dir=.
3039     if test -f $ac_dir/$ac_word; then
3040       ac_cv_prog_CC="$ac_prog"
3041       break
3042     fi
3043   done
3044   IFS="$ac_save_ifs"
3045 fi
3046 fi
3047 CC="$ac_cv_prog_CC"
3048 if test -n "$CC"; then
3049   echo "$ac_t""$CC" 1>&6
3050 else
3051   echo "$ac_t""no" 1>&6
3052 fi
3053
3054 test -n "$CC" && break
3055 done
3056
3057
3058                 if test "$CC" = cc ; then
3059                                                 if test $ol_with_threads != auto ; then
3060                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
3061                         else
3062                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
3063                         fi
3064                         ol_with_threads=no
3065                 fi
3066         fi
3067
3068         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
3069                 ol_with_threads=posix
3070                 ol_cv_pthread_create=yes
3071         fi
3072 fi
3073
3074 if test -z "${CC}"; then
3075         for ac_prog in cc
3076 do
3077 # Extract the first word of "$ac_prog", so it can be a program name with args.
3078 set dummy $ac_prog; ac_word=$2
3079 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3080 echo "configure:3081: checking for $ac_word" >&5
3081 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3082   echo $ac_n "(cached) $ac_c" 1>&6
3083 else
3084   if test -n "$CC"; then
3085   ac_cv_prog_CC="$CC" # Let the user override the test.
3086 else
3087   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3088   ac_dummy="$PATH"
3089   for ac_dir in $ac_dummy; do
3090     test -z "$ac_dir" && ac_dir=.
3091     if test -f $ac_dir/$ac_word; then
3092       ac_cv_prog_CC="$ac_prog"
3093       break
3094     fi
3095   done
3096   IFS="$ac_save_ifs"
3097 fi
3098 fi
3099 CC="$ac_cv_prog_CC"
3100 if test -n "$CC"; then
3101   echo "$ac_t""$CC" 1>&6
3102 else
3103   echo "$ac_t""no" 1>&6
3104 fi
3105
3106 test -n "$CC" && break
3107 done
3108 test -n "$CC" || CC="missing"
3109
3110
3111         if test "${CC}" = "missing" ; then
3112                 { echo "configure: error: Unable to locate cc(1).  Check PATH or set CC." 1>&2; exit 1; }
3113         fi
3114 fi
3115
3116
3117 if test -z "${AR}"; then
3118         for ac_prog in ar gar
3119 do
3120 # Extract the first word of "$ac_prog", so it can be a program name with args.
3121 set dummy $ac_prog; ac_word=$2
3122 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3123 echo "configure:3124: checking for $ac_word" >&5
3124 if eval "test \"\${ac_cv_prog_AR+set}\" = set"; then
3125   echo $ac_n "(cached) $ac_c" 1>&6
3126 else
3127   if test -n "$AR"; then
3128   ac_cv_prog_AR="$AR" # Let the user override the test.
3129 else
3130   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3131   ac_dummy="$PATH"
3132   for ac_dir in $ac_dummy; do
3133     test -z "$ac_dir" && ac_dir=.
3134     if test -f $ac_dir/$ac_word; then
3135       ac_cv_prog_AR="$ac_prog"
3136       break
3137     fi
3138   done
3139   IFS="$ac_save_ifs"
3140 fi
3141 fi
3142 AR="$ac_cv_prog_AR"
3143 if test -n "$AR"; then
3144   echo "$ac_t""$AR" 1>&6
3145 else
3146   echo "$ac_t""no" 1>&6
3147 fi
3148
3149 test -n "$AR" && break
3150 done
3151 test -n "$AR" || AR="missing"
3152
3153
3154         if test "${AR}" = "missing" ; then
3155                 { echo "configure: error: Unable to locate ar(1).  Check PATH or set AR." 1>&2; exit 1; }
3156         fi
3157 fi
3158
3159
3160
3161 # Find the correct PATH separator.  Usually this is `:', but
3162 # DJGPP uses `;' like DOS.
3163 if test "X${PATH_SEPARATOR+set}" != Xset; then
3164   UNAME=${UNAME-`uname 2>/dev/null`}
3165   case X$UNAME in
3166     *-DOS) lt_cv_sys_path_separator=';' ;;
3167     *)     lt_cv_sys_path_separator=':' ;;
3168   esac
3169   PATH_SEPARATOR=$lt_cv_sys_path_separator
3170 fi
3171
3172 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3173 echo "configure:3174: checking for Cygwin environment" >&5
3174 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
3175   echo $ac_n "(cached) $ac_c" 1>&6
3176 else
3177   cat > conftest.$ac_ext <<EOF
3178 #line 3179 "configure"
3179 #include "confdefs.h"
3180
3181 int main() {
3182
3183 #ifndef __CYGWIN__
3184 #define __CYGWIN__ __CYGWIN32__
3185 #endif
3186 return __CYGWIN__;
3187 ; return 0; }
3188 EOF
3189 if { (eval echo configure:3190: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3190   rm -rf conftest*
3191   ac_cv_cygwin=yes
3192 else
3193   echo "configure: failed program was:" >&5
3194   cat conftest.$ac_ext >&5
3195   rm -rf conftest*
3196   ac_cv_cygwin=no
3197 fi
3198 rm -f conftest*
3199 fi
3200
3201 echo "$ac_t""$ac_cv_cygwin" 1>&6
3202 CYGWIN=
3203 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3204 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3205 echo "configure:3206: checking for mingw32 environment" >&5
3206 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
3207   echo $ac_n "(cached) $ac_c" 1>&6
3208 else
3209   cat > conftest.$ac_ext <<EOF
3210 #line 3211 "configure"
3211 #include "confdefs.h"
3212
3213 int main() {
3214 return __MINGW32__;
3215 ; return 0; }
3216 EOF
3217 if { (eval echo configure:3218: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3218   rm -rf conftest*
3219   ac_cv_mingw32=yes
3220 else
3221   echo "configure: failed program was:" >&5
3222   cat conftest.$ac_ext >&5
3223   rm -rf conftest*
3224   ac_cv_mingw32=no
3225 fi
3226 rm -f conftest*
3227 fi
3228
3229 echo "$ac_t""$ac_cv_mingw32" 1>&6
3230 MINGW32=
3231 test "$ac_cv_mingw32" = yes && MINGW32=yes
3232 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
3233 echo "configure:3234: checking for EMX OS/2 environment" >&5
3234 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
3235   echo $ac_n "(cached) $ac_c" 1>&6
3236 else
3237   cat > conftest.$ac_ext <<EOF
3238 #line 3239 "configure"
3239 #include "confdefs.h"
3240
3241 int main() {
3242 return __EMX__;
3243 ; return 0; }
3244 EOF
3245 if { (eval echo configure:3246: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3246   rm -rf conftest*
3247   ac_cv_emxos2=yes
3248 else
3249   echo "configure: failed program was:" >&5
3250   cat conftest.$ac_ext >&5
3251   rm -rf conftest*
3252   ac_cv_emxos2=no
3253 fi
3254 rm -f conftest*
3255 fi
3256
3257 echo "$ac_t""$ac_cv_emxos2" 1>&6
3258 EMXOS2=
3259 test "$ac_cv_emxos2" = yes && EMXOS2=yes
3260 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3261 echo "configure:3262: checking how to run the C preprocessor" >&5
3262 # On Suns, sometimes $CPP names a directory.
3263 if test -n "$CPP" && test -d "$CPP"; then
3264   CPP=
3265 fi
3266 if test -z "$CPP"; then
3267 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3268   echo $ac_n "(cached) $ac_c" 1>&6
3269 else
3270     # This must be in double quotes, not single quotes, because CPP may get
3271   # substituted into the Makefile and "${CC-cc}" will confuse make.
3272   CPP="${CC-cc} -E"
3273   # On the NeXT, cc -E runs the code through the compiler's parser,
3274   # not just through cpp.
3275   cat > conftest.$ac_ext <<EOF
3276 #line 3277 "configure"
3277 #include "confdefs.h"
3278 #include <assert.h>
3279 Syntax Error
3280 EOF
3281 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3282 { (eval echo configure:3283: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3283 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3284 if test -z "$ac_err"; then
3285   :
3286 else
3287   echo "$ac_err" >&5
3288   echo "configure: failed program was:" >&5
3289   cat conftest.$ac_ext >&5
3290   rm -rf conftest*
3291   CPP="${CC-cc} -E -traditional-cpp"
3292   cat > conftest.$ac_ext <<EOF
3293 #line 3294 "configure"
3294 #include "confdefs.h"
3295 #include <assert.h>
3296 Syntax Error
3297 EOF
3298 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3299 { (eval echo configure:3300: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3300 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3301 if test -z "$ac_err"; then
3302   :
3303 else
3304   echo "$ac_err" >&5
3305   echo "configure: failed program was:" >&5
3306   cat conftest.$ac_ext >&5
3307   rm -rf conftest*
3308   CPP="${CC-cc} -nologo -E"
3309   cat > conftest.$ac_ext <<EOF
3310 #line 3311 "configure"
3311 #include "confdefs.h"
3312 #include <assert.h>
3313 Syntax Error
3314 EOF
3315 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3316 { (eval echo configure:3317: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3317 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3318 if test -z "$ac_err"; then
3319   :
3320 else
3321   echo "$ac_err" >&5
3322   echo "configure: failed program was:" >&5
3323   cat conftest.$ac_ext >&5
3324   rm -rf conftest*
3325   CPP=/lib/cpp
3326 fi
3327 rm -f conftest*
3328 fi
3329 rm -f conftest*
3330 fi
3331 rm -f conftest*
3332   ac_cv_prog_CPP="$CPP"
3333 fi
3334   CPP="$ac_cv_prog_CPP"
3335 else
3336   ac_cv_prog_CPP="$CPP"
3337 fi
3338 echo "$ac_t""$CPP" 1>&6
3339
3340 # Check whether --enable-fast-install or --disable-fast-install was given.
3341 if test "${enable_fast_install+set}" = set; then
3342   enableval="$enable_fast_install"
3343   p=${PACKAGE-default}
3344 case $enableval in
3345 yes) enable_fast_install=yes ;;
3346 no) enable_fast_install=no ;;
3347 *)
3348   enable_fast_install=no
3349   # Look at the argument we got.  We use all the common list separators.
3350   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3351   for pkg in $enableval; do
3352     if test "X$pkg" = "X$p"; then
3353       enable_fast_install=yes
3354     fi
3355   done
3356   IFS="$ac_save_ifs"
3357   ;;
3358 esac
3359 else
3360   enable_fast_install=yes
3361 fi
3362
3363 # Extract the first word of "gcc", so it can be a program name with args.
3364 set dummy gcc; ac_word=$2
3365 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3366 echo "configure:3367: checking for $ac_word" >&5
3367 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3368   echo $ac_n "(cached) $ac_c" 1>&6
3369 else
3370   if test -n "$CC"; then
3371   ac_cv_prog_CC="$CC" # Let the user override the test.
3372 else
3373   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3374   ac_dummy="$PATH"
3375   for ac_dir in $ac_dummy; do
3376     test -z "$ac_dir" && ac_dir=.
3377     if test -f $ac_dir/$ac_word; then
3378       ac_cv_prog_CC="gcc"
3379       break
3380     fi
3381   done
3382   IFS="$ac_save_ifs"
3383 fi
3384 fi
3385 CC="$ac_cv_prog_CC"
3386 if test -n "$CC"; then
3387   echo "$ac_t""$CC" 1>&6
3388 else
3389   echo "$ac_t""no" 1>&6
3390 fi
3391
3392 if test -z "$CC"; then
3393   # Extract the first word of "cc", so it can be a program name with args.
3394 set dummy cc; ac_word=$2
3395 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3396 echo "configure:3397: checking for $ac_word" >&5
3397 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3398   echo $ac_n "(cached) $ac_c" 1>&6
3399 else
3400   if test -n "$CC"; then
3401   ac_cv_prog_CC="$CC" # Let the user override the test.
3402 else
3403   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3404   ac_prog_rejected=no
3405   ac_dummy="$PATH"
3406   for ac_dir in $ac_dummy; do
3407     test -z "$ac_dir" && ac_dir=.
3408     if test -f $ac_dir/$ac_word; then
3409       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
3410         ac_prog_rejected=yes
3411         continue
3412       fi
3413       ac_cv_prog_CC="cc"
3414       break
3415     fi
3416   done
3417   IFS="$ac_save_ifs"
3418 if test $ac_prog_rejected = yes; then
3419   # We found a bogon in the path, so make sure we never use it.
3420   set dummy $ac_cv_prog_CC
3421   shift
3422   if test $# -gt 0; then
3423     # We chose a different compiler from the bogus one.
3424     # However, it has the same basename, so the bogon will be chosen
3425     # first if we set CC to just the basename; use the full file name.
3426     shift
3427     set dummy "$ac_dir/$ac_word" "$@"
3428     shift
3429     ac_cv_prog_CC="$@"
3430   fi
3431 fi
3432 fi
3433 fi
3434 CC="$ac_cv_prog_CC"
3435 if test -n "$CC"; then
3436   echo "$ac_t""$CC" 1>&6
3437 else
3438   echo "$ac_t""no" 1>&6
3439 fi
3440
3441   if test -z "$CC"; then
3442     case "`uname -s`" in
3443     *win32* | *WIN32* | *CYGWIN*)
3444       # Extract the first word of "cl", so it can be a program name with args.
3445 set dummy cl; ac_word=$2
3446 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3447 echo "configure:3448: checking for $ac_word" >&5
3448 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3449   echo $ac_n "(cached) $ac_c" 1>&6
3450 else
3451   if test -n "$CC"; then
3452   ac_cv_prog_CC="$CC" # Let the user override the test.
3453 else
3454   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3455   ac_dummy="$PATH"
3456   for ac_dir in $ac_dummy; do
3457     test -z "$ac_dir" && ac_dir=.
3458     if test -f $ac_dir/$ac_word; then
3459       ac_cv_prog_CC="cl"
3460       break
3461     fi
3462   done
3463   IFS="$ac_save_ifs"
3464 fi
3465 fi
3466 CC="$ac_cv_prog_CC"
3467 if test -n "$CC"; then
3468   echo "$ac_t""$CC" 1>&6
3469 else
3470   echo "$ac_t""no" 1>&6
3471 fi
3472  ;;
3473     esac
3474   fi
3475   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
3476 fi
3477
3478 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
3479 echo "configure:3480: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
3480
3481 ac_ext=c
3482 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3483 ac_cpp='$CPP $CPPFLAGS'
3484 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3485 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3486 cross_compiling=$ac_cv_prog_cc_cross
3487
3488 cat > conftest.$ac_ext << EOF
3489
3490 #line 3491 "configure"
3491 #include "confdefs.h"
3492
3493 main(){return(0);}
3494 EOF
3495 if { (eval echo configure:3496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3496   ac_cv_prog_cc_works=yes
3497   # If we can't run a trivial program, we are probably using a cross compiler.
3498   if (./conftest; exit) 2>/dev/null; then
3499     ac_cv_prog_cc_cross=no
3500   else
3501     ac_cv_prog_cc_cross=yes
3502   fi
3503 else
3504   echo "configure: failed program was:" >&5
3505   cat conftest.$ac_ext >&5
3506   ac_cv_prog_cc_works=no
3507 fi
3508 rm -fr conftest*
3509 ac_ext=c
3510 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3511 ac_cpp='$CPP $CPPFLAGS'
3512 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3513 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3514 cross_compiling=$ac_cv_prog_cc_cross
3515
3516 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
3517 if test $ac_cv_prog_cc_works = no; then
3518   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
3519 fi
3520 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
3521 echo "configure:3522: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
3522 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
3523 cross_compiling=$ac_cv_prog_cc_cross
3524
3525 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
3526 echo "configure:3527: checking whether we are using GNU C" >&5
3527 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
3528   echo $ac_n "(cached) $ac_c" 1>&6
3529 else
3530   cat > conftest.c <<EOF
3531 #ifdef __GNUC__
3532   yes;
3533 #endif
3534 EOF
3535 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3536: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
3536   ac_cv_prog_gcc=yes
3537 else
3538   ac_cv_prog_gcc=no
3539 fi
3540 fi
3541
3542 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
3543
3544 if test $ac_cv_prog_gcc = yes; then
3545   GCC=yes
3546 else
3547   GCC=
3548 fi
3549
3550 ac_test_CFLAGS="${CFLAGS+set}"
3551 ac_save_CFLAGS="$CFLAGS"
3552 CFLAGS=
3553 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
3554 echo "configure:3555: checking whether ${CC-cc} accepts -g" >&5
3555 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
3556   echo $ac_n "(cached) $ac_c" 1>&6
3557 else
3558   echo 'void f(){}' > conftest.c
3559 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
3560   ac_cv_prog_cc_g=yes
3561 else
3562   ac_cv_prog_cc_g=no
3563 fi
3564 rm -f conftest*
3565
3566 fi
3567
3568 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
3569 if test "$ac_test_CFLAGS" = set; then
3570   CFLAGS="$ac_save_CFLAGS"
3571 elif test $ac_cv_prog_cc_g = yes; then
3572   if test "$GCC" = yes; then
3573     CFLAGS="-g -O2"
3574   else
3575     CFLAGS="-g"
3576   fi
3577 else
3578   if test "$GCC" = yes; then
3579     CFLAGS="-O2"
3580   else
3581     CFLAGS=
3582   fi
3583 fi
3584
3585 # Check whether --with-gnu-ld or --without-gnu-ld was given.
3586 if test "${with_gnu_ld+set}" = set; then
3587   withval="$with_gnu_ld"
3588   test "$withval" = no || with_gnu_ld=yes
3589 else
3590   with_gnu_ld=no
3591 fi
3592
3593 ac_prog=ld
3594 if test "$GCC" = yes; then
3595   # Check if gcc -print-prog-name=ld gives a path.
3596   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
3597 echo "configure:3598: checking for ld used by GCC" >&5
3598   case $host in
3599   *-*-mingw*)
3600     # gcc leaves a trailing carriage return which upsets mingw
3601     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3602   *)
3603     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3604   esac
3605   case $ac_prog in
3606     # Accept absolute paths.
3607     [\\/]* | [A-Za-z]:[\\/]*)
3608       re_direlt='/[^/][^/]*/\.\./'
3609       # Canonicalize the path of ld
3610       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3611       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3612         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3613       done
3614       test -z "$LD" && LD="$ac_prog"
3615       ;;
3616   "")
3617     # If it fails, then pretend we aren't using GCC.
3618     ac_prog=ld
3619     ;;
3620   *)
3621     # If it is relative, then search for the first ld in PATH.
3622     with_gnu_ld=unknown
3623     ;;
3624   esac
3625 elif test "$with_gnu_ld" = yes; then
3626   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
3627 echo "configure:3628: checking for GNU ld" >&5
3628 else
3629   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
3630 echo "configure:3631: checking for non-GNU ld" >&5
3631 fi
3632 if eval "test \"\${lt_cv_path_LD+set}\" = set"; then
3633   echo $ac_n "(cached) $ac_c" 1>&6
3634 else
3635   if test -z "$LD"; then
3636   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3637   for ac_dir in $PATH; do
3638     test -z "$ac_dir" && ac_dir=.
3639     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3640       lt_cv_path_LD="$ac_dir/$ac_prog"
3641       # Check to see if the program is GNU ld.  I'd rather use --version,
3642       # but apparently some GNU ld's only accept -v.
3643       # Break only if it was the GNU/non-GNU ld that we prefer.
3644       if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3645         test "$with_gnu_ld" != no && break
3646       else
3647         test "$with_gnu_ld" != yes && break
3648       fi
3649     fi
3650   done
3651   IFS="$ac_save_ifs"
3652 else
3653   lt_cv_path_LD="$LD" # Let the user override the test with a path.
3654 fi
3655 fi
3656
3657 LD="$lt_cv_path_LD"
3658 if test -n "$LD"; then
3659   echo "$ac_t""$LD" 1>&6
3660 else
3661   echo "$ac_t""no" 1>&6
3662 fi
3663 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
3664 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
3665 echo "configure:3666: checking if the linker ($LD) is GNU ld" >&5
3666 if eval "test \"\${lt_cv_prog_gnu_ld+set}\" = set"; then
3667   echo $ac_n "(cached) $ac_c" 1>&6
3668 else
3669   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
3670 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3671   lt_cv_prog_gnu_ld=yes
3672 else
3673   lt_cv_prog_gnu_ld=no
3674 fi
3675 fi
3676
3677 echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
3678 with_gnu_ld=$lt_cv_prog_gnu_ld
3679
3680
3681 echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
3682 echo "configure:3683: checking for $LD option to reload object files" >&5
3683 if eval "test \"\${lt_cv_ld_reload_flag+set}\" = set"; then
3684   echo $ac_n "(cached) $ac_c" 1>&6
3685 else
3686   lt_cv_ld_reload_flag='-r'
3687 fi
3688
3689 echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6
3690 reload_flag=$lt_cv_ld_reload_flag
3691 test -n "$reload_flag" && reload_flag=" $reload_flag"
3692
3693 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
3694 echo "configure:3695: checking for BSD-compatible nm" >&5
3695 if eval "test \"\${lt_cv_path_NM+set}\" = set"; then
3696   echo $ac_n "(cached) $ac_c" 1>&6
3697 else
3698   if test -n "$NM"; then
3699   # Let the user override the test.
3700   lt_cv_path_NM="$NM"
3701 else
3702   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3703   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3704     test -z "$ac_dir" && ac_dir=.
3705     tmp_nm=$ac_dir/${ac_tool_prefix}nm
3706     if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
3707       # Check to see if the nm accepts a BSD-compat flag.
3708       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3709       #   nm: unknown option "B" ignored
3710       # Tru64's nm complains that /dev/null is an invalid object file
3711       if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
3712         lt_cv_path_NM="$tmp_nm -B"
3713         break
3714       elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3715         lt_cv_path_NM="$tmp_nm -p"
3716         break
3717       else
3718         lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3719         continue # so that we can try to find one that supports BSD flags
3720       fi
3721     fi
3722   done
3723   IFS="$ac_save_ifs"
3724   test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
3725 fi
3726 fi
3727
3728 NM="$lt_cv_path_NM"
3729 echo "$ac_t""$NM" 1>&6
3730
3731 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3732 echo "configure:3733: checking whether ln -s works" >&5
3733 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3734   echo $ac_n "(cached) $ac_c" 1>&6
3735 else
3736   rm -f conftestdata
3737 if ln -s X conftestdata 2>/dev/null
3738 then
3739   rm -f conftestdata
3740   ac_cv_prog_LN_S="ln -s"
3741 else
3742   ac_cv_prog_LN_S=ln
3743 fi
3744 fi
3745 LN_S="$ac_cv_prog_LN_S"
3746 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3747   echo "$ac_t""yes" 1>&6
3748 else
3749   echo "$ac_t""no" 1>&6
3750 fi
3751
3752 echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
3753 echo "configure:3754: checking how to recognise dependant libraries" >&5
3754 if eval "test \"\${lt_cv_deplibs_check_method+set}\" = set"; then
3755   echo $ac_n "(cached) $ac_c" 1>&6
3756 else
3757   lt_cv_file_magic_cmd='$MAGIC_CMD'
3758 lt_cv_file_magic_test_file=
3759 lt_cv_deplibs_check_method='unknown'
3760 # Need to set the preceding variable on all platforms that support
3761 # interlibrary dependencies.
3762 # 'none' -- dependencies not supported.
3763 # `unknown' -- same as none, but documents that we really don't know.
3764 # 'pass_all' -- all dependencies passed with no checks.
3765 # 'test_compile' -- check by making test program.
3766 # 'file_magic [[regex]]' -- check by looking for files in library path
3767 # which responds to the $file_magic_cmd with a given egrep regex.
3768 # If you have `file' or equivalent on your system and you're not sure
3769 # whether `pass_all' will *always* work, you probably want this one.
3770
3771 case $host_os in
3772 aix4* | aix5*)
3773   lt_cv_deplibs_check_method=pass_all
3774   ;;
3775
3776 beos*)
3777   lt_cv_deplibs_check_method=pass_all
3778   ;;
3779
3780 bsdi4*)
3781   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
3782   lt_cv_file_magic_cmd='/usr/bin/file -L'
3783   lt_cv_file_magic_test_file=/shlib/libc.so
3784   ;;
3785
3786 cygwin* | mingw* | pw32*)
3787   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3788   lt_cv_file_magic_cmd='$OBJDUMP -f'
3789   ;;
3790
3791 darwin* | rhapsody*)
3792   lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
3793   lt_cv_file_magic_cmd='/usr/bin/file -L'
3794   case "$host_os" in
3795   rhapsody* | darwin1.[012])
3796     lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
3797     ;;
3798   *) # Darwin 1.3 on
3799     lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
3800     ;;
3801   esac
3802   ;;
3803
3804 freebsd*)
3805   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3806     case $host_cpu in
3807     i*86 )
3808       # Not sure whether the presence of OpenBSD here was a mistake.
3809       # Let's accept both of them until this is cleared up.
3810       lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
3811       lt_cv_file_magic_cmd=/usr/bin/file
3812       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3813       ;;
3814     esac
3815   else
3816     lt_cv_deplibs_check_method=pass_all
3817   fi
3818   ;;
3819
3820 gnu*)
3821   lt_cv_deplibs_check_method=pass_all
3822   ;;
3823
3824 hpux10.20*|hpux11*)
3825   lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
3826   lt_cv_file_magic_cmd=/usr/bin/file
3827   lt_cv_file_magic_test_file=/usr/lib/libc.sl
3828   ;;
3829
3830 irix5* | irix6*)
3831   case $host_os in
3832   irix5*)
3833     # this will be overridden with pass_all, but let us keep it just in case
3834     lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
3835     ;;
3836   *)
3837     case $LD in
3838     *-32|*"-32 ") libmagic=32-bit;;
3839     *-n32|*"-n32 ") libmagic=N32;;
3840     *-64|*"-64 ") libmagic=64-bit;;
3841     *) libmagic=never-match;;
3842     esac
3843     # this will be overridden with pass_all, but let us keep it just in case
3844     lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
3845     ;;
3846   esac
3847   lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
3848   lt_cv_deplibs_check_method=pass_all
3849   ;;
3850
3851 # This must be Linux ELF.
3852 linux-gnu*)
3853   case $host_cpu in
3854   alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
3855     lt_cv_deplibs_check_method=pass_all ;;
3856   *)
3857     # glibc up to 2.1.1 does not perform some relocations on ARM
3858     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
3859   esac
3860   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
3861   ;;
3862
3863 netbsd*)
3864   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3865     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
3866   else
3867     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
3868   fi
3869   ;;
3870
3871 newos6*)
3872   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
3873   lt_cv_file_magic_cmd=/usr/bin/file
3874   lt_cv_file_magic_test_file=/usr/lib/libnls.so
3875   ;;
3876
3877 openbsd*)
3878   lt_cv_file_magic_cmd=/usr/bin/file
3879   lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3880   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3881     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
3882   else
3883     lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
3884   fi
3885   ;;
3886
3887 osf3* | osf4* | osf5*)
3888   # this will be overridden with pass_all, but let us keep it just in case
3889   lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
3890   lt_cv_file_magic_test_file=/shlib/libc.so
3891   lt_cv_deplibs_check_method=pass_all
3892   ;;
3893
3894 sco3.2v5*)
3895   lt_cv_deplibs_check_method=pass_all
3896   ;;
3897
3898 solaris*)
3899   lt_cv_deplibs_check_method=pass_all
3900   lt_cv_file_magic_test_file=/lib/libc.so
3901   ;;
3902
3903 sysv5uw[78]* | sysv4*uw2*)
3904   lt_cv_deplibs_check_method=pass_all
3905   ;;
3906
3907 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
3908   case $host_vendor in
3909   motorola)
3910     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]'
3911     lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3912     ;;
3913   ncr)
3914     lt_cv_deplibs_check_method=pass_all
3915     ;;
3916   sequent)
3917     lt_cv_file_magic_cmd='/bin/file'
3918     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
3919     ;;
3920   sni)
3921     lt_cv_file_magic_cmd='/bin/file'
3922     lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
3923     lt_cv_file_magic_test_file=/lib/libc.so
3924     ;;
3925   esac
3926   ;;
3927 esac
3928
3929 fi
3930
3931 echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6
3932 file_magic_cmd=$lt_cv_file_magic_cmd
3933 deplibs_check_method=$lt_cv_deplibs_check_method
3934
3935 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
3936 echo "configure:3937: checking for object suffix" >&5
3937 if eval "test \"\${ac_cv_objext+set}\" = set"; then
3938   echo $ac_n "(cached) $ac_c" 1>&6
3939 else
3940   rm -f conftest*
3941 echo 'int i = 1;' > conftest.$ac_ext
3942 if { (eval echo configure:3943: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3943   for ac_file in conftest.*; do
3944     case $ac_file in
3945     *.c) ;;
3946     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
3947     esac
3948   done
3949 else
3950   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
3951 fi
3952 rm -f conftest*
3953 fi
3954
3955 echo "$ac_t""$ac_cv_objext" 1>&6
3956 OBJEXT=$ac_cv_objext
3957 ac_objext=$ac_cv_objext
3958
3959
3960
3961
3962 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
3963 echo "configure:3964: checking for executable suffix" >&5
3964 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
3965   echo $ac_n "(cached) $ac_c" 1>&6
3966 else
3967   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
3968   ac_cv_exeext=.exe
3969 else
3970   rm -f conftest*
3971   echo 'int main () { return 0; }' > conftest.$ac_ext
3972   ac_cv_exeext=
3973   if { (eval echo configure:3974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
3974     for file in conftest.*; do
3975       case $file in
3976       *.c | *.C | *.o | *.obj | *.xcoff) ;;
3977       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
3978       esac
3979     done
3980   else
3981     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
3982   fi
3983   rm -f conftest*
3984   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
3985 fi
3986 fi
3987
3988 EXEEXT=""
3989 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
3990 echo "$ac_t""${ac_cv_exeext}" 1>&6
3991 ac_exeext=$EXEEXT
3992
3993 if test $host != $build; then
3994   ac_tool_prefix=${host_alias}-
3995 else
3996   ac_tool_prefix=
3997 fi
3998
3999
4000
4001
4002 # Check for command to grab the raw symbol name followed by C symbol from nm.
4003 echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
4004 echo "configure:4005: checking command to parse $NM output" >&5
4005 if eval "test \"\${lt_cv_sys_global_symbol_pipe+set}\" = set"; then
4006   echo $ac_n "(cached) $ac_c" 1>&6
4007 else
4008   
4009 # These are sane defaults that work on at least a few old systems.
4010 # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4011
4012 # Character class describing NM global symbol codes.
4013 symcode='[BCDEGRST]'
4014
4015 # Regexp to match symbols that can be accessed directly from C.
4016 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
4017
4018 # Transform the above into a raw symbol and a C symbol.
4019 symxfrm='\1 \2\3 \3'
4020
4021 # Transform an extracted symbol line into a proper C declaration
4022 lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
4023
4024 # Transform an extracted symbol line into symbol name and symbol address
4025 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'"
4026
4027 # Define system-specific variables.
4028 case $host_os in
4029 aix*)
4030   symcode='[BCDT]'
4031   ;;
4032 cygwin* | mingw* | pw32*)
4033   symcode='[ABCDGISTW]'
4034   ;;
4035 hpux*) # Its linker distinguishes data from code symbols
4036   lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4037   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'"
4038   ;;
4039 irix*)
4040   symcode='[BCDEGRST]'
4041   ;;
4042 solaris* | sysv5*)
4043   symcode='[BDT]'
4044   ;;
4045 sysv4)
4046   symcode='[DFNSTU]'
4047   ;;
4048 esac
4049
4050 # Handle CRLF in mingw tool chain
4051 opt_cr=
4052 case $host_os in
4053 mingw*)
4054   opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4055   ;;
4056 esac
4057
4058 # If we're using GNU nm, then use its standard symbol codes.
4059 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
4060   symcode='[ABCDGISTW]'
4061 fi
4062
4063 # Try without a prefix undercore, then with it.
4064 for ac_symprfx in "" "_"; do
4065
4066   # Write the raw and C identifiers.
4067 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[         ]\($symcode$symcode*\)[         ][      ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
4068
4069   # Check to see that the pipe works correctly.
4070   pipe_works=no
4071   rm -f conftest*
4072   cat > conftest.$ac_ext <<EOF
4073 #ifdef __cplusplus
4074 extern "C" {
4075 #endif
4076 char nm_test_var;
4077 void nm_test_func(){}
4078 #ifdef __cplusplus
4079 }
4080 #endif
4081 int main(){nm_test_var='a';nm_test_func();return(0);}
4082 EOF
4083
4084   if { (eval echo configure:4085: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4085     # Now try to grab the symbols.
4086     nlist=conftest.nm
4087     if { (eval echo configure:4088: \"$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
4088       # Try sorting and uniquifying the output.
4089       if sort "$nlist" | uniq > "$nlist"T; then
4090         mv -f "$nlist"T "$nlist"
4091       else
4092         rm -f "$nlist"T
4093       fi
4094
4095       # Make sure that we snagged all the symbols we need.
4096       if egrep ' nm_test_var$' "$nlist" >/dev/null; then
4097         if egrep ' nm_test_func$' "$nlist" >/dev/null; then
4098           cat <<EOF > conftest.$ac_ext
4099 #ifdef __cplusplus
4100 extern "C" {
4101 #endif
4102
4103 EOF
4104           # Now generate the symbol file.
4105           eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
4106
4107           cat <<EOF >> conftest.$ac_ext
4108 #if defined (__STDC__) && __STDC__
4109 # define lt_ptr void *
4110 #else
4111 # define lt_ptr char *
4112 # define const
4113 #endif
4114
4115 /* The mapping between symbol names and symbols. */
4116 const struct {
4117   const char *name;
4118   lt_ptr address;
4119 }
4120 lt_preloaded_symbols[] =
4121 {
4122 EOF
4123           sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
4124           cat <<\EOF >> conftest.$ac_ext
4125   {0, (lt_ptr) 0}
4126 };
4127
4128 #ifdef __cplusplus
4129 }
4130 #endif
4131 EOF
4132           # Now try linking the two files.
4133           mv conftest.$ac_objext conftstm.$ac_objext
4134           save_LIBS="$LIBS"
4135           save_CFLAGS="$CFLAGS"
4136           LIBS="conftstm.$ac_objext"
4137           CFLAGS="$CFLAGS$no_builtin_flag"
4138           if { (eval echo configure:4139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4139             pipe_works=yes
4140           fi
4141           LIBS="$save_LIBS"
4142           CFLAGS="$save_CFLAGS"
4143         else
4144           echo "cannot find nm_test_func in $nlist" >&5
4145         fi
4146       else
4147         echo "cannot find nm_test_var in $nlist" >&5
4148       fi
4149     else
4150       echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
4151     fi
4152   else
4153     echo "$progname: failed program was:" >&5
4154     cat conftest.$ac_ext >&5
4155   fi
4156   rm -f conftest* conftst*
4157
4158   # Do not use the global_symbol_pipe unless it works.
4159   if test "$pipe_works" = yes; then
4160     break
4161   else
4162     lt_cv_sys_global_symbol_pipe=
4163   fi
4164 done
4165
4166 fi
4167
4168 global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
4169 if test -z "$lt_cv_sys_global_symbol_pipe"; then
4170   global_symbol_to_cdecl=
4171   global_symbol_to_c_name_address=
4172 else
4173   global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
4174   global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
4175 fi
4176 if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
4177 then
4178   echo "$ac_t""failed" 1>&6
4179 else
4180   echo "$ac_t""ok" 1>&6
4181 fi
4182
4183 for ac_hdr in dlfcn.h
4184 do
4185 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4186 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4187 echo "configure:4188: checking for $ac_hdr" >&5
4188 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4189   echo $ac_n "(cached) $ac_c" 1>&6
4190 else
4191   cat > conftest.$ac_ext <<EOF
4192 #line 4193 "configure"
4193 #include "confdefs.h"
4194 #include <$ac_hdr>
4195 EOF
4196 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4197 { (eval echo configure:4198: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4198 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4199 if test -z "$ac_err"; then
4200   rm -rf conftest*
4201   eval "ac_cv_header_$ac_safe=yes"
4202 else
4203   echo "$ac_err" >&5
4204   echo "configure: failed program was:" >&5
4205   cat conftest.$ac_ext >&5
4206   rm -rf conftest*
4207   eval "ac_cv_header_$ac_safe=no"
4208 fi
4209 rm -f conftest*
4210 fi
4211 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4212   echo "$ac_t""yes" 1>&6
4213     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4214   cat >> confdefs.h <<EOF
4215 #define $ac_tr_hdr 1
4216 EOF
4217  
4218 else
4219   echo "$ac_t""no" 1>&6
4220 fi
4221 done
4222
4223
4224
4225
4226
4227 # Only perform the check for file, if the check method requires it
4228 case $deplibs_check_method in
4229 file_magic*)
4230   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
4231     echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
4232 echo "configure:4233: checking for ${ac_tool_prefix}file" >&5
4233 if eval "test \"\${lt_cv_path_MAGIC_CMD+set}\" = set"; then
4234   echo $ac_n "(cached) $ac_c" 1>&6
4235 else
4236   case $MAGIC_CMD in
4237   /*)
4238   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4239   ;;
4240   ?:/*)
4241   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
4242   ;;
4243   *)
4244   ac_save_MAGIC_CMD="$MAGIC_CMD"
4245   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4246   ac_dummy="/usr/bin:$PATH"
4247   for ac_dir in $ac_dummy; do
4248     test -z "$ac_dir" && ac_dir=.
4249     if test -f $ac_dir/${ac_tool_prefix}file; then
4250       lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
4251       if test -n "$file_magic_test_file"; then
4252         case $deplibs_check_method in
4253         "file_magic "*)
4254           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
4255           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4256           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4257             egrep "$file_magic_regex" > /dev/null; then
4258             :
4259           else
4260             cat <<EOF 1>&2
4261
4262 *** Warning: the command libtool uses to detect shared libraries,
4263 *** $file_magic_cmd, produces output that libtool cannot recognize.
4264 *** The result is that libtool may fail to recognize shared libraries
4265 *** as such.  This will affect the creation of libtool libraries that
4266 *** depend on shared libraries, but programs linked with such libtool
4267 *** libraries will work regardless of this problem.  Nevertheless, you
4268 *** may want to report the problem to your system manager and/or to
4269 *** bug-libtool@gnu.org
4270
4271 EOF
4272           fi ;;
4273         esac
4274       fi
4275       break
4276     fi
4277   done
4278   IFS="$ac_save_ifs"
4279   MAGIC_CMD="$ac_save_MAGIC_CMD"
4280   ;;
4281 esac
4282 fi
4283
4284 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4285 if test -n "$MAGIC_CMD"; then
4286   echo "$ac_t""$MAGIC_CMD" 1>&6
4287 else
4288   echo "$ac_t""no" 1>&6
4289 fi
4290
4291 if test -z "$lt_cv_path_MAGIC_CMD"; then
4292   if test -n "$ac_tool_prefix"; then
4293     echo $ac_n "checking for file""... $ac_c" 1>&6
4294 echo "configure:4295: checking for file" >&5
4295 if eval "test \"\${lt_cv_path_MAGIC_CMD+set}\" = set"; then
4296   echo $ac_n "(cached) $ac_c" 1>&6
4297 else
4298   case $MAGIC_CMD in
4299   /*)
4300   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4301   ;;
4302   ?:/*)
4303   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
4304   ;;
4305   *)
4306   ac_save_MAGIC_CMD="$MAGIC_CMD"
4307   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4308   ac_dummy="/usr/bin:$PATH"
4309   for ac_dir in $ac_dummy; do
4310     test -z "$ac_dir" && ac_dir=.
4311     if test -f $ac_dir/file; then
4312       lt_cv_path_MAGIC_CMD="$ac_dir/file"
4313       if test -n "$file_magic_test_file"; then
4314         case $deplibs_check_method in
4315         "file_magic "*)
4316           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
4317           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4318           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4319             egrep "$file_magic_regex" > /dev/null; then
4320             :
4321           else
4322             cat <<EOF 1>&2
4323
4324 *** Warning: the command libtool uses to detect shared libraries,
4325 *** $file_magic_cmd, produces output that libtool cannot recognize.
4326 *** The result is that libtool may fail to recognize shared libraries
4327 *** as such.  This will affect the creation of libtool libraries that
4328 *** depend on shared libraries, but programs linked with such libtool
4329 *** libraries will work regardless of this problem.  Nevertheless, you
4330 *** may want to report the problem to your system manager and/or to
4331 *** bug-libtool@gnu.org
4332
4333 EOF
4334           fi ;;
4335         esac
4336       fi
4337       break
4338     fi
4339   done
4340   IFS="$ac_save_ifs"
4341   MAGIC_CMD="$ac_save_MAGIC_CMD"
4342   ;;
4343 esac
4344 fi
4345
4346 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4347 if test -n "$MAGIC_CMD"; then
4348   echo "$ac_t""$MAGIC_CMD" 1>&6
4349 else
4350   echo "$ac_t""no" 1>&6
4351 fi
4352
4353   else
4354     MAGIC_CMD=:
4355   fi
4356 fi
4357
4358   fi
4359   ;;
4360 esac
4361
4362 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
4363 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
4364 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4365 echo "configure:4366: checking for $ac_word" >&5
4366 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
4367   echo $ac_n "(cached) $ac_c" 1>&6
4368 else
4369   if test -n "$RANLIB"; then
4370   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
4371 else
4372   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4373   ac_dummy="$PATH"
4374   for ac_dir in $ac_dummy; do
4375     test -z "$ac_dir" && ac_dir=.
4376     if test -f $ac_dir/$ac_word; then
4377       ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
4378       break
4379     fi
4380   done
4381   IFS="$ac_save_ifs"
4382 fi
4383 fi
4384 RANLIB="$ac_cv_prog_RANLIB"
4385 if test -n "$RANLIB"; then
4386   echo "$ac_t""$RANLIB" 1>&6
4387 else
4388   echo "$ac_t""no" 1>&6
4389 fi
4390
4391
4392 if test -z "$ac_cv_prog_RANLIB"; then
4393 if test -n "$ac_tool_prefix"; then
4394   # Extract the first word of "ranlib", so it can be a program name with args.
4395 set dummy ranlib; ac_word=$2
4396 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4397 echo "configure:4398: checking for $ac_word" >&5
4398 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
4399   echo $ac_n "(cached) $ac_c" 1>&6
4400 else
4401   if test -n "$RANLIB"; then
4402   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
4403 else
4404   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4405   ac_dummy="$PATH"
4406   for ac_dir in $ac_dummy; do
4407     test -z "$ac_dir" && ac_dir=.
4408     if test -f $ac_dir/$ac_word; then
4409       ac_cv_prog_RANLIB="ranlib"
4410       break
4411     fi
4412   done
4413   IFS="$ac_save_ifs"
4414   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
4415 fi
4416 fi
4417 RANLIB="$ac_cv_prog_RANLIB"
4418 if test -n "$RANLIB"; then
4419   echo "$ac_t""$RANLIB" 1>&6
4420 else
4421   echo "$ac_t""no" 1>&6
4422 fi
4423
4424 else
4425   RANLIB=":"
4426 fi
4427 fi
4428
4429 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
4430 set dummy ${ac_tool_prefix}strip; ac_word=$2
4431 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4432 echo "configure:4433: checking for $ac_word" >&5
4433 if eval "test \"\${ac_cv_prog_STRIP+set}\" = set"; then
4434   echo $ac_n "(cached) $ac_c" 1>&6
4435 else
4436   if test -n "$STRIP"; then
4437   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
4438 else
4439   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4440   ac_dummy="$PATH"
4441   for ac_dir in $ac_dummy; do
4442     test -z "$ac_dir" && ac_dir=.
4443     if test -f $ac_dir/$ac_word; then
4444       ac_cv_prog_STRIP="${ac_tool_prefix}strip"
4445       break
4446     fi
4447   done
4448   IFS="$ac_save_ifs"
4449 fi
4450 fi
4451 STRIP="$ac_cv_prog_STRIP"
4452 if test -n "$STRIP"; then
4453   echo "$ac_t""$STRIP" 1>&6
4454 else
4455   echo "$ac_t""no" 1>&6
4456 fi
4457
4458
4459 if test -z "$ac_cv_prog_STRIP"; then
4460 if test -n "$ac_tool_prefix"; then
4461   # Extract the first word of "strip", so it can be a program name with args.
4462 set dummy strip; ac_word=$2
4463 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4464 echo "configure:4465: checking for $ac_word" >&5
4465 if eval "test \"\${ac_cv_prog_STRIP+set}\" = set"; then
4466   echo $ac_n "(cached) $ac_c" 1>&6
4467 else
4468   if test -n "$STRIP"; then
4469   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
4470 else
4471   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4472   ac_dummy="$PATH"
4473   for ac_dir in $ac_dummy; do
4474     test -z "$ac_dir" && ac_dir=.
4475     if test -f $ac_dir/$ac_word; then
4476       ac_cv_prog_STRIP="strip"
4477       break
4478     fi
4479   done
4480   IFS="$ac_save_ifs"
4481   test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
4482 fi
4483 fi
4484 STRIP="$ac_cv_prog_STRIP"
4485 if test -n "$STRIP"; then
4486   echo "$ac_t""$STRIP" 1>&6
4487 else
4488   echo "$ac_t""no" 1>&6
4489 fi
4490
4491 else
4492   STRIP=":"
4493 fi
4494 fi
4495
4496
4497 enable_dlopen=yes
4498 enable_win32_dll=yes
4499
4500 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
4501 if test "${enable_libtool_lock+set}" = set; then
4502   enableval="$enable_libtool_lock"
4503   :
4504 fi
4505
4506 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
4507
4508 # Some flags need to be propagated to the compiler or linker for good
4509 # libtool support.
4510 case $host in
4511 *-*-irix6*)
4512   # Find out which ABI we are using.
4513   echo '#line 4514 "configure"' > conftest.$ac_ext
4514   if { (eval echo configure:4515: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4515     case `/usr/bin/file conftest.$ac_objext` in
4516     *32-bit*)
4517       LD="${LD-ld} -32"
4518       ;;
4519     *N32*)
4520       LD="${LD-ld} -n32"
4521       ;;
4522     *64-bit*)
4523       LD="${LD-ld} -64"
4524       ;;
4525     esac
4526   fi
4527   rm -rf conftest*
4528   ;;
4529
4530 *-*-sco3.2v5*)
4531   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
4532   SAVE_CFLAGS="$CFLAGS"
4533   CFLAGS="$CFLAGS -belf"
4534   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
4535 echo "configure:4536: checking whether the C compiler needs -belf" >&5
4536 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
4537   echo $ac_n "(cached) $ac_c" 1>&6
4538 else
4539   
4540      ac_ext=c
4541 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
4542 ac_cpp='$CPP $CPPFLAGS'
4543 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
4544 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
4545 cross_compiling=$ac_cv_prog_cc_cross
4546
4547      cat > conftest.$ac_ext <<EOF
4548 #line 4549 "configure"
4549 #include "confdefs.h"
4550
4551 int main() {
4552
4553 ; return 0; }
4554 EOF
4555 if { (eval echo configure:4556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4556   rm -rf conftest*
4557   lt_cv_cc_needs_belf=yes
4558 else
4559   echo "configure: failed program was:" >&5
4560   cat conftest.$ac_ext >&5
4561   rm -rf conftest*
4562   lt_cv_cc_needs_belf=no
4563 fi
4564 rm -f conftest*
4565      ac_ext=c
4566 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
4567 ac_cpp='$CPP $CPPFLAGS'
4568 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
4569 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
4570 cross_compiling=$ac_cv_prog_cc_cross
4571
4572 fi
4573
4574 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
4575   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
4576     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
4577     CFLAGS="$SAVE_CFLAGS"
4578   fi
4579   ;;
4580
4581 *-*-cygwin* | *-*-mingw* | *-*-pw32*)
4582   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
4583 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
4584 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4585 echo "configure:4586: checking for $ac_word" >&5
4586 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
4587   echo $ac_n "(cached) $ac_c" 1>&6
4588 else
4589   if test -n "$DLLTOOL"; then
4590   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
4591 else
4592   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4593   ac_dummy="$PATH"
4594   for ac_dir in $ac_dummy; do
4595     test -z "$ac_dir" && ac_dir=.
4596     if test -f $ac_dir/$ac_word; then
4597       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
4598       break
4599     fi
4600   done
4601   IFS="$ac_save_ifs"
4602 fi
4603 fi
4604 DLLTOOL="$ac_cv_prog_DLLTOOL"
4605 if test -n "$DLLTOOL"; then
4606   echo "$ac_t""$DLLTOOL" 1>&6
4607 else
4608   echo "$ac_t""no" 1>&6
4609 fi
4610
4611
4612 if test -z "$ac_cv_prog_DLLTOOL"; then
4613 if test -n "$ac_tool_prefix"; then
4614   # Extract the first word of "dlltool", so it can be a program name with args.
4615 set dummy dlltool; ac_word=$2
4616 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4617 echo "configure:4618: checking for $ac_word" >&5
4618 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
4619   echo $ac_n "(cached) $ac_c" 1>&6
4620 else
4621   if test -n "$DLLTOOL"; then
4622   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
4623 else
4624   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4625   ac_dummy="$PATH"
4626   for ac_dir in $ac_dummy; do
4627     test -z "$ac_dir" && ac_dir=.
4628     if test -f $ac_dir/$ac_word; then
4629       ac_cv_prog_DLLTOOL="dlltool"
4630       break
4631     fi
4632   done
4633   IFS="$ac_save_ifs"
4634   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
4635 fi
4636 fi
4637 DLLTOOL="$ac_cv_prog_DLLTOOL"
4638 if test -n "$DLLTOOL"; then
4639   echo "$ac_t""$DLLTOOL" 1>&6
4640 else
4641   echo "$ac_t""no" 1>&6
4642 fi
4643
4644 else
4645   DLLTOOL="false"
4646 fi
4647 fi
4648
4649   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
4650 set dummy ${ac_tool_prefix}as; ac_word=$2
4651 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4652 echo "configure:4653: checking for $ac_word" >&5
4653 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
4654   echo $ac_n "(cached) $ac_c" 1>&6
4655 else
4656   if test -n "$AS"; then
4657   ac_cv_prog_AS="$AS" # Let the user override the test.
4658 else
4659   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4660   ac_dummy="$PATH"
4661   for ac_dir in $ac_dummy; do
4662     test -z "$ac_dir" && ac_dir=.
4663     if test -f $ac_dir/$ac_word; then
4664       ac_cv_prog_AS="${ac_tool_prefix}as"
4665       break
4666     fi
4667   done
4668   IFS="$ac_save_ifs"
4669 fi
4670 fi
4671 AS="$ac_cv_prog_AS"
4672 if test -n "$AS"; then
4673   echo "$ac_t""$AS" 1>&6
4674 else
4675   echo "$ac_t""no" 1>&6
4676 fi
4677
4678
4679 if test -z "$ac_cv_prog_AS"; then
4680 if test -n "$ac_tool_prefix"; then
4681   # Extract the first word of "as", so it can be a program name with args.
4682 set dummy as; ac_word=$2
4683 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4684 echo "configure:4685: checking for $ac_word" >&5
4685 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
4686   echo $ac_n "(cached) $ac_c" 1>&6
4687 else
4688   if test -n "$AS"; then
4689   ac_cv_prog_AS="$AS" # Let the user override the test.
4690 else
4691   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4692   ac_dummy="$PATH"
4693   for ac_dir in $ac_dummy; do
4694     test -z "$ac_dir" && ac_dir=.
4695     if test -f $ac_dir/$ac_word; then
4696       ac_cv_prog_AS="as"
4697       break
4698     fi
4699   done
4700   IFS="$ac_save_ifs"
4701   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
4702 fi
4703 fi
4704 AS="$ac_cv_prog_AS"
4705 if test -n "$AS"; then
4706   echo "$ac_t""$AS" 1>&6
4707 else
4708   echo "$ac_t""no" 1>&6
4709 fi
4710
4711 else
4712   AS="false"
4713 fi
4714 fi
4715
4716   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
4717 set dummy ${ac_tool_prefix}objdump; ac_word=$2
4718 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4719 echo "configure:4720: checking for $ac_word" >&5
4720 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
4721   echo $ac_n "(cached) $ac_c" 1>&6
4722 else
4723   if test -n "$OBJDUMP"; then
4724   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
4725 else
4726   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4727   ac_dummy="$PATH"
4728   for ac_dir in $ac_dummy; do
4729     test -z "$ac_dir" && ac_dir=.
4730     if test -f $ac_dir/$ac_word; then
4731       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
4732       break
4733     fi
4734   done
4735   IFS="$ac_save_ifs"
4736 fi
4737 fi
4738 OBJDUMP="$ac_cv_prog_OBJDUMP"
4739 if test -n "$OBJDUMP"; then
4740   echo "$ac_t""$OBJDUMP" 1>&6
4741 else
4742   echo "$ac_t""no" 1>&6
4743 fi
4744
4745
4746 if test -z "$ac_cv_prog_OBJDUMP"; then
4747 if test -n "$ac_tool_prefix"; then
4748   # Extract the first word of "objdump", so it can be a program name with args.
4749 set dummy objdump; ac_word=$2
4750 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4751 echo "configure:4752: checking for $ac_word" >&5
4752 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
4753   echo $ac_n "(cached) $ac_c" 1>&6
4754 else
4755   if test -n "$OBJDUMP"; then
4756   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
4757 else
4758   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4759   ac_dummy="$PATH"
4760   for ac_dir in $ac_dummy; do
4761     test -z "$ac_dir" && ac_dir=.
4762     if test -f $ac_dir/$ac_word; then
4763       ac_cv_prog_OBJDUMP="objdump"
4764       break
4765     fi
4766   done
4767   IFS="$ac_save_ifs"
4768   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
4769 fi
4770 fi
4771 OBJDUMP="$ac_cv_prog_OBJDUMP"
4772 if test -n "$OBJDUMP"; then
4773   echo "$ac_t""$OBJDUMP" 1>&6
4774 else
4775   echo "$ac_t""no" 1>&6
4776 fi
4777
4778 else
4779   OBJDUMP="false"
4780 fi
4781 fi
4782
4783
4784   # recent cygwin and mingw systems supply a stub DllMain which the user
4785   # can override, but on older systems we have to supply one
4786   echo $ac_n "checking if libtool should supply DllMain function""... $ac_c" 1>&6
4787 echo "configure:4788: checking if libtool should supply DllMain function" >&5
4788 if eval "test \"\${lt_cv_need_dllmain+set}\" = set"; then
4789   echo $ac_n "(cached) $ac_c" 1>&6
4790 else
4791   cat > conftest.$ac_ext <<EOF
4792 #line 4793 "configure"
4793 #include "confdefs.h"
4794
4795 int main() {
4796 extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
4797       DllMain (0, 0, 0);
4798 ; return 0; }
4799 EOF
4800 if { (eval echo configure:4801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4801   rm -rf conftest*
4802   lt_cv_need_dllmain=no
4803 else
4804   echo "configure: failed program was:" >&5
4805   cat conftest.$ac_ext >&5
4806   rm -rf conftest*
4807   lt_cv_need_dllmain=yes
4808 fi
4809 rm -f conftest*
4810 fi
4811
4812 echo "$ac_t""$lt_cv_need_dllmain" 1>&6
4813
4814   case $host/$CC in
4815   *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
4816     # old mingw systems require "-dll" to link a DLL, while more recent ones
4817     # require "-mdll"
4818     SAVE_CFLAGS="$CFLAGS"
4819     CFLAGS="$CFLAGS -mdll"
4820     echo $ac_n "checking how to link DLLs""... $ac_c" 1>&6
4821 echo "configure:4822: checking how to link DLLs" >&5
4822 if eval "test \"\${lt_cv_cc_dll_switch+set}\" = set"; then
4823   echo $ac_n "(cached) $ac_c" 1>&6
4824 else
4825   cat > conftest.$ac_ext <<EOF
4826 #line 4827 "configure"
4827 #include "confdefs.h"
4828
4829 int main() {
4830
4831 ; return 0; }
4832 EOF
4833 if { (eval echo configure:4834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4834   rm -rf conftest*
4835   lt_cv_cc_dll_switch=-mdll
4836 else
4837   echo "configure: failed program was:" >&5
4838   cat conftest.$ac_ext >&5
4839   rm -rf conftest*
4840   lt_cv_cc_dll_switch=-dll
4841 fi
4842 rm -f conftest*
4843 fi
4844
4845 echo "$ac_t""$lt_cv_cc_dll_switch" 1>&6
4846     CFLAGS="$SAVE_CFLAGS" ;;
4847   *-*-cygwin* | *-*-pw32*)
4848     # cygwin systems need to pass --dll to the linker, and not link
4849     # crt.o which will require a WinMain@16 definition.
4850     lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
4851   esac
4852   ;;
4853   
4854 esac
4855
4856 # Sed substitution that helps us do robust quoting.  It backslashifies
4857 # metacharacters that are still active within double-quoted strings.
4858 Xsed='sed -e s/^X//'
4859 sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
4860
4861 # Same as above, but do not quote variable references.
4862 double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
4863
4864 # Sed substitution to delay expansion of an escaped shell variable in a
4865 # double_quote_subst'ed string.
4866 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
4867
4868 # Constants:
4869 rm="rm -f"
4870
4871 # Global variables:
4872 default_ofile=libtool
4873 can_build_shared=yes
4874
4875 # All known linkers require a `.a' archive for static linking (except M$VC,
4876 # which needs '.lib').
4877 libext=a
4878 ltmain="$ac_aux_dir/ltmain.sh"
4879 ofile="$default_ofile"
4880 with_gnu_ld="$lt_cv_prog_gnu_ld"
4881 need_locks="$enable_libtool_lock"
4882
4883 old_CC="$CC"
4884 old_CFLAGS="$CFLAGS"
4885
4886 # Set sane defaults for various variables
4887 test -z "$AR" && AR=ar
4888 test -z "$AR_FLAGS" && AR_FLAGS=cru
4889 test -z "$AS" && AS=as
4890 test -z "$CC" && CC=cc
4891 test -z "$DLLTOOL" && DLLTOOL=dlltool
4892 test -z "$LD" && LD=ld
4893 test -z "$LN_S" && LN_S="ln -s"
4894 test -z "$MAGIC_CMD" && MAGIC_CMD=file
4895 test -z "$NM" && NM=nm
4896 test -z "$OBJDUMP" && OBJDUMP=objdump
4897 test -z "$RANLIB" && RANLIB=:
4898 test -z "$STRIP" && STRIP=:
4899 test -z "$ac_objext" && ac_objext=o
4900
4901 if test x"$host" != x"$build"; then
4902   ac_tool_prefix=${host_alias}-
4903 else
4904   ac_tool_prefix=
4905 fi
4906
4907 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
4908 case $host_os in
4909 linux-gnu*) ;;
4910 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
4911 esac
4912
4913 case $host_os in
4914 aix3*)
4915   # AIX sometimes has problems with the GCC collect2 program.  For some
4916   # reason, if we set the COLLECT_NAMES environment variable, the problems
4917   # vanish in a puff of smoke.
4918   if test "X${COLLECT_NAMES+set}" != Xset; then
4919     COLLECT_NAMES=
4920     export COLLECT_NAMES
4921   fi
4922   ;;
4923 esac
4924
4925 # Determine commands to create old-style static archives.
4926 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
4927 old_postinstall_cmds='chmod 644 $oldlib'
4928 old_postuninstall_cmds=
4929
4930 if test -n "$RANLIB"; then
4931   case $host_os in
4932   openbsd*)
4933     old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
4934     ;;
4935   *)
4936     old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
4937     ;;
4938   esac
4939   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
4940 fi
4941
4942 # Allow CC to be a program name with arguments.
4943 set dummy $CC
4944 compiler="$2"
4945
4946 echo $ac_n "checking for objdir""... $ac_c" 1>&6
4947 echo "configure:4948: checking for objdir" >&5
4948 rm -f .libs 2>/dev/null
4949 mkdir .libs 2>/dev/null
4950 if test -d .libs; then
4951   objdir=.libs
4952 else
4953   # MS-DOS does not allow filenames that begin with a dot.
4954   objdir=_libs
4955 fi
4956 rmdir .libs 2>/dev/null
4957 echo "$ac_t""$objdir" 1>&6
4958
4959
4960 # Check whether --with-pic or --without-pic was given.
4961 if test "${with_pic+set}" = set; then
4962   withval="$with_pic"
4963   pic_mode="$withval"
4964 else
4965   pic_mode=default
4966 fi
4967
4968 test -z "$pic_mode" && pic_mode=default
4969
4970 # We assume here that the value for lt_cv_prog_cc_pic will not be cached
4971 # in isolation, and that seeing it set (from the cache) indicates that
4972 # the associated values are set (in the cache) correctly too.
4973 echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6
4974 echo "configure:4975: checking for $compiler option to produce PIC" >&5
4975 if eval "test \"\${lt_cv_prog_cc_pic+set}\" = set"; then
4976   echo $ac_n "(cached) $ac_c" 1>&6
4977 else
4978    lt_cv_prog_cc_pic=
4979   lt_cv_prog_cc_shlib=
4980   lt_cv_prog_cc_wl=
4981   lt_cv_prog_cc_static=
4982   lt_cv_prog_cc_no_builtin=
4983   lt_cv_prog_cc_can_build_shared=$can_build_shared
4984
4985   if test "$GCC" = yes; then
4986     lt_cv_prog_cc_wl='-Wl,'
4987     lt_cv_prog_cc_static='-static'
4988
4989     case $host_os in
4990     aix*)
4991       # Below there is a dirty hack to force normal static linking with -ldl
4992       # The problem is because libdl dynamically linked with both libc and
4993       # libC (AIX C++ library), which obviously doesn't included in libraries
4994       # list by gcc. This cause undefined symbols with -static flags.
4995       # This hack allows C programs to be linked with "-static -ldl", but
4996       # not sure about C++ programs.
4997       lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
4998       ;;
4999     amigaos*)
5000       # FIXME: we need at least 68020 code to build shared libraries, but
5001       # adding the `-m68020' flag to GCC prevents building anything better,
5002       # like `-m68040'.
5003       lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
5004       ;;
5005     beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
5006       # PIC is the default for these OSes.
5007       ;;
5008     darwin* | rhapsody*)
5009       # PIC is the default on this platform
5010       # Common symbols not allowed in MH_DYLIB files
5011       lt_cv_prog_cc_pic='-fno-common'
5012       ;;
5013     cygwin* | mingw* | pw32* | os2*)
5014       # This hack is so that the source file can tell whether it is being
5015       # built for inclusion in a dll (and should export symbols for example).
5016       lt_cv_prog_cc_pic='-DDLL_EXPORT'
5017       ;;
5018     sysv4*MP*)
5019       if test -d /usr/nec; then
5020          lt_cv_prog_cc_pic=-Kconform_pic
5021       fi
5022       ;;
5023     *)
5024       lt_cv_prog_cc_pic='-fPIC'
5025       ;;
5026     esac
5027   else
5028     # PORTME Check for PIC flags for the system compiler.
5029     case $host_os in
5030     aix3* | aix4* | aix5*)
5031       lt_cv_prog_cc_wl='-Wl,'
5032       # All AIX code is PIC.
5033       if test "$host_cpu" = ia64; then
5034         # AIX 5 now supports IA64 processor
5035         lt_cv_prog_cc_static='-Bstatic'
5036       else
5037         lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
5038       fi
5039       ;;
5040
5041     hpux9* | hpux10* | hpux11*)
5042       # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
5043       lt_cv_prog_cc_wl='-Wl,'
5044       lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
5045       lt_cv_prog_cc_pic='+Z'
5046       ;;
5047
5048     irix5* | irix6*)
5049       lt_cv_prog_cc_wl='-Wl,'
5050       lt_cv_prog_cc_static='-non_shared'
5051       # PIC (with -KPIC) is the default.
5052       ;;
5053
5054     cygwin* | mingw* | pw32* | os2*)
5055       # This hack is so that the source file can tell whether it is being
5056       # built for inclusion in a dll (and should export symbols for example).
5057       lt_cv_prog_cc_pic='-DDLL_EXPORT'
5058       ;;
5059
5060     newsos6)
5061       lt_cv_prog_cc_pic='-KPIC'
5062       lt_cv_prog_cc_static='-Bstatic'
5063       ;;
5064
5065     osf3* | osf4* | osf5*)
5066       # All OSF/1 code is PIC.
5067       lt_cv_prog_cc_wl='-Wl,'
5068       lt_cv_prog_cc_static='-non_shared'
5069       ;;
5070
5071     sco3.2v5*)
5072       lt_cv_prog_cc_pic='-Kpic'
5073       lt_cv_prog_cc_static='-dn'
5074       lt_cv_prog_cc_shlib='-belf'
5075       ;;
5076
5077     solaris*)
5078       lt_cv_prog_cc_pic='-KPIC'
5079       lt_cv_prog_cc_static='-Bstatic'
5080       lt_cv_prog_cc_wl='-Wl,'
5081       ;;
5082
5083     sunos4*)
5084       lt_cv_prog_cc_pic='-PIC'
5085       lt_cv_prog_cc_static='-Bstatic'
5086       lt_cv_prog_cc_wl='-Qoption ld '
5087       ;;
5088
5089     sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5090       lt_cv_prog_cc_pic='-KPIC'
5091       lt_cv_prog_cc_static='-Bstatic'
5092       if test "x$host_vendor" = xsni; then
5093         lt_cv_prog_cc_wl='-LD'
5094       else
5095         lt_cv_prog_cc_wl='-Wl,'
5096       fi
5097       ;;
5098
5099     uts4*)
5100       lt_cv_prog_cc_pic='-pic'
5101       lt_cv_prog_cc_static='-Bstatic'
5102       ;;
5103
5104     sysv4*MP*)
5105       if test -d /usr/nec ;then
5106         lt_cv_prog_cc_pic='-Kconform_pic'
5107         lt_cv_prog_cc_static='-Bstatic'
5108       fi
5109       ;;
5110
5111     *)
5112       lt_cv_prog_cc_can_build_shared=no
5113       ;;
5114     esac
5115   fi
5116
5117 fi
5118
5119 if test -z "$lt_cv_prog_cc_pic"; then
5120   echo "$ac_t""none" 1>&6
5121 else
5122   echo "$ac_t""$lt_cv_prog_cc_pic" 1>&6
5123
5124   # Check to make sure the pic_flag actually works.
5125   echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6
5126 echo "configure:5127: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
5127   if eval "test \"\${lt_cv_prog_cc_pic_works+set}\" = set"; then
5128   echo $ac_n "(cached) $ac_c" 1>&6
5129 else
5130       save_CFLAGS="$CFLAGS"
5131     CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
5132     cat > conftest.$ac_ext <<EOF
5133 #line 5134 "configure"
5134 #include "confdefs.h"
5135
5136 int main() {
5137
5138 ; return 0; }
5139 EOF
5140 if { (eval echo configure:5141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5141   rm -rf conftest*
5142         case $host_os in
5143       hpux9* | hpux10* | hpux11*)
5144         # On HP-UX, both CC and GCC only warn that PIC is supported... then
5145         # they create non-PIC objects.  So, if there were any warnings, we
5146         # assume that PIC is not supported.
5147         if test -s conftest.err; then
5148           lt_cv_prog_cc_pic_works=no
5149         else
5150           lt_cv_prog_cc_pic_works=yes
5151         fi
5152         ;;
5153       *)
5154         lt_cv_prog_cc_pic_works=yes
5155         ;;
5156       esac
5157     
5158 else
5159   echo "configure: failed program was:" >&5
5160   cat conftest.$ac_ext >&5
5161   rm -rf conftest*
5162         lt_cv_prog_cc_pic_works=no
5163     
5164 fi
5165 rm -f conftest*
5166     CFLAGS="$save_CFLAGS"
5167   
5168 fi
5169
5170
5171   if test "X$lt_cv_prog_cc_pic_works" = Xno; then
5172     lt_cv_prog_cc_pic=
5173     lt_cv_prog_cc_can_build_shared=no
5174   else
5175     lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
5176   fi
5177
5178   echo "$ac_t""$lt_cv_prog_cc_pic_works" 1>&6
5179 fi
5180
5181 # Check for any special shared library compilation flags.
5182 if test -n "$lt_cv_prog_cc_shlib"; then
5183   echo "configure: warning: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" 1>&2
5184   if echo "$old_CC $old_CFLAGS " | egrep -e "[  ]$lt_cv_prog_cc_shlib[  ]" >/dev/null; then :
5185   else
5186    echo "configure: warning: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2
5187     lt_cv_prog_cc_can_build_shared=no
5188   fi
5189 fi
5190
5191 echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6
5192 echo "configure:5193: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
5193 if eval "test \"\${lt_cv_prog_cc_static_works+set}\" = set"; then
5194   echo $ac_n "(cached) $ac_c" 1>&6
5195 else
5196     lt_cv_prog_cc_static_works=no
5197   save_LDFLAGS="$LDFLAGS"
5198   LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
5199   cat > conftest.$ac_ext <<EOF
5200 #line 5201 "configure"
5201 #include "confdefs.h"
5202
5203 int main() {
5204
5205 ; return 0; }
5206 EOF
5207 if { (eval echo configure:5208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5208   rm -rf conftest*
5209   lt_cv_prog_cc_static_works=yes
5210 else
5211   echo "configure: failed program was:" >&5
5212   cat conftest.$ac_ext >&5
5213 fi
5214 rm -f conftest*
5215   LDFLAGS="$save_LDFLAGS"
5216
5217 fi
5218
5219
5220 # Belt *and* braces to stop my trousers falling down:
5221 test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
5222 echo "$ac_t""$lt_cv_prog_cc_static_works" 1>&6
5223
5224 pic_flag="$lt_cv_prog_cc_pic"
5225 special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
5226 wl="$lt_cv_prog_cc_wl"
5227 link_static_flag="$lt_cv_prog_cc_static"
5228 no_builtin_flag="$lt_cv_prog_cc_no_builtin"
5229 can_build_shared="$lt_cv_prog_cc_can_build_shared"
5230
5231
5232 # Check to see if options -o and -c are simultaneously supported by compiler
5233 echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6
5234 echo "configure:5235: checking if $compiler supports -c -o file.$ac_objext" >&5
5235 if eval "test \"\${lt_cv_compiler_c_o+set}\" = set"; then
5236   echo $ac_n "(cached) $ac_c" 1>&6
5237 else
5238   
5239 $rm -r conftest 2>/dev/null
5240 mkdir conftest
5241 cd conftest
5242 echo "int some_variable = 0;" > conftest.$ac_ext
5243 mkdir out
5244 # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
5245 # that will create temporary files in the current directory regardless of
5246 # the output directory.  Thus, making CWD read-only will cause this test
5247 # to fail, enabling locking or at least warning the user not to do parallel
5248 # builds.
5249 chmod -w .
5250 save_CFLAGS="$CFLAGS"
5251 CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
5252 compiler_c_o=no
5253 if { (eval echo configure:5254: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
5254   # The compiler can only warn and ignore the option if not recognized
5255   # So say no if there are warnings
5256   if test -s out/conftest.err; then
5257     lt_cv_compiler_c_o=no
5258   else
5259     lt_cv_compiler_c_o=yes
5260   fi
5261 else
5262   # Append any errors to the config.log.
5263   cat out/conftest.err 1>&5
5264   lt_cv_compiler_c_o=no
5265 fi
5266 CFLAGS="$save_CFLAGS"
5267 chmod u+w .
5268 $rm conftest* out/*
5269 rmdir out
5270 cd ..
5271 rmdir conftest
5272 $rm -r conftest 2>/dev/null
5273
5274 fi
5275
5276 compiler_c_o=$lt_cv_compiler_c_o
5277 echo "$ac_t""$compiler_c_o" 1>&6
5278
5279 if test x"$compiler_c_o" = x"yes"; then
5280   # Check to see if we can write to a .lo
5281   echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6
5282 echo "configure:5283: checking if $compiler supports -c -o file.lo" >&5
5283   if eval "test \"\${lt_cv_compiler_o_lo+set}\" = set"; then
5284   echo $ac_n "(cached) $ac_c" 1>&6
5285 else
5286   
5287   lt_cv_compiler_o_lo=no
5288   save_CFLAGS="$CFLAGS"
5289   CFLAGS="$CFLAGS -c -o conftest.lo"
5290   save_objext="$ac_objext"
5291   ac_objext=lo
5292   cat > conftest.$ac_ext <<EOF
5293 #line 5294 "configure"
5294 #include "confdefs.h"
5295
5296 int main() {
5297 int some_variable = 0;
5298 ; return 0; }
5299 EOF
5300 if { (eval echo configure:5301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5301   rm -rf conftest*
5302       # The compiler can only warn and ignore the option if not recognized
5303     # So say no if there are warnings
5304     if test -s conftest.err; then
5305       lt_cv_compiler_o_lo=no
5306     else
5307       lt_cv_compiler_o_lo=yes
5308     fi
5309   
5310 else
5311   echo "configure: failed program was:" >&5
5312   cat conftest.$ac_ext >&5
5313 fi
5314 rm -f conftest*
5315   ac_objext="$save_objext"
5316   CFLAGS="$save_CFLAGS"
5317   
5318 fi
5319
5320   compiler_o_lo=$lt_cv_compiler_o_lo
5321   echo "$ac_t""$compiler_o_lo" 1>&6
5322 else
5323   compiler_o_lo=no
5324 fi
5325
5326 # Check to see if we can do hard links to lock some files if needed
5327 hard_links="nottested"
5328 if test "$compiler_c_o" = no && test "$need_locks" != no; then
5329   # do not overwrite the value of need_locks provided by the user
5330   echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6
5331 echo "configure:5332: checking if we can lock with hard links" >&5
5332   hard_links=yes
5333   $rm conftest*
5334   ln conftest.a conftest.b 2>/dev/null && hard_links=no
5335   touch conftest.a
5336   ln conftest.a conftest.b 2>&5 || hard_links=no
5337   ln conftest.a conftest.b 2>/dev/null && hard_links=no
5338   echo "$ac_t""$hard_links" 1>&6
5339   if test "$hard_links" = no; then
5340     echo "configure: warning: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" 1>&2
5341     need_locks=warn
5342   fi
5343 else
5344   need_locks=no
5345 fi
5346
5347 if test "$GCC" = yes; then
5348   # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
5349   echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6
5350 echo "configure:5351: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
5351   echo "int some_variable = 0;" > conftest.$ac_ext
5352   save_CFLAGS="$CFLAGS"
5353   CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
5354   compiler_rtti_exceptions=no
5355   cat > conftest.$ac_ext <<EOF
5356 #line 5357 "configure"
5357 #include "confdefs.h"
5358
5359 int main() {
5360 int some_variable = 0;
5361 ; return 0; }
5362 EOF
5363 if { (eval echo configure:5364: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5364   rm -rf conftest*
5365       # The compiler can only warn and ignore the option if not recognized
5366     # So say no if there are warnings
5367     if test -s conftest.err; then
5368       compiler_rtti_exceptions=no
5369     else
5370       compiler_rtti_exceptions=yes
5371     fi
5372   
5373 else
5374   echo "configure: failed program was:" >&5
5375   cat conftest.$ac_ext >&5
5376 fi
5377 rm -f conftest*
5378   CFLAGS="$save_CFLAGS"
5379   echo "$ac_t""$compiler_rtti_exceptions" 1>&6
5380
5381   if test "$compiler_rtti_exceptions" = "yes"; then
5382     no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
5383   else
5384     no_builtin_flag=' -fno-builtin'
5385   fi
5386 fi
5387
5388 # See if the linker supports building shared libraries.
5389 echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6
5390 echo "configure:5391: checking whether the linker ($LD) supports shared libraries" >&5
5391
5392 allow_undefined_flag=
5393 no_undefined_flag=
5394 need_lib_prefix=unknown
5395 need_version=unknown
5396 # when you set need_version to no, make sure it does not cause -set_version
5397 # flags to be left without arguments
5398 archive_cmds=
5399 archive_expsym_cmds=
5400 old_archive_from_new_cmds=
5401 old_archive_from_expsyms_cmds=
5402 export_dynamic_flag_spec=
5403 whole_archive_flag_spec=
5404 thread_safe_flag_spec=
5405 hardcode_into_libs=no
5406 hardcode_libdir_flag_spec=
5407 hardcode_libdir_separator=
5408 hardcode_direct=no
5409 hardcode_minus_L=no
5410 hardcode_shlibpath_var=unsupported
5411 runpath_var=
5412 link_all_deplibs=unknown
5413 always_export_symbols=no
5414 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
5415 # include_expsyms should be a list of space-separated symbols to be *always*
5416 # included in the symbol list
5417 include_expsyms=
5418 # exclude_expsyms can be an egrep regular expression of symbols to exclude
5419 # it will be wrapped by ` (' and `)$', so one must not match beginning or
5420 # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5421 # as well as any symbol that contains `d'.
5422 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
5423 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5424 # platforms (ab)use it in PIC code, but their linkers get confused if
5425 # the symbol is explicitly referenced.  Since portable code cannot
5426 # rely on this symbol name, it's probably fine to never include it in
5427 # preloaded symbol tables.
5428 extract_expsyms_cmds=
5429
5430 case $host_os in
5431 cygwin* | mingw* | pw32*)
5432   # FIXME: the MSVC++ port hasn't been tested in a loooong time
5433   # When not using gcc, we currently assume that we are using
5434   # Microsoft Visual C++.
5435   if test "$GCC" != yes; then
5436     with_gnu_ld=no
5437   fi
5438   ;;
5439 openbsd*)
5440   with_gnu_ld=no
5441   ;;
5442 esac
5443
5444 ld_shlibs=yes
5445 if test "$with_gnu_ld" = yes; then
5446   # If archive_cmds runs LD, not CC, wlarc should be empty
5447   wlarc='${wl}'
5448
5449   # See if GNU ld supports shared libraries.
5450   case $host_os in
5451   aix3* | aix4* | aix5*)
5452     # On AIX, the GNU linker is very broken
5453     # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
5454     ld_shlibs=no
5455     cat <<EOF 1>&2
5456
5457 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
5458 *** to be unable to reliably create shared libraries on AIX.
5459 *** Therefore, libtool is disabling shared libraries support.  If you
5460 *** really care for shared libraries, you may want to modify your PATH
5461 *** so that a non-GNU linker is found, and then restart.
5462
5463 EOF
5464     ;;
5465
5466   amigaos*)
5467     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)'
5468     hardcode_libdir_flag_spec='-L$libdir'
5469     hardcode_minus_L=yes
5470
5471     # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
5472     # that the semantics of dynamic libraries on AmigaOS, at least up
5473     # to version 4, is to share data among multiple programs linked
5474     # with the same dynamic library.  Since this doesn't match the
5475     # behavior of shared libraries on other platforms, we can use
5476     # them.
5477     ld_shlibs=no
5478     ;;
5479
5480   beos*)
5481     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5482       allow_undefined_flag=unsupported
5483       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5484       # support --undefined.  This deserves some investigation.  FIXME
5485       archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5486     else
5487       ld_shlibs=no
5488     fi
5489     ;;
5490
5491   cygwin* | mingw* | pw32*)
5492     # hardcode_libdir_flag_spec is actually meaningless, as there is
5493     # no search path for DLLs.
5494     hardcode_libdir_flag_spec='-L$libdir'
5495     allow_undefined_flag=unsupported
5496     always_export_symbols=yes
5497
5498     extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
5499       sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
5500       test -f $output_objdir/impgen.exe || (cd $output_objdir && \
5501       if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
5502       else $CC -o impgen impgen.c ; fi)~
5503       $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
5504
5505     old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
5506
5507     # cygwin and mingw dlls have different entry points and sets of symbols
5508     # to exclude.
5509     # FIXME: what about values for MSVC?
5510     dll_entry=__cygwin_dll_entry@12
5511     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
5512     case $host_os in
5513     mingw*)
5514       # mingw values
5515       dll_entry=_DllMainCRTStartup@12
5516       dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
5517       ;;
5518     esac
5519
5520     # mingw and cygwin differ, and it's simplest to just exclude the union
5521     # of the two symbol sets.
5522     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
5523
5524     # recent cygwin and mingw systems supply a stub DllMain which the user
5525     # can override, but on older systems we have to supply one (in ltdll.c)
5526     if test "x$lt_cv_need_dllmain" = "xyes"; then
5527       ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
5528       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~
5529         test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
5530     else
5531       ltdll_obj=
5532       ltdll_cmds=
5533     fi
5534
5535     # Extract the symbol export list from an `--export-all' def file,
5536     # then regenerate the def file from the symbol export list, so that
5537     # the compiled dll only exports the symbol export list.
5538     # Be careful not to strip the DATA tag left be newer dlltools.
5539     export_symbols_cmds="$ltdll_cmds"'
5540       $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
5541       sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
5542
5543     # If the export-symbols file already is a .def file (1st line
5544     # is EXPORTS), use it as is.
5545     # If DATA tags from a recent dlltool are present, honour them!
5546     archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
5547         cp $export_symbols $output_objdir/$soname-def;
5548       else
5549         echo EXPORTS > $output_objdir/$soname-def;
5550         _lt_hint=1;
5551         cat $export_symbols | while read symbol; do
5552          set dummy \$symbol;
5553          case \$# in
5554            2) echo "   \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
5555            *) echo "     \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
5556          esac;
5557          _lt_hint=`expr 1 + \$_lt_hint`;
5558         done;
5559       fi~
5560       '"$ltdll_cmds"'
5561       $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~
5562       $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~
5563       $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~
5564       $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~
5565       $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
5566     ;;
5567
5568   netbsd*)
5569     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5570       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5571       wlarc=
5572     else
5573       archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5574       archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5575     fi
5576     ;;
5577
5578   solaris* | sysv5*)
5579     if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
5580       ld_shlibs=no
5581       cat <<EOF 1>&2
5582
5583 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
5584 *** create shared libraries on Solaris systems.  Therefore, libtool
5585 *** is disabling shared libraries support.  We urge you to upgrade GNU
5586 *** binutils to release 2.9.1 or newer.  Another option is to modify
5587 *** your PATH or compiler configuration so that the native linker is
5588 *** used, and then restart.
5589
5590 EOF
5591     elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5592       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5593       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5594     else
5595       ld_shlibs=no
5596     fi
5597     ;;
5598
5599   sunos4*)
5600     archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5601     wlarc=
5602     hardcode_direct=yes
5603     hardcode_shlibpath_var=no
5604     ;;
5605
5606   *)
5607     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5608       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5609       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5610     else
5611       ld_shlibs=no
5612     fi
5613     ;;
5614   esac
5615
5616   if test "$ld_shlibs" = yes; then
5617     runpath_var=LD_RUN_PATH
5618     hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
5619     export_dynamic_flag_spec='${wl}--export-dynamic'
5620     case $host_os in
5621     cygwin* | mingw* | pw32*)
5622       # dlltool doesn't understand --whole-archive et. al.
5623       whole_archive_flag_spec=
5624       ;;
5625     *)
5626       # ancient GNU ld didn't support --whole-archive et. al.
5627       if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
5628         whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5629       else
5630         whole_archive_flag_spec=
5631       fi
5632       ;;
5633     esac
5634   fi
5635 else
5636   # PORTME fill in a description of your system's linker (not GNU ld)
5637   case $host_os in
5638   aix3*)
5639     allow_undefined_flag=unsupported
5640     always_export_symbols=yes
5641     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'
5642     # Note: this linker hardcodes the directories in LIBPATH if there
5643     # are no directories specified by -L.
5644     hardcode_minus_L=yes
5645     if test "$GCC" = yes && test -z "$link_static_flag"; then
5646       # Neither direct hardcoding nor static linking is supported with a
5647       # broken collect2.
5648       hardcode_direct=unsupported
5649     fi
5650     ;;
5651
5652   aix4* | aix5*)
5653     if test "$host_cpu" = ia64; then
5654       # On IA64, the linker does run time linking by default, so we don't
5655       # have to do anything special.
5656       aix_use_runtimelinking=no
5657       exp_sym_flag='-Bexport'
5658       no_entry_flag=""
5659     else
5660       aix_use_runtimelinking=no
5661
5662       # Test if we are trying to use run time linking or normal
5663       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5664       # need to do runtime linking.
5665       case $host_os in aix4.[23]|aix4.[23].*|aix5*)
5666         for ld_flag in $LDFLAGS; do
5667           if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
5668             aix_use_runtimelinking=yes
5669             break
5670           fi
5671         done
5672       esac
5673
5674       exp_sym_flag='-bexport'
5675       no_entry_flag='-bnoentry'
5676     fi
5677
5678     # When large executables or shared objects are built, AIX ld can
5679     # have problems creating the table of contents.  If linking a library
5680     # or program results in "error TOC overflow" add -mminimal-toc to
5681     # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5682     # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5683
5684     hardcode_direct=yes
5685     archive_cmds=''
5686     hardcode_libdir_separator=':'
5687     if test "$GCC" = yes; then
5688       case $host_os in aix4.[012]|aix4.[012].*)
5689         collect2name=`${CC} -print-prog-name=collect2`
5690         if test -f "$collect2name" && \
5691           strings "$collect2name" | grep resolve_lib_name >/dev/null
5692         then
5693           # We have reworked collect2
5694           hardcode_direct=yes
5695         else
5696           # We have old collect2
5697           hardcode_direct=unsupported
5698           # It fails to find uninstalled libraries when the uninstalled
5699           # path is not listed in the libpath.  Setting hardcode_minus_L
5700           # to unsupported forces relinking
5701           hardcode_minus_L=yes
5702           hardcode_libdir_flag_spec='-L$libdir'
5703           hardcode_libdir_separator=
5704         fi
5705       esac
5706
5707       shared_flag='-shared'
5708     else
5709       # not using gcc
5710       if test "$host_cpu" = ia64; then
5711         shared_flag='${wl}-G'
5712       else
5713         if test "$aix_use_runtimelinking" = yes; then
5714           shared_flag='${wl}-G'
5715         else
5716           shared_flag='${wl}-bM:SRE'
5717         fi
5718       fi
5719     fi
5720
5721     # It seems that -bexpall can do strange things, so it is better to
5722     # generate a list of symbols to export.
5723     always_export_symbols=yes
5724     if test "$aix_use_runtimelinking" = yes; then
5725       # Warning - without using the other runtime loading flags (-brtl),
5726       # -berok will link without error, but may produce a broken library.
5727       allow_undefined_flag='-berok'
5728       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
5729       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"
5730     else
5731       if test "$host_cpu" = ia64; then
5732         hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
5733         allow_undefined_flag="-z nodefs"
5734         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"
5735       else
5736         hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
5737         # Warning - without using the other run time loading flags,
5738         # -berok will link without error, but may produce a broken library.
5739         allow_undefined_flag='${wl}-berok'
5740         # This is a bit strange, but is similar to how AIX traditionally builds
5741         # it's shared libraries.
5742         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'
5743       fi
5744     fi
5745     ;;
5746
5747   amigaos*)
5748     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)'
5749     hardcode_libdir_flag_spec='-L$libdir'
5750     hardcode_minus_L=yes
5751     # see comment about different semantics on the GNU ld section
5752     ld_shlibs=no
5753     ;;
5754
5755   cygwin* | mingw* | pw32*)
5756     # When not using gcc, we currently assume that we are using
5757     # Microsoft Visual C++.
5758     # hardcode_libdir_flag_spec is actually meaningless, as there is
5759     # no search path for DLLs.
5760     hardcode_libdir_flag_spec=' '
5761     allow_undefined_flag=unsupported
5762     # Tell ltmain to make .lib files, not .a files.
5763     libext=lib
5764     # FIXME: Setting linknames here is a bad hack.
5765     archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
5766     # The linker will automatically build a .lib file if we build a DLL.
5767     old_archive_from_new_cmds='true'
5768     # FIXME: Should let the user specify the lib program.
5769     old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
5770     fix_srcfile_path='`cygpath -w "$srcfile"`'
5771     ;;
5772
5773   darwin* | rhapsody*)
5774     case "$host_os" in
5775     rhapsody* | darwin1.[012])
5776       allow_undefined_flag='-undefined suppress'
5777       ;;
5778     *) # Darwin 1.3 on
5779       allow_undefined_flag='-flat_namespace -undefined suppress'
5780       ;;
5781     esac
5782     # FIXME: Relying on posixy $() will cause problems for
5783     #        cross-compilation, but unfortunately the echo tests do not
5784     #        yet detect zsh echo's removal of \ escapes.
5785     archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring'
5786     # We need to add '_' to the symbols in $export_symbols first
5787     #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
5788     hardcode_direct=yes
5789     hardcode_shlibpath_var=no
5790     whole_archive_flag_spec='-all_load $convenience'
5791     ;;
5792
5793   freebsd1*)
5794     ld_shlibs=no
5795     ;;
5796
5797   # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5798   # support.  Future versions do this automatically, but an explicit c++rt0.o
5799   # does not break anything, and helps significantly (at the cost of a little
5800   # extra space).
5801   freebsd2.2*)
5802     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5803     hardcode_libdir_flag_spec='-R$libdir'
5804     hardcode_direct=yes
5805     hardcode_shlibpath_var=no
5806     ;;
5807
5808   # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5809   freebsd2*)
5810     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5811     hardcode_direct=yes
5812     hardcode_minus_L=yes
5813     hardcode_shlibpath_var=no
5814     ;;
5815
5816   # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5817   freebsd*)
5818     archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
5819     hardcode_libdir_flag_spec='-R$libdir'
5820     hardcode_direct=yes
5821     hardcode_shlibpath_var=no
5822     ;;
5823
5824   hpux9* | hpux10* | hpux11*)
5825     case $host_os in
5826     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' ;;
5827     *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
5828     esac
5829     hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
5830     hardcode_libdir_separator=:
5831     hardcode_direct=yes
5832     hardcode_minus_L=yes # Not in the search PATH, but as the default
5833                          # location of the library.
5834     export_dynamic_flag_spec='${wl}-E'
5835     ;;
5836
5837   irix5* | irix6*)
5838     if test "$GCC" = yes; then
5839       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'
5840     else
5841       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'
5842     fi
5843     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5844     hardcode_libdir_separator=:
5845     link_all_deplibs=yes
5846     ;;
5847
5848   netbsd*)
5849     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5850       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5851     else
5852       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5853     fi
5854     hardcode_libdir_flag_spec='-R$libdir'
5855     hardcode_direct=yes
5856     hardcode_shlibpath_var=no
5857     ;;
5858
5859   newsos6)
5860     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5861     hardcode_direct=yes
5862     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5863     hardcode_libdir_separator=:
5864     hardcode_shlibpath_var=no
5865     ;;
5866
5867   openbsd*)
5868     hardcode_direct=yes
5869     hardcode_shlibpath_var=no
5870     if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5871       archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
5872       hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
5873       export_dynamic_flag_spec='${wl}-E'
5874     else
5875       case "$host_os" in
5876       openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
5877         archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5878         hardcode_libdir_flag_spec='-R$libdir'
5879         ;;
5880       *)
5881         archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
5882         hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
5883         ;;
5884       esac
5885     fi
5886     ;;
5887
5888   os2*)
5889     hardcode_libdir_flag_spec='-L$libdir'
5890     hardcode_minus_L=yes
5891     allow_undefined_flag=unsupported
5892     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'
5893     old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
5894     ;;
5895
5896   osf3*)
5897     if test "$GCC" = yes; then
5898       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
5899       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'
5900     else
5901       allow_undefined_flag=' -expect_unresolved \*'
5902       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'
5903     fi
5904     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5905     hardcode_libdir_separator=:
5906     ;;
5907
5908   osf4* | osf5*)        # as osf3* with the addition of -msym flag
5909     if test "$GCC" = yes; then
5910       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
5911       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'
5912       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5913     else
5914       allow_undefined_flag=' -expect_unresolved \*'
5915       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'
5916       archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
5917       $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'
5918
5919       #Both c and cxx compiler support -rpath directly
5920       hardcode_libdir_flag_spec='-rpath $libdir'
5921     fi
5922     hardcode_libdir_separator=:
5923     ;;
5924
5925   sco3.2v5*)
5926     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5927     hardcode_shlibpath_var=no
5928     runpath_var=LD_RUN_PATH
5929     hardcode_runpath_var=yes
5930     export_dynamic_flag_spec='${wl}-Bexport'
5931     ;;
5932
5933   solaris*)
5934     # gcc --version < 3.0 without binutils cannot create self contained
5935     # shared libraries reliably, requiring libgcc.a to resolve some of
5936     # the object symbols generated in some cases.  Libraries that use
5937     # assert need libgcc.a to resolve __eprintf, for example.  Linking
5938     # a copy of libgcc.a into every shared library to guarantee resolving
5939     # such symbols causes other problems:  According to Tim Van Holder
5940     # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
5941     # (to the application) exception stack for one thing.
5942     no_undefined_flag=' -z defs'
5943     if test "$GCC" = yes; then
5944       case `$CC --version 2>/dev/null` in
5945       [12].*)
5946         cat <<EOF 1>&2
5947
5948 *** Warning: Releases of GCC earlier than version 3.0 cannot reliably
5949 *** create self contained shared libraries on Solaris systems, without
5950 *** introducing a dependency on libgcc.a.  Therefore, libtool is disabling
5951 *** -no-undefined support, which will at least allow you to build shared
5952 *** libraries.  However, you may find that when you link such libraries
5953 *** into an application without using GCC, you have to manually add
5954 *** \`gcc --print-libgcc-file-name\` to the link command.  We urge you to
5955 *** upgrade to a newer version of GCC.  Another option is to rebuild your
5956 *** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
5957
5958 EOF
5959         no_undefined_flag=
5960         ;;
5961       esac
5962     fi
5963     # $CC -shared without GNU ld will not create a library from C++
5964     # object files and a static libstdc++, better avoid it by now
5965     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
5966     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
5967                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
5968     hardcode_libdir_flag_spec='-R$libdir'
5969     hardcode_shlibpath_var=no
5970     case $host_os in
5971     solaris2.[0-5] | solaris2.[0-5].*) ;;
5972     *) # Supported since Solaris 2.6 (maybe 2.5.1?)
5973       whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
5974     esac
5975     link_all_deplibs=yes
5976     ;;
5977
5978   sunos4*)
5979     if test "x$host_vendor" = xsequent; then
5980       # Use $CC to link under sequent, because it throws in some extra .o
5981       # files that make .init and .fini sections work.
5982       archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5983     else
5984       archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5985     fi
5986     hardcode_libdir_flag_spec='-L$libdir'
5987     hardcode_direct=yes
5988     hardcode_minus_L=yes
5989     hardcode_shlibpath_var=no
5990     ;;
5991
5992   sysv4)
5993     if test "x$host_vendor" = xsno; then
5994       archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags'
5995       hardcode_direct=yes # is this really true???
5996     else
5997       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5998       hardcode_direct=no #Motorola manual says yes, but my tests say they lie
5999     fi
6000     runpath_var='LD_RUN_PATH'
6001     hardcode_shlibpath_var=no
6002     ;;
6003
6004   sysv4.3*)
6005     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6006     hardcode_shlibpath_var=no
6007     export_dynamic_flag_spec='-Bexport'
6008     ;;
6009
6010   sysv5*)
6011     no_undefined_flag=' -z text'
6012     # $CC -shared without GNU ld will not create a library from C++
6013     # object files and a static libstdc++, better avoid it by now
6014     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6015     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6016                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
6017     hardcode_libdir_flag_spec=
6018     hardcode_shlibpath_var=no
6019     runpath_var='LD_RUN_PATH'
6020     ;;
6021
6022   uts4*)
6023     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6024     hardcode_libdir_flag_spec='-L$libdir'
6025     hardcode_shlibpath_var=no
6026     ;;
6027
6028   dgux*)
6029     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6030     hardcode_libdir_flag_spec='-L$libdir'
6031     hardcode_shlibpath_var=no
6032     ;;
6033
6034   sysv4*MP*)
6035     if test -d /usr/nec; then
6036       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6037       hardcode_shlibpath_var=no
6038       runpath_var=LD_RUN_PATH
6039       hardcode_runpath_var=yes
6040       ld_shlibs=yes
6041     fi
6042     ;;
6043
6044   sysv4.2uw2*)
6045     archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6046     hardcode_direct=yes
6047     hardcode_minus_L=no
6048     hardcode_shlibpath_var=no
6049     hardcode_runpath_var=yes
6050     runpath_var=LD_RUN_PATH
6051     ;;
6052
6053   sysv5uw7* | unixware7*)
6054     no_undefined_flag='${wl}-z ${wl}text'
6055     if test "$GCC" = yes; then
6056       archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6057     else
6058       archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6059     fi
6060     runpath_var='LD_RUN_PATH'
6061     hardcode_shlibpath_var=no
6062     ;;
6063
6064   *)
6065     ld_shlibs=no
6066     ;;
6067   esac
6068 fi
6069 echo "$ac_t""$ld_shlibs" 1>&6
6070 test "$ld_shlibs" = no && can_build_shared=no
6071
6072 # Check hardcoding attributes.
6073 echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6
6074 echo "configure:6075: checking how to hardcode library paths into programs" >&5
6075 hardcode_action=
6076 if test -n "$hardcode_libdir_flag_spec" || \
6077    test -n "$runpath_var"; then
6078
6079   # We can hardcode non-existant directories.
6080   if test "$hardcode_direct" != no &&
6081      # If the only mechanism to avoid hardcoding is shlibpath_var, we
6082      # have to relink, otherwise we might link with an installed library
6083      # when we should be linking with a yet-to-be-installed one
6084      ## test "$hardcode_shlibpath_var" != no &&
6085      test "$hardcode_minus_L" != no; then
6086     # Linking always hardcodes the temporary library directory.
6087     hardcode_action=relink
6088   else
6089     # We can link without hardcoding, and we can hardcode nonexisting dirs.
6090     hardcode_action=immediate
6091   fi
6092 else
6093   # We cannot hardcode anything, or else we can only hardcode existing
6094   # directories.
6095   hardcode_action=unsupported
6096 fi
6097 echo "$ac_t""$hardcode_action" 1>&6
6098
6099 striplib=
6100 old_striplib=
6101 echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6
6102 echo "configure:6103: checking whether stripping libraries is possible" >&5
6103 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
6104   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
6105   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
6106   echo "$ac_t""yes" 1>&6
6107 else
6108   echo "$ac_t""no" 1>&6
6109 fi
6110
6111 reload_cmds='$LD$reload_flag -o $output$reload_objs'
6112 test -z "$deplibs_check_method" && deplibs_check_method=unknown
6113
6114 # PORTME Fill in your ld.so characteristics
6115 echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6
6116 echo "configure:6117: checking dynamic linker characteristics" >&5
6117 library_names_spec=
6118 libname_spec='lib$name'
6119 soname_spec=
6120 postinstall_cmds=
6121 postuninstall_cmds=
6122 finish_cmds=
6123 finish_eval=
6124 shlibpath_var=
6125 shlibpath_overrides_runpath=unknown
6126 version_type=none
6127 dynamic_linker="$host_os ld.so"
6128 sys_lib_dlsearch_path_spec="/lib /usr/lib"
6129 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
6130
6131 case $host_os in
6132 aix3*)
6133   version_type=linux
6134   library_names_spec='${libname}${release}.so$versuffix $libname.a'
6135   shlibpath_var=LIBPATH
6136
6137   # AIX has no versioning support, so we append a major version to the name.
6138   soname_spec='${libname}${release}.so$major'
6139   ;;
6140
6141 aix4* | aix5*)
6142   version_type=linux
6143   if test "$host_cpu" = ia64; then
6144     # AIX 5 supports IA64
6145     library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
6146     shlibpath_var=LD_LIBRARY_PATH
6147   else
6148     # With GCC up to 2.95.x, collect2 would create an import file
6149     # for dependence libraries.  The import file would start with
6150     # the line `#! .'.  This would cause the generated library to
6151     # depend on `.', always an invalid library.  This was fixed in
6152     # development snapshots of GCC prior to 3.0.
6153     case $host_os in
6154       aix4 | aix4.[01] | aix4.[01].*)
6155         if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
6156              echo ' yes '
6157              echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
6158           :
6159         else
6160           can_build_shared=no
6161         fi
6162         ;;
6163     esac
6164     # AIX (on Power*) has no versioning support, so currently we can
6165     # not hardcode correct soname into executable. Probably we can
6166     # add versioning support to collect2, so additional links can
6167     # be useful in future.
6168     if test "$aix_use_runtimelinking" = yes; then
6169       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
6170       # instead of lib<name>.a to let people know that these are not
6171       # typical AIX shared libraries.
6172       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6173     else
6174       # We preserve .a as extension for shared libraries through AIX4.2
6175       # and later when we are not doing run time linking.
6176       library_names_spec='${libname}${release}.a $libname.a'
6177       soname_spec='${libname}${release}.so$major'
6178     fi
6179     shlibpath_var=LIBPATH
6180   fi
6181   ;;
6182
6183 amigaos*)
6184   library_names_spec='$libname.ixlibrary $libname.a'
6185   # Create ${libname}_ixlibrary.a entries in /sys/libs.
6186   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'
6187   ;;
6188
6189 beos*)
6190   library_names_spec='${libname}.so'
6191   dynamic_linker="$host_os ld.so"
6192   shlibpath_var=LIBRARY_PATH
6193   ;;
6194
6195 bsdi4*)
6196   version_type=linux
6197   need_version=no
6198   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6199   soname_spec='${libname}${release}.so$major'
6200   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
6201   shlibpath_var=LD_LIBRARY_PATH
6202   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
6203   sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
6204   export_dynamic_flag_spec=-rdynamic
6205   # the default ld.so.conf also contains /usr/contrib/lib and
6206   # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
6207   # libtool to hard-code these into programs
6208   ;;
6209
6210 cygwin* | mingw* | pw32*)
6211   version_type=windows
6212   need_version=no
6213   need_lib_prefix=no
6214   case $GCC,$host_os in
6215   yes,cygwin*)
6216     library_names_spec='$libname.dll.a'
6217     soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
6218     postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
6219       dldir=$destdir/`dirname \$dlpath`~
6220       test -d \$dldir || mkdir -p \$dldir~
6221       $install_prog .libs/$dlname \$dldir/$dlname'
6222     postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
6223       dlpath=$dir/\$dldll~
6224        $rm \$dlpath'
6225     ;;
6226   yes,mingw*)
6227     library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
6228     sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
6229     ;;
6230   yes,pw32*)
6231     library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll'
6232     ;;
6233   *)
6234     library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
6235     ;;
6236   esac
6237   dynamic_linker='Win32 ld.exe'
6238   # FIXME: first we should search . and the directory the executable is in
6239   shlibpath_var=PATH
6240   ;;
6241
6242 darwin* | rhapsody*)
6243   dynamic_linker="$host_os dyld"
6244   version_type=darwin
6245   need_lib_prefix=no
6246   need_version=no
6247   # FIXME: Relying on posixy $() will cause problems for
6248   #        cross-compilation, but unfortunately the echo tests do not
6249   #        yet detect zsh echo's removal of \ escapes.
6250   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)'
6251   soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
6252   shlibpath_overrides_runpath=yes
6253   shlibpath_var=DYLD_LIBRARY_PATH
6254   ;;
6255
6256 freebsd1*)
6257   dynamic_linker=no
6258   ;;
6259
6260 freebsd*)
6261   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
6262   version_type=freebsd-$objformat
6263   case $version_type in
6264     freebsd-elf*)
6265       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
6266       need_version=no
6267       need_lib_prefix=no
6268       ;;
6269     freebsd-*)
6270       library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
6271       need_version=yes
6272       ;;
6273   esac
6274   shlibpath_var=LD_LIBRARY_PATH
6275   case $host_os in
6276   freebsd2*)
6277     shlibpath_overrides_runpath=yes
6278     ;;
6279   *)
6280     shlibpath_overrides_runpath=no
6281     hardcode_into_libs=yes
6282     ;;
6283   esac
6284   ;;
6285
6286 gnu*)
6287   version_type=linux
6288   need_lib_prefix=no
6289   need_version=no
6290   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
6291   soname_spec='${libname}${release}.so$major'
6292   shlibpath_var=LD_LIBRARY_PATH
6293   hardcode_into_libs=yes
6294   ;;
6295
6296 hpux9* | hpux10* | hpux11*)
6297   # Give a soname corresponding to the major version so that dld.sl refuses to
6298   # link against other versions.
6299   dynamic_linker="$host_os dld.sl"
6300   version_type=sunos
6301   need_lib_prefix=no
6302   need_version=no
6303   shlibpath_var=SHLIB_PATH
6304   shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
6305   library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
6306   soname_spec='${libname}${release}.sl$major'
6307   # HP-UX runs *really* slowly unless shared libraries are mode 555.
6308   postinstall_cmds='chmod 555 $lib'
6309   ;;
6310
6311 irix5* | irix6*)
6312   version_type=irix
6313   need_lib_prefix=no
6314   need_version=no
6315   soname_spec='${libname}${release}.so$major'
6316   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
6317   case $host_os in
6318   irix5*)
6319     libsuff= shlibsuff=
6320     ;;
6321   *)
6322     case $LD in # libtool.m4 will add one of these switches to LD
6323     *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
6324     *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
6325     *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
6326     *) libsuff= shlibsuff= libmagic=never-match;;
6327     esac
6328     ;;
6329   esac
6330   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
6331   shlibpath_overrides_runpath=no
6332   sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
6333   sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
6334   ;;
6335
6336 # No shared lib support for Linux oldld, aout, or coff.
6337 linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
6338   dynamic_linker=no
6339   ;;
6340
6341 # This must be Linux ELF.
6342 linux-gnu*)
6343   version_type=linux
6344   need_lib_prefix=no
6345   need_version=no
6346   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6347   soname_spec='${libname}${release}.so$major'
6348   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
6349   shlibpath_var=LD_LIBRARY_PATH
6350   shlibpath_overrides_runpath=no
6351   # This implies no fast_install, which is unacceptable.
6352   # Some rework will be needed to allow for fast_install
6353   # before this can be enabled.
6354   hardcode_into_libs=yes
6355
6356   # We used to test for /lib/ld.so.1 and disable shared libraries on
6357   # powerpc, because MkLinux only supported shared libraries with the
6358   # GNU dynamic linker.  Since this was broken with cross compilers,
6359   # most powerpc-linux boxes support dynamic linking these days and
6360   # people can always --disable-shared, the test was removed, and we
6361   # assume the GNU/Linux dynamic linker is in use.
6362   dynamic_linker='GNU/Linux ld.so'
6363   ;;
6364
6365 netbsd*)
6366   version_type=sunos
6367   need_lib_prefix=no
6368   need_version=no
6369   if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6370     library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6371     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6372     dynamic_linker='NetBSD (a.out) ld.so'
6373   else
6374     library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
6375     soname_spec='${libname}${release}.so$major'
6376     dynamic_linker='NetBSD ld.elf_so'
6377   fi
6378   shlibpath_var=LD_LIBRARY_PATH
6379   shlibpath_overrides_runpath=yes
6380   hardcode_into_libs=yes
6381   ;;
6382
6383 newsos6)
6384   version_type=linux
6385   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6386   shlibpath_var=LD_LIBRARY_PATH
6387   shlibpath_overrides_runpath=yes
6388   ;;
6389
6390 openbsd*)
6391   version_type=sunos
6392   need_lib_prefix=no
6393   need_version=no
6394   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6395     case "$host_os" in
6396     openbsd2.[89] | openbsd2.[89].*)
6397       shlibpath_overrides_runpath=no
6398       ;;
6399     *)
6400       shlibpath_overrides_runpath=yes
6401       ;;
6402     esac
6403   else
6404     shlibpath_overrides_runpath=yes
6405   fi
6406   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6407   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6408   shlibpath_var=LD_LIBRARY_PATH
6409   ;;
6410
6411 os2*)
6412   libname_spec='$name'
6413   need_lib_prefix=no
6414   library_names_spec='$libname.dll $libname.a'
6415   dynamic_linker='OS/2 ld.exe'
6416   shlibpath_var=LIBPATH
6417   ;;
6418
6419 osf3* | osf4* | osf5*)
6420   version_type=osf
6421   need_version=no
6422   soname_spec='${libname}${release}.so'
6423   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
6424   shlibpath_var=LD_LIBRARY_PATH
6425   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
6426   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
6427   ;;
6428
6429 sco3.2v5*)
6430   version_type=osf
6431   soname_spec='${libname}${release}.so$major'
6432   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6433   shlibpath_var=LD_LIBRARY_PATH
6434   ;;
6435
6436 solaris*)
6437   version_type=linux
6438   need_lib_prefix=no
6439   need_version=no
6440   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6441   soname_spec='${libname}${release}.so$major'
6442   shlibpath_var=LD_LIBRARY_PATH
6443   shlibpath_overrides_runpath=yes
6444   hardcode_into_libs=yes
6445   # ldd complains unless libraries are executable
6446   postinstall_cmds='chmod +x $lib'
6447   ;;
6448
6449 sunos4*)
6450   version_type=sunos
6451   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6452   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
6453   shlibpath_var=LD_LIBRARY_PATH
6454   shlibpath_overrides_runpath=yes
6455   if test "$with_gnu_ld" = yes; then
6456     need_lib_prefix=no
6457   fi
6458   need_version=yes
6459   ;;
6460
6461 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6462   version_type=linux
6463   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6464   soname_spec='${libname}${release}.so$major'
6465   shlibpath_var=LD_LIBRARY_PATH
6466   case $host_vendor in
6467     sni)
6468       shlibpath_overrides_runpath=no
6469       ;;
6470     motorola)
6471       need_lib_prefix=no
6472       need_version=no
6473       shlibpath_overrides_runpath=no
6474       sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
6475       ;;
6476   esac
6477   ;;
6478
6479 uts4*)
6480   version_type=linux
6481   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6482   soname_spec='${libname}${release}.so$major'
6483   shlibpath_var=LD_LIBRARY_PATH
6484   ;;
6485
6486 dgux*)
6487   version_type=linux
6488   need_lib_prefix=no
6489   need_version=no
6490   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6491   soname_spec='${libname}${release}.so$major'
6492   shlibpath_var=LD_LIBRARY_PATH
6493   ;;
6494
6495 sysv4*MP*)
6496   if test -d /usr/nec ;then
6497     version_type=linux
6498     library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
6499     soname_spec='$libname.so.$major'
6500     shlibpath_var=LD_LIBRARY_PATH
6501   fi
6502   ;;
6503
6504 *)
6505   dynamic_linker=no
6506   ;;
6507 esac
6508 echo "$ac_t""$dynamic_linker" 1>&6
6509 test "$dynamic_linker" = no && can_build_shared=no
6510
6511 # Report the final consequences.
6512 echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6
6513 echo "configure:6514: checking if libtool supports shared libraries" >&5
6514 echo "$ac_t""$can_build_shared" 1>&6
6515
6516 echo $ac_n "checking whether to build shared libraries""... $ac_c" 1>&6
6517 echo "configure:6518: checking whether to build shared libraries" >&5
6518 test "$can_build_shared" = "no" && enable_shared=no
6519
6520 # On AIX, shared libraries and static libraries use the same namespace, and
6521 # are all built from PIC.
6522 case "$host_os" in
6523 aix3*)
6524   test "$enable_shared" = yes && enable_static=no
6525   if test -n "$RANLIB"; then
6526     archive_cmds="$archive_cmds~\$RANLIB \$lib"
6527     postinstall_cmds='$RANLIB $lib'
6528   fi
6529   ;;
6530
6531 aix4*)
6532   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6533     test "$enable_shared" = yes && enable_static=no
6534   fi
6535   ;;
6536 esac
6537 echo "$ac_t""$enable_shared" 1>&6
6538
6539 echo $ac_n "checking whether to build static libraries""... $ac_c" 1>&6
6540 echo "configure:6541: checking whether to build static libraries" >&5
6541 # Make sure either enable_shared or enable_static is yes.
6542 test "$enable_shared" = yes || enable_static=yes
6543 echo "$ac_t""$enable_static" 1>&6
6544
6545 if test "$hardcode_action" = relink; then
6546   # Fast installation is not supported
6547   enable_fast_install=no
6548 elif test "$shlibpath_overrides_runpath" = yes ||
6549      test "$enable_shared" = no; then
6550   # Fast installation is not necessary
6551   enable_fast_install=needless
6552 fi
6553
6554 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
6555 if test "$GCC" = yes; then
6556   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
6557 fi
6558
6559 if test "x$enable_dlopen" != xyes; then
6560   enable_dlopen=unknown
6561   enable_dlopen_self=unknown
6562   enable_dlopen_self_static=unknown
6563 else
6564   lt_cv_dlopen=no
6565   lt_cv_dlopen_libs=
6566
6567   case $host_os in
6568   beos*)
6569     lt_cv_dlopen="load_add_on"
6570     lt_cv_dlopen_libs=
6571     lt_cv_dlopen_self=yes
6572     ;;
6573
6574   cygwin* | mingw* | pw32*)
6575     lt_cv_dlopen="LoadLibrary"
6576     lt_cv_dlopen_libs=
6577    ;;
6578
6579   *)
6580     echo $ac_n "checking for shl_load""... $ac_c" 1>&6
6581 echo "configure:6582: checking for shl_load" >&5
6582 if eval "test \"\${ac_cv_func_shl_load+set}\" = set"; then
6583   echo $ac_n "(cached) $ac_c" 1>&6
6584 else
6585   cat > conftest.$ac_ext <<EOF
6586 #line 6587 "configure"
6587 #include "confdefs.h"
6588 /* System header to define __stub macros and hopefully few prototypes,
6589     which can conflict with char shl_load(); below.  */
6590 #include <assert.h>
6591 /* Override any gcc2 internal prototype to avoid an error.  */
6592 /* We use char because int might match the return type of a gcc2
6593     builtin and then its argument prototype would still apply.  */
6594 char shl_load();
6595 char (*f)();
6596
6597 int main() {
6598
6599 /* The GNU C library defines this for functions which it implements
6600     to always fail with ENOSYS.  Some functions are actually named
6601     something starting with __ and the normal name is an alias.  */
6602 #if defined (__stub_shl_load) || defined (__stub___shl_load)
6603 choke me
6604 #else
6605 f = shl_load;
6606 #endif
6607
6608 ; return 0; }
6609 EOF
6610 if { (eval echo configure:6611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6611   rm -rf conftest*
6612   eval "ac_cv_func_shl_load=yes"
6613 else
6614   echo "configure: failed program was:" >&5
6615   cat conftest.$ac_ext >&5
6616   rm -rf conftest*
6617   eval "ac_cv_func_shl_load=no"
6618 fi
6619 rm -f conftest*
6620 fi
6621
6622 if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
6623   echo "$ac_t""yes" 1>&6
6624   lt_cv_dlopen="shl_load"
6625 else
6626   echo "$ac_t""no" 1>&6
6627 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
6628 echo "configure:6629: checking for shl_load in -ldld" >&5
6629 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-:%__p__%'`
6630 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6631   echo $ac_n "(cached) $ac_c" 1>&6
6632 else
6633   ac_save_LIBS="$LIBS"
6634 LIBS="-ldld  $LIBS"
6635 cat > conftest.$ac_ext <<EOF
6636 #line 6637 "configure"
6637 #include "confdefs.h"
6638 /* Override any gcc2 internal prototype to avoid an error.  */
6639 /* We use char because int might match the return type of a gcc2
6640     builtin and then its argument prototype would still apply.  */
6641 char shl_load();
6642
6643 int main() {
6644 shl_load()
6645 ; return 0; }
6646 EOF
6647 if { (eval echo configure:6648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6648   rm -rf conftest*
6649   eval "ac_cv_lib_$ac_lib_var=yes"
6650 else
6651   echo "configure: failed program was:" >&5
6652   cat conftest.$ac_ext >&5
6653   rm -rf conftest*
6654   eval "ac_cv_lib_$ac_lib_var=no"
6655 fi
6656 rm -f conftest*
6657 LIBS="$ac_save_LIBS"
6658
6659 fi
6660 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6661   echo "$ac_t""yes" 1>&6
6662   lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
6663 else
6664   echo "$ac_t""no" 1>&6
6665 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
6666 echo "configure:6667: checking for dlopen" >&5
6667 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
6668   echo $ac_n "(cached) $ac_c" 1>&6
6669 else
6670   cat > conftest.$ac_ext <<EOF
6671 #line 6672 "configure"
6672 #include "confdefs.h"
6673 /* System header to define __stub macros and hopefully few prototypes,
6674     which can conflict with char dlopen(); below.  */
6675 #include <assert.h>
6676 /* Override any gcc2 internal prototype to avoid an error.  */
6677 /* We use char because int might match the return type of a gcc2
6678     builtin and then its argument prototype would still apply.  */
6679 char dlopen();
6680 char (*f)();
6681
6682 int main() {
6683
6684 /* The GNU C library defines this for functions which it implements
6685     to always fail with ENOSYS.  Some functions are actually named
6686     something starting with __ and the normal name is an alias.  */
6687 #if defined (__stub_dlopen) || defined (__stub___dlopen)
6688 choke me
6689 #else
6690 f = dlopen;
6691 #endif
6692
6693 ; return 0; }
6694 EOF
6695 if { (eval echo configure:6696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6696   rm -rf conftest*
6697   eval "ac_cv_func_dlopen=yes"
6698 else
6699   echo "configure: failed program was:" >&5
6700   cat conftest.$ac_ext >&5
6701   rm -rf conftest*
6702   eval "ac_cv_func_dlopen=no"
6703 fi
6704 rm -f conftest*
6705 fi
6706
6707 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
6708   echo "$ac_t""yes" 1>&6
6709   lt_cv_dlopen="dlopen"
6710 else
6711   echo "$ac_t""no" 1>&6
6712 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
6713 echo "configure:6714: checking for dlopen in -ldl" >&5
6714 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
6715 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6716   echo $ac_n "(cached) $ac_c" 1>&6
6717 else
6718   ac_save_LIBS="$LIBS"
6719 LIBS="-ldl  $LIBS"
6720 cat > conftest.$ac_ext <<EOF
6721 #line 6722 "configure"
6722 #include "confdefs.h"
6723 /* Override any gcc2 internal prototype to avoid an error.  */
6724 /* We use char because int might match the return type of a gcc2
6725     builtin and then its argument prototype would still apply.  */
6726 char dlopen();
6727
6728 int main() {
6729 dlopen()
6730 ; return 0; }
6731 EOF
6732 if { (eval echo configure:6733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6733   rm -rf conftest*
6734   eval "ac_cv_lib_$ac_lib_var=yes"
6735 else
6736   echo "configure: failed program was:" >&5
6737   cat conftest.$ac_ext >&5
6738   rm -rf conftest*
6739   eval "ac_cv_lib_$ac_lib_var=no"
6740 fi
6741 rm -f conftest*
6742 LIBS="$ac_save_LIBS"
6743
6744 fi
6745 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6746   echo "$ac_t""yes" 1>&6
6747   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
6748 else
6749   echo "$ac_t""no" 1>&6
6750 echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
6751 echo "configure:6752: checking for dlopen in -lsvld" >&5
6752 ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-:%__p__%'`
6753 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6754   echo $ac_n "(cached) $ac_c" 1>&6
6755 else
6756   ac_save_LIBS="$LIBS"
6757 LIBS="-lsvld  $LIBS"
6758 cat > conftest.$ac_ext <<EOF
6759 #line 6760 "configure"
6760 #include "confdefs.h"
6761 /* Override any gcc2 internal prototype to avoid an error.  */
6762 /* We use char because int might match the return type of a gcc2
6763     builtin and then its argument prototype would still apply.  */
6764 char dlopen();
6765
6766 int main() {
6767 dlopen()
6768 ; return 0; }
6769 EOF
6770 if { (eval echo configure:6771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6771   rm -rf conftest*
6772   eval "ac_cv_lib_$ac_lib_var=yes"
6773 else
6774   echo "configure: failed program was:" >&5
6775   cat conftest.$ac_ext >&5
6776   rm -rf conftest*
6777   eval "ac_cv_lib_$ac_lib_var=no"
6778 fi
6779 rm -f conftest*
6780 LIBS="$ac_save_LIBS"
6781
6782 fi
6783 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6784   echo "$ac_t""yes" 1>&6
6785   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
6786 else
6787   echo "$ac_t""no" 1>&6
6788 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
6789 echo "configure:6790: checking for dld_link in -ldld" >&5
6790 ac_lib_var=`echo dld'_'dld_link | 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 dld_link();
6803
6804 int main() {
6805 dld_link()
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="dld_link" lt_cv_dlopen_libs="-dld"
6824 else
6825   echo "$ac_t""no" 1>&6
6826 fi
6827
6828               
6829 fi
6830
6831             
6832 fi
6833
6834           
6835 fi
6836
6837         
6838 fi
6839
6840       
6841 fi
6842
6843     ;;
6844   esac
6845
6846   if test "x$lt_cv_dlopen" != xno; then
6847     enable_dlopen=yes
6848   else
6849     enable_dlopen=no
6850   fi
6851
6852   case $lt_cv_dlopen in
6853   dlopen)
6854     save_CPPFLAGS="$CPPFLAGS"
6855         test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
6856
6857     save_LDFLAGS="$LDFLAGS"
6858     eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
6859
6860     save_LIBS="$LIBS"
6861     LIBS="$lt_cv_dlopen_libs $LIBS"
6862
6863     echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
6864 echo "configure:6865: checking whether a program can dlopen itself" >&5
6865 if eval "test \"\${lt_cv_dlopen_self+set}\" = set"; then
6866   echo $ac_n "(cached) $ac_c" 1>&6
6867 else
6868           if test "$cross_compiling" = yes; then :
6869   lt_cv_dlopen_self=cross
6870 else
6871     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
6872   lt_status=$lt_dlunknown
6873   cat > conftest.$ac_ext <<EOF
6874 #line 6875 "configure"
6875 #include "confdefs.h"
6876
6877 #if HAVE_DLFCN_H
6878 #include <dlfcn.h>
6879 #endif
6880
6881 #include <stdio.h>
6882
6883 #ifdef RTLD_GLOBAL
6884 #  define LT_DLGLOBAL           RTLD_GLOBAL
6885 #else
6886 #  ifdef DL_GLOBAL
6887 #    define LT_DLGLOBAL         DL_GLOBAL
6888 #  else
6889 #    define LT_DLGLOBAL         0
6890 #  endif
6891 #endif
6892
6893 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
6894    find out it does not work in some platform. */
6895 #ifndef LT_DLLAZY_OR_NOW
6896 #  ifdef RTLD_LAZY
6897 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
6898 #  else
6899 #    ifdef DL_LAZY
6900 #      define LT_DLLAZY_OR_NOW          DL_LAZY
6901 #    else
6902 #      ifdef RTLD_NOW
6903 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
6904 #      else
6905 #        ifdef DL_NOW
6906 #          define LT_DLLAZY_OR_NOW      DL_NOW
6907 #        else
6908 #          define LT_DLLAZY_OR_NOW      0
6909 #        endif
6910 #      endif
6911 #    endif
6912 #  endif
6913 #endif
6914
6915 #ifdef __cplusplus
6916 extern "C" void exit (int);
6917 #endif
6918
6919 void fnord() { int i=42;}
6920 int main ()
6921 {
6922   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
6923   int status = $lt_dlunknown;
6924
6925   if (self)
6926     {
6927       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
6928       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
6929       /* dlclose (self); */
6930     }
6931
6932     exit (status);
6933 }
6934 EOF
6935   if { (eval echo configure:6936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
6936     (./conftest; exit; ) 2>/dev/null
6937     lt_status=$?
6938     case x$lt_status in
6939       x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
6940       x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
6941       x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
6942     esac
6943   else :
6944     # compilation failed
6945     lt_cv_dlopen_self=no
6946   fi
6947 fi
6948 rm -fr conftest*
6949
6950     
6951 fi
6952
6953 echo "$ac_t""$lt_cv_dlopen_self" 1>&6
6954
6955     if test "x$lt_cv_dlopen_self" = xyes; then
6956       LDFLAGS="$LDFLAGS $link_static_flag"
6957       echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
6958 echo "configure:6959: checking whether a statically linked program can dlopen itself" >&5
6959 if eval "test \"\${lt_cv_dlopen_self_static+set}\" = set"; then
6960   echo $ac_n "(cached) $ac_c" 1>&6
6961 else
6962           if test "$cross_compiling" = yes; then :
6963   lt_cv_dlopen_self_static=cross
6964 else
6965     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
6966   lt_status=$lt_dlunknown
6967   cat > conftest.$ac_ext <<EOF
6968 #line 6969 "configure"
6969 #include "confdefs.h"
6970
6971 #if HAVE_DLFCN_H
6972 #include <dlfcn.h>
6973 #endif
6974
6975 #include <stdio.h>
6976
6977 #ifdef RTLD_GLOBAL
6978 #  define LT_DLGLOBAL           RTLD_GLOBAL
6979 #else
6980 #  ifdef DL_GLOBAL
6981 #    define LT_DLGLOBAL         DL_GLOBAL
6982 #  else
6983 #    define LT_DLGLOBAL         0
6984 #  endif
6985 #endif
6986
6987 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
6988    find out it does not work in some platform. */
6989 #ifndef LT_DLLAZY_OR_NOW
6990 #  ifdef RTLD_LAZY
6991 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
6992 #  else
6993 #    ifdef DL_LAZY
6994 #      define LT_DLLAZY_OR_NOW          DL_LAZY
6995 #    else
6996 #      ifdef RTLD_NOW
6997 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
6998 #      else
6999 #        ifdef DL_NOW
7000 #          define LT_DLLAZY_OR_NOW      DL_NOW
7001 #        else
7002 #          define LT_DLLAZY_OR_NOW      0
7003 #        endif
7004 #      endif
7005 #    endif
7006 #  endif
7007 #endif
7008
7009 #ifdef __cplusplus
7010 extern "C" void exit (int);
7011 #endif
7012
7013 void fnord() { int i=42;}
7014 int main ()
7015 {
7016   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
7017   int status = $lt_dlunknown;
7018
7019   if (self)
7020     {
7021       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
7022       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
7023       /* dlclose (self); */
7024     }
7025
7026     exit (status);
7027 }
7028 EOF
7029   if { (eval echo configure:7030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
7030     (./conftest; exit; ) 2>/dev/null
7031     lt_status=$?
7032     case x$lt_status in
7033       x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
7034       x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
7035       x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
7036     esac
7037   else :
7038     # compilation failed
7039     lt_cv_dlopen_self_static=no
7040   fi
7041 fi
7042 rm -fr conftest*
7043
7044       
7045 fi
7046
7047 echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
7048     fi
7049
7050     CPPFLAGS="$save_CPPFLAGS"
7051     LDFLAGS="$save_LDFLAGS"
7052     LIBS="$save_LIBS"
7053     ;;
7054   esac
7055
7056   case $lt_cv_dlopen_self in
7057   yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
7058   *) enable_dlopen_self=unknown ;;
7059   esac
7060
7061   case $lt_cv_dlopen_self_static in
7062   yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
7063   *) enable_dlopen_self_static=unknown ;;
7064   esac
7065 fi
7066
7067
7068 if test "$enable_shared" = yes && test "$GCC" = yes; then
7069   case $archive_cmds in
7070   *'~'*)
7071     # FIXME: we may have to deal with multi-command sequences.
7072     ;;
7073   '$CC '*)
7074     # Test whether the compiler implicitly links with -lc since on some
7075     # systems, -lgcc has to come before -lc. If gcc already passes -lc
7076     # to ld, don't add -lc before -lgcc.
7077     echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6
7078 echo "configure:7079: checking whether -lc should be explicitly linked in" >&5
7079     if eval "test \"\${lt_cv_archive_cmds_need_lc+set}\" = set"; then
7080   echo $ac_n "(cached) $ac_c" 1>&6
7081 else
7082   $rm conftest*
7083     echo 'static int dummy;' > conftest.$ac_ext
7084
7085     if { (eval echo configure:7086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7086       soname=conftest
7087       lib=conftest
7088       libobjs=conftest.$ac_objext
7089       deplibs=
7090       wl=$lt_cv_prog_cc_wl
7091       compiler_flags=-v
7092       linker_flags=-v
7093       verstring=
7094       output_objdir=.
7095       libname=conftest
7096       save_allow_undefined_flag=$allow_undefined_flag
7097       allow_undefined_flag=
7098       if { (eval echo configure:7099: \"$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; }
7099       then
7100         lt_cv_archive_cmds_need_lc=no
7101       else
7102         lt_cv_archive_cmds_need_lc=yes
7103       fi
7104       allow_undefined_flag=$save_allow_undefined_flag
7105     else
7106       cat conftest.err 1>&5
7107     fi
7108 fi
7109
7110     echo "$ac_t""$lt_cv_archive_cmds_need_lc" 1>&6
7111     ;;
7112   esac
7113 fi
7114 need_lc=${lt_cv_archive_cmds_need_lc-yes}
7115
7116 # The second clause should only fire when bootstrapping the
7117 # libtool distribution, otherwise you forgot to ship ltmain.sh
7118 # with your package, and you will get complaints that there are
7119 # no rules to generate ltmain.sh.
7120 if test -f "$ltmain"; then
7121   :
7122 else
7123   # If there is no Makefile yet, we rely on a make rule to execute
7124   # `config.status --recheck' to rerun these tests and create the
7125   # libtool script then.
7126   test -f Makefile && make "$ltmain"
7127 fi
7128
7129 if test -f "$ltmain"; then
7130   trap "$rm \"${ofile}T\"; exit 1" 1 2 15
7131   $rm -f "${ofile}T"
7132
7133   echo creating $ofile
7134
7135   # Now quote all the things that may contain metacharacters while being
7136   # careful not to overquote the AC_SUBSTed values.  We take copies of the
7137   # variables and quote the copies for generation of the libtool script.
7138   for var in echo old_CC old_CFLAGS \
7139     AR AR_FLAGS CC LD LN_S NM SHELL \
7140     reload_flag reload_cmds wl \
7141     pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
7142     thread_safe_flag_spec whole_archive_flag_spec libname_spec \
7143     library_names_spec soname_spec \
7144     RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
7145     old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
7146     postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
7147     old_striplib striplib file_magic_cmd export_symbols_cmds \
7148     deplibs_check_method allow_undefined_flag no_undefined_flag \
7149     finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
7150     global_symbol_to_c_name_address \
7151     hardcode_libdir_flag_spec hardcode_libdir_separator  \
7152     sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
7153     compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
7154
7155     case $var in
7156     reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
7157     old_postinstall_cmds | old_postuninstall_cmds | \
7158     export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
7159     extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
7160     postinstall_cmds | postuninstall_cmds | \
7161     finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
7162       # Double-quote double-evaled strings.
7163       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
7164       ;;
7165     *)
7166       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
7167       ;;
7168     esac
7169   done
7170
7171   cat <<__EOF__ > "${ofile}T"
7172 #! $SHELL
7173
7174 # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
7175 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
7176 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
7177 #
7178 # Copyright (C) 1996-2000 Free Software Foundation, Inc.
7179 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7180 #
7181 # This program is free software; you can redistribute it and/or modify
7182 # it under the terms of the GNU General Public License as published by
7183 # the Free Software Foundation; either version 2 of the License, or
7184 # (at your option) any later version.
7185 #
7186 # This program is distributed in the hope that it will be useful, but
7187 # WITHOUT ANY WARRANTY; without even the implied warranty of
7188 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
7189 # General Public License for more details.
7190 #
7191 # You should have received a copy of the GNU General Public License
7192 # along with this program; if not, write to the Free Software
7193 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
7194 #
7195 # As a special exception to the GNU General Public License, if you
7196 # distribute this file as part of a program that contains a
7197 # configuration script generated by Autoconf, you may include it under
7198 # the same distribution terms that you use for the rest of that program.
7199
7200 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
7201 Xsed="sed -e s/^X//"
7202
7203 # The HP-UX ksh and POSIX shell print the target directory to stdout
7204 # if CDPATH is set.
7205 if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
7206
7207 # ### BEGIN LIBTOOL CONFIG
7208
7209 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
7210
7211 # Shell to use when invoking shell scripts.
7212 SHELL=$lt_SHELL
7213
7214 # Whether or not to build shared libraries.
7215 build_libtool_libs=$enable_shared
7216
7217 # Whether or not to build static libraries.
7218 build_old_libs=$enable_static
7219
7220 # Whether or not to add -lc for building shared libraries.
7221 build_libtool_need_lc=$need_lc
7222
7223 # Whether or not to optimize for fast installation.
7224 fast_install=$enable_fast_install
7225
7226 # The host system.
7227 host_alias=$host_alias
7228 host=$host
7229
7230 # An echo program that does not interpret backslashes.
7231 echo=$lt_echo
7232
7233 # The archiver.
7234 AR=$lt_AR
7235 AR_FLAGS=$lt_AR_FLAGS
7236
7237 # The default C compiler.
7238 CC=$lt_CC
7239
7240 # Is the compiler the GNU C compiler?
7241 with_gcc=$GCC
7242
7243 # The linker used to build libraries.
7244 LD=$lt_LD
7245
7246 # Whether we need hard or soft links.
7247 LN_S=$lt_LN_S
7248
7249 # A BSD-compatible nm program.
7250 NM=$lt_NM
7251
7252 # A symbol stripping program
7253 STRIP=$STRIP
7254
7255 # Used to examine libraries when file_magic_cmd begins "file"
7256 MAGIC_CMD=$MAGIC_CMD
7257
7258 # Used on cygwin: DLL creation program.
7259 DLLTOOL="$DLLTOOL"
7260
7261 # Used on cygwin: object dumper.
7262 OBJDUMP="$OBJDUMP"
7263
7264 # Used on cygwin: assembler.
7265 AS="$AS"
7266
7267 # The name of the directory that contains temporary libtool files.
7268 objdir=$objdir
7269
7270 # How to create reloadable object files.
7271 reload_flag=$lt_reload_flag
7272 reload_cmds=$lt_reload_cmds
7273
7274 # How to pass a linker flag through the compiler.
7275 wl=$lt_wl
7276
7277 # Object file suffix (normally "o").
7278 objext="$ac_objext"
7279
7280 # Old archive suffix (normally "a").
7281 libext="$libext"
7282
7283 # Executable file suffix (normally "").
7284 exeext="$exeext"
7285
7286 # Additional compiler flags for building library objects.
7287 pic_flag=$lt_pic_flag
7288 pic_mode=$pic_mode
7289
7290 # Does compiler simultaneously support -c and -o options?
7291 compiler_c_o=$lt_compiler_c_o
7292
7293 # Can we write directly to a .lo ?
7294 compiler_o_lo=$lt_compiler_o_lo
7295
7296 # Must we lock files when doing compilation ?
7297 need_locks=$lt_need_locks
7298
7299 # Do we need the lib prefix for modules?
7300 need_lib_prefix=$need_lib_prefix
7301
7302 # Do we need a version for libraries?
7303 need_version=$need_version
7304
7305 # Whether dlopen is supported.
7306 dlopen_support=$enable_dlopen
7307
7308 # Whether dlopen of programs is supported.
7309 dlopen_self=$enable_dlopen_self
7310
7311 # Whether dlopen of statically linked programs is supported.
7312 dlopen_self_static=$enable_dlopen_self_static
7313
7314 # Compiler flag to prevent dynamic linking.
7315 link_static_flag=$lt_link_static_flag
7316
7317 # Compiler flag to turn off builtin functions.
7318 no_builtin_flag=$lt_no_builtin_flag
7319
7320 # Compiler flag to allow reflexive dlopens.
7321 export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
7322
7323 # Compiler flag to generate shared objects directly from archives.
7324 whole_archive_flag_spec=$lt_whole_archive_flag_spec
7325
7326 # Compiler flag to generate thread-safe objects.
7327 thread_safe_flag_spec=$lt_thread_safe_flag_spec
7328
7329 # Library versioning type.
7330 version_type=$version_type
7331
7332 # Format of library name prefix.
7333 libname_spec=$lt_libname_spec
7334
7335 # List of archive names.  First name is the real one, the rest are links.
7336 # The last name is the one that the linker finds with -lNAME.
7337 library_names_spec=$lt_library_names_spec
7338
7339 # The coded name of the library, if different from the real name.
7340 soname_spec=$lt_soname_spec
7341
7342 # Commands used to build and install an old-style archive.
7343 RANLIB=$lt_RANLIB
7344 old_archive_cmds=$lt_old_archive_cmds
7345 old_postinstall_cmds=$lt_old_postinstall_cmds
7346 old_postuninstall_cmds=$lt_old_postuninstall_cmds
7347
7348 # Create an old-style archive from a shared archive.
7349 old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
7350
7351 # Create a temporary old-style archive to link instead of a shared archive.
7352 old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
7353
7354 # Commands used to build and install a shared archive.
7355 archive_cmds=$lt_archive_cmds
7356 archive_expsym_cmds=$lt_archive_expsym_cmds
7357 postinstall_cmds=$lt_postinstall_cmds
7358 postuninstall_cmds=$lt_postuninstall_cmds
7359
7360 # Commands to strip libraries.
7361 old_striplib=$lt_old_striplib
7362 striplib=$lt_striplib
7363
7364 # Method to check whether dependent libraries are shared objects.
7365 deplibs_check_method=$lt_deplibs_check_method
7366
7367 # Command to use when deplibs_check_method == file_magic.
7368 file_magic_cmd=$lt_file_magic_cmd
7369
7370 # Flag that allows shared libraries with undefined symbols to be built.
7371 allow_undefined_flag=$lt_allow_undefined_flag
7372
7373 # Flag that forces no undefined symbols.
7374 no_undefined_flag=$lt_no_undefined_flag
7375
7376 # Commands used to finish a libtool library installation in a directory.
7377 finish_cmds=$lt_finish_cmds
7378
7379 # Same as above, but a single script fragment to be evaled but not shown.
7380 finish_eval=$lt_finish_eval
7381
7382 # Take the output of nm and produce a listing of raw symbols and C names.
7383 global_symbol_pipe=$lt_global_symbol_pipe
7384
7385 # Transform the output of nm in a proper C declaration
7386 global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
7387
7388 # Transform the output of nm in a C name address pair
7389 global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
7390
7391 # This is the shared library runtime path variable.
7392 runpath_var=$runpath_var
7393
7394 # This is the shared library path variable.
7395 shlibpath_var=$shlibpath_var
7396
7397 # Is shlibpath searched before the hard-coded library search path?
7398 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
7399
7400 # How to hardcode a shared library path into an executable.
7401 hardcode_action=$hardcode_action
7402
7403 # Whether we should hardcode library paths into libraries.
7404 hardcode_into_libs=$hardcode_into_libs
7405
7406 # Flag to hardcode \$libdir into a binary during linking.
7407 # This must work even if \$libdir does not exist.
7408 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
7409
7410 # Whether we need a single -rpath flag with a separated argument.
7411 hardcode_libdir_separator=$lt_hardcode_libdir_separator
7412
7413 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
7414 # resulting binary.
7415 hardcode_direct=$hardcode_direct
7416
7417 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7418 # resulting binary.
7419 hardcode_minus_L=$hardcode_minus_L
7420
7421 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7422 # the resulting binary.
7423 hardcode_shlibpath_var=$hardcode_shlibpath_var
7424
7425 # Variables whose values should be saved in libtool wrapper scripts and
7426 # restored at relink time.
7427 variables_saved_for_relink="$variables_saved_for_relink"
7428
7429 # Whether libtool must link a program against all its dependency libraries.
7430 link_all_deplibs=$link_all_deplibs
7431
7432 # Compile-time system search path for libraries
7433 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
7434
7435 # Run-time system search path for libraries
7436 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
7437
7438 # Fix the shell variable \$srcfile for the compiler.
7439 fix_srcfile_path="$fix_srcfile_path"
7440
7441 # Set to yes if exported symbols are required.
7442 always_export_symbols=$always_export_symbols
7443
7444 # The commands to list exported symbols.
7445 export_symbols_cmds=$lt_export_symbols_cmds
7446
7447 # The commands to extract the exported symbol list from a shared archive.
7448 extract_expsyms_cmds=$lt_extract_expsyms_cmds
7449
7450 # Symbols that should not be listed in the preloaded symbols.
7451 exclude_expsyms=$lt_exclude_expsyms
7452
7453 # Symbols that must always be exported.
7454 include_expsyms=$lt_include_expsyms
7455
7456 # ### END LIBTOOL CONFIG
7457
7458 __EOF__
7459
7460   case $host_os in
7461   aix3*)
7462     cat <<\EOF >> "${ofile}T"
7463
7464 # AIX sometimes has problems with the GCC collect2 program.  For some
7465 # reason, if we set the COLLECT_NAMES environment variable, the problems
7466 # vanish in a puff of smoke.
7467 if test "X${COLLECT_NAMES+set}" != Xset; then
7468   COLLECT_NAMES=
7469   export COLLECT_NAMES
7470 fi
7471 EOF
7472     ;;
7473   esac
7474
7475   case $host_os in
7476   cygwin* | mingw* | pw32* | os2*)
7477     cat <<'EOF' >> "${ofile}T"
7478       # This is a source program that is used to create dlls on Windows
7479       # Don't remove nor modify the starting and closing comments
7480 # /* ltdll.c starts here */
7481 # #define WIN32_LEAN_AND_MEAN
7482 # #include <windows.h>
7483 # #undef WIN32_LEAN_AND_MEAN
7484 # #include <stdio.h>
7485 #
7486 # #ifndef __CYGWIN__
7487 # #  ifdef __CYGWIN32__
7488 # #    define __CYGWIN__ __CYGWIN32__
7489 # #  endif
7490 # #endif
7491 #
7492 # #ifdef __cplusplus
7493 # extern "C" {
7494 # #endif
7495 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
7496 # #ifdef __cplusplus
7497 # }
7498 # #endif
7499 #
7500 # #ifdef __CYGWIN__
7501 # #include <cygwin/cygwin_dll.h>
7502 # DECLARE_CYGWIN_DLL( DllMain );
7503 # #endif
7504 # HINSTANCE __hDllInstance_base;
7505 #
7506 # BOOL APIENTRY
7507 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
7508 # {
7509 #   __hDllInstance_base = hInst;
7510 #   return TRUE;
7511 # }
7512 # /* ltdll.c ends here */
7513         # This is a source program that is used to create import libraries
7514         # on Windows for dlls which lack them. Don't remove nor modify the
7515         # starting and closing comments
7516 # /* impgen.c starts here */
7517 # /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
7518 #
7519 #  This file is part of GNU libtool.
7520 #
7521 #  This program is free software; you can redistribute it and/or modify
7522 #  it under the terms of the GNU General Public License as published by
7523 #  the Free Software Foundation; either version 2 of the License, or
7524 #  (at your option) any later version.
7525 #
7526 #  This program is distributed in the hope that it will be useful,
7527 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
7528 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
7529 #  GNU General Public License for more details.
7530 #
7531 #  You should have received a copy of the GNU General Public License
7532 #  along with this program; if not, write to the Free Software
7533 #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
7534 #  */
7535 #
7536 # #include <stdio.h>            /* for printf() */
7537 # #include <unistd.h>           /* for open(), lseek(), read() */
7538 # #include <fcntl.h>            /* for O_RDONLY, O_BINARY */
7539 # #include <string.h>           /* for strdup() */
7540 #
7541 # /* O_BINARY isn't required (or even defined sometimes) under Unix */
7542 # #ifndef O_BINARY
7543 # #define O_BINARY 0
7544 # #endif
7545 #
7546 # static unsigned int
7547 # pe_get16 (fd, offset)
7548 #      int fd;
7549 #      int offset;
7550 # {
7551 #   unsigned char b[2];
7552 #   lseek (fd, offset, SEEK_SET);
7553 #   read (fd, b, 2);
7554 #   return b[0] + (b[1]<<8);
7555 # }
7556 #
7557 # static unsigned int
7558 # pe_get32 (fd, offset)
7559 #     int fd;
7560 #     int offset;
7561 # {
7562 #   unsigned char b[4];
7563 #   lseek (fd, offset, SEEK_SET);
7564 #   read (fd, b, 4);
7565 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
7566 # }
7567 #
7568 # static unsigned int
7569 # pe_as32 (ptr)
7570 #      void *ptr;
7571 # {
7572 #   unsigned char *b = ptr;
7573 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
7574 # }
7575 #
7576 # int
7577 # main (argc, argv)
7578 #     int argc;
7579 #     char *argv[];
7580 # {
7581 #     int dll;
7582 #     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
7583 #     unsigned long export_rva, export_size, nsections, secptr, expptr;
7584 #     unsigned long name_rvas, nexp;
7585 #     unsigned char *expdata, *erva;
7586 #     char *filename, *dll_name;
7587 #
7588 #     filename = argv[1];
7589 #
7590 #     dll = open(filename, O_RDONLY|O_BINARY);
7591 #     if (dll < 1)
7592 #       return 1;
7593 #
7594 #     dll_name = filename;
7595 #
7596 #     for (i=0; filename[i]; i++)
7597 #       if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
7598 #           dll_name = filename + i +1;
7599 #
7600 #     pe_header_offset = pe_get32 (dll, 0x3c);
7601 #     opthdr_ofs = pe_header_offset + 4 + 20;
7602 #     num_entries = pe_get32 (dll, opthdr_ofs + 92);
7603 #
7604 #     if (num_entries < 1) /* no exports */
7605 #       return 1;
7606 #
7607 #     export_rva = pe_get32 (dll, opthdr_ofs + 96);
7608 #     export_size = pe_get32 (dll, opthdr_ofs + 100);
7609 #     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
7610 #     secptr = (pe_header_offset + 4 + 20 +
7611 #             pe_get16 (dll, pe_header_offset + 4 + 16));
7612 #
7613 #     expptr = 0;
7614 #     for (i = 0; i < nsections; i++)
7615 #     {
7616 #       char sname[8];
7617 #       unsigned long secptr1 = secptr + 40 * i;
7618 #       unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
7619 #       unsigned long vsize = pe_get32 (dll, secptr1 + 16);
7620 #       unsigned long fptr = pe_get32 (dll, secptr1 + 20);
7621 #       lseek(dll, secptr1, SEEK_SET);
7622 #       read(dll, sname, 8);
7623 #       if (vaddr <= export_rva && vaddr+vsize > export_rva)
7624 #       {
7625 #           expptr = fptr + (export_rva - vaddr);
7626 #           if (export_rva + export_size > vaddr + vsize)
7627 #               export_size = vsize - (export_rva - vaddr);
7628 #           break;
7629 #       }
7630 #     }
7631 #
7632 #     expdata = (unsigned char*)malloc(export_size);
7633 #     lseek (dll, expptr, SEEK_SET);
7634 #     read (dll, expdata, export_size);
7635 #     erva = expdata - export_rva;
7636 #
7637 #     nexp = pe_as32 (expdata+24);
7638 #     name_rvas = pe_as32 (expdata+32);
7639 #
7640 #     printf ("EXPORTS\n");
7641 #     for (i = 0; i<nexp; i++)
7642 #     {
7643 #       unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
7644 #       printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
7645 #     }
7646 #
7647 #     return 0;
7648 # }
7649 # /* impgen.c ends here */
7650
7651 EOF
7652     ;;
7653   esac
7654
7655   # We use sed instead of cat because bash on DJGPP gets confused if
7656   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
7657   # text mode, it properly converts lines to CR/LF.  This bash problem
7658   # is reportedly fixed, but why not run on old versions too?
7659   sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
7660
7661   mv -f "${ofile}T" "$ofile" || \
7662     (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
7663   chmod +x "$ofile"
7664 fi
7665
7666
7667
7668
7669
7670 # This can be used to rebuild libtool when needed
7671 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
7672
7673 # Always use our own libtool.
7674 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
7675
7676 # Prevent multiple expansion
7677
7678
7679
7680 for ac_prog in mawk gawk nawk awk
7681 do
7682 # Extract the first word of "$ac_prog", so it can be a program name with args.
7683 set dummy $ac_prog; ac_word=$2
7684 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7685 echo "configure:7686: checking for $ac_word" >&5
7686 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
7687   echo $ac_n "(cached) $ac_c" 1>&6
7688 else
7689   if test -n "$AWK"; then
7690   ac_cv_prog_AWK="$AWK" # Let the user override the test.
7691 else
7692   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7693   ac_dummy="$PATH"
7694   for ac_dir in $ac_dummy; do
7695     test -z "$ac_dir" && ac_dir=.
7696     if test -f $ac_dir/$ac_word; then
7697       ac_cv_prog_AWK="$ac_prog"
7698       break
7699     fi
7700   done
7701   IFS="$ac_save_ifs"
7702 fi
7703 fi
7704 AWK="$ac_cv_prog_AWK"
7705 if test -n "$AWK"; then
7706   echo "$ac_t""$AWK" 1>&6
7707 else
7708   echo "$ac_t""no" 1>&6
7709 fi
7710
7711 test -n "$AWK" && break
7712 done
7713
7714 # test for ln hardlink support
7715 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
7716 echo "configure:7717: checking whether ln works" >&5
7717 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
7718   echo $ac_n "(cached) $ac_c" 1>&6
7719 else
7720   rm -f conftest.src conftest.dst
7721 echo "conftest" > conftest.src
7722 if ln conftest.src conftest.dst 2>/dev/null
7723 then
7724   ol_cv_prog_LN_H="ln"
7725 else
7726   ol_cv_prog_LN_H="cp"
7727 fi
7728 rm -f conftest.src conftest.dst
7729
7730 fi
7731 LN_H="$ol_cv_prog_LN_H"
7732 if test "$ol_cv_prog_LN_H" = "ln"; then
7733         echo "$ac_t""yes" 1>&6
7734 else
7735         echo "$ac_t""no" 1>&6
7736 fi
7737
7738 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
7739 echo "configure:7740: checking whether ln -s works" >&5
7740 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
7741   echo $ac_n "(cached) $ac_c" 1>&6
7742 else
7743   rm -f conftestdata
7744 if ln -s X conftestdata 2>/dev/null
7745 then
7746   rm -f conftestdata
7747   ac_cv_prog_LN_S="ln -s"
7748 else
7749   ac_cv_prog_LN_S=ln
7750 fi
7751 fi
7752 LN_S="$ac_cv_prog_LN_S"
7753 if test "$ac_cv_prog_LN_S" = "ln -s"; then
7754   echo "$ac_t""yes" 1>&6
7755 else
7756   echo "$ac_t""no" 1>&6
7757 fi
7758
7759
7760 # Extract the first word of "sendmail", so it can be a program name with args.
7761 set dummy sendmail; ac_word=$2
7762 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7763 echo "configure:7764: checking for $ac_word" >&5
7764 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
7765   echo $ac_n "(cached) $ac_c" 1>&6
7766 else
7767   case "$SENDMAIL" in
7768   /*)
7769   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
7770   ;;
7771   ?:/*)
7772   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
7773   ;;
7774   *)
7775   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7776   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
7777   for ac_dir in $ac_dummy; do 
7778     test -z "$ac_dir" && ac_dir=.
7779     if test -f $ac_dir/$ac_word; then
7780       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
7781       break
7782     fi
7783   done
7784   IFS="$ac_save_ifs"
7785   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
7786   ;;
7787 esac
7788 fi
7789 SENDMAIL="$ac_cv_path_SENDMAIL"
7790 if test -n "$SENDMAIL"; then
7791   echo "$ac_t""$SENDMAIL" 1>&6
7792 else
7793   echo "$ac_t""no" 1>&6
7794 fi
7795
7796 # Extract the first word of "vi", so it can be a program name with args.
7797 set dummy vi; ac_word=$2
7798 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7799 echo "configure:7800: checking for $ac_word" >&5
7800 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
7801   echo $ac_n "(cached) $ac_c" 1>&6
7802 else
7803   case "$EDITOR" in
7804   /*)
7805   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
7806   ;;
7807   ?:/*)
7808   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
7809   ;;
7810   *)
7811   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7812   ac_dummy="$PATH:/usr/ucb"
7813   for ac_dir in $ac_dummy; do 
7814     test -z "$ac_dir" && ac_dir=.
7815     if test -f $ac_dir/$ac_word; then
7816       ac_cv_path_EDITOR="$ac_dir/$ac_word"
7817       break
7818     fi
7819   done
7820   IFS="$ac_save_ifs"
7821   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
7822   ;;
7823 esac
7824 fi
7825 EDITOR="$ac_cv_path_EDITOR"
7826 if test -n "$EDITOR"; then
7827   echo "$ac_t""$EDITOR" 1>&6
7828 else
7829   echo "$ac_t""no" 1>&6
7830 fi
7831
7832
7833 ol_link_perl=no
7834 if test $ol_enable_perl != no ; then
7835         # Extract the first word of "perl", so it can be a program name with args.
7836 set dummy perl; ac_word=$2
7837 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7838 echo "configure:7839: checking for $ac_word" >&5
7839 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
7840   echo $ac_n "(cached) $ac_c" 1>&6
7841 else
7842   case "$PERLBIN" in
7843   /*)
7844   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
7845   ;;
7846   ?:/*)
7847   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
7848   ;;
7849   *)
7850   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7851   ac_dummy="$PATH"
7852   for ac_dir in $ac_dummy; do 
7853     test -z "$ac_dir" && ac_dir=.
7854     if test -f $ac_dir/$ac_word; then
7855       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
7856       break
7857     fi
7858   done
7859   IFS="$ac_save_ifs"
7860   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
7861   ;;
7862 esac
7863 fi
7864 PERLBIN="$ac_cv_path_PERLBIN"
7865 if test -n "$PERLBIN"; then
7866   echo "$ac_t""$PERLBIN" 1>&6
7867 else
7868   echo "$ac_t""no" 1>&6
7869 fi
7870
7871
7872         if test "no$PERLBIN" = "no" ; then
7873                 if test $ol_enable_perl = yes ; then
7874                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
7875                 fi
7876
7877         else
7878                 PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
7879                 if test x"$ol_with_perl_module" = "xstatic" ; then
7880                         SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
7881                 else
7882                         MOD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
7883                 fi
7884                                 ol_link_perl=yes
7885         fi
7886 fi
7887
7888 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
7889 echo "configure:7890: checking how to run the C preprocessor" >&5
7890 # On Suns, sometimes $CPP names a directory.
7891 if test -n "$CPP" && test -d "$CPP"; then
7892   CPP=
7893 fi
7894 if test -z "$CPP"; then
7895 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
7896   echo $ac_n "(cached) $ac_c" 1>&6
7897 else
7898     # This must be in double quotes, not single quotes, because CPP may get
7899   # substituted into the Makefile and "${CC-cc}" will confuse make.
7900   CPP="${CC-cc} -E"
7901   # On the NeXT, cc -E runs the code through the compiler's parser,
7902   # not just through cpp.
7903   cat > conftest.$ac_ext <<EOF
7904 #line 7905 "configure"
7905 #include "confdefs.h"
7906 #include <assert.h>
7907 Syntax Error
7908 EOF
7909 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7910 { (eval echo configure:7911: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7911 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7912 if test -z "$ac_err"; then
7913   :
7914 else
7915   echo "$ac_err" >&5
7916   echo "configure: failed program was:" >&5
7917   cat conftest.$ac_ext >&5
7918   rm -rf conftest*
7919   CPP="${CC-cc} -E -traditional-cpp"
7920   cat > conftest.$ac_ext <<EOF
7921 #line 7922 "configure"
7922 #include "confdefs.h"
7923 #include <assert.h>
7924 Syntax Error
7925 EOF
7926 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7927 { (eval echo configure:7928: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7928 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7929 if test -z "$ac_err"; then
7930   :
7931 else
7932   echo "$ac_err" >&5
7933   echo "configure: failed program was:" >&5
7934   cat conftest.$ac_ext >&5
7935   rm -rf conftest*
7936   CPP="${CC-cc} -nologo -E"
7937   cat > conftest.$ac_ext <<EOF
7938 #line 7939 "configure"
7939 #include "confdefs.h"
7940 #include <assert.h>
7941 Syntax Error
7942 EOF
7943 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7944 { (eval echo configure:7945: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7945 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7946 if test -z "$ac_err"; then
7947   :
7948 else
7949   echo "$ac_err" >&5
7950   echo "configure: failed program was:" >&5
7951   cat conftest.$ac_ext >&5
7952   rm -rf conftest*
7953   CPP=/lib/cpp
7954 fi
7955 rm -f conftest*
7956 fi
7957 rm -f conftest*
7958 fi
7959 rm -f conftest*
7960   ac_cv_prog_CPP="$CPP"
7961 fi
7962   CPP="$ac_cv_prog_CPP"
7963 else
7964   ac_cv_prog_CPP="$CPP"
7965 fi
7966 echo "$ac_t""$CPP" 1>&6
7967
7968
7969 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
7970         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
7971
7972 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
7973         echo "configure: warning: programs compiled here do run here..." 1>&2
7974         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
7975
7976 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
7977         echo "configure: warning: programs compiled here do not run here..." 1>&2
7978         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
7979 fi
7980
7981
7982 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
7983 echo "configure:7984: checking for Cygwin environment" >&5
7984 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
7985   echo $ac_n "(cached) $ac_c" 1>&6
7986 else
7987   cat > conftest.$ac_ext <<EOF
7988 #line 7989 "configure"
7989 #include "confdefs.h"
7990
7991 int main() {
7992
7993 #ifndef __CYGWIN__
7994 #define __CYGWIN__ __CYGWIN32__
7995 #endif
7996 return __CYGWIN__;
7997 ; return 0; }
7998 EOF
7999 if { (eval echo configure:8000: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8000   rm -rf conftest*
8001   ac_cv_cygwin=yes
8002 else
8003   echo "configure: failed program was:" >&5
8004   cat conftest.$ac_ext >&5
8005   rm -rf conftest*
8006   ac_cv_cygwin=no
8007 fi
8008 rm -f conftest*
8009 fi
8010
8011 echo "$ac_t""$ac_cv_cygwin" 1>&6
8012 CYGWIN=
8013 test "$ac_cv_cygwin" = yes && CYGWIN=yes
8014 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
8015 echo "configure:8016: checking for mingw32 environment" >&5
8016 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
8017   echo $ac_n "(cached) $ac_c" 1>&6
8018 else
8019   cat > conftest.$ac_ext <<EOF
8020 #line 8021 "configure"
8021 #include "confdefs.h"
8022
8023 int main() {
8024 return __MINGW32__;
8025 ; return 0; }
8026 EOF
8027 if { (eval echo configure:8028: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8028   rm -rf conftest*
8029   ac_cv_mingw32=yes
8030 else
8031   echo "configure: failed program was:" >&5
8032   cat conftest.$ac_ext >&5
8033   rm -rf conftest*
8034   ac_cv_mingw32=no
8035 fi
8036 rm -f conftest*
8037 fi
8038
8039 echo "$ac_t""$ac_cv_mingw32" 1>&6
8040 MINGW32=
8041 test "$ac_cv_mingw32" = yes && MINGW32=yes
8042
8043
8044
8045 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
8046 echo "configure:8047: checking for executable suffix" >&5
8047 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
8048   echo $ac_n "(cached) $ac_c" 1>&6
8049 else
8050   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
8051   ac_cv_exeext=.exe
8052 else
8053   rm -f conftest*
8054   echo 'int main () { return 0; }' > conftest.$ac_ext
8055   ac_cv_exeext=
8056   if { (eval echo configure:8057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
8057     for file in conftest.*; do
8058       case $file in
8059       *.c | *.C | *.o | *.obj | *.xcoff) ;;
8060       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
8061       esac
8062     done
8063   else
8064     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
8065   fi
8066   rm -f conftest*
8067   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
8068 fi
8069 fi
8070
8071 EXEEXT=""
8072 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
8073 echo "$ac_t""${ac_cv_exeext}" 1>&6
8074 ac_exeext=$EXEEXT
8075
8076 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
8077 echo "configure:8078: checking for object suffix" >&5
8078 if eval "test \"\${ac_cv_objext+set}\" = set"; then
8079   echo $ac_n "(cached) $ac_c" 1>&6
8080 else
8081   rm -f conftest*
8082 echo 'int i = 1;' > conftest.$ac_ext
8083 if { (eval echo configure:8084: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8084   for ac_file in conftest.*; do
8085     case $ac_file in
8086     *.c) ;;
8087     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
8088     esac
8089   done
8090 else
8091   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
8092 fi
8093 rm -f conftest*
8094 fi
8095
8096 echo "$ac_t""$ac_cv_objext" 1>&6
8097 OBJEXT=$ac_cv_objext
8098 ac_objext=$ac_cv_objext
8099
8100
8101 cat >> confdefs.h <<EOF
8102 #define EXEEXT "${EXEEXT}"
8103 EOF
8104
8105
8106 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
8107 echo "configure:8108: checking for be_app in -lbe" >&5
8108 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
8109 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8110   echo $ac_n "(cached) $ac_c" 1>&6
8111 else
8112   ac_save_LIBS="$LIBS"
8113 LIBS="-lbe -lroot -lnet $LIBS"
8114 cat > conftest.$ac_ext <<EOF
8115 #line 8116 "configure"
8116 #include "confdefs.h"
8117 /* Override any gcc2 internal prototype to avoid an error.  */
8118 /* We use char because int might match the return type of a gcc2
8119     builtin and then its argument prototype would still apply.  */
8120 char be_app();
8121
8122 int main() {
8123 be_app()
8124 ; return 0; }
8125 EOF
8126 if { (eval echo configure:8127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8127   rm -rf conftest*
8128   eval "ac_cv_lib_$ac_lib_var=yes"
8129 else
8130   echo "configure: failed program was:" >&5
8131   cat conftest.$ac_ext >&5
8132   rm -rf conftest*
8133   eval "ac_cv_lib_$ac_lib_var=no"
8134 fi
8135 rm -f conftest*
8136 LIBS="$ac_save_LIBS"
8137
8138 fi
8139 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8140   echo "$ac_t""yes" 1>&6
8141   LIBS="$LIBS -lbe -lroot -lnet"
8142 else
8143   echo "$ac_t""no" 1>&6
8144 :
8145 fi
8146
8147
8148
8149
8150
8151 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
8152 echo "configure:8153: checking for ${CC-cc} option to accept ANSI C" >&5
8153 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
8154   echo $ac_n "(cached) $ac_c" 1>&6
8155 else
8156   am_cv_prog_cc_stdc=no
8157 ac_save_CC="$CC"
8158 # Don't try gcc -ansi; that turns off useful extensions and
8159 # breaks some systems' header files.
8160 # AIX                   -qlanglvl=ansi
8161 # Ultrix and OSF/1      -std1
8162 # HP-UX 10.20 and later -Ae
8163 # HP-UX older versions  -Aa -D_HPUX_SOURCE
8164 # SVR4                  -Xc -D__EXTENSIONS__
8165 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
8166 do
8167   CC="$ac_save_CC $ac_arg"
8168   cat > conftest.$ac_ext <<EOF
8169 #line 8170 "configure"
8170 #include "confdefs.h"
8171 #include <stdarg.h>
8172 #include <stdio.h>
8173 #include <sys/types.h>
8174 #include <sys/stat.h>
8175 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
8176 struct buf { int x; };
8177 FILE * (*rcsopen) (struct buf *, struct stat *, int);
8178 static char *e (p, i)
8179      char **p;
8180      int i;
8181 {
8182   return p[i];
8183 }
8184 static char *f (char * (*g) (char **, int), char **p, ...)
8185 {
8186   char *s;
8187   va_list v;
8188   va_start (v,p);
8189   s = g (p, va_arg (v,int));
8190   va_end (v);
8191   return s;
8192 }
8193 int test (int i, double x);
8194 struct s1 {int (*f) (int a);};
8195 struct s2 {int (*f) (double a);};
8196 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
8197 int argc;
8198 char **argv;
8199
8200 int main() {
8201
8202 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
8203
8204 ; return 0; }
8205 EOF
8206 if { (eval echo configure:8207: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8207   rm -rf conftest*
8208   am_cv_prog_cc_stdc="$ac_arg"; break
8209 else
8210   echo "configure: failed program was:" >&5
8211   cat conftest.$ac_ext >&5
8212 fi
8213 rm -f conftest*
8214 done
8215 CC="$ac_save_CC"
8216
8217 fi
8218
8219 if test -z "$am_cv_prog_cc_stdc"; then
8220   echo "$ac_t""none needed" 1>&6
8221 else
8222   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
8223 fi
8224 case "x$am_cv_prog_cc_stdc" in
8225   x|xno) ;;
8226   *) CC="$CC $am_cv_prog_cc_stdc" ;;
8227 esac
8228
8229 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
8230         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
8231 fi
8232
8233 # test for make depend flag
8234 OL_MKDEP=
8235 OL_MKDEP_FLAGS=
8236 if test -z "${MKDEP}"; then
8237         OL_MKDEP="${CC-cc}"
8238         if test -z "${MKDEP_FLAGS}"; then
8239                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
8240 echo "configure:8241: checking for ${OL_MKDEP} depend flag" >&5
8241 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
8242   echo $ac_n "(cached) $ac_c" 1>&6
8243 else
8244   
8245                         ol_cv_mkdep=no
8246                         for flag in "-M" "-xM"; do
8247                                 cat > conftest.c <<EOF
8248  noCode;
8249 EOF
8250                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:8251: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
8251                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
8252                                 then
8253                                         if test ! -f conftest."${ac_object}" ; then
8254                                                 ol_cv_mkdep=$flag
8255                                                 OL_MKDEP_FLAGS="$flag"
8256                                                 break
8257                                         fi
8258                                 fi
8259                         done
8260                         rm -f conftest*
8261                 
8262 fi
8263
8264 echo "$ac_t""$ol_cv_mkdep" 1>&6
8265         else
8266                 cc_cv_mkdep=yes
8267                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
8268         fi
8269 else
8270         cc_cv_mkdep=yes
8271         OL_MKDEP="${MKDEP}"
8272         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
8273 fi
8274
8275
8276
8277 if test "${ol_cv_mkdep}" = no ; then
8278         # this will soon become an error
8279         echo "configure: warning: do not know how to generate dependencies" 1>&2
8280 fi
8281
8282 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
8283 echo "configure:8284: checking for afopen in -ls" >&5
8284 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
8285 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8286   echo $ac_n "(cached) $ac_c" 1>&6
8287 else
8288   ac_save_LIBS="$LIBS"
8289 LIBS="-ls  $LIBS"
8290 cat > conftest.$ac_ext <<EOF
8291 #line 8292 "configure"
8292 #include "confdefs.h"
8293 /* Override any gcc2 internal prototype to avoid an error.  */
8294 /* We use char because int might match the return type of a gcc2
8295     builtin and then its argument prototype would still apply.  */
8296 char afopen();
8297
8298 int main() {
8299 afopen()
8300 ; return 0; }
8301 EOF
8302 if { (eval echo configure:8303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8303   rm -rf conftest*
8304   eval "ac_cv_lib_$ac_lib_var=yes"
8305 else
8306   echo "configure: failed program was:" >&5
8307   cat conftest.$ac_ext >&5
8308   rm -rf conftest*
8309   eval "ac_cv_lib_$ac_lib_var=no"
8310 fi
8311 rm -f conftest*
8312 LIBS="$ac_save_LIBS"
8313
8314 fi
8315 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8316   echo "$ac_t""yes" 1>&6
8317   
8318         AUTH_LIBS=-ls
8319         cat >> confdefs.h <<\EOF
8320 #define HAVE_AIX_SECURITY 1
8321 EOF
8322
8323
8324 else
8325   echo "$ac_t""no" 1>&6
8326 fi
8327
8328
8329
8330 ol_link_modules=no
8331 if test $ol_enable_modules != no ; then
8332         for ac_hdr in ltdl.h
8333 do
8334 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8335 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8336 echo "configure:8337: checking for $ac_hdr" >&5
8337 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8338   echo $ac_n "(cached) $ac_c" 1>&6
8339 else
8340   cat > conftest.$ac_ext <<EOF
8341 #line 8342 "configure"
8342 #include "confdefs.h"
8343 #include <$ac_hdr>
8344 EOF
8345 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8346 { (eval echo configure:8347: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8347 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8348 if test -z "$ac_err"; then
8349   rm -rf conftest*
8350   eval "ac_cv_header_$ac_safe=yes"
8351 else
8352   echo "$ac_err" >&5
8353   echo "configure: failed program was:" >&5
8354   cat conftest.$ac_ext >&5
8355   rm -rf conftest*
8356   eval "ac_cv_header_$ac_safe=no"
8357 fi
8358 rm -f conftest*
8359 fi
8360 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8361   echo "$ac_t""yes" 1>&6
8362     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8363   cat >> confdefs.h <<EOF
8364 #define $ac_tr_hdr 1
8365 EOF
8366  
8367 else
8368   echo "$ac_t""no" 1>&6
8369 fi
8370 done
8371
8372
8373         if test $ac_cv_header_ltdl_h = no ; then
8374                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
8375         fi
8376
8377         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
8378 echo "configure:8379: checking for lt_dlinit in -lltdl" >&5
8379 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
8380 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8381   echo $ac_n "(cached) $ac_c" 1>&6
8382 else
8383   ac_save_LIBS="$LIBS"
8384 LIBS="-lltdl  $LIBS"
8385 cat > conftest.$ac_ext <<EOF
8386 #line 8387 "configure"
8387 #include "confdefs.h"
8388 /* Override any gcc2 internal prototype to avoid an error.  */
8389 /* We use char because int might match the return type of a gcc2
8390     builtin and then its argument prototype would still apply.  */
8391 char lt_dlinit();
8392
8393 int main() {
8394 lt_dlinit()
8395 ; return 0; }
8396 EOF
8397 if { (eval echo configure:8398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8398   rm -rf conftest*
8399   eval "ac_cv_lib_$ac_lib_var=yes"
8400 else
8401   echo "configure: failed program was:" >&5
8402   cat conftest.$ac_ext >&5
8403   rm -rf conftest*
8404   eval "ac_cv_lib_$ac_lib_var=no"
8405 fi
8406 rm -f conftest*
8407 LIBS="$ac_save_LIBS"
8408
8409 fi
8410 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8411   echo "$ac_t""yes" 1>&6
8412   
8413                 MODULES_LIBS=-lltdl
8414                 cat >> confdefs.h <<\EOF
8415 #define HAVE_LIBLTDL 1
8416 EOF
8417
8418         
8419 else
8420   echo "$ac_t""no" 1>&6
8421 fi
8422
8423
8424         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
8425                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
8426         fi
8427         ol_link_modules=yes
8428 else
8429         ol_with_bdb_module=static
8430         ol_with_dnssrv_module=static
8431         ol_with_ldap_module=static
8432         ol_with_ldbm_module=static
8433         ol_with_meta_module=static
8434         ol_with_monitor_module=static
8435         ol_with_null_module=static
8436         ol_with_passwd_module=static
8437         ol_with_perl_module=static
8438         ol_with_shell_module=static
8439         ol_with_tcl_module=static
8440         ol_with_sql_module=static
8441 fi
8442
8443 # test for EBCDIC
8444 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
8445 echo "configure:8446: checking for EBCDIC" >&5
8446 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
8447   echo $ac_n "(cached) $ac_c" 1>&6
8448 else
8449   
8450         cat > conftest.$ac_ext <<EOF
8451 #line 8452 "configure"
8452 #include "confdefs.h"
8453
8454 #if !('M' == 0xd4)
8455 #include <__ASCII__/generate_error.h>
8456 #endif
8457
8458 EOF
8459 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8460 { (eval echo configure:8461: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8461 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8462 if test -z "$ac_err"; then
8463   rm -rf conftest*
8464   ol_cv_cpp_ebcdic=yes
8465 else
8466   echo "$ac_err" >&5
8467   echo "configure: failed program was:" >&5
8468   cat conftest.$ac_ext >&5
8469   rm -rf conftest*
8470   ol_cv_cpp_ebcdic=no
8471 fi
8472 rm -f conftest*
8473 fi
8474
8475 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
8476 if test $ol_cv_cpp_ebcdic = yes ; then
8477         cat >> confdefs.h <<\EOF
8478 #define HAVE_EBCDIC 1
8479 EOF
8480
8481 fi
8482
8483 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
8484 echo "configure:8485: checking for ANSI C header files" >&5
8485 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
8486   echo $ac_n "(cached) $ac_c" 1>&6
8487 else
8488   cat > conftest.$ac_ext <<EOF
8489 #line 8490 "configure"
8490 #include "confdefs.h"
8491 #include <stdlib.h>
8492 #include <stdarg.h>
8493 #include <string.h>
8494 #include <float.h>
8495 EOF
8496 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8497 { (eval echo configure:8498: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8498 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8499 if test -z "$ac_err"; then
8500   rm -rf conftest*
8501   ol_cv_header_stdc=yes
8502 else
8503   echo "$ac_err" >&5
8504   echo "configure: failed program was:" >&5
8505   cat conftest.$ac_ext >&5
8506   rm -rf conftest*
8507   ol_cv_header_stdc=no
8508 fi
8509 rm -f conftest*
8510
8511 if test $ol_cv_header_stdc = yes; then
8512   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
8513 cat > conftest.$ac_ext <<EOF
8514 #line 8515 "configure"
8515 #include "confdefs.h"
8516 #include <string.h>
8517 EOF
8518 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8519   egrep "memchr" >/dev/null 2>&1; then
8520   :
8521 else
8522   rm -rf conftest*
8523   ol_cv_header_stdc=no
8524 fi
8525 rm -f conftest*
8526
8527 fi
8528
8529 if test $ol_cv_header_stdc = yes; then
8530   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
8531 cat > conftest.$ac_ext <<EOF
8532 #line 8533 "configure"
8533 #include "confdefs.h"
8534 #include <stdlib.h>
8535 EOF
8536 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8537   egrep "free" >/dev/null 2>&1; then
8538   :
8539 else
8540   rm -rf conftest*
8541   ol_cv_header_stdc=no
8542 fi
8543 rm -f conftest*
8544
8545 fi
8546
8547 if test $ol_cv_header_stdc = yes; then
8548   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
8549 if test "$cross_compiling" = yes; then
8550   :
8551 else
8552   cat > conftest.$ac_ext <<EOF
8553 #line 8554 "configure"
8554 #include "confdefs.h"
8555 #include <ctype.h>
8556 #ifndef HAVE_EBCDIC
8557 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
8558 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
8559 #else
8560 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
8561                 || ('j' <= (c) && (c) <= 'r') \
8562                 || ('s' <= (c) && (c) <= 'z'))
8563 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
8564 #endif
8565 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
8566 int main () { int i; for (i = 0; i < 256; i++)
8567 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
8568 exit (0); }
8569
8570 EOF
8571 if { (eval echo configure:8572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8572 then
8573   :
8574 else
8575   echo "configure: failed program was:" >&5
8576   cat conftest.$ac_ext >&5
8577   rm -fr conftest*
8578   ol_cv_header_stdc=no
8579 fi
8580 rm -fr conftest*
8581 fi
8582
8583 fi
8584 fi
8585
8586 echo "$ac_t""$ol_cv_header_stdc" 1>&6
8587 if test $ol_cv_header_stdc = yes; then
8588   cat >> confdefs.h <<\EOF
8589 #define STDC_HEADERS 1
8590 EOF
8591
8592 fi
8593 ac_cv_header_stdc=disable
8594
8595
8596 if test $ol_cv_header_stdc != yes; then
8597         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
8598 fi
8599
8600 ac_header_dirent=no
8601 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
8602 do
8603 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8604 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
8605 echo "configure:8606: checking for $ac_hdr that defines DIR" >&5
8606 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
8607   echo $ac_n "(cached) $ac_c" 1>&6
8608 else
8609   cat > conftest.$ac_ext <<EOF
8610 #line 8611 "configure"
8611 #include "confdefs.h"
8612 #include <sys/types.h>
8613 #include <$ac_hdr>
8614 int main() {
8615 DIR *dirp = 0;
8616 ; return 0; }
8617 EOF
8618 if { (eval echo configure:8619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8619   rm -rf conftest*
8620   eval "ac_cv_header_dirent_$ac_safe=yes"
8621 else
8622   echo "configure: failed program was:" >&5
8623   cat conftest.$ac_ext >&5
8624   rm -rf conftest*
8625   eval "ac_cv_header_dirent_$ac_safe=no"
8626 fi
8627 rm -f conftest*
8628 fi
8629 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
8630   echo "$ac_t""yes" 1>&6
8631     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8632   cat >> confdefs.h <<EOF
8633 #define $ac_tr_hdr 1
8634 EOF
8635  ac_header_dirent=$ac_hdr; break
8636 else
8637   echo "$ac_t""no" 1>&6
8638 fi
8639 done
8640 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
8641 if test $ac_header_dirent = dirent.h; then
8642 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
8643 echo "configure:8644: checking for opendir in -ldir" >&5
8644 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
8645 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8646   echo $ac_n "(cached) $ac_c" 1>&6
8647 else
8648   ac_save_LIBS="$LIBS"
8649 LIBS="-ldir  $LIBS"
8650 cat > conftest.$ac_ext <<EOF
8651 #line 8652 "configure"
8652 #include "confdefs.h"
8653 /* Override any gcc2 internal prototype to avoid an error.  */
8654 /* We use char because int might match the return type of a gcc2
8655     builtin and then its argument prototype would still apply.  */
8656 char opendir();
8657
8658 int main() {
8659 opendir()
8660 ; return 0; }
8661 EOF
8662 if { (eval echo configure:8663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8663   rm -rf conftest*
8664   eval "ac_cv_lib_$ac_lib_var=yes"
8665 else
8666   echo "configure: failed program was:" >&5
8667   cat conftest.$ac_ext >&5
8668   rm -rf conftest*
8669   eval "ac_cv_lib_$ac_lib_var=no"
8670 fi
8671 rm -f conftest*
8672 LIBS="$ac_save_LIBS"
8673
8674 fi
8675 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8676   echo "$ac_t""yes" 1>&6
8677   LIBS="$LIBS -ldir"
8678 else
8679   echo "$ac_t""no" 1>&6
8680 fi
8681
8682 else
8683 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
8684 echo "configure:8685: checking for opendir in -lx" >&5
8685 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
8686 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8687   echo $ac_n "(cached) $ac_c" 1>&6
8688 else
8689   ac_save_LIBS="$LIBS"
8690 LIBS="-lx  $LIBS"
8691 cat > conftest.$ac_ext <<EOF
8692 #line 8693 "configure"
8693 #include "confdefs.h"
8694 /* Override any gcc2 internal prototype to avoid an error.  */
8695 /* We use char because int might match the return type of a gcc2
8696     builtin and then its argument prototype would still apply.  */
8697 char opendir();
8698
8699 int main() {
8700 opendir()
8701 ; return 0; }
8702 EOF
8703 if { (eval echo configure:8704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8704   rm -rf conftest*
8705   eval "ac_cv_lib_$ac_lib_var=yes"
8706 else
8707   echo "configure: failed program was:" >&5
8708   cat conftest.$ac_ext >&5
8709   rm -rf conftest*
8710   eval "ac_cv_lib_$ac_lib_var=no"
8711 fi
8712 rm -f conftest*
8713 LIBS="$ac_save_LIBS"
8714
8715 fi
8716 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8717   echo "$ac_t""yes" 1>&6
8718   LIBS="$LIBS -lx"
8719 else
8720   echo "$ac_t""no" 1>&6
8721 fi
8722
8723 fi
8724
8725 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
8726 echo "configure:8727: checking for sys/wait.h that is POSIX.1 compatible" >&5
8727 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
8728   echo $ac_n "(cached) $ac_c" 1>&6
8729 else
8730   cat > conftest.$ac_ext <<EOF
8731 #line 8732 "configure"
8732 #include "confdefs.h"
8733 #include <sys/types.h>
8734 #include <sys/wait.h>
8735 #ifndef WEXITSTATUS
8736 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
8737 #endif
8738 #ifndef WIFEXITED
8739 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
8740 #endif
8741 int main() {
8742 int s;
8743 wait (&s);
8744 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
8745 ; return 0; }
8746 EOF
8747 if { (eval echo configure:8748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8748   rm -rf conftest*
8749   ac_cv_header_sys_wait_h=yes
8750 else
8751   echo "configure: failed program was:" >&5
8752   cat conftest.$ac_ext >&5
8753   rm -rf conftest*
8754   ac_cv_header_sys_wait_h=no
8755 fi
8756 rm -f conftest*
8757 fi
8758
8759 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
8760 if test $ac_cv_header_sys_wait_h = yes; then
8761   cat >> confdefs.h <<\EOF
8762 #define HAVE_SYS_WAIT_H 1
8763 EOF
8764
8765 fi
8766
8767 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
8768 echo "configure:8769: checking POSIX termios" >&5
8769 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
8770   echo $ac_n "(cached) $ac_c" 1>&6
8771 else
8772   cat > conftest.$ac_ext <<EOF
8773 #line 8774 "configure"
8774 #include "confdefs.h"
8775 #include <sys/types.h>
8776 #include <unistd.h>
8777 #include <termios.h>
8778 int main() {
8779 /* SunOS 4.0.3 has termios.h but not the library calls.  */
8780    tcgetattr(0, 0);
8781 ; return 0; }
8782 EOF
8783 if { (eval echo configure:8784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8784   rm -rf conftest*
8785   am_cv_sys_posix_termios=yes
8786 else
8787   echo "configure: failed program was:" >&5
8788   cat conftest.$ac_ext >&5
8789   rm -rf conftest*
8790   am_cv_sys_posix_termios=no
8791 fi
8792 rm -f conftest*
8793 fi
8794
8795 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
8796
8797
8798  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
8799 echo "configure:8800: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
8800 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
8801   echo $ac_n "(cached) $ac_c" 1>&6
8802 else
8803   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
8804
8805   gwinsz_in_termios_h=no
8806   if test $am_cv_sys_posix_termios = yes; then
8807     cat > conftest.$ac_ext <<EOF
8808 #line 8809 "configure"
8809 #include "confdefs.h"
8810 #include <sys/types.h>
8811 #     include <termios.h>
8812 #     ifdef TIOCGWINSZ
8813         yes
8814 #     endif
8815     
8816 EOF
8817 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8818   egrep "yes" >/dev/null 2>&1; then
8819   rm -rf conftest*
8820   gwinsz_in_termios_h=yes
8821 fi
8822 rm -f conftest*
8823
8824   fi
8825
8826   if test $gwinsz_in_termios_h = no; then
8827     cat > conftest.$ac_ext <<EOF
8828 #line 8829 "configure"
8829 #include "confdefs.h"
8830 #include <sys/types.h>
8831 #     include <sys/ioctl.h>
8832 #     ifdef TIOCGWINSZ
8833         yes
8834 #     endif
8835     
8836 EOF
8837 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8838   egrep "yes" >/dev/null 2>&1; then
8839   rm -rf conftest*
8840   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
8841 fi
8842 rm -f conftest*
8843
8844   fi
8845   
8846 fi
8847
8848 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
8849   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
8850     cat >> confdefs.h <<\EOF
8851 #define GWINSZ_IN_SYS_IOCTL 1
8852 EOF
8853
8854   fi
8855
8856 if test $am_cv_sys_posix_termios = yes ; then
8857         cat >> confdefs.h <<\EOF
8858 #define HAVE_POSIX_TERMIOS 1
8859 EOF
8860
8861 fi
8862
8863 for ac_hdr in \
8864         arpa/inet.h             \
8865         arpa/nameser.h  \
8866         assert.h                \
8867         conio.h                 \
8868         crypt.h                 \
8869         direct.h                \
8870         errno.h                 \
8871         fcntl.h                 \
8872         filio.h                 \
8873         getopt.h                \
8874         grp.h                   \
8875         io.h                    \
8876         libutil.h               \
8877         limits.h                \
8878         locale.h                \
8879         netinet/tcp.h   \
8880         malloc.h                \
8881         memory.h                \
8882         psap.h                  \
8883         pwd.h                   \
8884         process.h               \
8885         resolv.h                \
8886         sgtty.h                 \
8887         shadow.h                \
8888         stddef.h                \
8889         string.h                \
8890         strings.h               \
8891         sysexits.h              \
8892         sys/file.h              \
8893         sys/filio.h             \
8894         sys/errno.h             \
8895         sys/ioctl.h             \
8896         sys/param.h             \
8897         sys/resource.h  \
8898         sys/select.h    \
8899         sys/socket.h    \
8900         sys/syslog.h    \
8901         sys/time.h              \
8902         sys/types.h             \
8903         syslog.h                \
8904         termios.h               \
8905         unistd.h                \
8906         winsock.h               \
8907         winsock2.h              \
8908
8909 do
8910 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8911 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8912 echo "configure:8913: checking for $ac_hdr" >&5
8913 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8914   echo $ac_n "(cached) $ac_c" 1>&6
8915 else
8916   cat > conftest.$ac_ext <<EOF
8917 #line 8918 "configure"
8918 #include "confdefs.h"
8919 #include <$ac_hdr>
8920 EOF
8921 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8922 { (eval echo configure:8923: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8923 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8924 if test -z "$ac_err"; then
8925   rm -rf conftest*
8926   eval "ac_cv_header_$ac_safe=yes"
8927 else
8928   echo "$ac_err" >&5
8929   echo "configure: failed program was:" >&5
8930   cat conftest.$ac_ext >&5
8931   rm -rf conftest*
8932   eval "ac_cv_header_$ac_safe=no"
8933 fi
8934 rm -f conftest*
8935 fi
8936 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8937   echo "$ac_t""yes" 1>&6
8938     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8939   cat >> confdefs.h <<EOF
8940 #define $ac_tr_hdr 1
8941 EOF
8942  
8943 else
8944   echo "$ac_t""no" 1>&6
8945 fi
8946 done
8947
8948
8949
8950
8951 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
8952 echo "configure:8953: checking for dlopen" >&5
8953 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
8954   echo $ac_n "(cached) $ac_c" 1>&6
8955 else
8956   cat > conftest.$ac_ext <<EOF
8957 #line 8958 "configure"
8958 #include "confdefs.h"
8959 /* System header to define __stub macros and hopefully few prototypes,
8960     which can conflict with char dlopen(); below.  */
8961 #include <assert.h>
8962 /* Override any gcc2 internal prototype to avoid an error.  */
8963 /* We use char because int might match the return type of a gcc2
8964     builtin and then its argument prototype would still apply.  */
8965 char dlopen();
8966 char (*f)();
8967
8968 int main() {
8969
8970 /* The GNU C library defines this for functions which it implements
8971     to always fail with ENOSYS.  Some functions are actually named
8972     something starting with __ and the normal name is an alias.  */
8973 #if defined (__stub_dlopen) || defined (__stub___dlopen)
8974 choke me
8975 #else
8976 f = dlopen;
8977 #endif
8978
8979 ; return 0; }
8980 EOF
8981 if { (eval echo configure:8982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8982   rm -rf conftest*
8983   eval "ac_cv_func_dlopen=yes"
8984 else
8985   echo "configure: failed program was:" >&5
8986   cat conftest.$ac_ext >&5
8987   rm -rf conftest*
8988   eval "ac_cv_func_dlopen=no"
8989 fi
8990 rm -f conftest*
8991 fi
8992
8993 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
8994   echo "$ac_t""yes" 1>&6
8995   :
8996 else
8997   echo "$ac_t""no" 1>&6
8998 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
8999 echo "configure:9000: checking for dlopen in -ldl" >&5
9000 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
9001 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9002   echo $ac_n "(cached) $ac_c" 1>&6
9003 else
9004   ac_save_LIBS="$LIBS"
9005 LIBS="-ldl  $LIBS"
9006 cat > conftest.$ac_ext <<EOF
9007 #line 9008 "configure"
9008 #include "confdefs.h"
9009 /* Override any gcc2 internal prototype to avoid an error.  */
9010 /* We use char because int might match the return type of a gcc2
9011     builtin and then its argument prototype would still apply.  */
9012 char dlopen();
9013
9014 int main() {
9015 dlopen()
9016 ; return 0; }
9017 EOF
9018 if { (eval echo configure:9019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9019   rm -rf conftest*
9020   eval "ac_cv_lib_$ac_lib_var=yes"
9021 else
9022   echo "configure: failed program was:" >&5
9023   cat conftest.$ac_ext >&5
9024   rm -rf conftest*
9025   eval "ac_cv_lib_$ac_lib_var=no"
9026 fi
9027 rm -f conftest*
9028 LIBS="$ac_save_LIBS"
9029
9030 fi
9031 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9032   echo "$ac_t""yes" 1>&6
9033     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9034     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9035   cat >> confdefs.h <<EOF
9036 #define $ac_tr_lib 1
9037 EOF
9038
9039   LIBS="-ldl $LIBS"
9040
9041 else
9042   echo "$ac_t""no" 1>&6
9043 fi
9044
9045 fi
9046
9047
9048 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
9049 echo "configure:9050: checking for sigset in -lV3" >&5
9050 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
9051 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9052   echo $ac_n "(cached) $ac_c" 1>&6
9053 else
9054   ac_save_LIBS="$LIBS"
9055 LIBS="-lV3  $LIBS"
9056 cat > conftest.$ac_ext <<EOF
9057 #line 9058 "configure"
9058 #include "confdefs.h"
9059 /* Override any gcc2 internal prototype to avoid an error.  */
9060 /* We use char because int might match the return type of a gcc2
9061     builtin and then its argument prototype would still apply.  */
9062 char sigset();
9063
9064 int main() {
9065 sigset()
9066 ; return 0; }
9067 EOF
9068 if { (eval echo configure:9069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9069   rm -rf conftest*
9070   eval "ac_cv_lib_$ac_lib_var=yes"
9071 else
9072   echo "configure: failed program was:" >&5
9073   cat conftest.$ac_ext >&5
9074   rm -rf conftest*
9075   eval "ac_cv_lib_$ac_lib_var=no"
9076 fi
9077 rm -f conftest*
9078 LIBS="$ac_save_LIBS"
9079
9080 fi
9081 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9082   echo "$ac_t""yes" 1>&6
9083     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9084     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9085   cat >> confdefs.h <<EOF
9086 #define $ac_tr_lib 1
9087 EOF
9088
9089   LIBS="-lV3 $LIBS"
9090
9091 else
9092   echo "$ac_t""no" 1>&6
9093 fi
9094
9095
9096 echo $ac_n "checking for winsock""... $ac_c" 1>&6
9097 echo "configure:9098: checking for winsock" >&5
9098 save_LIBS="$LIBS"
9099 for curlib in ws2_32 wsock32; do
9100         LIBS="$LIBS -l$curlib"
9101         cat > conftest.$ac_ext <<EOF
9102 #line 9103 "configure"
9103 #include "confdefs.h"
9104
9105                         char socket@12();
9106                         char select@20();
9107                         char closesocket@4();
9108                         char gethostname@8();
9109                         
9110 int main() {
9111
9112                         socket@12();
9113                         select@20();
9114                         closesocket@4();
9115                         gethostname@8();
9116                         
9117 ; return 0; }
9118 EOF
9119 if { (eval echo configure:9120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9120   rm -rf conftest*
9121   have_winsock=yes
9122 else
9123   echo "configure: failed program was:" >&5
9124   cat conftest.$ac_ext >&5
9125   rm -rf conftest*
9126   have_winsock=no
9127 fi
9128 rm -f conftest*
9129
9130         if test $have_winsock = yes; then
9131                 cat >> confdefs.h <<\EOF
9132 #define HAVE_WINSOCK 1
9133 EOF
9134
9135                 ac_cv_func_socket=yes
9136                 ac_cv_func_select=yes
9137                 ac_cv_func_closesocket=yes
9138                 ac_cv_func_gethostname=yes
9139                 if test $curlib = ws2_32; then
9140                         have_winsock=winsock2
9141                         cat >> confdefs.h <<\EOF
9142 #define HAVE_WINSOCK2 1
9143 EOF
9144
9145                 fi
9146                 break
9147         fi
9148         LIBS="$save_LIBS"
9149 done
9150 echo "$ac_t""$have_winsock" 1>&6
9151
9152
9153 echo $ac_n "checking for socket""... $ac_c" 1>&6
9154 echo "configure:9155: checking for socket" >&5
9155 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
9156   echo $ac_n "(cached) $ac_c" 1>&6
9157 else
9158   cat > conftest.$ac_ext <<EOF
9159 #line 9160 "configure"
9160 #include "confdefs.h"
9161 /* System header to define __stub macros and hopefully few prototypes,
9162     which can conflict with char socket(); below.  */
9163 #include <assert.h>
9164 /* Override any gcc2 internal prototype to avoid an error.  */
9165 /* We use char because int might match the return type of a gcc2
9166     builtin and then its argument prototype would still apply.  */
9167 char socket();
9168 char (*f)();
9169
9170 int main() {
9171
9172 /* The GNU C library defines this for functions which it implements
9173     to always fail with ENOSYS.  Some functions are actually named
9174     something starting with __ and the normal name is an alias.  */
9175 #if defined (__stub_socket) || defined (__stub___socket)
9176 choke me
9177 #else
9178 f = socket;
9179 #endif
9180
9181 ; return 0; }
9182 EOF
9183 if { (eval echo configure:9184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9184   rm -rf conftest*
9185   eval "ac_cv_func_socket=yes"
9186 else
9187   echo "configure: failed program was:" >&5
9188   cat conftest.$ac_ext >&5
9189   rm -rf conftest*
9190   eval "ac_cv_func_socket=no"
9191 fi
9192 rm -f conftest*
9193 fi
9194
9195 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
9196   echo "$ac_t""yes" 1>&6
9197   :
9198 else
9199   echo "$ac_t""no" 1>&6
9200         
9201         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
9202 echo "configure:9203: checking for main in -lsocket" >&5
9203 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
9204 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9205   echo $ac_n "(cached) $ac_c" 1>&6
9206 else
9207   ac_save_LIBS="$LIBS"
9208 LIBS="-lsocket  $LIBS"
9209 cat > conftest.$ac_ext <<EOF
9210 #line 9211 "configure"
9211 #include "confdefs.h"
9212
9213 int main() {
9214 main()
9215 ; return 0; }
9216 EOF
9217 if { (eval echo configure:9218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9218   rm -rf conftest*
9219   eval "ac_cv_lib_$ac_lib_var=yes"
9220 else
9221   echo "configure: failed program was:" >&5
9222   cat conftest.$ac_ext >&5
9223   rm -rf conftest*
9224   eval "ac_cv_lib_$ac_lib_var=no"
9225 fi
9226 rm -f conftest*
9227 LIBS="$ac_save_LIBS"
9228
9229 fi
9230 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9231   echo "$ac_t""yes" 1>&6
9232     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9233     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9234   cat >> confdefs.h <<EOF
9235 #define $ac_tr_lib 1
9236 EOF
9237
9238   LIBS="-lsocket $LIBS"
9239
9240 else
9241   echo "$ac_t""no" 1>&6
9242 fi
9243
9244         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
9245 echo "configure:9246: checking for main in -lnet" >&5
9246 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
9247 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9248   echo $ac_n "(cached) $ac_c" 1>&6
9249 else
9250   ac_save_LIBS="$LIBS"
9251 LIBS="-lnet  $LIBS"
9252 cat > conftest.$ac_ext <<EOF
9253 #line 9254 "configure"
9254 #include "confdefs.h"
9255
9256 int main() {
9257 main()
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_lib_$ac_lib_var=yes"
9263 else
9264   echo "configure: failed program was:" >&5
9265   cat conftest.$ac_ext >&5
9266   rm -rf conftest*
9267   eval "ac_cv_lib_$ac_lib_var=no"
9268 fi
9269 rm -f conftest*
9270 LIBS="$ac_save_LIBS"
9271
9272 fi
9273 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9274   echo "$ac_t""yes" 1>&6
9275     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9276     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9277   cat >> confdefs.h <<EOF
9278 #define $ac_tr_lib 1
9279 EOF
9280
9281   LIBS="-lnet $LIBS"
9282
9283 else
9284   echo "$ac_t""no" 1>&6
9285 fi
9286
9287         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
9288 echo "configure:9289: checking for main in -lnsl_s" >&5
9289 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
9290 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9291   echo $ac_n "(cached) $ac_c" 1>&6
9292 else
9293   ac_save_LIBS="$LIBS"
9294 LIBS="-lnsl_s  $LIBS"
9295 cat > conftest.$ac_ext <<EOF
9296 #line 9297 "configure"
9297 #include "confdefs.h"
9298
9299 int main() {
9300 main()
9301 ; return 0; }
9302 EOF
9303 if { (eval echo configure:9304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9304   rm -rf conftest*
9305   eval "ac_cv_lib_$ac_lib_var=yes"
9306 else
9307   echo "configure: failed program was:" >&5
9308   cat conftest.$ac_ext >&5
9309   rm -rf conftest*
9310   eval "ac_cv_lib_$ac_lib_var=no"
9311 fi
9312 rm -f conftest*
9313 LIBS="$ac_save_LIBS"
9314
9315 fi
9316 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9317   echo "$ac_t""yes" 1>&6
9318     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9319     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9320   cat >> confdefs.h <<EOF
9321 #define $ac_tr_lib 1
9322 EOF
9323
9324   LIBS="-lnsl_s $LIBS"
9325
9326 else
9327   echo "$ac_t""no" 1>&6
9328 fi
9329
9330         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
9331 echo "configure:9332: checking for main in -lnsl" >&5
9332 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
9333 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9334   echo $ac_n "(cached) $ac_c" 1>&6
9335 else
9336   ac_save_LIBS="$LIBS"
9337 LIBS="-lnsl  $LIBS"
9338 cat > conftest.$ac_ext <<EOF
9339 #line 9340 "configure"
9340 #include "confdefs.h"
9341
9342 int main() {
9343 main()
9344 ; return 0; }
9345 EOF
9346 if { (eval echo configure:9347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9347   rm -rf conftest*
9348   eval "ac_cv_lib_$ac_lib_var=yes"
9349 else
9350   echo "configure: failed program was:" >&5
9351   cat conftest.$ac_ext >&5
9352   rm -rf conftest*
9353   eval "ac_cv_lib_$ac_lib_var=no"
9354 fi
9355 rm -f conftest*
9356 LIBS="$ac_save_LIBS"
9357
9358 fi
9359 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9360   echo "$ac_t""yes" 1>&6
9361     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9362     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9363   cat >> confdefs.h <<EOF
9364 #define $ac_tr_lib 1
9365 EOF
9366
9367   LIBS="-lnsl $LIBS"
9368
9369 else
9370   echo "$ac_t""no" 1>&6
9371 fi
9372
9373         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
9374 echo "configure:9375: checking for socket in -linet" >&5
9375 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
9376 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9377   echo $ac_n "(cached) $ac_c" 1>&6
9378 else
9379   ac_save_LIBS="$LIBS"
9380 LIBS="-linet  $LIBS"
9381 cat > conftest.$ac_ext <<EOF
9382 #line 9383 "configure"
9383 #include "confdefs.h"
9384 /* Override any gcc2 internal prototype to avoid an error.  */
9385 /* We use char because int might match the return type of a gcc2
9386     builtin and then its argument prototype would still apply.  */
9387 char socket();
9388
9389 int main() {
9390 socket()
9391 ; return 0; }
9392 EOF
9393 if { (eval echo configure:9394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9394   rm -rf conftest*
9395   eval "ac_cv_lib_$ac_lib_var=yes"
9396 else
9397   echo "configure: failed program was:" >&5
9398   cat conftest.$ac_ext >&5
9399   rm -rf conftest*
9400   eval "ac_cv_lib_$ac_lib_var=no"
9401 fi
9402 rm -f conftest*
9403 LIBS="$ac_save_LIBS"
9404
9405 fi
9406 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9407   echo "$ac_t""yes" 1>&6
9408     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9409     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9410   cat >> confdefs.h <<EOF
9411 #define $ac_tr_lib 1
9412 EOF
9413
9414   LIBS="-linet $LIBS"
9415
9416 else
9417   echo "$ac_t""no" 1>&6
9418 fi
9419
9420         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
9421 echo "configure:9422: checking for main in -lgen" >&5
9422 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
9423 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9424   echo $ac_n "(cached) $ac_c" 1>&6
9425 else
9426   ac_save_LIBS="$LIBS"
9427 LIBS="-lgen  $LIBS"
9428 cat > conftest.$ac_ext <<EOF
9429 #line 9430 "configure"
9430 #include "confdefs.h"
9431
9432 int main() {
9433 main()
9434 ; return 0; }
9435 EOF
9436 if { (eval echo configure:9437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9437   rm -rf conftest*
9438   eval "ac_cv_lib_$ac_lib_var=yes"
9439 else
9440   echo "configure: failed program was:" >&5
9441   cat conftest.$ac_ext >&5
9442   rm -rf conftest*
9443   eval "ac_cv_lib_$ac_lib_var=no"
9444 fi
9445 rm -f conftest*
9446 LIBS="$ac_save_LIBS"
9447
9448 fi
9449 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9450   echo "$ac_t""yes" 1>&6
9451     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9452     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9453   cat >> confdefs.h <<EOF
9454 #define $ac_tr_lib 1
9455 EOF
9456
9457   LIBS="-lgen $LIBS"
9458
9459 else
9460   echo "$ac_t""no" 1>&6
9461 fi
9462
9463
9464 fi
9465
9466
9467 echo $ac_n "checking for select""... $ac_c" 1>&6
9468 echo "configure:9469: checking for select" >&5
9469 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
9470   echo $ac_n "(cached) $ac_c" 1>&6
9471 else
9472   cat > conftest.$ac_ext <<EOF
9473 #line 9474 "configure"
9474 #include "confdefs.h"
9475 /* System header to define __stub macros and hopefully few prototypes,
9476     which can conflict with char select(); below.  */
9477 #include <assert.h>
9478 /* Override any gcc2 internal prototype to avoid an error.  */
9479 /* We use char because int might match the return type of a gcc2
9480     builtin and then its argument prototype would still apply.  */
9481 char select();
9482 char (*f)();
9483
9484 int main() {
9485
9486 /* The GNU C library defines this for functions which it implements
9487     to always fail with ENOSYS.  Some functions are actually named
9488     something starting with __ and the normal name is an alias.  */
9489 #if defined (__stub_select) || defined (__stub___select)
9490 choke me
9491 #else
9492 f = select;
9493 #endif
9494
9495 ; return 0; }
9496 EOF
9497 if { (eval echo configure:9498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9498   rm -rf conftest*
9499   eval "ac_cv_func_select=yes"
9500 else
9501   echo "configure: failed program was:" >&5
9502   cat conftest.$ac_ext >&5
9503   rm -rf conftest*
9504   eval "ac_cv_func_select=no"
9505 fi
9506 rm -f conftest*
9507 fi
9508
9509 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
9510   echo "$ac_t""yes" 1>&6
9511   :
9512 else
9513   echo "$ac_t""no" 1>&6
9514 { echo "configure: error: select() required." 1>&2; exit 1; }
9515 fi
9516
9517
9518 if test "${ac_cv_header_winsock_h}" != yes; then
9519                                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
9520 echo "configure:9521: checking types of arguments for select()" >&5
9521  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
9522   echo $ac_n "(cached) $ac_c" 1>&6
9523 else
9524    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
9525   echo $ac_n "(cached) $ac_c" 1>&6
9526 else
9527     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
9528   echo $ac_n "(cached) $ac_c" 1>&6
9529 else
9530      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
9531      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
9532       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
9533        cat > conftest.$ac_ext <<EOF
9534 #line 9535 "configure"
9535 #include "confdefs.h"
9536 #ifdef HAVE_SYS_TYPES_H
9537 #include <sys/types.h>
9538 #endif
9539 #ifdef HAVE_SYS_TIME_H
9540 #include <sys/time.h>
9541 #endif
9542 #ifdef HAVE_SYS_SELECT_H
9543 #include <sys/select.h>
9544 #endif
9545 #ifdef HAVE_SYS_SOCKET_H
9546 #include <sys/socket.h>
9547 #endif
9548 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);
9549 int main() {
9550
9551 ; return 0; }
9552 EOF
9553 if { (eval echo configure:9554: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9554   rm -rf conftest*
9555           ac_not_found=no ; break 3
9556 else
9557   echo "configure: failed program was:" >&5
9558   cat conftest.$ac_ext >&5
9559   rm -rf conftest*
9560   ac_not_found=yes
9561 fi
9562 rm -f conftest*
9563       done
9564      done
9565     done
9566    
9567 fi
9568   
9569 fi
9570  
9571 fi
9572  if test "$ac_not_found" = yes; then
9573   ac_cv_func_select_arg1=int 
9574   ac_cv_func_select_arg234='int *' 
9575   ac_cv_func_select_arg5='struct timeval *'
9576  fi
9577  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
9578  cat >> confdefs.h <<EOF
9579 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
9580 EOF
9581
9582  cat >> confdefs.h <<EOF
9583 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
9584 EOF
9585
9586  cat >> confdefs.h <<EOF
9587 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
9588 EOF
9589
9590
9591 fi
9592
9593
9594 for ac_hdr in regex.h 
9595 do
9596 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9597 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9598 echo "configure:9599: checking for $ac_hdr" >&5
9599 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9600   echo $ac_n "(cached) $ac_c" 1>&6
9601 else
9602   cat > conftest.$ac_ext <<EOF
9603 #line 9604 "configure"
9604 #include "confdefs.h"
9605 #include <$ac_hdr>
9606 EOF
9607 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9608 { (eval echo configure:9609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9609 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9610 if test -z "$ac_err"; then
9611   rm -rf conftest*
9612   eval "ac_cv_header_$ac_safe=yes"
9613 else
9614   echo "$ac_err" >&5
9615   echo "configure: failed program was:" >&5
9616   cat conftest.$ac_ext >&5
9617   rm -rf conftest*
9618   eval "ac_cv_header_$ac_safe=no"
9619 fi
9620 rm -f conftest*
9621 fi
9622 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9623   echo "$ac_t""yes" 1>&6
9624     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9625   cat >> confdefs.h <<EOF
9626 #define $ac_tr_hdr 1
9627 EOF
9628  
9629 else
9630   echo "$ac_t""no" 1>&6
9631 fi
9632 done
9633
9634 if test "$ac_cv_header_regex_h" != yes ; then
9635         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
9636 fi
9637
9638 echo $ac_n "checking for library containing regfree""... $ac_c" 1>&6
9639 echo "configure:9640: checking for library containing regfree" >&5
9640 if eval "test \"\${ac_cv_search_regfree+set}\" = set"; then
9641   echo $ac_n "(cached) $ac_c" 1>&6
9642 else
9643   ac_func_search_save_LIBS="$LIBS"
9644 ac_cv_search_regfree="no"
9645 cat > conftest.$ac_ext <<EOF
9646 #line 9647 "configure"
9647 #include "confdefs.h"
9648 /* Override any gcc2 internal prototype to avoid an error.  */
9649 /* We use char because int might match the return type of a gcc2
9650     builtin and then its argument prototype would still apply.  */
9651 char regfree();
9652
9653 int main() {
9654 regfree()
9655 ; return 0; }
9656 EOF
9657 if { (eval echo configure:9658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9658   rm -rf conftest*
9659   ac_cv_search_regfree="none required"
9660 else
9661   echo "configure: failed program was:" >&5
9662   cat conftest.$ac_ext >&5
9663 fi
9664 rm -f conftest*
9665 test "$ac_cv_search_regfree" = "no" && for ac_lib in regex gnuregex; do
9666 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9667 cat > conftest.$ac_ext <<EOF
9668 #line 9669 "configure"
9669 #include "confdefs.h"
9670 /* Override any gcc2 internal prototype to avoid an error.  */
9671 /* We use char because int might match the return type of a gcc2
9672     builtin and then its argument prototype would still apply.  */
9673 char regfree();
9674
9675 int main() {
9676 regfree()
9677 ; return 0; }
9678 EOF
9679 if { (eval echo configure:9680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9680   rm -rf conftest*
9681   ac_cv_search_regfree="-l$ac_lib"
9682 break
9683 else
9684   echo "configure: failed program was:" >&5
9685   cat conftest.$ac_ext >&5
9686 fi
9687 rm -f conftest*
9688 done
9689 LIBS="$ac_func_search_save_LIBS"
9690 fi
9691
9692 echo "$ac_t""$ac_cv_search_regfree" 1>&6
9693 if test "$ac_cv_search_regfree" != "no"; then
9694   test "$ac_cv_search_regfree" = "none required" || LIBS="$ac_cv_search_regfree $LIBS"
9695   :
9696 else :
9697   { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
9698 fi
9699
9700
9701 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
9702 echo "configure:9703: checking for compatible POSIX regex" >&5
9703 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
9704   echo $ac_n "(cached) $ac_c" 1>&6
9705 else
9706   
9707         if test "$cross_compiling" = yes; then
9708   ol_cv_c_posix_regex=cross
9709 else
9710   cat > conftest.$ac_ext <<EOF
9711 #line 9712 "configure"
9712 #include "confdefs.h"
9713
9714 #include <sys/types.h>
9715 #include <regex.h>
9716 static char *pattern, *string;
9717 main()
9718 {
9719         int rc;
9720         regex_t re;
9721
9722         pattern = "^A";
9723
9724         if(regcomp(&re, pattern, 0)) {
9725                 return -1;
9726         }
9727         
9728         string = "ALL MATCH";
9729         
9730         rc = regexec(&re, string, 0, (void*)0, 0);
9731
9732         regfree(&re);
9733
9734         return rc;
9735 }
9736 EOF
9737 if { (eval echo configure:9738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9738 then
9739   ol_cv_c_posix_regex=yes
9740 else
9741   echo "configure: failed program was:" >&5
9742   cat conftest.$ac_ext >&5
9743   rm -fr conftest*
9744   ol_cv_c_posix_regex=no
9745 fi
9746 rm -fr conftest*
9747 fi
9748
9749 fi
9750
9751 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
9752
9753 if test "$ol_cv_c_posix_regex" = no ; then
9754         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
9755 fi
9756
9757
9758 have_uuid=no
9759 for ac_hdr in sys/uuid.h
9760 do
9761 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9762 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9763 echo "configure:9764: checking for $ac_hdr" >&5
9764 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9765   echo $ac_n "(cached) $ac_c" 1>&6
9766 else
9767   cat > conftest.$ac_ext <<EOF
9768 #line 9769 "configure"
9769 #include "confdefs.h"
9770 #include <$ac_hdr>
9771 EOF
9772 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9773 { (eval echo configure:9774: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9774 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9775 if test -z "$ac_err"; then
9776   rm -rf conftest*
9777   eval "ac_cv_header_$ac_safe=yes"
9778 else
9779   echo "$ac_err" >&5
9780   echo "configure: failed program was:" >&5
9781   cat conftest.$ac_ext >&5
9782   rm -rf conftest*
9783   eval "ac_cv_header_$ac_safe=no"
9784 fi
9785 rm -f conftest*
9786 fi
9787 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9788   echo "$ac_t""yes" 1>&6
9789     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9790   cat >> confdefs.h <<EOF
9791 #define $ac_tr_hdr 1
9792 EOF
9793  
9794 else
9795   echo "$ac_t""no" 1>&6
9796 fi
9797 done
9798
9799 if test $ac_cv_header_sys_uuid_h = yes ; then
9800         save_LIBS="$LIBS"
9801         
9802 echo $ac_n "checking for library containing uuid_to_str""... $ac_c" 1>&6
9803 echo "configure:9804: checking for library containing uuid_to_str" >&5
9804 if eval "test \"\${ac_cv_search_uuid_to_str+set}\" = set"; then
9805   echo $ac_n "(cached) $ac_c" 1>&6
9806 else
9807   ac_func_search_save_LIBS="$LIBS"
9808 ac_cv_search_uuid_to_str="no"
9809 cat > conftest.$ac_ext <<EOF
9810 #line 9811 "configure"
9811 #include "confdefs.h"
9812 /* Override any gcc2 internal prototype to avoid an error.  */
9813 /* We use char because int might match the return type of a gcc2
9814     builtin and then its argument prototype would still apply.  */
9815 char uuid_to_str();
9816
9817 int main() {
9818 uuid_to_str()
9819 ; return 0; }
9820 EOF
9821 if { (eval echo configure:9822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9822   rm -rf conftest*
9823   ac_cv_search_uuid_to_str="none required"
9824 else
9825   echo "configure: failed program was:" >&5
9826   cat conftest.$ac_ext >&5
9827 fi
9828 rm -f conftest*
9829 test "$ac_cv_search_uuid_to_str" = "no" && for ac_lib in uuid; do
9830 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9831 cat > conftest.$ac_ext <<EOF
9832 #line 9833 "configure"
9833 #include "confdefs.h"
9834 /* Override any gcc2 internal prototype to avoid an error.  */
9835 /* We use char because int might match the return type of a gcc2
9836     builtin and then its argument prototype would still apply.  */
9837 char uuid_to_str();
9838
9839 int main() {
9840 uuid_to_str()
9841 ; return 0; }
9842 EOF
9843 if { (eval echo configure:9844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9844   rm -rf conftest*
9845   ac_cv_search_uuid_to_str="-l$ac_lib"
9846 break
9847 else
9848   echo "configure: failed program was:" >&5
9849   cat conftest.$ac_ext >&5
9850 fi
9851 rm -f conftest*
9852 done
9853 LIBS="$ac_func_search_save_LIBS"
9854 fi
9855
9856 echo "$ac_t""$ac_cv_search_uuid_to_str" 1>&6
9857 if test "$ac_cv_search_uuid_to_str" != "no"; then
9858   test "$ac_cv_search_uuid_to_str" = "none required" || LIBS="$ac_cv_search_uuid_to_str $LIBS"
9859   have_uuid=yes
9860 else :
9861   :
9862 fi
9863         LIBS="$save_LIBS"
9864
9865         if test have_uuid = yes ; then
9866                 cat >> confdefs.h <<\EOF
9867 #define HAVE_UUID_TO_STR 1
9868 EOF
9869
9870
9871                 test "$ac_cv_search_uuid_to_str" = "none required" || \
9872                         SLAPD_LIBS="$SLAPD_LIBS $ac_cv_search_uuid_to_str"
9873         fi
9874 fi
9875
9876 if test $have_uuid = no ; then
9877         echo $ac_n "checking to see if -lrpcrt4 is needed for win32 UUID support""... $ac_c" 1>&6
9878 echo "configure:9879: checking to see if -lrpcrt4 is needed for win32 UUID support" >&5
9879         save_LIBS="$LIBS"
9880         LIBS="$LIBS -lrpcrt4"
9881         cat > conftest.$ac_ext <<EOF
9882 #line 9883 "configure"
9883 #include "confdefs.h"
9884
9885                 char UuidCreate@4();
9886                 char UuidToStringA@8();
9887                 
9888 int main() {
9889
9890                 UuidCreate@4();
9891                 UuidToStringA@8();
9892                 
9893 ; return 0; }
9894 EOF
9895 if { (eval echo configure:9896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9896   rm -rf conftest*
9897   need_rpcrt=yes
9898 else
9899   echo "configure: failed program was:" >&5
9900   cat conftest.$ac_ext >&5
9901   rm -rf conftest*
9902   need_rpcrt=no
9903 fi
9904 rm -f conftest*
9905         if test $need_rpcrt = yes; then
9906                 SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
9907         fi
9908         LIBS="$save_LIBS"
9909         echo "$ac_t""$need_rpcrt" 1>&6
9910 fi
9911
9912 ol_link_dnssrv=no
9913 echo $ac_n "checking for res_query""... $ac_c" 1>&6
9914 echo "configure:9915: checking for res_query" >&5
9915 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
9916   echo $ac_n "(cached) $ac_c" 1>&6
9917 else
9918   cat > conftest.$ac_ext <<EOF
9919 #line 9920 "configure"
9920 #include "confdefs.h"
9921 /* System header to define __stub macros and hopefully few prototypes,
9922     which can conflict with char res_query(); below.  */
9923 #include <assert.h>
9924 /* Override any gcc2 internal prototype to avoid an error.  */
9925 /* We use char because int might match the return type of a gcc2
9926     builtin and then its argument prototype would still apply.  */
9927 char res_query();
9928 char (*f)();
9929
9930 int main() {
9931
9932 /* The GNU C library defines this for functions which it implements
9933     to always fail with ENOSYS.  Some functions are actually named
9934     something starting with __ and the normal name is an alias.  */
9935 #if defined (__stub_res_query) || defined (__stub___res_query)
9936 choke me
9937 #else
9938 f = res_query;
9939 #endif
9940
9941 ; return 0; }
9942 EOF
9943 if { (eval echo configure:9944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9944   rm -rf conftest*
9945   eval "ac_cv_func_res_query=yes"
9946 else
9947   echo "configure: failed program was:" >&5
9948   cat conftest.$ac_ext >&5
9949   rm -rf conftest*
9950   eval "ac_cv_func_res_query=no"
9951 fi
9952 rm -f conftest*
9953 fi
9954
9955 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
9956   echo "$ac_t""yes" 1>&6
9957   :
9958 else
9959   echo "$ac_t""no" 1>&6
9960 fi
9961
9962 if test $ac_cv_func_res_query = no ; then 
9963         echo $ac_n "checking for __res_query""... $ac_c" 1>&6
9964 echo "configure:9965: checking for __res_query" >&5
9965 if eval "test \"\${ac_cv_func___res_query+set}\" = set"; then
9966   echo $ac_n "(cached) $ac_c" 1>&6
9967 else
9968   cat > conftest.$ac_ext <<EOF
9969 #line 9970 "configure"
9970 #include "confdefs.h"
9971 /* System header to define __stub macros and hopefully few prototypes,
9972     which can conflict with char __res_query(); below.  */
9973 #include <assert.h>
9974 /* Override any gcc2 internal prototype to avoid an error.  */
9975 /* We use char because int might match the return type of a gcc2
9976     builtin and then its argument prototype would still apply.  */
9977 char __res_query();
9978 char (*f)();
9979
9980 int main() {
9981
9982 /* The GNU C library defines this for functions which it implements
9983     to always fail with ENOSYS.  Some functions are actually named
9984     something starting with __ and the normal name is an alias.  */
9985 #if defined (__stub___res_query) || defined (__stub_____res_query)
9986 choke me
9987 #else
9988 f = __res_query;
9989 #endif
9990
9991 ; return 0; }
9992 EOF
9993 if { (eval echo configure:9994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9994   rm -rf conftest*
9995   eval "ac_cv_func___res_query=yes"
9996 else
9997   echo "configure: failed program was:" >&5
9998   cat conftest.$ac_ext >&5
9999   rm -rf conftest*
10000   eval "ac_cv_func___res_query=no"
10001 fi
10002 rm -f conftest*
10003 fi
10004
10005 if eval "test \"`echo '$ac_cv_func_'__res_query`\" = yes"; then
10006   echo "$ac_t""yes" 1>&6
10007   :
10008 else
10009   echo "$ac_t""no" 1>&6
10010 fi
10011
10012         ac_cv_func_res_query=$ac_cv_func___res_query
10013 fi
10014
10015 if test $ac_cv_func_res_query = no ; then 
10016         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
10017 echo "configure:10018: checking for res_query in -lbind" >&5
10018 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
10019 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10020   echo $ac_n "(cached) $ac_c" 1>&6
10021 else
10022   ac_save_LIBS="$LIBS"
10023 LIBS="-lbind  $LIBS"
10024 cat > conftest.$ac_ext <<EOF
10025 #line 10026 "configure"
10026 #include "confdefs.h"
10027 /* Override any gcc2 internal prototype to avoid an error.  */
10028 /* We use char because int might match the return type of a gcc2
10029     builtin and then its argument prototype would still apply.  */
10030 char res_query();
10031
10032 int main() {
10033 res_query()
10034 ; return 0; }
10035 EOF
10036 if { (eval echo configure:10037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10037   rm -rf conftest*
10038   eval "ac_cv_lib_$ac_lib_var=yes"
10039 else
10040   echo "configure: failed program was:" >&5
10041   cat conftest.$ac_ext >&5
10042   rm -rf conftest*
10043   eval "ac_cv_lib_$ac_lib_var=no"
10044 fi
10045 rm -f conftest*
10046 LIBS="$ac_save_LIBS"
10047
10048 fi
10049 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10050   echo "$ac_t""yes" 1>&6
10051     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10052     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10053   cat >> confdefs.h <<EOF
10054 #define $ac_tr_lib 1
10055 EOF
10056
10057   LIBS="-lbind $LIBS"
10058
10059 else
10060   echo "$ac_t""no" 1>&6
10061 fi
10062
10063         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
10064 fi
10065
10066 if test $ac_cv_func_res_query = no ; then 
10067         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
10068 echo "configure:10069: checking for __res_query in -lbind" >&5
10069 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
10070 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10071   echo $ac_n "(cached) $ac_c" 1>&6
10072 else
10073   ac_save_LIBS="$LIBS"
10074 LIBS="-lbind  $LIBS"
10075 cat > conftest.$ac_ext <<EOF
10076 #line 10077 "configure"
10077 #include "confdefs.h"
10078 /* Override any gcc2 internal prototype to avoid an error.  */
10079 /* We use char because int might match the return type of a gcc2
10080     builtin and then its argument prototype would still apply.  */
10081 char __res_query();
10082
10083 int main() {
10084 __res_query()
10085 ; return 0; }
10086 EOF
10087 if { (eval echo configure:10088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10088   rm -rf conftest*
10089   eval "ac_cv_lib_$ac_lib_var=yes"
10090 else
10091   echo "configure: failed program was:" >&5
10092   cat conftest.$ac_ext >&5
10093   rm -rf conftest*
10094   eval "ac_cv_lib_$ac_lib_var=no"
10095 fi
10096 rm -f conftest*
10097 LIBS="$ac_save_LIBS"
10098
10099 fi
10100 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10101   echo "$ac_t""yes" 1>&6
10102     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10103     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10104   cat >> confdefs.h <<EOF
10105 #define $ac_tr_lib 1
10106 EOF
10107
10108   LIBS="-lbind $LIBS"
10109
10110 else
10111   echo "$ac_t""no" 1>&6
10112 fi
10113
10114         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
10115 fi
10116
10117 if test $ac_cv_func_res_query = no ; then 
10118         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
10119 echo "configure:10120: checking for res_query in -lresolv" >&5
10120 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
10121 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10122   echo $ac_n "(cached) $ac_c" 1>&6
10123 else
10124   ac_save_LIBS="$LIBS"
10125 LIBS="-lresolv  $LIBS"
10126 cat > conftest.$ac_ext <<EOF
10127 #line 10128 "configure"
10128 #include "confdefs.h"
10129 /* Override any gcc2 internal prototype to avoid an error.  */
10130 /* We use char because int might match the return type of a gcc2
10131     builtin and then its argument prototype would still apply.  */
10132 char res_query();
10133
10134 int main() {
10135 res_query()
10136 ; return 0; }
10137 EOF
10138 if { (eval echo configure:10139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10139   rm -rf conftest*
10140   eval "ac_cv_lib_$ac_lib_var=yes"
10141 else
10142   echo "configure: failed program was:" >&5
10143   cat conftest.$ac_ext >&5
10144   rm -rf conftest*
10145   eval "ac_cv_lib_$ac_lib_var=no"
10146 fi
10147 rm -f conftest*
10148 LIBS="$ac_save_LIBS"
10149
10150 fi
10151 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10152   echo "$ac_t""yes" 1>&6
10153     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10154     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10155   cat >> confdefs.h <<EOF
10156 #define $ac_tr_lib 1
10157 EOF
10158
10159   LIBS="-lresolv $LIBS"
10160
10161 else
10162   echo "$ac_t""no" 1>&6
10163 fi
10164
10165         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
10166 fi
10167
10168 if test $ac_cv_func_res_query = no ; then 
10169         echo $ac_n "checking for __res_query in -lresolv""... $ac_c" 1>&6
10170 echo "configure:10171: checking for __res_query in -lresolv" >&5
10171 ac_lib_var=`echo resolv'_'__res_query | sed 'y%./+-:%__p__%'`
10172 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10173   echo $ac_n "(cached) $ac_c" 1>&6
10174 else
10175   ac_save_LIBS="$LIBS"
10176 LIBS="-lresolv  $LIBS"
10177 cat > conftest.$ac_ext <<EOF
10178 #line 10179 "configure"
10179 #include "confdefs.h"
10180 /* Override any gcc2 internal prototype to avoid an error.  */
10181 /* We use char because int might match the return type of a gcc2
10182     builtin and then its argument prototype would still apply.  */
10183 char __res_query();
10184
10185 int main() {
10186 __res_query()
10187 ; return 0; }
10188 EOF
10189 if { (eval echo configure:10190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10190   rm -rf conftest*
10191   eval "ac_cv_lib_$ac_lib_var=yes"
10192 else
10193   echo "configure: failed program was:" >&5
10194   cat conftest.$ac_ext >&5
10195   rm -rf conftest*
10196   eval "ac_cv_lib_$ac_lib_var=no"
10197 fi
10198 rm -f conftest*
10199 LIBS="$ac_save_LIBS"
10200
10201 fi
10202 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10203   echo "$ac_t""yes" 1>&6
10204     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10205     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10206   cat >> confdefs.h <<EOF
10207 #define $ac_tr_lib 1
10208 EOF
10209
10210   LIBS="-lresolv $LIBS"
10211
10212 else
10213   echo "$ac_t""no" 1>&6
10214 fi
10215
10216         ac_cv_func_res_query=$ac_cv_lib_resolv___res_query
10217 fi
10218
10219 if test "$ac_cv_func_res_query" = yes ; then
10220         cat >> confdefs.h <<\EOF
10221 #define HAVE_RES_QUERY 1
10222 EOF
10223
10224
10225         if test $ol_enable_dnssrv != no ; then
10226                 ol_link_dnssrv=yes
10227         fi
10228 fi
10229
10230 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
10231         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
10232 fi
10233
10234 for ac_func in getaddrinfo gai_strerror inet_ntop 
10235 do
10236 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10237 echo "configure:10238: checking for $ac_func" >&5
10238 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10239   echo $ac_n "(cached) $ac_c" 1>&6
10240 else
10241   cat > conftest.$ac_ext <<EOF
10242 #line 10243 "configure"
10243 #include "confdefs.h"
10244 /* System header to define __stub macros and hopefully few prototypes,
10245     which can conflict with char $ac_func(); below.  */
10246 #include <assert.h>
10247 /* Override any gcc2 internal prototype to avoid an error.  */
10248 /* We use char because int might match the return type of a gcc2
10249     builtin and then its argument prototype would still apply.  */
10250 char $ac_func();
10251 char (*f)();
10252
10253 int main() {
10254
10255 /* The GNU C library defines this for functions which it implements
10256     to always fail with ENOSYS.  Some functions are actually named
10257     something starting with __ and the normal name is an alias.  */
10258 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10259 choke me
10260 #else
10261 f = $ac_func;
10262 #endif
10263
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_func_$ac_func=yes"
10269 else
10270   echo "configure: failed program was:" >&5
10271   cat conftest.$ac_ext >&5
10272   rm -rf conftest*
10273   eval "ac_cv_func_$ac_func=no"
10274 fi
10275 rm -f conftest*
10276 fi
10277
10278 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10279   echo "$ac_t""yes" 1>&6
10280     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10281   cat >> confdefs.h <<EOF
10282 #define $ac_tr_func 1
10283 EOF
10284  
10285 else
10286   echo "$ac_t""no" 1>&6
10287 fi
10288 done
10289
10290
10291 ol_link_ipv6=no
10292 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
10293         if test $ol_enable_ipv6 = yes ; then
10294                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
10295         fi
10296 elif test $ol_enable_ipv6 != no ; then
10297         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
10298 echo "configure:10299: checking INET6_ADDRSTRLEN" >&5
10299 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
10300   echo $ac_n "(cached) $ac_c" 1>&6
10301 else
10302   
10303                 cat > conftest.$ac_ext <<EOF
10304 #line 10305 "configure"
10305 #include "confdefs.h"
10306
10307 #                       include <netinet/in.h>
10308 #                       ifdef INET6_ADDRSTRLEN
10309                                 __has_inet6_addrstrlen__;
10310 #                       endif
10311                 
10312 EOF
10313 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10314   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
10315   rm -rf conftest*
10316   ol_cv_inet6_addrstrlen=yes
10317 else
10318   rm -rf conftest*
10319   ol_cv_inet6_addrstrlen=no
10320 fi
10321 rm -f conftest*
10322
10323 fi
10324
10325 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
10326
10327         if test $ol_cv_inet6_addrstrlen = yes ; then
10328                 ol_link_ipv6=yes
10329         elif test $ol_enable_ipv6 = yes ; then
10330                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
10331         fi
10332 fi
10333
10334 if test $ol_enable_local != no ; then
10335         for ac_hdr in sys/un.h 
10336 do
10337 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10338 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10339 echo "configure:10340: checking for $ac_hdr" >&5
10340 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10341   echo $ac_n "(cached) $ac_c" 1>&6
10342 else
10343   cat > conftest.$ac_ext <<EOF
10344 #line 10345 "configure"
10345 #include "confdefs.h"
10346 #include <$ac_hdr>
10347 EOF
10348 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10349 { (eval echo configure:10350: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10350 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10351 if test -z "$ac_err"; then
10352   rm -rf conftest*
10353   eval "ac_cv_header_$ac_safe=yes"
10354 else
10355   echo "$ac_err" >&5
10356   echo "configure: failed program was:" >&5
10357   cat conftest.$ac_ext >&5
10358   rm -rf conftest*
10359   eval "ac_cv_header_$ac_safe=no"
10360 fi
10361 rm -f conftest*
10362 fi
10363 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10364   echo "$ac_t""yes" 1>&6
10365     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10366   cat >> confdefs.h <<EOF
10367 #define $ac_tr_hdr 1
10368 EOF
10369  
10370 else
10371   echo "$ac_t""no" 1>&6
10372 fi
10373 done
10374
10375
10376         if test $ol_enable_local = auto ; then
10377                 ol_enable_local=$ac_cv_header_sys_un_h
10378         elif test $ac_cv_header_sys_un_h = no ; then
10379                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
10380         fi
10381 fi
10382
10383 ol_link_kbind=no
10384 ol_link_kpasswd=no
10385 ol_link_krb5=no
10386 ol_link_krb4=no
10387
10388 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
10389         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
10390         -o $ol_with_kerberos = k425 ; then
10391
10392         for ac_hdr in krb5.h
10393 do
10394 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10395 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10396 echo "configure:10397: checking for $ac_hdr" >&5
10397 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10398   echo $ac_n "(cached) $ac_c" 1>&6
10399 else
10400   cat > conftest.$ac_ext <<EOF
10401 #line 10402 "configure"
10402 #include "confdefs.h"
10403 #include <$ac_hdr>
10404 EOF
10405 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10406 { (eval echo configure:10407: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10407 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10408 if test -z "$ac_err"; then
10409   rm -rf conftest*
10410   eval "ac_cv_header_$ac_safe=yes"
10411 else
10412   echo "$ac_err" >&5
10413   echo "configure: failed program was:" >&5
10414   cat conftest.$ac_ext >&5
10415   rm -rf conftest*
10416   eval "ac_cv_header_$ac_safe=no"
10417 fi
10418 rm -f conftest*
10419 fi
10420 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10421   echo "$ac_t""yes" 1>&6
10422     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10423   cat >> confdefs.h <<EOF
10424 #define $ac_tr_hdr 1
10425 EOF
10426  
10427 else
10428   echo "$ac_t""no" 1>&6
10429 fi
10430 done
10431
10432
10433         if test $ac_cv_header_krb5_h = yes ; then
10434                                 for ac_hdr in heim_err.h
10435 do
10436 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10437 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10438 echo "configure:10439: checking for $ac_hdr" >&5
10439 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10440   echo $ac_n "(cached) $ac_c" 1>&6
10441 else
10442   cat > conftest.$ac_ext <<EOF
10443 #line 10444 "configure"
10444 #include "confdefs.h"
10445 #include <$ac_hdr>
10446 EOF
10447 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10448 { (eval echo configure:10449: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10449 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10450 if test -z "$ac_err"; then
10451   rm -rf conftest*
10452   eval "ac_cv_header_$ac_safe=yes"
10453 else
10454   echo "$ac_err" >&5
10455   echo "configure: failed program was:" >&5
10456   cat conftest.$ac_ext >&5
10457   rm -rf conftest*
10458   eval "ac_cv_header_$ac_safe=no"
10459 fi
10460 rm -f conftest*
10461 fi
10462 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10463   echo "$ac_t""yes" 1>&6
10464     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10465   cat >> confdefs.h <<EOF
10466 #define $ac_tr_hdr 1
10467 EOF
10468  
10469 else
10470   echo "$ac_t""no" 1>&6
10471 fi
10472 done
10473
10474                 if test $ac_cv_header_heim_err_h = yes ; then
10475                         krb5_impl=heimdal
10476                 else
10477                         krb5_impl=mit
10478                 fi
10479
10480                 if test $krb5_impl = mit; then
10481                         echo $ac_n "checking for main in -lk5crypto""... $ac_c" 1>&6
10482 echo "configure:10483: checking for main in -lk5crypto" >&5
10483 ac_lib_var=`echo k5crypto'_'main | sed 'y%./+-:%__p__%'`
10484 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10485   echo $ac_n "(cached) $ac_c" 1>&6
10486 else
10487   ac_save_LIBS="$LIBS"
10488 LIBS="-lk5crypto  $LIBS"
10489 cat > conftest.$ac_ext <<EOF
10490 #line 10491 "configure"
10491 #include "confdefs.h"
10492
10493 int main() {
10494 main()
10495 ; return 0; }
10496 EOF
10497 if { (eval echo configure:10498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10498   rm -rf conftest*
10499   eval "ac_cv_lib_$ac_lib_var=yes"
10500 else
10501   echo "configure: failed program was:" >&5
10502   cat conftest.$ac_ext >&5
10503   rm -rf conftest*
10504   eval "ac_cv_lib_$ac_lib_var=no"
10505 fi
10506 rm -f conftest*
10507 LIBS="$ac_save_LIBS"
10508
10509 fi
10510 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10511   echo "$ac_t""yes" 1>&6
10512   krb5crypto=k5crypto
10513 else
10514   echo "$ac_t""no" 1>&6
10515 krb5crypto=crypto
10516 fi
10517
10518
10519                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
10520 echo "configure:10521: checking for main in -lkrb5" >&5
10521 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
10522 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10523   echo $ac_n "(cached) $ac_c" 1>&6
10524 else
10525   ac_save_LIBS="$LIBS"
10526 LIBS="-lkrb5 -l$krb5crypto -lcom_err $LIBS"
10527 cat > conftest.$ac_ext <<EOF
10528 #line 10529 "configure"
10529 #include "confdefs.h"
10530
10531 int main() {
10532 main()
10533 ; return 0; }
10534 EOF
10535 if { (eval echo configure:10536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10536   rm -rf conftest*
10537   eval "ac_cv_lib_$ac_lib_var=yes"
10538 else
10539   echo "configure: failed program was:" >&5
10540   cat conftest.$ac_ext >&5
10541   rm -rf conftest*
10542   eval "ac_cv_lib_$ac_lib_var=no"
10543 fi
10544 rm -f conftest*
10545 LIBS="$ac_save_LIBS"
10546
10547 fi
10548 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10549   echo "$ac_t""yes" 1>&6
10550   have_krb5=yes
10551                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lcom_err"
10552 else
10553   echo "$ac_t""no" 1>&6
10554 have_krb5=no
10555 fi
10556
10557
10558                 elif test $krb5_impl = heimdal; then
10559                         echo $ac_n "checking for main in -ldes""... $ac_c" 1>&6
10560 echo "configure:10561: checking for main in -ldes" >&5
10561 ac_lib_var=`echo des'_'main | sed 'y%./+-:%__p__%'`
10562 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10563   echo $ac_n "(cached) $ac_c" 1>&6
10564 else
10565   ac_save_LIBS="$LIBS"
10566 LIBS="-ldes  $LIBS"
10567 cat > conftest.$ac_ext <<EOF
10568 #line 10569 "configure"
10569 #include "confdefs.h"
10570
10571 int main() {
10572 main()
10573 ; return 0; }
10574 EOF
10575 if { (eval echo configure:10576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10576   rm -rf conftest*
10577   eval "ac_cv_lib_$ac_lib_var=yes"
10578 else
10579   echo "configure: failed program was:" >&5
10580   cat conftest.$ac_ext >&5
10581   rm -rf conftest*
10582   eval "ac_cv_lib_$ac_lib_var=no"
10583 fi
10584 rm -f conftest*
10585 LIBS="$ac_save_LIBS"
10586
10587 fi
10588 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10589   echo "$ac_t""yes" 1>&6
10590   krb5crypto=des
10591 else
10592   echo "$ac_t""no" 1>&6
10593 krb5crypto=crypto
10594 fi
10595
10596
10597                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
10598 echo "configure:10599: checking for main in -lkrb5" >&5
10599 ac_lib_var=`echo krb5'_'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="-lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err $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   have_krb5=yes
10629                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err"
10630 else
10631   echo "$ac_t""no" 1>&6
10632 have_krb5=no
10633 fi
10634
10635
10636                         cat >> confdefs.h <<\EOF
10637 #define HAVE_HEIMDAL_KERBEROS 1
10638 EOF
10639
10640
10641                 else
10642                         have_krb5=no
10643                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
10644                 fi
10645
10646                 if test $have_krb5 = yes ; then
10647                         ol_link_krb5=yes
10648
10649                         cat >> confdefs.h <<\EOF
10650 #define HAVE_KRB5 1
10651 EOF
10652
10653
10654                         if test $ol_enable_kpasswd != no ; then
10655                                 ol_link_kpasswd=yes;
10656                         fi
10657
10658                         if test $ol_with_kerberos = k5only ; then
10659                                 ol_with_kerberos=found
10660                         fi
10661
10662                 elif test $ol_with_kerberos != auto ; then
10663                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
10664                 fi
10665
10666         fi
10667 fi
10668
10669 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
10670         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
10671
10672         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
10673 do
10674 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10675 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10676 echo "configure:10677: checking for $ac_hdr" >&5
10677 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10678   echo $ac_n "(cached) $ac_c" 1>&6
10679 else
10680   cat > conftest.$ac_ext <<EOF
10681 #line 10682 "configure"
10682 #include "confdefs.h"
10683 #include <$ac_hdr>
10684 EOF
10685 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10686 { (eval echo configure:10687: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10687 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10688 if test -z "$ac_err"; then
10689   rm -rf conftest*
10690   eval "ac_cv_header_$ac_safe=yes"
10691 else
10692   echo "$ac_err" >&5
10693   echo "configure: failed program was:" >&5
10694   cat conftest.$ac_ext >&5
10695   rm -rf conftest*
10696   eval "ac_cv_header_$ac_safe=no"
10697 fi
10698 rm -f conftest*
10699 fi
10700 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10701   echo "$ac_t""yes" 1>&6
10702     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10703   cat >> confdefs.h <<EOF
10704 #define $ac_tr_hdr 1
10705 EOF
10706  
10707 else
10708   echo "$ac_t""no" 1>&6
10709 fi
10710 done
10711
10712
10713         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
10714                 if test $krb5_impl = mit; then
10715                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
10716 echo "configure:10717: checking for main in -lkrb4" >&5
10717 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
10718 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10719   echo $ac_n "(cached) $ac_c" 1>&6
10720 else
10721   ac_save_LIBS="$LIBS"
10722 LIBS="-lkrb4 -ldes425 -lkrb5 -l$krb5crypto -lcom_err $LIBS"
10723 cat > conftest.$ac_ext <<EOF
10724 #line 10725 "configure"
10725 #include "confdefs.h"
10726
10727 int main() {
10728 main()
10729 ; return 0; }
10730 EOF
10731 if { (eval echo configure:10732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10732   rm -rf conftest*
10733   eval "ac_cv_lib_$ac_lib_var=yes"
10734 else
10735   echo "configure: failed program was:" >&5
10736   cat conftest.$ac_ext >&5
10737   rm -rf conftest*
10738   eval "ac_cv_lib_$ac_lib_var=no"
10739 fi
10740 rm -f conftest*
10741 LIBS="$ac_save_LIBS"
10742
10743 fi
10744 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10745   echo "$ac_t""yes" 1>&6
10746   have_k425=yes
10747                                 KRB4_LIBS="-lkrb4 -ldes425"
10748 else
10749   echo "$ac_t""no" 1>&6
10750 have_k425=no
10751 fi
10752
10753
10754                 elif test $krb5_impl = heimdal; then
10755                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
10756 echo "configure:10757: checking for main in -lkrb4" >&5
10757 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
10758 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10759   echo $ac_n "(cached) $ac_c" 1>&6
10760 else
10761   ac_save_LIBS="$LIBS"
10762 LIBS="-lkrb4 -lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err $LIBS"
10763 cat > conftest.$ac_ext <<EOF
10764 #line 10765 "configure"
10765 #include "confdefs.h"
10766
10767 int main() {
10768 main()
10769 ; return 0; }
10770 EOF
10771 if { (eval echo configure:10772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10772   rm -rf conftest*
10773   eval "ac_cv_lib_$ac_lib_var=yes"
10774 else
10775   echo "configure: failed program was:" >&5
10776   cat conftest.$ac_ext >&5
10777   rm -rf conftest*
10778   eval "ac_cv_lib_$ac_lib_var=no"
10779 fi
10780 rm -f conftest*
10781 LIBS="$ac_save_LIBS"
10782
10783 fi
10784 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10785   echo "$ac_t""yes" 1>&6
10786   have_k425=yes
10787                                 KRB4_LIBS="-lkrb4"
10788 else
10789   echo "$ac_t""no" 1>&6
10790 have_k425=no
10791 fi
10792
10793
10794                 else
10795                         have_425=no
10796                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
10797                 fi
10798
10799                 if test $have_k425 = yes ; then
10800                         ol_with_kerberos=found
10801                         ol_link_krb4=yes
10802
10803                         cat >> confdefs.h <<\EOF
10804 #define HAVE_KRB425 1
10805 EOF
10806
10807                         cat >> confdefs.h <<\EOF
10808 #define HAVE_KRB4 1
10809 EOF
10810
10811
10812                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
10813 echo "configure:10814: checking for des_debug in Kerberos libraries" >&5
10814 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
10815   echo $ac_n "(cached) $ac_c" 1>&6
10816 else
10817   
10818                                                                 save_LIBS="$LIBS"
10819                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
10820                                 cat > conftest.$ac_ext <<EOF
10821 #line 10822 "configure"
10822 #include "confdefs.h"
10823
10824 #include <kerberosIV/krb.h>
10825 #include <kerberosIV/des.h>
10826 extern int des_debug;
10827
10828 int main() {
10829
10830 des_debug = 1;
10831
10832 ; return 0; }
10833 EOF
10834 if { (eval echo configure:10835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10835   rm -rf conftest*
10836   ol_cv_var_des_debug=yes
10837 else
10838   echo "configure: failed program was:" >&5
10839   cat conftest.$ac_ext >&5
10840   rm -rf conftest*
10841   ol_cv_var_des_debug=no
10842 fi
10843 rm -f conftest*
10844                                                                 LIBS="$save_LIBS"
10845                         
10846 fi
10847
10848 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
10849
10850                         if test $ol_cv_var_des_debug = yes ; then
10851                                 cat >> confdefs.h <<\EOF
10852 #define HAVE_DES_DEBUG 1
10853 EOF
10854
10855                         fi
10856
10857                         LIBS="$save_LIBS"
10858                 fi
10859         fi
10860 fi
10861
10862 if test $ol_link_krb5 = yes ; then
10863         ol_with_kerberos=found
10864 fi
10865
10866 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
10867         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
10868
10869         for ac_hdr in krb.h des.h krb-archaeology.h 
10870 do
10871 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10872 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10873 echo "configure:10874: checking for $ac_hdr" >&5
10874 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10875   echo $ac_n "(cached) $ac_c" 1>&6
10876 else
10877   cat > conftest.$ac_ext <<EOF
10878 #line 10879 "configure"
10879 #include "confdefs.h"
10880 #include <$ac_hdr>
10881 EOF
10882 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10883 { (eval echo configure:10884: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10884 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10885 if test -z "$ac_err"; then
10886   rm -rf conftest*
10887   eval "ac_cv_header_$ac_safe=yes"
10888 else
10889   echo "$ac_err" >&5
10890   echo "configure: failed program was:" >&5
10891   cat conftest.$ac_ext >&5
10892   rm -rf conftest*
10893   eval "ac_cv_header_$ac_safe=no"
10894 fi
10895 rm -f conftest*
10896 fi
10897 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10898   echo "$ac_t""yes" 1>&6
10899     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10900   cat >> confdefs.h <<EOF
10901 #define $ac_tr_hdr 1
10902 EOF
10903  
10904 else
10905   echo "$ac_t""no" 1>&6
10906 fi
10907 done
10908
10909
10910         if test $ac_cv_header_krb_h = yes ; then
10911                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
10912 echo "configure:10913: checking for main in -lkrb" >&5
10913 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
10914 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10915   echo $ac_n "(cached) $ac_c" 1>&6
10916 else
10917   ac_save_LIBS="$LIBS"
10918 LIBS="-lkrb -ldes $LIBS"
10919 cat > conftest.$ac_ext <<EOF
10920 #line 10921 "configure"
10921 #include "confdefs.h"
10922
10923 int main() {
10924 main()
10925 ; return 0; }
10926 EOF
10927 if { (eval echo configure:10928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10928   rm -rf conftest*
10929   eval "ac_cv_lib_$ac_lib_var=yes"
10930 else
10931   echo "configure: failed program was:" >&5
10932   cat conftest.$ac_ext >&5
10933   rm -rf conftest*
10934   eval "ac_cv_lib_$ac_lib_var=no"
10935 fi
10936 rm -f conftest*
10937 LIBS="$ac_save_LIBS"
10938
10939 fi
10940 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10941   echo "$ac_t""yes" 1>&6
10942   have_k4=yes
10943 else
10944   echo "$ac_t""no" 1>&6
10945 have_k4=no
10946 fi
10947
10948
10949                 if test $have_k4 = yes ; then
10950                         ol_with_kerberos=found
10951                         ol_link_krb4=yes
10952
10953                         cat >> confdefs.h <<\EOF
10954 #define HAVE_KRB4 1
10955 EOF
10956
10957
10958                         KRB4_LIBS="-lkrb -ldes"
10959
10960                         if test $ac_cv_header_krb_archaeology_h = yes ; then
10961                                 cat >> confdefs.h <<\EOF
10962 #define HAVE_KTH_KERBEROS 1
10963 EOF
10964
10965                         fi
10966                 fi
10967         fi
10968 fi
10969
10970 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
10971         ol_link_kpasswd=yes
10972 fi
10973
10974 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
10975         ol_link_kbind=yes
10976
10977 elif test $ol_enable_kbind = yes ; then
10978         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
10979 fi
10980
10981 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
10982         cat >> confdefs.h <<\EOF
10983 #define HAVE_KERBEROS 1
10984 EOF
10985
10986
10987 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
10988         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
10989 fi
10990
10991 ol_link_tls=no
10992 if test $ol_with_tls != no ; then
10993         for ac_hdr in openssl/ssl.h ssl.h
10994 do
10995 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10996 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10997 echo "configure:10998: checking for $ac_hdr" >&5
10998 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10999   echo $ac_n "(cached) $ac_c" 1>&6
11000 else
11001   cat > conftest.$ac_ext <<EOF
11002 #line 11003 "configure"
11003 #include "confdefs.h"
11004 #include <$ac_hdr>
11005 EOF
11006 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11007 { (eval echo configure:11008: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11008 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11009 if test -z "$ac_err"; then
11010   rm -rf conftest*
11011   eval "ac_cv_header_$ac_safe=yes"
11012 else
11013   echo "$ac_err" >&5
11014   echo "configure: failed program was:" >&5
11015   cat conftest.$ac_ext >&5
11016   rm -rf conftest*
11017   eval "ac_cv_header_$ac_safe=no"
11018 fi
11019 rm -f conftest*
11020 fi
11021 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11022   echo "$ac_t""yes" 1>&6
11023     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11024   cat >> confdefs.h <<EOF
11025 #define $ac_tr_hdr 1
11026 EOF
11027  
11028 else
11029   echo "$ac_t""no" 1>&6
11030 fi
11031 done
11032
11033         
11034         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
11035                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
11036 echo "configure:11037: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
11037 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
11038 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11039   echo $ac_n "(cached) $ac_c" 1>&6
11040 else
11041   ac_save_LIBS="$LIBS"
11042 LIBS="-lssl -lcrypto $LIBS"
11043 cat > conftest.$ac_ext <<EOF
11044 #line 11045 "configure"
11045 #include "confdefs.h"
11046 /* Override any gcc2 internal prototype to avoid an error.  */
11047 /* We use char because int might match the return type of a gcc2
11048     builtin and then its argument prototype would still apply.  */
11049 char SSLeay_add_ssl_algorithms();
11050
11051 int main() {
11052 SSLeay_add_ssl_algorithms()
11053 ; return 0; }
11054 EOF
11055 if { (eval echo configure:11056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11056   rm -rf conftest*
11057   eval "ac_cv_lib_$ac_lib_var=yes"
11058 else
11059   echo "configure: failed program was:" >&5
11060   cat conftest.$ac_ext >&5
11061   rm -rf conftest*
11062   eval "ac_cv_lib_$ac_lib_var=no"
11063 fi
11064 rm -f conftest*
11065 LIBS="$ac_save_LIBS"
11066
11067 fi
11068 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11069   echo "$ac_t""yes" 1>&6
11070   have_ssleay=yes
11071                         need_rsaref=no
11072 else
11073   echo "$ac_t""no" 1>&6
11074 have_ssleay=no
11075 fi
11076
11077                         
11078                 if test $have_ssleay = no ; then
11079                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
11080 echo "configure:11081: checking for SSL_library_init in -lssl" >&5
11081 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
11082 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11083   echo $ac_n "(cached) $ac_c" 1>&6
11084 else
11085   ac_save_LIBS="$LIBS"
11086 LIBS="-lssl -lcrypto $LIBS"
11087 cat > conftest.$ac_ext <<EOF
11088 #line 11089 "configure"
11089 #include "confdefs.h"
11090 /* Override any gcc2 internal prototype to avoid an error.  */
11091 /* We use char because int might match the return type of a gcc2
11092     builtin and then its argument prototype would still apply.  */
11093 char SSL_library_init();
11094
11095 int main() {
11096 SSL_library_init()
11097 ; return 0; }
11098 EOF
11099 if { (eval echo configure:11100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11100   rm -rf conftest*
11101   eval "ac_cv_lib_$ac_lib_var=yes"
11102 else
11103   echo "configure: failed program was:" >&5
11104   cat conftest.$ac_ext >&5
11105   rm -rf conftest*
11106   eval "ac_cv_lib_$ac_lib_var=no"
11107 fi
11108 rm -f conftest*
11109 LIBS="$ac_save_LIBS"
11110
11111 fi
11112 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11113   echo "$ac_t""yes" 1>&6
11114   have_ssleay=yes
11115                                 need_rsaref=no
11116 else
11117   echo "$ac_t""no" 1>&6
11118 have_ssleay=no
11119 fi
11120
11121                 fi
11122
11123                 if test $have_ssleay = no ; then
11124                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
11125 echo "configure:11126: checking for ssl3_accept in -lssl" >&5
11126 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
11127 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11128   echo $ac_n "(cached) $ac_c" 1>&6
11129 else
11130   ac_save_LIBS="$LIBS"
11131 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
11132 cat > conftest.$ac_ext <<EOF
11133 #line 11134 "configure"
11134 #include "confdefs.h"
11135 /* Override any gcc2 internal prototype to avoid an error.  */
11136 /* We use char because int might match the return type of a gcc2
11137     builtin and then its argument prototype would still apply.  */
11138 char ssl3_accept();
11139
11140 int main() {
11141 ssl3_accept()
11142 ; return 0; }
11143 EOF
11144 if { (eval echo configure:11145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11145   rm -rf conftest*
11146   eval "ac_cv_lib_$ac_lib_var=yes"
11147 else
11148   echo "configure: failed program was:" >&5
11149   cat conftest.$ac_ext >&5
11150   rm -rf conftest*
11151   eval "ac_cv_lib_$ac_lib_var=no"
11152 fi
11153 rm -f conftest*
11154 LIBS="$ac_save_LIBS"
11155
11156 fi
11157 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11158   echo "$ac_t""yes" 1>&6
11159   have_ssleay=yes
11160                                 need_rsaref=yes
11161 else
11162   echo "$ac_t""no" 1>&6
11163 have_ssleay=no
11164 fi
11165
11166                 fi
11167
11168                 if test $have_ssleay = yes ; then
11169                         ol_with_tls=found
11170                         ol_link_tls=yes
11171
11172                         cat >> confdefs.h <<\EOF
11173 #define HAVE_SSLEAY 1
11174 EOF
11175
11176
11177                         if test $need_rsaref = yes; then
11178                                 cat >> confdefs.h <<\EOF
11179 #define HAVE_RSAREF 1
11180 EOF
11181
11182
11183                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
11184                         else
11185                                 TLS_LIBS="-lssl -lcrypto"
11186                         fi
11187                 fi
11188         fi
11189
11190 else
11191         echo "configure: warning: TLS data protection not supported!" 1>&2
11192 fi
11193
11194 if test $ol_link_tls = yes ; then
11195         cat >> confdefs.h <<\EOF
11196 #define HAVE_TLS 1
11197 EOF
11198
11199
11200 elif test $ol_with_tls = auto ; then
11201         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
11202         echo "configure: warning: TLS data protection not supported!" 1>&2
11203
11204 elif test $ol_with_tls != no ; then
11205         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
11206 fi
11207
11208 if test $ol_enable_lmpasswd != no; then
11209         if test $ol_link_tls != yes ; then
11210                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
11211         fi
11212
11213         cat >> confdefs.h <<\EOF
11214 #define SLAPD_LMHASH 1
11215 EOF
11216
11217 fi
11218
11219 for ac_func in \
11220         ctime_r                 \
11221         gethostbyname_r gethostbyaddr_r \
11222
11223 do
11224 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11225 echo "configure:11226: checking for $ac_func" >&5
11226 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11227   echo $ac_n "(cached) $ac_c" 1>&6
11228 else
11229   cat > conftest.$ac_ext <<EOF
11230 #line 11231 "configure"
11231 #include "confdefs.h"
11232 /* System header to define __stub macros and hopefully few prototypes,
11233     which can conflict with char $ac_func(); below.  */
11234 #include <assert.h>
11235 /* Override any gcc2 internal prototype to avoid an error.  */
11236 /* We use char because int might match the return type of a gcc2
11237     builtin and then its argument prototype would still apply.  */
11238 char $ac_func();
11239 char (*f)();
11240
11241 int main() {
11242
11243 /* The GNU C library defines this for functions which it implements
11244     to always fail with ENOSYS.  Some functions are actually named
11245     something starting with __ and the normal name is an alias.  */
11246 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11247 choke me
11248 #else
11249 f = $ac_func;
11250 #endif
11251
11252 ; return 0; }
11253 EOF
11254 if { (eval echo configure:11255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11255   rm -rf conftest*
11256   eval "ac_cv_func_$ac_func=yes"
11257 else
11258   echo "configure: failed program was:" >&5
11259   cat conftest.$ac_ext >&5
11260   rm -rf conftest*
11261   eval "ac_cv_func_$ac_func=no"
11262 fi
11263 rm -f conftest*
11264 fi
11265
11266 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11267   echo "$ac_t""yes" 1>&6
11268     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11269   cat >> confdefs.h <<EOF
11270 #define $ac_tr_func 1
11271 EOF
11272  
11273 else
11274   echo "$ac_t""no" 1>&6
11275 fi
11276 done
11277
11278
11279 if test "$ac_cv_func_ctime_r" = no ; then
11280         ol_cv_func_ctime_r_nargs=0
11281 else
11282         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
11283 echo "configure:11284: checking number of arguments of ctime_r" >&5
11284 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
11285   echo $ac_n "(cached) $ac_c" 1>&6
11286 else
11287   cat > conftest.$ac_ext <<EOF
11288 #line 11289 "configure"
11289 #include "confdefs.h"
11290 #include <time.h>
11291 int main() {
11292 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
11293 ; return 0; }
11294 EOF
11295 if { (eval echo configure:11296: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11296   rm -rf conftest*
11297   ol_cv_func_ctime_r_nargs3=yes
11298 else
11299   echo "configure: failed program was:" >&5
11300   cat conftest.$ac_ext >&5
11301   rm -rf conftest*
11302   ol_cv_func_ctime_r_nargs3=no
11303 fi
11304 rm -f conftest*
11305
11306         cat > conftest.$ac_ext <<EOF
11307 #line 11308 "configure"
11308 #include "confdefs.h"
11309 #include <time.h>
11310 int main() {
11311 time_t ti; char *buffer; ctime_r(&ti,buffer);
11312 ; return 0; }
11313 EOF
11314 if { (eval echo configure:11315: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11315   rm -rf conftest*
11316   ol_cv_func_ctime_r_nargs2=yes
11317 else
11318   echo "configure: failed program was:" >&5
11319   cat conftest.$ac_ext >&5
11320   rm -rf conftest*
11321   ol_cv_func_ctime_r_nargs2=no
11322 fi
11323 rm -f conftest*
11324
11325         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
11326                 $ol_cv_func_ctime_r_nargs2 = no ; then
11327
11328                 ol_cv_func_ctime_r_nargs=3
11329
11330         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
11331                 $ol_cv_func_ctime_r_nargs2 = yes ; then
11332
11333                 ol_cv_func_ctime_r_nargs=2
11334
11335         else
11336                 ol_cv_func_ctime_r_nargs=0
11337         fi
11338   
11339 fi
11340
11341 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
11342
11343   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
11344         cat >> confdefs.h <<EOF
11345 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
11346 EOF
11347
11348   fi
11349
11350 fi
11351
11352 if test "$ac_cv_func_gethostbyname_r" = yes ; then
11353         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
11354 echo "configure:11355: checking number of arguments of gethostbyname_r" >&5
11355 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
11356   echo $ac_n "(cached) $ac_c" 1>&6
11357 else
11358   cat > conftest.$ac_ext <<EOF
11359 #line 11360 "configure"
11360 #include "confdefs.h"
11361 #include <sys/types.h>
11362 #include <sys/socket.h>
11363 #include <netinet/in.h>
11364 #include <netdb.h>
11365 #define BUFSIZE (sizeof(struct hostent)+10)
11366 int main() {
11367 struct hostent hent; char buffer[BUFSIZE];
11368                 int bufsize=BUFSIZE;int h_errno;
11369                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
11370                         buffer, bufsize, &h_errno);
11371 ; return 0; }
11372 EOF
11373 if { (eval echo configure:11374: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11374   rm -rf conftest*
11375   ol_cv_func_gethostbyname_r_nargs5=yes
11376 else
11377   echo "configure: failed program was:" >&5
11378   cat conftest.$ac_ext >&5
11379   rm -rf conftest*
11380   ol_cv_func_gethostbyname_r_nargs5=no
11381 fi
11382 rm -f conftest*
11383
11384         cat > conftest.$ac_ext <<EOF
11385 #line 11386 "configure"
11386 #include "confdefs.h"
11387 #include <sys/types.h>
11388 #include <sys/socket.h>
11389 #include <netinet/in.h>
11390 #include <netdb.h>
11391 #define BUFSIZE (sizeof(struct hostent)+10)
11392 int main() {
11393 struct hostent hent;struct hostent *rhent;
11394                 char buffer[BUFSIZE];
11395                 int bufsize=BUFSIZE;int h_errno;
11396                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
11397                         &rhent, &h_errno);
11398 ; return 0; }
11399 EOF
11400 if { (eval echo configure:11401: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11401   rm -rf conftest*
11402   ol_cv_func_gethostbyname_r_nargs6=yes
11403 else
11404   echo "configure: failed program was:" >&5
11405   cat conftest.$ac_ext >&5
11406   rm -rf conftest*
11407   ol_cv_func_gethostbyname_r_nargs6=no
11408 fi
11409 rm -f conftest*
11410
11411         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
11412                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
11413
11414                 ol_cv_func_gethostbyname_r_nargs=5
11415
11416         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
11417                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
11418
11419                 ol_cv_func_gethostbyname_r_nargs=6
11420
11421         else
11422                 ol_cv_func_gethostbyname_r_nargs=0
11423         fi
11424   
11425 fi
11426
11427 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
11428   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
11429         cat >> confdefs.h <<EOF
11430 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
11431 EOF
11432
11433   fi
11434
11435 else
11436         ol_cv_func_gethostbyname_r_nargs=0
11437 fi
11438  
11439 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
11440         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
11441 echo "configure:11442: checking number of arguments of gethostbyaddr_r" >&5
11442 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
11443   echo $ac_n "(cached) $ac_c" 1>&6
11444 else
11445   cat > conftest.$ac_ext <<EOF
11446 #line 11447 "configure"
11447 #include "confdefs.h"
11448 #include <sys/types.h>
11449 #include <sys/socket.h>
11450 #include <netinet/in.h>
11451 #include <netdb.h>
11452 #define BUFSIZE (sizeof(struct hostent)+10)
11453 int main() {
11454 struct hostent hent; char buffer[BUFSIZE]; 
11455             struct in_addr add;
11456             size_t alen=sizeof(struct in_addr);
11457             int bufsize=BUFSIZE;int h_errno;
11458                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
11459                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
11460 ; return 0; }
11461 EOF
11462 if { (eval echo configure:11463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11463   rm -rf conftest*
11464   ol_cv_func_gethostbyaddr_r_nargs7=yes
11465 else
11466   echo "configure: failed program was:" >&5
11467   cat conftest.$ac_ext >&5
11468   rm -rf conftest*
11469   ol_cv_func_gethostbyaddr_r_nargs7=no
11470 fi
11471 rm -f conftest*
11472
11473         cat > conftest.$ac_ext <<EOF
11474 #line 11475 "configure"
11475 #include "confdefs.h"
11476 #include <sys/types.h>
11477 #include <sys/socket.h>
11478 #include <netinet/in.h>
11479 #include <netdb.h>
11480 #define BUFSIZE (sizeof(struct hostent)+10)
11481 int main() {
11482 struct hostent hent;
11483                 struct hostent *rhent; char buffer[BUFSIZE]; 
11484                 struct in_addr add;
11485                 size_t alen=sizeof(struct in_addr);
11486                 int bufsize=BUFSIZE;int h_errno;
11487                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
11488                         alen, AF_INET, &hent, buffer, bufsize, 
11489                         &rhent, &h_errno);
11490 ; return 0; }
11491 EOF
11492 if { (eval echo configure:11493: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11493   rm -rf conftest*
11494   ol_cv_func_gethostbyaddr_r_nargs8=yes
11495 else
11496   echo "configure: failed program was:" >&5
11497   cat conftest.$ac_ext >&5
11498   rm -rf conftest*
11499   ol_cv_func_gethostbyaddr_r_nargs8=no
11500 fi
11501 rm -f conftest*
11502
11503         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
11504                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
11505
11506                 ol_cv_func_gethostbyaddr_r_nargs=7
11507
11508         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
11509                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
11510
11511                 ol_cv_func_gethostbyaddr_r_nargs=8
11512
11513         else
11514                 ol_cv_func_gethostbyaddr_r_nargs=0
11515         fi
11516   
11517 fi
11518
11519 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
11520   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
11521     cat >> confdefs.h <<EOF
11522 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
11523 EOF
11524
11525   fi
11526
11527 else
11528         ol_cv_func_gethostbyaddr_r_nargs=0
11529 fi
11530
11531 if test "$ac_cv_func_ctime_r" = yes \
11532         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
11533         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
11534         -a "$ac_cv_func_gethostbyname_r" = yes \
11535         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
11536         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
11537         -a "$ac_cv_func_gethostbyaddr_r" = yes \
11538         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
11539         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
11540         ; then
11541  
11542         cat >> confdefs.h <<\EOF
11543 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
11544 EOF
11545
11546 fi
11547
11548 ol_link_threads=no
11549
11550 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11551         -o $ol_with_threads = nt ; then
11552
11553         
11554         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
11555 echo "configure:11556: checking for _beginthread" >&5
11556 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
11557   echo $ac_n "(cached) $ac_c" 1>&6
11558 else
11559   cat > conftest.$ac_ext <<EOF
11560 #line 11561 "configure"
11561 #include "confdefs.h"
11562 /* System header to define __stub macros and hopefully few prototypes,
11563     which can conflict with char _beginthread(); below.  */
11564 #include <assert.h>
11565 /* Override any gcc2 internal prototype to avoid an error.  */
11566 /* We use char because int might match the return type of a gcc2
11567     builtin and then its argument prototype would still apply.  */
11568 char _beginthread();
11569 char (*f)();
11570
11571 int main() {
11572
11573 /* The GNU C library defines this for functions which it implements
11574     to always fail with ENOSYS.  Some functions are actually named
11575     something starting with __ and the normal name is an alias.  */
11576 #if defined (__stub__beginthread) || defined (__stub____beginthread)
11577 choke me
11578 #else
11579 f = _beginthread;
11580 #endif
11581
11582 ; return 0; }
11583 EOF
11584 if { (eval echo configure:11585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11585   rm -rf conftest*
11586   eval "ac_cv_func__beginthread=yes"
11587 else
11588   echo "configure: failed program was:" >&5
11589   cat conftest.$ac_ext >&5
11590   rm -rf conftest*
11591   eval "ac_cv_func__beginthread=no"
11592 fi
11593 rm -f conftest*
11594 fi
11595
11596 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
11597   echo "$ac_t""yes" 1>&6
11598   :
11599 else
11600   echo "$ac_t""no" 1>&6
11601 fi
11602
11603
11604         if test $ac_cv_func__beginthread = yes ; then
11605                 cat >> confdefs.h <<\EOF
11606 #define HAVE_NT_THREADS 1
11607 EOF
11608
11609                 ol_cv_nt_threads=yes
11610         fi
11611
11612
11613         if test "$ol_cv_nt_threads" = yes ; then
11614                 ol_link_threads=nt
11615                 ol_with_threads=found
11616                 ol_with_yielding_select=yes
11617
11618                 cat >> confdefs.h <<\EOF
11619 #define HAVE_NT_SERVICE_MANAGER 1
11620 EOF
11621
11622                 cat >> confdefs.h <<\EOF
11623 #define HAVE_NT_EVENT_LOG 1
11624 EOF
11625
11626         fi
11627
11628         if test $ol_with_threads = nt ; then
11629                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
11630         fi
11631 fi
11632
11633 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11634         -o $ol_with_threads = posix ; then
11635
11636         for ac_hdr in pthread.h
11637 do
11638 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11639 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11640 echo "configure:11641: checking for $ac_hdr" >&5
11641 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11642   echo $ac_n "(cached) $ac_c" 1>&6
11643 else
11644   cat > conftest.$ac_ext <<EOF
11645 #line 11646 "configure"
11646 #include "confdefs.h"
11647 #include <$ac_hdr>
11648 EOF
11649 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11650 { (eval echo configure:11651: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11651 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11652 if test -z "$ac_err"; then
11653   rm -rf conftest*
11654   eval "ac_cv_header_$ac_safe=yes"
11655 else
11656   echo "$ac_err" >&5
11657   echo "configure: failed program was:" >&5
11658   cat conftest.$ac_ext >&5
11659   rm -rf conftest*
11660   eval "ac_cv_header_$ac_safe=no"
11661 fi
11662 rm -f conftest*
11663 fi
11664 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11665   echo "$ac_t""yes" 1>&6
11666     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11667   cat >> confdefs.h <<EOF
11668 #define $ac_tr_hdr 1
11669 EOF
11670  
11671 else
11672   echo "$ac_t""no" 1>&6
11673 fi
11674 done
11675
11676
11677         if test $ac_cv_header_pthread_h = yes ; then
11678                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
11679 echo "configure:11680: checking POSIX thread version" >&5
11680 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
11681   echo $ac_n "(cached) $ac_c" 1>&6
11682 else
11683   
11684         cat > conftest.$ac_ext <<EOF
11685 #line 11686 "configure"
11686 #include "confdefs.h"
11687
11688 #               include <pthread.h>
11689                 /* this check could be improved */
11690 #               ifdef PTHREAD_ONCE_INIT
11691                         pthread_version_final;
11692 #               endif
11693         
11694 EOF
11695 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11696   egrep "pthread_version_final" >/dev/null 2>&1; then
11697   rm -rf conftest*
11698   ol_pthread_final=yes
11699 else
11700   rm -rf conftest*
11701   ol_pthread_final=no
11702 fi
11703 rm -f conftest*
11704
11705
11706         cat > conftest.$ac_ext <<EOF
11707 #line 11708 "configure"
11708 #include "confdefs.h"
11709
11710 #               include <pthread.h>
11711                 /* this check could be improved */
11712 #               ifdef pthread_once_init
11713                         pthread_version_draft4;
11714 #               endif
11715         
11716 EOF
11717 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11718   egrep "pthread_version_draft4" >/dev/null 2>&1; then
11719   rm -rf conftest*
11720   ol_pthread_draft4=yes
11721 else
11722   rm -rf conftest*
11723   ol_pthread_draft4=no
11724 fi
11725 rm -f conftest*
11726
11727
11728         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
11729                 ol_cv_pthread_version=final
11730         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
11731                 ol_cv_pthread_version=draft4
11732         else
11733                 ol_cv_pthread_version=unknown
11734         fi
11735
11736 fi
11737
11738 echo "$ac_t""$ol_cv_pthread_version" 1>&6
11739
11740
11741                 if test $ol_cv_pthread_version = final ; then
11742                         cat >> confdefs.h <<\EOF
11743 #define HAVE_PTHREADS_FINAL 1
11744 EOF
11745
11746                 elif test $ol_cv_pthread_version = draft4 ; then
11747                         cat >> confdefs.h <<\EOF
11748 #define HAVE_PTHREADS_D4 1
11749 EOF
11750
11751                 else
11752                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
11753                 fi
11754
11755                 # consider threads found
11756                 ol_with_threads=found
11757
11758                 
11759         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
11760 echo "configure:11761: checking for LinuxThreads pthread.h" >&5
11761 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
11762   echo $ac_n "(cached) $ac_c" 1>&6
11763 else
11764   cat > conftest.$ac_ext <<EOF
11765 #line 11766 "configure"
11766 #include "confdefs.h"
11767 #include <pthread.h>
11768 EOF
11769 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11770   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
11771   rm -rf conftest*
11772   ol_cv_header_linux_threads=yes
11773 else
11774   rm -rf conftest*
11775   ol_cv_header_linux_threads=no
11776 fi
11777 rm -f conftest*
11778
11779                 
11780 fi
11781
11782 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
11783         if test $ol_cv_header_linux_threads = yes; then
11784                 cat >> confdefs.h <<\EOF
11785 #define HAVE_LINUX_THREADS 1
11786 EOF
11787
11788         fi
11789
11790                 
11791         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
11792 echo "configure:11793: checking for GNU Pth pthread.h" >&5
11793 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
11794   echo $ac_n "(cached) $ac_c" 1>&6
11795 else
11796   cat > conftest.$ac_ext <<EOF
11797 #line 11798 "configure"
11798 #include "confdefs.h"
11799 #include <pthread.h>
11800 #ifdef _POSIX_THREAD_IS_GNU_PTH
11801         __gnu_pth__;
11802 #endif
11803
11804 EOF
11805 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11806   egrep "__gnu_pth__" >/dev/null 2>&1; then
11807   rm -rf conftest*
11808   ol_cv_header_gnu_pth_pthread_h=yes
11809 else
11810   rm -rf conftest*
11811   ol_cv_header_gnu_pth_pthread_h=no
11812 fi
11813 rm -f conftest*
11814
11815                 
11816 fi
11817
11818 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
11819
11820
11821                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
11822                         for ac_hdr in sched.h
11823 do
11824 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11825 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11826 echo "configure:11827: checking for $ac_hdr" >&5
11827 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11828   echo $ac_n "(cached) $ac_c" 1>&6
11829 else
11830   cat > conftest.$ac_ext <<EOF
11831 #line 11832 "configure"
11832 #include "confdefs.h"
11833 #include <$ac_hdr>
11834 EOF
11835 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11836 { (eval echo configure:11837: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11837 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11838 if test -z "$ac_err"; then
11839   rm -rf conftest*
11840   eval "ac_cv_header_$ac_safe=yes"
11841 else
11842   echo "$ac_err" >&5
11843   echo "configure: failed program was:" >&5
11844   cat conftest.$ac_ext >&5
11845   rm -rf conftest*
11846   eval "ac_cv_header_$ac_safe=no"
11847 fi
11848 rm -f conftest*
11849 fi
11850 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11851   echo "$ac_t""yes" 1>&6
11852     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11853   cat >> confdefs.h <<EOF
11854 #define $ac_tr_hdr 1
11855 EOF
11856  
11857 else
11858   echo "$ac_t""no" 1>&6
11859 fi
11860 done
11861
11862                 fi
11863
11864                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
11865                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
11866 echo "configure:11867: checking for pthread_create in default libraries" >&5
11867 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
11868   echo $ac_n "(cached) $ac_c" 1>&6
11869 else
11870   
11871                 if test "$cross_compiling" = yes; then
11872   cat > conftest.$ac_ext <<EOF
11873 #line 11874 "configure"
11874 #include "confdefs.h"
11875 /* pthread test headers */
11876 #include <pthread.h>
11877 #ifndef NULL
11878 #define NULL (void*)0
11879 #endif
11880
11881 static void *task(p)
11882         void *p;
11883 {
11884         return (void *) (p == NULL);
11885 }
11886
11887 int main() {
11888
11889         /* pthread test function */
11890         pthread_t t;
11891         int status;
11892         int detach = 1;
11893
11894 #ifdef HAVE_PTHREADS_FINAL
11895         /* Final pthreads */
11896         pthread_attr_t attr;
11897
11898         status = pthread_attr_init(&attr);
11899         if( status ) return status;
11900
11901 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11902         if( !detach ) {
11903 #if defined( PTHREAD_CREATE_JOINABLE )
11904                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11905 #else
11906                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11907 #endif
11908
11909 #ifdef PTHREAD_CREATE_DETACHED
11910         } else {
11911                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11912 #endif
11913         }
11914         if( status ) return status;
11915 #endif
11916
11917         status = pthread_create( &t, &attr, task, NULL );
11918         if( status ) return status;
11919
11920 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11921         if( detach ) {
11922                 /* give thread a chance to complete */
11923                 /* it should remain joinable and hence detachable */
11924                 sleep( 1 );
11925
11926                 status = pthread_detach( t );
11927                 if( status ) return status;
11928         }
11929 #endif
11930
11931 #else
11932         /* Draft 4 pthreads */
11933         status = pthread_create( &t, pthread_attr_default, task, NULL );
11934         if( status ) return status;
11935
11936         if( detach ) {
11937                 /* give thread a chance to complete */
11938                 /* it should remain joinable and hence detachable */
11939                 sleep( 1 );
11940
11941                 status = pthread_detach( &t );
11942                 if( status ) return status;
11943         }
11944 #endif
11945
11946 #ifdef HAVE_LINUX_THREADS
11947         pthread_kill_other_threads_np();
11948 #endif
11949
11950         return 0;
11951
11952 ; return 0; }
11953 EOF
11954 if { (eval echo configure:11955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11955   rm -rf conftest*
11956   ol_cv_pthread_create=yes
11957 else
11958   echo "configure: failed program was:" >&5
11959   cat conftest.$ac_ext >&5
11960   rm -rf conftest*
11961   ol_cv_pthread_create=no
11962 fi
11963 rm -f conftest*
11964 else
11965   cat > conftest.$ac_ext <<EOF
11966 #line 11967 "configure"
11967 #include "confdefs.h"
11968 /* pthread test headers */
11969 #include <pthread.h>
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         pthread_t t;
11988         int status;
11989         int detach = 1;
11990
11991 #ifdef HAVE_PTHREADS_FINAL
11992         /* Final pthreads */
11993         pthread_attr_t attr;
11994
11995         status = pthread_attr_init(&attr);
11996         if( status ) return status;
11997
11998 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11999         if( !detach ) {
12000 #if defined( PTHREAD_CREATE_JOINABLE )
12001                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
12002 #else
12003                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
12004 #endif
12005
12006 #ifdef PTHREAD_CREATE_DETACHED
12007         } else {
12008                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
12009 #endif
12010         }
12011         if( status ) return status;
12012 #endif
12013
12014         status = pthread_create( &t, &attr, task, NULL );
12015         if( status ) return status;
12016
12017 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
12018         if( detach ) {
12019                 /* give thread a chance to complete */
12020                 /* it should remain joinable and hence detachable */
12021                 sleep( 1 );
12022
12023                 status = pthread_detach( t );
12024                 if( status ) return status;
12025         }
12026 #endif
12027
12028 #else
12029         /* Draft 4 pthreads */
12030         status = pthread_create( &t, pthread_attr_default, task, NULL );
12031         if( status ) return status;
12032
12033         if( detach ) {
12034                 /* give thread a chance to complete */
12035                 /* it should remain joinable and hence detachable */
12036                 sleep( 1 );
12037
12038                 status = pthread_detach( &t );
12039                 if( status ) return status;
12040         }
12041 #endif
12042
12043 #ifdef HAVE_LINUX_THREADS
12044         pthread_kill_other_threads_np();
12045 #endif
12046
12047         return 0;
12048
12049 }
12050
12051 EOF
12052 if { (eval echo configure:12053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12053 then
12054   ol_cv_pthread_create=yes
12055 else
12056   echo "configure: failed program was:" >&5
12057   cat conftest.$ac_ext >&5
12058   rm -fr conftest*
12059   ol_cv_pthread_create=no
12060 fi
12061 rm -fr conftest*
12062 fi
12063
12064 fi
12065
12066 echo "$ac_t""$ol_cv_pthread_create" 1>&6
12067
12068                 if test $ol_cv_pthread_create != no ; then
12069                         ol_link_threads=posix
12070                         ol_link_pthreads=""
12071                 fi
12072                 
12073                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
12074 if test "$ol_link_threads" = no ; then
12075         # try -kthread
12076         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
12077 echo "configure:12078: checking for pthread link with -kthread" >&5
12078 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
12079   echo $ac_n "(cached) $ac_c" 1>&6
12080 else
12081   
12082                 # save the flags
12083                 ol_LIBS="$LIBS"
12084                 LIBS="-kthread $LIBS"
12085
12086                 if test "$cross_compiling" = yes; then
12087   cat > conftest.$ac_ext <<EOF
12088 #line 12089 "configure"
12089 #include "confdefs.h"
12090 /* pthread test headers */
12091 #include <pthread.h>
12092 #ifndef NULL
12093 #define NULL (void*)0
12094 #endif
12095
12096 static void *task(p)
12097         void *p;
12098 {
12099         return (void *) (p == NULL);
12100 }
12101
12102 int main() {
12103
12104         /* pthread test function */
12105         pthread_t t;
12106         int status;
12107         int detach = 1;
12108
12109 #ifdef HAVE_PTHREADS_FINAL
12110         /* Final pthreads */
12111         pthread_attr_t attr;
12112
12113         status = pthread_attr_init(&attr);
12114         if( status ) return status;
12115
12116 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
12117         if( !detach ) {
12118 #if defined( PTHREAD_CREATE_JOINABLE )
12119                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
12120 #else
12121                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
12122 #endif
12123
12124 #ifdef PTHREAD_CREATE_DETACHED
12125         } else {
12126                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
12127 #endif
12128         }
12129         if( status ) return status;
12130 #endif
12131
12132         status = pthread_create( &t, &attr, task, NULL );
12133         if( status ) return status;
12134
12135 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
12136         if( detach ) {
12137                 /* give thread a chance to complete */
12138                 /* it should remain joinable and hence detachable */
12139                 sleep( 1 );
12140
12141                 status = pthread_detach( t );
12142                 if( status ) return status;
12143         }
12144 #endif
12145
12146 #else
12147         /* Draft 4 pthreads */
12148         status = pthread_create( &t, pthread_attr_default, task, NULL );
12149         if( status ) return status;
12150
12151         if( detach ) {
12152                 /* give thread a chance to complete */
12153                 /* it should remain joinable and hence detachable */
12154                 sleep( 1 );
12155
12156                 status = pthread_detach( &t );
12157                 if( status ) return status;
12158         }
12159 #endif
12160
12161 #ifdef HAVE_LINUX_THREADS
12162         pthread_kill_other_threads_np();
12163 #endif
12164
12165         return 0;
12166
12167 ; return 0; }
12168 EOF
12169 if { (eval echo configure:12170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12170   rm -rf conftest*
12171   ol_cv_pthread_kthread=yes
12172 else
12173   echo "configure: failed program was:" >&5
12174   cat conftest.$ac_ext >&5
12175   rm -rf conftest*
12176   ol_cv_pthread_kthread=no
12177 fi
12178 rm -f conftest*
12179 else
12180   cat > conftest.$ac_ext <<EOF
12181 #line 12182 "configure"
12182 #include "confdefs.h"
12183 /* pthread test headers */
12184 #include <pthread.h>
12185 #ifndef NULL
12186 #define NULL (void*)0
12187 #endif
12188
12189 static void *task(p)
12190         void *p;
12191 {
12192         return (void *) (p == NULL);
12193 }
12194
12195
12196 int main(argc, argv)
12197         int argc;
12198         char **argv;
12199 {
12200
12201         /* pthread test function */
12202         pthread_t t;
12203         int status;
12204         int detach = 1;
12205
12206 #ifdef HAVE_PTHREADS_FINAL
12207         /* Final pthreads */
12208         pthread_attr_t attr;
12209
12210         status = pthread_attr_init(&attr);
12211         if( status ) return status;
12212
12213 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
12214         if( !detach ) {
12215 #if defined( PTHREAD_CREATE_JOINABLE )
12216                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
12217 #else
12218                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
12219 #endif
12220
12221 #ifdef PTHREAD_CREATE_DETACHED
12222         } else {
12223                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
12224 #endif
12225         }
12226         if( status ) return status;
12227 #endif
12228
12229         status = pthread_create( &t, &attr, task, NULL );
12230         if( status ) return status;
12231
12232 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
12233         if( detach ) {
12234                 /* give thread a chance to complete */
12235                 /* it should remain joinable and hence detachable */
12236                 sleep( 1 );
12237
12238                 status = pthread_detach( t );
12239                 if( status ) return status;
12240         }
12241 #endif
12242
12243 #else
12244         /* Draft 4 pthreads */
12245         status = pthread_create( &t, pthread_attr_default, task, NULL );
12246         if( status ) return status;
12247
12248         if( detach ) {
12249                 /* give thread a chance to complete */
12250                 /* it should remain joinable and hence detachable */
12251                 sleep( 1 );
12252
12253                 status = pthread_detach( &t );
12254                 if( status ) return status;
12255         }
12256 #endif
12257
12258 #ifdef HAVE_LINUX_THREADS
12259         pthread_kill_other_threads_np();
12260 #endif
12261
12262         return 0;
12263
12264 }
12265
12266 EOF
12267 if { (eval echo configure:12268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12268 then
12269   ol_cv_pthread_kthread=yes
12270 else
12271   echo "configure: failed program was:" >&5
12272   cat conftest.$ac_ext >&5
12273   rm -fr conftest*
12274   ol_cv_pthread_kthread=no
12275 fi
12276 rm -fr conftest*
12277 fi
12278
12279
12280                 # restore the LIBS
12281                 LIBS="$ol_LIBS"
12282         
12283 fi
12284
12285 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
12286
12287         if test $ol_cv_pthread_kthread = yes ; then
12288                 ol_link_pthreads="-kthread"
12289                 ol_link_threads=posix
12290         fi
12291 fi
12292
12293                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
12294 if test "$ol_link_threads" = no ; then
12295         # try -pthread
12296         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
12297 echo "configure:12298: checking for pthread link with -pthread" >&5
12298 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
12299   echo $ac_n "(cached) $ac_c" 1>&6
12300 else
12301   
12302                 # save the flags
12303                 ol_LIBS="$LIBS"
12304                 LIBS="-pthread $LIBS"
12305
12306                 if test "$cross_compiling" = yes; then
12307   cat > conftest.$ac_ext <<EOF
12308 #line 12309 "configure"
12309 #include "confdefs.h"
12310 /* pthread test headers */
12311 #include <pthread.h>
12312 #ifndef NULL
12313 #define NULL (void*)0
12314 #endif
12315
12316 static void *task(p)
12317         void *p;
12318 {
12319         return (void *) (p == NULL);
12320 }
12321
12322 int main() {
12323
12324         /* pthread test function */
12325         pthread_t t;
12326         int status;
12327         int detach = 1;
12328
12329 #ifdef HAVE_PTHREADS_FINAL
12330         /* Final pthreads */
12331         pthread_attr_t attr;
12332
12333         status = pthread_attr_init(&attr);
12334         if( status ) return status;
12335
12336 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
12337         if( !detach ) {
12338 #if defined( PTHREAD_CREATE_JOINABLE )
12339                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
12340 #else
12341                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
12342 #endif
12343
12344 #ifdef PTHREAD_CREATE_DETACHED
12345         } else {
12346                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
12347 #endif
12348         }
12349         if( status ) return status;
12350 #endif
12351
12352         status = pthread_create( &t, &attr, task, NULL );
12353         if( status ) return status;
12354
12355 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
12356         if( detach ) {
12357                 /* give thread a chance to complete */
12358                 /* it should remain joinable and hence detachable */
12359                 sleep( 1 );
12360
12361                 status = pthread_detach( t );
12362                 if( status ) return status;
12363         }
12364 #endif
12365
12366 #else
12367         /* Draft 4 pthreads */
12368         status = pthread_create( &t, pthread_attr_default, task, NULL );
12369         if( status ) return status;
12370
12371         if( detach ) {
12372                 /* give thread a chance to complete */
12373                 /* it should remain joinable and hence detachable */
12374                 sleep( 1 );
12375
12376                 status = pthread_detach( &t );
12377                 if( status ) return status;
12378         }
12379 #endif
12380
12381 #ifdef HAVE_LINUX_THREADS
12382         pthread_kill_other_threads_np();
12383 #endif
12384
12385         return 0;
12386
12387 ; return 0; }
12388 EOF
12389 if { (eval echo configure:12390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12390   rm -rf conftest*
12391   ol_cv_pthread_pthread=yes
12392 else
12393   echo "configure: failed program was:" >&5
12394   cat conftest.$ac_ext >&5
12395   rm -rf conftest*
12396   ol_cv_pthread_pthread=no
12397 fi
12398 rm -f conftest*
12399 else
12400   cat > conftest.$ac_ext <<EOF
12401 #line 12402 "configure"
12402 #include "confdefs.h"
12403 /* pthread test headers */
12404 #include <pthread.h>
12405 #ifndef NULL
12406 #define NULL (void*)0
12407 #endif
12408
12409 static void *task(p)
12410         void *p;
12411 {
12412         return (void *) (p == NULL);
12413 }
12414
12415
12416 int main(argc, argv)
12417         int argc;
12418         char **argv;
12419 {
12420
12421         /* pthread test function */
12422         pthread_t t;
12423         int status;
12424         int detach = 1;
12425
12426 #ifdef HAVE_PTHREADS_FINAL
12427         /* Final pthreads */
12428         pthread_attr_t attr;
12429
12430         status = pthread_attr_init(&attr);
12431         if( status ) return status;
12432
12433 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
12434         if( !detach ) {
12435 #if defined( PTHREAD_CREATE_JOINABLE )
12436                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
12437 #else
12438                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
12439 #endif
12440
12441 #ifdef PTHREAD_CREATE_DETACHED
12442         } else {
12443                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
12444 #endif
12445         }
12446         if( status ) return status;
12447 #endif
12448
12449         status = pthread_create( &t, &attr, task, NULL );
12450         if( status ) return status;
12451
12452 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
12453         if( detach ) {
12454                 /* give thread a chance to complete */
12455                 /* it should remain joinable and hence detachable */
12456                 sleep( 1 );
12457
12458                 status = pthread_detach( t );
12459                 if( status ) return status;
12460         }
12461 #endif
12462
12463 #else
12464         /* Draft 4 pthreads */
12465         status = pthread_create( &t, pthread_attr_default, task, NULL );
12466         if( status ) return status;
12467
12468         if( detach ) {
12469                 /* give thread a chance to complete */
12470                 /* it should remain joinable and hence detachable */
12471                 sleep( 1 );
12472
12473                 status = pthread_detach( &t );
12474                 if( status ) return status;
12475         }
12476 #endif
12477
12478 #ifdef HAVE_LINUX_THREADS
12479         pthread_kill_other_threads_np();
12480 #endif
12481
12482         return 0;
12483
12484 }
12485
12486 EOF
12487 if { (eval echo configure:12488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12488 then
12489   ol_cv_pthread_pthread=yes
12490 else
12491   echo "configure: failed program was:" >&5
12492   cat conftest.$ac_ext >&5
12493   rm -fr conftest*
12494   ol_cv_pthread_pthread=no
12495 fi
12496 rm -fr conftest*
12497 fi
12498
12499
12500                 # restore the LIBS
12501                 LIBS="$ol_LIBS"
12502         
12503 fi
12504
12505 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
12506
12507         if test $ol_cv_pthread_pthread = yes ; then
12508                 ol_link_pthreads="-pthread"
12509                 ol_link_threads=posix
12510         fi
12511 fi
12512
12513                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
12514 if test "$ol_link_threads" = no ; then
12515         # try -pthreads
12516         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
12517 echo "configure:12518: checking for pthread link with -pthreads" >&5
12518 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
12519   echo $ac_n "(cached) $ac_c" 1>&6
12520 else
12521   
12522                 # save the flags
12523                 ol_LIBS="$LIBS"
12524                 LIBS="-pthreads $LIBS"
12525
12526                 if test "$cross_compiling" = yes; then
12527   cat > conftest.$ac_ext <<EOF
12528 #line 12529 "configure"
12529 #include "confdefs.h"
12530 /* pthread test headers */
12531 #include <pthread.h>
12532 #ifndef NULL
12533 #define NULL (void*)0
12534 #endif
12535
12536 static void *task(p)
12537         void *p;
12538 {
12539         return (void *) (p == NULL);
12540 }
12541
12542 int main() {
12543
12544         /* pthread test function */
12545         pthread_t t;
12546         int status;
12547         int detach = 1;
12548
12549 #ifdef HAVE_PTHREADS_FINAL
12550         /* Final pthreads */
12551         pthread_attr_t attr;
12552
12553         status = pthread_attr_init(&attr);
12554         if( status ) return status;
12555
12556 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
12557         if( !detach ) {
12558 #if defined( PTHREAD_CREATE_JOINABLE )
12559                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
12560 #else
12561                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
12562 #endif
12563
12564 #ifdef PTHREAD_CREATE_DETACHED
12565         } else {
12566                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
12567 #endif
12568         }
12569         if( status ) return status;
12570 #endif
12571
12572         status = pthread_create( &t, &attr, task, NULL );
12573         if( status ) return status;
12574
12575 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
12576         if( detach ) {
12577                 /* give thread a chance to complete */
12578                 /* it should remain joinable and hence detachable */
12579                 sleep( 1 );
12580
12581                 status = pthread_detach( t );
12582                 if( status ) return status;
12583         }
12584 #endif
12585
12586 #else
12587         /* Draft 4 pthreads */
12588         status = pthread_create( &t, pthread_attr_default, task, NULL );
12589         if( status ) return status;
12590
12591         if( detach ) {
12592                 /* give thread a chance to complete */
12593                 /* it should remain joinable and hence detachable */
12594                 sleep( 1 );
12595
12596                 status = pthread_detach( &t );
12597                 if( status ) return status;
12598         }
12599 #endif
12600
12601 #ifdef HAVE_LINUX_THREADS
12602         pthread_kill_other_threads_np();
12603 #endif
12604
12605         return 0;
12606
12607 ; return 0; }
12608 EOF
12609 if { (eval echo configure:12610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12610   rm -rf conftest*
12611   ol_cv_pthread_pthreads=yes
12612 else
12613   echo "configure: failed program was:" >&5
12614   cat conftest.$ac_ext >&5
12615   rm -rf conftest*
12616   ol_cv_pthread_pthreads=no
12617 fi
12618 rm -f conftest*
12619 else
12620   cat > conftest.$ac_ext <<EOF
12621 #line 12622 "configure"
12622 #include "confdefs.h"
12623 /* pthread test headers */
12624 #include <pthread.h>
12625 #ifndef NULL
12626 #define NULL (void*)0
12627 #endif
12628
12629 static void *task(p)
12630         void *p;
12631 {
12632         return (void *) (p == NULL);
12633 }
12634
12635
12636 int main(argc, argv)
12637         int argc;
12638         char **argv;
12639 {
12640
12641         /* pthread test function */
12642         pthread_t t;
12643         int status;
12644         int detach = 1;
12645
12646 #ifdef HAVE_PTHREADS_FINAL
12647         /* Final pthreads */
12648         pthread_attr_t attr;
12649
12650         status = pthread_attr_init(&attr);
12651         if( status ) return status;
12652
12653 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
12654         if( !detach ) {
12655 #if defined( PTHREAD_CREATE_JOINABLE )
12656                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
12657 #else
12658                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
12659 #endif
12660
12661 #ifdef PTHREAD_CREATE_DETACHED
12662         } else {
12663                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
12664 #endif
12665         }
12666         if( status ) return status;
12667 #endif
12668
12669         status = pthread_create( &t, &attr, task, NULL );
12670         if( status ) return status;
12671
12672 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
12673         if( detach ) {
12674                 /* give thread a chance to complete */
12675                 /* it should remain joinable and hence detachable */
12676                 sleep( 1 );
12677
12678                 status = pthread_detach( t );
12679                 if( status ) return status;
12680         }
12681 #endif
12682
12683 #else
12684         /* Draft 4 pthreads */
12685         status = pthread_create( &t, pthread_attr_default, task, NULL );
12686         if( status ) return status;
12687
12688         if( detach ) {
12689                 /* give thread a chance to complete */
12690                 /* it should remain joinable and hence detachable */
12691                 sleep( 1 );
12692
12693                 status = pthread_detach( &t );
12694                 if( status ) return status;
12695         }
12696 #endif
12697
12698 #ifdef HAVE_LINUX_THREADS
12699         pthread_kill_other_threads_np();
12700 #endif
12701
12702         return 0;
12703
12704 }
12705
12706 EOF
12707 if { (eval echo configure:12708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12708 then
12709   ol_cv_pthread_pthreads=yes
12710 else
12711   echo "configure: failed program was:" >&5
12712   cat conftest.$ac_ext >&5
12713   rm -fr conftest*
12714   ol_cv_pthread_pthreads=no
12715 fi
12716 rm -fr conftest*
12717 fi
12718
12719
12720                 # restore the LIBS
12721                 LIBS="$ol_LIBS"
12722         
12723 fi
12724
12725 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
12726
12727         if test $ol_cv_pthread_pthreads = yes ; then
12728                 ol_link_pthreads="-pthreads"
12729                 ol_link_threads=posix
12730         fi
12731 fi
12732
12733                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
12734 if test "$ol_link_threads" = no ; then
12735         # try -mthreads
12736         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
12737 echo "configure:12738: checking for pthread link with -mthreads" >&5
12738 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
12739   echo $ac_n "(cached) $ac_c" 1>&6
12740 else
12741   
12742                 # save the flags
12743                 ol_LIBS="$LIBS"
12744                 LIBS="-mthreads $LIBS"
12745
12746                 if test "$cross_compiling" = yes; then
12747   cat > conftest.$ac_ext <<EOF
12748 #line 12749 "configure"
12749 #include "confdefs.h"
12750 /* pthread test headers */
12751 #include <pthread.h>
12752 #ifndef NULL
12753 #define NULL (void*)0
12754 #endif
12755
12756 static void *task(p)
12757         void *p;
12758 {
12759         return (void *) (p == NULL);
12760 }
12761
12762 int main() {
12763
12764         /* pthread test function */
12765         pthread_t t;
12766         int status;
12767         int detach = 1;
12768
12769 #ifdef HAVE_PTHREADS_FINAL
12770         /* Final pthreads */
12771         pthread_attr_t attr;
12772
12773         status = pthread_attr_init(&attr);
12774         if( status ) return status;
12775
12776 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
12777         if( !detach ) {
12778 #if defined( PTHREAD_CREATE_JOINABLE )
12779                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
12780 #else
12781                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
12782 #endif
12783
12784 #ifdef PTHREAD_CREATE_DETACHED
12785         } else {
12786                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
12787 #endif
12788         }
12789         if( status ) return status;
12790 #endif
12791
12792         status = pthread_create( &t, &attr, task, NULL );
12793         if( status ) return status;
12794
12795 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
12796         if( detach ) {
12797                 /* give thread a chance to complete */
12798                 /* it should remain joinable and hence detachable */
12799                 sleep( 1 );
12800
12801                 status = pthread_detach( t );
12802                 if( status ) return status;
12803         }
12804 #endif
12805
12806 #else
12807         /* Draft 4 pthreads */
12808         status = pthread_create( &t, pthread_attr_default, task, NULL );
12809         if( status ) return status;
12810
12811         if( detach ) {
12812                 /* give thread a chance to complete */
12813                 /* it should remain joinable and hence detachable */
12814                 sleep( 1 );
12815
12816                 status = pthread_detach( &t );
12817                 if( status ) return status;
12818         }
12819 #endif
12820
12821 #ifdef HAVE_LINUX_THREADS
12822         pthread_kill_other_threads_np();
12823 #endif
12824
12825         return 0;
12826
12827 ; return 0; }
12828 EOF
12829 if { (eval echo configure:12830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12830   rm -rf conftest*
12831   ol_cv_pthread_mthreads=yes
12832 else
12833   echo "configure: failed program was:" >&5
12834   cat conftest.$ac_ext >&5
12835   rm -rf conftest*
12836   ol_cv_pthread_mthreads=no
12837 fi
12838 rm -f conftest*
12839 else
12840   cat > conftest.$ac_ext <<EOF
12841 #line 12842 "configure"
12842 #include "confdefs.h"
12843 /* pthread test headers */
12844 #include <pthread.h>
12845 #ifndef NULL
12846 #define NULL (void*)0
12847 #endif
12848
12849 static void *task(p)
12850         void *p;
12851 {
12852         return (void *) (p == NULL);
12853 }
12854
12855
12856 int main(argc, argv)
12857         int argc;
12858         char **argv;
12859 {
12860
12861         /* pthread test function */
12862         pthread_t t;
12863         int status;
12864         int detach = 1;
12865
12866 #ifdef HAVE_PTHREADS_FINAL
12867         /* Final pthreads */
12868         pthread_attr_t attr;
12869
12870         status = pthread_attr_init(&attr);
12871         if( status ) return status;
12872
12873 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
12874         if( !detach ) {
12875 #if defined( PTHREAD_CREATE_JOINABLE )
12876                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
12877 #else
12878                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
12879 #endif
12880
12881 #ifdef PTHREAD_CREATE_DETACHED
12882         } else {
12883                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
12884 #endif
12885         }
12886         if( status ) return status;
12887 #endif
12888
12889         status = pthread_create( &t, &attr, task, NULL );
12890         if( status ) return status;
12891
12892 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
12893         if( detach ) {
12894                 /* give thread a chance to complete */
12895                 /* it should remain joinable and hence detachable */
12896                 sleep( 1 );
12897
12898                 status = pthread_detach( t );
12899                 if( status ) return status;
12900         }
12901 #endif
12902
12903 #else
12904         /* Draft 4 pthreads */
12905         status = pthread_create( &t, pthread_attr_default, task, NULL );
12906         if( status ) return status;
12907
12908         if( detach ) {
12909                 /* give thread a chance to complete */
12910                 /* it should remain joinable and hence detachable */
12911                 sleep( 1 );
12912
12913                 status = pthread_detach( &t );
12914                 if( status ) return status;
12915         }
12916 #endif
12917
12918 #ifdef HAVE_LINUX_THREADS
12919         pthread_kill_other_threads_np();
12920 #endif
12921
12922         return 0;
12923
12924 }
12925
12926 EOF
12927 if { (eval echo configure:12928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12928 then
12929   ol_cv_pthread_mthreads=yes
12930 else
12931   echo "configure: failed program was:" >&5
12932   cat conftest.$ac_ext >&5
12933   rm -fr conftest*
12934   ol_cv_pthread_mthreads=no
12935 fi
12936 rm -fr conftest*
12937 fi
12938
12939
12940                 # restore the LIBS
12941                 LIBS="$ol_LIBS"
12942         
12943 fi
12944
12945 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
12946
12947         if test $ol_cv_pthread_mthreads = yes ; then
12948                 ol_link_pthreads="-mthreads"
12949                 ol_link_threads=posix
12950         fi
12951 fi
12952
12953                 # Pthread try link: -thread (ol_cv_pthread_thread)
12954 if test "$ol_link_threads" = no ; then
12955         # try -thread
12956         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
12957 echo "configure:12958: checking for pthread link with -thread" >&5
12958 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
12959   echo $ac_n "(cached) $ac_c" 1>&6
12960 else
12961   
12962                 # save the flags
12963                 ol_LIBS="$LIBS"
12964                 LIBS="-thread $LIBS"
12965
12966                 if test "$cross_compiling" = yes; then
12967   cat > conftest.$ac_ext <<EOF
12968 #line 12969 "configure"
12969 #include "confdefs.h"
12970 /* pthread test headers */
12971 #include <pthread.h>
12972 #ifndef NULL
12973 #define NULL (void*)0
12974 #endif
12975
12976 static void *task(p)
12977         void *p;
12978 {
12979         return (void *) (p == NULL);
12980 }
12981
12982 int main() {
12983
12984         /* pthread test function */
12985         pthread_t t;
12986         int status;
12987         int detach = 1;
12988
12989 #ifdef HAVE_PTHREADS_FINAL
12990         /* Final pthreads */
12991         pthread_attr_t attr;
12992
12993         status = pthread_attr_init(&attr);
12994         if( status ) return status;
12995
12996 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
12997         if( !detach ) {
12998 #if defined( PTHREAD_CREATE_JOINABLE )
12999                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
13000 #else
13001                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
13002 #endif
13003
13004 #ifdef PTHREAD_CREATE_DETACHED
13005         } else {
13006                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
13007 #endif
13008         }
13009         if( status ) return status;
13010 #endif
13011
13012         status = pthread_create( &t, &attr, task, NULL );
13013         if( status ) return status;
13014
13015 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
13016         if( detach ) {
13017                 /* give thread a chance to complete */
13018                 /* it should remain joinable and hence detachable */
13019                 sleep( 1 );
13020
13021                 status = pthread_detach( t );
13022                 if( status ) return status;
13023         }
13024 #endif
13025
13026 #else
13027         /* Draft 4 pthreads */
13028         status = pthread_create( &t, pthread_attr_default, task, NULL );
13029         if( status ) return status;
13030
13031         if( detach ) {
13032                 /* give thread a chance to complete */
13033                 /* it should remain joinable and hence detachable */
13034                 sleep( 1 );
13035
13036                 status = pthread_detach( &t );
13037                 if( status ) return status;
13038         }
13039 #endif
13040
13041 #ifdef HAVE_LINUX_THREADS
13042         pthread_kill_other_threads_np();
13043 #endif
13044
13045         return 0;
13046
13047 ; return 0; }
13048 EOF
13049 if { (eval echo configure:13050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13050   rm -rf conftest*
13051   ol_cv_pthread_thread=yes
13052 else
13053   echo "configure: failed program was:" >&5
13054   cat conftest.$ac_ext >&5
13055   rm -rf conftest*
13056   ol_cv_pthread_thread=no
13057 fi
13058 rm -f conftest*
13059 else
13060   cat > conftest.$ac_ext <<EOF
13061 #line 13062 "configure"
13062 #include "confdefs.h"
13063 /* pthread test headers */
13064 #include <pthread.h>
13065 #ifndef NULL
13066 #define NULL (void*)0
13067 #endif
13068
13069 static void *task(p)
13070         void *p;
13071 {
13072         return (void *) (p == NULL);
13073 }
13074
13075
13076 int main(argc, argv)
13077         int argc;
13078         char **argv;
13079 {
13080
13081         /* pthread test function */
13082         pthread_t t;
13083         int status;
13084         int detach = 1;
13085
13086 #ifdef HAVE_PTHREADS_FINAL
13087         /* Final pthreads */
13088         pthread_attr_t attr;
13089
13090         status = pthread_attr_init(&attr);
13091         if( status ) return status;
13092
13093 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
13094         if( !detach ) {
13095 #if defined( PTHREAD_CREATE_JOINABLE )
13096                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
13097 #else
13098                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
13099 #endif
13100
13101 #ifdef PTHREAD_CREATE_DETACHED
13102         } else {
13103                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
13104 #endif
13105         }
13106         if( status ) return status;
13107 #endif
13108
13109         status = pthread_create( &t, &attr, task, NULL );
13110         if( status ) return status;
13111
13112 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
13113         if( detach ) {
13114                 /* give thread a chance to complete */
13115                 /* it should remain joinable and hence detachable */
13116                 sleep( 1 );
13117
13118                 status = pthread_detach( t );
13119                 if( status ) return status;
13120         }
13121 #endif
13122
13123 #else
13124         /* Draft 4 pthreads */
13125         status = pthread_create( &t, pthread_attr_default, task, NULL );
13126         if( status ) return status;
13127
13128         if( detach ) {
13129                 /* give thread a chance to complete */
13130                 /* it should remain joinable and hence detachable */
13131                 sleep( 1 );
13132
13133                 status = pthread_detach( &t );
13134                 if( status ) return status;
13135         }
13136 #endif
13137
13138 #ifdef HAVE_LINUX_THREADS
13139         pthread_kill_other_threads_np();
13140 #endif
13141
13142         return 0;
13143
13144 }
13145
13146 EOF
13147 if { (eval echo configure:13148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13148 then
13149   ol_cv_pthread_thread=yes
13150 else
13151   echo "configure: failed program was:" >&5
13152   cat conftest.$ac_ext >&5
13153   rm -fr conftest*
13154   ol_cv_pthread_thread=no
13155 fi
13156 rm -fr conftest*
13157 fi
13158
13159
13160                 # restore the LIBS
13161                 LIBS="$ol_LIBS"
13162         
13163 fi
13164
13165 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
13166
13167         if test $ol_cv_pthread_thread = yes ; then
13168                 ol_link_pthreads="-thread"
13169                 ol_link_threads=posix
13170         fi
13171 fi
13172
13173
13174                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
13175 if test "$ol_link_threads" = no ; then
13176         # try -lpthread -lmach -lexc -lc_r
13177         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
13178 echo "configure:13179: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
13179 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
13180   echo $ac_n "(cached) $ac_c" 1>&6
13181 else
13182   
13183                 # save the flags
13184                 ol_LIBS="$LIBS"
13185                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
13186
13187                 if test "$cross_compiling" = yes; then
13188   cat > conftest.$ac_ext <<EOF
13189 #line 13190 "configure"
13190 #include "confdefs.h"
13191 /* pthread test headers */
13192 #include <pthread.h>
13193 #ifndef NULL
13194 #define NULL (void*)0
13195 #endif
13196
13197 static void *task(p)
13198         void *p;
13199 {
13200         return (void *) (p == NULL);
13201 }
13202
13203 int main() {
13204
13205         /* pthread test function */
13206         pthread_t t;
13207         int status;
13208         int detach = 1;
13209
13210 #ifdef HAVE_PTHREADS_FINAL
13211         /* Final pthreads */
13212         pthread_attr_t attr;
13213
13214         status = pthread_attr_init(&attr);
13215         if( status ) return status;
13216
13217 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
13218         if( !detach ) {
13219 #if defined( PTHREAD_CREATE_JOINABLE )
13220                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
13221 #else
13222                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
13223 #endif
13224
13225 #ifdef PTHREAD_CREATE_DETACHED
13226         } else {
13227                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
13228 #endif
13229         }
13230         if( status ) return status;
13231 #endif
13232
13233         status = pthread_create( &t, &attr, task, NULL );
13234         if( status ) return status;
13235
13236 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
13237         if( detach ) {
13238                 /* give thread a chance to complete */
13239                 /* it should remain joinable and hence detachable */
13240                 sleep( 1 );
13241
13242                 status = pthread_detach( t );
13243                 if( status ) return status;
13244         }
13245 #endif
13246
13247 #else
13248         /* Draft 4 pthreads */
13249         status = pthread_create( &t, pthread_attr_default, task, NULL );
13250         if( status ) return status;
13251
13252         if( detach ) {
13253                 /* give thread a chance to complete */
13254                 /* it should remain joinable and hence detachable */
13255                 sleep( 1 );
13256
13257                 status = pthread_detach( &t );
13258                 if( status ) return status;
13259         }
13260 #endif
13261
13262 #ifdef HAVE_LINUX_THREADS
13263         pthread_kill_other_threads_np();
13264 #endif
13265
13266         return 0;
13267
13268 ; return 0; }
13269 EOF
13270 if { (eval echo configure:13271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13271   rm -rf conftest*
13272   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
13273 else
13274   echo "configure: failed program was:" >&5
13275   cat conftest.$ac_ext >&5
13276   rm -rf conftest*
13277   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
13278 fi
13279 rm -f conftest*
13280 else
13281   cat > conftest.$ac_ext <<EOF
13282 #line 13283 "configure"
13283 #include "confdefs.h"
13284 /* pthread test headers */
13285 #include <pthread.h>
13286 #ifndef NULL
13287 #define NULL (void*)0
13288 #endif
13289
13290 static void *task(p)
13291         void *p;
13292 {
13293         return (void *) (p == NULL);
13294 }
13295
13296
13297 int main(argc, argv)
13298         int argc;
13299         char **argv;
13300 {
13301
13302         /* pthread test function */
13303         pthread_t t;
13304         int status;
13305         int detach = 1;
13306
13307 #ifdef HAVE_PTHREADS_FINAL
13308         /* Final pthreads */
13309         pthread_attr_t attr;
13310
13311         status = pthread_attr_init(&attr);
13312         if( status ) return status;
13313
13314 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
13315         if( !detach ) {
13316 #if defined( PTHREAD_CREATE_JOINABLE )
13317                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
13318 #else
13319                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
13320 #endif
13321
13322 #ifdef PTHREAD_CREATE_DETACHED
13323         } else {
13324                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
13325 #endif
13326         }
13327         if( status ) return status;
13328 #endif
13329
13330         status = pthread_create( &t, &attr, task, NULL );
13331         if( status ) return status;
13332
13333 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
13334         if( detach ) {
13335                 /* give thread a chance to complete */
13336                 /* it should remain joinable and hence detachable */
13337                 sleep( 1 );
13338
13339                 status = pthread_detach( t );
13340                 if( status ) return status;
13341         }
13342 #endif
13343
13344 #else
13345         /* Draft 4 pthreads */
13346         status = pthread_create( &t, pthread_attr_default, task, NULL );
13347         if( status ) return status;
13348
13349         if( detach ) {
13350                 /* give thread a chance to complete */
13351                 /* it should remain joinable and hence detachable */
13352                 sleep( 1 );
13353
13354                 status = pthread_detach( &t );
13355                 if( status ) return status;
13356         }
13357 #endif
13358
13359 #ifdef HAVE_LINUX_THREADS
13360         pthread_kill_other_threads_np();
13361 #endif
13362
13363         return 0;
13364
13365 }
13366
13367 EOF
13368 if { (eval echo configure:13369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13369 then
13370   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
13371 else
13372   echo "configure: failed program was:" >&5
13373   cat conftest.$ac_ext >&5
13374   rm -fr conftest*
13375   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
13376 fi
13377 rm -fr conftest*
13378 fi
13379
13380
13381                 # restore the LIBS
13382                 LIBS="$ol_LIBS"
13383         
13384 fi
13385
13386 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
13387
13388         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
13389                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
13390                 ol_link_threads=posix
13391         fi
13392 fi
13393
13394                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
13395 if test "$ol_link_threads" = no ; then
13396         # try -lpthread -lmach -lexc
13397         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
13398 echo "configure:13399: checking for pthread link with -lpthread -lmach -lexc" >&5
13399 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
13400   echo $ac_n "(cached) $ac_c" 1>&6
13401 else
13402   
13403                 # save the flags
13404                 ol_LIBS="$LIBS"
13405                 LIBS="-lpthread -lmach -lexc $LIBS"
13406
13407                 if test "$cross_compiling" = yes; then
13408   cat > conftest.$ac_ext <<EOF
13409 #line 13410 "configure"
13410 #include "confdefs.h"
13411 /* pthread test headers */
13412 #include <pthread.h>
13413 #ifndef NULL
13414 #define NULL (void*)0
13415 #endif
13416
13417 static void *task(p)
13418         void *p;
13419 {
13420         return (void *) (p == NULL);
13421 }
13422
13423 int main() {
13424
13425         /* pthread test function */
13426         pthread_t t;
13427         int status;
13428         int detach = 1;
13429
13430 #ifdef HAVE_PTHREADS_FINAL
13431         /* Final pthreads */
13432         pthread_attr_t attr;
13433
13434         status = pthread_attr_init(&attr);
13435         if( status ) return status;
13436
13437 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
13438         if( !detach ) {
13439 #if defined( PTHREAD_CREATE_JOINABLE )
13440                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
13441 #else
13442                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
13443 #endif
13444
13445 #ifdef PTHREAD_CREATE_DETACHED
13446         } else {
13447                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
13448 #endif
13449         }
13450         if( status ) return status;
13451 #endif
13452
13453         status = pthread_create( &t, &attr, task, NULL );
13454         if( status ) return status;
13455
13456 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
13457         if( detach ) {
13458                 /* give thread a chance to complete */
13459                 /* it should remain joinable and hence detachable */
13460                 sleep( 1 );
13461
13462                 status = pthread_detach( t );
13463                 if( status ) return status;
13464         }
13465 #endif
13466
13467 #else
13468         /* Draft 4 pthreads */
13469         status = pthread_create( &t, pthread_attr_default, task, NULL );
13470         if( status ) return status;
13471
13472         if( detach ) {
13473                 /* give thread a chance to complete */
13474                 /* it should remain joinable and hence detachable */
13475                 sleep( 1 );
13476
13477                 status = pthread_detach( &t );
13478                 if( status ) return status;
13479         }
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_lmach_lexc=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_lmach_lexc=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 #ifndef NULL
13507 #define NULL (void*)0
13508 #endif
13509
13510 static void *task(p)
13511         void *p;
13512 {
13513         return (void *) (p == NULL);
13514 }
13515
13516
13517 int main(argc, argv)
13518         int argc;
13519         char **argv;
13520 {
13521
13522         /* pthread test function */
13523         pthread_t t;
13524         int status;
13525         int detach = 1;
13526
13527 #ifdef HAVE_PTHREADS_FINAL
13528         /* Final pthreads */
13529         pthread_attr_t attr;
13530
13531         status = pthread_attr_init(&attr);
13532         if( status ) return status;
13533
13534 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
13535         if( !detach ) {
13536 #if defined( PTHREAD_CREATE_JOINABLE )
13537                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
13538 #else
13539                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
13540 #endif
13541
13542 #ifdef PTHREAD_CREATE_DETACHED
13543         } else {
13544                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
13545 #endif
13546         }
13547         if( status ) return status;
13548 #endif
13549
13550         status = pthread_create( &t, &attr, task, NULL );
13551         if( status ) return status;
13552
13553 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
13554         if( detach ) {
13555                 /* give thread a chance to complete */
13556                 /* it should remain joinable and hence detachable */
13557                 sleep( 1 );
13558
13559                 status = pthread_detach( t );
13560                 if( status ) return status;
13561         }
13562 #endif
13563
13564 #else
13565         /* Draft 4 pthreads */
13566         status = pthread_create( &t, pthread_attr_default, task, NULL );
13567         if( status ) return status;
13568
13569         if( detach ) {
13570                 /* give thread a chance to complete */
13571                 /* it should remain joinable and hence detachable */
13572                 sleep( 1 );
13573
13574                 status = pthread_detach( &t );
13575                 if( status ) return status;
13576         }
13577 #endif
13578
13579 #ifdef HAVE_LINUX_THREADS
13580         pthread_kill_other_threads_np();
13581 #endif
13582
13583         return 0;
13584
13585 }
13586
13587 EOF
13588 if { (eval echo configure:13589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13589 then
13590   ol_cv_pthread_lpthread_lmach_lexc=yes
13591 else
13592   echo "configure: failed program was:" >&5
13593   cat conftest.$ac_ext >&5
13594   rm -fr conftest*
13595   ol_cv_pthread_lpthread_lmach_lexc=no
13596 fi
13597 rm -fr conftest*
13598 fi
13599
13600
13601                 # restore the LIBS
13602                 LIBS="$ol_LIBS"
13603         
13604 fi
13605
13606 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
13607
13608         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
13609                 ol_link_pthreads="-lpthread -lmach -lexc"
13610                 ol_link_threads=posix
13611         fi
13612 fi
13613
13614
13615                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
13616 if test "$ol_link_threads" = no ; then
13617         # try -lpthread -Wl,-woff,85
13618         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
13619 echo "configure:13620: checking for pthread link with -lpthread -Wl,-woff,85" >&5
13620 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
13621   echo $ac_n "(cached) $ac_c" 1>&6
13622 else
13623   
13624                 # save the flags
13625                 ol_LIBS="$LIBS"
13626                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
13627
13628                 if test "$cross_compiling" = yes; then
13629   cat > conftest.$ac_ext <<EOF
13630 #line 13631 "configure"
13631 #include "confdefs.h"
13632 /* pthread test headers */
13633 #include <pthread.h>
13634 #ifndef NULL
13635 #define NULL (void*)0
13636 #endif
13637
13638 static void *task(p)
13639         void *p;
13640 {
13641         return (void *) (p == NULL);
13642 }
13643
13644 int main() {
13645
13646         /* pthread test function */
13647         pthread_t t;
13648         int status;
13649         int detach = 1;
13650
13651 #ifdef HAVE_PTHREADS_FINAL
13652         /* Final pthreads */
13653         pthread_attr_t attr;
13654
13655         status = pthread_attr_init(&attr);
13656         if( status ) return status;
13657
13658 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
13659         if( !detach ) {
13660 #if defined( PTHREAD_CREATE_JOINABLE )
13661                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
13662 #else
13663                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
13664 #endif
13665
13666 #ifdef PTHREAD_CREATE_DETACHED
13667         } else {
13668                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
13669 #endif
13670         }
13671         if( status ) return status;
13672 #endif
13673
13674         status = pthread_create( &t, &attr, task, NULL );
13675         if( status ) return status;
13676
13677 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
13678         if( detach ) {
13679                 /* give thread a chance to complete */
13680                 /* it should remain joinable and hence detachable */
13681                 sleep( 1 );
13682
13683                 status = pthread_detach( t );
13684                 if( status ) return status;
13685         }
13686 #endif
13687
13688 #else
13689         /* Draft 4 pthreads */
13690         status = pthread_create( &t, pthread_attr_default, task, NULL );
13691         if( status ) return status;
13692
13693         if( detach ) {
13694                 /* give thread a chance to complete */
13695                 /* it should remain joinable and hence detachable */
13696                 sleep( 1 );
13697
13698                 status = pthread_detach( &t );
13699                 if( status ) return status;
13700         }
13701 #endif
13702
13703 #ifdef HAVE_LINUX_THREADS
13704         pthread_kill_other_threads_np();
13705 #endif
13706
13707         return 0;
13708
13709 ; return 0; }
13710 EOF
13711 if { (eval echo configure:13712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13712   rm -rf conftest*
13713   ol_cv_pthread_lib_lpthread_woff=yes
13714 else
13715   echo "configure: failed program was:" >&5
13716   cat conftest.$ac_ext >&5
13717   rm -rf conftest*
13718   ol_cv_pthread_lib_lpthread_woff=no
13719 fi
13720 rm -f conftest*
13721 else
13722   cat > conftest.$ac_ext <<EOF
13723 #line 13724 "configure"
13724 #include "confdefs.h"
13725 /* pthread test headers */
13726 #include <pthread.h>
13727 #ifndef NULL
13728 #define NULL (void*)0
13729 #endif
13730
13731 static void *task(p)
13732         void *p;
13733 {
13734         return (void *) (p == NULL);
13735 }
13736
13737
13738 int main(argc, argv)
13739         int argc;
13740         char **argv;
13741 {
13742
13743         /* pthread test function */
13744         pthread_t t;
13745         int status;
13746         int detach = 1;
13747
13748 #ifdef HAVE_PTHREADS_FINAL
13749         /* Final pthreads */
13750         pthread_attr_t attr;
13751
13752         status = pthread_attr_init(&attr);
13753         if( status ) return status;
13754
13755 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
13756         if( !detach ) {
13757 #if defined( PTHREAD_CREATE_JOINABLE )
13758                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
13759 #else
13760                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
13761 #endif
13762
13763 #ifdef PTHREAD_CREATE_DETACHED
13764         } else {
13765                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
13766 #endif
13767         }
13768         if( status ) return status;
13769 #endif
13770
13771         status = pthread_create( &t, &attr, task, NULL );
13772         if( status ) return status;
13773
13774 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
13775         if( detach ) {
13776                 /* give thread a chance to complete */
13777                 /* it should remain joinable and hence detachable */
13778                 sleep( 1 );
13779
13780                 status = pthread_detach( t );
13781                 if( status ) return status;
13782         }
13783 #endif
13784
13785 #else
13786         /* Draft 4 pthreads */
13787         status = pthread_create( &t, pthread_attr_default, task, NULL );
13788         if( status ) return status;
13789
13790         if( detach ) {
13791                 /* give thread a chance to complete */
13792                 /* it should remain joinable and hence detachable */
13793                 sleep( 1 );
13794
13795                 status = pthread_detach( &t );
13796                 if( status ) return status;
13797         }
13798 #endif
13799
13800 #ifdef HAVE_LINUX_THREADS
13801         pthread_kill_other_threads_np();
13802 #endif
13803
13804         return 0;
13805
13806 }
13807
13808 EOF
13809 if { (eval echo configure:13810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13810 then
13811   ol_cv_pthread_lib_lpthread_woff=yes
13812 else
13813   echo "configure: failed program was:" >&5
13814   cat conftest.$ac_ext >&5
13815   rm -fr conftest*
13816   ol_cv_pthread_lib_lpthread_woff=no
13817 fi
13818 rm -fr conftest*
13819 fi
13820
13821
13822                 # restore the LIBS
13823                 LIBS="$ol_LIBS"
13824         
13825 fi
13826
13827 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
13828
13829         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
13830                 ol_link_pthreads="-lpthread -Wl,-woff,85"
13831                 ol_link_threads=posix
13832         fi
13833 fi
13834
13835
13836                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
13837 if test "$ol_link_threads" = no ; then
13838         # try -lpthread
13839         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
13840 echo "configure:13841: checking for pthread link with -lpthread" >&5
13841 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
13842   echo $ac_n "(cached) $ac_c" 1>&6
13843 else
13844   
13845                 # save the flags
13846                 ol_LIBS="$LIBS"
13847                 LIBS="-lpthread $LIBS"
13848
13849                 if test "$cross_compiling" = yes; then
13850   cat > conftest.$ac_ext <<EOF
13851 #line 13852 "configure"
13852 #include "confdefs.h"
13853 /* pthread test headers */
13854 #include <pthread.h>
13855 #ifndef NULL
13856 #define NULL (void*)0
13857 #endif
13858
13859 static void *task(p)
13860         void *p;
13861 {
13862         return (void *) (p == NULL);
13863 }
13864
13865 int main() {
13866
13867         /* pthread test function */
13868         pthread_t t;
13869         int status;
13870         int detach = 1;
13871
13872 #ifdef HAVE_PTHREADS_FINAL
13873         /* Final pthreads */
13874         pthread_attr_t attr;
13875
13876         status = pthread_attr_init(&attr);
13877         if( status ) return status;
13878
13879 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
13880         if( !detach ) {
13881 #if defined( PTHREAD_CREATE_JOINABLE )
13882                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
13883 #else
13884                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
13885 #endif
13886
13887 #ifdef PTHREAD_CREATE_DETACHED
13888         } else {
13889                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
13890 #endif
13891         }
13892         if( status ) return status;
13893 #endif
13894
13895         status = pthread_create( &t, &attr, task, NULL );
13896         if( status ) return status;
13897
13898 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
13899         if( detach ) {
13900                 /* give thread a chance to complete */
13901                 /* it should remain joinable and hence detachable */
13902                 sleep( 1 );
13903
13904                 status = pthread_detach( t );
13905                 if( status ) return status;
13906         }
13907 #endif
13908
13909 #else
13910         /* Draft 4 pthreads */
13911         status = pthread_create( &t, pthread_attr_default, task, NULL );
13912         if( status ) return status;
13913
13914         if( detach ) {
13915                 /* give thread a chance to complete */
13916                 /* it should remain joinable and hence detachable */
13917                 sleep( 1 );
13918
13919                 status = pthread_detach( &t );
13920                 if( status ) return status;
13921         }
13922 #endif
13923
13924 #ifdef HAVE_LINUX_THREADS
13925         pthread_kill_other_threads_np();
13926 #endif
13927
13928         return 0;
13929
13930 ; return 0; }
13931 EOF
13932 if { (eval echo configure:13933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13933   rm -rf conftest*
13934   ol_cv_pthread_lpthread=yes
13935 else
13936   echo "configure: failed program was:" >&5
13937   cat conftest.$ac_ext >&5
13938   rm -rf conftest*
13939   ol_cv_pthread_lpthread=no
13940 fi
13941 rm -f conftest*
13942 else
13943   cat > conftest.$ac_ext <<EOF
13944 #line 13945 "configure"
13945 #include "confdefs.h"
13946 /* pthread test headers */
13947 #include <pthread.h>
13948 #ifndef NULL
13949 #define NULL (void*)0
13950 #endif
13951
13952 static void *task(p)
13953         void *p;
13954 {
13955         return (void *) (p == NULL);
13956 }
13957
13958
13959 int main(argc, argv)
13960         int argc;
13961         char **argv;
13962 {
13963
13964         /* pthread test function */
13965         pthread_t t;
13966         int status;
13967         int detach = 1;
13968
13969 #ifdef HAVE_PTHREADS_FINAL
13970         /* Final pthreads */
13971         pthread_attr_t attr;
13972
13973         status = pthread_attr_init(&attr);
13974         if( status ) return status;
13975
13976 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
13977         if( !detach ) {
13978 #if defined( PTHREAD_CREATE_JOINABLE )
13979                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
13980 #else
13981                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
13982 #endif
13983
13984 #ifdef PTHREAD_CREATE_DETACHED
13985         } else {
13986                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
13987 #endif
13988         }
13989         if( status ) return status;
13990 #endif
13991
13992         status = pthread_create( &t, &attr, task, NULL );
13993         if( status ) return status;
13994
13995 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
13996         if( detach ) {
13997                 /* give thread a chance to complete */
13998                 /* it should remain joinable and hence detachable */
13999                 sleep( 1 );
14000
14001                 status = pthread_detach( t );
14002                 if( status ) return status;
14003         }
14004 #endif
14005
14006 #else
14007         /* Draft 4 pthreads */
14008         status = pthread_create( &t, pthread_attr_default, task, NULL );
14009         if( status ) return status;
14010
14011         if( detach ) {
14012                 /* give thread a chance to complete */
14013                 /* it should remain joinable and hence detachable */
14014                 sleep( 1 );
14015
14016                 status = pthread_detach( &t );
14017                 if( status ) return status;
14018         }
14019 #endif
14020
14021 #ifdef HAVE_LINUX_THREADS
14022         pthread_kill_other_threads_np();
14023 #endif
14024
14025         return 0;
14026
14027 }
14028
14029 EOF
14030 if { (eval echo configure:14031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14031 then
14032   ol_cv_pthread_lpthread=yes
14033 else
14034   echo "configure: failed program was:" >&5
14035   cat conftest.$ac_ext >&5
14036   rm -fr conftest*
14037   ol_cv_pthread_lpthread=no
14038 fi
14039 rm -fr conftest*
14040 fi
14041
14042
14043                 # restore the LIBS
14044                 LIBS="$ol_LIBS"
14045         
14046 fi
14047
14048 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
14049
14050         if test $ol_cv_pthread_lpthread = yes ; then
14051                 ol_link_pthreads="-lpthread"
14052                 ol_link_threads=posix
14053         fi
14054 fi
14055
14056                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
14057 if test "$ol_link_threads" = no ; then
14058         # try -lc_r
14059         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
14060 echo "configure:14061: checking for pthread link with -lc_r" >&5
14061 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
14062   echo $ac_n "(cached) $ac_c" 1>&6
14063 else
14064   
14065                 # save the flags
14066                 ol_LIBS="$LIBS"
14067                 LIBS="-lc_r $LIBS"
14068
14069                 if test "$cross_compiling" = yes; then
14070   cat > conftest.$ac_ext <<EOF
14071 #line 14072 "configure"
14072 #include "confdefs.h"
14073 /* pthread test headers */
14074 #include <pthread.h>
14075 #ifndef NULL
14076 #define NULL (void*)0
14077 #endif
14078
14079 static void *task(p)
14080         void *p;
14081 {
14082         return (void *) (p == NULL);
14083 }
14084
14085 int main() {
14086
14087         /* pthread test function */
14088         pthread_t t;
14089         int status;
14090         int detach = 1;
14091
14092 #ifdef HAVE_PTHREADS_FINAL
14093         /* Final pthreads */
14094         pthread_attr_t attr;
14095
14096         status = pthread_attr_init(&attr);
14097         if( status ) return status;
14098
14099 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
14100         if( !detach ) {
14101 #if defined( PTHREAD_CREATE_JOINABLE )
14102                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
14103 #else
14104                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
14105 #endif
14106
14107 #ifdef PTHREAD_CREATE_DETACHED
14108         } else {
14109                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
14110 #endif
14111         }
14112         if( status ) return status;
14113 #endif
14114
14115         status = pthread_create( &t, &attr, task, NULL );
14116         if( status ) return status;
14117
14118 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
14119         if( detach ) {
14120                 /* give thread a chance to complete */
14121                 /* it should remain joinable and hence detachable */
14122                 sleep( 1 );
14123
14124                 status = pthread_detach( t );
14125                 if( status ) return status;
14126         }
14127 #endif
14128
14129 #else
14130         /* Draft 4 pthreads */
14131         status = pthread_create( &t, pthread_attr_default, task, NULL );
14132         if( status ) return status;
14133
14134         if( detach ) {
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 status;
14141         }
14142 #endif
14143
14144 #ifdef HAVE_LINUX_THREADS
14145         pthread_kill_other_threads_np();
14146 #endif
14147
14148         return 0;
14149
14150 ; return 0; }
14151 EOF
14152 if { (eval echo configure:14153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14153   rm -rf conftest*
14154   ol_cv_pthread_lc_r=yes
14155 else
14156   echo "configure: failed program was:" >&5
14157   cat conftest.$ac_ext >&5
14158   rm -rf conftest*
14159   ol_cv_pthread_lc_r=no
14160 fi
14161 rm -f conftest*
14162 else
14163   cat > conftest.$ac_ext <<EOF
14164 #line 14165 "configure"
14165 #include "confdefs.h"
14166 /* pthread test headers */
14167 #include <pthread.h>
14168 #ifndef NULL
14169 #define NULL (void*)0
14170 #endif
14171
14172 static void *task(p)
14173         void *p;
14174 {
14175         return (void *) (p == NULL);
14176 }
14177
14178
14179 int main(argc, argv)
14180         int argc;
14181         char **argv;
14182 {
14183
14184         /* pthread test function */
14185         pthread_t t;
14186         int status;
14187         int detach = 1;
14188
14189 #ifdef HAVE_PTHREADS_FINAL
14190         /* Final pthreads */
14191         pthread_attr_t attr;
14192
14193         status = pthread_attr_init(&attr);
14194         if( status ) return status;
14195
14196 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
14197         if( !detach ) {
14198 #if defined( PTHREAD_CREATE_JOINABLE )
14199                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
14200 #else
14201                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
14202 #endif
14203
14204 #ifdef PTHREAD_CREATE_DETACHED
14205         } else {
14206                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
14207 #endif
14208         }
14209         if( status ) return status;
14210 #endif
14211
14212         status = pthread_create( &t, &attr, task, NULL );
14213         if( status ) return status;
14214
14215 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
14216         if( detach ) {
14217                 /* give thread a chance to complete */
14218                 /* it should remain joinable and hence detachable */
14219                 sleep( 1 );
14220
14221                 status = pthread_detach( t );
14222                 if( status ) return status;
14223         }
14224 #endif
14225
14226 #else
14227         /* Draft 4 pthreads */
14228         status = pthread_create( &t, pthread_attr_default, task, NULL );
14229         if( status ) return status;
14230
14231         if( detach ) {
14232                 /* give thread a chance to complete */
14233                 /* it should remain joinable and hence detachable */
14234                 sleep( 1 );
14235
14236                 status = pthread_detach( &t );
14237                 if( status ) return status;
14238         }
14239 #endif
14240
14241 #ifdef HAVE_LINUX_THREADS
14242         pthread_kill_other_threads_np();
14243 #endif
14244
14245         return 0;
14246
14247 }
14248
14249 EOF
14250 if { (eval echo configure:14251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14251 then
14252   ol_cv_pthread_lc_r=yes
14253 else
14254   echo "configure: failed program was:" >&5
14255   cat conftest.$ac_ext >&5
14256   rm -fr conftest*
14257   ol_cv_pthread_lc_r=no
14258 fi
14259 rm -fr conftest*
14260 fi
14261
14262
14263                 # restore the LIBS
14264                 LIBS="$ol_LIBS"
14265         
14266 fi
14267
14268 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
14269
14270         if test $ol_cv_pthread_lc_r = yes ; then
14271                 ol_link_pthreads="-lc_r"
14272                 ol_link_threads=posix
14273         fi
14274 fi
14275
14276
14277                 # Pthread try link: -threads (ol_cv_pthread_threads)
14278 if test "$ol_link_threads" = no ; then
14279         # try -threads
14280         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
14281 echo "configure:14282: checking for pthread link with -threads" >&5
14282 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
14283   echo $ac_n "(cached) $ac_c" 1>&6
14284 else
14285   
14286                 # save the flags
14287                 ol_LIBS="$LIBS"
14288                 LIBS="-threads $LIBS"
14289
14290                 if test "$cross_compiling" = yes; then
14291   cat > conftest.$ac_ext <<EOF
14292 #line 14293 "configure"
14293 #include "confdefs.h"
14294 /* pthread test headers */
14295 #include <pthread.h>
14296 #ifndef NULL
14297 #define NULL (void*)0
14298 #endif
14299
14300 static void *task(p)
14301         void *p;
14302 {
14303         return (void *) (p == NULL);
14304 }
14305
14306 int main() {
14307
14308         /* pthread test function */
14309         pthread_t t;
14310         int status;
14311         int detach = 1;
14312
14313 #ifdef HAVE_PTHREADS_FINAL
14314         /* Final pthreads */
14315         pthread_attr_t attr;
14316
14317         status = pthread_attr_init(&attr);
14318         if( status ) return status;
14319
14320 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
14321         if( !detach ) {
14322 #if defined( PTHREAD_CREATE_JOINABLE )
14323                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
14324 #else
14325                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
14326 #endif
14327
14328 #ifdef PTHREAD_CREATE_DETACHED
14329         } else {
14330                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
14331 #endif
14332         }
14333         if( status ) return status;
14334 #endif
14335
14336         status = pthread_create( &t, &attr, task, NULL );
14337         if( status ) return status;
14338
14339 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
14340         if( detach ) {
14341                 /* give thread a chance to complete */
14342                 /* it should remain joinable and hence detachable */
14343                 sleep( 1 );
14344
14345                 status = pthread_detach( t );
14346                 if( status ) return status;
14347         }
14348 #endif
14349
14350 #else
14351         /* Draft 4 pthreads */
14352         status = pthread_create( &t, pthread_attr_default, task, NULL );
14353         if( status ) return status;
14354
14355         if( detach ) {
14356                 /* give thread a chance to complete */
14357                 /* it should remain joinable and hence detachable */
14358                 sleep( 1 );
14359
14360                 status = pthread_detach( &t );
14361                 if( status ) return status;
14362         }
14363 #endif
14364
14365 #ifdef HAVE_LINUX_THREADS
14366         pthread_kill_other_threads_np();
14367 #endif
14368
14369         return 0;
14370
14371 ; return 0; }
14372 EOF
14373 if { (eval echo configure:14374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14374   rm -rf conftest*
14375   ol_cv_pthread_threads=yes
14376 else
14377   echo "configure: failed program was:" >&5
14378   cat conftest.$ac_ext >&5
14379   rm -rf conftest*
14380   ol_cv_pthread_threads=no
14381 fi
14382 rm -f conftest*
14383 else
14384   cat > conftest.$ac_ext <<EOF
14385 #line 14386 "configure"
14386 #include "confdefs.h"
14387 /* pthread test headers */
14388 #include <pthread.h>
14389 #ifndef NULL
14390 #define NULL (void*)0
14391 #endif
14392
14393 static void *task(p)
14394         void *p;
14395 {
14396         return (void *) (p == NULL);
14397 }
14398
14399
14400 int main(argc, argv)
14401         int argc;
14402         char **argv;
14403 {
14404
14405         /* pthread test function */
14406         pthread_t t;
14407         int status;
14408         int detach = 1;
14409
14410 #ifdef HAVE_PTHREADS_FINAL
14411         /* Final pthreads */
14412         pthread_attr_t attr;
14413
14414         status = pthread_attr_init(&attr);
14415         if( status ) return status;
14416
14417 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
14418         if( !detach ) {
14419 #if defined( PTHREAD_CREATE_JOINABLE )
14420                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
14421 #else
14422                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
14423 #endif
14424
14425 #ifdef PTHREAD_CREATE_DETACHED
14426         } else {
14427                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
14428 #endif
14429         }
14430         if( status ) return status;
14431 #endif
14432
14433         status = pthread_create( &t, &attr, task, NULL );
14434         if( status ) return status;
14435
14436 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
14437         if( detach ) {
14438                 /* give thread a chance to complete */
14439                 /* it should remain joinable and hence detachable */
14440                 sleep( 1 );
14441
14442                 status = pthread_detach( t );
14443                 if( status ) return status;
14444         }
14445 #endif
14446
14447 #else
14448         /* Draft 4 pthreads */
14449         status = pthread_create( &t, pthread_attr_default, task, NULL );
14450         if( status ) return status;
14451
14452         if( detach ) {
14453                 /* give thread a chance to complete */
14454                 /* it should remain joinable and hence detachable */
14455                 sleep( 1 );
14456
14457                 status = pthread_detach( &t );
14458                 if( status ) return status;
14459         }
14460 #endif
14461
14462 #ifdef HAVE_LINUX_THREADS
14463         pthread_kill_other_threads_np();
14464 #endif
14465
14466         return 0;
14467
14468 }
14469
14470 EOF
14471 if { (eval echo configure:14472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14472 then
14473   ol_cv_pthread_threads=yes
14474 else
14475   echo "configure: failed program was:" >&5
14476   cat conftest.$ac_ext >&5
14477   rm -fr conftest*
14478   ol_cv_pthread_threads=no
14479 fi
14480 rm -fr conftest*
14481 fi
14482
14483
14484                 # restore the LIBS
14485                 LIBS="$ol_LIBS"
14486         
14487 fi
14488
14489 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
14490
14491         if test $ol_cv_pthread_threads = yes ; then
14492                 ol_link_pthreads="-threads"
14493                 ol_link_threads=posix
14494         fi
14495 fi
14496
14497
14498                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
14499 if test "$ol_link_threads" = no ; then
14500         # try -lpthreads -lmach -lexc -lc_r
14501         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
14502 echo "configure:14503: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
14503 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
14504   echo $ac_n "(cached) $ac_c" 1>&6
14505 else
14506   
14507                 # save the flags
14508                 ol_LIBS="$LIBS"
14509                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
14510
14511                 if test "$cross_compiling" = yes; then
14512   cat > conftest.$ac_ext <<EOF
14513 #line 14514 "configure"
14514 #include "confdefs.h"
14515 /* pthread test headers */
14516 #include <pthread.h>
14517 #ifndef NULL
14518 #define NULL (void*)0
14519 #endif
14520
14521 static void *task(p)
14522         void *p;
14523 {
14524         return (void *) (p == NULL);
14525 }
14526
14527 int main() {
14528
14529         /* pthread test function */
14530         pthread_t t;
14531         int status;
14532         int detach = 1;
14533
14534 #ifdef HAVE_PTHREADS_FINAL
14535         /* Final pthreads */
14536         pthread_attr_t attr;
14537
14538         status = pthread_attr_init(&attr);
14539         if( status ) return status;
14540
14541 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
14542         if( !detach ) {
14543 #if defined( PTHREAD_CREATE_JOINABLE )
14544                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
14545 #else
14546                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
14547 #endif
14548
14549 #ifdef PTHREAD_CREATE_DETACHED
14550         } else {
14551                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
14552 #endif
14553         }
14554         if( status ) return status;
14555 #endif
14556
14557         status = pthread_create( &t, &attr, task, NULL );
14558         if( status ) return status;
14559
14560 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
14561         if( detach ) {
14562                 /* give thread a chance to complete */
14563                 /* it should remain joinable and hence detachable */
14564                 sleep( 1 );
14565
14566                 status = pthread_detach( t );
14567                 if( status ) return status;
14568         }
14569 #endif
14570
14571 #else
14572         /* Draft 4 pthreads */
14573         status = pthread_create( &t, pthread_attr_default, task, NULL );
14574         if( status ) return status;
14575
14576         if( detach ) {
14577                 /* give thread a chance to complete */
14578                 /* it should remain joinable and hence detachable */
14579                 sleep( 1 );
14580
14581                 status = pthread_detach( &t );
14582                 if( status ) return status;
14583         }
14584 #endif
14585
14586 #ifdef HAVE_LINUX_THREADS
14587         pthread_kill_other_threads_np();
14588 #endif
14589
14590         return 0;
14591
14592 ; return 0; }
14593 EOF
14594 if { (eval echo configure:14595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14595   rm -rf conftest*
14596   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
14597 else
14598   echo "configure: failed program was:" >&5
14599   cat conftest.$ac_ext >&5
14600   rm -rf conftest*
14601   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
14602 fi
14603 rm -f conftest*
14604 else
14605   cat > conftest.$ac_ext <<EOF
14606 #line 14607 "configure"
14607 #include "confdefs.h"
14608 /* pthread test headers */
14609 #include <pthread.h>
14610 #ifndef NULL
14611 #define NULL (void*)0
14612 #endif
14613
14614 static void *task(p)
14615         void *p;
14616 {
14617         return (void *) (p == NULL);
14618 }
14619
14620
14621 int main(argc, argv)
14622         int argc;
14623         char **argv;
14624 {
14625
14626         /* pthread test function */
14627         pthread_t t;
14628         int status;
14629         int detach = 1;
14630
14631 #ifdef HAVE_PTHREADS_FINAL
14632         /* Final pthreads */
14633         pthread_attr_t attr;
14634
14635         status = pthread_attr_init(&attr);
14636         if( status ) return status;
14637
14638 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
14639         if( !detach ) {
14640 #if defined( PTHREAD_CREATE_JOINABLE )
14641                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
14642 #else
14643                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
14644 #endif
14645
14646 #ifdef PTHREAD_CREATE_DETACHED
14647         } else {
14648                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
14649 #endif
14650         }
14651         if( status ) return status;
14652 #endif
14653
14654         status = pthread_create( &t, &attr, task, NULL );
14655         if( status ) return status;
14656
14657 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
14658         if( detach ) {
14659                 /* give thread a chance to complete */
14660                 /* it should remain joinable and hence detachable */
14661                 sleep( 1 );
14662
14663                 status = pthread_detach( t );
14664                 if( status ) return status;
14665         }
14666 #endif
14667
14668 #else
14669         /* Draft 4 pthreads */
14670         status = pthread_create( &t, pthread_attr_default, task, NULL );
14671         if( status ) return status;
14672
14673         if( detach ) {
14674                 /* give thread a chance to complete */
14675                 /* it should remain joinable and hence detachable */
14676                 sleep( 1 );
14677
14678                 status = pthread_detach( &t );
14679                 if( status ) return status;
14680         }
14681 #endif
14682
14683 #ifdef HAVE_LINUX_THREADS
14684         pthread_kill_other_threads_np();
14685 #endif
14686
14687         return 0;
14688
14689 }
14690
14691 EOF
14692 if { (eval echo configure:14693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14693 then
14694   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
14695 else
14696   echo "configure: failed program was:" >&5
14697   cat conftest.$ac_ext >&5
14698   rm -fr conftest*
14699   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
14700 fi
14701 rm -fr conftest*
14702 fi
14703
14704
14705                 # restore the LIBS
14706                 LIBS="$ol_LIBS"
14707         
14708 fi
14709
14710 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
14711
14712         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
14713                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
14714                 ol_link_threads=posix
14715         fi
14716 fi
14717
14718                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
14719 if test "$ol_link_threads" = no ; then
14720         # try -lpthreads -lmach -lexc
14721         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
14722 echo "configure:14723: checking for pthread link with -lpthreads -lmach -lexc" >&5
14723 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
14724   echo $ac_n "(cached) $ac_c" 1>&6
14725 else
14726   
14727                 # save the flags
14728                 ol_LIBS="$LIBS"
14729                 LIBS="-lpthreads -lmach -lexc $LIBS"
14730
14731                 if test "$cross_compiling" = yes; then
14732   cat > conftest.$ac_ext <<EOF
14733 #line 14734 "configure"
14734 #include "confdefs.h"
14735 /* pthread test headers */
14736 #include <pthread.h>
14737 #ifndef NULL
14738 #define NULL (void*)0
14739 #endif
14740
14741 static void *task(p)
14742         void *p;
14743 {
14744         return (void *) (p == NULL);
14745 }
14746
14747 int main() {
14748
14749         /* pthread test function */
14750         pthread_t t;
14751         int status;
14752         int detach = 1;
14753
14754 #ifdef HAVE_PTHREADS_FINAL
14755         /* Final pthreads */
14756         pthread_attr_t attr;
14757
14758         status = pthread_attr_init(&attr);
14759         if( status ) return status;
14760
14761 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
14762         if( !detach ) {
14763 #if defined( PTHREAD_CREATE_JOINABLE )
14764                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
14765 #else
14766                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
14767 #endif
14768
14769 #ifdef PTHREAD_CREATE_DETACHED
14770         } else {
14771                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
14772 #endif
14773         }
14774         if( status ) return status;
14775 #endif
14776
14777         status = pthread_create( &t, &attr, task, NULL );
14778         if( status ) return status;
14779
14780 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
14781         if( detach ) {
14782                 /* give thread a chance to complete */
14783                 /* it should remain joinable and hence detachable */
14784                 sleep( 1 );
14785
14786                 status = pthread_detach( t );
14787                 if( status ) return status;
14788         }
14789 #endif
14790
14791 #else
14792         /* Draft 4 pthreads */
14793         status = pthread_create( &t, pthread_attr_default, task, NULL );
14794         if( status ) return status;
14795
14796         if( detach ) {
14797                 /* give thread a chance to complete */
14798                 /* it should remain joinable and hence detachable */
14799                 sleep( 1 );
14800
14801                 status = pthread_detach( &t );
14802                 if( status ) return status;
14803         }
14804 #endif
14805
14806 #ifdef HAVE_LINUX_THREADS
14807         pthread_kill_other_threads_np();
14808 #endif
14809
14810         return 0;
14811
14812 ; return 0; }
14813 EOF
14814 if { (eval echo configure:14815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14815   rm -rf conftest*
14816   ol_cv_pthread_lpthreads_lmach_lexc=yes
14817 else
14818   echo "configure: failed program was:" >&5
14819   cat conftest.$ac_ext >&5
14820   rm -rf conftest*
14821   ol_cv_pthread_lpthreads_lmach_lexc=no
14822 fi
14823 rm -f conftest*
14824 else
14825   cat > conftest.$ac_ext <<EOF
14826 #line 14827 "configure"
14827 #include "confdefs.h"
14828 /* pthread test headers */
14829 #include <pthread.h>
14830 #ifndef NULL
14831 #define NULL (void*)0
14832 #endif
14833
14834 static void *task(p)
14835         void *p;
14836 {
14837         return (void *) (p == NULL);
14838 }
14839
14840
14841 int main(argc, argv)
14842         int argc;
14843         char **argv;
14844 {
14845
14846         /* pthread test function */
14847         pthread_t t;
14848         int status;
14849         int detach = 1;
14850
14851 #ifdef HAVE_PTHREADS_FINAL
14852         /* Final pthreads */
14853         pthread_attr_t attr;
14854
14855         status = pthread_attr_init(&attr);
14856         if( status ) return status;
14857
14858 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
14859         if( !detach ) {
14860 #if defined( PTHREAD_CREATE_JOINABLE )
14861                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
14862 #else
14863                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
14864 #endif
14865
14866 #ifdef PTHREAD_CREATE_DETACHED
14867         } else {
14868                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
14869 #endif
14870         }
14871         if( status ) return status;
14872 #endif
14873
14874         status = pthread_create( &t, &attr, task, NULL );
14875         if( status ) return status;
14876
14877 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
14878         if( detach ) {
14879                 /* give thread a chance to complete */
14880                 /* it should remain joinable and hence detachable */
14881                 sleep( 1 );
14882
14883                 status = pthread_detach( t );
14884                 if( status ) return status;
14885         }
14886 #endif
14887
14888 #else
14889         /* Draft 4 pthreads */
14890         status = pthread_create( &t, pthread_attr_default, task, NULL );
14891         if( status ) return status;
14892
14893         if( detach ) {
14894                 /* give thread a chance to complete */
14895                 /* it should remain joinable and hence detachable */
14896                 sleep( 1 );
14897
14898                 status = pthread_detach( &t );
14899                 if( status ) return status;
14900         }
14901 #endif
14902
14903 #ifdef HAVE_LINUX_THREADS
14904         pthread_kill_other_threads_np();
14905 #endif
14906
14907         return 0;
14908
14909 }
14910
14911 EOF
14912 if { (eval echo configure:14913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14913 then
14914   ol_cv_pthread_lpthreads_lmach_lexc=yes
14915 else
14916   echo "configure: failed program was:" >&5
14917   cat conftest.$ac_ext >&5
14918   rm -fr conftest*
14919   ol_cv_pthread_lpthreads_lmach_lexc=no
14920 fi
14921 rm -fr conftest*
14922 fi
14923
14924
14925                 # restore the LIBS
14926                 LIBS="$ol_LIBS"
14927         
14928 fi
14929
14930 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
14931
14932         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
14933                 ol_link_pthreads="-lpthreads -lmach -lexc"
14934                 ol_link_threads=posix
14935         fi
14936 fi
14937
14938                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
14939 if test "$ol_link_threads" = no ; then
14940         # try -lpthreads -lexc
14941         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
14942 echo "configure:14943: checking for pthread link with -lpthreads -lexc" >&5
14943 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
14944   echo $ac_n "(cached) $ac_c" 1>&6
14945 else
14946   
14947                 # save the flags
14948                 ol_LIBS="$LIBS"
14949                 LIBS="-lpthreads -lexc $LIBS"
14950
14951                 if test "$cross_compiling" = yes; then
14952   cat > conftest.$ac_ext <<EOF
14953 #line 14954 "configure"
14954 #include "confdefs.h"
14955 /* pthread test headers */
14956 #include <pthread.h>
14957 #ifndef NULL
14958 #define NULL (void*)0
14959 #endif
14960
14961 static void *task(p)
14962         void *p;
14963 {
14964         return (void *) (p == NULL);
14965 }
14966
14967 int main() {
14968
14969         /* pthread test function */
14970         pthread_t t;
14971         int status;
14972         int detach = 1;
14973
14974 #ifdef HAVE_PTHREADS_FINAL
14975         /* Final pthreads */
14976         pthread_attr_t attr;
14977
14978         status = pthread_attr_init(&attr);
14979         if( status ) return status;
14980
14981 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
14982         if( !detach ) {
14983 #if defined( PTHREAD_CREATE_JOINABLE )
14984                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
14985 #else
14986                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
14987 #endif
14988
14989 #ifdef PTHREAD_CREATE_DETACHED
14990         } else {
14991                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
14992 #endif
14993         }
14994         if( status ) return status;
14995 #endif
14996
14997         status = pthread_create( &t, &attr, task, NULL );
14998         if( status ) return status;
14999
15000 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
15001         if( detach ) {
15002                 /* give thread a chance to complete */
15003                 /* it should remain joinable and hence detachable */
15004                 sleep( 1 );
15005
15006                 status = pthread_detach( t );
15007                 if( status ) return status;
15008         }
15009 #endif
15010
15011 #else
15012         /* Draft 4 pthreads */
15013         status = pthread_create( &t, pthread_attr_default, task, NULL );
15014         if( status ) return status;
15015
15016         if( detach ) {
15017                 /* give thread a chance to complete */
15018                 /* it should remain joinable and hence detachable */
15019                 sleep( 1 );
15020
15021                 status = pthread_detach( &t );
15022                 if( status ) return status;
15023         }
15024 #endif
15025
15026 #ifdef HAVE_LINUX_THREADS
15027         pthread_kill_other_threads_np();
15028 #endif
15029
15030         return 0;
15031
15032 ; return 0; }
15033 EOF
15034 if { (eval echo configure:15035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15035   rm -rf conftest*
15036   ol_cv_pthread_lpthreads_lexc=yes
15037 else
15038   echo "configure: failed program was:" >&5
15039   cat conftest.$ac_ext >&5
15040   rm -rf conftest*
15041   ol_cv_pthread_lpthreads_lexc=no
15042 fi
15043 rm -f conftest*
15044 else
15045   cat > conftest.$ac_ext <<EOF
15046 #line 15047 "configure"
15047 #include "confdefs.h"
15048 /* pthread test headers */
15049 #include <pthread.h>
15050 #ifndef NULL
15051 #define NULL (void*)0
15052 #endif
15053
15054 static void *task(p)
15055         void *p;
15056 {
15057         return (void *) (p == NULL);
15058 }
15059
15060
15061 int main(argc, argv)
15062         int argc;
15063         char **argv;
15064 {
15065
15066         /* pthread test function */
15067         pthread_t t;
15068         int status;
15069         int detach = 1;
15070
15071 #ifdef HAVE_PTHREADS_FINAL
15072         /* Final pthreads */
15073         pthread_attr_t attr;
15074
15075         status = pthread_attr_init(&attr);
15076         if( status ) return status;
15077
15078 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
15079         if( !detach ) {
15080 #if defined( PTHREAD_CREATE_JOINABLE )
15081                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
15082 #else
15083                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
15084 #endif
15085
15086 #ifdef PTHREAD_CREATE_DETACHED
15087         } else {
15088                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
15089 #endif
15090         }
15091         if( status ) return status;
15092 #endif
15093
15094         status = pthread_create( &t, &attr, task, NULL );
15095         if( status ) return status;
15096
15097 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
15098         if( detach ) {
15099                 /* give thread a chance to complete */
15100                 /* it should remain joinable and hence detachable */
15101                 sleep( 1 );
15102
15103                 status = pthread_detach( t );
15104                 if( status ) return status;
15105         }
15106 #endif
15107
15108 #else
15109         /* Draft 4 pthreads */
15110         status = pthread_create( &t, pthread_attr_default, task, NULL );
15111         if( status ) return status;
15112
15113         if( detach ) {
15114                 /* give thread a chance to complete */
15115                 /* it should remain joinable and hence detachable */
15116                 sleep( 1 );
15117
15118                 status = pthread_detach( &t );
15119                 if( status ) return status;
15120         }
15121 #endif
15122
15123 #ifdef HAVE_LINUX_THREADS
15124         pthread_kill_other_threads_np();
15125 #endif
15126
15127         return 0;
15128
15129 }
15130
15131 EOF
15132 if { (eval echo configure:15133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15133 then
15134   ol_cv_pthread_lpthreads_lexc=yes
15135 else
15136   echo "configure: failed program was:" >&5
15137   cat conftest.$ac_ext >&5
15138   rm -fr conftest*
15139   ol_cv_pthread_lpthreads_lexc=no
15140 fi
15141 rm -fr conftest*
15142 fi
15143
15144
15145                 # restore the LIBS
15146                 LIBS="$ol_LIBS"
15147         
15148 fi
15149
15150 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
15151
15152         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
15153                 ol_link_pthreads="-lpthreads -lexc"
15154                 ol_link_threads=posix
15155         fi
15156 fi
15157
15158
15159                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
15160 if test "$ol_link_threads" = no ; then
15161         # try -lpthreads
15162         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
15163 echo "configure:15164: checking for pthread link with -lpthreads" >&5
15164 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
15165   echo $ac_n "(cached) $ac_c" 1>&6
15166 else
15167   
15168                 # save the flags
15169                 ol_LIBS="$LIBS"
15170                 LIBS="-lpthreads $LIBS"
15171
15172                 if test "$cross_compiling" = yes; then
15173   cat > conftest.$ac_ext <<EOF
15174 #line 15175 "configure"
15175 #include "confdefs.h"
15176 /* pthread test headers */
15177 #include <pthread.h>
15178 #ifndef NULL
15179 #define NULL (void*)0
15180 #endif
15181
15182 static void *task(p)
15183         void *p;
15184 {
15185         return (void *) (p == NULL);
15186 }
15187
15188 int main() {
15189
15190         /* pthread test function */
15191         pthread_t t;
15192         int status;
15193         int detach = 1;
15194
15195 #ifdef HAVE_PTHREADS_FINAL
15196         /* Final pthreads */
15197         pthread_attr_t attr;
15198
15199         status = pthread_attr_init(&attr);
15200         if( status ) return status;
15201
15202 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
15203         if( !detach ) {
15204 #if defined( PTHREAD_CREATE_JOINABLE )
15205                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
15206 #else
15207                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
15208 #endif
15209
15210 #ifdef PTHREAD_CREATE_DETACHED
15211         } else {
15212                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
15213 #endif
15214         }
15215         if( status ) return status;
15216 #endif
15217
15218         status = pthread_create( &t, &attr, task, NULL );
15219         if( status ) return status;
15220
15221 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
15222         if( detach ) {
15223                 /* give thread a chance to complete */
15224                 /* it should remain joinable and hence detachable */
15225                 sleep( 1 );
15226
15227                 status = pthread_detach( t );
15228                 if( status ) return status;
15229         }
15230 #endif
15231
15232 #else
15233         /* Draft 4 pthreads */
15234         status = pthread_create( &t, pthread_attr_default, task, NULL );
15235         if( status ) return status;
15236
15237         if( detach ) {
15238                 /* give thread a chance to complete */
15239                 /* it should remain joinable and hence detachable */
15240                 sleep( 1 );
15241
15242                 status = pthread_detach( &t );
15243                 if( status ) return status;
15244         }
15245 #endif
15246
15247 #ifdef HAVE_LINUX_THREADS
15248         pthread_kill_other_threads_np();
15249 #endif
15250
15251         return 0;
15252
15253 ; return 0; }
15254 EOF
15255 if { (eval echo configure:15256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15256   rm -rf conftest*
15257   ol_cv_pthread_lib_lpthreads=yes
15258 else
15259   echo "configure: failed program was:" >&5
15260   cat conftest.$ac_ext >&5
15261   rm -rf conftest*
15262   ol_cv_pthread_lib_lpthreads=no
15263 fi
15264 rm -f conftest*
15265 else
15266   cat > conftest.$ac_ext <<EOF
15267 #line 15268 "configure"
15268 #include "confdefs.h"
15269 /* pthread test headers */
15270 #include <pthread.h>
15271 #ifndef NULL
15272 #define NULL (void*)0
15273 #endif
15274
15275 static void *task(p)
15276         void *p;
15277 {
15278         return (void *) (p == NULL);
15279 }
15280
15281
15282 int main(argc, argv)
15283         int argc;
15284         char **argv;
15285 {
15286
15287         /* pthread test function */
15288         pthread_t t;
15289         int status;
15290         int detach = 1;
15291
15292 #ifdef HAVE_PTHREADS_FINAL
15293         /* Final pthreads */
15294         pthread_attr_t attr;
15295
15296         status = pthread_attr_init(&attr);
15297         if( status ) return status;
15298
15299 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
15300         if( !detach ) {
15301 #if defined( PTHREAD_CREATE_JOINABLE )
15302                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
15303 #else
15304                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
15305 #endif
15306
15307 #ifdef PTHREAD_CREATE_DETACHED
15308         } else {
15309                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
15310 #endif
15311         }
15312         if( status ) return status;
15313 #endif
15314
15315         status = pthread_create( &t, &attr, task, NULL );
15316         if( status ) return status;
15317
15318 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
15319         if( detach ) {
15320                 /* give thread a chance to complete */
15321                 /* it should remain joinable and hence detachable */
15322                 sleep( 1 );
15323
15324                 status = pthread_detach( t );
15325                 if( status ) return status;
15326         }
15327 #endif
15328
15329 #else
15330         /* Draft 4 pthreads */
15331         status = pthread_create( &t, pthread_attr_default, task, NULL );
15332         if( status ) return status;
15333
15334         if( detach ) {
15335                 /* give thread a chance to complete */
15336                 /* it should remain joinable and hence detachable */
15337                 sleep( 1 );
15338
15339                 status = pthread_detach( &t );
15340                 if( status ) return status;
15341         }
15342 #endif
15343
15344 #ifdef HAVE_LINUX_THREADS
15345         pthread_kill_other_threads_np();
15346 #endif
15347
15348         return 0;
15349
15350 }
15351
15352 EOF
15353 if { (eval echo configure:15354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15354 then
15355   ol_cv_pthread_lib_lpthreads=yes
15356 else
15357   echo "configure: failed program was:" >&5
15358   cat conftest.$ac_ext >&5
15359   rm -fr conftest*
15360   ol_cv_pthread_lib_lpthreads=no
15361 fi
15362 rm -fr conftest*
15363 fi
15364
15365
15366                 # restore the LIBS
15367                 LIBS="$ol_LIBS"
15368         
15369 fi
15370
15371 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
15372
15373         if test $ol_cv_pthread_lib_lpthreads = yes ; then
15374                 ol_link_pthreads="-lpthreads"
15375                 ol_link_threads=posix
15376         fi
15377 fi
15378
15379
15380                 if test $ol_link_threads != no ; then
15381                         cat >> confdefs.h <<\EOF
15382 #define HAVE_PTHREADS 1
15383 EOF
15384
15385
15386                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
15387
15388                                                 save_CPPFLAGS="$CPPFLAGS"
15389                         save_LIBS="$LIBS"
15390                         LIBS="$LTHREAD_LIBS $LIBS"
15391
15392                                                                                                 for ac_func in sched_yield pthread_yield
15393 do
15394 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15395 echo "configure:15396: checking for $ac_func" >&5
15396 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15397   echo $ac_n "(cached) $ac_c" 1>&6
15398 else
15399   cat > conftest.$ac_ext <<EOF
15400 #line 15401 "configure"
15401 #include "confdefs.h"
15402 /* System header to define __stub macros and hopefully few prototypes,
15403     which can conflict with char $ac_func(); below.  */
15404 #include <assert.h>
15405 /* Override any gcc2 internal prototype to avoid an error.  */
15406 /* We use char because int might match the return type of a gcc2
15407     builtin and then its argument prototype would still apply.  */
15408 char $ac_func();
15409 char (*f)();
15410
15411 int main() {
15412
15413 /* The GNU C library defines this for functions which it implements
15414     to always fail with ENOSYS.  Some functions are actually named
15415     something starting with __ and the normal name is an alias.  */
15416 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15417 choke me
15418 #else
15419 f = $ac_func;
15420 #endif
15421
15422 ; return 0; }
15423 EOF
15424 if { (eval echo configure:15425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15425   rm -rf conftest*
15426   eval "ac_cv_func_$ac_func=yes"
15427 else
15428   echo "configure: failed program was:" >&5
15429   cat conftest.$ac_ext >&5
15430   rm -rf conftest*
15431   eval "ac_cv_func_$ac_func=no"
15432 fi
15433 rm -f conftest*
15434 fi
15435
15436 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15437   echo "$ac_t""yes" 1>&6
15438     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15439   cat >> confdefs.h <<EOF
15440 #define $ac_tr_func 1
15441 EOF
15442  
15443 else
15444   echo "$ac_t""no" 1>&6
15445 fi
15446 done
15447
15448
15449                         if test $ac_cv_func_sched_yield = no -a \
15450                                 $ac_cv_func_pthread_yield = no ; then
15451                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
15452 echo "configure:15453: checking for sched_yield in -lrt" >&5
15453 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
15454 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15455   echo $ac_n "(cached) $ac_c" 1>&6
15456 else
15457   ac_save_LIBS="$LIBS"
15458 LIBS="-lrt  $LIBS"
15459 cat > conftest.$ac_ext <<EOF
15460 #line 15461 "configure"
15461 #include "confdefs.h"
15462 /* Override any gcc2 internal prototype to avoid an error.  */
15463 /* We use char because int might match the return type of a gcc2
15464     builtin and then its argument prototype would still apply.  */
15465 char sched_yield();
15466
15467 int main() {
15468 sched_yield()
15469 ; return 0; }
15470 EOF
15471 if { (eval echo configure:15472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15472   rm -rf conftest*
15473   eval "ac_cv_lib_$ac_lib_var=yes"
15474 else
15475   echo "configure: failed program was:" >&5
15476   cat conftest.$ac_ext >&5
15477   rm -rf conftest*
15478   eval "ac_cv_lib_$ac_lib_var=no"
15479 fi
15480 rm -f conftest*
15481 LIBS="$ac_save_LIBS"
15482
15483 fi
15484 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15485   echo "$ac_t""yes" 1>&6
15486   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
15487                                         cat >> confdefs.h <<\EOF
15488 #define HAVE_SCHED_YIELD 1
15489 EOF
15490
15491                                         ac_cv_func_sched_yield=yes
15492 else
15493   echo "$ac_t""no" 1>&6
15494 ac_cv_func_sched_yield=no
15495 fi
15496
15497                         fi
15498                         if test $ac_cv_func_sched_yield = no -a \
15499                                 $ac_cv_func_pthread_yield = no ; then
15500                                                                                                 for ac_func in thr_yield
15501 do
15502 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15503 echo "configure:15504: checking for $ac_func" >&5
15504 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15505   echo $ac_n "(cached) $ac_c" 1>&6
15506 else
15507   cat > conftest.$ac_ext <<EOF
15508 #line 15509 "configure"
15509 #include "confdefs.h"
15510 /* System header to define __stub macros and hopefully few prototypes,
15511     which can conflict with char $ac_func(); below.  */
15512 #include <assert.h>
15513 /* Override any gcc2 internal prototype to avoid an error.  */
15514 /* We use char because int might match the return type of a gcc2
15515     builtin and then its argument prototype would still apply.  */
15516 char $ac_func();
15517 char (*f)();
15518
15519 int main() {
15520
15521 /* The GNU C library defines this for functions which it implements
15522     to always fail with ENOSYS.  Some functions are actually named
15523     something starting with __ and the normal name is an alias.  */
15524 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15525 choke me
15526 #else
15527 f = $ac_func;
15528 #endif
15529
15530 ; return 0; }
15531 EOF
15532 if { (eval echo configure:15533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15533   rm -rf conftest*
15534   eval "ac_cv_func_$ac_func=yes"
15535 else
15536   echo "configure: failed program was:" >&5
15537   cat conftest.$ac_ext >&5
15538   rm -rf conftest*
15539   eval "ac_cv_func_$ac_func=no"
15540 fi
15541 rm -f conftest*
15542 fi
15543
15544 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15545   echo "$ac_t""yes" 1>&6
15546     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15547   cat >> confdefs.h <<EOF
15548 #define $ac_tr_func 1
15549 EOF
15550  
15551 else
15552   echo "$ac_t""no" 1>&6
15553 fi
15554 done
15555
15556                         fi
15557                         if test $ac_cv_func_sched_yield = no -a \
15558                                 $ac_cv_func_pthread_yield = no -a \
15559                                 "$ac_cv_func_thr_yield" = no ; then
15560                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
15561                         fi
15562
15563                                                 for ac_func in pthread_kill pthread_rwlock_destroy
15564 do
15565 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15566 echo "configure:15567: checking for $ac_func" >&5
15567 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15568   echo $ac_n "(cached) $ac_c" 1>&6
15569 else
15570   cat > conftest.$ac_ext <<EOF
15571 #line 15572 "configure"
15572 #include "confdefs.h"
15573 /* System header to define __stub macros and hopefully few prototypes,
15574     which can conflict with char $ac_func(); below.  */
15575 #include <assert.h>
15576 /* Override any gcc2 internal prototype to avoid an error.  */
15577 /* We use char because int might match the return type of a gcc2
15578     builtin and then its argument prototype would still apply.  */
15579 char $ac_func();
15580 char (*f)();
15581
15582 int main() {
15583
15584 /* The GNU C library defines this for functions which it implements
15585     to always fail with ENOSYS.  Some functions are actually named
15586     something starting with __ and the normal name is an alias.  */
15587 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15588 choke me
15589 #else
15590 f = $ac_func;
15591 #endif
15592
15593 ; return 0; }
15594 EOF
15595 if { (eval echo configure:15596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15596   rm -rf conftest*
15597   eval "ac_cv_func_$ac_func=yes"
15598 else
15599   echo "configure: failed program was:" >&5
15600   cat conftest.$ac_ext >&5
15601   rm -rf conftest*
15602   eval "ac_cv_func_$ac_func=no"
15603 fi
15604 rm -f conftest*
15605 fi
15606
15607 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15608   echo "$ac_t""yes" 1>&6
15609     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15610   cat >> confdefs.h <<EOF
15611 #define $ac_tr_func 1
15612 EOF
15613  
15614 else
15615   echo "$ac_t""no" 1>&6
15616 fi
15617 done
15618
15619
15620                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
15621 echo "configure:15622: checking for pthread_detach with <pthread.h>" >&5
15622 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
15623   echo $ac_n "(cached) $ac_c" 1>&6
15624 else
15625   
15626                                                                 cat > conftest.$ac_ext <<EOF
15627 #line 15628 "configure"
15628 #include "confdefs.h"
15629
15630 #include <pthread.h>
15631 #ifndef NULL
15632 #define NULL (void*)0
15633 #endif
15634
15635 int main() {
15636 pthread_detach(NULL);
15637 ; return 0; }
15638 EOF
15639 if { (eval echo configure:15640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15640   rm -rf conftest*
15641   ol_cv_func_pthread_detach=yes
15642 else
15643   echo "configure: failed program was:" >&5
15644   cat conftest.$ac_ext >&5
15645   rm -rf conftest*
15646   ol_cv_func_pthread_detach=no
15647 fi
15648 rm -f conftest*
15649                         
15650 fi
15651
15652 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
15653
15654                         if test $ol_cv_func_pthread_detach = no ; then
15655                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
15656                         fi
15657
15658                         cat >> confdefs.h <<\EOF
15659 #define HAVE_PTHREAD_DETACH 1
15660 EOF
15661
15662
15663                                                 for ac_func in \
15664                                 pthread_setconcurrency \
15665                                 pthread_getconcurrency \
15666                                 thr_setconcurrency \
15667                                 thr_getconcurrency \
15668                         
15669 do
15670 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15671 echo "configure:15672: checking for $ac_func" >&5
15672 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15673   echo $ac_n "(cached) $ac_c" 1>&6
15674 else
15675   cat > conftest.$ac_ext <<EOF
15676 #line 15677 "configure"
15677 #include "confdefs.h"
15678 /* System header to define __stub macros and hopefully few prototypes,
15679     which can conflict with char $ac_func(); below.  */
15680 #include <assert.h>
15681 /* Override any gcc2 internal prototype to avoid an error.  */
15682 /* We use char because int might match the return type of a gcc2
15683     builtin and then its argument prototype would still apply.  */
15684 char $ac_func();
15685 char (*f)();
15686
15687 int main() {
15688
15689 /* The GNU C library defines this for functions which it implements
15690     to always fail with ENOSYS.  Some functions are actually named
15691     something starting with __ and the normal name is an alias.  */
15692 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15693 choke me
15694 #else
15695 f = $ac_func;
15696 #endif
15697
15698 ; return 0; }
15699 EOF
15700 if { (eval echo configure:15701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15701   rm -rf conftest*
15702   eval "ac_cv_func_$ac_func=yes"
15703 else
15704   echo "configure: failed program was:" >&5
15705   cat conftest.$ac_ext >&5
15706   rm -rf conftest*
15707   eval "ac_cv_func_$ac_func=no"
15708 fi
15709 rm -f conftest*
15710 fi
15711
15712 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15713   echo "$ac_t""yes" 1>&6
15714     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15715   cat >> confdefs.h <<EOF
15716 #define $ac_tr_func 1
15717 EOF
15718  
15719 else
15720   echo "$ac_t""no" 1>&6
15721 fi
15722 done
15723
15724
15725                         
15726         for ac_func in pthread_kill_other_threads_np
15727 do
15728 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15729 echo "configure:15730: checking for $ac_func" >&5
15730 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15731   echo $ac_n "(cached) $ac_c" 1>&6
15732 else
15733   cat > conftest.$ac_ext <<EOF
15734 #line 15735 "configure"
15735 #include "confdefs.h"
15736 /* System header to define __stub macros and hopefully few prototypes,
15737     which can conflict with char $ac_func(); below.  */
15738 #include <assert.h>
15739 /* Override any gcc2 internal prototype to avoid an error.  */
15740 /* We use char because int might match the return type of a gcc2
15741     builtin and then its argument prototype would still apply.  */
15742 char $ac_func();
15743 char (*f)();
15744
15745 int main() {
15746
15747 /* The GNU C library defines this for functions which it implements
15748     to always fail with ENOSYS.  Some functions are actually named
15749     something starting with __ and the normal name is an alias.  */
15750 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15751 choke me
15752 #else
15753 f = $ac_func;
15754 #endif
15755
15756 ; return 0; }
15757 EOF
15758 if { (eval echo configure:15759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15759   rm -rf conftest*
15760   eval "ac_cv_func_$ac_func=yes"
15761 else
15762   echo "configure: failed program was:" >&5
15763   cat conftest.$ac_ext >&5
15764   rm -rf conftest*
15765   eval "ac_cv_func_$ac_func=no"
15766 fi
15767 rm -f conftest*
15768 fi
15769
15770 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15771   echo "$ac_t""yes" 1>&6
15772     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15773   cat >> confdefs.h <<EOF
15774 #define $ac_tr_func 1
15775 EOF
15776  
15777 else
15778   echo "$ac_t""no" 1>&6
15779 fi
15780 done
15781
15782         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
15783 echo "configure:15784: checking for LinuxThreads implementation" >&5
15784 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
15785   echo $ac_n "(cached) $ac_c" 1>&6
15786 else
15787   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
15788 fi
15789
15790 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
15791
15792                         
15793         
15794         
15795         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
15796 echo "configure:15797: checking for LinuxThreads consistency" >&5
15797 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
15798   echo $ac_n "(cached) $ac_c" 1>&6
15799 else
15800   
15801                 if test $ol_cv_header_linux_threads = yes -a \
15802                         $ol_cv_sys_linux_threads = yes; then
15803                         ol_cv_linux_threads=yes
15804                 elif test $ol_cv_header_linux_threads = no -a \
15805                         $ol_cv_sys_linux_threads = no; then
15806                         ol_cv_linux_threads=no
15807                 else
15808                         ol_cv_linux_threads=error
15809                 fi
15810         
15811 fi
15812
15813 echo "$ac_t""$ol_cv_linux_threads" 1>&6
15814
15815
15816                         if test $ol_cv_linux_threads = error; then
15817                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
15818                         fi
15819
15820                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
15821 echo "configure:15822: checking if pthread_create() works" >&5
15822 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
15823   echo $ac_n "(cached) $ac_c" 1>&6
15824 else
15825   
15826                         if test "$cross_compiling" = yes; then
15827                                 ol_cv_pthread_create_works=yes
15828 else
15829   cat > conftest.$ac_ext <<EOF
15830 #line 15831 "configure"
15831 #include "confdefs.h"
15832 /* pthread test headers */
15833 #include <pthread.h>
15834 #ifndef NULL
15835 #define NULL (void*)0
15836 #endif
15837
15838 static void *task(p)
15839         void *p;
15840 {
15841         return (void *) (p == NULL);
15842 }
15843
15844
15845 int main(argc, argv)
15846         int argc;
15847         char **argv;
15848 {
15849
15850         /* pthread test function */
15851         pthread_t t;
15852         int status;
15853         int detach = 1;
15854
15855 #ifdef HAVE_PTHREADS_FINAL
15856         /* Final pthreads */
15857         pthread_attr_t attr;
15858
15859         status = pthread_attr_init(&attr);
15860         if( status ) return status;
15861
15862 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
15863         if( !detach ) {
15864 #if defined( PTHREAD_CREATE_JOINABLE )
15865                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
15866 #else
15867                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
15868 #endif
15869
15870 #ifdef PTHREAD_CREATE_DETACHED
15871         } else {
15872                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
15873 #endif
15874         }
15875         if( status ) return status;
15876 #endif
15877
15878         status = pthread_create( &t, &attr, task, NULL );
15879         if( status ) return status;
15880
15881 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
15882         if( detach ) {
15883                 /* give thread a chance to complete */
15884                 /* it should remain joinable and hence detachable */
15885                 sleep( 1 );
15886
15887                 status = pthread_detach( t );
15888                 if( status ) return status;
15889         }
15890 #endif
15891
15892 #else
15893         /* Draft 4 pthreads */
15894         status = pthread_create( &t, pthread_attr_default, task, NULL );
15895         if( status ) return status;
15896
15897         if( detach ) {
15898                 /* give thread a chance to complete */
15899                 /* it should remain joinable and hence detachable */
15900                 sleep( 1 );
15901
15902                 status = pthread_detach( &t );
15903                 if( status ) return status;
15904         }
15905 #endif
15906
15907 #ifdef HAVE_LINUX_THREADS
15908         pthread_kill_other_threads_np();
15909 #endif
15910
15911         return 0;
15912
15913 }
15914
15915 EOF
15916 if { (eval echo configure:15917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15917 then
15918   ol_cv_pthread_create_works=yes
15919 else
15920   echo "configure: failed program was:" >&5
15921   cat conftest.$ac_ext >&5
15922   rm -fr conftest*
15923   ol_cv_pthread_create_works=no
15924 fi
15925 rm -fr conftest*
15926 fi
15927
15928 fi
15929
15930 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
15931
15932                         if test $ol_cv_pthread_create_works = no ; then
15933                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
15934                         fi
15935
15936                                                 if test $ol_with_yielding_select = auto ; then
15937                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
15938 echo "configure:15939: checking if select yields when using pthreads" >&5
15939 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
15940   echo $ac_n "(cached) $ac_c" 1>&6
15941 else
15942   
15943                                 if test "$cross_compiling" = yes; then
15944   ol_cv_pthread_select_yields=cross
15945 else
15946   cat > conftest.$ac_ext <<EOF
15947 #line 15948 "configure"
15948 #include "confdefs.h"
15949
15950 #include <sys/types.h>
15951 #include <sys/time.h>
15952 #include <unistd.h>
15953 #include <pthread.h>
15954 #ifndef NULL
15955 #define NULL (void*) 0
15956 #endif
15957
15958 static int fildes[2];
15959
15960 static void *task(p)
15961         void *p;
15962 {
15963         int i;
15964         struct timeval tv;
15965
15966         fd_set rfds;
15967
15968         tv.tv_sec=10;
15969         tv.tv_usec=0;
15970
15971         FD_ZERO(&rfds);
15972         FD_SET(fildes[0], &rfds);
15973
15974         /* we're not interested in any fds */
15975         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
15976
15977         if(i < 0) {
15978                 perror("select");
15979                 exit(10);
15980         }
15981
15982         exit(0); /* if we exit here, the select blocked the whole process */
15983 }
15984
15985 int main(argc, argv)
15986         int argc;
15987         char **argv;
15988 {
15989         pthread_t t;
15990
15991         /* create a pipe to select */
15992         if(pipe(&fildes[0])) {
15993                 perror("select");
15994                 exit(1);
15995         }
15996
15997 #ifdef HAVE_PTHREAD_SETCONCURRENCY
15998         (void) pthread_setconcurrency(2);
15999 #else
16000 #ifdef HAVE_THR_SETCONCURRENCY
16001         /* Set Solaris LWP concurrency to 2 */
16002         thr_setconcurrency(2);
16003 #endif
16004 #endif
16005
16006 #if HAVE_PTHREADS_D4
16007         pthread_create(&t, pthread_attr_default, task, NULL);
16008 #else
16009         pthread_create(&t, NULL, task, NULL);
16010 #endif
16011
16012 #if HAVE_SCHED_YIELD
16013         sched_yield();  /* make sure task runs first */
16014 #else
16015 #ifdef HAVE_PTHREAD_YIELD
16016         pthread_yield();        /* make sure task runs first */
16017 #endif
16018 #endif
16019
16020         exit(2);
16021 }
16022 EOF
16023 if { (eval echo configure:16024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16024 then
16025   ol_cv_pthread_select_yields=no
16026 else
16027   echo "configure: failed program was:" >&5
16028   cat conftest.$ac_ext >&5
16029   rm -fr conftest*
16030   ol_cv_pthread_select_yields=yes
16031 fi
16032 rm -fr conftest*
16033 fi
16034
16035 fi
16036
16037 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
16038
16039                                 if test $ol_cv_pthread_select_yields = cross ; then
16040                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
16041                                 fi
16042
16043                                 if test $ol_cv_pthread_select_yields = yes ; then
16044                                         ol_with_yielding_select=yes
16045                                 fi
16046                         fi
16047
16048                                                 CPPFLAGS="$save_CPPFLAGS"
16049                         LIBS="$save_LIBS"
16050                 else
16051                         { echo "configure: error: could not locate usable POSIX Threads" 1>&2; exit 1; }
16052                 fi
16053         fi
16054
16055         if test $ol_with_threads = posix ; then
16056                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
16057         fi
16058 fi
16059
16060 if test $ol_with_threads = auto -o $ol_with_threads = yes \
16061         -o $ol_with_threads = mach ; then
16062
16063                 for ac_hdr in mach/cthreads.h cthreads.h
16064 do
16065 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16066 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16067 echo "configure:16068: checking for $ac_hdr" >&5
16068 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16069   echo $ac_n "(cached) $ac_c" 1>&6
16070 else
16071   cat > conftest.$ac_ext <<EOF
16072 #line 16073 "configure"
16073 #include "confdefs.h"
16074 #include <$ac_hdr>
16075 EOF
16076 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16077 { (eval echo configure:16078: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16078 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16079 if test -z "$ac_err"; then
16080   rm -rf conftest*
16081   eval "ac_cv_header_$ac_safe=yes"
16082 else
16083   echo "$ac_err" >&5
16084   echo "configure: failed program was:" >&5
16085   cat conftest.$ac_ext >&5
16086   rm -rf conftest*
16087   eval "ac_cv_header_$ac_safe=no"
16088 fi
16089 rm -f conftest*
16090 fi
16091 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16092   echo "$ac_t""yes" 1>&6
16093     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16094   cat >> confdefs.h <<EOF
16095 #define $ac_tr_hdr 1
16096 EOF
16097  
16098 else
16099   echo "$ac_t""no" 1>&6
16100 fi
16101 done
16102
16103         if test $ac_cv_header_mach_cthreads_h = yes ; then
16104                 ol_with_threads=found
16105
16106                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
16107 echo "configure:16108: checking for cthread_fork" >&5
16108 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
16109   echo $ac_n "(cached) $ac_c" 1>&6
16110 else
16111   cat > conftest.$ac_ext <<EOF
16112 #line 16113 "configure"
16113 #include "confdefs.h"
16114 /* System header to define __stub macros and hopefully few prototypes,
16115     which can conflict with char cthread_fork(); below.  */
16116 #include <assert.h>
16117 /* Override any gcc2 internal prototype to avoid an error.  */
16118 /* We use char because int might match the return type of a gcc2
16119     builtin and then its argument prototype would still apply.  */
16120 char cthread_fork();
16121 char (*f)();
16122
16123 int main() {
16124
16125 /* The GNU C library defines this for functions which it implements
16126     to always fail with ENOSYS.  Some functions are actually named
16127     something starting with __ and the normal name is an alias.  */
16128 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
16129 choke me
16130 #else
16131 f = cthread_fork;
16132 #endif
16133
16134 ; return 0; }
16135 EOF
16136 if { (eval echo configure:16137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16137   rm -rf conftest*
16138   eval "ac_cv_func_cthread_fork=yes"
16139 else
16140   echo "configure: failed program was:" >&5
16141   cat conftest.$ac_ext >&5
16142   rm -rf conftest*
16143   eval "ac_cv_func_cthread_fork=no"
16144 fi
16145 rm -f conftest*
16146 fi
16147
16148 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
16149   echo "$ac_t""yes" 1>&6
16150   ol_link_threads=yes
16151 else
16152   echo "$ac_t""no" 1>&6
16153 fi
16154
16155
16156                 if test $ol_link_threads = no ; then
16157                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
16158 echo "configure:16159: checking for cthread_fork with -all_load" >&5
16159 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
16160   echo $ac_n "(cached) $ac_c" 1>&6
16161 else
16162   
16163                                                                 save_LIBS="$LIBS"
16164                                 LIBS="-all_load $LIBS"
16165                                 cat > conftest.$ac_ext <<EOF
16166 #line 16167 "configure"
16167 #include "confdefs.h"
16168 #include <mach/cthreads.h>
16169 int main() {
16170
16171                                         cthread_fork((void *)0, (void *)0);
16172                                         
16173 ; return 0; }
16174 EOF
16175 if { (eval echo configure:16176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16176   rm -rf conftest*
16177   ol_cv_cthread_all_load=yes
16178 else
16179   echo "configure: failed program was:" >&5
16180   cat conftest.$ac_ext >&5
16181   rm -rf conftest*
16182   ol_cv_cthread_all_load=no
16183 fi
16184 rm -f conftest*
16185                                                                 LIBS="$save_LIBS"
16186                         
16187 fi
16188
16189 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
16190
16191                         if test $ol_cv_cthread_all_load = yes ; then
16192                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
16193                                 ol_link_threads=mach
16194                                 ol_with_threads=found
16195                         fi
16196                 fi
16197
16198         elif test $ac_cv_header_cthreads_h = yes ; then
16199                                 
16200                 ol_with_threads=found
16201  
16202                                 save_LIBS="$LIBS"
16203                 LIBS="$LIBS -lthreads"
16204                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
16205 echo "configure:16206: checking for cthread_fork" >&5
16206 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
16207   echo $ac_n "(cached) $ac_c" 1>&6
16208 else
16209   cat > conftest.$ac_ext <<EOF
16210 #line 16211 "configure"
16211 #include "confdefs.h"
16212 /* System header to define __stub macros and hopefully few prototypes,
16213     which can conflict with char cthread_fork(); below.  */
16214 #include <assert.h>
16215 /* Override any gcc2 internal prototype to avoid an error.  */
16216 /* We use char because int might match the return type of a gcc2
16217     builtin and then its argument prototype would still apply.  */
16218 char cthread_fork();
16219 char (*f)();
16220
16221 int main() {
16222
16223 /* The GNU C library defines this for functions which it implements
16224     to always fail with ENOSYS.  Some functions are actually named
16225     something starting with __ and the normal name is an alias.  */
16226 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
16227 choke me
16228 #else
16229 f = cthread_fork;
16230 #endif
16231
16232 ; return 0; }
16233 EOF
16234 if { (eval echo configure:16235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16235   rm -rf conftest*
16236   eval "ac_cv_func_cthread_fork=yes"
16237 else
16238   echo "configure: failed program was:" >&5
16239   cat conftest.$ac_ext >&5
16240   rm -rf conftest*
16241   eval "ac_cv_func_cthread_fork=no"
16242 fi
16243 rm -f conftest*
16244 fi
16245
16246 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
16247   echo "$ac_t""yes" 1>&6
16248   ol_link_threads=yes
16249 else
16250   echo "$ac_t""no" 1>&6
16251 fi
16252
16253                 LIBS="$save_LIBS"
16254
16255                 if test $ol_link_threads = yes ; then
16256                         LTHREAD_LIBS="-lthreads"
16257                         ol_link_threads=mach
16258                         ol_with_threads=found
16259                 else
16260                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
16261                 fi
16262
16263         elif test $ol_with_threads = mach ; then
16264                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
16265         fi
16266
16267         if test $ol_link_threads = mach ; then
16268                 cat >> confdefs.h <<\EOF
16269 #define HAVE_MACH_CTHREADS 1
16270 EOF
16271
16272         elif test $ol_with_threads = found ; then
16273                 { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
16274         fi
16275 fi
16276
16277 if test $ol_with_threads = auto -o $ol_with_threads = yes \
16278         -o $ol_with_threads = pth ; then
16279
16280         for ac_hdr in pth.h
16281 do
16282 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16283 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16284 echo "configure:16285: checking for $ac_hdr" >&5
16285 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16286   echo $ac_n "(cached) $ac_c" 1>&6
16287 else
16288   cat > conftest.$ac_ext <<EOF
16289 #line 16290 "configure"
16290 #include "confdefs.h"
16291 #include <$ac_hdr>
16292 EOF
16293 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16294 { (eval echo configure:16295: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16295 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16296 if test -z "$ac_err"; then
16297   rm -rf conftest*
16298   eval "ac_cv_header_$ac_safe=yes"
16299 else
16300   echo "$ac_err" >&5
16301   echo "configure: failed program was:" >&5
16302   cat conftest.$ac_ext >&5
16303   rm -rf conftest*
16304   eval "ac_cv_header_$ac_safe=no"
16305 fi
16306 rm -f conftest*
16307 fi
16308 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16309   echo "$ac_t""yes" 1>&6
16310     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16311   cat >> confdefs.h <<EOF
16312 #define $ac_tr_hdr 1
16313 EOF
16314  
16315 else
16316   echo "$ac_t""no" 1>&6
16317 fi
16318 done
16319
16320
16321         if test $ac_cv_header_pth_h = yes ; then
16322                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
16323 echo "configure:16324: checking for pth_version in -lpth" >&5
16324 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
16325 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
16326   echo $ac_n "(cached) $ac_c" 1>&6
16327 else
16328   ac_save_LIBS="$LIBS"
16329 LIBS="-lpth  $LIBS"
16330 cat > conftest.$ac_ext <<EOF
16331 #line 16332 "configure"
16332 #include "confdefs.h"
16333 /* Override any gcc2 internal prototype to avoid an error.  */
16334 /* We use char because int might match the return type of a gcc2
16335     builtin and then its argument prototype would still apply.  */
16336 char pth_version();
16337
16338 int main() {
16339 pth_version()
16340 ; return 0; }
16341 EOF
16342 if { (eval echo configure:16343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16343   rm -rf conftest*
16344   eval "ac_cv_lib_$ac_lib_var=yes"
16345 else
16346   echo "configure: failed program was:" >&5
16347   cat conftest.$ac_ext >&5
16348   rm -rf conftest*
16349   eval "ac_cv_lib_$ac_lib_var=no"
16350 fi
16351 rm -f conftest*
16352 LIBS="$ac_save_LIBS"
16353
16354 fi
16355 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
16356   echo "$ac_t""yes" 1>&6
16357   have_pth=yes
16358 else
16359   echo "$ac_t""no" 1>&6
16360 have_pth=no
16361 fi
16362
16363
16364                 if test $have_pth = yes ; then
16365                         cat >> confdefs.h <<\EOF
16366 #define HAVE_GNU_PTH 1
16367 EOF
16368
16369                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
16370                         ol_link_threads=pth
16371                         ol_with_threads=found
16372
16373                         if test $ol_with_yielding_select = auto ; then
16374                                 ol_with_yielding_select=yes
16375                         fi
16376                 fi
16377         fi
16378 fi
16379
16380 if test $ol_with_threads = auto -o $ol_with_threads = yes \
16381         -o $ol_with_threads = lwp ; then
16382
16383                 for ac_hdr in thread.h synch.h
16384 do
16385 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16386 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16387 echo "configure:16388: checking for $ac_hdr" >&5
16388 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16389   echo $ac_n "(cached) $ac_c" 1>&6
16390 else
16391   cat > conftest.$ac_ext <<EOF
16392 #line 16393 "configure"
16393 #include "confdefs.h"
16394 #include <$ac_hdr>
16395 EOF
16396 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16397 { (eval echo configure:16398: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16398 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16399 if test -z "$ac_err"; then
16400   rm -rf conftest*
16401   eval "ac_cv_header_$ac_safe=yes"
16402 else
16403   echo "$ac_err" >&5
16404   echo "configure: failed program was:" >&5
16405   cat conftest.$ac_ext >&5
16406   rm -rf conftest*
16407   eval "ac_cv_header_$ac_safe=no"
16408 fi
16409 rm -f conftest*
16410 fi
16411 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16412   echo "$ac_t""yes" 1>&6
16413     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16414   cat >> confdefs.h <<EOF
16415 #define $ac_tr_hdr 1
16416 EOF
16417  
16418 else
16419   echo "$ac_t""no" 1>&6
16420 fi
16421 done
16422
16423         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
16424                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
16425 echo "configure:16426: checking for thr_create in -lthread" >&5
16426 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
16427 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
16428   echo $ac_n "(cached) $ac_c" 1>&6
16429 else
16430   ac_save_LIBS="$LIBS"
16431 LIBS="-lthread  $LIBS"
16432 cat > conftest.$ac_ext <<EOF
16433 #line 16434 "configure"
16434 #include "confdefs.h"
16435 /* Override any gcc2 internal prototype to avoid an error.  */
16436 /* We use char because int might match the return type of a gcc2
16437     builtin and then its argument prototype would still apply.  */
16438 char thr_create();
16439
16440 int main() {
16441 thr_create()
16442 ; return 0; }
16443 EOF
16444 if { (eval echo configure:16445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16445   rm -rf conftest*
16446   eval "ac_cv_lib_$ac_lib_var=yes"
16447 else
16448   echo "configure: failed program was:" >&5
16449   cat conftest.$ac_ext >&5
16450   rm -rf conftest*
16451   eval "ac_cv_lib_$ac_lib_var=no"
16452 fi
16453 rm -f conftest*
16454 LIBS="$ac_save_LIBS"
16455
16456 fi
16457 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
16458   echo "$ac_t""yes" 1>&6
16459   have_thr=yes
16460 else
16461   echo "$ac_t""no" 1>&6
16462 have_thr=no
16463 fi
16464
16465
16466                 if test $have_thr = yes ; then
16467                         cat >> confdefs.h <<\EOF
16468 #define HAVE_THR 1
16469 EOF
16470
16471                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
16472                         ol_link_threads=thr
16473
16474                         if test $ol_with_yielding_select = auto ; then
16475                                 ol_with_yielding_select=yes
16476                         fi
16477
16478                                                 for ac_func in \
16479                                 thr_setconcurrency \
16480                                 thr_getconcurrency \
16481                         
16482 do
16483 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16484 echo "configure:16485: checking for $ac_func" >&5
16485 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16486   echo $ac_n "(cached) $ac_c" 1>&6
16487 else
16488   cat > conftest.$ac_ext <<EOF
16489 #line 16490 "configure"
16490 #include "confdefs.h"
16491 /* System header to define __stub macros and hopefully few prototypes,
16492     which can conflict with char $ac_func(); below.  */
16493 #include <assert.h>
16494 /* Override any gcc2 internal prototype to avoid an error.  */
16495 /* We use char because int might match the return type of a gcc2
16496     builtin and then its argument prototype would still apply.  */
16497 char $ac_func();
16498 char (*f)();
16499
16500 int main() {
16501
16502 /* The GNU C library defines this for functions which it implements
16503     to always fail with ENOSYS.  Some functions are actually named
16504     something starting with __ and the normal name is an alias.  */
16505 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16506 choke me
16507 #else
16508 f = $ac_func;
16509 #endif
16510
16511 ; return 0; }
16512 EOF
16513 if { (eval echo configure:16514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16514   rm -rf conftest*
16515   eval "ac_cv_func_$ac_func=yes"
16516 else
16517   echo "configure: failed program was:" >&5
16518   cat conftest.$ac_ext >&5
16519   rm -rf conftest*
16520   eval "ac_cv_func_$ac_func=no"
16521 fi
16522 rm -f conftest*
16523 fi
16524
16525 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16526   echo "$ac_t""yes" 1>&6
16527     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16528   cat >> confdefs.h <<EOF
16529 #define $ac_tr_func 1
16530 EOF
16531  
16532 else
16533   echo "$ac_t""no" 1>&6
16534 fi
16535 done
16536
16537                 fi
16538         fi
16539
16540                 for ac_hdr in lwp/lwp.h
16541 do
16542 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16543 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16544 echo "configure:16545: checking for $ac_hdr" >&5
16545 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16546   echo $ac_n "(cached) $ac_c" 1>&6
16547 else
16548   cat > conftest.$ac_ext <<EOF
16549 #line 16550 "configure"
16550 #include "confdefs.h"
16551 #include <$ac_hdr>
16552 EOF
16553 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16554 { (eval echo configure:16555: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16555 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16556 if test -z "$ac_err"; then
16557   rm -rf conftest*
16558   eval "ac_cv_header_$ac_safe=yes"
16559 else
16560   echo "$ac_err" >&5
16561   echo "configure: failed program was:" >&5
16562   cat conftest.$ac_ext >&5
16563   rm -rf conftest*
16564   eval "ac_cv_header_$ac_safe=no"
16565 fi
16566 rm -f conftest*
16567 fi
16568 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16569   echo "$ac_t""yes" 1>&6
16570     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16571   cat >> confdefs.h <<EOF
16572 #define $ac_tr_hdr 1
16573 EOF
16574  
16575 else
16576   echo "$ac_t""no" 1>&6
16577 fi
16578 done
16579
16580         if test $ac_cv_header_lwp_lwp_h = yes ; then
16581                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
16582 echo "configure:16583: checking for lwp_create in -llwp" >&5
16583 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
16584 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
16585   echo $ac_n "(cached) $ac_c" 1>&6
16586 else
16587   ac_save_LIBS="$LIBS"
16588 LIBS="-llwp  $LIBS"
16589 cat > conftest.$ac_ext <<EOF
16590 #line 16591 "configure"
16591 #include "confdefs.h"
16592 /* Override any gcc2 internal prototype to avoid an error.  */
16593 /* We use char because int might match the return type of a gcc2
16594     builtin and then its argument prototype would still apply.  */
16595 char lwp_create();
16596
16597 int main() {
16598 lwp_create()
16599 ; return 0; }
16600 EOF
16601 if { (eval echo configure:16602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16602   rm -rf conftest*
16603   eval "ac_cv_lib_$ac_lib_var=yes"
16604 else
16605   echo "configure: failed program was:" >&5
16606   cat conftest.$ac_ext >&5
16607   rm -rf conftest*
16608   eval "ac_cv_lib_$ac_lib_var=no"
16609 fi
16610 rm -f conftest*
16611 LIBS="$ac_save_LIBS"
16612
16613 fi
16614 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
16615   echo "$ac_t""yes" 1>&6
16616   have_lwp=yes
16617 else
16618   echo "$ac_t""no" 1>&6
16619 have_lwp=no
16620 fi
16621
16622
16623                 if test $have_lwp = yes ; then
16624                         cat >> confdefs.h <<\EOF
16625 #define HAVE_LWP 1
16626 EOF
16627
16628                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
16629                         ol_link_threads=lwp
16630
16631                         if test $ol_with_yielding_select = auto ; then
16632                                 ol_with_yielding_select=no
16633                         fi
16634                 fi
16635         fi
16636 fi
16637
16638 if test $ol_with_yielding_select = yes ; then
16639         cat >> confdefs.h <<\EOF
16640 #define HAVE_YIELDING_SELECT 1
16641 EOF
16642
16643 fi
16644
16645 if test $ol_with_threads = manual ; then
16646                 ol_link_threads=yes
16647
16648         echo "configure: warning: thread defines and link options must be set manually" 1>&2
16649
16650         for ac_hdr in pthread.h sched.h
16651 do
16652 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16653 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16654 echo "configure:16655: checking for $ac_hdr" >&5
16655 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16656   echo $ac_n "(cached) $ac_c" 1>&6
16657 else
16658   cat > conftest.$ac_ext <<EOF
16659 #line 16660 "configure"
16660 #include "confdefs.h"
16661 #include <$ac_hdr>
16662 EOF
16663 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16664 { (eval echo configure:16665: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16665 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16666 if test -z "$ac_err"; then
16667   rm -rf conftest*
16668   eval "ac_cv_header_$ac_safe=yes"
16669 else
16670   echo "$ac_err" >&5
16671   echo "configure: failed program was:" >&5
16672   cat conftest.$ac_ext >&5
16673   rm -rf conftest*
16674   eval "ac_cv_header_$ac_safe=no"
16675 fi
16676 rm -f conftest*
16677 fi
16678 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16679   echo "$ac_t""yes" 1>&6
16680     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16681   cat >> confdefs.h <<EOF
16682 #define $ac_tr_hdr 1
16683 EOF
16684  
16685 else
16686   echo "$ac_t""no" 1>&6
16687 fi
16688 done
16689
16690         for ac_func in sched_yield pthread_yield
16691 do
16692 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16693 echo "configure:16694: checking for $ac_func" >&5
16694 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16695   echo $ac_n "(cached) $ac_c" 1>&6
16696 else
16697   cat > conftest.$ac_ext <<EOF
16698 #line 16699 "configure"
16699 #include "confdefs.h"
16700 /* System header to define __stub macros and hopefully few prototypes,
16701     which can conflict with char $ac_func(); below.  */
16702 #include <assert.h>
16703 /* Override any gcc2 internal prototype to avoid an error.  */
16704 /* We use char because int might match the return type of a gcc2
16705     builtin and then its argument prototype would still apply.  */
16706 char $ac_func();
16707 char (*f)();
16708
16709 int main() {
16710
16711 /* The GNU C library defines this for functions which it implements
16712     to always fail with ENOSYS.  Some functions are actually named
16713     something starting with __ and the normal name is an alias.  */
16714 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16715 choke me
16716 #else
16717 f = $ac_func;
16718 #endif
16719
16720 ; return 0; }
16721 EOF
16722 if { (eval echo configure:16723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16723   rm -rf conftest*
16724   eval "ac_cv_func_$ac_func=yes"
16725 else
16726   echo "configure: failed program was:" >&5
16727   cat conftest.$ac_ext >&5
16728   rm -rf conftest*
16729   eval "ac_cv_func_$ac_func=no"
16730 fi
16731 rm -f conftest*
16732 fi
16733
16734 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16735   echo "$ac_t""yes" 1>&6
16736     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16737   cat >> confdefs.h <<EOF
16738 #define $ac_tr_func 1
16739 EOF
16740  
16741 else
16742   echo "$ac_t""no" 1>&6
16743 fi
16744 done
16745
16746         
16747         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
16748 echo "configure:16749: checking for LinuxThreads pthread.h" >&5
16749 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
16750   echo $ac_n "(cached) $ac_c" 1>&6
16751 else
16752   cat > conftest.$ac_ext <<EOF
16753 #line 16754 "configure"
16754 #include "confdefs.h"
16755 #include <pthread.h>
16756 EOF
16757 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16758   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
16759   rm -rf conftest*
16760   ol_cv_header_linux_threads=yes
16761 else
16762   rm -rf conftest*
16763   ol_cv_header_linux_threads=no
16764 fi
16765 rm -f conftest*
16766
16767                 
16768 fi
16769
16770 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
16771         if test $ol_cv_header_linux_threads = yes; then
16772                 cat >> confdefs.h <<\EOF
16773 #define HAVE_LINUX_THREADS 1
16774 EOF
16775
16776         fi
16777
16778
16779         for ac_hdr in mach/cthreads.h
16780 do
16781 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16782 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16783 echo "configure:16784: checking for $ac_hdr" >&5
16784 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16785   echo $ac_n "(cached) $ac_c" 1>&6
16786 else
16787   cat > conftest.$ac_ext <<EOF
16788 #line 16789 "configure"
16789 #include "confdefs.h"
16790 #include <$ac_hdr>
16791 EOF
16792 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16793 { (eval echo configure:16794: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16794 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16795 if test -z "$ac_err"; then
16796   rm -rf conftest*
16797   eval "ac_cv_header_$ac_safe=yes"
16798 else
16799   echo "$ac_err" >&5
16800   echo "configure: failed program was:" >&5
16801   cat conftest.$ac_ext >&5
16802   rm -rf conftest*
16803   eval "ac_cv_header_$ac_safe=no"
16804 fi
16805 rm -f conftest*
16806 fi
16807 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16808   echo "$ac_t""yes" 1>&6
16809     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16810   cat >> confdefs.h <<EOF
16811 #define $ac_tr_hdr 1
16812 EOF
16813  
16814 else
16815   echo "$ac_t""no" 1>&6
16816 fi
16817 done
16818
16819         for ac_hdr in lwp/lwp.h
16820 do
16821 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16822 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16823 echo "configure:16824: checking for $ac_hdr" >&5
16824 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16825   echo $ac_n "(cached) $ac_c" 1>&6
16826 else
16827   cat > conftest.$ac_ext <<EOF
16828 #line 16829 "configure"
16829 #include "confdefs.h"
16830 #include <$ac_hdr>
16831 EOF
16832 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16833 { (eval echo configure:16834: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16834 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16835 if test -z "$ac_err"; then
16836   rm -rf conftest*
16837   eval "ac_cv_header_$ac_safe=yes"
16838 else
16839   echo "$ac_err" >&5
16840   echo "configure: failed program was:" >&5
16841   cat conftest.$ac_ext >&5
16842   rm -rf conftest*
16843   eval "ac_cv_header_$ac_safe=no"
16844 fi
16845 rm -f conftest*
16846 fi
16847 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16848   echo "$ac_t""yes" 1>&6
16849     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16850   cat >> confdefs.h <<EOF
16851 #define $ac_tr_hdr 1
16852 EOF
16853  
16854 else
16855   echo "$ac_t""no" 1>&6
16856 fi
16857 done
16858
16859         for ac_hdr in thread.h synch.h
16860 do
16861 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16862 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16863 echo "configure:16864: checking for $ac_hdr" >&5
16864 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16865   echo $ac_n "(cached) $ac_c" 1>&6
16866 else
16867   cat > conftest.$ac_ext <<EOF
16868 #line 16869 "configure"
16869 #include "confdefs.h"
16870 #include <$ac_hdr>
16871 EOF
16872 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16873 { (eval echo configure:16874: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16874 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16875 if test -z "$ac_err"; then
16876   rm -rf conftest*
16877   eval "ac_cv_header_$ac_safe=yes"
16878 else
16879   echo "$ac_err" >&5
16880   echo "configure: failed program was:" >&5
16881   cat conftest.$ac_ext >&5
16882   rm -rf conftest*
16883   eval "ac_cv_header_$ac_safe=no"
16884 fi
16885 rm -f conftest*
16886 fi
16887 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16888   echo "$ac_t""yes" 1>&6
16889     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16890   cat >> confdefs.h <<EOF
16891 #define $ac_tr_hdr 1
16892 EOF
16893  
16894 else
16895   echo "$ac_t""no" 1>&6
16896 fi
16897 done
16898
16899 fi
16900
16901 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
16902                         cat >> confdefs.h <<\EOF
16903 #define REENTRANT 1
16904 EOF
16905
16906         cat >> confdefs.h <<\EOF
16907 #define _REENTRANT 1
16908 EOF
16909
16910         cat >> confdefs.h <<\EOF
16911 #define THREAD_SAFE 1
16912 EOF
16913
16914         cat >> confdefs.h <<\EOF
16915 #define _THREAD_SAFE 1
16916 EOF
16917
16918         cat >> confdefs.h <<\EOF
16919 #define THREADSAFE 1
16920 EOF
16921
16922         cat >> confdefs.h <<\EOF
16923 #define _THREADSAFE 1
16924 EOF
16925
16926         cat >> confdefs.h <<\EOF
16927 #define _SGI_MP_SOURCE 1
16928 EOF
16929
16930
16931                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
16932 echo "configure:16933: checking for thread specific errno" >&5
16933 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
16934   echo $ac_n "(cached) $ac_c" 1>&6
16935 else
16936   
16937                 cat > conftest.$ac_ext <<EOF
16938 #line 16939 "configure"
16939 #include "confdefs.h"
16940 #include <errno.h>
16941 int main() {
16942 errno = 0;
16943 ; return 0; }
16944 EOF
16945 if { (eval echo configure:16946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16946   rm -rf conftest*
16947   ol_cv_errno_thread_specific=yes
16948 else
16949   echo "configure: failed program was:" >&5
16950   cat conftest.$ac_ext >&5
16951   rm -rf conftest*
16952   ol_cv_errno_thread_specific=no
16953 fi
16954 rm -f conftest*
16955         
16956 fi
16957
16958 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
16959
16960                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
16961 echo "configure:16962: checking for thread specific h_errno" >&5
16962 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
16963   echo $ac_n "(cached) $ac_c" 1>&6
16964 else
16965   
16966                 cat > conftest.$ac_ext <<EOF
16967 #line 16968 "configure"
16968 #include "confdefs.h"
16969 #include <netdb.h>
16970 int main() {
16971 h_errno = 0;
16972 ; return 0; }
16973 EOF
16974 if { (eval echo configure:16975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16975   rm -rf conftest*
16976   ol_cv_h_errno_thread_specific=yes
16977 else
16978   echo "configure: failed program was:" >&5
16979   cat conftest.$ac_ext >&5
16980   rm -rf conftest*
16981   ol_cv_h_errno_thread_specific=no
16982 fi
16983 rm -f conftest*
16984         
16985 fi
16986
16987 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
16988
16989         if test $ol_cv_errno_thread_specific != yes \
16990                 -o $ol_cv_h_errno_thread_specific != yes ; then
16991                 LIBS="$LTHREAD_LIBS $LIBS"
16992                 LTHREAD_LIBS=""
16993         fi
16994
16995 fi  
16996
16997 if test $ol_link_threads = no ; then
16998         if test $ol_with_threads = yes ; then
16999                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
17000         fi
17001
17002         if test $ol_with_threads = auto ; then
17003                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
17004                 ol_with_threads=no
17005         fi
17006
17007         cat >> confdefs.h <<\EOF
17008 #define NO_THREADS 1
17009 EOF
17010
17011         LTHREAD_LIBS=""
17012 fi
17013
17014 if test $ol_link_threads != no ; then
17015         cat >> confdefs.h <<\EOF
17016 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
17017 EOF
17018
17019 fi
17020
17021 ol_link_ldbm=no 
17022
17023 if test $ol_with_ldbm_api = auto \
17024         -o $ol_with_ldbm_api = berkeley \
17025         -o $ol_with_ldbm_api = bcompat ; then
17026
17027         if test $ol_with_ldbm_api = bcompat; then \
17028                 for ac_hdr in db_185.h db.h
17029 do
17030 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
17031 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
17032 echo "configure:17033: checking for $ac_hdr" >&5
17033 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
17034   echo $ac_n "(cached) $ac_c" 1>&6
17035 else
17036   cat > conftest.$ac_ext <<EOF
17037 #line 17038 "configure"
17038 #include "confdefs.h"
17039 #include <$ac_hdr>
17040 EOF
17041 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
17042 { (eval echo configure:17043: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
17043 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
17044 if test -z "$ac_err"; then
17045   rm -rf conftest*
17046   eval "ac_cv_header_$ac_safe=yes"
17047 else
17048   echo "$ac_err" >&5
17049   echo "configure: failed program was:" >&5
17050   cat conftest.$ac_ext >&5
17051   rm -rf conftest*
17052   eval "ac_cv_header_$ac_safe=no"
17053 fi
17054 rm -f conftest*
17055 fi
17056 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
17057   echo "$ac_t""yes" 1>&6
17058     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
17059   cat >> confdefs.h <<EOF
17060 #define $ac_tr_hdr 1
17061 EOF
17062  
17063 else
17064   echo "$ac_t""no" 1>&6
17065 fi
17066 done
17067
17068 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
17069         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
17070 echo "configure:17071: checking if Berkeley DB header compatibility" >&5
17071 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
17072   echo $ac_n "(cached) $ac_c" 1>&6
17073 else
17074   
17075                 cat > conftest.$ac_ext <<EOF
17076 #line 17077 "configure"
17077 #include "confdefs.h"
17078
17079 #if HAVE_DB_185_H
17080 #       include <db_185.h>
17081 #else
17082 #       include <db.h>
17083 #endif
17084
17085  /* this check could be improved */
17086 #ifndef DB_VERSION_MAJOR
17087 #       define DB_VERSION_MAJOR 1
17088 #endif
17089
17090 #if DB_VERSION_MAJOR == 1 
17091         __db_version_1
17092 #endif
17093
17094 EOF
17095 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17096   egrep "__db_version_1" >/dev/null 2>&1; then
17097   rm -rf conftest*
17098   ol_cv_header_db1=yes
17099 else
17100   rm -rf conftest*
17101   ol_cv_header_db1=no
17102 fi
17103 rm -f conftest*
17104
17105 fi
17106
17107 echo "$ac_t""$ol_cv_header_db1" 1>&6
17108
17109         if test $ol_cv_header_db1 = yes ; then
17110                 ol_cv_lib_db=no
17111 if test $ol_cv_lib_db = no ; then
17112         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
17113 echo "configure:17114: checking for Berkeley DB link (default)" >&5
17114 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
17115   echo $ac_n "(cached) $ac_c" 1>&6
17116 else
17117   
17118         ol_DB_LIB=
17119         ol_LIBS=$LIBS
17120         LIBS="$ol_DB_LIB $LIBS"
17121
17122         cat > conftest.$ac_ext <<EOF
17123 #line 17124 "configure"
17124 #include "confdefs.h"
17125
17126 #ifdef HAVE_DB_185_H
17127 # include <db_185.h>
17128 #else
17129 # include <db.h>
17130 #endif
17131
17132 #ifndef DB_VERSION_MAJOR
17133 # define DB_VERSION_MAJOR 1
17134 #endif
17135
17136 #ifndef NULL
17137 #define NULL ((void*)0)
17138 #endif
17139
17140 int main() {
17141
17142 #if DB_VERSION_MAJOR > 1
17143         {
17144                 char *version;
17145                 int major, minor, patch;
17146
17147                 version = db_version( &major, &minor, &patch );
17148
17149                 if( major != DB_VERSION_MAJOR ||
17150                         minor < DB_VERSION_MINOR )
17151                 {
17152                         printf("Berkeley DB version mismatch\n"
17153                                 "\texpected: %s\n\tgot: %s\n",
17154                                 DB_VERSION_STRING, version);
17155                         return 1;
17156                 }
17157         }
17158 #endif
17159
17160 #if DB_VERSION_MAJOR > 2
17161         db_env_create( NULL, 0 );
17162 #elif DB_VERSION_MAJOR > 1
17163         db_appexit( NULL );
17164 #else
17165         (void) dbopen( NULL, 0, 0, 0, NULL);
17166 #endif
17167
17168 ; return 0; }
17169 EOF
17170 if { (eval echo configure:17171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17171   rm -rf conftest*
17172   ol_cv_db_none=yes
17173 else
17174   echo "configure: failed program was:" >&5
17175   cat conftest.$ac_ext >&5
17176   rm -rf conftest*
17177   ol_cv_db_none=no
17178 fi
17179 rm -f conftest*
17180
17181         LIBS="$ol_LIBS"
17182
17183 fi
17184
17185 echo "$ac_t""$ol_cv_db_none" 1>&6
17186
17187         if test $ol_cv_db_none = yes ; then
17188                 ol_cv_lib_db=yes
17189         fi
17190 fi
17191
17192 if test $ol_cv_lib_db = no ; then
17193         echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
17194 echo "configure:17195: checking for Berkeley DB link (-ldb4)" >&5
17195 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
17196   echo $ac_n "(cached) $ac_c" 1>&6
17197 else
17198   
17199         ol_DB_LIB=-ldb4
17200         ol_LIBS=$LIBS
17201         LIBS="$ol_DB_LIB $LIBS"
17202
17203         cat > conftest.$ac_ext <<EOF
17204 #line 17205 "configure"
17205 #include "confdefs.h"
17206
17207 #ifdef HAVE_DB_185_H
17208 # include <db_185.h>
17209 #else
17210 # include <db.h>
17211 #endif
17212
17213 #ifndef DB_VERSION_MAJOR
17214 # define DB_VERSION_MAJOR 1
17215 #endif
17216
17217 #ifndef NULL
17218 #define NULL ((void*)0)
17219 #endif
17220
17221 int main() {
17222
17223 #if DB_VERSION_MAJOR > 1
17224         {
17225                 char *version;
17226                 int major, minor, patch;
17227
17228                 version = db_version( &major, &minor, &patch );
17229
17230                 if( major != DB_VERSION_MAJOR ||
17231                         minor < DB_VERSION_MINOR )
17232                 {
17233                         printf("Berkeley DB version mismatch\n"
17234                                 "\texpected: %s\n\tgot: %s\n",
17235                                 DB_VERSION_STRING, version);
17236                         return 1;
17237                 }
17238         }
17239 #endif
17240
17241 #if DB_VERSION_MAJOR > 2
17242         db_env_create( NULL, 0 );
17243 #elif DB_VERSION_MAJOR > 1
17244         db_appexit( NULL );
17245 #else
17246         (void) dbopen( NULL, 0, 0, 0, NULL);
17247 #endif
17248
17249 ; return 0; }
17250 EOF
17251 if { (eval echo configure:17252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17252   rm -rf conftest*
17253   ol_cv_db_db4=yes
17254 else
17255   echo "configure: failed program was:" >&5
17256   cat conftest.$ac_ext >&5
17257   rm -rf conftest*
17258   ol_cv_db_db4=no
17259 fi
17260 rm -f conftest*
17261
17262         LIBS="$ol_LIBS"
17263
17264 fi
17265
17266 echo "$ac_t""$ol_cv_db_db4" 1>&6
17267
17268         if test $ol_cv_db_db4 = yes ; then
17269                 ol_cv_lib_db=-ldb4
17270         fi
17271 fi
17272
17273 if test $ol_cv_lib_db = no ; then
17274         echo $ac_n "checking for Berkeley DB link (-ldb-4)""... $ac_c" 1>&6
17275 echo "configure:17276: checking for Berkeley DB link (-ldb-4)" >&5
17276 if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then
17277   echo $ac_n "(cached) $ac_c" 1>&6
17278 else
17279   
17280         ol_DB_LIB=-ldb-4
17281         ol_LIBS=$LIBS
17282         LIBS="$ol_DB_LIB $LIBS"
17283
17284         cat > conftest.$ac_ext <<EOF
17285 #line 17286 "configure"
17286 #include "confdefs.h"
17287
17288 #ifdef HAVE_DB_185_H
17289 # include <db_185.h>
17290 #else
17291 # include <db.h>
17292 #endif
17293
17294 #ifndef DB_VERSION_MAJOR
17295 # define DB_VERSION_MAJOR 1
17296 #endif
17297
17298 #ifndef NULL
17299 #define NULL ((void*)0)
17300 #endif
17301
17302 int main() {
17303
17304 #if DB_VERSION_MAJOR > 1
17305         {
17306                 char *version;
17307                 int major, minor, patch;
17308
17309                 version = db_version( &major, &minor, &patch );
17310
17311                 if( major != DB_VERSION_MAJOR ||
17312                         minor < DB_VERSION_MINOR )
17313                 {
17314                         printf("Berkeley DB version mismatch\n"
17315                                 "\texpected: %s\n\tgot: %s\n",
17316                                 DB_VERSION_STRING, version);
17317                         return 1;
17318                 }
17319         }
17320 #endif
17321
17322 #if DB_VERSION_MAJOR > 2
17323         db_env_create( NULL, 0 );
17324 #elif DB_VERSION_MAJOR > 1
17325         db_appexit( NULL );
17326 #else
17327         (void) dbopen( NULL, 0, 0, 0, NULL);
17328 #endif
17329
17330 ; return 0; }
17331 EOF
17332 if { (eval echo configure:17333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17333   rm -rf conftest*
17334   ol_cv_db_db_4=yes
17335 else
17336   echo "configure: failed program was:" >&5
17337   cat conftest.$ac_ext >&5
17338   rm -rf conftest*
17339   ol_cv_db_db_4=no
17340 fi
17341 rm -f conftest*
17342
17343         LIBS="$ol_LIBS"
17344
17345 fi
17346
17347 echo "$ac_t""$ol_cv_db_db_4" 1>&6
17348
17349         if test $ol_cv_db_db_4 = yes ; then
17350                 ol_cv_lib_db=-ldb-4
17351         fi
17352 fi
17353
17354 if test $ol_cv_lib_db = no ; then
17355         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
17356 echo "configure:17357: checking for Berkeley DB link (-ldb)" >&5
17357 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
17358   echo $ac_n "(cached) $ac_c" 1>&6
17359 else
17360   
17361         ol_DB_LIB=-ldb
17362         ol_LIBS=$LIBS
17363         LIBS="$ol_DB_LIB $LIBS"
17364
17365         cat > conftest.$ac_ext <<EOF
17366 #line 17367 "configure"
17367 #include "confdefs.h"
17368
17369 #ifdef HAVE_DB_185_H
17370 # include <db_185.h>
17371 #else
17372 # include <db.h>
17373 #endif
17374
17375 #ifndef DB_VERSION_MAJOR
17376 # define DB_VERSION_MAJOR 1
17377 #endif
17378
17379 #ifndef NULL
17380 #define NULL ((void*)0)
17381 #endif
17382
17383 int main() {
17384
17385 #if DB_VERSION_MAJOR > 1
17386         {
17387                 char *version;
17388                 int major, minor, patch;
17389
17390                 version = db_version( &major, &minor, &patch );
17391
17392                 if( major != DB_VERSION_MAJOR ||
17393                         minor < DB_VERSION_MINOR )
17394                 {
17395                         printf("Berkeley DB version mismatch\n"
17396                                 "\texpected: %s\n\tgot: %s\n",
17397                                 DB_VERSION_STRING, version);
17398                         return 1;
17399                 }
17400         }
17401 #endif
17402
17403 #if DB_VERSION_MAJOR > 2
17404         db_env_create( NULL, 0 );
17405 #elif DB_VERSION_MAJOR > 1
17406         db_appexit( NULL );
17407 #else
17408         (void) dbopen( NULL, 0, 0, 0, NULL);
17409 #endif
17410
17411 ; return 0; }
17412 EOF
17413 if { (eval echo configure:17414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17414   rm -rf conftest*
17415   ol_cv_db_db=yes
17416 else
17417   echo "configure: failed program was:" >&5
17418   cat conftest.$ac_ext >&5
17419   rm -rf conftest*
17420   ol_cv_db_db=no
17421 fi
17422 rm -f conftest*
17423
17424         LIBS="$ol_LIBS"
17425
17426 fi
17427
17428 echo "$ac_t""$ol_cv_db_db" 1>&6
17429
17430         if test $ol_cv_db_db = yes ; then
17431                 ol_cv_lib_db=-ldb
17432         fi
17433 fi
17434
17435 if test $ol_cv_lib_db = no ; then
17436         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
17437 echo "configure:17438: checking for Berkeley DB link (-ldb3)" >&5
17438 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
17439   echo $ac_n "(cached) $ac_c" 1>&6
17440 else
17441   
17442         ol_DB_LIB=-ldb3
17443         ol_LIBS=$LIBS
17444         LIBS="$ol_DB_LIB $LIBS"
17445
17446         cat > conftest.$ac_ext <<EOF
17447 #line 17448 "configure"
17448 #include "confdefs.h"
17449
17450 #ifdef HAVE_DB_185_H
17451 # include <db_185.h>
17452 #else
17453 # include <db.h>
17454 #endif
17455
17456 #ifndef DB_VERSION_MAJOR
17457 # define DB_VERSION_MAJOR 1
17458 #endif
17459
17460 #ifndef NULL
17461 #define NULL ((void*)0)
17462 #endif
17463
17464 int main() {
17465
17466 #if DB_VERSION_MAJOR > 1
17467         {
17468                 char *version;
17469                 int major, minor, patch;
17470
17471                 version = db_version( &major, &minor, &patch );
17472
17473                 if( major != DB_VERSION_MAJOR ||
17474                         minor < DB_VERSION_MINOR )
17475                 {
17476                         printf("Berkeley DB version mismatch\n"
17477                                 "\texpected: %s\n\tgot: %s\n",
17478                                 DB_VERSION_STRING, version);
17479                         return 1;
17480                 }
17481         }
17482 #endif
17483
17484 #if DB_VERSION_MAJOR > 2
17485         db_env_create( NULL, 0 );
17486 #elif DB_VERSION_MAJOR > 1
17487         db_appexit( NULL );
17488 #else
17489         (void) dbopen( NULL, 0, 0, 0, NULL);
17490 #endif
17491
17492 ; return 0; }
17493 EOF
17494 if { (eval echo configure:17495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17495   rm -rf conftest*
17496   ol_cv_db_db3=yes
17497 else
17498   echo "configure: failed program was:" >&5
17499   cat conftest.$ac_ext >&5
17500   rm -rf conftest*
17501   ol_cv_db_db3=no
17502 fi
17503 rm -f conftest*
17504
17505         LIBS="$ol_LIBS"
17506
17507 fi
17508
17509 echo "$ac_t""$ol_cv_db_db3" 1>&6
17510
17511         if test $ol_cv_db_db3 = yes ; then
17512                 ol_cv_lib_db=-ldb3
17513         fi
17514 fi
17515
17516 if test $ol_cv_lib_db = no ; then
17517         echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6
17518 echo "configure:17519: checking for Berkeley DB link (-ldb-3)" >&5
17519 if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then
17520   echo $ac_n "(cached) $ac_c" 1>&6
17521 else
17522   
17523         ol_DB_LIB=-ldb-3
17524         ol_LIBS=$LIBS
17525         LIBS="$ol_DB_LIB $LIBS"
17526
17527         cat > conftest.$ac_ext <<EOF
17528 #line 17529 "configure"
17529 #include "confdefs.h"
17530
17531 #ifdef HAVE_DB_185_H
17532 # include <db_185.h>
17533 #else
17534 # include <db.h>
17535 #endif
17536
17537 #ifndef DB_VERSION_MAJOR
17538 # define DB_VERSION_MAJOR 1
17539 #endif
17540
17541 #ifndef NULL
17542 #define NULL ((void*)0)
17543 #endif
17544
17545 int main() {
17546
17547 #if DB_VERSION_MAJOR > 1
17548         {
17549                 char *version;
17550                 int major, minor, patch;
17551
17552                 version = db_version( &major, &minor, &patch );
17553
17554                 if( major != DB_VERSION_MAJOR ||
17555                         minor < DB_VERSION_MINOR )
17556                 {
17557                         printf("Berkeley DB version mismatch\n"
17558                                 "\texpected: %s\n\tgot: %s\n",
17559                                 DB_VERSION_STRING, version);
17560                         return 1;
17561                 }
17562         }
17563 #endif
17564
17565 #if DB_VERSION_MAJOR > 2
17566         db_env_create( NULL, 0 );
17567 #elif DB_VERSION_MAJOR > 1
17568         db_appexit( NULL );
17569 #else
17570         (void) dbopen( NULL, 0, 0, 0, NULL);
17571 #endif
17572
17573 ; return 0; }
17574 EOF
17575 if { (eval echo configure:17576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17576   rm -rf conftest*
17577   ol_cv_db_db_3=yes
17578 else
17579   echo "configure: failed program was:" >&5
17580   cat conftest.$ac_ext >&5
17581   rm -rf conftest*
17582   ol_cv_db_db_3=no
17583 fi
17584 rm -f conftest*
17585
17586         LIBS="$ol_LIBS"
17587
17588 fi
17589
17590 echo "$ac_t""$ol_cv_db_db_3" 1>&6
17591
17592         if test $ol_cv_db_db_3 = yes ; then
17593                 ol_cv_lib_db=-ldb-3
17594         fi
17595 fi
17596
17597 if test $ol_cv_lib_db = no ; then
17598         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
17599 echo "configure:17600: checking for Berkeley DB link (-ldb2)" >&5
17600 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
17601   echo $ac_n "(cached) $ac_c" 1>&6
17602 else
17603   
17604         ol_DB_LIB=-ldb2
17605         ol_LIBS=$LIBS
17606         LIBS="$ol_DB_LIB $LIBS"
17607
17608         cat > conftest.$ac_ext <<EOF
17609 #line 17610 "configure"
17610 #include "confdefs.h"
17611
17612 #ifdef HAVE_DB_185_H
17613 # include <db_185.h>
17614 #else
17615 # include <db.h>
17616 #endif
17617
17618 #ifndef DB_VERSION_MAJOR
17619 # define DB_VERSION_MAJOR 1
17620 #endif
17621
17622 #ifndef NULL
17623 #define NULL ((void*)0)
17624 #endif
17625
17626 int main() {
17627
17628 #if DB_VERSION_MAJOR > 1
17629         {
17630                 char *version;
17631                 int major, minor, patch;
17632
17633                 version = db_version( &major, &minor, &patch );
17634
17635                 if( major != DB_VERSION_MAJOR ||
17636                         minor < DB_VERSION_MINOR )
17637                 {
17638                         printf("Berkeley DB version mismatch\n"
17639                                 "\texpected: %s\n\tgot: %s\n",
17640                                 DB_VERSION_STRING, version);
17641                         return 1;
17642                 }
17643         }
17644 #endif
17645
17646 #if DB_VERSION_MAJOR > 2
17647         db_env_create( NULL, 0 );
17648 #elif DB_VERSION_MAJOR > 1
17649         db_appexit( NULL );
17650 #else
17651         (void) dbopen( NULL, 0, 0, 0, NULL);
17652 #endif
17653
17654 ; return 0; }
17655 EOF
17656 if { (eval echo configure:17657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17657   rm -rf conftest*
17658   ol_cv_db_db2=yes
17659 else
17660   echo "configure: failed program was:" >&5
17661   cat conftest.$ac_ext >&5
17662   rm -rf conftest*
17663   ol_cv_db_db2=no
17664 fi
17665 rm -f conftest*
17666
17667         LIBS="$ol_LIBS"
17668
17669 fi
17670
17671 echo "$ac_t""$ol_cv_db_db2" 1>&6
17672
17673         if test $ol_cv_db_db2 = yes ; then
17674                 ol_cv_lib_db=-ldb2
17675         fi
17676 fi
17677
17678 if test $ol_cv_lib_db = no ; then
17679         echo $ac_n "checking for Berkeley DB link (-ldb-2)""... $ac_c" 1>&6
17680 echo "configure:17681: checking for Berkeley DB link (-ldb-2)" >&5
17681 if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then
17682   echo $ac_n "(cached) $ac_c" 1>&6
17683 else
17684   
17685         ol_DB_LIB=-ldb-2
17686         ol_LIBS=$LIBS
17687         LIBS="$ol_DB_LIB $LIBS"
17688
17689         cat > conftest.$ac_ext <<EOF
17690 #line 17691 "configure"
17691 #include "confdefs.h"
17692
17693 #ifdef HAVE_DB_185_H
17694 # include <db_185.h>
17695 #else
17696 # include <db.h>
17697 #endif
17698
17699 #ifndef DB_VERSION_MAJOR
17700 # define DB_VERSION_MAJOR 1
17701 #endif
17702
17703 #ifndef NULL
17704 #define NULL ((void*)0)
17705 #endif
17706
17707 int main() {
17708
17709 #if DB_VERSION_MAJOR > 1
17710         {
17711                 char *version;
17712                 int major, minor, patch;
17713
17714                 version = db_version( &major, &minor, &patch );
17715
17716                 if( major != DB_VERSION_MAJOR ||
17717                         minor < DB_VERSION_MINOR )
17718                 {
17719                         printf("Berkeley DB version mismatch\n"
17720                                 "\texpected: %s\n\tgot: %s\n",
17721                                 DB_VERSION_STRING, version);
17722                         return 1;
17723                 }
17724         }
17725 #endif
17726
17727 #if DB_VERSION_MAJOR > 2
17728         db_env_create( NULL, 0 );
17729 #elif DB_VERSION_MAJOR > 1
17730         db_appexit( NULL );
17731 #else
17732         (void) dbopen( NULL, 0, 0, 0, NULL);
17733 #endif
17734
17735 ; return 0; }
17736 EOF
17737 if { (eval echo configure:17738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17738   rm -rf conftest*
17739   ol_cv_db_db_2=yes
17740 else
17741   echo "configure: failed program was:" >&5
17742   cat conftest.$ac_ext >&5
17743   rm -rf conftest*
17744   ol_cv_db_db_2=no
17745 fi
17746 rm -f conftest*
17747
17748         LIBS="$ol_LIBS"
17749
17750 fi
17751
17752 echo "$ac_t""$ol_cv_db_db_2" 1>&6
17753
17754         if test $ol_cv_db_db_2 = yes ; then
17755                 ol_cv_lib_db=-ldb-2
17756         fi
17757 fi
17758
17759 if test $ol_cv_lib_db = no ; then
17760         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
17761 echo "configure:17762: checking for Berkeley DB link (-ldb1)" >&5
17762 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
17763   echo $ac_n "(cached) $ac_c" 1>&6
17764 else
17765   
17766         ol_DB_LIB=-ldb1
17767         ol_LIBS=$LIBS
17768         LIBS="$ol_DB_LIB $LIBS"
17769
17770         cat > conftest.$ac_ext <<EOF
17771 #line 17772 "configure"
17772 #include "confdefs.h"
17773
17774 #ifdef HAVE_DB_185_H
17775 # include <db_185.h>
17776 #else
17777 # include <db.h>
17778 #endif
17779
17780 #ifndef DB_VERSION_MAJOR
17781 # define DB_VERSION_MAJOR 1
17782 #endif
17783
17784 #ifndef NULL
17785 #define NULL ((void*)0)
17786 #endif
17787
17788 int main() {
17789
17790 #if DB_VERSION_MAJOR > 1
17791         {
17792                 char *version;
17793                 int major, minor, patch;
17794
17795                 version = db_version( &major, &minor, &patch );
17796
17797                 if( major != DB_VERSION_MAJOR ||
17798                         minor < DB_VERSION_MINOR )
17799                 {
17800                         printf("Berkeley DB version mismatch\n"
17801                                 "\texpected: %s\n\tgot: %s\n",
17802                                 DB_VERSION_STRING, version);
17803                         return 1;
17804                 }
17805         }
17806 #endif
17807
17808 #if DB_VERSION_MAJOR > 2
17809         db_env_create( NULL, 0 );
17810 #elif DB_VERSION_MAJOR > 1
17811         db_appexit( NULL );
17812 #else
17813         (void) dbopen( NULL, 0, 0, 0, NULL);
17814 #endif
17815
17816 ; return 0; }
17817 EOF
17818 if { (eval echo configure:17819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17819   rm -rf conftest*
17820   ol_cv_db_db1=yes
17821 else
17822   echo "configure: failed program was:" >&5
17823   cat conftest.$ac_ext >&5
17824   rm -rf conftest*
17825   ol_cv_db_db1=no
17826 fi
17827 rm -f conftest*
17828
17829         LIBS="$ol_LIBS"
17830
17831 fi
17832
17833 echo "$ac_t""$ol_cv_db_db1" 1>&6
17834
17835         if test $ol_cv_db_db1 = yes ; then
17836                 ol_cv_lib_db=-ldb1
17837         fi
17838 fi
17839
17840 if test $ol_cv_lib_db = no ; then
17841         echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6
17842 echo "configure:17843: checking for Berkeley DB link (-ldb-1)" >&5
17843 if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then
17844   echo $ac_n "(cached) $ac_c" 1>&6
17845 else
17846   
17847         ol_DB_LIB=-ldb-1
17848         ol_LIBS=$LIBS
17849         LIBS="$ol_DB_LIB $LIBS"
17850
17851         cat > conftest.$ac_ext <<EOF
17852 #line 17853 "configure"
17853 #include "confdefs.h"
17854
17855 #ifdef HAVE_DB_185_H
17856 # include <db_185.h>
17857 #else
17858 # include <db.h>
17859 #endif
17860
17861 #ifndef DB_VERSION_MAJOR
17862 # define DB_VERSION_MAJOR 1
17863 #endif
17864
17865 #ifndef NULL
17866 #define NULL ((void*)0)
17867 #endif
17868
17869 int main() {
17870
17871 #if DB_VERSION_MAJOR > 1
17872         {
17873                 char *version;
17874                 int major, minor, patch;
17875
17876                 version = db_version( &major, &minor, &patch );
17877
17878                 if( major != DB_VERSION_MAJOR ||
17879                         minor < DB_VERSION_MINOR )
17880                 {
17881                         printf("Berkeley DB version mismatch\n"
17882                                 "\texpected: %s\n\tgot: %s\n",
17883                                 DB_VERSION_STRING, version);
17884                         return 1;
17885                 }
17886         }
17887 #endif
17888
17889 #if DB_VERSION_MAJOR > 2
17890         db_env_create( NULL, 0 );
17891 #elif DB_VERSION_MAJOR > 1
17892         db_appexit( NULL );
17893 #else
17894         (void) dbopen( NULL, 0, 0, 0, NULL);
17895 #endif
17896
17897 ; return 0; }
17898 EOF
17899 if { (eval echo configure:17900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17900   rm -rf conftest*
17901   ol_cv_db_db_1=yes
17902 else
17903   echo "configure: failed program was:" >&5
17904   cat conftest.$ac_ext >&5
17905   rm -rf conftest*
17906   ol_cv_db_db_1=no
17907 fi
17908 rm -f conftest*
17909
17910         LIBS="$ol_LIBS"
17911
17912 fi
17913
17914 echo "$ac_t""$ol_cv_db_db_1" 1>&6
17915
17916         if test $ol_cv_db_db_1 = yes ; then
17917                 ol_cv_lib_db=-ldb-1
17918         fi
17919 fi
17920
17921
17922                 if test "$ol_cv_lib_db" != no ; then
17923                         ol_cv_berkeley_db=yes
17924                 fi
17925         fi
17926 fi
17927
17928         else
17929                 ol_cv_berkeley_db=no
17930 for ac_hdr in db.h
17931 do
17932 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
17933 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
17934 echo "configure:17935: checking for $ac_hdr" >&5
17935 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
17936   echo $ac_n "(cached) $ac_c" 1>&6
17937 else
17938   cat > conftest.$ac_ext <<EOF
17939 #line 17940 "configure"
17940 #include "confdefs.h"
17941 #include <$ac_hdr>
17942 EOF
17943 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
17944 { (eval echo configure:17945: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
17945 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
17946 if test -z "$ac_err"; then
17947   rm -rf conftest*
17948   eval "ac_cv_header_$ac_safe=yes"
17949 else
17950   echo "$ac_err" >&5
17951   echo "configure: failed program was:" >&5
17952   cat conftest.$ac_ext >&5
17953   rm -rf conftest*
17954   eval "ac_cv_header_$ac_safe=no"
17955 fi
17956 rm -f conftest*
17957 fi
17958 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
17959   echo "$ac_t""yes" 1>&6
17960     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
17961   cat >> confdefs.h <<EOF
17962 #define $ac_tr_hdr 1
17963 EOF
17964  
17965 else
17966   echo "$ac_t""no" 1>&6
17967 fi
17968 done
17969
17970 if test $ac_cv_header_db_h = yes; then
17971         ol_cv_lib_db=no
17972 if test $ol_cv_lib_db = no ; then
17973         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
17974 echo "configure:17975: checking for Berkeley DB link (default)" >&5
17975 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
17976   echo $ac_n "(cached) $ac_c" 1>&6
17977 else
17978   
17979         ol_DB_LIB=
17980         ol_LIBS=$LIBS
17981         LIBS="$ol_DB_LIB $LIBS"
17982
17983         cat > conftest.$ac_ext <<EOF
17984 #line 17985 "configure"
17985 #include "confdefs.h"
17986
17987 #ifdef HAVE_DB_185_H
17988 # include <db_185.h>
17989 #else
17990 # include <db.h>
17991 #endif
17992
17993 #ifndef DB_VERSION_MAJOR
17994 # define DB_VERSION_MAJOR 1
17995 #endif
17996
17997 #ifndef NULL
17998 #define NULL ((void*)0)
17999 #endif
18000
18001 int main() {
18002
18003 #if DB_VERSION_MAJOR > 1
18004         {
18005                 char *version;
18006                 int major, minor, patch;
18007
18008                 version = db_version( &major, &minor, &patch );
18009
18010                 if( major != DB_VERSION_MAJOR ||
18011                         minor < DB_VERSION_MINOR )
18012                 {
18013                         printf("Berkeley DB version mismatch\n"
18014                                 "\texpected: %s\n\tgot: %s\n",
18015                                 DB_VERSION_STRING, version);
18016                         return 1;
18017                 }
18018         }
18019 #endif
18020
18021 #if DB_VERSION_MAJOR > 2
18022         db_env_create( NULL, 0 );
18023 #elif DB_VERSION_MAJOR > 1
18024         db_appexit( NULL );
18025 #else
18026         (void) dbopen( NULL, 0, 0, 0, NULL);
18027 #endif
18028
18029 ; return 0; }
18030 EOF
18031 if { (eval echo configure:18032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18032   rm -rf conftest*
18033   ol_cv_db_none=yes
18034 else
18035   echo "configure: failed program was:" >&5
18036   cat conftest.$ac_ext >&5
18037   rm -rf conftest*
18038   ol_cv_db_none=no
18039 fi
18040 rm -f conftest*
18041
18042         LIBS="$ol_LIBS"
18043
18044 fi
18045
18046 echo "$ac_t""$ol_cv_db_none" 1>&6
18047
18048         if test $ol_cv_db_none = yes ; then
18049                 ol_cv_lib_db=yes
18050         fi
18051 fi
18052
18053 if test $ol_cv_lib_db = no ; then
18054         echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
18055 echo "configure:18056: checking for Berkeley DB link (-ldb4)" >&5
18056 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
18057   echo $ac_n "(cached) $ac_c" 1>&6
18058 else
18059   
18060         ol_DB_LIB=-ldb4
18061         ol_LIBS=$LIBS
18062         LIBS="$ol_DB_LIB $LIBS"
18063
18064         cat > conftest.$ac_ext <<EOF
18065 #line 18066 "configure"
18066 #include "confdefs.h"
18067
18068 #ifdef HAVE_DB_185_H
18069 # include <db_185.h>
18070 #else
18071 # include <db.h>
18072 #endif
18073
18074 #ifndef DB_VERSION_MAJOR
18075 # define DB_VERSION_MAJOR 1
18076 #endif
18077
18078 #ifndef NULL
18079 #define NULL ((void*)0)
18080 #endif
18081
18082 int main() {
18083
18084 #if DB_VERSION_MAJOR > 1
18085         {
18086                 char *version;
18087                 int major, minor, patch;
18088
18089                 version = db_version( &major, &minor, &patch );
18090
18091                 if( major != DB_VERSION_MAJOR ||
18092                         minor < DB_VERSION_MINOR )
18093                 {
18094                         printf("Berkeley DB version mismatch\n"
18095                                 "\texpected: %s\n\tgot: %s\n",
18096                                 DB_VERSION_STRING, version);
18097                         return 1;
18098                 }
18099         }
18100 #endif
18101
18102 #if DB_VERSION_MAJOR > 2
18103         db_env_create( NULL, 0 );
18104 #elif DB_VERSION_MAJOR > 1
18105         db_appexit( NULL );
18106 #else
18107         (void) dbopen( NULL, 0, 0, 0, NULL);
18108 #endif
18109
18110 ; return 0; }
18111 EOF
18112 if { (eval echo configure:18113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18113   rm -rf conftest*
18114   ol_cv_db_db4=yes
18115 else
18116   echo "configure: failed program was:" >&5
18117   cat conftest.$ac_ext >&5
18118   rm -rf conftest*
18119   ol_cv_db_db4=no
18120 fi
18121 rm -f conftest*
18122
18123         LIBS="$ol_LIBS"
18124
18125 fi
18126
18127 echo "$ac_t""$ol_cv_db_db4" 1>&6
18128
18129         if test $ol_cv_db_db4 = yes ; then
18130                 ol_cv_lib_db=-ldb4
18131         fi
18132 fi
18133
18134 if test $ol_cv_lib_db = no ; then
18135         echo $ac_n "checking for Berkeley DB link (-ldb-4)""... $ac_c" 1>&6
18136 echo "configure:18137: checking for Berkeley DB link (-ldb-4)" >&5
18137 if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then
18138   echo $ac_n "(cached) $ac_c" 1>&6
18139 else
18140   
18141         ol_DB_LIB=-ldb-4
18142         ol_LIBS=$LIBS
18143         LIBS="$ol_DB_LIB $LIBS"
18144
18145         cat > conftest.$ac_ext <<EOF
18146 #line 18147 "configure"
18147 #include "confdefs.h"
18148
18149 #ifdef HAVE_DB_185_H
18150 # include <db_185.h>
18151 #else
18152 # include <db.h>
18153 #endif
18154
18155 #ifndef DB_VERSION_MAJOR
18156 # define DB_VERSION_MAJOR 1
18157 #endif
18158
18159 #ifndef NULL
18160 #define NULL ((void*)0)
18161 #endif
18162
18163 int main() {
18164
18165 #if DB_VERSION_MAJOR > 1
18166         {
18167                 char *version;
18168                 int major, minor, patch;
18169
18170                 version = db_version( &major, &minor, &patch );
18171
18172                 if( major != DB_VERSION_MAJOR ||
18173                         minor < DB_VERSION_MINOR )
18174                 {
18175                         printf("Berkeley DB version mismatch\n"
18176                                 "\texpected: %s\n\tgot: %s\n",
18177                                 DB_VERSION_STRING, version);
18178                         return 1;
18179                 }
18180         }
18181 #endif
18182
18183 #if DB_VERSION_MAJOR > 2
18184         db_env_create( NULL, 0 );
18185 #elif DB_VERSION_MAJOR > 1
18186         db_appexit( NULL );
18187 #else
18188         (void) dbopen( NULL, 0, 0, 0, NULL);
18189 #endif
18190
18191 ; return 0; }
18192 EOF
18193 if { (eval echo configure:18194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18194   rm -rf conftest*
18195   ol_cv_db_db_4=yes
18196 else
18197   echo "configure: failed program was:" >&5
18198   cat conftest.$ac_ext >&5
18199   rm -rf conftest*
18200   ol_cv_db_db_4=no
18201 fi
18202 rm -f conftest*
18203
18204         LIBS="$ol_LIBS"
18205
18206 fi
18207
18208 echo "$ac_t""$ol_cv_db_db_4" 1>&6
18209
18210         if test $ol_cv_db_db_4 = yes ; then
18211                 ol_cv_lib_db=-ldb-4
18212         fi
18213 fi
18214
18215 if test $ol_cv_lib_db = no ; then
18216         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
18217 echo "configure:18218: checking for Berkeley DB link (-ldb)" >&5
18218 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
18219   echo $ac_n "(cached) $ac_c" 1>&6
18220 else
18221   
18222         ol_DB_LIB=-ldb
18223         ol_LIBS=$LIBS
18224         LIBS="$ol_DB_LIB $LIBS"
18225
18226         cat > conftest.$ac_ext <<EOF
18227 #line 18228 "configure"
18228 #include "confdefs.h"
18229
18230 #ifdef HAVE_DB_185_H
18231 # include <db_185.h>
18232 #else
18233 # include <db.h>
18234 #endif
18235
18236 #ifndef DB_VERSION_MAJOR
18237 # define DB_VERSION_MAJOR 1
18238 #endif
18239
18240 #ifndef NULL
18241 #define NULL ((void*)0)
18242 #endif
18243
18244 int main() {
18245
18246 #if DB_VERSION_MAJOR > 1
18247         {
18248                 char *version;
18249                 int major, minor, patch;
18250
18251                 version = db_version( &major, &minor, &patch );
18252
18253                 if( major != DB_VERSION_MAJOR ||
18254                         minor < DB_VERSION_MINOR )
18255                 {
18256                         printf("Berkeley DB version mismatch\n"
18257                                 "\texpected: %s\n\tgot: %s\n",
18258                                 DB_VERSION_STRING, version);
18259                         return 1;
18260                 }
18261         }
18262 #endif
18263
18264 #if DB_VERSION_MAJOR > 2
18265         db_env_create( NULL, 0 );
18266 #elif DB_VERSION_MAJOR > 1
18267         db_appexit( NULL );
18268 #else
18269         (void) dbopen( NULL, 0, 0, 0, NULL);
18270 #endif
18271
18272 ; return 0; }
18273 EOF
18274 if { (eval echo configure:18275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18275   rm -rf conftest*
18276   ol_cv_db_db=yes
18277 else
18278   echo "configure: failed program was:" >&5
18279   cat conftest.$ac_ext >&5
18280   rm -rf conftest*
18281   ol_cv_db_db=no
18282 fi
18283 rm -f conftest*
18284
18285         LIBS="$ol_LIBS"
18286
18287 fi
18288
18289 echo "$ac_t""$ol_cv_db_db" 1>&6
18290
18291         if test $ol_cv_db_db = yes ; then
18292                 ol_cv_lib_db=-ldb
18293         fi
18294 fi
18295
18296 if test $ol_cv_lib_db = no ; then
18297         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
18298 echo "configure:18299: checking for Berkeley DB link (-ldb3)" >&5
18299 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
18300   echo $ac_n "(cached) $ac_c" 1>&6
18301 else
18302   
18303         ol_DB_LIB=-ldb3
18304         ol_LIBS=$LIBS
18305         LIBS="$ol_DB_LIB $LIBS"
18306
18307         cat > conftest.$ac_ext <<EOF
18308 #line 18309 "configure"
18309 #include "confdefs.h"
18310
18311 #ifdef HAVE_DB_185_H
18312 # include <db_185.h>
18313 #else
18314 # include <db.h>
18315 #endif
18316
18317 #ifndef DB_VERSION_MAJOR
18318 # define DB_VERSION_MAJOR 1
18319 #endif
18320
18321 #ifndef NULL
18322 #define NULL ((void*)0)
18323 #endif
18324
18325 int main() {
18326
18327 #if DB_VERSION_MAJOR > 1
18328         {
18329                 char *version;
18330                 int major, minor, patch;
18331
18332                 version = db_version( &major, &minor, &patch );
18333
18334                 if( major != DB_VERSION_MAJOR ||
18335                         minor < DB_VERSION_MINOR )
18336                 {
18337                         printf("Berkeley DB version mismatch\n"
18338                                 "\texpected: %s\n\tgot: %s\n",
18339                                 DB_VERSION_STRING, version);
18340                         return 1;
18341                 }
18342         }
18343 #endif
18344
18345 #if DB_VERSION_MAJOR > 2
18346         db_env_create( NULL, 0 );
18347 #elif DB_VERSION_MAJOR > 1
18348         db_appexit( NULL );
18349 #else
18350         (void) dbopen( NULL, 0, 0, 0, NULL);
18351 #endif
18352
18353 ; return 0; }
18354 EOF
18355 if { (eval echo configure:18356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18356   rm -rf conftest*
18357   ol_cv_db_db3=yes
18358 else
18359   echo "configure: failed program was:" >&5
18360   cat conftest.$ac_ext >&5
18361   rm -rf conftest*
18362   ol_cv_db_db3=no
18363 fi
18364 rm -f conftest*
18365
18366         LIBS="$ol_LIBS"
18367
18368 fi
18369
18370 echo "$ac_t""$ol_cv_db_db3" 1>&6
18371
18372         if test $ol_cv_db_db3 = yes ; then
18373                 ol_cv_lib_db=-ldb3
18374         fi
18375 fi
18376
18377 if test $ol_cv_lib_db = no ; then
18378         echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6
18379 echo "configure:18380: checking for Berkeley DB link (-ldb-3)" >&5
18380 if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then
18381   echo $ac_n "(cached) $ac_c" 1>&6
18382 else
18383   
18384         ol_DB_LIB=-ldb-3
18385         ol_LIBS=$LIBS
18386         LIBS="$ol_DB_LIB $LIBS"
18387
18388         cat > conftest.$ac_ext <<EOF
18389 #line 18390 "configure"
18390 #include "confdefs.h"
18391
18392 #ifdef HAVE_DB_185_H
18393 # include <db_185.h>
18394 #else
18395 # include <db.h>
18396 #endif
18397
18398 #ifndef DB_VERSION_MAJOR
18399 # define DB_VERSION_MAJOR 1
18400 #endif
18401
18402 #ifndef NULL
18403 #define NULL ((void*)0)
18404 #endif
18405
18406 int main() {
18407
18408 #if DB_VERSION_MAJOR > 1
18409         {
18410                 char *version;
18411                 int major, minor, patch;
18412
18413                 version = db_version( &major, &minor, &patch );
18414
18415                 if( major != DB_VERSION_MAJOR ||
18416                         minor < DB_VERSION_MINOR )
18417                 {
18418                         printf("Berkeley DB version mismatch\n"
18419                                 "\texpected: %s\n\tgot: %s\n",
18420                                 DB_VERSION_STRING, version);
18421                         return 1;
18422                 }
18423         }
18424 #endif
18425
18426 #if DB_VERSION_MAJOR > 2
18427         db_env_create( NULL, 0 );
18428 #elif DB_VERSION_MAJOR > 1
18429         db_appexit( NULL );
18430 #else
18431         (void) dbopen( NULL, 0, 0, 0, NULL);
18432 #endif
18433
18434 ; return 0; }
18435 EOF
18436 if { (eval echo configure:18437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18437   rm -rf conftest*
18438   ol_cv_db_db_3=yes
18439 else
18440   echo "configure: failed program was:" >&5
18441   cat conftest.$ac_ext >&5
18442   rm -rf conftest*
18443   ol_cv_db_db_3=no
18444 fi
18445 rm -f conftest*
18446
18447         LIBS="$ol_LIBS"
18448
18449 fi
18450
18451 echo "$ac_t""$ol_cv_db_db_3" 1>&6
18452
18453         if test $ol_cv_db_db_3 = yes ; then
18454                 ol_cv_lib_db=-ldb-3
18455         fi
18456 fi
18457
18458 if test $ol_cv_lib_db = no ; then
18459         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
18460 echo "configure:18461: checking for Berkeley DB link (-ldb2)" >&5
18461 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
18462   echo $ac_n "(cached) $ac_c" 1>&6
18463 else
18464   
18465         ol_DB_LIB=-ldb2
18466         ol_LIBS=$LIBS
18467         LIBS="$ol_DB_LIB $LIBS"
18468
18469         cat > conftest.$ac_ext <<EOF
18470 #line 18471 "configure"
18471 #include "confdefs.h"
18472
18473 #ifdef HAVE_DB_185_H
18474 # include <db_185.h>
18475 #else
18476 # include <db.h>
18477 #endif
18478
18479 #ifndef DB_VERSION_MAJOR
18480 # define DB_VERSION_MAJOR 1
18481 #endif
18482
18483 #ifndef NULL
18484 #define NULL ((void*)0)
18485 #endif
18486
18487 int main() {
18488
18489 #if DB_VERSION_MAJOR > 1
18490         {
18491                 char *version;
18492                 int major, minor, patch;
18493
18494                 version = db_version( &major, &minor, &patch );
18495
18496                 if( major != DB_VERSION_MAJOR ||
18497                         minor < DB_VERSION_MINOR )
18498                 {
18499                         printf("Berkeley DB version mismatch\n"
18500                                 "\texpected: %s\n\tgot: %s\n",
18501                                 DB_VERSION_STRING, version);
18502                         return 1;
18503                 }
18504         }
18505 #endif
18506
18507 #if DB_VERSION_MAJOR > 2
18508         db_env_create( NULL, 0 );
18509 #elif DB_VERSION_MAJOR > 1
18510         db_appexit( NULL );
18511 #else
18512         (void) dbopen( NULL, 0, 0, 0, NULL);
18513 #endif
18514
18515 ; return 0; }
18516 EOF
18517 if { (eval echo configure:18518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18518   rm -rf conftest*
18519   ol_cv_db_db2=yes
18520 else
18521   echo "configure: failed program was:" >&5
18522   cat conftest.$ac_ext >&5
18523   rm -rf conftest*
18524   ol_cv_db_db2=no
18525 fi
18526 rm -f conftest*
18527
18528         LIBS="$ol_LIBS"
18529
18530 fi
18531
18532 echo "$ac_t""$ol_cv_db_db2" 1>&6
18533
18534         if test $ol_cv_db_db2 = yes ; then
18535                 ol_cv_lib_db=-ldb2
18536         fi
18537 fi
18538
18539 if test $ol_cv_lib_db = no ; then
18540         echo $ac_n "checking for Berkeley DB link (-ldb-2)""... $ac_c" 1>&6
18541 echo "configure:18542: checking for Berkeley DB link (-ldb-2)" >&5
18542 if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then
18543   echo $ac_n "(cached) $ac_c" 1>&6
18544 else
18545   
18546         ol_DB_LIB=-ldb-2
18547         ol_LIBS=$LIBS
18548         LIBS="$ol_DB_LIB $LIBS"
18549
18550         cat > conftest.$ac_ext <<EOF
18551 #line 18552 "configure"
18552 #include "confdefs.h"
18553
18554 #ifdef HAVE_DB_185_H
18555 # include <db_185.h>
18556 #else
18557 # include <db.h>
18558 #endif
18559
18560 #ifndef DB_VERSION_MAJOR
18561 # define DB_VERSION_MAJOR 1
18562 #endif
18563
18564 #ifndef NULL
18565 #define NULL ((void*)0)
18566 #endif
18567
18568 int main() {
18569
18570 #if DB_VERSION_MAJOR > 1
18571         {
18572                 char *version;
18573                 int major, minor, patch;
18574
18575                 version = db_version( &major, &minor, &patch );
18576
18577                 if( major != DB_VERSION_MAJOR ||
18578                         minor < DB_VERSION_MINOR )
18579                 {
18580                         printf("Berkeley DB version mismatch\n"
18581                                 "\texpected: %s\n\tgot: %s\n",
18582                                 DB_VERSION_STRING, version);
18583                         return 1;
18584                 }
18585         }
18586 #endif
18587
18588 #if DB_VERSION_MAJOR > 2
18589         db_env_create( NULL, 0 );
18590 #elif DB_VERSION_MAJOR > 1
18591         db_appexit( NULL );
18592 #else
18593         (void) dbopen( NULL, 0, 0, 0, NULL);
18594 #endif
18595
18596 ; return 0; }
18597 EOF
18598 if { (eval echo configure:18599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18599   rm -rf conftest*
18600   ol_cv_db_db_2=yes
18601 else
18602   echo "configure: failed program was:" >&5
18603   cat conftest.$ac_ext >&5
18604   rm -rf conftest*
18605   ol_cv_db_db_2=no
18606 fi
18607 rm -f conftest*
18608
18609         LIBS="$ol_LIBS"
18610
18611 fi
18612
18613 echo "$ac_t""$ol_cv_db_db_2" 1>&6
18614
18615         if test $ol_cv_db_db_2 = yes ; then
18616                 ol_cv_lib_db=-ldb-2
18617         fi
18618 fi
18619
18620 if test $ol_cv_lib_db = no ; then
18621         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
18622 echo "configure:18623: checking for Berkeley DB link (-ldb1)" >&5
18623 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
18624   echo $ac_n "(cached) $ac_c" 1>&6
18625 else
18626   
18627         ol_DB_LIB=-ldb1
18628         ol_LIBS=$LIBS
18629         LIBS="$ol_DB_LIB $LIBS"
18630
18631         cat > conftest.$ac_ext <<EOF
18632 #line 18633 "configure"
18633 #include "confdefs.h"
18634
18635 #ifdef HAVE_DB_185_H
18636 # include <db_185.h>
18637 #else
18638 # include <db.h>
18639 #endif
18640
18641 #ifndef DB_VERSION_MAJOR
18642 # define DB_VERSION_MAJOR 1
18643 #endif
18644
18645 #ifndef NULL
18646 #define NULL ((void*)0)
18647 #endif
18648
18649 int main() {
18650
18651 #if DB_VERSION_MAJOR > 1
18652         {
18653                 char *version;
18654                 int major, minor, patch;
18655
18656                 version = db_version( &major, &minor, &patch );
18657
18658                 if( major != DB_VERSION_MAJOR ||
18659                         minor < DB_VERSION_MINOR )
18660                 {
18661                         printf("Berkeley DB version mismatch\n"
18662                                 "\texpected: %s\n\tgot: %s\n",
18663                                 DB_VERSION_STRING, version);
18664                         return 1;
18665                 }
18666         }
18667 #endif
18668
18669 #if DB_VERSION_MAJOR > 2
18670         db_env_create( NULL, 0 );
18671 #elif DB_VERSION_MAJOR > 1
18672         db_appexit( NULL );
18673 #else
18674         (void) dbopen( NULL, 0, 0, 0, NULL);
18675 #endif
18676
18677 ; return 0; }
18678 EOF
18679 if { (eval echo configure:18680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18680   rm -rf conftest*
18681   ol_cv_db_db1=yes
18682 else
18683   echo "configure: failed program was:" >&5
18684   cat conftest.$ac_ext >&5
18685   rm -rf conftest*
18686   ol_cv_db_db1=no
18687 fi
18688 rm -f conftest*
18689
18690         LIBS="$ol_LIBS"
18691
18692 fi
18693
18694 echo "$ac_t""$ol_cv_db_db1" 1>&6
18695
18696         if test $ol_cv_db_db1 = yes ; then
18697                 ol_cv_lib_db=-ldb1
18698         fi
18699 fi
18700
18701 if test $ol_cv_lib_db = no ; then
18702         echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6
18703 echo "configure:18704: checking for Berkeley DB link (-ldb-1)" >&5
18704 if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then
18705   echo $ac_n "(cached) $ac_c" 1>&6
18706 else
18707   
18708         ol_DB_LIB=-ldb-1
18709         ol_LIBS=$LIBS
18710         LIBS="$ol_DB_LIB $LIBS"
18711
18712         cat > conftest.$ac_ext <<EOF
18713 #line 18714 "configure"
18714 #include "confdefs.h"
18715
18716 #ifdef HAVE_DB_185_H
18717 # include <db_185.h>
18718 #else
18719 # include <db.h>
18720 #endif
18721
18722 #ifndef DB_VERSION_MAJOR
18723 # define DB_VERSION_MAJOR 1
18724 #endif
18725
18726 #ifndef NULL
18727 #define NULL ((void*)0)
18728 #endif
18729
18730 int main() {
18731
18732 #if DB_VERSION_MAJOR > 1
18733         {
18734                 char *version;
18735                 int major, minor, patch;
18736
18737                 version = db_version( &major, &minor, &patch );
18738
18739                 if( major != DB_VERSION_MAJOR ||
18740                         minor < DB_VERSION_MINOR )
18741                 {
18742                         printf("Berkeley DB version mismatch\n"
18743                                 "\texpected: %s\n\tgot: %s\n",
18744                                 DB_VERSION_STRING, version);
18745                         return 1;
18746                 }
18747         }
18748 #endif
18749
18750 #if DB_VERSION_MAJOR > 2
18751         db_env_create( NULL, 0 );
18752 #elif DB_VERSION_MAJOR > 1
18753         db_appexit( NULL );
18754 #else
18755         (void) dbopen( NULL, 0, 0, 0, NULL);
18756 #endif
18757
18758 ; return 0; }
18759 EOF
18760 if { (eval echo configure:18761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18761   rm -rf conftest*
18762   ol_cv_db_db_1=yes
18763 else
18764   echo "configure: failed program was:" >&5
18765   cat conftest.$ac_ext >&5
18766   rm -rf conftest*
18767   ol_cv_db_db_1=no
18768 fi
18769 rm -f conftest*
18770
18771         LIBS="$ol_LIBS"
18772
18773 fi
18774
18775 echo "$ac_t""$ol_cv_db_db_1" 1>&6
18776
18777         if test $ol_cv_db_db_1 = yes ; then
18778                 ol_cv_lib_db=-ldb-1
18779         fi
18780 fi
18781
18782
18783         if test "$ol_cv_lib_db" != no ; then
18784                 ol_cv_berkeley_db=yes
18785                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
18786 echo "configure:18787: checking for Berkeley DB thread support" >&5
18787 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
18788   echo $ac_n "(cached) $ac_c" 1>&6
18789 else
18790   
18791         ol_LIBS="$LIBS"
18792         if test $ol_cv_lib_db != yes ; then
18793                 LIBS="$ol_cv_lib_db"
18794         fi
18795
18796         if test "$cross_compiling" = yes; then
18797   ol_cv_berkeley_db_thread=cross
18798 else
18799   cat > conftest.$ac_ext <<EOF
18800 #line 18801 "configure"
18801 #include "confdefs.h"
18802
18803 #ifdef HAVE_DB_185_H
18804         choke me;
18805 #else
18806 #include <db.h>
18807 #endif
18808 #ifndef NULL
18809 #define NULL ((void *)0)
18810 #endif
18811 main()
18812 {
18813         int rc;
18814         u_int32_t flags = DB_CREATE |
18815 #ifdef DB_PRIVATE
18816                 DB_PRIVATE |
18817 #endif
18818                 DB_THREAD;
18819
18820 #if DB_VERSION_MAJOR > 2
18821         DB_ENV *env = NULL;
18822
18823         rc = db_env_create( &env, 0 );
18824
18825         flags |= DB_INIT_MPOOL;
18826 #ifdef DB_MPOOL_PRIVATE
18827         flags |= DB_MPOOL_PRIVATE;
18828 #endif
18829
18830         if( rc ) {
18831                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
18832                 return rc;
18833         }
18834
18835 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
18836         rc = env->open( env, NULL, flags, 0 );
18837 #else
18838         rc = env->open( env, NULL, NULL, flags, 0 );
18839 #endif
18840
18841         if ( rc == 0 ) {
18842                 rc = env->close( env, 0 );
18843         }
18844
18845         if( rc ) {
18846                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
18847                 return rc;
18848         }
18849
18850 #else
18851         DB_ENV env;
18852         memset( &env, '\0', sizeof(env) );
18853
18854         rc = db_appinit( NULL, NULL, &env, flags );
18855
18856         if( rc == 0 ) {
18857                 db_appexit( &env );
18858         }
18859
18860         unlink("__db_mpool.share");
18861         unlink("__db_lock.share");
18862 #endif
18863
18864         return rc;
18865 }
18866 EOF
18867 if { (eval echo configure:18868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
18868 then
18869   ol_cv_berkeley_db_thread=yes
18870 else
18871   echo "configure: failed program was:" >&5
18872   cat conftest.$ac_ext >&5
18873   rm -fr conftest*
18874   ol_cv_berkeley_db_thread=no
18875 fi
18876 rm -fr conftest*
18877 fi
18878
18879
18880         LIBS="$ol_LIBS"
18881
18882         if test $ol_cv_berkeley_db_thread != no ; then
18883                 cat >> confdefs.h <<\EOF
18884 #define HAVE_BERKELEY_DB_THREAD 1
18885 EOF
18886
18887         fi
18888
18889 fi
18890
18891 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
18892         fi
18893 fi
18894
18895         fi
18896
18897         if test $ol_cv_berkeley_db != no ; then
18898                 cat >> confdefs.h <<\EOF
18899 #define HAVE_BERKELEY_DB 1
18900 EOF
18901
18902
18903                 ol_link_ldbm=berkeley
18904                 ol_with_ldbm_api=berkeley
18905
18906                 if test $ol_with_ldbm_type = hash ; then
18907                         cat >> confdefs.h <<\EOF
18908 #define LDBM_USE_DBHASH 1
18909 EOF
18910
18911                 else
18912                         cat >> confdefs.h <<\EOF
18913 #define LDBM_USE_DBBTREE 1
18914 EOF
18915
18916                 fi
18917
18918                                                 if test $ol_cv_lib_db != yes ; then
18919                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
18920                 fi
18921         fi
18922 fi
18923
18924 if test $ol_enable_bdb = yes -a $ol_link_ldbm != berkeley ; then
18925         { echo "configure: error: BDB: BerkeleyDB not available" 1>&2; exit 1; }
18926 elif test $ol_enable_bdb != no -a $ol_link_ldbm = berkeley ; then
18927         echo $ac_n "checking Berkeley DB version for BDB backend""... $ac_c" 1>&6
18928 echo "configure:18929: checking Berkeley DB version for BDB backend" >&5
18929 if eval "test \"\${ol_cv_bdb_compat+set}\" = set"; then
18930   echo $ac_n "(cached) $ac_c" 1>&6
18931 else
18932   
18933         cat > conftest.$ac_ext <<EOF
18934 #line 18935 "configure"
18935 #include "confdefs.h"
18936
18937 #include <db.h>
18938
18939  /* this check could be improved */
18940 #ifndef DB_VERSION_MAJOR
18941 #       define DB_VERSION_MAJOR 1
18942 #endif
18943
18944 /* require 4.0 or later */
18945 #if DB_VERSION_MAJOR >= 4 
18946         __db_version_compat
18947 #endif
18948         
18949 EOF
18950 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
18951   egrep "__db_version_compat" >/dev/null 2>&1; then
18952   rm -rf conftest*
18953   ol_cv_bdb_compat=yes
18954 else
18955   rm -rf conftest*
18956   ol_cv_bdb_compat=no
18957 fi
18958 rm -f conftest*
18959
18960 fi
18961
18962 echo "$ac_t""$ol_cv_bdb_compat" 1>&6
18963
18964
18965         if test $ol_cv_bdb_compat = yes ; then
18966                 ol_enable_bdb=yes
18967         elif test $ol_enable_bdb = yes ; then
18968                 { echo "configure: error: BDB: BerkeleyDB version incompatible" 1>&2; exit 1; }
18969         else
18970                 ol_enable_bdb=no
18971         fi
18972 fi
18973
18974 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
18975         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
18976         ol_with_ldbm_api=none
18977 fi
18978
18979 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
18980         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
18981 echo "configure:18982: checking for MDBM library" >&5
18982 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
18983   echo $ac_n "(cached) $ac_c" 1>&6
18984 else
18985         ol_LIBS="$LIBS"
18986         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
18987 echo "configure:18988: checking for mdbm_set_chain" >&5
18988 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
18989   echo $ac_n "(cached) $ac_c" 1>&6
18990 else
18991   cat > conftest.$ac_ext <<EOF
18992 #line 18993 "configure"
18993 #include "confdefs.h"
18994 /* System header to define __stub macros and hopefully few prototypes,
18995     which can conflict with char mdbm_set_chain(); below.  */
18996 #include <assert.h>
18997 /* Override any gcc2 internal prototype to avoid an error.  */
18998 /* We use char because int might match the return type of a gcc2
18999     builtin and then its argument prototype would still apply.  */
19000 char mdbm_set_chain();
19001 char (*f)();
19002
19003 int main() {
19004
19005 /* The GNU C library defines this for functions which it implements
19006     to always fail with ENOSYS.  Some functions are actually named
19007     something starting with __ and the normal name is an alias.  */
19008 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
19009 choke me
19010 #else
19011 f = mdbm_set_chain;
19012 #endif
19013
19014 ; return 0; }
19015 EOF
19016 if { (eval echo configure:19017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19017   rm -rf conftest*
19018   eval "ac_cv_func_mdbm_set_chain=yes"
19019 else
19020   echo "configure: failed program was:" >&5
19021   cat conftest.$ac_ext >&5
19022   rm -rf conftest*
19023   eval "ac_cv_func_mdbm_set_chain=no"
19024 fi
19025 rm -f conftest*
19026 fi
19027
19028 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
19029   echo "$ac_t""yes" 1>&6
19030   ol_cv_lib_mdbm=yes
19031 else
19032   echo "$ac_t""no" 1>&6
19033
19034                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
19035 echo "configure:19036: checking for mdbm_set_chain in -lmdbm" >&5
19036 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
19037 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19038   echo $ac_n "(cached) $ac_c" 1>&6
19039 else
19040   ac_save_LIBS="$LIBS"
19041 LIBS="-lmdbm  $LIBS"
19042 cat > conftest.$ac_ext <<EOF
19043 #line 19044 "configure"
19044 #include "confdefs.h"
19045 /* Override any gcc2 internal prototype to avoid an error.  */
19046 /* We use char because int might match the return type of a gcc2
19047     builtin and then its argument prototype would still apply.  */
19048 char mdbm_set_chain();
19049
19050 int main() {
19051 mdbm_set_chain()
19052 ; return 0; }
19053 EOF
19054 if { (eval echo configure:19055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19055   rm -rf conftest*
19056   eval "ac_cv_lib_$ac_lib_var=yes"
19057 else
19058   echo "configure: failed program was:" >&5
19059   cat conftest.$ac_ext >&5
19060   rm -rf conftest*
19061   eval "ac_cv_lib_$ac_lib_var=no"
19062 fi
19063 rm -f conftest*
19064 LIBS="$ac_save_LIBS"
19065
19066 fi
19067 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19068   echo "$ac_t""yes" 1>&6
19069   ol_cv_lib_mdbm=-lmdbm
19070 else
19071   echo "$ac_t""no" 1>&6
19072 ol_cv_lib_mdbm=no
19073 fi
19074
19075         
19076 fi
19077
19078         LIBS="$ol_LIBS"
19079
19080 fi
19081
19082 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
19083
19084
19085  for ac_hdr in mdbm.h
19086 do
19087 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19088 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19089 echo "configure:19090: checking for $ac_hdr" >&5
19090 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19091   echo $ac_n "(cached) $ac_c" 1>&6
19092 else
19093   cat > conftest.$ac_ext <<EOF
19094 #line 19095 "configure"
19095 #include "confdefs.h"
19096 #include <$ac_hdr>
19097 EOF
19098 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19099 { (eval echo configure:19100: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19100 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19101 if test -z "$ac_err"; then
19102   rm -rf conftest*
19103   eval "ac_cv_header_$ac_safe=yes"
19104 else
19105   echo "$ac_err" >&5
19106   echo "configure: failed program was:" >&5
19107   cat conftest.$ac_ext >&5
19108   rm -rf conftest*
19109   eval "ac_cv_header_$ac_safe=no"
19110 fi
19111 rm -f conftest*
19112 fi
19113 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19114   echo "$ac_t""yes" 1>&6
19115     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19116   cat >> confdefs.h <<EOF
19117 #define $ac_tr_hdr 1
19118 EOF
19119  
19120 else
19121   echo "$ac_t""no" 1>&6
19122 fi
19123 done
19124
19125  echo $ac_n "checking for db""... $ac_c" 1>&6
19126 echo "configure:19127: checking for db" >&5
19127 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
19128   echo $ac_n "(cached) $ac_c" 1>&6
19129 else
19130   
19131         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
19132                 ol_cv_mdbm=no
19133         else
19134                 ol_cv_mdbm=yes
19135         fi
19136
19137 fi
19138
19139 echo "$ac_t""$ol_cv_mdbm" 1>&6
19140  if test $ol_cv_mdbm = yes ; then
19141         cat >> confdefs.h <<\EOF
19142 #define HAVE_MDBM 1
19143 EOF
19144
19145  fi
19146
19147
19148         if test $ol_cv_mdbm = yes ; then
19149                 ol_link_ldbm=mdbm
19150                 ol_with_ldbm_api=mdbm
19151                 if test $ol_cv_lib_mdbm != yes ; then
19152                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
19153                 fi
19154         fi
19155 fi
19156
19157 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
19158         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
19159 echo "configure:19160: checking for GDBM library" >&5
19160 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
19161   echo $ac_n "(cached) $ac_c" 1>&6
19162 else
19163         ol_LIBS="$LIBS"
19164         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
19165 echo "configure:19166: checking for gdbm_open" >&5
19166 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
19167   echo $ac_n "(cached) $ac_c" 1>&6
19168 else
19169   cat > conftest.$ac_ext <<EOF
19170 #line 19171 "configure"
19171 #include "confdefs.h"
19172 /* System header to define __stub macros and hopefully few prototypes,
19173     which can conflict with char gdbm_open(); below.  */
19174 #include <assert.h>
19175 /* Override any gcc2 internal prototype to avoid an error.  */
19176 /* We use char because int might match the return type of a gcc2
19177     builtin and then its argument prototype would still apply.  */
19178 char gdbm_open();
19179 char (*f)();
19180
19181 int main() {
19182
19183 /* The GNU C library defines this for functions which it implements
19184     to always fail with ENOSYS.  Some functions are actually named
19185     something starting with __ and the normal name is an alias.  */
19186 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
19187 choke me
19188 #else
19189 f = gdbm_open;
19190 #endif
19191
19192 ; return 0; }
19193 EOF
19194 if { (eval echo configure:19195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19195   rm -rf conftest*
19196   eval "ac_cv_func_gdbm_open=yes"
19197 else
19198   echo "configure: failed program was:" >&5
19199   cat conftest.$ac_ext >&5
19200   rm -rf conftest*
19201   eval "ac_cv_func_gdbm_open=no"
19202 fi
19203 rm -f conftest*
19204 fi
19205
19206 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
19207   echo "$ac_t""yes" 1>&6
19208   ol_cv_lib_gdbm=yes
19209 else
19210   echo "$ac_t""no" 1>&6
19211
19212                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
19213 echo "configure:19214: checking for gdbm_open in -lgdbm" >&5
19214 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
19215 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19216   echo $ac_n "(cached) $ac_c" 1>&6
19217 else
19218   ac_save_LIBS="$LIBS"
19219 LIBS="-lgdbm  $LIBS"
19220 cat > conftest.$ac_ext <<EOF
19221 #line 19222 "configure"
19222 #include "confdefs.h"
19223 /* Override any gcc2 internal prototype to avoid an error.  */
19224 /* We use char because int might match the return type of a gcc2
19225     builtin and then its argument prototype would still apply.  */
19226 char gdbm_open();
19227
19228 int main() {
19229 gdbm_open()
19230 ; return 0; }
19231 EOF
19232 if { (eval echo configure:19233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19233   rm -rf conftest*
19234   eval "ac_cv_lib_$ac_lib_var=yes"
19235 else
19236   echo "configure: failed program was:" >&5
19237   cat conftest.$ac_ext >&5
19238   rm -rf conftest*
19239   eval "ac_cv_lib_$ac_lib_var=no"
19240 fi
19241 rm -f conftest*
19242 LIBS="$ac_save_LIBS"
19243
19244 fi
19245 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19246   echo "$ac_t""yes" 1>&6
19247   ol_cv_lib_gdbm=-lgdbm
19248 else
19249   echo "$ac_t""no" 1>&6
19250 ol_cv_lib_gdbm=no
19251 fi
19252
19253         
19254 fi
19255
19256         LIBS="$ol_LIBS"
19257
19258 fi
19259
19260 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
19261
19262
19263  for ac_hdr in gdbm.h
19264 do
19265 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19266 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19267 echo "configure:19268: checking for $ac_hdr" >&5
19268 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19269   echo $ac_n "(cached) $ac_c" 1>&6
19270 else
19271   cat > conftest.$ac_ext <<EOF
19272 #line 19273 "configure"
19273 #include "confdefs.h"
19274 #include <$ac_hdr>
19275 EOF
19276 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19277 { (eval echo configure:19278: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19278 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19279 if test -z "$ac_err"; then
19280   rm -rf conftest*
19281   eval "ac_cv_header_$ac_safe=yes"
19282 else
19283   echo "$ac_err" >&5
19284   echo "configure: failed program was:" >&5
19285   cat conftest.$ac_ext >&5
19286   rm -rf conftest*
19287   eval "ac_cv_header_$ac_safe=no"
19288 fi
19289 rm -f conftest*
19290 fi
19291 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19292   echo "$ac_t""yes" 1>&6
19293     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19294   cat >> confdefs.h <<EOF
19295 #define $ac_tr_hdr 1
19296 EOF
19297  
19298 else
19299   echo "$ac_t""no" 1>&6
19300 fi
19301 done
19302
19303  echo $ac_n "checking for db""... $ac_c" 1>&6
19304 echo "configure:19305: checking for db" >&5
19305 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
19306   echo $ac_n "(cached) $ac_c" 1>&6
19307 else
19308   
19309         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
19310                 ol_cv_gdbm=no
19311         else
19312                 ol_cv_gdbm=yes
19313         fi
19314
19315 fi
19316
19317 echo "$ac_t""$ol_cv_gdbm" 1>&6
19318  if test $ol_cv_gdbm = yes ; then
19319         cat >> confdefs.h <<\EOF
19320 #define HAVE_GDBM 1
19321 EOF
19322
19323  fi
19324
19325
19326         if test $ol_cv_gdbm = yes ; then
19327                 ol_link_ldbm=gdbm
19328                 ol_with_ldbm_api=gdbm
19329
19330                 if test $ol_cv_lib_gdbm != yes ; then
19331                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
19332                 fi
19333         fi
19334 fi
19335
19336 if test $ol_with_ldbm_api = ndbm ; then
19337         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
19338 echo "configure:19339: checking for NDBM library" >&5
19339 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
19340   echo $ac_n "(cached) $ac_c" 1>&6
19341 else
19342         ol_LIBS="$LIBS"
19343         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
19344 echo "configure:19345: checking for dbm_open" >&5
19345 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
19346   echo $ac_n "(cached) $ac_c" 1>&6
19347 else
19348   cat > conftest.$ac_ext <<EOF
19349 #line 19350 "configure"
19350 #include "confdefs.h"
19351 /* System header to define __stub macros and hopefully few prototypes,
19352     which can conflict with char dbm_open(); below.  */
19353 #include <assert.h>
19354 /* Override any gcc2 internal prototype to avoid an error.  */
19355 /* We use char because int might match the return type of a gcc2
19356     builtin and then its argument prototype would still apply.  */
19357 char dbm_open();
19358 char (*f)();
19359
19360 int main() {
19361
19362 /* The GNU C library defines this for functions which it implements
19363     to always fail with ENOSYS.  Some functions are actually named
19364     something starting with __ and the normal name is an alias.  */
19365 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
19366 choke me
19367 #else
19368 f = dbm_open;
19369 #endif
19370
19371 ; return 0; }
19372 EOF
19373 if { (eval echo configure:19374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19374   rm -rf conftest*
19375   eval "ac_cv_func_dbm_open=yes"
19376 else
19377   echo "configure: failed program was:" >&5
19378   cat conftest.$ac_ext >&5
19379   rm -rf conftest*
19380   eval "ac_cv_func_dbm_open=no"
19381 fi
19382 rm -f conftest*
19383 fi
19384
19385 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
19386   echo "$ac_t""yes" 1>&6
19387   ol_cv_lib_ndbm=yes
19388 else
19389   echo "$ac_t""no" 1>&6
19390
19391                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
19392 echo "configure:19393: checking for dbm_open in -lndbm" >&5
19393 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
19394 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19395   echo $ac_n "(cached) $ac_c" 1>&6
19396 else
19397   ac_save_LIBS="$LIBS"
19398 LIBS="-lndbm  $LIBS"
19399 cat > conftest.$ac_ext <<EOF
19400 #line 19401 "configure"
19401 #include "confdefs.h"
19402 /* Override any gcc2 internal prototype to avoid an error.  */
19403 /* We use char because int might match the return type of a gcc2
19404     builtin and then its argument prototype would still apply.  */
19405 char dbm_open();
19406
19407 int main() {
19408 dbm_open()
19409 ; return 0; }
19410 EOF
19411 if { (eval echo configure:19412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19412   rm -rf conftest*
19413   eval "ac_cv_lib_$ac_lib_var=yes"
19414 else
19415   echo "configure: failed program was:" >&5
19416   cat conftest.$ac_ext >&5
19417   rm -rf conftest*
19418   eval "ac_cv_lib_$ac_lib_var=no"
19419 fi
19420 rm -f conftest*
19421 LIBS="$ac_save_LIBS"
19422
19423 fi
19424 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19425   echo "$ac_t""yes" 1>&6
19426   ol_cv_lib_ndbm=-lndbm
19427 else
19428   echo "$ac_t""no" 1>&6
19429
19430                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
19431 echo "configure:19432: checking for dbm_open in -ldbm" >&5
19432 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
19433 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19434   echo $ac_n "(cached) $ac_c" 1>&6
19435 else
19436   ac_save_LIBS="$LIBS"
19437 LIBS="-ldbm  $LIBS"
19438 cat > conftest.$ac_ext <<EOF
19439 #line 19440 "configure"
19440 #include "confdefs.h"
19441 /* Override any gcc2 internal prototype to avoid an error.  */
19442 /* We use char because int might match the return type of a gcc2
19443     builtin and then its argument prototype would still apply.  */
19444 char dbm_open();
19445
19446 int main() {
19447 dbm_open()
19448 ; return 0; }
19449 EOF
19450 if { (eval echo configure:19451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19451   rm -rf conftest*
19452   eval "ac_cv_lib_$ac_lib_var=yes"
19453 else
19454   echo "configure: failed program was:" >&5
19455   cat conftest.$ac_ext >&5
19456   rm -rf conftest*
19457   eval "ac_cv_lib_$ac_lib_var=no"
19458 fi
19459 rm -f conftest*
19460 LIBS="$ac_save_LIBS"
19461
19462 fi
19463 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19464   echo "$ac_t""yes" 1>&6
19465   ol_cv_lib_ndbm=-ldbm
19466 else
19467   echo "$ac_t""no" 1>&6
19468 ol_cv_lib_ndbm=no
19469 fi
19470                 
19471 fi
19472
19473         
19474 fi
19475
19476         LIBS="$ol_LIBS"
19477
19478 fi
19479
19480 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
19481
19482
19483  for ac_hdr in ndbm.h
19484 do
19485 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19486 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19487 echo "configure:19488: checking for $ac_hdr" >&5
19488 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19489   echo $ac_n "(cached) $ac_c" 1>&6
19490 else
19491   cat > conftest.$ac_ext <<EOF
19492 #line 19493 "configure"
19493 #include "confdefs.h"
19494 #include <$ac_hdr>
19495 EOF
19496 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19497 { (eval echo configure:19498: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19498 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19499 if test -z "$ac_err"; then
19500   rm -rf conftest*
19501   eval "ac_cv_header_$ac_safe=yes"
19502 else
19503   echo "$ac_err" >&5
19504   echo "configure: failed program was:" >&5
19505   cat conftest.$ac_ext >&5
19506   rm -rf conftest*
19507   eval "ac_cv_header_$ac_safe=no"
19508 fi
19509 rm -f conftest*
19510 fi
19511 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19512   echo "$ac_t""yes" 1>&6
19513     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19514   cat >> confdefs.h <<EOF
19515 #define $ac_tr_hdr 1
19516 EOF
19517  
19518 else
19519   echo "$ac_t""no" 1>&6
19520 fi
19521 done
19522
19523  echo $ac_n "checking for db""... $ac_c" 1>&6
19524 echo "configure:19525: checking for db" >&5
19525 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
19526   echo $ac_n "(cached) $ac_c" 1>&6
19527 else
19528   
19529         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
19530                 ol_cv_ndbm=no
19531         else
19532                 ol_cv_ndbm=yes
19533         fi
19534
19535 fi
19536
19537 echo "$ac_t""$ol_cv_ndbm" 1>&6
19538  if test $ol_cv_ndbm = yes ; then
19539         cat >> confdefs.h <<\EOF
19540 #define HAVE_NDBM 1
19541 EOF
19542
19543  fi
19544
19545
19546         if test $ol_cv_ndbm = yes ; then
19547                 ol_link_ldbm=ndbm
19548                 ol_with_ldbm_api=ndbm
19549
19550                 if test $ol_cv_lib_ndbm != yes ; then
19551                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
19552                 fi
19553         fi
19554 fi
19555
19556 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
19557         echo "configure: warning: could not find suitable LDBM backend" 1>&2
19558         if test $ol_enable_ldbm = yes ; then
19559                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
19560         fi
19561
19562         echo "configure: warning: disabling LDBM" 1>&2
19563         ol_enable_ldbm=no
19564 fi
19565
19566 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
19567         BUILD_LIBS_DYNAMIC=shared
19568         cat >> confdefs.h <<\EOF
19569 #define LDAP_LIBS_DYNAMIC 1
19570 EOF
19571
19572 else
19573         BUILD_LIBS_DYNAMIC=static
19574 fi
19575
19576 if test $ol_enable_wrappers != no ; then
19577         for ac_hdr in tcpd.h
19578 do
19579 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19580 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19581 echo "configure:19582: checking for $ac_hdr" >&5
19582 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19583   echo $ac_n "(cached) $ac_c" 1>&6
19584 else
19585   cat > conftest.$ac_ext <<EOF
19586 #line 19587 "configure"
19587 #include "confdefs.h"
19588 #include <$ac_hdr>
19589 EOF
19590 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19591 { (eval echo configure:19592: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19592 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19593 if test -z "$ac_err"; then
19594   rm -rf conftest*
19595   eval "ac_cv_header_$ac_safe=yes"
19596 else
19597   echo "$ac_err" >&5
19598   echo "configure: failed program was:" >&5
19599   cat conftest.$ac_ext >&5
19600   rm -rf conftest*
19601   eval "ac_cv_header_$ac_safe=no"
19602 fi
19603 rm -f conftest*
19604 fi
19605 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19606   echo "$ac_t""yes" 1>&6
19607     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19608   cat >> confdefs.h <<EOF
19609 #define $ac_tr_hdr 1
19610 EOF
19611  
19612                 echo $ac_n "checking for TCP wrappers library""... $ac_c" 1>&6
19613 echo "configure:19614: checking for TCP wrappers library" >&5
19614                 save_LIBS="$LIBS"
19615                 LIBS="$LIBS -lwrap"
19616                 cat > conftest.$ac_ext <<EOF
19617 #line 19618 "configure"
19618 #include "confdefs.h"
19619
19620 #include <tcpd.h>
19621 int allow_severity = 0;
19622 int deny_severity  = 0;
19623
19624 struct request_info *req;
19625                 
19626 int main() {
19627
19628 hosts_access(req)
19629                 
19630 ; return 0; }
19631 EOF
19632 if { (eval echo configure:19633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19633   rm -rf conftest*
19634   echo "$ac_t""-lwrap" 1>&6
19635                 have_wrappers=yes
19636                 LIBS="$save_LIBS"
19637 else
19638   echo "configure: failed program was:" >&5
19639   cat conftest.$ac_ext >&5
19640   rm -rf conftest*
19641   
19642                                 LIBS="$LIBS -lnsl"
19643                 cat > conftest.$ac_ext <<EOF
19644 #line 19645 "configure"
19645 #include "confdefs.h"
19646
19647 #include <tcpd.h>
19648 int allow_severity = 0;
19649 int deny_severity  = 0;
19650
19651 struct request_info *req;
19652                 
19653 int main() {
19654
19655 hosts_access(req)
19656                 
19657 ; return 0; }
19658 EOF
19659 if { (eval echo configure:19660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19660   rm -rf conftest*
19661   echo "$ac_t""-lwrap -lnsl" 1>&6
19662                 have_wrappers=yes
19663                 LIBS="$save_LIBS -lnsl"
19664 else
19665   echo "configure: failed program was:" >&5
19666   cat conftest.$ac_ext >&5
19667   rm -rf conftest*
19668   
19669                 echo "$ac_t""no" 1>&6
19670                 have_wrappers=no
19671                 LIBS=$save_LIBS
19672 fi
19673 rm -f conftest*
19674 fi
19675 rm -f conftest*
19676 else
19677   echo "$ac_t""no" 1>&6
19678 have_wrappers=no
19679 fi
19680 done
19681
19682
19683         if test $have_wrappers = yes ; then
19684                 cat >> confdefs.h <<\EOF
19685 #define HAVE_TCPD 1
19686 EOF
19687
19688                 WRAP_LIBS="-lwrap"
19689         elif test $ol_enable_wrappers = yes ; then
19690                 { echo "configure: error: could not find TCP wrappers, select apppropriate options ore disable" 1>&2; exit 1; }
19691         else
19692                 echo "configure: warning: could not find TCP wrappers, support disabled" 1>&2
19693                 WRAP_LIBS=""
19694         fi
19695 fi
19696
19697 if test $ol_enable_syslog != no ; then
19698         echo $ac_n "checking for openlog""... $ac_c" 1>&6
19699 echo "configure:19700: checking for openlog" >&5
19700 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
19701   echo $ac_n "(cached) $ac_c" 1>&6
19702 else
19703   cat > conftest.$ac_ext <<EOF
19704 #line 19705 "configure"
19705 #include "confdefs.h"
19706 /* System header to define __stub macros and hopefully few prototypes,
19707     which can conflict with char openlog(); below.  */
19708 #include <assert.h>
19709 /* Override any gcc2 internal prototype to avoid an error.  */
19710 /* We use char because int might match the return type of a gcc2
19711     builtin and then its argument prototype would still apply.  */
19712 char openlog();
19713 char (*f)();
19714
19715 int main() {
19716
19717 /* The GNU C library defines this for functions which it implements
19718     to always fail with ENOSYS.  Some functions are actually named
19719     something starting with __ and the normal name is an alias.  */
19720 #if defined (__stub_openlog) || defined (__stub___openlog)
19721 choke me
19722 #else
19723 f = openlog;
19724 #endif
19725
19726 ; return 0; }
19727 EOF
19728 if { (eval echo configure:19729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19729   rm -rf conftest*
19730   eval "ac_cv_func_openlog=yes"
19731 else
19732   echo "configure: failed program was:" >&5
19733   cat conftest.$ac_ext >&5
19734   rm -rf conftest*
19735   eval "ac_cv_func_openlog=no"
19736 fi
19737 rm -f conftest*
19738 fi
19739
19740 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
19741   echo "$ac_t""yes" 1>&6
19742   :
19743 else
19744   echo "$ac_t""no" 1>&6
19745 fi
19746
19747         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
19748                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
19749         fi
19750         ol_enable_syslog=$ac_cv_func_openlog
19751 fi
19752
19753
19754 ol_link_sql=no
19755 if test $ol_enable_sql != no ; then
19756         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
19757 echo "configure:19758: checking for SQLDriverConnect in -liodbc" >&5
19758 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
19759 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19760   echo $ac_n "(cached) $ac_c" 1>&6
19761 else
19762   ac_save_LIBS="$LIBS"
19763 LIBS="-liodbc  $LIBS"
19764 cat > conftest.$ac_ext <<EOF
19765 #line 19766 "configure"
19766 #include "confdefs.h"
19767 /* Override any gcc2 internal prototype to avoid an error.  */
19768 /* We use char because int might match the return type of a gcc2
19769     builtin and then its argument prototype would still apply.  */
19770 char SQLDriverConnect();
19771
19772 int main() {
19773 SQLDriverConnect()
19774 ; return 0; }
19775 EOF
19776 if { (eval echo configure:19777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19777   rm -rf conftest*
19778   eval "ac_cv_lib_$ac_lib_var=yes"
19779 else
19780   echo "configure: failed program was:" >&5
19781   cat conftest.$ac_ext >&5
19782   rm -rf conftest*
19783   eval "ac_cv_lib_$ac_lib_var=no"
19784 fi
19785 rm -f conftest*
19786 LIBS="$ac_save_LIBS"
19787
19788 fi
19789 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19790   echo "$ac_t""yes" 1>&6
19791   have_iodbc=yes
19792 else
19793   echo "$ac_t""no" 1>&6
19794 have_iodbc=no
19795 fi
19796
19797         if test $have_iodbc = yes ; then
19798                 ol_link_sql="-liodbc"
19799         else
19800                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
19801 echo "configure:19802: checking for SQLDriverConnect in -lodbc" >&5
19802 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
19803 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19804   echo $ac_n "(cached) $ac_c" 1>&6
19805 else
19806   ac_save_LIBS="$LIBS"
19807 LIBS="-lodbc  $LIBS"
19808 cat > conftest.$ac_ext <<EOF
19809 #line 19810 "configure"
19810 #include "confdefs.h"
19811 /* Override any gcc2 internal prototype to avoid an error.  */
19812 /* We use char because int might match the return type of a gcc2
19813     builtin and then its argument prototype would still apply.  */
19814 char SQLDriverConnect();
19815
19816 int main() {
19817 SQLDriverConnect()
19818 ; return 0; }
19819 EOF
19820 if { (eval echo configure:19821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19821   rm -rf conftest*
19822   eval "ac_cv_lib_$ac_lib_var=yes"
19823 else
19824   echo "configure: failed program was:" >&5
19825   cat conftest.$ac_ext >&5
19826   rm -rf conftest*
19827   eval "ac_cv_lib_$ac_lib_var=no"
19828 fi
19829 rm -f conftest*
19830 LIBS="$ac_save_LIBS"
19831
19832 fi
19833 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19834   echo "$ac_t""yes" 1>&6
19835   have_odbc=yes
19836 else
19837   echo "$ac_t""no" 1>&6
19838 have_odbc=no
19839 fi
19840
19841                 if test $have_odbc = yes ; then
19842                         ol_link_sql="-lodbc"
19843                 fi
19844         fi
19845
19846         if test $ol_link_sql != no ; then
19847                 SLAPD_SQL_LIBS="$ol_link_sql"
19848
19849         elif test $ol_enable_sql != auto ; then
19850                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
19851         fi
19852 fi
19853
19854 if test $ol_enable_tcl != no ; then
19855         for ac_hdr in tcl.h
19856 do
19857 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19858 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19859 echo "configure:19860: checking for $ac_hdr" >&5
19860 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19861   echo $ac_n "(cached) $ac_c" 1>&6
19862 else
19863   cat > conftest.$ac_ext <<EOF
19864 #line 19865 "configure"
19865 #include "confdefs.h"
19866 #include <$ac_hdr>
19867 EOF
19868 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19869 { (eval echo configure:19870: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19870 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19871 if test -z "$ac_err"; then
19872   rm -rf conftest*
19873   eval "ac_cv_header_$ac_safe=yes"
19874 else
19875   echo "$ac_err" >&5
19876   echo "configure: failed program was:" >&5
19877   cat conftest.$ac_ext >&5
19878   rm -rf conftest*
19879   eval "ac_cv_header_$ac_safe=no"
19880 fi
19881 rm -f conftest*
19882 fi
19883 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19884   echo "$ac_t""yes" 1>&6
19885     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19886   cat >> confdefs.h <<EOF
19887 #define $ac_tr_hdr 1
19888 EOF
19889  
19890 else
19891   echo "$ac_t""no" 1>&6
19892 fi
19893 done
19894
19895
19896         if test $ac_cv_header_tcl_h != yes ; then
19897                 have_tcl=no
19898         else
19899                 for lib in tcl tcl7.6 tcl8.0 tcl8.2 ; do
19900                         echo $ac_n "checking for main in -l$lib""... $ac_c" 1>&6
19901 echo "configure:19902: checking for main in -l$lib" >&5
19902 ac_lib_var=`echo $lib'_'main | sed 'y%./+-:%__p__%'`
19903 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19904   echo $ac_n "(cached) $ac_c" 1>&6
19905 else
19906   ac_save_LIBS="$LIBS"
19907 LIBS="-l$lib  $LIBS"
19908 cat > conftest.$ac_ext <<EOF
19909 #line 19910 "configure"
19910 #include "confdefs.h"
19911
19912 int main() {
19913 main()
19914 ; return 0; }
19915 EOF
19916 if { (eval echo configure:19917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19917   rm -rf conftest*
19918   eval "ac_cv_lib_$ac_lib_var=yes"
19919 else
19920   echo "configure: failed program was:" >&5
19921   cat conftest.$ac_ext >&5
19922   rm -rf conftest*
19923   eval "ac_cv_lib_$ac_lib_var=no"
19924 fi
19925 rm -f conftest*
19926 LIBS="$ac_save_LIBS"
19927
19928 fi
19929 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19930   echo "$ac_t""yes" 1>&6
19931   have_tcl=yes
19932                            if test x"$ol_with_tcl_module" = "xstatic" ; then
19933                                         SLAPD_LIBS="$SLAPD_LIBS -l${lib}"
19934                            else
19935                                         MOD_TCL_LIB="-l${lib}"
19936                            fi;break
19937 else
19938   echo "$ac_t""no" 1>&6
19939 have_tcl=no
19940 fi
19941
19942                 done
19943         fi
19944
19945         if test $have_tcl != yes ; then
19946                 echo "configure: warning: could not find -ltcl" 1>&2
19947                 if test $ol_enable_tcl = yes ; then
19948                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
19949                 fi
19950
19951                 ol_enable_tcl=no
19952         fi
19953 fi
19954
19955 ol_link_termcap=no
19956 for ac_hdr in termcap.h ncurses.h
19957 do
19958 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19959 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19960 echo "configure:19961: checking for $ac_hdr" >&5
19961 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19962   echo $ac_n "(cached) $ac_c" 1>&6
19963 else
19964   cat > conftest.$ac_ext <<EOF
19965 #line 19966 "configure"
19966 #include "confdefs.h"
19967 #include <$ac_hdr>
19968 EOF
19969 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19970 { (eval echo configure:19971: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19971 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19972 if test -z "$ac_err"; then
19973   rm -rf conftest*
19974   eval "ac_cv_header_$ac_safe=yes"
19975 else
19976   echo "$ac_err" >&5
19977   echo "configure: failed program was:" >&5
19978   cat conftest.$ac_ext >&5
19979   rm -rf conftest*
19980   eval "ac_cv_header_$ac_safe=no"
19981 fi
19982 rm -f conftest*
19983 fi
19984 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19985   echo "$ac_t""yes" 1>&6
19986     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19987   cat >> confdefs.h <<EOF
19988 #define $ac_tr_hdr 1
19989 EOF
19990  
19991 else
19992   echo "$ac_t""no" 1>&6
19993 fi
19994 done
19995
19996
19997 if test $ol_link_termcap = no ; then
19998         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
19999 echo "configure:20000: checking for tputs in -ltermcap" >&5
20000 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
20001 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20002   echo $ac_n "(cached) $ac_c" 1>&6
20003 else
20004   ac_save_LIBS="$LIBS"
20005 LIBS="-ltermcap  $LIBS"
20006 cat > conftest.$ac_ext <<EOF
20007 #line 20008 "configure"
20008 #include "confdefs.h"
20009 /* Override any gcc2 internal prototype to avoid an error.  */
20010 /* We use char because int might match the return type of a gcc2
20011     builtin and then its argument prototype would still apply.  */
20012 char tputs();
20013
20014 int main() {
20015 tputs()
20016 ; return 0; }
20017 EOF
20018 if { (eval echo configure:20019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20019   rm -rf conftest*
20020   eval "ac_cv_lib_$ac_lib_var=yes"
20021 else
20022   echo "configure: failed program was:" >&5
20023   cat conftest.$ac_ext >&5
20024   rm -rf conftest*
20025   eval "ac_cv_lib_$ac_lib_var=no"
20026 fi
20027 rm -f conftest*
20028 LIBS="$ac_save_LIBS"
20029
20030 fi
20031 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20032   echo "$ac_t""yes" 1>&6
20033   have_termcap=yes
20034 else
20035   echo "$ac_t""no" 1>&6
20036 have_termcap=no
20037 fi
20038
20039         if test $have_termcap = yes ; then
20040                 cat >> confdefs.h <<\EOF
20041 #define HAVE_TERMCAP 1
20042 EOF
20043
20044                 ol_link_termcap=yes
20045                 TERMCAP_LIBS=-ltermcap
20046         fi
20047 fi
20048
20049 if test $ol_link_termcap = no ; then
20050         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
20051 echo "configure:20052: checking for initscr in -lncurses" >&5
20052 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
20053 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20054   echo $ac_n "(cached) $ac_c" 1>&6
20055 else
20056   ac_save_LIBS="$LIBS"
20057 LIBS="-lncurses  $LIBS"
20058 cat > conftest.$ac_ext <<EOF
20059 #line 20060 "configure"
20060 #include "confdefs.h"
20061 /* Override any gcc2 internal prototype to avoid an error.  */
20062 /* We use char because int might match the return type of a gcc2
20063     builtin and then its argument prototype would still apply.  */
20064 char initscr();
20065
20066 int main() {
20067 initscr()
20068 ; return 0; }
20069 EOF
20070 if { (eval echo configure:20071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20071   rm -rf conftest*
20072   eval "ac_cv_lib_$ac_lib_var=yes"
20073 else
20074   echo "configure: failed program was:" >&5
20075   cat conftest.$ac_ext >&5
20076   rm -rf conftest*
20077   eval "ac_cv_lib_$ac_lib_var=no"
20078 fi
20079 rm -f conftest*
20080 LIBS="$ac_save_LIBS"
20081
20082 fi
20083 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20084   echo "$ac_t""yes" 1>&6
20085   have_ncurses=yes
20086 else
20087   echo "$ac_t""no" 1>&6
20088 have_ncurses=no
20089 fi
20090
20091         if test $have_ncurses = yes ; then
20092                 cat >> confdefs.h <<\EOF
20093 #define HAVE_NCURSES 1
20094 EOF
20095
20096                 ol_link_termcap=yes
20097                 TERMCAP_LIBS=-lncurses
20098         fi
20099 fi
20100
20101 if test $ol_link_termcap = no ; then
20102         cat >> confdefs.h <<\EOF
20103 #define NO_TERMCAP 1
20104 EOF
20105
20106         TERMCAP_LIBS=
20107 fi
20108
20109 ol_link_sasl=no
20110 ol_link_spasswd=no
20111 if test $ol_with_cyrus_sasl != no ; then
20112         for ac_hdr in sasl/sasl.h sasl.h
20113 do
20114 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20115 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20116 echo "configure:20117: checking for $ac_hdr" >&5
20117 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20118   echo $ac_n "(cached) $ac_c" 1>&6
20119 else
20120   cat > conftest.$ac_ext <<EOF
20121 #line 20122 "configure"
20122 #include "confdefs.h"
20123 #include <$ac_hdr>
20124 EOF
20125 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20126 { (eval echo configure:20127: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20127 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20128 if test -z "$ac_err"; then
20129   rm -rf conftest*
20130   eval "ac_cv_header_$ac_safe=yes"
20131 else
20132   echo "$ac_err" >&5
20133   echo "configure: failed program was:" >&5
20134   cat conftest.$ac_ext >&5
20135   rm -rf conftest*
20136   eval "ac_cv_header_$ac_safe=no"
20137 fi
20138 rm -f conftest*
20139 fi
20140 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20141   echo "$ac_t""yes" 1>&6
20142     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20143   cat >> confdefs.h <<EOF
20144 #define $ac_tr_hdr 1
20145 EOF
20146  
20147 else
20148   echo "$ac_t""no" 1>&6
20149 fi
20150 done
20151
20152
20153         if test $ac_cv_header_sasl_sasl_h = yes -o $ac_cv_header_sasl_h = yes; then
20154                 echo $ac_n "checking for sasl_client_init in -lsasl2""... $ac_c" 1>&6
20155 echo "configure:20156: checking for sasl_client_init in -lsasl2" >&5
20156 ac_lib_var=`echo sasl2'_'sasl_client_init | sed 'y%./+-:%__p__%'`
20157 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20158   echo $ac_n "(cached) $ac_c" 1>&6
20159 else
20160   ac_save_LIBS="$LIBS"
20161 LIBS="-lsasl2  $LIBS"
20162 cat > conftest.$ac_ext <<EOF
20163 #line 20164 "configure"
20164 #include "confdefs.h"
20165 /* Override any gcc2 internal prototype to avoid an error.  */
20166 /* We use char because int might match the return type of a gcc2
20167     builtin and then its argument prototype would still apply.  */
20168 char sasl_client_init();
20169
20170 int main() {
20171 sasl_client_init()
20172 ; return 0; }
20173 EOF
20174 if { (eval echo configure:20175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20175   rm -rf conftest*
20176   eval "ac_cv_lib_$ac_lib_var=yes"
20177 else
20178   echo "configure: failed program was:" >&5
20179   cat conftest.$ac_ext >&5
20180   rm -rf conftest*
20181   eval "ac_cv_lib_$ac_lib_var=no"
20182 fi
20183 rm -f conftest*
20184 LIBS="$ac_save_LIBS"
20185
20186 fi
20187 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20188   echo "$ac_t""yes" 1>&6
20189   ol_link_sasl="-lsasl2"
20190 else
20191   echo "$ac_t""no" 1>&6
20192 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
20193 echo "configure:20194: checking for sasl_client_init in -lsasl" >&5
20194 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
20195 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20196   echo $ac_n "(cached) $ac_c" 1>&6
20197 else
20198   ac_save_LIBS="$LIBS"
20199 LIBS="-lsasl  $LIBS"
20200 cat > conftest.$ac_ext <<EOF
20201 #line 20202 "configure"
20202 #include "confdefs.h"
20203 /* Override any gcc2 internal prototype to avoid an error.  */
20204 /* We use char because int might match the return type of a gcc2
20205     builtin and then its argument prototype would still apply.  */
20206 char sasl_client_init();
20207
20208 int main() {
20209 sasl_client_init()
20210 ; return 0; }
20211 EOF
20212 if { (eval echo configure:20213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20213   rm -rf conftest*
20214   eval "ac_cv_lib_$ac_lib_var=yes"
20215 else
20216   echo "configure: failed program was:" >&5
20217   cat conftest.$ac_ext >&5
20218   rm -rf conftest*
20219   eval "ac_cv_lib_$ac_lib_var=no"
20220 fi
20221 rm -f conftest*
20222 LIBS="$ac_save_LIBS"
20223
20224 fi
20225 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20226   echo "$ac_t""yes" 1>&6
20227   ol_link_sasl="-lsasl"
20228 else
20229   echo "$ac_t""no" 1>&6
20230 fi
20231
20232 fi
20233
20234         fi
20235
20236         if test $ol_link_sasl = no ; then
20237                 if test $ol_with_cyrus_sasl != auto ; then
20238                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
20239                 else
20240                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
20241                         echo "configure: warning: SASL authentication not supported!" 1>&2
20242                         if test $ol_link_tls = no ; then
20243                                 echo "configure: warning: Strong authentication not supported!" 1>&2
20244                         fi
20245                 fi
20246         else
20247                 echo $ac_n "checking Cyrus SASL library version""... $ac_c" 1>&6
20248 echo "configure:20249: checking Cyrus SASL library version" >&5
20249 if eval "test \"\${ol_cv_sasl_compat+set}\" = set"; then
20250   echo $ac_n "(cached) $ac_c" 1>&6
20251 else
20252   
20253         cat > conftest.$ac_ext <<EOF
20254 #line 20255 "configure"
20255 #include "confdefs.h"
20256
20257 #ifdef HAVE_SASL_SASL_H
20258 #include <sasl/sasl.h>
20259 #else
20260 #include <sasl.h>
20261 #endif
20262
20263 /* require 2.1.3 or later */
20264 #if SASL_VERSION_MAJOR == 1  && SASL_VERSION_MINOR >= 5
20265         char *__sasl_compat = "1.5.x okay";
20266 #elif SASL_VERSION_MAJOR == 2  && SASL_VERSION_MINOR > 1
20267         __sasl_compat "2.2+ or better okay (we guess)";
20268 #elif SASL_VERSION_MAJOR == 2  && SASL_VERSION_MINOR == 1 \
20269         && SASL_VERSION_STEP >=3
20270         __sasl_compat = "2.1.3+ or better okay";
20271 #endif
20272         
20273 EOF
20274 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20275   egrep "__sasl_compat" >/dev/null 2>&1; then
20276   rm -rf conftest*
20277   ol_cv_sasl_compat=yes
20278 else
20279   rm -rf conftest*
20280   ol_cv_sasl_compat=no
20281 fi
20282 rm -f conftest*
20283
20284 fi
20285
20286 echo "$ac_t""$ol_cv_sasl_compat" 1>&6
20287
20288                 if test $ol_cv_sasl_compat = no ; then
20289                         ol_link_sasl=no
20290                         { echo "configure: error: Cyrus SASL library located but incompatible" 1>&2; exit 1; }
20291                 fi
20292
20293                 cat >> confdefs.h <<\EOF
20294 #define HAVE_CYRUS_SASL 1
20295 EOF
20296
20297                 SASL_LIBS="$ol_link_sasl"
20298                 if test $ol_enable_spasswd != no ; then
20299                         ol_link_spasswd=yes
20300                 fi
20301         fi
20302
20303 else
20304         echo "configure: warning: SASL authentication not supported!" 1>&2
20305         if test $ol_link_tls = no ; then
20306                 echo "configure: warning: Strong authentication not supported!" 1>&2
20307         fi
20308 fi
20309
20310 if test $cross_compiling != yes -a "$ac_cv_mingw32" != yes ; then
20311         dev=no
20312         if test -r /dev/urandom ; then
20313                 dev="/dev/urandom";
20314         elif test -r /idev/urandom ; then
20315                 dev="/idev/urandom";
20316         elif test -r /dev/srandom ; then
20317                 dev="/dev/srandom";
20318         elif test -r /dev/random ; then
20319                 dev="/dev/random";
20320         elif test -r /idev/random ; then
20321                 dev="/idev/random";
20322         fi
20323
20324         if test $dev != no ; then
20325                 cat >> confdefs.h <<EOF
20326 #define URANDOM_DEVICE "$dev"
20327 EOF
20328
20329         fi
20330 fi
20331
20332 ol_link_fetch=no
20333 if test $ol_with_fetch != no ; then
20334         ol_LIBS=$LIBS
20335 LIBS="-lfetch -lcom_err $LIBS"
20336 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
20337 echo "configure:20338: checking fetch(3) library" >&5
20338 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
20339   echo $ac_n "(cached) $ac_c" 1>&6
20340 else
20341   
20342         cat > conftest.$ac_ext <<EOF
20343 #line 20344 "configure"
20344 #include "confdefs.h"
20345
20346 #include <sys/param.h>
20347 #include <stdio.h>
20348 #include <fetch.h>
20349 int main() {
20350 struct url *u = fetchParseURL("file:///"); 
20351 ; return 0; }
20352 EOF
20353 if { (eval echo configure:20354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20354   rm -rf conftest*
20355   ol_cv_lib_fetch=yes
20356 else
20357   echo "configure: failed program was:" >&5
20358   cat conftest.$ac_ext >&5
20359   rm -rf conftest*
20360   ol_cv_lib_fetch=no
20361 fi
20362 rm -f conftest*
20363 fi
20364
20365 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
20366 LIBS=$ol_LIBS
20367 if test $ol_cv_lib_fetch != no ; then
20368         ol_link_fetch="-lfetch -lcom_err"
20369         cat >> confdefs.h <<\EOF
20370 #define HAVE_FETCH 1
20371 EOF
20372
20373 fi
20374
20375
20376         if test $ol_cv_lib_fetch != no ; then
20377                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
20378                 ol_link_fetch=freebsd
20379
20380         elif test $ol_with_fetch != auto ; then
20381                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
20382         fi 
20383 fi
20384
20385 ol_link_readline=no
20386 if test $ol_with_readline != no ; then
20387         for ac_hdr in readline/readline.h readline/history.h
20388 do
20389 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20390 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20391 echo "configure:20392: checking for $ac_hdr" >&5
20392 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20393   echo $ac_n "(cached) $ac_c" 1>&6
20394 else
20395   cat > conftest.$ac_ext <<EOF
20396 #line 20397 "configure"
20397 #include "confdefs.h"
20398 #include <$ac_hdr>
20399 EOF
20400 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20401 { (eval echo configure:20402: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20402 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20403 if test -z "$ac_err"; then
20404   rm -rf conftest*
20405   eval "ac_cv_header_$ac_safe=yes"
20406 else
20407   echo "$ac_err" >&5
20408   echo "configure: failed program was:" >&5
20409   cat conftest.$ac_ext >&5
20410   rm -rf conftest*
20411   eval "ac_cv_header_$ac_safe=no"
20412 fi
20413 rm -f conftest*
20414 fi
20415 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20416   echo "$ac_t""yes" 1>&6
20417     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20418   cat >> confdefs.h <<EOF
20419 #define $ac_tr_hdr 1
20420 EOF
20421  
20422 else
20423   echo "$ac_t""no" 1>&6
20424 fi
20425 done
20426
20427
20428         if test $ac_cv_header_readline_readline_h = yes ; then
20429                 save_LIBS="$LIBS"
20430                 LIBS="$TERMCAP_LIBS $LIBS"
20431                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
20432 echo "configure:20433: checking for readline in -lreadline" >&5
20433 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
20434 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20435   echo $ac_n "(cached) $ac_c" 1>&6
20436 else
20437   ac_save_LIBS="$LIBS"
20438 LIBS="-lreadline  $LIBS"
20439 cat > conftest.$ac_ext <<EOF
20440 #line 20441 "configure"
20441 #include "confdefs.h"
20442 /* Override any gcc2 internal prototype to avoid an error.  */
20443 /* We use char because int might match the return type of a gcc2
20444     builtin and then its argument prototype would still apply.  */
20445 char readline();
20446
20447 int main() {
20448 readline()
20449 ; return 0; }
20450 EOF
20451 if { (eval echo configure:20452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20452   rm -rf conftest*
20453   eval "ac_cv_lib_$ac_lib_var=yes"
20454 else
20455   echo "configure: failed program was:" >&5
20456   cat conftest.$ac_ext >&5
20457   rm -rf conftest*
20458   eval "ac_cv_lib_$ac_lib_var=no"
20459 fi
20460 rm -f conftest*
20461 LIBS="$ac_save_LIBS"
20462
20463 fi
20464 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20465   echo "$ac_t""yes" 1>&6
20466   have_readline=yes
20467 else
20468   echo "$ac_t""no" 1>&6
20469 have_readline=no
20470 fi
20471
20472                 LIBS="$save_LIBS"
20473                         
20474                 if test $have_readline = yes ; then
20475                         ol_with_readline=found
20476                         ol_link_readline=yes
20477
20478                         READLINE_LIBS="-lreadline"
20479                 fi
20480         fi
20481 fi
20482
20483 if test $ol_link_readline = yes ; then
20484         cat >> confdefs.h <<\EOF
20485 #define HAVE_READLINE 1
20486 EOF
20487
20488 fi
20489
20490
20491 if test $ol_enable_crypt != no ; then
20492         echo $ac_n "checking for crypt""... $ac_c" 1>&6
20493 echo "configure:20494: checking for crypt" >&5
20494 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
20495   echo $ac_n "(cached) $ac_c" 1>&6
20496 else
20497   cat > conftest.$ac_ext <<EOF
20498 #line 20499 "configure"
20499 #include "confdefs.h"
20500 /* System header to define __stub macros and hopefully few prototypes,
20501     which can conflict with char crypt(); below.  */
20502 #include <assert.h>
20503 /* Override any gcc2 internal prototype to avoid an error.  */
20504 /* We use char because int might match the return type of a gcc2
20505     builtin and then its argument prototype would still apply.  */
20506 char crypt();
20507 char (*f)();
20508
20509 int main() {
20510
20511 /* The GNU C library defines this for functions which it implements
20512     to always fail with ENOSYS.  Some functions are actually named
20513     something starting with __ and the normal name is an alias.  */
20514 #if defined (__stub_crypt) || defined (__stub___crypt)
20515 choke me
20516 #else
20517 f = crypt;
20518 #endif
20519
20520 ; return 0; }
20521 EOF
20522 if { (eval echo configure:20523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20523   rm -rf conftest*
20524   eval "ac_cv_func_crypt=yes"
20525 else
20526   echo "configure: failed program was:" >&5
20527   cat conftest.$ac_ext >&5
20528   rm -rf conftest*
20529   eval "ac_cv_func_crypt=no"
20530 fi
20531 rm -f conftest*
20532 fi
20533
20534 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
20535   echo "$ac_t""yes" 1>&6
20536   have_crypt=yes
20537 else
20538   echo "$ac_t""no" 1>&6
20539
20540                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
20541 echo "configure:20542: checking for crypt in -lcrypt" >&5
20542 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
20543 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20544   echo $ac_n "(cached) $ac_c" 1>&6
20545 else
20546   ac_save_LIBS="$LIBS"
20547 LIBS="-lcrypt  $LIBS"
20548 cat > conftest.$ac_ext <<EOF
20549 #line 20550 "configure"
20550 #include "confdefs.h"
20551 /* Override any gcc2 internal prototype to avoid an error.  */
20552 /* We use char because int might match the return type of a gcc2
20553     builtin and then its argument prototype would still apply.  */
20554 char crypt();
20555
20556 int main() {
20557 crypt()
20558 ; return 0; }
20559 EOF
20560 if { (eval echo configure:20561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20561   rm -rf conftest*
20562   eval "ac_cv_lib_$ac_lib_var=yes"
20563 else
20564   echo "configure: failed program was:" >&5
20565   cat conftest.$ac_ext >&5
20566   rm -rf conftest*
20567   eval "ac_cv_lib_$ac_lib_var=no"
20568 fi
20569 rm -f conftest*
20570 LIBS="$ac_save_LIBS"
20571
20572 fi
20573 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20574   echo "$ac_t""yes" 1>&6
20575   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
20576                         have_crypt=yes
20577 else
20578   echo "$ac_t""no" 1>&6
20579 have_crypt=no
20580 fi
20581
20582 fi
20583
20584
20585         if test $have_crypt = yes ; then
20586                 cat >> confdefs.h <<\EOF
20587 #define HAVE_CRYPT 1
20588 EOF
20589
20590         else
20591                 echo "configure: warning: could not find crypt" 1>&2
20592                 if test $ol_enable_crypt = yes ; then
20593                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
20594                 fi
20595
20596                 echo "configure: warning: disabling crypt support" 1>&2
20597                 ol_enable_crypt=no
20598         fi
20599 fi
20600
20601 if test $ol_enable_proctitle != no ; then
20602         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
20603 echo "configure:20604: checking for setproctitle" >&5
20604 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
20605   echo $ac_n "(cached) $ac_c" 1>&6
20606 else
20607   cat > conftest.$ac_ext <<EOF
20608 #line 20609 "configure"
20609 #include "confdefs.h"
20610 /* System header to define __stub macros and hopefully few prototypes,
20611     which can conflict with char setproctitle(); below.  */
20612 #include <assert.h>
20613 /* Override any gcc2 internal prototype to avoid an error.  */
20614 /* We use char because int might match the return type of a gcc2
20615     builtin and then its argument prototype would still apply.  */
20616 char setproctitle();
20617 char (*f)();
20618
20619 int main() {
20620
20621 /* The GNU C library defines this for functions which it implements
20622     to always fail with ENOSYS.  Some functions are actually named
20623     something starting with __ and the normal name is an alias.  */
20624 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
20625 choke me
20626 #else
20627 f = setproctitle;
20628 #endif
20629
20630 ; return 0; }
20631 EOF
20632 if { (eval echo configure:20633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20633   rm -rf conftest*
20634   eval "ac_cv_func_setproctitle=yes"
20635 else
20636   echo "configure: failed program was:" >&5
20637   cat conftest.$ac_ext >&5
20638   rm -rf conftest*
20639   eval "ac_cv_func_setproctitle=no"
20640 fi
20641 rm -f conftest*
20642 fi
20643
20644 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
20645   echo "$ac_t""yes" 1>&6
20646   have_setproctitle=yes
20647 else
20648   echo "$ac_t""no" 1>&6
20649
20650                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
20651 echo "configure:20652: checking for setproctitle in -lutil" >&5
20652 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
20653 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20654   echo $ac_n "(cached) $ac_c" 1>&6
20655 else
20656   ac_save_LIBS="$LIBS"
20657 LIBS="-lutil  $LIBS"
20658 cat > conftest.$ac_ext <<EOF
20659 #line 20660 "configure"
20660 #include "confdefs.h"
20661 /* Override any gcc2 internal prototype to avoid an error.  */
20662 /* We use char because int might match the return type of a gcc2
20663     builtin and then its argument prototype would still apply.  */
20664 char setproctitle();
20665
20666 int main() {
20667 setproctitle()
20668 ; return 0; }
20669 EOF
20670 if { (eval echo configure:20671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20671   rm -rf conftest*
20672   eval "ac_cv_lib_$ac_lib_var=yes"
20673 else
20674   echo "configure: failed program was:" >&5
20675   cat conftest.$ac_ext >&5
20676   rm -rf conftest*
20677   eval "ac_cv_lib_$ac_lib_var=no"
20678 fi
20679 rm -f conftest*
20680 LIBS="$ac_save_LIBS"
20681
20682 fi
20683 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20684   echo "$ac_t""yes" 1>&6
20685   have_setproctitle=yes
20686                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
20687 else
20688   echo "$ac_t""no" 1>&6
20689 have_setproctitle=no
20690                         LIBOBJS="$LIBOBJS setproctitle.o"
20691                         LIBSRCS="$LIBSRCS setproctitle.c"
20692 fi
20693
20694 fi
20695
20696
20697         if test $have_setproctitle = yes ; then
20698                 cat >> confdefs.h <<\EOF
20699 #define HAVE_SETPROCTITLE 1
20700 EOF
20701
20702         fi
20703 fi
20704
20705 if test $ol_enable_slp != no ; then
20706         for ac_hdr in slp.h 
20707 do
20708 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20709 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20710 echo "configure:20711: checking for $ac_hdr" >&5
20711 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20712   echo $ac_n "(cached) $ac_c" 1>&6
20713 else
20714   cat > conftest.$ac_ext <<EOF
20715 #line 20716 "configure"
20716 #include "confdefs.h"
20717 #include <$ac_hdr>
20718 EOF
20719 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20720 { (eval echo configure:20721: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20721 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20722 if test -z "$ac_err"; then
20723   rm -rf conftest*
20724   eval "ac_cv_header_$ac_safe=yes"
20725 else
20726   echo "$ac_err" >&5
20727   echo "configure: failed program was:" >&5
20728   cat conftest.$ac_ext >&5
20729   rm -rf conftest*
20730   eval "ac_cv_header_$ac_safe=no"
20731 fi
20732 rm -f conftest*
20733 fi
20734 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20735   echo "$ac_t""yes" 1>&6
20736     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20737   cat >> confdefs.h <<EOF
20738 #define $ac_tr_hdr 1
20739 EOF
20740  
20741 else
20742   echo "$ac_t""no" 1>&6
20743 fi
20744 done
20745
20746
20747         if test $ac_cv_header_slp_h = yes ; then
20748                 echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
20749 echo "configure:20750: checking for SLPOpen in -lslp" >&5
20750 ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-:%__p__%'`
20751 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20752   echo $ac_n "(cached) $ac_c" 1>&6
20753 else
20754   ac_save_LIBS="$LIBS"
20755 LIBS="-lslp  $LIBS"
20756 cat > conftest.$ac_ext <<EOF
20757 #line 20758 "configure"
20758 #include "confdefs.h"
20759 /* Override any gcc2 internal prototype to avoid an error.  */
20760 /* We use char because int might match the return type of a gcc2
20761     builtin and then its argument prototype would still apply.  */
20762 char SLPOpen();
20763
20764 int main() {
20765 SLPOpen()
20766 ; return 0; }
20767 EOF
20768 if { (eval echo configure:20769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20769   rm -rf conftest*
20770   eval "ac_cv_lib_$ac_lib_var=yes"
20771 else
20772   echo "configure: failed program was:" >&5
20773   cat conftest.$ac_ext >&5
20774   rm -rf conftest*
20775   eval "ac_cv_lib_$ac_lib_var=no"
20776 fi
20777 rm -f conftest*
20778 LIBS="$ac_save_LIBS"
20779
20780 fi
20781 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20782   echo "$ac_t""yes" 1>&6
20783   have_slp=yes
20784 else
20785   echo "$ac_t""no" 1>&6
20786 have_slp=no
20787 fi
20788
20789                 if test $have_slp = yes ; then
20790                         cat >> confdefs.h <<\EOF
20791 #define HAVE_SLP 1
20792 EOF
20793
20794                         SLAPD_SLP_LIBS=-lslp
20795                 fi
20796
20797         elif test $ol_enable_slp = yes ; then
20798                 { echo "configure: error: SLP not found" 1>&2; exit 1; }
20799         fi
20800 fi
20801
20802 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
20803 echo "configure:20804: checking for ANSI C header files" >&5
20804 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
20805   echo $ac_n "(cached) $ac_c" 1>&6
20806 else
20807   cat > conftest.$ac_ext <<EOF
20808 #line 20809 "configure"
20809 #include "confdefs.h"
20810 #include <stdlib.h>
20811 #include <stdarg.h>
20812 #include <string.h>
20813 #include <float.h>
20814 EOF
20815 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20816 { (eval echo configure:20817: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20817 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20818 if test -z "$ac_err"; then
20819   rm -rf conftest*
20820   ac_cv_header_stdc=yes
20821 else
20822   echo "$ac_err" >&5
20823   echo "configure: failed program was:" >&5
20824   cat conftest.$ac_ext >&5
20825   rm -rf conftest*
20826   ac_cv_header_stdc=no
20827 fi
20828 rm -f conftest*
20829
20830 if test $ac_cv_header_stdc = yes; then
20831   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
20832 cat > conftest.$ac_ext <<EOF
20833 #line 20834 "configure"
20834 #include "confdefs.h"
20835 #include <string.h>
20836 EOF
20837 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20838   egrep "memchr" >/dev/null 2>&1; then
20839   :
20840 else
20841   rm -rf conftest*
20842   ac_cv_header_stdc=no
20843 fi
20844 rm -f conftest*
20845
20846 fi
20847
20848 if test $ac_cv_header_stdc = yes; then
20849   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
20850 cat > conftest.$ac_ext <<EOF
20851 #line 20852 "configure"
20852 #include "confdefs.h"
20853 #include <stdlib.h>
20854 EOF
20855 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20856   egrep "free" >/dev/null 2>&1; then
20857   :
20858 else
20859   rm -rf conftest*
20860   ac_cv_header_stdc=no
20861 fi
20862 rm -f conftest*
20863
20864 fi
20865
20866 if test $ac_cv_header_stdc = yes; then
20867   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
20868 if test "$cross_compiling" = yes; then
20869   :
20870 else
20871   cat > conftest.$ac_ext <<EOF
20872 #line 20873 "configure"
20873 #include "confdefs.h"
20874 #include <ctype.h>
20875 #if ((' ' & 0x0FF) == 0x020)
20876 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
20877 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
20878 #else
20879 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
20880  || ('j' <= (c) && (c) <= 'r') \
20881  || ('s' <= (c) && (c) <= 'z'))
20882 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
20883 #endif
20884 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
20885 int main () { int i; for (i = 0; i < 256; i++)
20886 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
20887 exit (0); }
20888
20889 EOF
20890 if { (eval echo configure:20891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
20891 then
20892   :
20893 else
20894   echo "configure: failed program was:" >&5
20895   cat conftest.$ac_ext >&5
20896   rm -fr conftest*
20897   ac_cv_header_stdc=no
20898 fi
20899 rm -fr conftest*
20900 fi
20901
20902 fi
20903 fi
20904
20905 echo "$ac_t""$ac_cv_header_stdc" 1>&6
20906 if test $ac_cv_header_stdc = yes; then
20907   cat >> confdefs.h <<\EOF
20908 #define STDC_HEADERS 1
20909 EOF
20910
20911 fi
20912
20913 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
20914 echo "configure:20915: checking for mode_t" >&5
20915 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
20916   echo $ac_n "(cached) $ac_c" 1>&6
20917 else
20918   cat > conftest.$ac_ext <<EOF
20919 #line 20920 "configure"
20920 #include "confdefs.h"
20921 #include <sys/types.h>
20922 #if STDC_HEADERS
20923 #include <stdlib.h>
20924 #include <stddef.h>
20925 #endif
20926
20927 EOF
20928 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20929   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
20930   rm -rf conftest*
20931   eval "ac_cv_type_mode_t=yes"
20932 else
20933   rm -rf conftest*
20934   eval "ac_cv_type_mode_t=no"
20935 fi
20936 rm -f conftest*
20937
20938 fi
20939 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
20940   echo "$ac_t""yes" 1>&6
20941 else
20942   echo "$ac_t""no" 1>&6
20943   cat >> confdefs.h <<EOF
20944 #define mode_t int
20945 EOF
20946
20947 fi
20948
20949 echo $ac_n "checking for off_t""... $ac_c" 1>&6
20950 echo "configure:20951: checking for off_t" >&5
20951 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
20952   echo $ac_n "(cached) $ac_c" 1>&6
20953 else
20954   cat > conftest.$ac_ext <<EOF
20955 #line 20956 "configure"
20956 #include "confdefs.h"
20957 #include <sys/types.h>
20958 #if STDC_HEADERS
20959 #include <stdlib.h>
20960 #include <stddef.h>
20961 #endif
20962
20963 EOF
20964 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20965   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
20966   rm -rf conftest*
20967   eval "ac_cv_type_off_t=yes"
20968 else
20969   rm -rf conftest*
20970   eval "ac_cv_type_off_t=no"
20971 fi
20972 rm -f conftest*
20973
20974 fi
20975 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
20976   echo "$ac_t""yes" 1>&6
20977 else
20978   echo "$ac_t""no" 1>&6
20979   cat >> confdefs.h <<EOF
20980 #define off_t long
20981 EOF
20982
20983 fi
20984
20985 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
20986 echo "configure:20987: checking for pid_t" >&5
20987 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
20988   echo $ac_n "(cached) $ac_c" 1>&6
20989 else
20990   cat > conftest.$ac_ext <<EOF
20991 #line 20992 "configure"
20992 #include "confdefs.h"
20993 #include <sys/types.h>
20994 #if STDC_HEADERS
20995 #include <stdlib.h>
20996 #include <stddef.h>
20997 #endif
20998
20999 EOF
21000 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21001   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21002   rm -rf conftest*
21003   eval "ac_cv_type_pid_t=yes"
21004 else
21005   rm -rf conftest*
21006   eval "ac_cv_type_pid_t=no"
21007 fi
21008 rm -f conftest*
21009
21010 fi
21011 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
21012   echo "$ac_t""yes" 1>&6
21013 else
21014   echo "$ac_t""no" 1>&6
21015   cat >> confdefs.h <<EOF
21016 #define pid_t int
21017 EOF
21018
21019 fi
21020
21021 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
21022 echo "configure:21023: checking for ptrdiff_t" >&5
21023 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
21024   echo $ac_n "(cached) $ac_c" 1>&6
21025 else
21026   cat > conftest.$ac_ext <<EOF
21027 #line 21028 "configure"
21028 #include "confdefs.h"
21029 #include <stddef.h>
21030 int main() {
21031 ptrdiff_t p
21032 ; return 0; }
21033 EOF
21034 if { (eval echo configure:21035: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21035   rm -rf conftest*
21036   am_cv_type_ptrdiff_t=yes
21037 else
21038   echo "configure: failed program was:" >&5
21039   cat conftest.$ac_ext >&5
21040   rm -rf conftest*
21041   am_cv_type_ptrdiff_t=no
21042 fi
21043 rm -f conftest*
21044 fi
21045
21046 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
21047    if test $am_cv_type_ptrdiff_t = yes; then
21048      cat >> confdefs.h <<\EOF
21049 #define HAVE_PTRDIFF_T 1
21050 EOF
21051
21052    fi
21053
21054 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
21055 echo "configure:21056: checking return type of signal handlers" >&5
21056 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
21057   echo $ac_n "(cached) $ac_c" 1>&6
21058 else
21059   cat > conftest.$ac_ext <<EOF
21060 #line 21061 "configure"
21061 #include "confdefs.h"
21062 #include <sys/types.h>
21063 #include <signal.h>
21064 #ifdef signal
21065 #undef signal
21066 #endif
21067 #ifdef __cplusplus
21068 extern "C" void (*signal (int, void (*)(int)))(int);
21069 #else
21070 void (*signal ()) ();
21071 #endif
21072
21073 int main() {
21074 int i;
21075 ; return 0; }
21076 EOF
21077 if { (eval echo configure:21078: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21078   rm -rf conftest*
21079   ac_cv_type_signal=void
21080 else
21081   echo "configure: failed program was:" >&5
21082   cat conftest.$ac_ext >&5
21083   rm -rf conftest*
21084   ac_cv_type_signal=int
21085 fi
21086 rm -f conftest*
21087 fi
21088
21089 echo "$ac_t""$ac_cv_type_signal" 1>&6
21090 cat >> confdefs.h <<EOF
21091 #define RETSIGTYPE $ac_cv_type_signal
21092 EOF
21093
21094
21095 echo $ac_n "checking for size_t""... $ac_c" 1>&6
21096 echo "configure:21097: checking for size_t" >&5
21097 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
21098   echo $ac_n "(cached) $ac_c" 1>&6
21099 else
21100   cat > conftest.$ac_ext <<EOF
21101 #line 21102 "configure"
21102 #include "confdefs.h"
21103 #include <sys/types.h>
21104 #if STDC_HEADERS
21105 #include <stdlib.h>
21106 #include <stddef.h>
21107 #endif
21108
21109 EOF
21110 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21111   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21112   rm -rf conftest*
21113   eval "ac_cv_type_size_t=yes"
21114 else
21115   rm -rf conftest*
21116   eval "ac_cv_type_size_t=no"
21117 fi
21118 rm -f conftest*
21119
21120 fi
21121 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
21122   echo "$ac_t""yes" 1>&6
21123 else
21124   echo "$ac_t""no" 1>&6
21125   cat >> confdefs.h <<EOF
21126 #define size_t unsigned
21127 EOF
21128
21129 fi
21130
21131
21132 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
21133 echo "configure:21134: checking for ssize_t" >&5
21134 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
21135   echo $ac_n "(cached) $ac_c" 1>&6
21136 else
21137   cat > conftest.$ac_ext <<EOF
21138 #line 21139 "configure"
21139 #include "confdefs.h"
21140 #include <sys/types.h>
21141 #if STDC_HEADERS
21142 #include <stdlib.h>
21143 #include <stddef.h>
21144 #endif
21145
21146 EOF
21147 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21148   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21149   rm -rf conftest*
21150   eval "ac_cv_type_ssize_t=yes"
21151 else
21152   rm -rf conftest*
21153   eval "ac_cv_type_ssize_t=no"
21154 fi
21155 rm -f conftest*
21156
21157 fi
21158 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
21159   echo "$ac_t""yes" 1>&6
21160 else
21161   echo "$ac_t""no" 1>&6
21162   cat >> confdefs.h <<EOF
21163 #define ssize_t signed int
21164 EOF
21165
21166 fi
21167
21168 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
21169 echo "configure:21170: checking for caddr_t" >&5
21170 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
21171   echo $ac_n "(cached) $ac_c" 1>&6
21172 else
21173   cat > conftest.$ac_ext <<EOF
21174 #line 21175 "configure"
21175 #include "confdefs.h"
21176 #include <sys/types.h>
21177 #if STDC_HEADERS
21178 #include <stdlib.h>
21179 #include <stddef.h>
21180 #endif
21181
21182 EOF
21183 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21184   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
21185   rm -rf conftest*
21186   eval "ac_cv_type_caddr_t=yes"
21187 else
21188   rm -rf conftest*
21189   eval "ac_cv_type_caddr_t=no"
21190 fi
21191 rm -f conftest*
21192
21193 fi
21194 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
21195   echo "$ac_t""yes" 1>&6
21196 else
21197   echo "$ac_t""no" 1>&6
21198   cat >> confdefs.h <<EOF
21199 #define caddr_t char *
21200 EOF
21201
21202 fi
21203
21204
21205 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
21206 echo "configure:21207: checking for socklen_t" >&5
21207 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
21208   echo $ac_n "(cached) $ac_c" 1>&6
21209 else
21210   cat > conftest.$ac_ext <<EOF
21211 #line 21212 "configure"
21212 #include "confdefs.h"
21213
21214 #ifdef HAVE_SYS_TYPES_H
21215 #include <sys/types.h>
21216 #endif
21217 #ifdef HAVE_SYS_SOCKET_H
21218 #include <sys/socket.h>
21219 #endif
21220
21221 int main() {
21222 socklen_t len;
21223 ; return 0; }
21224 EOF
21225 if { (eval echo configure:21226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21226   rm -rf conftest*
21227   ol_cv_type_socklen_t=yes
21228 else
21229   echo "configure: failed program was:" >&5
21230   cat conftest.$ac_ext >&5
21231   rm -rf conftest*
21232   ol_cv_type_socklen_t=no
21233 fi
21234 rm -f conftest*
21235 fi
21236
21237 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
21238   if test $ol_cv_type_socklen_t = no; then
21239     cat >> confdefs.h <<\EOF
21240 #define socklen_t int
21241 EOF
21242
21243   fi
21244  
21245 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
21246 echo "configure:21247: checking for member st_blksize in aggregate type struct stat" >&5
21247 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
21248   echo $ac_n "(cached) $ac_c" 1>&6
21249 else
21250   cat > conftest.$ac_ext <<EOF
21251 #line 21252 "configure"
21252 #include "confdefs.h"
21253 #include <sys/types.h>
21254 #include <sys/stat.h>
21255 int main() {
21256 struct stat foo; foo.st_blksize;
21257 ; return 0; }
21258 EOF
21259 if { (eval echo configure:21260: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21260   rm -rf conftest*
21261   ac_cv_c_struct_member_st_blksize=yes
21262 else
21263   echo "configure: failed program was:" >&5
21264   cat conftest.$ac_ext >&5
21265   rm -rf conftest*
21266   ac_cv_c_struct_member_st_blksize=no
21267 fi
21268 rm -f conftest*
21269 fi
21270
21271 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
21272 st_blksize="$ac_cv_c_struct_member_st_blksize"
21273 if test $ac_cv_c_struct_member_st_blksize = yes; then
21274   cat >> confdefs.h <<\EOF
21275 #define HAVE_ST_BLKSIZE 1
21276 EOF
21277
21278 fi
21279
21280 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
21281 echo "configure:21282: checking whether time.h and sys/time.h may both be included" >&5
21282 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
21283   echo $ac_n "(cached) $ac_c" 1>&6
21284 else
21285   cat > conftest.$ac_ext <<EOF
21286 #line 21287 "configure"
21287 #include "confdefs.h"
21288 #include <sys/types.h>
21289 #include <sys/time.h>
21290 #include <time.h>
21291 int main() {
21292 struct tm *tp;
21293 ; return 0; }
21294 EOF
21295 if { (eval echo configure:21296: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21296   rm -rf conftest*
21297   ac_cv_header_time=yes
21298 else
21299   echo "configure: failed program was:" >&5
21300   cat conftest.$ac_ext >&5
21301   rm -rf conftest*
21302   ac_cv_header_time=no
21303 fi
21304 rm -f conftest*
21305 fi
21306
21307 echo "$ac_t""$ac_cv_header_time" 1>&6
21308 if test $ac_cv_header_time = yes; then
21309   cat >> confdefs.h <<\EOF
21310 #define TIME_WITH_SYS_TIME 1
21311 EOF
21312
21313 fi
21314
21315 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
21316 echo "configure:21317: checking whether struct tm is in sys/time.h or time.h" >&5
21317 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
21318   echo $ac_n "(cached) $ac_c" 1>&6
21319 else
21320   cat > conftest.$ac_ext <<EOF
21321 #line 21322 "configure"
21322 #include "confdefs.h"
21323 #include <sys/types.h>
21324 #include <time.h>
21325 int main() {
21326 struct tm *tp; tp->tm_sec;
21327 ; return 0; }
21328 EOF
21329 if { (eval echo configure:21330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21330   rm -rf conftest*
21331   ac_cv_struct_tm=time.h
21332 else
21333   echo "configure: failed program was:" >&5
21334   cat conftest.$ac_ext >&5
21335   rm -rf conftest*
21336   ac_cv_struct_tm=sys/time.h
21337 fi
21338 rm -f conftest*
21339 fi
21340
21341 echo "$ac_t""$ac_cv_struct_tm" 1>&6
21342 if test $ac_cv_struct_tm = sys/time.h; then
21343   cat >> confdefs.h <<\EOF
21344 #define TM_IN_SYS_TIME 1
21345 EOF
21346
21347 fi
21348
21349 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
21350 echo "configure:21351: checking for uid_t in sys/types.h" >&5
21351 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
21352   echo $ac_n "(cached) $ac_c" 1>&6
21353 else
21354   cat > conftest.$ac_ext <<EOF
21355 #line 21356 "configure"
21356 #include "confdefs.h"
21357 #include <sys/types.h>
21358 EOF
21359 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21360   egrep "uid_t" >/dev/null 2>&1; then
21361   rm -rf conftest*
21362   ac_cv_type_uid_t=yes
21363 else
21364   rm -rf conftest*
21365   ac_cv_type_uid_t=no
21366 fi
21367 rm -f conftest*
21368
21369 fi
21370
21371 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
21372 if test $ac_cv_type_uid_t = no; then
21373   cat >> confdefs.h <<\EOF
21374 #define uid_t int
21375 EOF
21376
21377   cat >> confdefs.h <<\EOF
21378 #define gid_t int
21379 EOF
21380
21381 fi
21382
21383 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
21384 echo "configure:21385: checking for sig_atomic_t" >&5
21385 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
21386   echo $ac_n "(cached) $ac_c" 1>&6
21387 else
21388   cat > conftest.$ac_ext <<EOF
21389 #line 21390 "configure"
21390 #include "confdefs.h"
21391 #include <signal.h>
21392 int main() {
21393 sig_atomic_t atomic;
21394 ; return 0; }
21395 EOF
21396 if { (eval echo configure:21397: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21397   rm -rf conftest*
21398   ol_cv_type_sig_atomic_t=yes
21399 else
21400   echo "configure: failed program was:" >&5
21401   cat conftest.$ac_ext >&5
21402   rm -rf conftest*
21403   ol_cv_type_sig_atomic_t=no
21404 fi
21405 rm -f conftest*
21406 fi
21407
21408 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
21409   if test $ol_cv_type_sig_atomic_t = no; then
21410     cat >> confdefs.h <<\EOF
21411 #define sig_atomic_t int
21412 EOF
21413
21414   fi
21415  
21416
21417
21418 # test for pw_gecos in struct passwd
21419 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
21420 echo "configure:21421: checking struct passwd for pw_gecos" >&5
21421 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
21422   echo $ac_n "(cached) $ac_c" 1>&6
21423 else
21424   
21425         cat > conftest.$ac_ext <<EOF
21426 #line 21427 "configure"
21427 #include "confdefs.h"
21428 #include <pwd.h>
21429 int main() {
21430
21431         struct passwd pwd;
21432         pwd.pw_gecos = pwd.pw_name;
21433
21434 ; return 0; }
21435 EOF
21436 if { (eval echo configure:21437: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21437   rm -rf conftest*
21438   ol_cv_struct_passwd_pw_gecos=yes
21439 else
21440   echo "configure: failed program was:" >&5
21441   cat conftest.$ac_ext >&5
21442   rm -rf conftest*
21443   ol_cv_struct_passwd_pw_gecos=no
21444 fi
21445 rm -f conftest*
21446 fi
21447
21448 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
21449 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
21450         cat >> confdefs.h <<\EOF
21451 #define HAVE_PW_GECOS 1
21452 EOF
21453
21454 fi
21455
21456 # test for pw_passwd in struct passwd
21457 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
21458 echo "configure:21459: checking struct passwd for pw_passwd" >&5
21459 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
21460   echo $ac_n "(cached) $ac_c" 1>&6
21461 else
21462   
21463         cat > conftest.$ac_ext <<EOF
21464 #line 21465 "configure"
21465 #include "confdefs.h"
21466 #include <pwd.h>
21467 int main() {
21468
21469         struct passwd pwd;
21470         pwd.pw_passwd = pwd.pw_name;
21471
21472 ; return 0; }
21473 EOF
21474 if { (eval echo configure:21475: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21475   rm -rf conftest*
21476   ol_cv_struct_passwd_pw_passwd=yes
21477 else
21478   echo "configure: failed program was:" >&5
21479   cat conftest.$ac_ext >&5
21480   rm -rf conftest*
21481   ol_cv_struct_passwd_pw_passwd=no
21482 fi
21483 rm -f conftest*
21484 fi
21485
21486 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
21487 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
21488         cat >> confdefs.h <<\EOF
21489 #define HAVE_PW_PASSWD 1
21490 EOF
21491
21492 fi
21493
21494
21495 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
21496 echo "configure:21497: checking if toupper() requires islower()" >&5
21497 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
21498   echo $ac_n "(cached) $ac_c" 1>&6
21499 else
21500   
21501         if test "$cross_compiling" = yes; then
21502   ol_cv_c_upper_lower=safe
21503 else
21504   cat > conftest.$ac_ext <<EOF
21505 #line 21506 "configure"
21506 #include "confdefs.h"
21507
21508 #include <ctype.h>
21509 main()
21510 {
21511         if ('C' == toupper('C'))
21512                 exit(0);
21513         else
21514                 exit(1);
21515 }
21516 EOF
21517 if { (eval echo configure:21518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
21518 then
21519   ol_cv_c_upper_lower=no
21520 else
21521   echo "configure: failed program was:" >&5
21522   cat conftest.$ac_ext >&5
21523   rm -fr conftest*
21524   ol_cv_c_upper_lower=yes
21525 fi
21526 rm -fr conftest*
21527 fi
21528
21529 fi
21530
21531 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
21532 if test $ol_cv_c_upper_lower != no ; then
21533         cat >> confdefs.h <<\EOF
21534 #define C_UPPER_LOWER 1
21535 EOF
21536
21537 fi
21538
21539 echo $ac_n "checking for working const""... $ac_c" 1>&6
21540 echo "configure:21541: checking for working const" >&5
21541 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
21542   echo $ac_n "(cached) $ac_c" 1>&6
21543 else
21544   cat > conftest.$ac_ext <<EOF
21545 #line 21546 "configure"
21546 #include "confdefs.h"
21547
21548 int main() {
21549
21550 /* Ultrix mips cc rejects this.  */
21551 typedef int charset[2]; const charset x;
21552 /* SunOS 4.1.1 cc rejects this.  */
21553 char const *const *ccp;
21554 char **p;
21555 /* NEC SVR4.0.2 mips cc rejects this.  */
21556 struct point {int x, y;};
21557 static struct point const zero = {0,0};
21558 /* AIX XL C 1.02.0.0 rejects this.
21559    It does not let you subtract one const X* pointer from another in an arm
21560    of an if-expression whose if-part is not a constant expression */
21561 const char *g = "string";
21562 ccp = &g + (g ? g-g : 0);
21563 /* HPUX 7.0 cc rejects these. */
21564 ++ccp;
21565 p = (char**) ccp;
21566 ccp = (char const *const *) p;
21567 { /* SCO 3.2v4 cc rejects this.  */
21568   char *t;
21569   char const *s = 0 ? (char *) 0 : (char const *) 0;
21570
21571   *t++ = 0;
21572 }
21573 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
21574   int x[] = {25, 17};
21575   const int *foo = &x[0];
21576   ++foo;
21577 }
21578 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
21579   typedef const int *iptr;
21580   iptr p = 0;
21581   ++p;
21582 }
21583 { /* AIX XL C 1.02.0.0 rejects this saying
21584      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
21585   struct s { int j; const int *ap[3]; };
21586   struct s *b; b->j = 5;
21587 }
21588 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
21589   const int foo = 10;
21590 }
21591
21592 ; return 0; }
21593 EOF
21594 if { (eval echo configure:21595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21595   rm -rf conftest*
21596   ac_cv_c_const=yes
21597 else
21598   echo "configure: failed program was:" >&5
21599   cat conftest.$ac_ext >&5
21600   rm -rf conftest*
21601   ac_cv_c_const=no
21602 fi
21603 rm -f conftest*
21604 fi
21605
21606 echo "$ac_t""$ac_cv_c_const" 1>&6
21607 if test $ac_cv_c_const = no; then
21608   cat >> confdefs.h <<\EOF
21609 #define const 
21610 EOF
21611
21612 fi
21613
21614 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
21615 echo "configure:21616: checking if compiler understands volatile" >&5
21616 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
21617   echo $ac_n "(cached) $ac_c" 1>&6
21618 else
21619   cat > conftest.$ac_ext <<EOF
21620 #line 21621 "configure"
21621 #include "confdefs.h"
21622 int x, y, z;
21623 int main() {
21624 volatile int a; int * volatile b = x ? &y : &z;
21625       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
21626       *b = 0;
21627 ; return 0; }
21628 EOF
21629 if { (eval echo configure:21630: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21630   rm -rf conftest*
21631   ol_cv_c_volatile=yes
21632 else
21633   echo "configure: failed program was:" >&5
21634   cat conftest.$ac_ext >&5
21635   rm -rf conftest*
21636   ol_cv_c_volatile=no
21637 fi
21638 rm -f conftest*
21639 fi
21640
21641 echo "$ac_t""$ol_cv_c_volatile" 1>&6
21642   if test $ol_cv_c_volatile = yes; then
21643     : 
21644   else
21645     cat >> confdefs.h <<\EOF
21646 #define volatile 
21647 EOF
21648
21649   fi
21650  
21651
21652 if test $cross_compiling = yes ; then
21653         cat >> confdefs.h <<\EOF
21654 #define CROSS_COMPILING 1
21655 EOF
21656
21657 else
21658         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
21659 echo "configure:21660: checking whether byte ordering is bigendian" >&5
21660 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
21661   echo $ac_n "(cached) $ac_c" 1>&6
21662 else
21663   ac_cv_c_bigendian=unknown
21664 # See if sys/param.h defines the BYTE_ORDER macro.
21665 cat > conftest.$ac_ext <<EOF
21666 #line 21667 "configure"
21667 #include "confdefs.h"
21668 #include <sys/types.h>
21669 #include <sys/param.h>
21670 int main() {
21671
21672 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
21673  bogus endian macros
21674 #endif
21675 ; return 0; }
21676 EOF
21677 if { (eval echo configure:21678: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21678   rm -rf conftest*
21679   # It does; now see whether it defined to BIG_ENDIAN or not.
21680 cat > conftest.$ac_ext <<EOF
21681 #line 21682 "configure"
21682 #include "confdefs.h"
21683 #include <sys/types.h>
21684 #include <sys/param.h>
21685 int main() {
21686
21687 #if BYTE_ORDER != BIG_ENDIAN
21688  not big endian
21689 #endif
21690 ; return 0; }
21691 EOF
21692 if { (eval echo configure:21693: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21693   rm -rf conftest*
21694   ac_cv_c_bigendian=yes
21695 else
21696   echo "configure: failed program was:" >&5
21697   cat conftest.$ac_ext >&5
21698   rm -rf conftest*
21699   ac_cv_c_bigendian=no
21700 fi
21701 rm -f conftest*
21702 else
21703   echo "configure: failed program was:" >&5
21704   cat conftest.$ac_ext >&5
21705 fi
21706 rm -f conftest*
21707 if test $ac_cv_c_bigendian = unknown; then
21708 if test "$cross_compiling" = yes; then
21709     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
21710 else
21711   cat > conftest.$ac_ext <<EOF
21712 #line 21713 "configure"
21713 #include "confdefs.h"
21714 main () {
21715   /* Are we little or big endian?  From Harbison&Steele.  */
21716   union
21717   {
21718     long l;
21719     char c[sizeof (long)];
21720   } u;
21721   u.l = 1;
21722   exit (u.c[sizeof (long) - 1] == 1);
21723 }
21724 EOF
21725 if { (eval echo configure:21726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
21726 then
21727   ac_cv_c_bigendian=no
21728 else
21729   echo "configure: failed program was:" >&5
21730   cat conftest.$ac_ext >&5
21731   rm -fr conftest*
21732   ac_cv_c_bigendian=yes
21733 fi
21734 rm -fr conftest*
21735 fi
21736
21737 fi
21738 fi
21739
21740 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
21741 if test $ac_cv_c_bigendian = yes; then
21742   cat >> confdefs.h <<\EOF
21743 #define WORDS_BIGENDIAN 1
21744 EOF
21745
21746 fi
21747
21748 fi
21749
21750 echo $ac_n "checking size of short""... $ac_c" 1>&6
21751 echo "configure:21752: checking size of short" >&5 
21752 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
21753   echo $ac_n "(cached) $ac_c" 1>&6
21754 else
21755   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
21756   cat > conftest.$ac_ext <<EOF
21757 #line 21758 "configure"
21758 #include "confdefs.h"
21759 #include "confdefs.h" 
21760 #include <sys/types.h> 
21761  
21762
21763 int main() {
21764 switch (0) case 0: case (sizeof (short) == $ac_size):;
21765 ; return 0; }
21766 EOF
21767 if { (eval echo configure:21768: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21768   rm -rf conftest*
21769   ac_cv_sizeof_short=$ac_size
21770 else
21771   echo "configure: failed program was:" >&5
21772   cat conftest.$ac_ext >&5
21773 fi
21774 rm -f conftest* 
21775   if test x$ac_cv_sizeof_short != x ; then break; fi 
21776 done 
21777
21778 fi
21779  
21780 if test x$ac_cv_sizeof_short = x ; then 
21781   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
21782 fi 
21783 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
21784 cat >> confdefs.h <<EOF
21785 #define SIZEOF_SHORT $ac_cv_sizeof_short
21786 EOF
21787  
21788  
21789 echo $ac_n "checking size of int""... $ac_c" 1>&6
21790 echo "configure:21791: checking size of int" >&5 
21791 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
21792   echo $ac_n "(cached) $ac_c" 1>&6
21793 else
21794   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
21795   cat > conftest.$ac_ext <<EOF
21796 #line 21797 "configure"
21797 #include "confdefs.h"
21798 #include "confdefs.h" 
21799 #include <sys/types.h> 
21800  
21801
21802 int main() {
21803 switch (0) case 0: case (sizeof (int) == $ac_size):;
21804 ; return 0; }
21805 EOF
21806 if { (eval echo configure:21807: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21807   rm -rf conftest*
21808   ac_cv_sizeof_int=$ac_size
21809 else
21810   echo "configure: failed program was:" >&5
21811   cat conftest.$ac_ext >&5
21812 fi
21813 rm -f conftest* 
21814   if test x$ac_cv_sizeof_int != x ; then break; fi 
21815 done 
21816
21817 fi
21818  
21819 if test x$ac_cv_sizeof_int = x ; then 
21820   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
21821 fi 
21822 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
21823 cat >> confdefs.h <<EOF
21824 #define SIZEOF_INT $ac_cv_sizeof_int
21825 EOF
21826  
21827  
21828 echo $ac_n "checking size of long""... $ac_c" 1>&6
21829 echo "configure:21830: checking size of long" >&5 
21830 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
21831   echo $ac_n "(cached) $ac_c" 1>&6
21832 else
21833   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
21834   cat > conftest.$ac_ext <<EOF
21835 #line 21836 "configure"
21836 #include "confdefs.h"
21837 #include "confdefs.h" 
21838 #include <sys/types.h> 
21839  
21840
21841 int main() {
21842 switch (0) case 0: case (sizeof (long) == $ac_size):;
21843 ; return 0; }
21844 EOF
21845 if { (eval echo configure:21846: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21846   rm -rf conftest*
21847   ac_cv_sizeof_long=$ac_size
21848 else
21849   echo "configure: failed program was:" >&5
21850   cat conftest.$ac_ext >&5
21851 fi
21852 rm -f conftest* 
21853   if test x$ac_cv_sizeof_long != x ; then break; fi 
21854 done 
21855
21856 fi
21857  
21858 if test x$ac_cv_sizeof_long = x ; then 
21859   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
21860 fi 
21861 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
21862 cat >> confdefs.h <<EOF
21863 #define SIZEOF_LONG $ac_cv_sizeof_long
21864 EOF
21865  
21866
21867
21868 if test "$ac_cv_sizeof_int" -lt 4 ; then
21869         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
21870
21871         cat >> confdefs.h <<\EOF
21872 #define LBER_INT_T long
21873 EOF
21874
21875 else
21876         cat >> confdefs.h <<\EOF
21877 #define LBER_INT_T int
21878 EOF
21879
21880 fi
21881
21882 cat >> confdefs.h <<\EOF
21883 #define LBER_LEN_T long
21884 EOF
21885
21886 cat >> confdefs.h <<\EOF
21887 #define LBER_SOCKET_T int
21888 EOF
21889
21890 cat >> confdefs.h <<\EOF
21891 #define LBER_TAG_T long
21892 EOF
21893
21894
21895 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
21896 echo "configure:21897: checking for 8-bit clean memcmp" >&5
21897 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
21898   echo $ac_n "(cached) $ac_c" 1>&6
21899 else
21900   if test "$cross_compiling" = yes; then
21901   ac_cv_func_memcmp_clean=no
21902 else
21903   cat > conftest.$ac_ext <<EOF
21904 #line 21905 "configure"
21905 #include "confdefs.h"
21906
21907 main()
21908 {
21909   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
21910   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
21911 }
21912
21913 EOF
21914 if { (eval echo configure:21915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
21915 then
21916   ac_cv_func_memcmp_clean=yes
21917 else
21918   echo "configure: failed program was:" >&5
21919   cat conftest.$ac_ext >&5
21920   rm -fr conftest*
21921   ac_cv_func_memcmp_clean=no
21922 fi
21923 rm -fr conftest*
21924 fi
21925
21926 fi
21927
21928 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
21929 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
21930
21931 echo $ac_n "checking for strftime""... $ac_c" 1>&6
21932 echo "configure:21933: checking for strftime" >&5
21933 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
21934   echo $ac_n "(cached) $ac_c" 1>&6
21935 else
21936   cat > conftest.$ac_ext <<EOF
21937 #line 21938 "configure"
21938 #include "confdefs.h"
21939 /* System header to define __stub macros and hopefully few prototypes,
21940     which can conflict with char strftime(); below.  */
21941 #include <assert.h>
21942 /* Override any gcc2 internal prototype to avoid an error.  */
21943 /* We use char because int might match the return type of a gcc2
21944     builtin and then its argument prototype would still apply.  */
21945 char strftime();
21946 char (*f)();
21947
21948 int main() {
21949
21950 /* The GNU C library defines this for functions which it implements
21951     to always fail with ENOSYS.  Some functions are actually named
21952     something starting with __ and the normal name is an alias.  */
21953 #if defined (__stub_strftime) || defined (__stub___strftime)
21954 choke me
21955 #else
21956 f = strftime;
21957 #endif
21958
21959 ; return 0; }
21960 EOF
21961 if { (eval echo configure:21962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21962   rm -rf conftest*
21963   eval "ac_cv_func_strftime=yes"
21964 else
21965   echo "configure: failed program was:" >&5
21966   cat conftest.$ac_ext >&5
21967   rm -rf conftest*
21968   eval "ac_cv_func_strftime=no"
21969 fi
21970 rm -f conftest*
21971 fi
21972
21973 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
21974   echo "$ac_t""yes" 1>&6
21975   cat >> confdefs.h <<\EOF
21976 #define HAVE_STRFTIME 1
21977 EOF
21978
21979 else
21980   echo "$ac_t""no" 1>&6
21981 # strftime is in -lintl on SCO UNIX.
21982 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
21983 echo "configure:21984: checking for strftime in -lintl" >&5
21984 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
21985 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
21986   echo $ac_n "(cached) $ac_c" 1>&6
21987 else
21988   ac_save_LIBS="$LIBS"
21989 LIBS="-lintl  $LIBS"
21990 cat > conftest.$ac_ext <<EOF
21991 #line 21992 "configure"
21992 #include "confdefs.h"
21993 /* Override any gcc2 internal prototype to avoid an error.  */
21994 /* We use char because int might match the return type of a gcc2
21995     builtin and then its argument prototype would still apply.  */
21996 char strftime();
21997
21998 int main() {
21999 strftime()
22000 ; return 0; }
22001 EOF
22002 if { (eval echo configure:22003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22003   rm -rf conftest*
22004   eval "ac_cv_lib_$ac_lib_var=yes"
22005 else
22006   echo "configure: failed program was:" >&5
22007   cat conftest.$ac_ext >&5
22008   rm -rf conftest*
22009   eval "ac_cv_lib_$ac_lib_var=no"
22010 fi
22011 rm -f conftest*
22012 LIBS="$ac_save_LIBS"
22013
22014 fi
22015 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
22016   echo "$ac_t""yes" 1>&6
22017   cat >> confdefs.h <<\EOF
22018 #define HAVE_STRFTIME 1
22019 EOF
22020
22021 LIBS="-lintl $LIBS"
22022 else
22023   echo "$ac_t""no" 1>&6
22024 fi
22025
22026 fi
22027
22028
22029 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
22030 echo "configure:22031: checking for inet_aton()" >&5
22031 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
22032   echo $ac_n "(cached) $ac_c" 1>&6
22033 else
22034   cat > conftest.$ac_ext <<EOF
22035 #line 22036 "configure"
22036 #include "confdefs.h"
22037
22038 #ifdef HAVE_SYS_TYPES_H
22039 #       include <sys/types.h>
22040 #endif
22041 #ifdef HAVE_SYS_SOCKET_H
22042 #       include <sys/socket.h>
22043 #       ifdef HAVE_SYS_SELECT_H
22044 #               include <sys/select.h>
22045 #       endif
22046 #       include <netinet/in.h>
22047 #       ifdef HAVE_ARPA_INET_H
22048 #               include <arpa/inet.h>
22049 #       endif
22050 #endif
22051
22052 int main() {
22053 struct in_addr in;
22054 int rc = inet_aton( "255.255.255.255", &in );
22055 ; return 0; }
22056 EOF
22057 if { (eval echo configure:22058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22058   rm -rf conftest*
22059   ol_cv_func_inet_aton=yes
22060 else
22061   echo "configure: failed program was:" >&5
22062   cat conftest.$ac_ext >&5
22063   rm -rf conftest*
22064   ol_cv_func_inet_aton=no
22065 fi
22066 rm -f conftest*
22067 fi
22068
22069 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
22070   if test $ol_cv_func_inet_aton != no; then
22071     cat >> confdefs.h <<\EOF
22072 #define HAVE_INET_ATON 1
22073 EOF
22074
22075   fi
22076  
22077
22078 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
22079 echo "configure:22080: checking for _spawnlp" >&5
22080 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
22081   echo $ac_n "(cached) $ac_c" 1>&6
22082 else
22083   cat > conftest.$ac_ext <<EOF
22084 #line 22085 "configure"
22085 #include "confdefs.h"
22086 /* System header to define __stub macros and hopefully few prototypes,
22087     which can conflict with char _spawnlp(); below.  */
22088 #include <assert.h>
22089 /* Override any gcc2 internal prototype to avoid an error.  */
22090 /* We use char because int might match the return type of a gcc2
22091     builtin and then its argument prototype would still apply.  */
22092 char _spawnlp();
22093 char (*f)();
22094
22095 int main() {
22096
22097 /* The GNU C library defines this for functions which it implements
22098     to always fail with ENOSYS.  Some functions are actually named
22099     something starting with __ and the normal name is an alias.  */
22100 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
22101 choke me
22102 #else
22103 f = _spawnlp;
22104 #endif
22105
22106 ; return 0; }
22107 EOF
22108 if { (eval echo configure:22109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22109   rm -rf conftest*
22110   eval "ac_cv_func__spawnlp=yes"
22111 else
22112   echo "configure: failed program was:" >&5
22113   cat conftest.$ac_ext >&5
22114   rm -rf conftest*
22115   eval "ac_cv_func__spawnlp=no"
22116 fi
22117 rm -f conftest*
22118 fi
22119
22120 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
22121   echo "$ac_t""yes" 1>&6
22122   cat >> confdefs.h <<\EOF
22123 #define HAVE_SPAWNLP 1
22124 EOF
22125
22126 else
22127   echo "$ac_t""no" 1>&6
22128 fi
22129
22130
22131 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
22132 echo "configure:22133: checking for _snprintf" >&5
22133 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
22134   echo $ac_n "(cached) $ac_c" 1>&6
22135 else
22136   cat > conftest.$ac_ext <<EOF
22137 #line 22138 "configure"
22138 #include "confdefs.h"
22139 /* System header to define __stub macros and hopefully few prototypes,
22140     which can conflict with char _snprintf(); below.  */
22141 #include <assert.h>
22142 /* Override any gcc2 internal prototype to avoid an error.  */
22143 /* We use char because int might match the return type of a gcc2
22144     builtin and then its argument prototype would still apply.  */
22145 char _snprintf();
22146 char (*f)();
22147
22148 int main() {
22149
22150 /* The GNU C library defines this for functions which it implements
22151     to always fail with ENOSYS.  Some functions are actually named
22152     something starting with __ and the normal name is an alias.  */
22153 #if defined (__stub__snprintf) || defined (__stub____snprintf)
22154 choke me
22155 #else
22156 f = _snprintf;
22157 #endif
22158
22159 ; return 0; }
22160 EOF
22161 if { (eval echo configure:22162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22162   rm -rf conftest*
22163   eval "ac_cv_func__snprintf=yes"
22164 else
22165   echo "configure: failed program was:" >&5
22166   cat conftest.$ac_ext >&5
22167   rm -rf conftest*
22168   eval "ac_cv_func__snprintf=no"
22169 fi
22170 rm -f conftest*
22171 fi
22172
22173 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
22174   echo "$ac_t""yes" 1>&6
22175   ac_cv_func_snprintf=yes
22176         cat >> confdefs.h <<\EOF
22177 #define snprintf _snprintf
22178 EOF
22179
22180
22181 else
22182   echo "$ac_t""no" 1>&6
22183 fi
22184
22185
22186 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
22187 echo "configure:22188: checking for _vsnprintf" >&5
22188 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
22189   echo $ac_n "(cached) $ac_c" 1>&6
22190 else
22191   cat > conftest.$ac_ext <<EOF
22192 #line 22193 "configure"
22193 #include "confdefs.h"
22194 /* System header to define __stub macros and hopefully few prototypes,
22195     which can conflict with char _vsnprintf(); below.  */
22196 #include <assert.h>
22197 /* Override any gcc2 internal prototype to avoid an error.  */
22198 /* We use char because int might match the return type of a gcc2
22199     builtin and then its argument prototype would still apply.  */
22200 char _vsnprintf();
22201 char (*f)();
22202
22203 int main() {
22204
22205 /* The GNU C library defines this for functions which it implements
22206     to always fail with ENOSYS.  Some functions are actually named
22207     something starting with __ and the normal name is an alias.  */
22208 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
22209 choke me
22210 #else
22211 f = _vsnprintf;
22212 #endif
22213
22214 ; return 0; }
22215 EOF
22216 if { (eval echo configure:22217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22217   rm -rf conftest*
22218   eval "ac_cv_func__vsnprintf=yes"
22219 else
22220   echo "configure: failed program was:" >&5
22221   cat conftest.$ac_ext >&5
22222   rm -rf conftest*
22223   eval "ac_cv_func__vsnprintf=no"
22224 fi
22225 rm -f conftest*
22226 fi
22227
22228 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
22229   echo "$ac_t""yes" 1>&6
22230   ac_cv_func_vsnprintf=yes
22231         cat >> confdefs.h <<\EOF
22232 #define vsnprintf _vsnprintf
22233 EOF
22234
22235
22236 else
22237   echo "$ac_t""no" 1>&6
22238 fi
22239
22240
22241 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
22242 echo "configure:22243: checking for vprintf" >&5
22243 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
22244   echo $ac_n "(cached) $ac_c" 1>&6
22245 else
22246   cat > conftest.$ac_ext <<EOF
22247 #line 22248 "configure"
22248 #include "confdefs.h"
22249 /* System header to define __stub macros and hopefully few prototypes,
22250     which can conflict with char vprintf(); below.  */
22251 #include <assert.h>
22252 /* Override any gcc2 internal prototype to avoid an error.  */
22253 /* We use char because int might match the return type of a gcc2
22254     builtin and then its argument prototype would still apply.  */
22255 char vprintf();
22256 char (*f)();
22257
22258 int main() {
22259
22260 /* The GNU C library defines this for functions which it implements
22261     to always fail with ENOSYS.  Some functions are actually named
22262     something starting with __ and the normal name is an alias.  */
22263 #if defined (__stub_vprintf) || defined (__stub___vprintf)
22264 choke me
22265 #else
22266 f = vprintf;
22267 #endif
22268
22269 ; return 0; }
22270 EOF
22271 if { (eval echo configure:22272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22272   rm -rf conftest*
22273   eval "ac_cv_func_vprintf=yes"
22274 else
22275   echo "configure: failed program was:" >&5
22276   cat conftest.$ac_ext >&5
22277   rm -rf conftest*
22278   eval "ac_cv_func_vprintf=no"
22279 fi
22280 rm -f conftest*
22281 fi
22282
22283 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
22284   echo "$ac_t""yes" 1>&6
22285   cat >> confdefs.h <<\EOF
22286 #define HAVE_VPRINTF 1
22287 EOF
22288
22289 else
22290   echo "$ac_t""no" 1>&6
22291 fi
22292
22293 if test "$ac_cv_func_vprintf" != yes; then
22294 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
22295 echo "configure:22296: checking for _doprnt" >&5
22296 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
22297   echo $ac_n "(cached) $ac_c" 1>&6
22298 else
22299   cat > conftest.$ac_ext <<EOF
22300 #line 22301 "configure"
22301 #include "confdefs.h"
22302 /* System header to define __stub macros and hopefully few prototypes,
22303     which can conflict with char _doprnt(); below.  */
22304 #include <assert.h>
22305 /* Override any gcc2 internal prototype to avoid an error.  */
22306 /* We use char because int might match the return type of a gcc2
22307     builtin and then its argument prototype would still apply.  */
22308 char _doprnt();
22309 char (*f)();
22310
22311 int main() {
22312
22313 /* The GNU C library defines this for functions which it implements
22314     to always fail with ENOSYS.  Some functions are actually named
22315     something starting with __ and the normal name is an alias.  */
22316 #if defined (__stub__doprnt) || defined (__stub____doprnt)
22317 choke me
22318 #else
22319 f = _doprnt;
22320 #endif
22321
22322 ; return 0; }
22323 EOF
22324 if { (eval echo configure:22325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22325   rm -rf conftest*
22326   eval "ac_cv_func__doprnt=yes"
22327 else
22328   echo "configure: failed program was:" >&5
22329   cat conftest.$ac_ext >&5
22330   rm -rf conftest*
22331   eval "ac_cv_func__doprnt=no"
22332 fi
22333 rm -f conftest*
22334 fi
22335
22336 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
22337   echo "$ac_t""yes" 1>&6
22338   cat >> confdefs.h <<\EOF
22339 #define HAVE_DOPRNT 1
22340 EOF
22341
22342 else
22343   echo "$ac_t""no" 1>&6
22344 fi
22345
22346 fi
22347
22348
22349 if test $ac_cv_func_vprintf = yes ; then
22350                 for ac_func in vsnprintf vsprintf
22351 do
22352 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
22353 echo "configure:22354: checking for $ac_func" >&5
22354 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
22355   echo $ac_n "(cached) $ac_c" 1>&6
22356 else
22357   cat > conftest.$ac_ext <<EOF
22358 #line 22359 "configure"
22359 #include "confdefs.h"
22360 /* System header to define __stub macros and hopefully few prototypes,
22361     which can conflict with char $ac_func(); below.  */
22362 #include <assert.h>
22363 /* Override any gcc2 internal prototype to avoid an error.  */
22364 /* We use char because int might match the return type of a gcc2
22365     builtin and then its argument prototype would still apply.  */
22366 char $ac_func();
22367 char (*f)();
22368
22369 int main() {
22370
22371 /* The GNU C library defines this for functions which it implements
22372     to always fail with ENOSYS.  Some functions are actually named
22373     something starting with __ and the normal name is an alias.  */
22374 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
22375 choke me
22376 #else
22377 f = $ac_func;
22378 #endif
22379
22380 ; return 0; }
22381 EOF
22382 if { (eval echo configure:22383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22383   rm -rf conftest*
22384   eval "ac_cv_func_$ac_func=yes"
22385 else
22386   echo "configure: failed program was:" >&5
22387   cat conftest.$ac_ext >&5
22388   rm -rf conftest*
22389   eval "ac_cv_func_$ac_func=no"
22390 fi
22391 rm -f conftest*
22392 fi
22393
22394 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
22395   echo "$ac_t""yes" 1>&6
22396     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
22397   cat >> confdefs.h <<EOF
22398 #define $ac_tr_func 1
22399 EOF
22400  
22401 else
22402   echo "$ac_t""no" 1>&6
22403 fi
22404 done
22405
22406 fi
22407
22408 for ac_func in \
22409         bcopy                   \
22410         closesocket             \
22411         chroot                  \
22412         endgrent                \
22413         endpwent                \
22414         fcntl                   \
22415         flock                   \
22416         getdtablesize   \
22417         getgrgid                \
22418         gethostname             \
22419         getpass                 \
22420         getpassphrase   \
22421         getpwuid                \
22422         getpwnam                \
22423         getspnam                \
22424         gettimeofday    \
22425         initgroups              \
22426         lockf                   \
22427         memcpy                  \
22428         memmove                 \
22429         mkstemp                 \
22430         mktemp                  \
22431         pipe                    \
22432         read                    \
22433         recv                    \
22434         recvfrom                \
22435         recvmsg                 \
22436         setpwfile               \
22437         setgid                  \
22438         setegid                 \
22439         setsid                  \
22440         setuid                  \
22441         seteuid                 \
22442         sigaction               \
22443         signal                  \
22444         sigset                  \
22445         strdup                  \
22446         strerror                \
22447         strpbrk                 \
22448         strrchr                 \
22449         strsep                  \
22450         strstr                  \
22451         strtol                  \
22452         strtoul                 \
22453         strspn                  \
22454         sysconf                 \
22455         usleep                  \
22456         waitpid                 \
22457         wait4                   \
22458         write                   \
22459         send                    \
22460         sendto                  \
22461
22462 do
22463 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
22464 echo "configure:22465: checking for $ac_func" >&5
22465 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
22466   echo $ac_n "(cached) $ac_c" 1>&6
22467 else
22468   cat > conftest.$ac_ext <<EOF
22469 #line 22470 "configure"
22470 #include "confdefs.h"
22471 /* System header to define __stub macros and hopefully few prototypes,
22472     which can conflict with char $ac_func(); below.  */
22473 #include <assert.h>
22474 /* Override any gcc2 internal prototype to avoid an error.  */
22475 /* We use char because int might match the return type of a gcc2
22476     builtin and then its argument prototype would still apply.  */
22477 char $ac_func();
22478 char (*f)();
22479
22480 int main() {
22481
22482 /* The GNU C library defines this for functions which it implements
22483     to always fail with ENOSYS.  Some functions are actually named
22484     something starting with __ and the normal name is an alias.  */
22485 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
22486 choke me
22487 #else
22488 f = $ac_func;
22489 #endif
22490
22491 ; return 0; }
22492 EOF
22493 if { (eval echo configure:22494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22494   rm -rf conftest*
22495   eval "ac_cv_func_$ac_func=yes"
22496 else
22497   echo "configure: failed program was:" >&5
22498   cat conftest.$ac_ext >&5
22499   rm -rf conftest*
22500   eval "ac_cv_func_$ac_func=no"
22501 fi
22502 rm -f conftest*
22503 fi
22504
22505 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
22506   echo "$ac_t""yes" 1>&6
22507     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
22508   cat >> confdefs.h <<EOF
22509 #define $ac_tr_func 1
22510 EOF
22511  
22512 else
22513   echo "$ac_t""no" 1>&6
22514 fi
22515 done
22516
22517
22518 for ac_func in getopt
22519 do
22520 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
22521 echo "configure:22522: checking for $ac_func" >&5
22522 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
22523   echo $ac_n "(cached) $ac_c" 1>&6
22524 else
22525   cat > conftest.$ac_ext <<EOF
22526 #line 22527 "configure"
22527 #include "confdefs.h"
22528 /* System header to define __stub macros and hopefully few prototypes,
22529     which can conflict with char $ac_func(); below.  */
22530 #include <assert.h>
22531 /* Override any gcc2 internal prototype to avoid an error.  */
22532 /* We use char because int might match the return type of a gcc2
22533     builtin and then its argument prototype would still apply.  */
22534 char $ac_func();
22535 char (*f)();
22536
22537 int main() {
22538
22539 /* The GNU C library defines this for functions which it implements
22540     to always fail with ENOSYS.  Some functions are actually named
22541     something starting with __ and the normal name is an alias.  */
22542 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
22543 choke me
22544 #else
22545 f = $ac_func;
22546 #endif
22547
22548 ; return 0; }
22549 EOF
22550 if { (eval echo configure:22551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22551   rm -rf conftest*
22552   eval "ac_cv_func_$ac_func=yes"
22553 else
22554   echo "configure: failed program was:" >&5
22555   cat conftest.$ac_ext >&5
22556   rm -rf conftest*
22557   eval "ac_cv_func_$ac_func=no"
22558 fi
22559 rm -f conftest*
22560 fi
22561
22562 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
22563   echo "$ac_t""yes" 1>&6
22564     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
22565   cat >> confdefs.h <<EOF
22566 #define $ac_tr_func 1
22567 EOF
22568  
22569 else
22570   echo "$ac_t""no" 1>&6
22571 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
22572 fi
22573 done
22574
22575
22576
22577 if test "$ac_cv_func_getopt" != yes; then
22578         LIBSRCS="$LIBSRCS getopt.c"
22579 fi
22580
22581 # Check Configuration
22582 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
22583 echo "configure:22584: checking declaration of sys_errlist" >&5
22584 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
22585   echo $ac_n "(cached) $ac_c" 1>&6
22586 else
22587   
22588         cat > conftest.$ac_ext <<EOF
22589 #line 22590 "configure"
22590 #include "confdefs.h"
22591
22592 #include <stdio.h>
22593 #include <sys/types.h>
22594 #include <errno.h>
22595 #ifdef WINNT
22596 #include <stdlib.h>
22597 #endif 
22598 int main() {
22599 char *c = (char *) *sys_errlist
22600 ; return 0; }
22601 EOF
22602 if { (eval echo configure:22603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22603   rm -rf conftest*
22604   ol_cv_dcl_sys_errlist=yes
22605         ol_cv_have_sys_errlist=yes
22606 else
22607   echo "configure: failed program was:" >&5
22608   cat conftest.$ac_ext >&5
22609   rm -rf conftest*
22610   ol_cv_dcl_sys_errlist=no
22611 fi
22612 rm -f conftest*
22613 fi
22614
22615 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
22616 #
22617 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
22618 if test $ol_cv_dcl_sys_errlist = no ; then
22619         cat >> confdefs.h <<\EOF
22620 #define DECL_SYS_ERRLIST 1
22621 EOF
22622
22623
22624         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
22625 echo "configure:22626: checking existence of sys_errlist" >&5
22626 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
22627   echo $ac_n "(cached) $ac_c" 1>&6
22628 else
22629   
22630                 cat > conftest.$ac_ext <<EOF
22631 #line 22632 "configure"
22632 #include "confdefs.h"
22633 #include <errno.h>
22634 int main() {
22635 char *c = (char *) *sys_errlist
22636 ; return 0; }
22637 EOF
22638 if { (eval echo configure:22639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22639   rm -rf conftest*
22640   ol_cv_have_sys_errlist=yes
22641 else
22642   echo "configure: failed program was:" >&5
22643   cat conftest.$ac_ext >&5
22644   rm -rf conftest*
22645   ol_cv_have_sys_errlist=no
22646 fi
22647 rm -f conftest*
22648 fi
22649
22650 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
22651 fi
22652 if test $ol_cv_have_sys_errlist = yes ; then
22653         cat >> confdefs.h <<\EOF
22654 #define HAVE_SYS_ERRLIST 1
22655 EOF
22656
22657 fi
22658
22659
22660
22661 if test "$ol_enable_debug" != no ; then
22662         cat >> confdefs.h <<\EOF
22663 #define LDAP_DEBUG 1
22664 EOF
22665
22666 fi
22667 if test "$ol_enable_syslog" = yes ; then
22668         cat >> confdefs.h <<\EOF
22669 #define LDAP_SYSLOG 1
22670 EOF
22671
22672 fi
22673 if test "$ol_enable_cache" = no ; then
22674         cat >> confdefs.h <<\EOF
22675 #define LDAP_NOCACHE 1
22676 EOF
22677
22678 fi
22679 if test "$ol_link_kbind" != no ; then
22680         cat >> confdefs.h <<\EOF
22681 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
22682 EOF
22683
22684 fi
22685 if test "$ol_enable_proctitle" != no ; then
22686         cat >> confdefs.h <<\EOF
22687 #define LDAP_PROCTITLE 1
22688 EOF
22689
22690 fi
22691 if test "$ol_enable_referrals" != no ; then
22692         cat >> confdefs.h <<\EOF
22693 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
22694 EOF
22695
22696 fi
22697 if test "$ol_enable_local" != no; then
22698         cat >> confdefs.h <<\EOF
22699 #define LDAP_PF_LOCAL 1
22700 EOF
22701
22702 fi
22703 if test "$ol_link_ipv6" != no; then
22704         cat >> confdefs.h <<\EOF
22705 #define LDAP_PF_INET6 1
22706 EOF
22707
22708 fi
22709 if test "$ol_enable_cleartext" != no ; then
22710         cat >> confdefs.h <<\EOF
22711 #define SLAPD_CLEARTEXT 1
22712 EOF
22713
22714 fi
22715 if test "$ol_enable_crypt" != no ; then
22716         cat >> confdefs.h <<\EOF
22717 #define SLAPD_CRYPT 1
22718 EOF
22719
22720 fi
22721 if test "$ol_link_kpasswd" != no ; then
22722         cat >> confdefs.h <<\EOF
22723 #define SLAPD_KPASSWD 1
22724 EOF
22725
22726 fi
22727 if test "$ol_link_spasswd" != no ; then
22728         cat >> confdefs.h <<\EOF
22729 #define SLAPD_SPASSWD 1
22730 EOF
22731
22732 fi
22733 if test "$ol_enable_multimaster" != no ; then
22734         cat >> confdefs.h <<\EOF
22735 #define SLAPD_MULTIMASTER 1
22736 EOF
22737
22738 fi
22739 if test "$ol_enable_phonetic" != no ; then
22740         cat >> confdefs.h <<\EOF
22741 #define SLAPD_PHONETIC 1
22742 EOF
22743
22744 fi
22745 if test "$ol_enable_rlookups" != no ; then
22746         cat >> confdefs.h <<\EOF
22747 #define SLAPD_RLOOKUPS 1
22748 EOF
22749
22750 fi
22751 if test "$ol_enable_aci" != no ; then
22752         cat >> confdefs.h <<\EOF
22753 #define SLAPD_ACI_ENABLED 1
22754 EOF
22755
22756 fi
22757
22758 if test "$ol_link_modules" != no ; then
22759         cat >> confdefs.h <<\EOF
22760 #define SLAPD_MODULES 1
22761 EOF
22762
22763         BUILD_SLAPD=yes
22764         SLAPD_MODULES_LDFLAGS="-dlopen self"
22765 fi
22766
22767 if test "$ol_enable_bdb" != no ; then
22768         cat >> confdefs.h <<\EOF
22769 #define SLAPD_BDB 1
22770 EOF
22771
22772         BUILD_SLAPD=yes
22773         BUILD_BDB=yes
22774         if test "$ol_with_bdb_module" != static ; then
22775                 cat >> confdefs.h <<\EOF
22776 #define SLAPD_BDB_DYNAMIC 1
22777 EOF
22778
22779                 BUILD_BDB=mod
22780                 BUILD_BDB_DYNAMIC=shared
22781                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-bdb"
22782         else
22783                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-bdb"
22784         fi
22785 fi
22786
22787 if test "$ol_link_dnssrv" != no ; then
22788         cat >> confdefs.h <<\EOF
22789 #define SLAPD_DNSSRV 1
22790 EOF
22791
22792         BUILD_SLAPD=yes
22793         BUILD_DNSSRV=yes
22794         if test "$ol_with_dnssrv_module" != static ; then
22795                 cat >> confdefs.h <<\EOF
22796 #define SLAPD_DNSSRV_DYNAMIC 1
22797 EOF
22798
22799                 BUILD_DNSSRV=mod
22800                 BUILD_DNSSRV_DYNAMIC=shared
22801                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-dnssrv"
22802         else
22803                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-dnssrv"
22804         fi
22805 fi
22806
22807 if test "$ol_enable_ldap" != no ; then
22808         cat >> confdefs.h <<\EOF
22809 #define SLAPD_LDAP 1
22810 EOF
22811
22812         BUILD_SLAPD=yes
22813         BUILD_LDAP=yes
22814         if test "$ol_with_ldap_module" != static ; then
22815                 cat >> confdefs.h <<\EOF
22816 #define SLAPD_LDAP_DYNAMIC 1
22817 EOF
22818
22819                 BUILD_LDAP=mod
22820                 BUILD_LDAP_DYNAMIC=shared
22821                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldap"
22822         else
22823                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldap"
22824         fi
22825 fi
22826
22827 if test "$ol_link_ldbm" != no -a $ol_enable_ldbm != no; then
22828         cat >> confdefs.h <<\EOF
22829 #define SLAPD_LDBM 1
22830 EOF
22831
22832         BUILD_SLAPD=yes
22833         BUILD_LDBM=yes
22834         LDBM_LIB="-lldbm"
22835         if test "$ol_with_ldbm_module" != static ; then
22836                 cat >> confdefs.h <<\EOF
22837 #define SLAPD_LDBM_DYNAMIC 1
22838 EOF
22839
22840                 BUILD_LDBM=mod
22841                 BUILD_LDBM_DYNAMIC=shared
22842                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldbm"
22843         else
22844                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldbm"
22845         fi
22846 fi
22847
22848 if test "$ol_enable_meta" != no ; then
22849         if test "$ol_enable_ldap" = no ; then
22850                 { echo "configure: error: need --enable-ldap to use --enable-meta" 1>&2; exit 1; }
22851         fi
22852         if test "$ol_enable_rewrite" = no ; then
22853                 { echo "configure: error: need --enable-rewrite to use --enable-meta" 1>&2; exit 1; }
22854         fi
22855         cat >> confdefs.h <<\EOF
22856 #define SLAPD_META 1
22857 EOF
22858
22859         BUILD_SLAPD=yes
22860         BUILD_META=yes
22861         BUILD_LDAP=yes
22862         BUILD_REWRITE=yes
22863         if test "$ol_with_meta_module" != static ; then
22864                 cat >> confdefs.h <<\EOF
22865 #define SLAPD_META_DYNAMIC 1
22866 EOF
22867
22868                 BUILD_META=mod
22869                 BUILD_META_DYNAMIC=shared
22870                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-meta"
22871         else
22872                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-meta"
22873         fi
22874 fi
22875
22876 if test "$ol_enable_monitor" != no ; then
22877         cat >> confdefs.h <<\EOF
22878 #define SLAPD_MONITOR 1
22879 EOF
22880
22881         BUILD_SLAPD=yes
22882         BUILD_MONITOR=yes
22883         if test "$ol_with_monitor_module" != static ; then
22884                 cat >> confdefs.h <<\EOF
22885 #define SLAPD_MONITOR_DYNAMIC 1
22886 EOF
22887
22888                 BUILD_MONITOR=mod
22889                 BUILD_MONITOR_DYNAMIC=shared
22890                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-monitor"
22891         else
22892                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-monitor"
22893         fi
22894 fi
22895
22896 if test "$ol_enable_null" != no ; then
22897         cat >> confdefs.h <<\EOF
22898 #define SLAPD_NULL 1
22899 EOF
22900
22901         BUILD_SLAPD=yes
22902         BUILD_NULL=yes
22903         if test "$ol_with_null_module" != static ; then
22904                 cat >> confdefs.h <<\EOF
22905 #define SLAPD_NULL_DYNAMIC 1
22906 EOF
22907
22908                 BUILD_NULL=mod
22909                 BUILD_NULL_DYNAMIC=shared
22910                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-null"
22911         else
22912                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-null"
22913         fi
22914 fi
22915
22916 if test "$ol_enable_passwd" != no ; then
22917         cat >> confdefs.h <<\EOF
22918 #define SLAPD_PASSWD 1
22919 EOF
22920
22921         BUILD_SLAPD=yes
22922         BUILD_PASSWD=yes
22923         if test "$ol_with_passwd_module" != static ; then
22924                 cat >> confdefs.h <<\EOF
22925 #define SLAPD_PASSWD_DYNAMIC 1
22926 EOF
22927
22928                 BUILD_PASSWD=mod
22929                 BUILD_PASSWD_DYNAMIC=shared
22930                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-passwd"
22931         else
22932                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-passwd"
22933         fi
22934 fi
22935
22936 if test "$ol_link_perl" != no ; then
22937         cat >> confdefs.h <<\EOF
22938 #define SLAPD_PERL 1
22939 EOF
22940
22941         BUILD_SLAPD=yes
22942         BUILD_PERL=yes
22943         if test "$ol_with_perl_module" != static ; then
22944                 cat >> confdefs.h <<\EOF
22945 #define SLAPD_PERL_DYNAMIC 1
22946 EOF
22947
22948                 BUILD_PERL=mod
22949                 BUILD_PERL_DYNAMIC=shared
22950                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-perl"
22951         else
22952                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-perl"
22953         fi
22954 fi
22955
22956 if test "$ol_enable_shell" != no ; then
22957         cat >> confdefs.h <<\EOF
22958 #define SLAPD_SHELL 1
22959 EOF
22960
22961         BUILD_SLAPD=yes
22962         BUILD_SHELL=yes
22963         if test "$ol_with_shell_module" != static ; then
22964                 cat >> confdefs.h <<\EOF
22965 #define SLAPD_SHELL_DYNAMIC 1
22966 EOF
22967
22968                 BUILD_SHELL=mod
22969                 BUILD_SHELL_DYNAMIC=shared
22970                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-shell"
22971         else
22972                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-shell"
22973         fi
22974 fi
22975
22976 if test "$ol_enable_tcl" != no ; then
22977         cat >> confdefs.h <<\EOF
22978 #define SLAPD_TCL 1
22979 EOF
22980
22981         BUILD_SLAPD=yes
22982         BUILD_TCL=yes
22983         if test "$ol_with_tcl_module" != static; then
22984                 cat >> confdefs.h <<\EOF
22985 #define SLAPD_TCL_DYNAMIC 1
22986 EOF
22987
22988                 BUILD_TCL=mod
22989                 BUILD_TCL_DYNAMIC=shared
22990                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-tcl"
22991         else
22992                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-tcl"
22993         fi
22994 fi
22995
22996 if test "$ol_link_sql" != no ; then
22997         cat >> confdefs.h <<\EOF
22998 #define SLAPD_SQL 1
22999 EOF
23000
23001         BUILD_SLAPD=yes
23002         BUILD_SQL=yes
23003         if test "$ol_with_sql_module" != static; then
23004                 cat >> confdefs.h <<\EOF
23005 #define SLAPD_SQL_DYNAMIC 1
23006 EOF
23007
23008                 BUILD_SQL=mod
23009                 BUILD_SQL_DYNAMIC=shared
23010                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-sql"
23011         else
23012                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-sql"
23013         fi
23014 fi
23015
23016 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
23017         $BUILD_SLAPD = yes ; then
23018         BUILD_SLURPD=yes
23019 fi
23020
23021 if test "$ol_enable_rewrite" != no ; then
23022         cat >> confdefs.h <<\EOF
23023 #define ENABLE_REWRITE 1
23024 EOF
23025
23026         BUILD_REWRITE=yes
23027 fi
23028
23029
23030
23031 if test "$ac_cv_mingw32" = yes ; then
23032         PLAT=NT
23033         SLAPD_MODULES_LDFLAGS=
23034 else
23035         PLAT=UNIX
23036 fi
23037
23038
23039
23040
23041
23042
23043   
23044   
23045   
23046   
23047   
23048   
23049   
23050   
23051   
23052   
23053   
23054   
23055   
23056   
23057   
23058   
23059   
23060   
23061   
23062   
23063   
23064   
23065   
23066   
23067
23068
23069
23070
23071
23072
23073
23074
23075
23076
23077
23078
23079
23080
23081
23082
23083
23084
23085
23086
23087
23088
23089
23090
23091
23092
23093
23094
23095
23096
23097
23098
23099
23100
23101
23102
23103
23104
23105
23106 # Check whether --with-xxinstall or --without-xxinstall was given.
23107 if test "${with_xxinstall+set}" = set; then
23108   withval="$with_xxinstall"
23109   :
23110 fi
23111
23112
23113
23114 trap '' 1 2 15
23115
23116 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
23117
23118 test "x$prefix" = xNONE && prefix=$ac_default_prefix
23119 # Let make expand exec_prefix.
23120 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
23121
23122 # Any assignment to VPATH causes Sun make to only execute
23123 # the first set of double-colon rules, so remove it if not needed.
23124 # If there is a colon in the path, we need to keep it.
23125 if test "x$srcdir" = x.; then
23126   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
23127 fi
23128
23129 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
23130
23131 DEFS=-DHAVE_CONFIG_H
23132
23133 # Without the "./", some shells look in PATH for config.status.
23134 : ${CONFIG_STATUS=./config.status}
23135
23136 echo creating $CONFIG_STATUS
23137 rm -f $CONFIG_STATUS
23138 cat > $CONFIG_STATUS <<EOF
23139 #! /bin/sh
23140 # Generated automatically by configure.
23141 # Run this file to recreate the current configuration.
23142 # This directory was configured as follows,
23143 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
23144 #
23145 # $0 $ac_configure_args
23146 #
23147 # Compiler output produced by configure, useful for debugging
23148 # configure, is in ./config.log if it exists.
23149
23150 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
23151 for ac_option
23152 do
23153   case "\$ac_option" in
23154   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
23155     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
23156     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
23157   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
23158     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
23159     exit 0 ;;
23160   -help | --help | --hel | --he | --h)
23161     echo "\$ac_cs_usage"; exit 0 ;;
23162   *) echo "\$ac_cs_usage"; exit 1 ;;
23163   esac
23164 done
23165
23166 ac_given_srcdir=$srcdir
23167 ac_given_INSTALL="$INSTALL"
23168
23169 trap 'rm -fr `echo "\
23170 Makefile:build/top.mk:Makefile.in:build/dir.mk \
23171 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
23172 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
23173 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
23174 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
23175 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
23176 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
23177 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
23178 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
23179 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
23180 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
23181 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
23182 include/Makefile:build/top.mk:include/Makefile.in \
23183 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
23184 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
23185 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23186 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23187 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
23188 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
23189 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
23190 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
23191 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
23192 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
23193 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
23194 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
23195 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
23196 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
23197 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
23198 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
23199 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
23200 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
23201 servers/slapd/back-null/Makefile:build/top.mk:servers/slapd/back-null/Makefile.in:build/mod.mk \
23202 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
23203 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
23204 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
23205 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
23206 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
23207 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
23208 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
23209 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
23210 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
23211 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
23212  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
23213 EOF
23214 cat >> $CONFIG_STATUS <<EOF
23215
23216 # Protect against being on the right side of a sed subst in config.status.
23217 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
23218  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
23219 $ac_vpsub
23220 $extrasub
23221 s%@SHELL@%$SHELL%g
23222 s%@CFLAGS@%$CFLAGS%g
23223 s%@CPPFLAGS@%$CPPFLAGS%g
23224 s%@CXXFLAGS@%$CXXFLAGS%g
23225 s%@FFLAGS@%$FFLAGS%g
23226 s%@DEFS@%$DEFS%g
23227 s%@LDFLAGS@%$LDFLAGS%g
23228 s%@LIBS@%$LIBS%g
23229 s%@exec_prefix@%$exec_prefix%g
23230 s%@prefix@%$prefix%g
23231 s%@program_transform_name@%$program_transform_name%g
23232 s%@bindir@%$bindir%g
23233 s%@sbindir@%$sbindir%g
23234 s%@libexecdir@%$libexecdir%g
23235 s%@datadir@%$datadir%g
23236 s%@sysconfdir@%$sysconfdir%g
23237 s%@sharedstatedir@%$sharedstatedir%g
23238 s%@localstatedir@%$localstatedir%g
23239 s%@libdir@%$libdir%g
23240 s%@includedir@%$includedir%g
23241 s%@oldincludedir@%$oldincludedir%g
23242 s%@infodir@%$infodir%g
23243 s%@mandir@%$mandir%g
23244 s%@host@%$host%g
23245 s%@host_alias@%$host_alias%g
23246 s%@host_cpu@%$host_cpu%g
23247 s%@host_vendor@%$host_vendor%g
23248 s%@host_os@%$host_os%g
23249 s%@target@%$target%g
23250 s%@target_alias@%$target_alias%g
23251 s%@target_cpu@%$target_cpu%g
23252 s%@target_vendor@%$target_vendor%g
23253 s%@target_os@%$target_os%g
23254 s%@build@%$build%g
23255 s%@build_alias@%$build_alias%g
23256 s%@build_cpu@%$build_cpu%g
23257 s%@build_vendor@%$build_vendor%g
23258 s%@build_os@%$build_os%g
23259 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
23260 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
23261 s%@INSTALL_DATA@%$INSTALL_DATA%g
23262 s%@PACKAGE@%$PACKAGE%g
23263 s%@VERSION@%$VERSION%g
23264 s%@ACLOCAL@%$ACLOCAL%g
23265 s%@AUTOCONF@%$AUTOCONF%g
23266 s%@AUTOMAKE@%$AUTOMAKE%g
23267 s%@AUTOHEADER@%$AUTOHEADER%g
23268 s%@MAKEINFO@%$MAKEINFO%g
23269 s%@install_sh@%$install_sh%g
23270 s%@AMTAR@%$AMTAR%g
23271 s%@AWK@%$AWK%g
23272 s%@AMTARFLAGS@%$AMTARFLAGS%g
23273 s%@SET_MAKE@%$SET_MAKE%g
23274 s%@OPENLDAP_LIBVERSION@%$OPENLDAP_LIBVERSION%g
23275 s%@OPENLDAP_RELEASE_DATE@%$OPENLDAP_RELEASE_DATE%g
23276 s%@top_builddir@%$top_builddir%g
23277 s%@ldap_subdir@%$ldap_subdir%g
23278 s%@CC@%$CC%g
23279 s%@AR@%$AR%g
23280 s%@LN_S@%$LN_S%g
23281 s%@OBJEXT@%$OBJEXT%g
23282 s%@EXEEXT@%$EXEEXT%g
23283 s%@ECHO@%$ECHO%g
23284 s%@RANLIB@%$RANLIB%g
23285 s%@STRIP@%$STRIP%g
23286 s%@DLLTOOL@%$DLLTOOL%g
23287 s%@AS@%$AS%g
23288 s%@OBJDUMP@%$OBJDUMP%g
23289 s%@CPP@%$CPP%g
23290 s%@LIBTOOL@%$LIBTOOL%g
23291 s%@LN_H@%$LN_H%g
23292 s%@SENDMAIL@%$SENDMAIL%g
23293 s%@EDITOR@%$EDITOR%g
23294 s%@PERLBIN@%$PERLBIN%g
23295 s%@OL_MKDEP@%$OL_MKDEP%g
23296 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
23297 s%@LIBOBJS@%$LIBOBJS%g
23298 s%@LIBSRCS@%$LIBSRCS%g
23299 s%@PLAT@%$PLAT%g
23300 s%@BUILD_LIBS_DYNAMIC@%$BUILD_LIBS_DYNAMIC%g
23301 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
23302 s%@BUILD_BDB@%$BUILD_BDB%g
23303 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
23304 s%@BUILD_LDAP@%$BUILD_LDAP%g
23305 s%@BUILD_LDBM@%$BUILD_LDBM%g
23306 s%@BUILD_META@%$BUILD_META%g
23307 s%@BUILD_MONITOR@%$BUILD_MONITOR%g
23308 s%@BUILD_NULL@%$BUILD_NULL%g
23309 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
23310 s%@BUILD_PERL@%$BUILD_PERL%g
23311 s%@BUILD_SHELL@%$BUILD_SHELL%g
23312 s%@BUILD_SQL@%$BUILD_SQL%g
23313 s%@BUILD_TCL@%$BUILD_TCL%g
23314 s%@BUILD_BDB_DYNAMIC@%$BUILD_BDB_DYNAMIC%g
23315 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
23316 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
23317 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
23318 s%@BUILD_META_DYNAMIC@%$BUILD_META_DYNAMIC%g
23319 s%@BUILD_MONITOR_DYNAMIC@%$BUILD_MONITOR_DYNAMIC%g
23320 s%@BUILD_NULL_DYNAMIC@%$BUILD_NULL_DYNAMIC%g
23321 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
23322 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
23323 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
23324 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
23325 s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g
23326 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
23327 s%@LDBM_LIB@%$LDBM_LIB%g
23328 s%@LDAP_LIBS@%$LDAP_LIBS%g
23329 s%@LDIF_LIBS@%$LDIF_LIBS%g
23330 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
23331 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
23332 s%@LDBM_LIBS@%$LDBM_LIBS%g
23333 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
23334 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
23335 s%@WRAP_LIBS@%$WRAP_LIBS%g
23336 s%@MOD_TCL_LIB@%$MOD_TCL_LIB%g
23337 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
23338 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
23339 s%@SLAPD_STATIC_BACKENDS@%$SLAPD_STATIC_BACKENDS%g
23340 s%@SLAPD_DYNAMIC_BACKENDS@%$SLAPD_DYNAMIC_BACKENDS%g
23341 s%@PERL_CPPFLAGS@%$PERL_CPPFLAGS%g
23342 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
23343 s%@MOD_PERL_LDFLAGS@%$MOD_PERL_LDFLAGS%g
23344 s%@KRB4_LIBS@%$KRB4_LIBS%g
23345 s%@KRB5_LIBS@%$KRB5_LIBS%g
23346 s%@READLINE_LIBS@%$READLINE_LIBS%g
23347 s%@SASL_LIBS@%$SASL_LIBS%g
23348 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
23349 s%@TLS_LIBS@%$TLS_LIBS%g
23350 s%@MODULES_LIBS@%$MODULES_LIBS%g
23351 s%@AUTH_LIBS@%$AUTH_LIBS%g
23352 s%@SLAPD_SLP_LIBS@%$SLAPD_SLP_LIBS%g
23353 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
23354 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
23355 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
23356
23357 CEOF
23358 EOF
23359
23360 cat >> $CONFIG_STATUS <<\EOF
23361
23362 # Split the substitutions into bite-sized pieces for seds with
23363 # small command number limits, like on Digital OSF/1 and HP-UX.
23364 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
23365 ac_file=1 # Number of current file.
23366 ac_beg=1 # First line for current file.
23367 ac_end=$ac_max_sed_cmds # Line after last line for current file.
23368 ac_more_lines=:
23369 ac_sed_cmds=""
23370 while $ac_more_lines; do
23371   if test $ac_beg -gt 1; then
23372     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
23373   else
23374     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
23375   fi
23376   if test ! -s conftest.s$ac_file; then
23377     ac_more_lines=false
23378     rm -f conftest.s$ac_file
23379   else
23380     if test -z "$ac_sed_cmds"; then
23381       ac_sed_cmds="sed -f conftest.s$ac_file"
23382     else
23383       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
23384     fi
23385     ac_file=`expr $ac_file + 1`
23386     ac_beg=$ac_end
23387     ac_end=`expr $ac_end + $ac_max_sed_cmds`
23388   fi
23389 done
23390 if test -z "$ac_sed_cmds"; then
23391   ac_sed_cmds=cat
23392 fi
23393 EOF
23394
23395 cat >> $CONFIG_STATUS <<EOF
23396
23397 CONFIG_FILES=\${CONFIG_FILES-"\
23398 Makefile:build/top.mk:Makefile.in:build/dir.mk \
23399 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
23400 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
23401 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
23402 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
23403 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
23404 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
23405 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
23406 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
23407 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
23408 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
23409 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
23410 include/Makefile:build/top.mk:include/Makefile.in \
23411 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
23412 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
23413 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23414 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23415 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
23416 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
23417 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
23418 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
23419 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
23420 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
23421 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
23422 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
23423 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
23424 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
23425 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
23426 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
23427 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
23428 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
23429 servers/slapd/back-null/Makefile:build/top.mk:servers/slapd/back-null/Makefile.in:build/mod.mk \
23430 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
23431 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
23432 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
23433 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
23434 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
23435 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
23436 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
23437 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
23438 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
23439 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
23440 "}
23441 EOF
23442 cat >> $CONFIG_STATUS <<\EOF
23443 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
23444   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23445   case "$ac_file" in
23446   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
23447        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
23448   *) ac_file_in="${ac_file}.in" ;;
23449   esac
23450
23451   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
23452
23453   # Remove last slash and all that follows it.  Not all systems have dirname.
23454   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
23455   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23456     # The file is in a subdirectory.
23457     test ! -d "$ac_dir" && mkdir "$ac_dir"
23458     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
23459     # A "../" for each directory in $ac_dir_suffix.
23460     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
23461   else
23462     ac_dir_suffix= ac_dots=
23463   fi
23464
23465   case "$ac_given_srcdir" in
23466   .)  srcdir=.
23467       if test -z "$ac_dots"; then top_srcdir=.
23468       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
23469   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
23470   *) # Relative path.
23471     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
23472     top_srcdir="$ac_dots$ac_given_srcdir" ;;
23473   esac
23474
23475   case "$ac_given_INSTALL" in
23476   [/$]*) INSTALL="$ac_given_INSTALL" ;;
23477   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
23478   esac
23479
23480   echo creating "$ac_file"
23481   rm -f "$ac_file"
23482   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
23483   case "$ac_file" in
23484   *[Mm]akefile*) ac_comsub="1i\\
23485 # $configure_input" ;;
23486   *) ac_comsub= ;;
23487   esac
23488
23489   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
23490   sed -e "$ac_comsub
23491 s%@configure_input@%$configure_input%g
23492 s%@srcdir@%$srcdir%g
23493 s%@top_srcdir@%$top_srcdir%g
23494 s%@INSTALL@%$INSTALL%g
23495 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
23496 fi; done
23497 rm -f conftest.s*
23498
23499 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
23500 # NAME is the cpp macro being defined and VALUE is the value it is being given.
23501 #
23502 # ac_d sets the value in "#define NAME VALUE" lines.
23503 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
23504 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
23505 ac_dC='\3'
23506 ac_dD='%g'
23507 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
23508 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23509 ac_uB='\([      ]\)%\1#\2define\3'
23510 ac_uC=' '
23511 ac_uD='\4%g'
23512 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
23513 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23514 ac_eB='$%\1#\2define\3'
23515 ac_eC=' '
23516 ac_eD='%g'
23517
23518 if test "${CONFIG_HEADERS+set}" != set; then
23519 EOF
23520 cat >> $CONFIG_STATUS <<EOF
23521   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
23522 EOF
23523 cat >> $CONFIG_STATUS <<\EOF
23524 fi
23525 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
23526   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23527   case "$ac_file" in
23528   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
23529        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
23530   *) ac_file_in="${ac_file}.in" ;;
23531   esac
23532
23533   echo creating $ac_file
23534
23535   rm -f conftest.frag conftest.in conftest.out
23536   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
23537   cat $ac_file_inputs > conftest.in
23538
23539 EOF
23540
23541 # Transform confdefs.h into a sed script conftest.vals that substitutes
23542 # the proper values into config.h.in to produce config.h.  And first:
23543 # Protect against being on the right side of a sed subst in config.status.
23544 # Protect against being in an unquoted here document in config.status.
23545 rm -f conftest.vals
23546 cat > conftest.hdr <<\EOF
23547 s/[\\&%]/\\&/g
23548 s%[\\$`]%\\&%g
23549 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
23550 s%ac_d%ac_u%gp
23551 s%ac_u%ac_e%gp
23552 EOF
23553 sed -n -f conftest.hdr confdefs.h > conftest.vals
23554 rm -f conftest.hdr
23555
23556 # This sed command replaces #undef with comments.  This is necessary, for
23557 # example, in the case of _POSIX_SOURCE, which is predefined and required
23558 # on some systems where configure will not decide to define it.
23559 cat >> conftest.vals <<\EOF
23560 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
23561 EOF
23562
23563 # Break up conftest.vals because some shells have a limit on
23564 # the size of here documents, and old seds have small limits too.
23565
23566 rm -f conftest.tail
23567 while :
23568 do
23569   ac_lines=`grep -c . conftest.vals`
23570   # grep -c gives empty output for an empty file on some AIX systems.
23571   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
23572   # Write a limited-size here document to conftest.frag.
23573   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
23574   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
23575   echo 'CEOF
23576   sed -f conftest.frag conftest.in > conftest.out
23577   rm -f conftest.in
23578   mv conftest.out conftest.in
23579 ' >> $CONFIG_STATUS
23580   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
23581   rm -f conftest.vals
23582   mv conftest.tail conftest.vals
23583 done
23584 rm -f conftest.vals
23585
23586 cat >> $CONFIG_STATUS <<\EOF
23587   rm -f conftest.frag conftest.h
23588   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
23589   cat conftest.in >> conftest.h
23590   rm -f conftest.in
23591   if cmp -s $ac_file conftest.h 2>/dev/null; then
23592     echo "$ac_file is unchanged"
23593     rm -f conftest.h
23594   else
23595     # Remove last slash and all that follows it.  Not all systems have dirname.
23596       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
23597       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23598       # The file is in a subdirectory.
23599       test ! -d "$ac_dir" && mkdir "$ac_dir"
23600     fi
23601     rm -f $ac_file
23602     mv conftest.h $ac_file
23603   fi
23604 fi; done
23605
23606 EOF
23607 cat >> $CONFIG_STATUS <<EOF
23608
23609 EOF
23610 cat >> $CONFIG_STATUS <<\EOF
23611
23612 date > stamp-h
23613 echo Please run \"make depend\" to build dependencies
23614
23615 exit 0
23616 EOF
23617 chmod +x $CONFIG_STATUS
23618 rm -fr confdefs* $ac_clean_files
23619 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
23620