]> git.sur5r.net Git - openldap/blob - configure
charray fix from HEAD
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.408.2.1 2002/02/18 19:49:46 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-kbind          enable LDAPv2+ Kerberos IV bind (deprecated) [no]"
42 ac_help="$ac_help
43   --enable-ipv6           enable IPv6 support [auto]"
44 ac_help="$ac_help
45   --enable-local          enable AF_LOCAL (AF_UNIX) socket support [auto]"
46 ac_help="$ac_help
47   --enable-rewrite        enable rewrite [no]"
48 ac_help="$ac_help
49   --enable-x-compile      enable cross compiling [no]"
50 ac_help="$ac_help
51   --with-cyrus-sasl       with Cyrus SASL support [auto]"
52 ac_help="$ac_help
53   --with-fetch            with fetch URL support [auto]"
54 ac_help="$ac_help
55   --with-kerberos         with Kerberos support [auto]"
56 ac_help="$ac_help
57   --with-readline         with readline support [auto]"
58 ac_help="$ac_help
59   --with-threads          with threads [auto]"
60 ac_help="$ac_help
61   --with-tls              with TLS/SSL support [auto]"
62 ac_help="$ac_help
63   --with-yielding-select  with implicitly yielding select [auto]"
64 ac_help="$ac_help
65
66 SLAPD (Standalone LDAP Daemon) Options:"
67 ac_help="$ac_help
68   --enable-slapd          enable building slapd [yes]"
69 ac_help="$ac_help
70     --enable-aci          enable per-object ACIs (experimental) [no]"
71 ac_help="$ac_help
72     --enable-cleartext    enable cleartext passwords [yes]"
73 ac_help="$ac_help
74     --enable-crypt        enable crypt(3) passwords [no]"
75 ac_help="$ac_help
76     --enable-dynamic      enable linking built binaries with dynamic libs [no]"
77 ac_help="$ac_help
78     --enable-kpasswd      enable Kerberos password verification [no]"
79 ac_help="$ac_help
80     --enable-lmpasswd     enable LAN Manager passwords [no]"
81 ac_help="$ac_help
82     --enable-spasswd      enable (Cyrus) SASL password verification [no]"
83 ac_help="$ac_help
84     --enable-modules      enable dynamic module support [no]"
85 ac_help="$ac_help
86     --enable-phonetic     enable phonetic/soundex [no]"
87 ac_help="$ac_help
88     --enable-rlookups     enable reverse lookups [no]"
89 ac_help="$ac_help
90     --enable-slp          enable SLPv2 support [no]"
91 ac_help="$ac_help
92     --enable-wrappers     enable tcp wrapper support [no]"
93 ac_help="$ac_help
94     --enable-bdb          enable Berkeley DB backend [yes]"
95 ac_help="$ac_help
96     --with-bdb-module     module type [static]"
97 ac_help="$ac_help
98     --enable-dnssrv       enable dnssrv backend [no]"
99 ac_help="$ac_help
100     --with-dnssrv-module  module type [static]"
101 ac_help="$ac_help
102     --enable-ldap         enable ldap backend [no]"
103 ac_help="$ac_help
104     --with-ldap-module    module type [static]"
105 ac_help="$ac_help
106     --enable-ldbm         enable ldbm backend [no]"
107 ac_help="$ac_help
108     --with-ldbm-api       with LDBM API [auto]"
109 ac_help="$ac_help
110     --with-ldbm-module    module type [static]"
111 ac_help="$ac_help
112     --with-ldbm-type      use LDBM type [auto]"
113 ac_help="$ac_help
114     --enable-meta         enable metadirectory backend [no]"
115 ac_help="$ac_help
116     --with-meta-module    module type [static]"
117 ac_help="$ac_help
118     --enable-monitor      enable monitor backend [no]"
119 ac_help="$ac_help
120     --with-monitor-module module type [static]"
121 ac_help="$ac_help
122     --enable-passwd       enable passwd backend [no]"
123 ac_help="$ac_help
124     --with-passwd-module  module type [static]"
125 ac_help="$ac_help
126     --enable-perl         enable perl backend [no]"
127 ac_help="$ac_help
128     --with-perl-module    module type [static]"
129 ac_help="$ac_help
130     --enable-shell        enable shell backend [no]"
131 ac_help="$ac_help
132     --with-shell-module   module type [static]"
133 ac_help="$ac_help
134     --enable-sql          enable sql backend [no]"
135 ac_help="$ac_help
136     --with-sql-module     module type [static]"
137 ac_help="$ac_help
138
139 SLURPD (Replication Daemon) Options:"
140 ac_help="$ac_help
141   --enable-slurpd         enable building slurpd [auto]"
142 ac_help="$ac_help
143
144 Library Generation & Linking Options"
145 ac_help="$ac_help
146   --enable-static[=PKGS]  build static libraries [default=yes]"
147 ac_help="$ac_help
148   --enable-shared[=PKGS]  build shared libraries [default=yes]"
149 ac_help="$ac_help
150   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
151 ac_help="$ac_help
152   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
153
154 # Find the correct PATH separator.  Usually this is `:', but
155 # DJGPP uses `;' like DOS.
156 if test "X${PATH_SEPARATOR+set}" != Xset; then
157   UNAME=${UNAME-`uname 2>/dev/null`}
158   case X$UNAME in
159     *-DOS) lt_cv_sys_path_separator=';' ;;
160     *)     lt_cv_sys_path_separator=':' ;;
161   esac
162   PATH_SEPARATOR=$lt_cv_sys_path_separator
163 fi
164
165
166 # Check that we are running under the correct shell.
167 SHELL=${CONFIG_SHELL-/bin/sh}
168
169 case X$ECHO in
170 X*--fallback-echo)
171   # Remove one level of quotation (which was required for Make).
172   ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
173   ;;
174 esac
175
176 echo=${ECHO-echo}
177 if test "X$1" = X--no-reexec; then
178   # Discard the --no-reexec flag, and continue.
179   shift
180 elif test "X$1" = X--fallback-echo; then
181   # Avoid inline document here, it may be left over
182   :
183 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
184   # Yippee, $echo works!
185   :
186 else
187   # Restart under the correct shell.
188   exec $SHELL "$0" --no-reexec ${1+"$@"}
189 fi
190
191 if test "X$1" = X--fallback-echo; then
192   # used as fallback echo
193   shift
194   cat <<EOF
195
196 EOF
197   exit 0
198 fi
199
200 # The HP-UX ksh and POSIX shell print the target directory to stdout
201 # if CDPATH is set.
202 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
203
204 if test -z "$ECHO"; then
205 if test "X${echo_test_string+set}" != Xset; then
206 # find a string as large as possible, as long as the shell can cope with it
207   for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
208     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
209     if (echo_test_string="`eval $cmd`") 2>/dev/null &&
210        echo_test_string="`eval $cmd`" &&
211        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
212     then
213       break
214     fi
215   done
216 fi
217
218 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
219    echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
220    test "X$echo_testing_string" = "X$echo_test_string"; then
221   :
222 else
223   # The Solaris, AIX, and Digital Unix default echo programs unquote
224   # backslashes.  This makes it impossible to quote backslashes using
225   #   echo "$something" | sed 's/\\/\\\\/g'
226   #
227   # So, first we look for a working echo in the user's PATH.
228
229   IFS="${IFS=   }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
230   for dir in $PATH /usr/ucb; do
231     if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
232        test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
233        echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
234        test "X$echo_testing_string" = "X$echo_test_string"; then
235       echo="$dir/echo"
236       break
237     fi
238   done
239   IFS="$save_ifs"
240
241   if test "X$echo" = Xecho; then
242     # We didn't find a better echo, so look for alternatives.
243     if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
244        echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
245        test "X$echo_testing_string" = "X$echo_test_string"; then
246       # This shell has a builtin print -r that does the trick.
247       echo='print -r'
248     elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
249          test "X$CONFIG_SHELL" != X/bin/ksh; then
250       # If we have ksh, try running configure again with it.
251       ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
252       export ORIGINAL_CONFIG_SHELL
253       CONFIG_SHELL=/bin/ksh
254       export CONFIG_SHELL
255       exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
256     else
257       # Try using printf.
258       echo='printf %s\n'
259       if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
260          echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
261          test "X$echo_testing_string" = "X$echo_test_string"; then
262         # Cool, printf works
263         :
264       elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
265            test "X$echo_testing_string" = 'X\t' &&
266            echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
267            test "X$echo_testing_string" = "X$echo_test_string"; then
268         CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
269         export CONFIG_SHELL
270         SHELL="$CONFIG_SHELL"
271         export SHELL
272         echo="$CONFIG_SHELL $0 --fallback-echo"
273       elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
274            test "X$echo_testing_string" = 'X\t' &&
275            echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
276            test "X$echo_testing_string" = "X$echo_test_string"; then
277         echo="$CONFIG_SHELL $0 --fallback-echo"
278       else
279         # maybe with a smaller string...
280         prev=:
281
282         for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
283           if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
284           then
285             break
286           fi
287           prev="$cmd"
288         done
289
290         if test "$prev" != 'sed 50q "$0"'; then
291           echo_test_string=`eval $prev`
292           export echo_test_string
293           exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
294         else
295           # Oops.  We lost completely, so just stick with echo.
296           echo=echo
297         fi
298       fi
299     fi
300   fi
301 fi
302 fi
303
304 # Copy echo and quote the copy suitably for passing to libtool from
305 # the Makefile, instead of quoting the original, which is used later.
306 ECHO=$echo
307 if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
308    ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
309 fi
310
311
312 ac_help="$ac_help
313   --disable-libtool-lock  avoid locking (might break parallel builds)"
314 ac_help="$ac_help
315   --with-pic              try to use only PIC/non-PIC objects [default=use both]"
316 ac_help="$ac_help
317
318 See INSTALL file for further details."
319
320 # Initialize some variables set by options.
321 # The variables have the same names as the options, with
322 # dashes changed to underlines.
323 build=NONE
324 cache_file=./config.cache
325 exec_prefix=NONE
326 host=NONE
327 no_create=
328 nonopt=NONE
329 no_recursion=
330 prefix=NONE
331 program_prefix=NONE
332 program_suffix=NONE
333 program_transform_name=s,x,x,
334 silent=
335 site=
336 srcdir=
337 target=NONE
338 verbose=
339 x_includes=NONE
340 x_libraries=NONE
341 bindir='${exec_prefix}/bin'
342 sbindir='${exec_prefix}/sbin'
343 libexecdir='${exec_prefix}/libexec'
344 datadir='${prefix}/share'
345 sysconfdir='${prefix}/etc'
346 sharedstatedir='${prefix}/com'
347 localstatedir='${prefix}/var'
348 libdir='${exec_prefix}/lib'
349 includedir='${prefix}/include'
350 oldincludedir='/usr/include'
351 infodir='${prefix}/info'
352 mandir='${prefix}/man'
353
354 # Initialize some other variables.
355 subdirs=
356 MFLAGS= MAKEFLAGS=
357 SHELL=${CONFIG_SHELL-/bin/sh}
358 # Maximum number of lines to put in a shell here document.
359 ac_max_here_lines=12
360
361 ac_prev=
362 for ac_option
363 do
364
365   # If the previous option needs an argument, assign it.
366   if test -n "$ac_prev"; then
367     eval "$ac_prev=\$ac_option"
368     ac_prev=
369     continue
370   fi
371
372   case "$ac_option" in
373   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
374   *) ac_optarg= ;;
375   esac
376
377   # Accept the important Cygnus configure options, so we can diagnose typos.
378
379   case "$ac_option" in
380
381   -bindir | --bindir | --bindi | --bind | --bin | --bi)
382     ac_prev=bindir ;;
383   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
384     bindir="$ac_optarg" ;;
385
386   -build | --build | --buil | --bui | --bu)
387     ac_prev=build ;;
388   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
389     build="$ac_optarg" ;;
390
391   -cache-file | --cache-file | --cache-fil | --cache-fi \
392   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
393     ac_prev=cache_file ;;
394   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
395   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
396     cache_file="$ac_optarg" ;;
397
398   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
399     ac_prev=datadir ;;
400   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
401   | --da=*)
402     datadir="$ac_optarg" ;;
403
404   -disable-* | --disable-*)
405     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
406     # Reject names that are not valid shell variable names.
407     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
408       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
409     fi
410     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
411     eval "enable_${ac_feature}=no" ;;
412
413   -enable-* | --enable-*)
414     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
415     # Reject names that are not valid shell variable names.
416     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
417       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
418     fi
419     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
420     case "$ac_option" in
421       *=*) ;;
422       *) ac_optarg=yes ;;
423     esac
424     eval "enable_${ac_feature}='$ac_optarg'" ;;
425
426   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
427   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
428   | --exec | --exe | --ex)
429     ac_prev=exec_prefix ;;
430   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
431   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
432   | --exec=* | --exe=* | --ex=*)
433     exec_prefix="$ac_optarg" ;;
434
435   -gas | --gas | --ga | --g)
436     # Obsolete; use --with-gas.
437     with_gas=yes ;;
438
439   -help | --help | --hel | --he)
440     # Omit some internal or obsolete options to make the list less imposing.
441     # This message is too long to be a string in the A/UX 3.1 sh.
442     cat << EOF
443 Usage: configure [options] [host]
444 Options: [defaults in brackets after descriptions]
445 Configuration:
446   --cache-file=FILE       cache test results in FILE
447   --help                  print this message
448   --no-create             do not create output files
449   --quiet, --silent       do not print \`checking...' messages
450   --version               print the version of autoconf that created configure
451 Directory and file names:
452   --prefix=PREFIX         install architecture-independent files in PREFIX
453                           [$ac_default_prefix]
454   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
455                           [same as prefix]
456   --bindir=DIR            user executables in DIR [EPREFIX/bin]
457   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
458   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
459   --datadir=DIR           read-only architecture-independent data in DIR
460                           [PREFIX/share]
461   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
462   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
463                           [PREFIX/com]
464   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
465   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
466   --includedir=DIR        C header files in DIR [PREFIX/include]
467   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
468   --infodir=DIR           info documentation in DIR [PREFIX/info]
469   --mandir=DIR            man documentation in DIR [PREFIX/man]
470   --srcdir=DIR            find the sources in DIR [configure dir or ..]
471   --program-prefix=PREFIX prepend PREFIX to installed program names
472   --program-suffix=SUFFIX append SUFFIX to installed program names
473   --program-transform-name=PROGRAM
474                           run sed PROGRAM on installed program names
475 EOF
476     cat << EOF
477 Host type:
478   --build=BUILD           configure for building on BUILD [BUILD=HOST]
479   --host=HOST             configure for HOST [guessed]
480   --target=TARGET         configure for TARGET [TARGET=HOST]
481 Features and packages:
482   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
483   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
484   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
485   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
486   --x-includes=DIR        X include files are in DIR
487   --x-libraries=DIR       X library files are in DIR
488 EOF
489     if test -n "$ac_help"; then
490       echo "--enable and --with options recognized:$ac_help"
491     fi
492     exit 0 ;;
493
494   -host | --host | --hos | --ho)
495     ac_prev=host ;;
496   -host=* | --host=* | --hos=* | --ho=*)
497     host="$ac_optarg" ;;
498
499   -includedir | --includedir | --includedi | --included | --include \
500   | --includ | --inclu | --incl | --inc)
501     ac_prev=includedir ;;
502   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
503   | --includ=* | --inclu=* | --incl=* | --inc=*)
504     includedir="$ac_optarg" ;;
505
506   -infodir | --infodir | --infodi | --infod | --info | --inf)
507     ac_prev=infodir ;;
508   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
509     infodir="$ac_optarg" ;;
510
511   -libdir | --libdir | --libdi | --libd)
512     ac_prev=libdir ;;
513   -libdir=* | --libdir=* | --libdi=* | --libd=*)
514     libdir="$ac_optarg" ;;
515
516   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
517   | --libexe | --libex | --libe)
518     ac_prev=libexecdir ;;
519   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
520   | --libexe=* | --libex=* | --libe=*)
521     libexecdir="$ac_optarg" ;;
522
523   -localstatedir | --localstatedir | --localstatedi | --localstated \
524   | --localstate | --localstat | --localsta | --localst \
525   | --locals | --local | --loca | --loc | --lo)
526     ac_prev=localstatedir ;;
527   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
528   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
529   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
530     localstatedir="$ac_optarg" ;;
531
532   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
533     ac_prev=mandir ;;
534   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
535     mandir="$ac_optarg" ;;
536
537   -nfp | --nfp | --nf)
538     # Obsolete; use --without-fp.
539     with_fp=no ;;
540
541   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
542   | --no-cr | --no-c)
543     no_create=yes ;;
544
545   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
546   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
547     no_recursion=yes ;;
548
549   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
550   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
551   | --oldin | --oldi | --old | --ol | --o)
552     ac_prev=oldincludedir ;;
553   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
554   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
555   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
556     oldincludedir="$ac_optarg" ;;
557
558   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
559     ac_prev=prefix ;;
560   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
561     prefix="$ac_optarg" ;;
562
563   -program-prefix | --program-prefix | --program-prefi | --program-pref \
564   | --program-pre | --program-pr | --program-p)
565     ac_prev=program_prefix ;;
566   -program-prefix=* | --program-prefix=* | --program-prefi=* \
567   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
568     program_prefix="$ac_optarg" ;;
569
570   -program-suffix | --program-suffix | --program-suffi | --program-suff \
571   | --program-suf | --program-su | --program-s)
572     ac_prev=program_suffix ;;
573   -program-suffix=* | --program-suffix=* | --program-suffi=* \
574   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
575     program_suffix="$ac_optarg" ;;
576
577   -program-transform-name | --program-transform-name \
578   | --program-transform-nam | --program-transform-na \
579   | --program-transform-n | --program-transform- \
580   | --program-transform | --program-transfor \
581   | --program-transfo | --program-transf \
582   | --program-trans | --program-tran \
583   | --progr-tra | --program-tr | --program-t)
584     ac_prev=program_transform_name ;;
585   -program-transform-name=* | --program-transform-name=* \
586   | --program-transform-nam=* | --program-transform-na=* \
587   | --program-transform-n=* | --program-transform-=* \
588   | --program-transform=* | --program-transfor=* \
589   | --program-transfo=* | --program-transf=* \
590   | --program-trans=* | --program-tran=* \
591   | --progr-tra=* | --program-tr=* | --program-t=*)
592     program_transform_name="$ac_optarg" ;;
593
594   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
595   | -silent | --silent | --silen | --sile | --sil)
596     silent=yes ;;
597
598   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
599     ac_prev=sbindir ;;
600   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
601   | --sbi=* | --sb=*)
602     sbindir="$ac_optarg" ;;
603
604   -sharedstatedir | --sharedstatedir | --sharedstatedi \
605   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
606   | --sharedst | --shareds | --shared | --share | --shar \
607   | --sha | --sh)
608     ac_prev=sharedstatedir ;;
609   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
610   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
611   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
612   | --sha=* | --sh=*)
613     sharedstatedir="$ac_optarg" ;;
614
615   -site | --site | --sit)
616     ac_prev=site ;;
617   -site=* | --site=* | --sit=*)
618     site="$ac_optarg" ;;
619
620   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
621     ac_prev=srcdir ;;
622   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
623     srcdir="$ac_optarg" ;;
624
625   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
626   | --syscon | --sysco | --sysc | --sys | --sy)
627     ac_prev=sysconfdir ;;
628   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
629   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
630     sysconfdir="$ac_optarg" ;;
631
632   -target | --target | --targe | --targ | --tar | --ta | --t)
633     ac_prev=target ;;
634   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
635     target="$ac_optarg" ;;
636
637   -v | -verbose | --verbose | --verbos | --verbo | --verb)
638     verbose=yes ;;
639
640   -version | --version | --versio | --versi | --vers)
641     echo "configure generated by autoconf version 2.13.1"
642     exit 0 ;;
643
644   -with-* | --with-*)
645     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
646     # Reject names that are not valid shell variable names.
647     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
648       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
649     fi
650     ac_package=`echo $ac_package| sed 's/-/_/g'`
651     case "$ac_option" in
652       *=*) ;;
653       *) ac_optarg=yes ;;
654     esac
655     eval "with_${ac_package}='$ac_optarg'" ;;
656
657   -without-* | --without-*)
658     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
659     # Reject names that are not valid shell variable names.
660     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
661       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
662     fi
663     ac_package=`echo $ac_package| sed 's/-/_/g'`
664     eval "with_${ac_package}=no" ;;
665
666   --x)
667     # Obsolete; use --with-x.
668     with_x=yes ;;
669
670   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
671   | --x-incl | --x-inc | --x-in | --x-i)
672     ac_prev=x_includes ;;
673   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
674   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
675     x_includes="$ac_optarg" ;;
676
677   -x-libraries | --x-libraries | --x-librarie | --x-librari \
678   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
679     ac_prev=x_libraries ;;
680   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
681   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
682     x_libraries="$ac_optarg" ;;
683
684   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
685     ;;
686
687   *)
688     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
689       echo "configure: warning: $ac_option: invalid host type" 1>&2
690     fi
691     if test "x$nonopt" != xNONE; then
692       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
693     fi
694     nonopt="$ac_option"
695     ;;
696
697   esac
698 done
699
700 if test -n "$ac_prev"; then
701   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
702 fi
703
704 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
705
706 # File descriptor usage:
707 # 0 standard input
708 # 1 file creation
709 # 2 errors and warnings
710 # 3 some systems may open it to /dev/tty
711 # 4 used on the Kubota Titan
712 # 6 checking for... messages and results
713 # 5 compiler messages saved in config.log
714 if test "$silent" = yes; then
715   exec 6>/dev/null
716 else
717   exec 6>&1
718 fi
719 exec 5>./config.log
720
721 echo "\
722 This file contains any messages produced by compilers while
723 running configure, to aid debugging if configure makes a mistake.
724 " 1>&5
725
726 # Strip out --no-create and --no-recursion so they do not pile up.
727 # Also quote any args containing shell metacharacters.
728 ac_configure_args=
729 for ac_arg
730 do
731   case "$ac_arg" in
732   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
733   | --no-cr | --no-c) ;;
734   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
735   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
736   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
737   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
738   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
739   esac
740 done
741
742 # NLS nuisances.
743 # Only set these to C if already set.  These must not be set unconditionally
744 # because not all systems understand e.g. LANG=C (notably SCO).
745 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
746 # Non-C LC_CTYPE values break the ctype check.
747 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
748 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
749 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
750 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
751
752 # confdefs.h avoids OS command line length limits that DEFS can exceed.
753 rm -rf conftest* confdefs.h
754 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
755 echo > confdefs.h
756
757 # A filename unique to this package, relative to the directory that
758 # configure is in, which we can look for to find out if srcdir is correct.
759 ac_unique_file=build/version.sh
760
761 # Find the source files, if location was not specified.
762 if test -z "$srcdir"; then
763   ac_srcdir_defaulted=yes
764   # Try the directory containing this script, then its parent.
765   ac_prog=$0
766   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
767   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
768   srcdir=$ac_confdir
769   if test ! -r $srcdir/$ac_unique_file; then
770     srcdir=..
771   fi
772 else
773   ac_srcdir_defaulted=no
774 fi
775 if test ! -r $srcdir/$ac_unique_file; then
776   if test "$ac_srcdir_defaulted" = yes; then
777     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
778   else
779     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
780   fi
781 fi
782 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
783
784 # Prefer explicitly selected file to automatically selected ones.
785 if test -z "$CONFIG_SITE"; then
786   if test "x$prefix" != xNONE; then
787     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
788   else
789     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
790   fi
791 fi
792 for ac_site_file in $CONFIG_SITE; do
793   if test -r "$ac_site_file"; then
794     echo "loading site script $ac_site_file"
795     . "$ac_site_file"
796   fi
797 done
798
799
800 ac_ext=c
801 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
802 ac_cpp='$CPP $CPPFLAGS'
803 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
804 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
805 cross_compiling=$ac_cv_prog_cc_cross
806
807 ac_exeext=
808 ac_objext=o
809 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
810   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
811   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
812     ac_n= ac_c='
813 ' ac_t='        '
814   else
815     ac_n=-n ac_c= ac_t=
816   fi
817 else
818   ac_n= ac_c='\c' ac_t=
819 fi
820
821
822 # set unset (borrowed from autoconf 2.49c)
823 if (OL_FOO=OL_FOO; unset OL_FOO) >/dev/null 2>&1; then
824   ol_unset=unset
825 else
826   ol_unset=false
827 fi
828 # unset CDPATH
829 $ol_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
830
831 ac_aux_dir=
832 for ac_dir in build $srcdir/build; do
833   if test -f $ac_dir/install-sh; then
834     ac_aux_dir=$ac_dir
835     ac_install_sh="$ac_aux_dir/install-sh -c"
836     break
837   elif test -f $ac_dir/install.sh; then
838     ac_aux_dir=$ac_dir
839     ac_install_sh="$ac_aux_dir/install.sh -c"
840     break
841   elif test -f $ac_dir/shtool; then
842     ac_aux_dir=$ac_dir
843     ac_install_sh="$ac_aux_dir/shtool install -c"
844     break
845   fi
846 done
847 if test -z "$ac_aux_dir"; then
848   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
849 fi
850 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
851 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
852 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
853
854 eval `$ac_aux_dir/version.sh`
855 if test -z "$OL_STRING"; then
856         { echo "configure: error: could not determine version" 1>&2; exit 1; }
857 fi
858
859 if test -f "$ac_aux_dir/shtool" -a ! -d $ac_aux_dir/shtool; then
860         ac_cv_shtool="$ac_aux_dir/shtool"
861 else
862         { echo "configure: error: no shtool found in $ac_aux_dir" 1>&2; exit 1; }
863 fi
864
865 SHTOOL="$ac_cv_shtool"
866
867 TB=`$SHTOOL echo -e %B`
868 TN=`$SHTOOL echo -e %b`
869
870 echo "Configuring $TB$OL_STRING$TN ..."
871
872
873 echo $ac_n "checking host system type""... $ac_c" 1>&6
874 echo "configure:875: checking host system type" >&5
875 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
876
877 # Make sure we can run config.sub.
878   if $ac_config_sub sun4 >/dev/null 2>&1; then :
879     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
880   fi
881
882   ac_cv_host_alias=$host
883   case "$ac_cv_host_alias" in
884   NONE)
885     case $nonopt in
886     NONE)
887       if ac_cv_host_alias=`$ac_config_guess`; then :
888       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
889       fi ;;
890     *) ac_cv_host_alias=$nonopt ;;
891     esac ;;
892   esac
893
894   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
895   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
896   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
897   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
898 else
899   echo $ac_n "(cached) $ac_c" 1>&6
900 fi
901
902 echo "$ac_t""$ac_cv_host" 1>&6
903
904 host=$ac_cv_host
905 host_alias=$ac_cv_host_alias
906 host_cpu=$ac_cv_host_cpu
907 host_vendor=$ac_cv_host_vendor
908 host_os=$ac_cv_host_os
909
910
911
912
913
914 echo $ac_n "checking target system type""... $ac_c" 1>&6
915 echo "configure:916: checking target system type" >&5
916 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
917
918 # Make sure we can run config.sub.
919   if $ac_config_sub sun4 >/dev/null 2>&1; then :
920     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
921   fi
922
923   ac_cv_target_alias=$target
924   case "$ac_cv_target_alias" in
925   NONE)
926     case $nonopt in
927     NONE)
928       ac_cv_target_alias=$host_alias ;;
929
930     *) ac_cv_target_alias=$nonopt ;;
931     esac ;;
932   esac
933
934   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
935   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
936   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
937   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
938 else
939   echo $ac_n "(cached) $ac_c" 1>&6
940 fi
941
942 echo "$ac_t""$ac_cv_target" 1>&6
943
944 target=$ac_cv_target
945 target_alias=$ac_cv_target_alias
946 target_cpu=$ac_cv_target_cpu
947 target_vendor=$ac_cv_target_vendor
948 target_os=$ac_cv_target_os
949
950
951
952
953
954 echo $ac_n "checking build system type""... $ac_c" 1>&6
955 echo "configure:956: checking build system type" >&5
956 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
957
958 # Make sure we can run config.sub.
959   if $ac_config_sub sun4 >/dev/null 2>&1; then :
960     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
961   fi
962
963   ac_cv_build_alias=$build
964   case "$ac_cv_build_alias" in
965   NONE)
966     case $nonopt in
967     NONE)
968       ac_cv_build_alias=$host_alias ;;
969
970     *) ac_cv_build_alias=$nonopt ;;
971     esac ;;
972   esac
973
974   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
975   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
976   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
977   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
978 else
979   echo $ac_n "(cached) $ac_c" 1>&6
980 fi
981
982 echo "$ac_t""$ac_cv_build" 1>&6
983
984 build=$ac_cv_build
985 build_alias=$ac_cv_build_alias
986 build_cpu=$ac_cv_build_cpu
987 build_vendor=$ac_cv_build_vendor
988 build_os=$ac_cv_build_os
989
990
991
992
993
994 # Do some error checking and defaulting for the host and target type.
995 # The inputs are:
996 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
997 #
998 # The rules are:
999 # 1. You are not allowed to specify --host, --target, and nonopt at the
1000 #    same time.
1001 # 2. Host defaults to nonopt.
1002 # 3. If nonopt is not specified, then host defaults to the current host,
1003 #    as determined by config.guess.
1004 # 4. Target and build default to nonopt.
1005 # 5. If nonopt is not specified, then target and build default to host.
1006
1007 # The aliases save the names the user supplied, while $host etc.
1008 # will get canonicalized.
1009 case $host---$target---$nonopt in
1010 NONE---*---* | *---NONE---* | *---*---NONE) ;;
1011 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
1012 esac
1013
1014 test "$host_alias" != "$target_alias" &&
1015   test "$program_prefix$program_suffix$program_transform_name" = \
1016     NONENONEs,x,x, &&
1017   program_prefix=${target_alias}-
1018
1019
1020 # Find a good install program.  We prefer a C program (faster),
1021 # so one script is as good as another.  But avoid the broken or
1022 # incompatible versions:
1023 # SysV /etc/install, /usr/sbin/install
1024 # SunOS /usr/etc/install
1025 # IRIX /sbin/install
1026 # AIX /bin/install
1027 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1028 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1029 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1030 # ./install, which can be erroneously created by make from ./install.sh.
1031 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1032 echo "configure:1033: checking for a BSD compatible install" >&5
1033 if test -z "$INSTALL"; then
1034 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
1035   echo $ac_n "(cached) $ac_c" 1>&6
1036 else
1037     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1038   for ac_dir in $PATH; do
1039     # Account for people who put trailing slashes in PATH elements.
1040     case "$ac_dir/" in
1041     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1042     *)
1043       # OSF1 and SCO ODT 3.0 have their own names for install.
1044       # Don't use installbsd from OSF since it installs stuff as root
1045       # by default.
1046       for ac_prog in ginstall scoinst install; do
1047         if test -f $ac_dir/$ac_prog; then
1048           if test $ac_prog = install &&
1049             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1050             # AIX install.  It has an incompatible calling convention.
1051             :
1052           elif test $ac_prog = install &&
1053             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
1054             # program-specific install script used by HP pwplus--don't use.
1055             :
1056           else
1057             ac_cv_path_install="$ac_dir/$ac_prog -c"
1058             break 2
1059           fi
1060         fi
1061       done
1062       ;;
1063     esac
1064   done
1065   IFS="$ac_save_IFS"
1066
1067 fi
1068   if test "${ac_cv_path_install+set}" = set; then
1069     INSTALL="$ac_cv_path_install"
1070   else
1071     # As a last resort, use the slow shell script.  We don't cache a
1072     # path for INSTALL within a source directory, because that will
1073     # break other packages using the cache if that directory is
1074     # removed, or if the path is relative.
1075     INSTALL="$ac_install_sh"
1076   fi
1077 fi
1078 echo "$ac_t""$INSTALL" 1>&6
1079
1080 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1081 # It thinks the first close brace ends the variable substitution.
1082 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1083
1084 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
1085
1086 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1087
1088 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
1089 echo "configure:1090: checking whether build environment is sane" >&5
1090 # Just in case
1091 sleep 1
1092 echo timestamp > conftestfile
1093 # Do `set' in a subshell so we don't clobber the current shell's
1094 # arguments.  Must try -L first in case configure is actually a
1095 # symlink; some systems play weird games with the mod time of symlinks
1096 # (eg FreeBSD returns the mod time of the symlink's containing
1097 # directory).
1098 if (
1099    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1100    if test "$*" = "X"; then
1101       # -L didn't work.
1102       set X `ls -t $srcdir/configure conftestfile`
1103    fi
1104    if test "$*" != "X $srcdir/configure conftestfile" \
1105       && test "$*" != "X conftestfile $srcdir/configure"; then
1106
1107       # If neither matched, then we have a broken ls.  This can happen
1108       # if, for instance, CONFIG_SHELL is bash and it inherits a
1109       # broken ls alias from the environment.  This has actually
1110       # happened.  Such a system could not be considered "sane".
1111       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
1112 alias in your environment" 1>&2; exit 1; }
1113    fi
1114
1115    test "$2" = conftestfile
1116    )
1117 then
1118    # Ok.
1119    :
1120 else
1121    { echo "configure: error: newly created file is older than distributed files!
1122 Check your system clock" 1>&2; exit 1; }
1123 fi
1124 rm -f conftest*
1125 echo "$ac_t""yes" 1>&6
1126 if test "$program_transform_name" = s,x,x,; then
1127   program_transform_name=
1128 else
1129   # Double any \ or $.  echo might interpret backslashes.
1130   cat <<\EOF_SED > conftestsed
1131 s,\\,\\\\,g; s,\$,$$,g
1132 EOF_SED
1133   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
1134   rm -f conftestsed
1135 fi
1136 test "$program_prefix" != NONE &&
1137   program_transform_name="s,^,${program_prefix},;$program_transform_name"
1138 # Use a double $ so make ignores it.
1139 test "$program_suffix" != NONE &&
1140   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
1141
1142 # sed with no file args requires a program.
1143 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
1144
1145 for ac_prog in mawk gawk nawk awk
1146 do
1147 # Extract the first word of "$ac_prog", so it can be a program name with args.
1148 set dummy $ac_prog; ac_word=$2
1149 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1150 echo "configure:1151: checking for $ac_word" >&5
1151 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
1152   echo $ac_n "(cached) $ac_c" 1>&6
1153 else
1154   if test -n "$AWK"; then
1155   ac_cv_prog_AWK="$AWK" # Let the user override the test.
1156 else
1157   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1158   ac_dummy="$PATH"
1159   for ac_dir in $ac_dummy; do
1160     test -z "$ac_dir" && ac_dir=.
1161     if test -f $ac_dir/$ac_word; then
1162       ac_cv_prog_AWK="$ac_prog"
1163       break
1164     fi
1165   done
1166   IFS="$ac_save_ifs"
1167 fi
1168 fi
1169 AWK="$ac_cv_prog_AWK"
1170 if test -n "$AWK"; then
1171   echo "$ac_t""$AWK" 1>&6
1172 else
1173   echo "$ac_t""no" 1>&6
1174 fi
1175
1176 test -n "$AWK" && break
1177 done
1178
1179 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1180 echo "configure:1181: checking whether ${MAKE-make} sets \${MAKE}" >&5
1181 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1182 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1183   echo $ac_n "(cached) $ac_c" 1>&6
1184 else
1185   cat > conftestmake <<\EOF
1186 all:
1187         @echo 'ac_maketemp="${MAKE}"'
1188 EOF
1189 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1190 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1191 if test -n "$ac_maketemp"; then
1192   eval ac_cv_prog_make_${ac_make}_set=yes
1193 else
1194   eval ac_cv_prog_make_${ac_make}_set=no
1195 fi
1196 rm -f conftestmake
1197 fi
1198 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1199   echo "$ac_t""yes" 1>&6
1200   SET_MAKE=
1201 else
1202   echo "$ac_t""no" 1>&6
1203   SET_MAKE="MAKE=${MAKE-make}"
1204 fi
1205
1206
1207
1208 PACKAGE=$OL_PACKAGE
1209
1210 VERSION=$OL_VERSION
1211
1212 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1213   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
1214 fi
1215
1216
1217
1218 missing_dir=`cd $ac_aux_dir && pwd`
1219 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1220 echo "configure:1221: checking for working aclocal" >&5
1221 # Run test in a subshell; some versions of sh will print an error if
1222 # an executable is not found, even if stderr is redirected.
1223 # Redirect stdin to placate older versions of autoconf.  Sigh.
1224 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1225    ACLOCAL=aclocal
1226    echo "$ac_t""found" 1>&6
1227 else
1228    ACLOCAL="$missing_dir/missing aclocal"
1229    echo "$ac_t""missing" 1>&6
1230 fi
1231
1232 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1233 echo "configure:1234: checking for working autoconf" >&5
1234 # Run test in a subshell; some versions of sh will print an error if
1235 # an executable is not found, even if stderr is redirected.
1236 # Redirect stdin to placate older versions of autoconf.  Sigh.
1237 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1238    AUTOCONF=autoconf
1239    echo "$ac_t""found" 1>&6
1240 else
1241    AUTOCONF="$missing_dir/missing autoconf"
1242    echo "$ac_t""missing" 1>&6
1243 fi
1244
1245 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1246 echo "configure:1247: checking for working automake" >&5
1247 # Run test in a subshell; some versions of sh will print an error if
1248 # an executable is not found, even if stderr is redirected.
1249 # Redirect stdin to placate older versions of autoconf.  Sigh.
1250 if (automake --version) < /dev/null > /dev/null 2>&1; then
1251    AUTOMAKE=automake
1252    echo "$ac_t""found" 1>&6
1253 else
1254    AUTOMAKE="$missing_dir/missing automake"
1255    echo "$ac_t""missing" 1>&6
1256 fi
1257
1258 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1259 echo "configure:1260: checking for working autoheader" >&5
1260 # Run test in a subshell; some versions of sh will print an error if
1261 # an executable is not found, even if stderr is redirected.
1262 # Redirect stdin to placate older versions of autoconf.  Sigh.
1263 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1264    AUTOHEADER=autoheader
1265    echo "$ac_t""found" 1>&6
1266 else
1267    AUTOHEADER="$missing_dir/missing autoheader"
1268    echo "$ac_t""missing" 1>&6
1269 fi
1270
1271 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1272 echo "configure:1273: checking for working makeinfo" >&5
1273 # Run test in a subshell; some versions of sh will print an error if
1274 # an executable is not found, even if stderr is redirected.
1275 # Redirect stdin to placate older versions of autoconf.  Sigh.
1276 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1277    MAKEINFO=makeinfo
1278    echo "$ac_t""found" 1>&6
1279 else
1280    MAKEINFO="$missing_dir/missing makeinfo"
1281    echo "$ac_t""missing" 1>&6
1282 fi
1283
1284 install_sh="$missing_dir/install-sh"
1285 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1286
1287 for ac_prog in gnutar gtar tar
1288 do
1289 # Extract the first word of "$ac_prog", so it can be a program name with args.
1290 set dummy $ac_prog; ac_word=$2
1291 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1292 echo "configure:1293: checking for $ac_word" >&5
1293 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1294   echo $ac_n "(cached) $ac_c" 1>&6
1295 else
1296   if test -n "$AMTAR"; then
1297   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1298 else
1299   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1300   ac_dummy="$PATH"
1301   for ac_dir in $ac_dummy; do
1302     test -z "$ac_dir" && ac_dir=.
1303     if test -f $ac_dir/$ac_word; then
1304       ac_cv_prog_AMTAR="$ac_prog"
1305       break
1306     fi
1307   done
1308   IFS="$ac_save_ifs"
1309 fi
1310 fi
1311 AMTAR="$ac_cv_prog_AMTAR"
1312 if test -n "$AMTAR"; then
1313   echo "$ac_t""$AMTAR" 1>&6
1314 else
1315   echo "$ac_t""no" 1>&6
1316 fi
1317
1318 test -n "$AMTAR" && break
1319 done
1320
1321
1322 AMTARFLAGS=
1323 if test -n "$AMTAR"; then
1324   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1325         AMTARFLAGS=o
1326   fi
1327 fi
1328
1329 cat >> confdefs.h <<EOF
1330 #define OPENLDAP_PACKAGE "$PACKAGE"
1331 EOF
1332
1333 cat >> confdefs.h <<EOF
1334 #define OPENLDAP_VERSION "$VERSION"
1335 EOF
1336
1337
1338 cat >> confdefs.h <<EOF
1339 #define LDAP_VENDOR_VERSION $OL_API_INC
1340 EOF
1341
1342 cat >> confdefs.h <<EOF
1343 #define LDAP_VENDOR_VERSION_MAJOR $OL_MAJOR
1344 EOF
1345
1346 cat >> confdefs.h <<EOF
1347 #define LDAP_VENDOR_VERSION_MINOR $OL_MINOR
1348 EOF
1349
1350 cat >> confdefs.h <<EOF
1351 #define LDAP_VENDOR_VERSION_PATCH $OL_PATCH
1352 EOF
1353
1354
1355 OPENLDAP_LIBVERSION=$OL_API_LIB
1356
1357
1358
1359 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1360 echo "configure:1361: checking configure arguments" >&5
1361
1362
1363 top_builddir=`pwd`
1364
1365 ldap_subdir="/openldap"
1366
1367 # Check whether --with-subdir or --without-subdir was given.
1368 if test "${with_subdir+set}" = set; then
1369   withval="$with_subdir"
1370   case "$withval" in
1371         no) ldap_subdir=""
1372                 ;;
1373         yes)
1374                 ;;
1375         /*|\\*)
1376                 ldap_subdir="$withval"
1377                 ;;
1378         *)
1379                 ldap_subdir="/$withval"
1380                 ;;
1381 esac
1382
1383 fi
1384
1385
1386 # OpenLDAP --enable-debug
1387         # Check whether --enable-debug or --disable-debug was given.
1388 if test "${enable_debug+set}" = set; then
1389   enableval="$enable_debug"
1390   
1391         ol_arg=invalid
1392         for ol_val in auto yes no ; do
1393                 if test "$enableval" = "$ol_val" ; then
1394                         ol_arg="$ol_val"
1395                 fi
1396         done
1397         if test "$ol_arg" = "invalid" ; then
1398                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1399         fi
1400         ol_enable_debug="$ol_arg"
1401
1402 else
1403         ol_enable_debug="yes"
1404 fi
1405 # end --enable-debug
1406 # OpenLDAP --enable-syslog
1407         # Check whether --enable-syslog or --disable-syslog was given.
1408 if test "${enable_syslog+set}" = set; then
1409   enableval="$enable_syslog"
1410   
1411         ol_arg=invalid
1412         for ol_val in auto yes no ; do
1413                 if test "$enableval" = "$ol_val" ; then
1414                         ol_arg="$ol_val"
1415                 fi
1416         done
1417         if test "$ol_arg" = "invalid" ; then
1418                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1419         fi
1420         ol_enable_syslog="$ol_arg"
1421
1422 else
1423         ol_enable_syslog="auto"
1424 fi
1425 # end --enable-syslog
1426 # OpenLDAP --enable-proctitle
1427         # Check whether --enable-proctitle or --disable-proctitle was given.
1428 if test "${enable_proctitle+set}" = set; then
1429   enableval="$enable_proctitle"
1430   
1431         ol_arg=invalid
1432         for ol_val in auto yes no ; do
1433                 if test "$enableval" = "$ol_val" ; then
1434                         ol_arg="$ol_val"
1435                 fi
1436         done
1437         if test "$ol_arg" = "invalid" ; then
1438                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1439         fi
1440         ol_enable_proctitle="$ol_arg"
1441
1442 else
1443         ol_enable_proctitle="yes"
1444 fi
1445 # end --enable-proctitle
1446 # OpenLDAP --enable-cache
1447         # Check whether --enable-cache or --disable-cache was given.
1448 if test "${enable_cache+set}" = set; then
1449   enableval="$enable_cache"
1450   
1451         ol_arg=invalid
1452         for ol_val in auto yes no ; do
1453                 if test "$enableval" = "$ol_val" ; then
1454                         ol_arg="$ol_val"
1455                 fi
1456         done
1457         if test "$ol_arg" = "invalid" ; then
1458                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
1459         fi
1460         ol_enable_cache="$ol_arg"
1461
1462 else
1463         ol_enable_cache="no"
1464 fi
1465 # end --enable-cache
1466 # OpenLDAP --enable-referrals
1467         # Check whether --enable-referrals or --disable-referrals was given.
1468 if test "${enable_referrals+set}" = set; then
1469   enableval="$enable_referrals"
1470   
1471         ol_arg=invalid
1472         for ol_val in auto yes no ; do
1473                 if test "$enableval" = "$ol_val" ; then
1474                         ol_arg="$ol_val"
1475                 fi
1476         done
1477         if test "$ol_arg" = "invalid" ; then
1478                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1479         fi
1480         ol_enable_referrals="$ol_arg"
1481
1482 else
1483         ol_enable_referrals="no"
1484 fi
1485 # end --enable-referrals
1486 # OpenLDAP --enable-kbind
1487         # Check whether --enable-kbind or --disable-kbind was given.
1488 if test "${enable_kbind+set}" = set; then
1489   enableval="$enable_kbind"
1490   
1491         ol_arg=invalid
1492         for ol_val in auto yes no ; do
1493                 if test "$enableval" = "$ol_val" ; then
1494                         ol_arg="$ol_val"
1495                 fi
1496         done
1497         if test "$ol_arg" = "invalid" ; then
1498                 { echo "configure: error: bad value $enableval for --enable-kbind" 1>&2; exit 1; }
1499         fi
1500         ol_enable_kbind="$ol_arg"
1501
1502 else
1503         ol_enable_kbind="no"
1504 fi
1505 # end --enable-kbind
1506 # OpenLDAP --enable-ipv6
1507         # Check whether --enable-ipv6 or --disable-ipv6 was given.
1508 if test "${enable_ipv6+set}" = set; then
1509   enableval="$enable_ipv6"
1510   
1511         ol_arg=invalid
1512         for ol_val in auto yes no ; do
1513                 if test "$enableval" = "$ol_val" ; then
1514                         ol_arg="$ol_val"
1515                 fi
1516         done
1517         if test "$ol_arg" = "invalid" ; then
1518                 { echo "configure: error: bad value $enableval for --enable-ipv6" 1>&2; exit 1; }
1519         fi
1520         ol_enable_ipv6="$ol_arg"
1521
1522 else
1523         ol_enable_ipv6="auto"
1524 fi
1525 # end --enable-ipv6
1526 # OpenLDAP --enable-local
1527         # Check whether --enable-local or --disable-local was given.
1528 if test "${enable_local+set}" = set; then
1529   enableval="$enable_local"
1530   
1531         ol_arg=invalid
1532         for ol_val in auto yes no ; do
1533                 if test "$enableval" = "$ol_val" ; then
1534                         ol_arg="$ol_val"
1535                 fi
1536         done
1537         if test "$ol_arg" = "invalid" ; then
1538                 { echo "configure: error: bad value $enableval for --enable-local" 1>&2; exit 1; }
1539         fi
1540         ol_enable_local="$ol_arg"
1541
1542 else
1543         ol_enable_local="auto"
1544 fi
1545 # end --enable-local
1546 # OpenLDAP --enable-rewrite
1547         # Check whether --enable-rewrite or --disable-rewrite was given.
1548 if test "${enable_rewrite+set}" = set; then
1549   enableval="$enable_rewrite"
1550   
1551         ol_arg=invalid
1552         for ol_val in auto yes no ; do
1553                 if test "$enableval" = "$ol_val" ; then
1554                         ol_arg="$ol_val"
1555                 fi
1556         done
1557         if test "$ol_arg" = "invalid" ; then
1558                 { echo "configure: error: bad value $enableval for --enable-rewrite" 1>&2; exit 1; }
1559         fi
1560         ol_enable_rewrite="$ol_arg"
1561
1562 else
1563         ol_enable_rewrite="no"
1564 fi
1565 # end --enable-rewrite
1566 # OpenLDAP --enable-x_compile
1567         # Check whether --enable-x_compile or --disable-x_compile was given.
1568 if test "${enable_x_compile+set}" = set; then
1569   enableval="$enable_x_compile"
1570   
1571         ol_arg=invalid
1572         for ol_val in yes no ; do
1573                 if test "$enableval" = "$ol_val" ; then
1574                         ol_arg="$ol_val"
1575                 fi
1576         done
1577         if test "$ol_arg" = "invalid" ; then
1578                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1579         fi
1580         ol_enable_x_compile="$ol_arg"
1581
1582 else
1583         ol_enable_x_compile="no"
1584 fi
1585 # end --enable-x_compile
1586
1587
1588 # OpenLDAP --with-cyrus_sasl
1589         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1590 if test "${with_cyrus_sasl+set}" = set; then
1591   withval="$with_cyrus_sasl"
1592   
1593         ol_arg=invalid
1594         for ol_val in auto yes no  ; do
1595                 if test "$withval" = "$ol_val" ; then
1596                         ol_arg="$ol_val"
1597                 fi
1598         done
1599         if test "$ol_arg" = "invalid" ; then
1600                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1601         fi
1602         ol_with_cyrus_sasl="$ol_arg"
1603
1604 else
1605         ol_with_cyrus_sasl="auto"
1606 fi
1607 # end --with-cyrus_sasl
1608
1609 # OpenLDAP --with-fetch
1610         # Check whether --with-fetch or --without-fetch was given.
1611 if test "${with_fetch+set}" = set; then
1612   withval="$with_fetch"
1613   
1614         ol_arg=invalid
1615         for ol_val in auto yes no  ; do
1616                 if test "$withval" = "$ol_val" ; then
1617                         ol_arg="$ol_val"
1618                 fi
1619         done
1620         if test "$ol_arg" = "invalid" ; then
1621                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1622         fi
1623         ol_with_fetch="$ol_arg"
1624
1625 else
1626         ol_with_fetch="auto"
1627 fi
1628 # end --with-fetch
1629
1630 # OpenLDAP --with-kerberos
1631         # Check whether --with-kerberos or --without-kerberos was given.
1632 if test "${with_kerberos+set}" = set; then
1633   withval="$with_kerberos"
1634   
1635         ol_arg=invalid
1636         for ol_val in auto k5 k5only k425 kth k4 afs yes no ; do
1637                 if test "$withval" = "$ol_val" ; then
1638                         ol_arg="$ol_val"
1639                 fi
1640         done
1641         if test "$ol_arg" = "invalid" ; then
1642                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1643         fi
1644         ol_with_kerberos="$ol_arg"
1645
1646 else
1647         ol_with_kerberos="auto"
1648 fi
1649 # end --with-kerberos
1650
1651 # OpenLDAP --with-readline
1652         # Check whether --with-readline or --without-readline was given.
1653 if test "${with_readline+set}" = set; then
1654   withval="$with_readline"
1655   
1656         ol_arg=invalid
1657         for ol_val in auto yes no  ; do
1658                 if test "$withval" = "$ol_val" ; then
1659                         ol_arg="$ol_val"
1660                 fi
1661         done
1662         if test "$ol_arg" = "invalid" ; then
1663                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1664         fi
1665         ol_with_readline="$ol_arg"
1666
1667 else
1668         ol_with_readline="auto"
1669 fi
1670 # end --with-readline
1671
1672 # OpenLDAP --with-threads
1673         # Check whether --with-threads or --without-threads was given.
1674 if test "${with_threads+set}" = set; then
1675   withval="$with_threads"
1676   
1677         ol_arg=invalid
1678         for ol_val in auto nt posix mach pth lwp yes no manual  ; do
1679                 if test "$withval" = "$ol_val" ; then
1680                         ol_arg="$ol_val"
1681                 fi
1682         done
1683         if test "$ol_arg" = "invalid" ; then
1684                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1685         fi
1686         ol_with_threads="$ol_arg"
1687
1688 else
1689         ol_with_threads="auto"
1690 fi
1691 # end --with-threads
1692
1693 # OpenLDAP --with-tls
1694         # Check whether --with-tls or --without-tls was given.
1695 if test "${with_tls+set}" = set; then
1696   withval="$with_tls"
1697   
1698         ol_arg=invalid
1699         for ol_val in auto ssleay openssl yes no  ; do
1700                 if test "$withval" = "$ol_val" ; then
1701                         ol_arg="$ol_val"
1702                 fi
1703         done
1704         if test "$ol_arg" = "invalid" ; then
1705                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1706         fi
1707         ol_with_tls="$ol_arg"
1708
1709 else
1710         ol_with_tls="auto"
1711 fi
1712 # end --with-tls
1713
1714 # OpenLDAP --with-yielding_select
1715         # Check whether --with-yielding_select or --without-yielding_select was given.
1716 if test "${with_yielding_select+set}" = set; then
1717   withval="$with_yielding_select"
1718   
1719         ol_arg=invalid
1720         for ol_val in auto yes no manual  ; do
1721                 if test "$withval" = "$ol_val" ; then
1722                         ol_arg="$ol_val"
1723                 fi
1724         done
1725         if test "$ol_arg" = "invalid" ; then
1726                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1727         fi
1728         ol_with_yielding_select="$ol_arg"
1729
1730 else
1731         ol_with_yielding_select="auto"
1732 fi
1733 # end --with-yielding_select
1734
1735
1736
1737 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1738 if test "${with_xxslapdoptions+set}" = set; then
1739   withval="$with_xxslapdoptions"
1740   :
1741 fi
1742
1743 # OpenLDAP --enable-slapd
1744         # Check whether --enable-slapd or --disable-slapd was given.
1745 if test "${enable_slapd+set}" = set; then
1746   enableval="$enable_slapd"
1747   
1748         ol_arg=invalid
1749         for ol_val in auto yes no ; do
1750                 if test "$enableval" = "$ol_val" ; then
1751                         ol_arg="$ol_val"
1752                 fi
1753         done
1754         if test "$ol_arg" = "invalid" ; then
1755                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1756         fi
1757         ol_enable_slapd="$ol_arg"
1758
1759 else
1760         ol_enable_slapd="yes"
1761 fi
1762 # end --enable-slapd
1763 # OpenLDAP --enable-aci
1764         # Check whether --enable-aci or --disable-aci was given.
1765 if test "${enable_aci+set}" = set; then
1766   enableval="$enable_aci"
1767   
1768         ol_arg=invalid
1769         for ol_val in auto yes no ; do
1770                 if test "$enableval" = "$ol_val" ; then
1771                         ol_arg="$ol_val"
1772                 fi
1773         done
1774         if test "$ol_arg" = "invalid" ; then
1775                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1776         fi
1777         ol_enable_aci="$ol_arg"
1778
1779 else
1780         ol_enable_aci="no"
1781 fi
1782 # end --enable-aci
1783 # OpenLDAP --enable-cleartext
1784         # Check whether --enable-cleartext or --disable-cleartext was given.
1785 if test "${enable_cleartext+set}" = set; then
1786   enableval="$enable_cleartext"
1787   
1788         ol_arg=invalid
1789         for ol_val in auto yes no ; do
1790                 if test "$enableval" = "$ol_val" ; then
1791                         ol_arg="$ol_val"
1792                 fi
1793         done
1794         if test "$ol_arg" = "invalid" ; then
1795                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1796         fi
1797         ol_enable_cleartext="$ol_arg"
1798
1799 else
1800         ol_enable_cleartext="yes"
1801 fi
1802 # end --enable-cleartext
1803 # OpenLDAP --enable-crypt
1804         # Check whether --enable-crypt or --disable-crypt was given.
1805 if test "${enable_crypt+set}" = set; then
1806   enableval="$enable_crypt"
1807   
1808         ol_arg=invalid
1809         for ol_val in auto yes no ; do
1810                 if test "$enableval" = "$ol_val" ; then
1811                         ol_arg="$ol_val"
1812                 fi
1813         done
1814         if test "$ol_arg" = "invalid" ; then
1815                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1816         fi
1817         ol_enable_crypt="$ol_arg"
1818
1819 else
1820         ol_enable_crypt="no"
1821 fi
1822 # end --enable-crypt
1823 # OpenLDAP --enable-dynamic
1824         # Check whether --enable-dynamic or --disable-dynamic was given.
1825 if test "${enable_dynamic+set}" = set; then
1826   enableval="$enable_dynamic"
1827   
1828         ol_arg=invalid
1829         for ol_val in auto yes no ; do
1830                 if test "$enableval" = "$ol_val" ; then
1831                         ol_arg="$ol_val"
1832                 fi
1833         done
1834         if test "$ol_arg" = "invalid" ; then
1835                 { echo "configure: error: bad value $enableval for --enable-dynamic" 1>&2; exit 1; }
1836         fi
1837         ol_enable_dynamic="$ol_arg"
1838
1839 else
1840         ol_enable_dynamic="no"
1841 fi
1842 # end --enable-dynamic
1843 # OpenLDAP --enable-kpasswd
1844         # Check whether --enable-kpasswd or --disable-kpasswd was given.
1845 if test "${enable_kpasswd+set}" = set; then
1846   enableval="$enable_kpasswd"
1847   
1848         ol_arg=invalid
1849         for ol_val in auto yes no ; do
1850                 if test "$enableval" = "$ol_val" ; then
1851                         ol_arg="$ol_val"
1852                 fi
1853         done
1854         if test "$ol_arg" = "invalid" ; then
1855                 { echo "configure: error: bad value $enableval for --enable-kpasswd" 1>&2; exit 1; }
1856         fi
1857         ol_enable_kpasswd="$ol_arg"
1858
1859 else
1860         ol_enable_kpasswd="no"
1861 fi
1862 # end --enable-kpasswd
1863 # OpenLDAP --enable-lmpasswd
1864         # Check whether --enable-lmpasswd or --disable-lmpasswd was given.
1865 if test "${enable_lmpasswd+set}" = set; then
1866   enableval="$enable_lmpasswd"
1867   
1868         ol_arg=invalid
1869         for ol_val in auto yes no ; do
1870                 if test "$enableval" = "$ol_val" ; then
1871                         ol_arg="$ol_val"
1872                 fi
1873         done
1874         if test "$ol_arg" = "invalid" ; then
1875                 { echo "configure: error: bad value $enableval for --enable-lmpasswd" 1>&2; exit 1; }
1876         fi
1877         ol_enable_lmpasswd="$ol_arg"
1878
1879 else
1880         ol_enable_lmpasswd="no"
1881 fi
1882 # end --enable-lmpasswd
1883 # OpenLDAP --enable-spasswd
1884         # Check whether --enable-spasswd or --disable-spasswd was given.
1885 if test "${enable_spasswd+set}" = set; then
1886   enableval="$enable_spasswd"
1887   
1888         ol_arg=invalid
1889         for ol_val in auto yes no ; do
1890                 if test "$enableval" = "$ol_val" ; then
1891                         ol_arg="$ol_val"
1892                 fi
1893         done
1894         if test "$ol_arg" = "invalid" ; then
1895                 { echo "configure: error: bad value $enableval for --enable-spasswd" 1>&2; exit 1; }
1896         fi
1897         ol_enable_spasswd="$ol_arg"
1898
1899 else
1900         ol_enable_spasswd="no"
1901 fi
1902 # end --enable-spasswd
1903 # OpenLDAP --enable-modules
1904         # Check whether --enable-modules or --disable-modules was given.
1905 if test "${enable_modules+set}" = set; then
1906   enableval="$enable_modules"
1907   
1908         ol_arg=invalid
1909         for ol_val in auto yes no ; do
1910                 if test "$enableval" = "$ol_val" ; then
1911                         ol_arg="$ol_val"
1912                 fi
1913         done
1914         if test "$ol_arg" = "invalid" ; then
1915                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1916         fi
1917         ol_enable_modules="$ol_arg"
1918
1919 else
1920         ol_enable_modules="no"
1921 fi
1922 # end --enable-modules
1923 # OpenLDAP --enable-phonetic
1924         # Check whether --enable-phonetic or --disable-phonetic was given.
1925 if test "${enable_phonetic+set}" = set; then
1926   enableval="$enable_phonetic"
1927   
1928         ol_arg=invalid
1929         for ol_val in auto yes no ; do
1930                 if test "$enableval" = "$ol_val" ; then
1931                         ol_arg="$ol_val"
1932                 fi
1933         done
1934         if test "$ol_arg" = "invalid" ; then
1935                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1936         fi
1937         ol_enable_phonetic="$ol_arg"
1938
1939 else
1940         ol_enable_phonetic="no"
1941 fi
1942 # end --enable-phonetic
1943 # OpenLDAP --enable-rlookups
1944         # Check whether --enable-rlookups or --disable-rlookups was given.
1945 if test "${enable_rlookups+set}" = set; then
1946   enableval="$enable_rlookups"
1947   
1948         ol_arg=invalid
1949         for ol_val in auto yes no ; do
1950                 if test "$enableval" = "$ol_val" ; then
1951                         ol_arg="$ol_val"
1952                 fi
1953         done
1954         if test "$ol_arg" = "invalid" ; then
1955                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1956         fi
1957         ol_enable_rlookups="$ol_arg"
1958
1959 else
1960         ol_enable_rlookups="no"
1961 fi
1962 # end --enable-rlookups
1963 # OpenLDAP --enable-slp
1964         # Check whether --enable-slp or --disable-slp was given.
1965 if test "${enable_slp+set}" = set; then
1966   enableval="$enable_slp"
1967   
1968         ol_arg=invalid
1969         for ol_val in auto yes no ; do
1970                 if test "$enableval" = "$ol_val" ; then
1971                         ol_arg="$ol_val"
1972                 fi
1973         done
1974         if test "$ol_arg" = "invalid" ; then
1975                 { echo "configure: error: bad value $enableval for --enable-slp" 1>&2; exit 1; }
1976         fi
1977         ol_enable_slp="$ol_arg"
1978
1979 else
1980         ol_enable_slp="no"
1981 fi
1982 # end --enable-slp
1983 # OpenLDAP --enable-wrappers
1984         # Check whether --enable-wrappers or --disable-wrappers was given.
1985 if test "${enable_wrappers+set}" = set; then
1986   enableval="$enable_wrappers"
1987   
1988         ol_arg=invalid
1989         for ol_val in auto yes no ; do
1990                 if test "$enableval" = "$ol_val" ; then
1991                         ol_arg="$ol_val"
1992                 fi
1993         done
1994         if test "$ol_arg" = "invalid" ; then
1995                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1996         fi
1997         ol_enable_wrappers="$ol_arg"
1998
1999 else
2000         ol_enable_wrappers="no"
2001 fi
2002 # end --enable-wrappers
2003
2004 # OpenLDAP --enable-bdb
2005         # Check whether --enable-bdb or --disable-bdb was given.
2006 if test "${enable_bdb+set}" = set; then
2007   enableval="$enable_bdb"
2008   
2009         ol_arg=invalid
2010         for ol_val in auto yes no ; do
2011                 if test "$enableval" = "$ol_val" ; then
2012                         ol_arg="$ol_val"
2013                 fi
2014         done
2015         if test "$ol_arg" = "invalid" ; then
2016                 { echo "configure: error: bad value $enableval for --enable-bdb" 1>&2; exit 1; }
2017         fi
2018         ol_enable_bdb="$ol_arg"
2019
2020 else
2021         ol_enable_bdb="yes"
2022 fi
2023 # end --enable-bdb
2024 # OpenLDAP --with-bdb_module
2025         # Check whether --with-bdb_module or --without-bdb_module was given.
2026 if test "${with_bdb_module+set}" = set; then
2027   withval="$with_bdb_module"
2028   
2029         ol_arg=invalid
2030         for ol_val in static dynamic ; do
2031                 if test "$withval" = "$ol_val" ; then
2032                         ol_arg="$ol_val"
2033                 fi
2034         done
2035         if test "$ol_arg" = "invalid" ; then
2036                 { echo "configure: error: bad value $withval for --with-bdb_module" 1>&2; exit 1; }
2037         fi
2038         ol_with_bdb_module="$ol_arg"
2039
2040 else
2041         ol_with_bdb_module="static"
2042 fi
2043 # end --with-bdb_module
2044
2045 # OpenLDAP --enable-dnssrv
2046         # Check whether --enable-dnssrv or --disable-dnssrv was given.
2047 if test "${enable_dnssrv+set}" = set; then
2048   enableval="$enable_dnssrv"
2049   
2050         ol_arg=invalid
2051         for ol_val in auto yes no ; do
2052                 if test "$enableval" = "$ol_val" ; then
2053                         ol_arg="$ol_val"
2054                 fi
2055         done
2056         if test "$ol_arg" = "invalid" ; then
2057                 { echo "configure: error: bad value $enableval for --enable-dnssrv" 1>&2; exit 1; }
2058         fi
2059         ol_enable_dnssrv="$ol_arg"
2060
2061 else
2062         ol_enable_dnssrv="no"
2063 fi
2064 # end --enable-dnssrv
2065 # OpenLDAP --with-dnssrv_module
2066         # Check whether --with-dnssrv_module or --without-dnssrv_module was given.
2067 if test "${with_dnssrv_module+set}" = set; then
2068   withval="$with_dnssrv_module"
2069   
2070         ol_arg=invalid
2071         for ol_val in static dynamic ; do
2072                 if test "$withval" = "$ol_val" ; then
2073                         ol_arg="$ol_val"
2074                 fi
2075         done
2076         if test "$ol_arg" = "invalid" ; then
2077                 { echo "configure: error: bad value $withval for --with-dnssrv_module" 1>&2; exit 1; }
2078         fi
2079         ol_with_dnssrv_module="$ol_arg"
2080
2081 else
2082         ol_with_dnssrv_module="static"
2083 fi
2084 # end --with-dnssrv_module
2085
2086 # OpenLDAP --enable-ldap
2087         # Check whether --enable-ldap or --disable-ldap was given.
2088 if test "${enable_ldap+set}" = set; then
2089   enableval="$enable_ldap"
2090   
2091         ol_arg=invalid
2092         for ol_val in auto yes no ; do
2093                 if test "$enableval" = "$ol_val" ; then
2094                         ol_arg="$ol_val"
2095                 fi
2096         done
2097         if test "$ol_arg" = "invalid" ; then
2098                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
2099         fi
2100         ol_enable_ldap="$ol_arg"
2101
2102 else
2103         ol_enable_ldap="no"
2104 fi
2105 # end --enable-ldap
2106 # OpenLDAP --with-ldap_module
2107         # Check whether --with-ldap_module or --without-ldap_module was given.
2108 if test "${with_ldap_module+set}" = set; then
2109   withval="$with_ldap_module"
2110   
2111         ol_arg=invalid
2112         for ol_val in static dynamic ; do
2113                 if test "$withval" = "$ol_val" ; then
2114                         ol_arg="$ol_val"
2115                 fi
2116         done
2117         if test "$ol_arg" = "invalid" ; then
2118                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
2119         fi
2120         ol_with_ldap_module="$ol_arg"
2121
2122 else
2123         ol_with_ldap_module="static"
2124 fi
2125 # end --with-ldap_module
2126
2127 # OpenLDAP --enable-ldbm
2128         # Check whether --enable-ldbm or --disable-ldbm was given.
2129 if test "${enable_ldbm+set}" = set; then
2130   enableval="$enable_ldbm"
2131   
2132         ol_arg=invalid
2133         for ol_val in auto yes no ; do
2134                 if test "$enableval" = "$ol_val" ; then
2135                         ol_arg="$ol_val"
2136                 fi
2137         done
2138         if test "$ol_arg" = "invalid" ; then
2139                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
2140         fi
2141         ol_enable_ldbm="$ol_arg"
2142
2143 else
2144         ol_enable_ldbm="no"
2145 fi
2146 # end --enable-ldbm
2147 # OpenLDAP --with-ldbm_api
2148         # Check whether --with-ldbm_api or --without-ldbm_api was given.
2149 if test "${with_ldbm_api+set}" = set; then
2150   withval="$with_ldbm_api"
2151   
2152         ol_arg=invalid
2153         for ol_val in auto berkeley bcompat mdbm gdbm ; do
2154                 if test "$withval" = "$ol_val" ; then
2155                         ol_arg="$ol_val"
2156                 fi
2157         done
2158         if test "$ol_arg" = "invalid" ; then
2159                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
2160         fi
2161         ol_with_ldbm_api="$ol_arg"
2162
2163 else
2164         ol_with_ldbm_api="auto"
2165 fi
2166 # end --with-ldbm_api
2167
2168 # OpenLDAP --with-ldbm_module
2169         # Check whether --with-ldbm_module or --without-ldbm_module was given.
2170 if test "${with_ldbm_module+set}" = set; then
2171   withval="$with_ldbm_module"
2172   
2173         ol_arg=invalid
2174         for ol_val in static dynamic ; do
2175                 if test "$withval" = "$ol_val" ; then
2176                         ol_arg="$ol_val"
2177                 fi
2178         done
2179         if test "$ol_arg" = "invalid" ; then
2180                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
2181         fi
2182         ol_with_ldbm_module="$ol_arg"
2183
2184 else
2185         ol_with_ldbm_module="static"
2186 fi
2187 # end --with-ldbm_module
2188
2189 # OpenLDAP --with-ldbm_type
2190         # Check whether --with-ldbm_type or --without-ldbm_type was given.
2191 if test "${with_ldbm_type+set}" = set; then
2192   withval="$with_ldbm_type"
2193   
2194         ol_arg=invalid
2195         for ol_val in auto btree hash ; do
2196                 if test "$withval" = "$ol_val" ; then
2197                         ol_arg="$ol_val"
2198                 fi
2199         done
2200         if test "$ol_arg" = "invalid" ; then
2201                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
2202         fi
2203         ol_with_ldbm_type="$ol_arg"
2204
2205 else
2206         ol_with_ldbm_type="auto"
2207 fi
2208 # end --with-ldbm_type
2209
2210 # OpenLDAP --enable-meta
2211         # Check whether --enable-meta or --disable-meta was given.
2212 if test "${enable_meta+set}" = set; then
2213   enableval="$enable_meta"
2214   
2215         ol_arg=invalid
2216         for ol_val in auto yes no ; do
2217                 if test "$enableval" = "$ol_val" ; then
2218                         ol_arg="$ol_val"
2219                 fi
2220         done
2221         if test "$ol_arg" = "invalid" ; then
2222                 { echo "configure: error: bad value $enableval for --enable-meta" 1>&2; exit 1; }
2223         fi
2224         ol_enable_meta="$ol_arg"
2225
2226 else
2227         ol_enable_meta="no"
2228 fi
2229 # end --enable-meta
2230 # OpenLDAP --with-meta_module
2231         # Check whether --with-meta_module or --without-meta_module was given.
2232 if test "${with_meta_module+set}" = set; then
2233   withval="$with_meta_module"
2234   
2235         ol_arg=invalid
2236         for ol_val in static dynamic ; do
2237                 if test "$withval" = "$ol_val" ; then
2238                         ol_arg="$ol_val"
2239                 fi
2240         done
2241         if test "$ol_arg" = "invalid" ; then
2242                 { echo "configure: error: bad value $withval for --with-meta_module" 1>&2; exit 1; }
2243         fi
2244         ol_with_meta_module="$ol_arg"
2245
2246 else
2247         ol_with_meta_module="static"
2248 fi
2249 # end --with-meta_module
2250
2251 # OpenLDAP --enable-monitor
2252         # Check whether --enable-monitor or --disable-monitor was given.
2253 if test "${enable_monitor+set}" = set; then
2254   enableval="$enable_monitor"
2255   
2256         ol_arg=invalid
2257         for ol_val in auto yes no ; do
2258                 if test "$enableval" = "$ol_val" ; then
2259                         ol_arg="$ol_val"
2260                 fi
2261         done
2262         if test "$ol_arg" = "invalid" ; then
2263                 { echo "configure: error: bad value $enableval for --enable-monitor" 1>&2; exit 1; }
2264         fi
2265         ol_enable_monitor="$ol_arg"
2266
2267 else
2268         ol_enable_monitor="no"
2269 fi
2270 # end --enable-monitor
2271 # OpenLDAP --with-monitor_module
2272         # Check whether --with-monitor_module or --without-monitor_module was given.
2273 if test "${with_monitor_module+set}" = set; then
2274   withval="$with_monitor_module"
2275   
2276         ol_arg=invalid
2277         for ol_val in static dynamic ; do
2278                 if test "$withval" = "$ol_val" ; then
2279                         ol_arg="$ol_val"
2280                 fi
2281         done
2282         if test "$ol_arg" = "invalid" ; then
2283                 { echo "configure: error: bad value $withval for --with-monitor_module" 1>&2; exit 1; }
2284         fi
2285         ol_with_monitor_module="$ol_arg"
2286
2287 else
2288         ol_with_monitor_module="static"
2289 fi
2290 # end --with-monitor_module
2291
2292 # OpenLDAP --enable-passwd
2293         # Check whether --enable-passwd or --disable-passwd was given.
2294 if test "${enable_passwd+set}" = set; then
2295   enableval="$enable_passwd"
2296   
2297         ol_arg=invalid
2298         for ol_val in auto yes no ; do
2299                 if test "$enableval" = "$ol_val" ; then
2300                         ol_arg="$ol_val"
2301                 fi
2302         done
2303         if test "$ol_arg" = "invalid" ; then
2304                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
2305         fi
2306         ol_enable_passwd="$ol_arg"
2307
2308 else
2309         ol_enable_passwd="no"
2310 fi
2311 # end --enable-passwd
2312 # OpenLDAP --with-passwd_module
2313         # Check whether --with-passwd_module or --without-passwd_module was given.
2314 if test "${with_passwd_module+set}" = set; then
2315   withval="$with_passwd_module"
2316   
2317         ol_arg=invalid
2318         for ol_val in static dynamic ; do
2319                 if test "$withval" = "$ol_val" ; then
2320                         ol_arg="$ol_val"
2321                 fi
2322         done
2323         if test "$ol_arg" = "invalid" ; then
2324                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
2325         fi
2326         ol_with_passwd_module="$ol_arg"
2327
2328 else
2329         ol_with_passwd_module="static"
2330 fi
2331 # end --with-passwd_module
2332
2333 # OpenLDAP --enable-perl
2334         # Check whether --enable-perl or --disable-perl was given.
2335 if test "${enable_perl+set}" = set; then
2336   enableval="$enable_perl"
2337   
2338         ol_arg=invalid
2339         for ol_val in auto yes no ; do
2340                 if test "$enableval" = "$ol_val" ; then
2341                         ol_arg="$ol_val"
2342                 fi
2343         done
2344         if test "$ol_arg" = "invalid" ; then
2345                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
2346         fi
2347         ol_enable_perl="$ol_arg"
2348
2349 else
2350         ol_enable_perl="no"
2351 fi
2352 # end --enable-perl
2353 # OpenLDAP --with-perl_module
2354         # Check whether --with-perl_module or --without-perl_module was given.
2355 if test "${with_perl_module+set}" = set; then
2356   withval="$with_perl_module"
2357   
2358         ol_arg=invalid
2359         for ol_val in static dynamic ; do
2360                 if test "$withval" = "$ol_val" ; then
2361                         ol_arg="$ol_val"
2362                 fi
2363         done
2364         if test "$ol_arg" = "invalid" ; then
2365                 { echo "configure: error: bad value $withval for --with-perl_module" 1>&2; exit 1; }
2366         fi
2367         ol_with_perl_module="$ol_arg"
2368
2369 else
2370         ol_with_perl_module="static"
2371 fi
2372 # end --with-perl_module
2373
2374 # OpenLDAP --enable-shell
2375         # Check whether --enable-shell or --disable-shell was given.
2376 if test "${enable_shell+set}" = set; then
2377   enableval="$enable_shell"
2378   
2379         ol_arg=invalid
2380         for ol_val in auto yes no ; do
2381                 if test "$enableval" = "$ol_val" ; then
2382                         ol_arg="$ol_val"
2383                 fi
2384         done
2385         if test "$ol_arg" = "invalid" ; then
2386                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
2387         fi
2388         ol_enable_shell="$ol_arg"
2389
2390 else
2391         ol_enable_shell="no"
2392 fi
2393 # end --enable-shell
2394 # OpenLDAP --with-shell_module
2395         # Check whether --with-shell_module or --without-shell_module was given.
2396 if test "${with_shell_module+set}" = set; then
2397   withval="$with_shell_module"
2398   
2399         ol_arg=invalid
2400         for ol_val in static dynamic ; do
2401                 if test "$withval" = "$ol_val" ; then
2402                         ol_arg="$ol_val"
2403                 fi
2404         done
2405         if test "$ol_arg" = "invalid" ; then
2406                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
2407         fi
2408         ol_with_shell_module="$ol_arg"
2409
2410 else
2411         ol_with_shell_module="static"
2412 fi
2413 # end --with-shell_module
2414
2415 # OpenLDAP --enable-sql
2416         # Check whether --enable-sql or --disable-sql was given.
2417 if test "${enable_sql+set}" = set; then
2418   enableval="$enable_sql"
2419   
2420         ol_arg=invalid
2421         for ol_val in auto yes no ; do
2422                 if test "$enableval" = "$ol_val" ; then
2423                         ol_arg="$ol_val"
2424                 fi
2425         done
2426         if test "$ol_arg" = "invalid" ; then
2427                 { echo "configure: error: bad value $enableval for --enable-sql" 1>&2; exit 1; }
2428         fi
2429         ol_enable_sql="$ol_arg"
2430
2431 else
2432         ol_enable_sql="no"
2433 fi
2434 # end --enable-sql
2435 # OpenLDAP --with-sql_module
2436         # Check whether --with-sql_module or --without-sql_module was given.
2437 if test "${with_sql_module+set}" = set; then
2438   withval="$with_sql_module"
2439   
2440         ol_arg=invalid
2441         for ol_val in static dynamic ; do
2442                 if test "$withval" = "$ol_val" ; then
2443                         ol_arg="$ol_val"
2444                 fi
2445         done
2446         if test "$ol_arg" = "invalid" ; then
2447                 { echo "configure: error: bad value $withval for --with-sql_module" 1>&2; exit 1; }
2448         fi
2449         ol_with_sql_module="$ol_arg"
2450
2451 else
2452         ol_with_sql_module="static"
2453 fi
2454 # end --with-sql_module
2455
2456
2457 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2458 if test "${with_xxslurpdoptions+set}" = set; then
2459   withval="$with_xxslurpdoptions"
2460   :
2461 fi
2462
2463 # OpenLDAP --enable-slurpd
2464         # Check whether --enable-slurpd or --disable-slurpd was given.
2465 if test "${enable_slurpd+set}" = set; then
2466   enableval="$enable_slurpd"
2467   
2468         ol_arg=invalid
2469         for ol_val in auto yes no ; do
2470                 if test "$enableval" = "$ol_val" ; then
2471                         ol_arg="$ol_val"
2472                 fi
2473         done
2474         if test "$ol_arg" = "invalid" ; then
2475                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2476         fi
2477         ol_enable_slurpd="$ol_arg"
2478
2479 else
2480         ol_enable_slurpd="auto"
2481 fi
2482 # end --enable-slurpd
2483
2484 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2485 if test "${with_xxliboptions+set}" = set; then
2486   withval="$with_xxliboptions"
2487   :
2488 fi
2489
2490 # Check whether --enable-static or --disable-static was given.
2491 if test "${enable_static+set}" = set; then
2492   enableval="$enable_static"
2493   p=${PACKAGE-default}
2494 case $enableval in
2495 yes) enable_static=yes ;;
2496 no) enable_static=no ;;
2497 *)
2498   enable_static=no
2499   # Look at the argument we got.  We use all the common list separators.
2500   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2501   for pkg in $enableval; do
2502     if test "X$pkg" = "X$p"; then
2503       enable_static=yes
2504     fi
2505   done
2506   IFS="$ac_save_ifs"
2507   ;;
2508 esac
2509 else
2510   enable_static=yes
2511 fi
2512
2513 # Check whether --enable-shared or --disable-shared was given.
2514 if test "${enable_shared+set}" = set; then
2515   enableval="$enable_shared"
2516   p=${PACKAGE-default}
2517 case $enableval in
2518 yes) enable_shared=yes ;;
2519 no) enable_shared=no ;;
2520 *)
2521   enable_shared=no
2522   # Look at the argument we got.  We use all the common list separators.
2523   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2524   for pkg in $enableval; do
2525     if test "X$pkg" = "X$p"; then
2526       enable_shared=yes
2527     fi
2528   done
2529   IFS="$ac_save_ifs"
2530   ;;
2531 esac
2532 else
2533   enable_shared=yes
2534 fi
2535
2536
2537
2538 # validate options
2539 if test $ol_enable_slapd = no ; then
2540                 if test $ol_enable_bdb = yes ; then
2541                 echo "configure: warning: slapd disabled, ignoring --enable-bdb argument" 1>&2
2542         fi
2543         if test $ol_enable_dnssrv = yes ; then
2544                 echo "configure: warning: slapd disabled, ignoring --enable-dnssrv argument" 1>&2
2545         fi
2546         if test $ol_enable_ldap = yes ; then
2547                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2548         fi
2549         if test $ol_enable_ldbm = yes ; then
2550                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2551         fi
2552         if test $ol_enable_meta = yes ; then
2553                 echo "configure: warning: slapd disabled, ignoring --enable-meta argument" 1>&2
2554         fi
2555         if test $ol_enable_monitor = yes ; then
2556                 echo "configure: warning: slapd disabled, ignoring --enable-monitor argument" 1>&2
2557         fi
2558         if test $ol_enable_passwd = yes ; then
2559                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2560         fi
2561         if test $ol_enable_perl = yes ; then
2562                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
2563         fi
2564         if test $ol_enable_shell = yes ; then
2565                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2566         fi
2567         if test $ol_enable_sql = yes ; then
2568                 echo "configure: warning: slapd disabled, ignoring --enable-sql argument" 1>&2
2569         fi
2570         if test $ol_enable_modules = yes ; then
2571                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2572         fi
2573         if test $ol_enable_wrappers = yes ; then
2574                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2575         fi
2576         if test $ol_enable_phonetic = yes ; then
2577                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2578         fi
2579         if test $ol_enable_rlookups = yes ; then
2580                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2581         fi
2582         if test $ol_enable_aci = yes ; then
2583                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2584         fi
2585         if test $ol_with_ldbm_api != auto ; then
2586                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2587         fi
2588         if test $ol_with_ldbm_type != auto ; then
2589                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2590         fi
2591         if test $ol_with_bdb_module != static ; then
2592                 echo "configure: warning: slapd disabled, ignoring --with-bdb-module argument" 1>&2
2593         fi
2594         if test $ol_with_dnssrv_module != static ; then
2595                 echo "configure: warning: slapd disabled, ignoring --with-dnssrv-module argument" 1>&2
2596         fi
2597         if test $ol_with_ldap_module != static ; then
2598                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2599         fi
2600         if test $ol_with_ldbm_module != static ; then
2601                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2602         fi
2603         if test $ol_with_meta_module != static ; then
2604                 echo "configure: warning: slapd disabled, ignoring --with-meta-module argument" 1>&2
2605         fi
2606         if test $ol_with_monitor_module != static ; then
2607                 echo "configure: warning: slapd disabled, ignoring --with-monitor-module argument" 1>&2
2608         fi
2609         if test $ol_with_passwd_module != static ; then
2610                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2611         fi
2612         if test $ol_with_perl_module != static ; then
2613                 echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2
2614         fi
2615         if test $ol_with_shell_module != static ; then
2616                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2617         fi
2618         if test $ol_with_sql_module != static ; then
2619                 echo "configure: warning: slapd disabled, ignoring --with-sql-module argument" 1>&2
2620         fi
2621         if test $ol_enable_slurpd = yes ; then
2622                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2623         fi
2624         if test $ol_enable_rewrite = yes ; then
2625                 echo "configure: warning: slapd disabled, ignoring --enable-rewrite argument" 1>&2
2626         fi
2627
2628         # force settings to no
2629         ol_enable_bdb=no
2630         ol_enable_dnssrv=no
2631         ol_enable_ldap=no
2632         ol_enable_ldbm=no
2633         ol_enable_meta=no
2634         ol_enable_monitor=no
2635         ol_enable_passwd=no
2636         ol_enable_perl=no
2637         ol_enable_shell=no
2638         ol_enable_sql=no
2639
2640         ol_enable_modules=no
2641         ol_enable_phonetic=no
2642         ol_enable_rlookups=no
2643         ol_enable_aci=no
2644         ol_enable_wrappers=no
2645         ol_enable_dynamic=no
2646
2647         ol_with_ldbm_api=no
2648         ol_with_ldbm_type=no
2649
2650         ol_with_bdb_module=static
2651         ol_with_dnssrv_module=static
2652         ol_with_ldap_module=static
2653         ol_with_ldbm_module=static
2654         ol_with_meta_module=static
2655         ol_with_monitor_module=static
2656         ol_with_passwd_module=static
2657         ol_with_perl_module=static
2658         ol_with_shell_module=static
2659         ol_with_sql_module=static
2660
2661         ol_enable_slurpd=no
2662
2663         ol_enable_rewrite=no
2664
2665 elif test $ol_enable_ldbm = no ; then
2666         
2667         if test $ol_with_ldbm_api != auto ; then
2668                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2669         fi
2670
2671         if test $ol_with_ldbm_type != auto ; then
2672                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2673         fi
2674
2675         if test $ol_with_ldbm_module != static ; then
2676                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2677         fi
2678
2679         if test $ol_enable_modules != yes -a \
2680                 $ol_enable_bdb = no -a \
2681                 $ol_enable_dnssrv = no -a \
2682                 $ol_enable_ldap = no -a \
2683                 $ol_enable_meta = no -a \
2684                 $ol_enable_monitor = no -a \
2685                 $ol_enable_passwd = no -a \
2686                 $ol_enable_perl = no -a \
2687                 $ol_enable_shell = no -a \
2688                 $ol_enable_sql = no ; then
2689
2690                 if test $ol_enable_slapd = yes ; then
2691                         { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2692                 else
2693                         echo "configure: warning: skipping slapd, no backend specified" 1>&2
2694                         ol_enable_slapd=no
2695                 fi
2696         fi
2697
2698         ol_with_ldbm_api=no
2699         ol_with_ldbm_type=no
2700         ol_with_ldbm_module=static
2701
2702         if test $ol_enable_bdb != no ; then
2703                 ol_with_ldbm_api=berkeley
2704         fi
2705
2706 else
2707                 if test $ol_with_ldbm_api = gdbm -a \
2708                 $ol_with_ldbm_type = btree ; then
2709                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2710         fi
2711         if test $ol_with_ldbm_api = mdbm -a \
2712                 $ol_with_ldbm_type = btree ; then
2713                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2714         fi
2715         if test $ol_with_ldbm_api = ndbm -a \
2716                 $ol_with_ldbm_type = btree ; then
2717                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2718         fi
2719
2720         if test $ol_enable_bdb = yes ; then
2721                 if test $ol_with_ldbm_api = auto ; then
2722                         ol_with_ldbm_api=berkeley
2723                 elif test $ol_with_ldbm_api != berkeley ; then
2724                         { echo "configure: error: LDBM API not compatible with BDB" 1>&2; exit 1; }
2725                 fi
2726
2727         elif test $ol_enable_bdb = auto ; then
2728                 if test $ol_with_ldbm_api != berkeley \
2729                         -o $ol_with_ldbm_api != auto ; then
2730                         echo "configure: warning: LDBM API not compatible with BDB, disabling BDB" 1>&2
2731                         ol_enable_bdb=no
2732                 fi
2733         fi
2734 fi
2735
2736 if test $ol_enable_slurpd = yes ; then
2737                 if test $ol_with_threads = no ; then
2738                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2739         fi
2740 fi
2741
2742 if test $ol_enable_lmpasswd = yes ; then
2743         if test $ol_with_tls = no ; then
2744                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
2745         fi
2746 fi
2747
2748 if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
2749         if test $ol_with_kerberos = no ; then
2750                 { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
2751         elif test $ol_with_kerberos = auto ; then
2752                 ol_with_kerberos=yes
2753         fi
2754
2755 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
2756         if test $ol_with_kerberos = auto ; then
2757                 ol_with_kerberos=no
2758         elif test $ol_with_kerberos != no ; then
2759                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2760                 ol_with_kerberos=no
2761         fi
2762 fi
2763
2764 if test $ol_enable_spasswd = yes ; then
2765         if test $ol_with_cyrus_sasl = no ; then
2766                 { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
2767         fi
2768         ol_with_cyrus_sasl=yes
2769 fi
2770
2771 echo "$ac_t""done" 1>&6
2772
2773 LDAP_LIBS=
2774 LDIF_LIBS=
2775 LDBM_LIB=
2776 LDBM_LIBS=
2777 LTHREAD_LIBS=
2778 LUTIL_LIBS=
2779
2780 SLAPD_LIBS=
2781 SLURPD_LIBS=
2782
2783 BUILD_SLAPD=no
2784 BUILD_SLURPD=no
2785
2786 BUILD_THREAD=no
2787
2788 BUILD_BDB=no
2789 BUILD_DNSSRV=no
2790 BUILD_LDAP=no
2791 BUILD_LDBM=no
2792 BUILD_META=no
2793 BUILD_MONITOR=no
2794 BUILD_PASSWD=no
2795 BUILD_PERL=no
2796 BUILD_SHELL=no
2797 BUILD_SQL=no
2798
2799 BUILD_BDB_DYNAMIC=static
2800 BUILD_DNSSRV_DYNAMIC=static
2801 BUILD_LDAP_DYNAMIC=static
2802 BUILD_LDBM_DYNAMIC=static
2803 BUILD_META_DYNAMIC=static
2804 BUILD_MONITOR_DYNAMIC=static
2805 BUILD_PASSWD_DYNAMIC=static
2806 BUILD_PERL_DYNAMIC=static
2807 BUILD_SHELL_DYNAMIC=static
2808 BUILD_SQL_DYNAMIC=static
2809
2810 SLAPD_MODULES_LDFLAGS=
2811 SLAPD_MODULES_CPPFLAGS=
2812 SLAPD_MODULES_LIST=
2813
2814 SLAPD_STATIC_BACKENDS=
2815 SLAPD_DYNAMIC_BACKENDS=
2816
2817 SLAPD_PERL_LDFLAGS=
2818 MOD_PERL_LDFLAGS=
2819 PERL_CPPFLAGS=
2820
2821 SLAPD_SQL_LDFLAGS=
2822 SLAPD_SQL_LIBS=
2823 SLAPD_SQL_INCLUDES=
2824
2825 KRB4_LIBS=
2826 KRB5_LIBS=
2827 READLINE_LIBS=
2828 SASL_LIBS=
2829 TERMCAP_LIBS=
2830 TLS_LIBS=
2831 MODULES_LIBS=
2832 AUTH_LIBS=
2833
2834 SLAPD_SLP_LIBS=
2835
2836
2837 # Find a good install program.  We prefer a C program (faster),
2838 # so one script is as good as another.  But avoid the broken or
2839 # incompatible versions:
2840 # SysV /etc/install, /usr/sbin/install
2841 # SunOS /usr/etc/install
2842 # IRIX /sbin/install
2843 # AIX /bin/install
2844 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2845 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2846 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2847 # ./install, which can be erroneously created by make from ./install.sh.
2848 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
2849 echo "configure:2850: checking for a BSD compatible install" >&5
2850 if test -z "$INSTALL"; then
2851 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
2852   echo $ac_n "(cached) $ac_c" 1>&6
2853 else
2854     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
2855   for ac_dir in $PATH; do
2856     # Account for people who put trailing slashes in PATH elements.
2857     case "$ac_dir/" in
2858     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
2859     *)
2860       # OSF1 and SCO ODT 3.0 have their own names for install.
2861       # Don't use installbsd from OSF since it installs stuff as root
2862       # by default.
2863       for ac_prog in ginstall scoinst install; do
2864         if test -f $ac_dir/$ac_prog; then
2865           if test $ac_prog = install &&
2866             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
2867             # AIX install.  It has an incompatible calling convention.
2868             :
2869           elif test $ac_prog = install &&
2870             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
2871             # program-specific install script used by HP pwplus--don't use.
2872             :
2873           else
2874             ac_cv_path_install="$ac_dir/$ac_prog -c"
2875             break 2
2876           fi
2877         fi
2878       done
2879       ;;
2880     esac
2881   done
2882   IFS="$ac_save_IFS"
2883
2884 fi
2885   if test "${ac_cv_path_install+set}" = set; then
2886     INSTALL="$ac_cv_path_install"
2887   else
2888     # As a last resort, use the slow shell script.  We don't cache a
2889     # path for INSTALL within a source directory, because that will
2890     # break other packages using the cache if that directory is
2891     # removed, or if the path is relative.
2892     INSTALL="$ac_install_sh"
2893   fi
2894 fi
2895 echo "$ac_t""$INSTALL" 1>&6
2896
2897 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2898 # It thinks the first close brace ends the variable substitution.
2899 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2900
2901 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2902
2903 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2904
2905
2906 cat >> confdefs.h <<\EOF
2907 #define HAVE_MKVERSION 1
2908 EOF
2909
2910
2911
2912
2913 ol_aix_threads=no
2914 case "$target" in
2915 *-*-aix*)       if test -z "$CC" ; then
2916                 case "$ol_with_threads" in
2917                 auto | yes |  posix) ol_aix_threads=yes ;;
2918                 esac
2919         fi
2920 ;;
2921 esac
2922
2923 if test $ol_aix_threads = yes ; then
2924         if test -z "${CC}" ; then
2925                 for ac_prog in cc_r xlc_r cc
2926 do
2927 # Extract the first word of "$ac_prog", so it can be a program name with args.
2928 set dummy $ac_prog; ac_word=$2
2929 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2930 echo "configure:2931: checking for $ac_word" >&5
2931 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2932   echo $ac_n "(cached) $ac_c" 1>&6
2933 else
2934   if test -n "$CC"; then
2935   ac_cv_prog_CC="$CC" # Let the user override the test.
2936 else
2937   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2938   ac_dummy="$PATH"
2939   for ac_dir in $ac_dummy; do
2940     test -z "$ac_dir" && ac_dir=.
2941     if test -f $ac_dir/$ac_word; then
2942       ac_cv_prog_CC="$ac_prog"
2943       break
2944     fi
2945   done
2946   IFS="$ac_save_ifs"
2947 fi
2948 fi
2949 CC="$ac_cv_prog_CC"
2950 if test -n "$CC"; then
2951   echo "$ac_t""$CC" 1>&6
2952 else
2953   echo "$ac_t""no" 1>&6
2954 fi
2955
2956 test -n "$CC" && break
2957 done
2958
2959
2960                 if test "$CC" = cc ; then
2961                                                 if test $ol_with_threads != auto ; then
2962                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2963                         else
2964                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2965                         fi
2966                         ol_with_threads=no
2967                 fi
2968         fi
2969
2970         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2971                 ol_with_threads=posix
2972                 ol_cv_pthread_create=yes
2973         fi
2974 fi
2975
2976 if test -z "${CC}"; then
2977         for ac_prog in cc
2978 do
2979 # Extract the first word of "$ac_prog", so it can be a program name with args.
2980 set dummy $ac_prog; ac_word=$2
2981 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2982 echo "configure:2983: checking for $ac_word" >&5
2983 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2984   echo $ac_n "(cached) $ac_c" 1>&6
2985 else
2986   if test -n "$CC"; then
2987   ac_cv_prog_CC="$CC" # Let the user override the test.
2988 else
2989   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2990   ac_dummy="$PATH"
2991   for ac_dir in $ac_dummy; do
2992     test -z "$ac_dir" && ac_dir=.
2993     if test -f $ac_dir/$ac_word; then
2994       ac_cv_prog_CC="$ac_prog"
2995       break
2996     fi
2997   done
2998   IFS="$ac_save_ifs"
2999 fi
3000 fi
3001 CC="$ac_cv_prog_CC"
3002 if test -n "$CC"; then
3003   echo "$ac_t""$CC" 1>&6
3004 else
3005   echo "$ac_t""no" 1>&6
3006 fi
3007
3008 test -n "$CC" && break
3009 done
3010
3011 fi
3012
3013
3014 for ac_prog in ar gar
3015 do
3016 # Extract the first word of "$ac_prog", so it can be a program name with args.
3017 set dummy $ac_prog; ac_word=$2
3018 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3019 echo "configure:3020: checking for $ac_word" >&5
3020 if eval "test \"\${ac_cv_prog_AR+set}\" = set"; then
3021   echo $ac_n "(cached) $ac_c" 1>&6
3022 else
3023   if test -n "$AR"; then
3024   ac_cv_prog_AR="$AR" # Let the user override the test.
3025 else
3026   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3027   ac_dummy="$PATH"
3028   for ac_dir in $ac_dummy; do
3029     test -z "$ac_dir" && ac_dir=.
3030     if test -f $ac_dir/$ac_word; then
3031       ac_cv_prog_AR="$ac_prog"
3032       break
3033     fi
3034   done
3035   IFS="$ac_save_ifs"
3036 fi
3037 fi
3038 AR="$ac_cv_prog_AR"
3039 if test -n "$AR"; then
3040   echo "$ac_t""$AR" 1>&6
3041 else
3042   echo "$ac_t""no" 1>&6
3043 fi
3044
3045 test -n "$AR" && break
3046 done
3047 test -n "$AR" || AR="ar"
3048
3049
3050
3051
3052 # Find the correct PATH separator.  Usually this is `:', but
3053 # DJGPP uses `;' like DOS.
3054 if test "X${PATH_SEPARATOR+set}" != Xset; then
3055   UNAME=${UNAME-`uname 2>/dev/null`}
3056   case X$UNAME in
3057     *-DOS) lt_cv_sys_path_separator=';' ;;
3058     *)     lt_cv_sys_path_separator=':' ;;
3059   esac
3060   PATH_SEPARATOR=$lt_cv_sys_path_separator
3061 fi
3062
3063 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3064 echo "configure:3065: checking for Cygwin environment" >&5
3065 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
3066   echo $ac_n "(cached) $ac_c" 1>&6
3067 else
3068   cat > conftest.$ac_ext <<EOF
3069 #line 3070 "configure"
3070 #include "confdefs.h"
3071
3072 int main() {
3073
3074 #ifndef __CYGWIN__
3075 #define __CYGWIN__ __CYGWIN32__
3076 #endif
3077 return __CYGWIN__;
3078 ; return 0; }
3079 EOF
3080 if { (eval echo configure:3081: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3081   rm -rf conftest*
3082   ac_cv_cygwin=yes
3083 else
3084   echo "configure: failed program was:" >&5
3085   cat conftest.$ac_ext >&5
3086   rm -rf conftest*
3087   ac_cv_cygwin=no
3088 fi
3089 rm -f conftest*
3090 fi
3091
3092 echo "$ac_t""$ac_cv_cygwin" 1>&6
3093 CYGWIN=
3094 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3095 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3096 echo "configure:3097: checking for mingw32 environment" >&5
3097 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
3098   echo $ac_n "(cached) $ac_c" 1>&6
3099 else
3100   cat > conftest.$ac_ext <<EOF
3101 #line 3102 "configure"
3102 #include "confdefs.h"
3103
3104 int main() {
3105 return __MINGW32__;
3106 ; return 0; }
3107 EOF
3108 if { (eval echo configure:3109: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3109   rm -rf conftest*
3110   ac_cv_mingw32=yes
3111 else
3112   echo "configure: failed program was:" >&5
3113   cat conftest.$ac_ext >&5
3114   rm -rf conftest*
3115   ac_cv_mingw32=no
3116 fi
3117 rm -f conftest*
3118 fi
3119
3120 echo "$ac_t""$ac_cv_mingw32" 1>&6
3121 MINGW32=
3122 test "$ac_cv_mingw32" = yes && MINGW32=yes
3123 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
3124 echo "configure:3125: checking for EMX OS/2 environment" >&5
3125 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
3126   echo $ac_n "(cached) $ac_c" 1>&6
3127 else
3128   cat > conftest.$ac_ext <<EOF
3129 #line 3130 "configure"
3130 #include "confdefs.h"
3131
3132 int main() {
3133 return __EMX__;
3134 ; return 0; }
3135 EOF
3136 if { (eval echo configure:3137: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3137   rm -rf conftest*
3138   ac_cv_emxos2=yes
3139 else
3140   echo "configure: failed program was:" >&5
3141   cat conftest.$ac_ext >&5
3142   rm -rf conftest*
3143   ac_cv_emxos2=no
3144 fi
3145 rm -f conftest*
3146 fi
3147
3148 echo "$ac_t""$ac_cv_emxos2" 1>&6
3149 EMXOS2=
3150 test "$ac_cv_emxos2" = yes && EMXOS2=yes
3151 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3152 echo "configure:3153: checking how to run the C preprocessor" >&5
3153 # On Suns, sometimes $CPP names a directory.
3154 if test -n "$CPP" && test -d "$CPP"; then
3155   CPP=
3156 fi
3157 if test -z "$CPP"; then
3158 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3159   echo $ac_n "(cached) $ac_c" 1>&6
3160 else
3161     # This must be in double quotes, not single quotes, because CPP may get
3162   # substituted into the Makefile and "${CC-cc}" will confuse make.
3163   CPP="${CC-cc} -E"
3164   # On the NeXT, cc -E runs the code through the compiler's parser,
3165   # not just through cpp.
3166   cat > conftest.$ac_ext <<EOF
3167 #line 3168 "configure"
3168 #include "confdefs.h"
3169 #include <assert.h>
3170 Syntax Error
3171 EOF
3172 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3173 { (eval echo configure:3174: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3174 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3175 if test -z "$ac_err"; then
3176   :
3177 else
3178   echo "$ac_err" >&5
3179   echo "configure: failed program was:" >&5
3180   cat conftest.$ac_ext >&5
3181   rm -rf conftest*
3182   CPP="${CC-cc} -E -traditional-cpp"
3183   cat > conftest.$ac_ext <<EOF
3184 #line 3185 "configure"
3185 #include "confdefs.h"
3186 #include <assert.h>
3187 Syntax Error
3188 EOF
3189 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3190 { (eval echo configure:3191: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3191 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3192 if test -z "$ac_err"; then
3193   :
3194 else
3195   echo "$ac_err" >&5
3196   echo "configure: failed program was:" >&5
3197   cat conftest.$ac_ext >&5
3198   rm -rf conftest*
3199   CPP="${CC-cc} -nologo -E"
3200   cat > conftest.$ac_ext <<EOF
3201 #line 3202 "configure"
3202 #include "confdefs.h"
3203 #include <assert.h>
3204 Syntax Error
3205 EOF
3206 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3207 { (eval echo configure:3208: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3208 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3209 if test -z "$ac_err"; then
3210   :
3211 else
3212   echo "$ac_err" >&5
3213   echo "configure: failed program was:" >&5
3214   cat conftest.$ac_ext >&5
3215   rm -rf conftest*
3216   CPP=/lib/cpp
3217 fi
3218 rm -f conftest*
3219 fi
3220 rm -f conftest*
3221 fi
3222 rm -f conftest*
3223   ac_cv_prog_CPP="$CPP"
3224 fi
3225   CPP="$ac_cv_prog_CPP"
3226 else
3227   ac_cv_prog_CPP="$CPP"
3228 fi
3229 echo "$ac_t""$CPP" 1>&6
3230
3231 # Check whether --enable-fast-install or --disable-fast-install was given.
3232 if test "${enable_fast_install+set}" = set; then
3233   enableval="$enable_fast_install"
3234   p=${PACKAGE-default}
3235 case $enableval in
3236 yes) enable_fast_install=yes ;;
3237 no) enable_fast_install=no ;;
3238 *)
3239   enable_fast_install=no
3240   # Look at the argument we got.  We use all the common list separators.
3241   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3242   for pkg in $enableval; do
3243     if test "X$pkg" = "X$p"; then
3244       enable_fast_install=yes
3245     fi
3246   done
3247   IFS="$ac_save_ifs"
3248   ;;
3249 esac
3250 else
3251   enable_fast_install=yes
3252 fi
3253
3254 # Extract the first word of "gcc", so it can be a program name with args.
3255 set dummy gcc; ac_word=$2
3256 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3257 echo "configure:3258: checking for $ac_word" >&5
3258 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3259   echo $ac_n "(cached) $ac_c" 1>&6
3260 else
3261   if test -n "$CC"; then
3262   ac_cv_prog_CC="$CC" # Let the user override the test.
3263 else
3264   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3265   ac_dummy="$PATH"
3266   for ac_dir in $ac_dummy; do
3267     test -z "$ac_dir" && ac_dir=.
3268     if test -f $ac_dir/$ac_word; then
3269       ac_cv_prog_CC="gcc"
3270       break
3271     fi
3272   done
3273   IFS="$ac_save_ifs"
3274 fi
3275 fi
3276 CC="$ac_cv_prog_CC"
3277 if test -n "$CC"; then
3278   echo "$ac_t""$CC" 1>&6
3279 else
3280   echo "$ac_t""no" 1>&6
3281 fi
3282
3283 if test -z "$CC"; then
3284   # Extract the first word of "cc", so it can be a program name with args.
3285 set dummy cc; ac_word=$2
3286 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3287 echo "configure:3288: checking for $ac_word" >&5
3288 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3289   echo $ac_n "(cached) $ac_c" 1>&6
3290 else
3291   if test -n "$CC"; then
3292   ac_cv_prog_CC="$CC" # Let the user override the test.
3293 else
3294   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3295   ac_prog_rejected=no
3296   ac_dummy="$PATH"
3297   for ac_dir in $ac_dummy; do
3298     test -z "$ac_dir" && ac_dir=.
3299     if test -f $ac_dir/$ac_word; then
3300       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
3301         ac_prog_rejected=yes
3302         continue
3303       fi
3304       ac_cv_prog_CC="cc"
3305       break
3306     fi
3307   done
3308   IFS="$ac_save_ifs"
3309 if test $ac_prog_rejected = yes; then
3310   # We found a bogon in the path, so make sure we never use it.
3311   set dummy $ac_cv_prog_CC
3312   shift
3313   if test $# -gt 0; then
3314     # We chose a different compiler from the bogus one.
3315     # However, it has the same basename, so the bogon will be chosen
3316     # first if we set CC to just the basename; use the full file name.
3317     shift
3318     set dummy "$ac_dir/$ac_word" "$@"
3319     shift
3320     ac_cv_prog_CC="$@"
3321   fi
3322 fi
3323 fi
3324 fi
3325 CC="$ac_cv_prog_CC"
3326 if test -n "$CC"; then
3327   echo "$ac_t""$CC" 1>&6
3328 else
3329   echo "$ac_t""no" 1>&6
3330 fi
3331
3332   if test -z "$CC"; then
3333     case "`uname -s`" in
3334     *win32* | *WIN32* | *CYGWIN*)
3335       # Extract the first word of "cl", so it can be a program name with args.
3336 set dummy cl; ac_word=$2
3337 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3338 echo "configure:3339: checking for $ac_word" >&5
3339 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3340   echo $ac_n "(cached) $ac_c" 1>&6
3341 else
3342   if test -n "$CC"; then
3343   ac_cv_prog_CC="$CC" # Let the user override the test.
3344 else
3345   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3346   ac_dummy="$PATH"
3347   for ac_dir in $ac_dummy; do
3348     test -z "$ac_dir" && ac_dir=.
3349     if test -f $ac_dir/$ac_word; then
3350       ac_cv_prog_CC="cl"
3351       break
3352     fi
3353   done
3354   IFS="$ac_save_ifs"
3355 fi
3356 fi
3357 CC="$ac_cv_prog_CC"
3358 if test -n "$CC"; then
3359   echo "$ac_t""$CC" 1>&6
3360 else
3361   echo "$ac_t""no" 1>&6
3362 fi
3363  ;;
3364     esac
3365   fi
3366   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
3367 fi
3368
3369 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
3370 echo "configure:3371: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
3371
3372 ac_ext=c
3373 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3374 ac_cpp='$CPP $CPPFLAGS'
3375 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3376 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3377 cross_compiling=$ac_cv_prog_cc_cross
3378
3379 cat > conftest.$ac_ext << EOF
3380
3381 #line 3382 "configure"
3382 #include "confdefs.h"
3383
3384 main(){return(0);}
3385 EOF
3386 if { (eval echo configure:3387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3387   ac_cv_prog_cc_works=yes
3388   # If we can't run a trivial program, we are probably using a cross compiler.
3389   if (./conftest; exit) 2>/dev/null; then
3390     ac_cv_prog_cc_cross=no
3391   else
3392     ac_cv_prog_cc_cross=yes
3393   fi
3394 else
3395   echo "configure: failed program was:" >&5
3396   cat conftest.$ac_ext >&5
3397   ac_cv_prog_cc_works=no
3398 fi
3399 rm -fr conftest*
3400 ac_ext=c
3401 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3402 ac_cpp='$CPP $CPPFLAGS'
3403 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3404 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3405 cross_compiling=$ac_cv_prog_cc_cross
3406
3407 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
3408 if test $ac_cv_prog_cc_works = no; then
3409   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
3410 fi
3411 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
3412 echo "configure:3413: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
3413 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
3414 cross_compiling=$ac_cv_prog_cc_cross
3415
3416 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
3417 echo "configure:3418: checking whether we are using GNU C" >&5
3418 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
3419   echo $ac_n "(cached) $ac_c" 1>&6
3420 else
3421   cat > conftest.c <<EOF
3422 #ifdef __GNUC__
3423   yes;
3424 #endif
3425 EOF
3426 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3427: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
3427   ac_cv_prog_gcc=yes
3428 else
3429   ac_cv_prog_gcc=no
3430 fi
3431 fi
3432
3433 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
3434
3435 if test $ac_cv_prog_gcc = yes; then
3436   GCC=yes
3437 else
3438   GCC=
3439 fi
3440
3441 ac_test_CFLAGS="${CFLAGS+set}"
3442 ac_save_CFLAGS="$CFLAGS"
3443 CFLAGS=
3444 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
3445 echo "configure:3446: checking whether ${CC-cc} accepts -g" >&5
3446 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
3447   echo $ac_n "(cached) $ac_c" 1>&6
3448 else
3449   echo 'void f(){}' > conftest.c
3450 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
3451   ac_cv_prog_cc_g=yes
3452 else
3453   ac_cv_prog_cc_g=no
3454 fi
3455 rm -f conftest*
3456
3457 fi
3458
3459 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
3460 if test "$ac_test_CFLAGS" = set; then
3461   CFLAGS="$ac_save_CFLAGS"
3462 elif test $ac_cv_prog_cc_g = yes; then
3463   if test "$GCC" = yes; then
3464     CFLAGS="-g -O2"
3465   else
3466     CFLAGS="-g"
3467   fi
3468 else
3469   if test "$GCC" = yes; then
3470     CFLAGS="-O2"
3471   else
3472     CFLAGS=
3473   fi
3474 fi
3475
3476 # Check whether --with-gnu-ld or --without-gnu-ld was given.
3477 if test "${with_gnu_ld+set}" = set; then
3478   withval="$with_gnu_ld"
3479   test "$withval" = no || with_gnu_ld=yes
3480 else
3481   with_gnu_ld=no
3482 fi
3483
3484 ac_prog=ld
3485 if test "$GCC" = yes; then
3486   # Check if gcc -print-prog-name=ld gives a path.
3487   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
3488 echo "configure:3489: checking for ld used by GCC" >&5
3489   case $host in
3490   *-*-mingw*)
3491     # gcc leaves a trailing carriage return which upsets mingw
3492     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3493   *)
3494     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3495   esac
3496   case $ac_prog in
3497     # Accept absolute paths.
3498     [\\/]* | [A-Za-z]:[\\/]*)
3499       re_direlt='/[^/][^/]*/\.\./'
3500       # Canonicalize the path of ld
3501       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3502       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3503         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3504       done
3505       test -z "$LD" && LD="$ac_prog"
3506       ;;
3507   "")
3508     # If it fails, then pretend we aren't using GCC.
3509     ac_prog=ld
3510     ;;
3511   *)
3512     # If it is relative, then search for the first ld in PATH.
3513     with_gnu_ld=unknown
3514     ;;
3515   esac
3516 elif test "$with_gnu_ld" = yes; then
3517   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
3518 echo "configure:3519: checking for GNU ld" >&5
3519 else
3520   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
3521 echo "configure:3522: checking for non-GNU ld" >&5
3522 fi
3523 if eval "test \"\${lt_cv_path_LD+set}\" = set"; then
3524   echo $ac_n "(cached) $ac_c" 1>&6
3525 else
3526   if test -z "$LD"; then
3527   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3528   for ac_dir in $PATH; do
3529     test -z "$ac_dir" && ac_dir=.
3530     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3531       lt_cv_path_LD="$ac_dir/$ac_prog"
3532       # Check to see if the program is GNU ld.  I'd rather use --version,
3533       # but apparently some GNU ld's only accept -v.
3534       # Break only if it was the GNU/non-GNU ld that we prefer.
3535       if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3536         test "$with_gnu_ld" != no && break
3537       else
3538         test "$with_gnu_ld" != yes && break
3539       fi
3540     fi
3541   done
3542   IFS="$ac_save_ifs"
3543 else
3544   lt_cv_path_LD="$LD" # Let the user override the test with a path.
3545 fi
3546 fi
3547
3548 LD="$lt_cv_path_LD"
3549 if test -n "$LD"; then
3550   echo "$ac_t""$LD" 1>&6
3551 else
3552   echo "$ac_t""no" 1>&6
3553 fi
3554 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
3555 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
3556 echo "configure:3557: checking if the linker ($LD) is GNU ld" >&5
3557 if eval "test \"\${lt_cv_prog_gnu_ld+set}\" = set"; then
3558   echo $ac_n "(cached) $ac_c" 1>&6
3559 else
3560   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
3561 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3562   lt_cv_prog_gnu_ld=yes
3563 else
3564   lt_cv_prog_gnu_ld=no
3565 fi
3566 fi
3567
3568 echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
3569 with_gnu_ld=$lt_cv_prog_gnu_ld
3570
3571
3572 echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
3573 echo "configure:3574: checking for $LD option to reload object files" >&5
3574 if eval "test \"\${lt_cv_ld_reload_flag+set}\" = set"; then
3575   echo $ac_n "(cached) $ac_c" 1>&6
3576 else
3577   lt_cv_ld_reload_flag='-r'
3578 fi
3579
3580 echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6
3581 reload_flag=$lt_cv_ld_reload_flag
3582 test -n "$reload_flag" && reload_flag=" $reload_flag"
3583
3584 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
3585 echo "configure:3586: checking for BSD-compatible nm" >&5
3586 if eval "test \"\${lt_cv_path_NM+set}\" = set"; then
3587   echo $ac_n "(cached) $ac_c" 1>&6
3588 else
3589   if test -n "$NM"; then
3590   # Let the user override the test.
3591   lt_cv_path_NM="$NM"
3592 else
3593   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3594   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3595     test -z "$ac_dir" && ac_dir=.
3596     tmp_nm=$ac_dir/${ac_tool_prefix}nm
3597     if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
3598       # Check to see if the nm accepts a BSD-compat flag.
3599       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3600       #   nm: unknown option "B" ignored
3601       # Tru64's nm complains that /dev/null is an invalid object file
3602       if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
3603         lt_cv_path_NM="$tmp_nm -B"
3604         break
3605       elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3606         lt_cv_path_NM="$tmp_nm -p"
3607         break
3608       else
3609         lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3610         continue # so that we can try to find one that supports BSD flags
3611       fi
3612     fi
3613   done
3614   IFS="$ac_save_ifs"
3615   test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
3616 fi
3617 fi
3618
3619 NM="$lt_cv_path_NM"
3620 echo "$ac_t""$NM" 1>&6
3621
3622 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3623 echo "configure:3624: checking whether ln -s works" >&5
3624 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3625   echo $ac_n "(cached) $ac_c" 1>&6
3626 else
3627   rm -f conftestdata
3628 if ln -s X conftestdata 2>/dev/null
3629 then
3630   rm -f conftestdata
3631   ac_cv_prog_LN_S="ln -s"
3632 else
3633   ac_cv_prog_LN_S=ln
3634 fi
3635 fi
3636 LN_S="$ac_cv_prog_LN_S"
3637 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3638   echo "$ac_t""yes" 1>&6
3639 else
3640   echo "$ac_t""no" 1>&6
3641 fi
3642
3643 echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
3644 echo "configure:3645: checking how to recognise dependant libraries" >&5
3645 if eval "test \"\${lt_cv_deplibs_check_method+set}\" = set"; then
3646   echo $ac_n "(cached) $ac_c" 1>&6
3647 else
3648   lt_cv_file_magic_cmd='$MAGIC_CMD'
3649 lt_cv_file_magic_test_file=
3650 lt_cv_deplibs_check_method='unknown'
3651 # Need to set the preceding variable on all platforms that support
3652 # interlibrary dependencies.
3653 # 'none' -- dependencies not supported.
3654 # `unknown' -- same as none, but documents that we really don't know.
3655 # 'pass_all' -- all dependencies passed with no checks.
3656 # 'test_compile' -- check by making test program.
3657 # 'file_magic [[regex]]' -- check by looking for files in library path
3658 # which responds to the $file_magic_cmd with a given egrep regex.
3659 # If you have `file' or equivalent on your system and you're not sure
3660 # whether `pass_all' will *always* work, you probably want this one.
3661
3662 case $host_os in
3663 aix4* | aix5*)
3664   lt_cv_deplibs_check_method=pass_all
3665   ;;
3666
3667 beos*)
3668   lt_cv_deplibs_check_method=pass_all
3669   ;;
3670
3671 bsdi4*)
3672   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
3673   lt_cv_file_magic_cmd='/usr/bin/file -L'
3674   lt_cv_file_magic_test_file=/shlib/libc.so
3675   ;;
3676
3677 cygwin* | mingw* | pw32*)
3678   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3679   lt_cv_file_magic_cmd='$OBJDUMP -f'
3680   ;;
3681
3682 darwin* | rhapsody*)
3683   lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
3684   lt_cv_file_magic_cmd='/usr/bin/file -L'
3685   case "$host_os" in
3686   rhapsody* | darwin1.[012])
3687     lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
3688     ;;
3689   *) # Darwin 1.3 on
3690     lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
3691     ;;
3692   esac
3693   ;;
3694
3695 freebsd*)
3696   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3697     case $host_cpu in
3698     i*86 )
3699       # Not sure whether the presence of OpenBSD here was a mistake.
3700       # Let's accept both of them until this is cleared up.
3701       lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
3702       lt_cv_file_magic_cmd=/usr/bin/file
3703       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3704       ;;
3705     esac
3706   else
3707     lt_cv_deplibs_check_method=pass_all
3708   fi
3709   ;;
3710
3711 gnu*)
3712   lt_cv_deplibs_check_method=pass_all
3713   ;;
3714
3715 hpux10.20*|hpux11*)
3716   lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
3717   lt_cv_file_magic_cmd=/usr/bin/file
3718   lt_cv_file_magic_test_file=/usr/lib/libc.sl
3719   ;;
3720
3721 irix5* | irix6*)
3722   case $host_os in
3723   irix5*)
3724     # this will be overridden with pass_all, but let us keep it just in case
3725     lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
3726     ;;
3727   *)
3728     case $LD in
3729     *-32|*"-32 ") libmagic=32-bit;;
3730     *-n32|*"-n32 ") libmagic=N32;;
3731     *-64|*"-64 ") libmagic=64-bit;;
3732     *) libmagic=never-match;;
3733     esac
3734     # this will be overridden with pass_all, but let us keep it just in case
3735     lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
3736     ;;
3737   esac
3738   lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
3739   lt_cv_deplibs_check_method=pass_all
3740   ;;
3741
3742 # This must be Linux ELF.
3743 linux-gnu*)
3744   case $host_cpu in
3745   alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
3746     lt_cv_deplibs_check_method=pass_all ;;
3747   *)
3748     # glibc up to 2.1.1 does not perform some relocations on ARM
3749     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
3750   esac
3751   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
3752   ;;
3753
3754 netbsd*)
3755   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3756     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
3757   else
3758     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
3759   fi
3760   ;;
3761
3762 newos6*)
3763   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
3764   lt_cv_file_magic_cmd=/usr/bin/file
3765   lt_cv_file_magic_test_file=/usr/lib/libnls.so
3766   ;;
3767
3768 openbsd*)
3769   lt_cv_file_magic_cmd=/usr/bin/file
3770   lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3771   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3772     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
3773   else
3774     lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
3775   fi
3776   ;;
3777
3778 osf3* | osf4* | osf5*)
3779   # this will be overridden with pass_all, but let us keep it just in case
3780   lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
3781   lt_cv_file_magic_test_file=/shlib/libc.so
3782   lt_cv_deplibs_check_method=pass_all
3783   ;;
3784
3785 sco3.2v5*)
3786   lt_cv_deplibs_check_method=pass_all
3787   ;;
3788
3789 solaris*)
3790   lt_cv_deplibs_check_method=pass_all
3791   lt_cv_file_magic_test_file=/lib/libc.so
3792   ;;
3793
3794 sysv5uw[78]* | sysv4*uw2*)
3795   lt_cv_deplibs_check_method=pass_all
3796   ;;
3797
3798 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
3799   case $host_vendor in
3800   motorola)
3801     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]'
3802     lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3803     ;;
3804   ncr)
3805     lt_cv_deplibs_check_method=pass_all
3806     ;;
3807   sequent)
3808     lt_cv_file_magic_cmd='/bin/file'
3809     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
3810     ;;
3811   sni)
3812     lt_cv_file_magic_cmd='/bin/file'
3813     lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
3814     lt_cv_file_magic_test_file=/lib/libc.so
3815     ;;
3816   esac
3817   ;;
3818 esac
3819
3820 fi
3821
3822 echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6
3823 file_magic_cmd=$lt_cv_file_magic_cmd
3824 deplibs_check_method=$lt_cv_deplibs_check_method
3825
3826 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
3827 echo "configure:3828: checking for object suffix" >&5
3828 if eval "test \"\${ac_cv_objext+set}\" = set"; then
3829   echo $ac_n "(cached) $ac_c" 1>&6
3830 else
3831   rm -f conftest*
3832 echo 'int i = 1;' > conftest.$ac_ext
3833 if { (eval echo configure:3834: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3834   for ac_file in conftest.*; do
3835     case $ac_file in
3836     *.c) ;;
3837     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
3838     esac
3839   done
3840 else
3841   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
3842 fi
3843 rm -f conftest*
3844 fi
3845
3846 echo "$ac_t""$ac_cv_objext" 1>&6
3847 OBJEXT=$ac_cv_objext
3848 ac_objext=$ac_cv_objext
3849
3850
3851
3852
3853 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
3854 echo "configure:3855: checking for executable suffix" >&5
3855 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
3856   echo $ac_n "(cached) $ac_c" 1>&6
3857 else
3858   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
3859   ac_cv_exeext=.exe
3860 else
3861   rm -f conftest*
3862   echo 'int main () { return 0; }' > conftest.$ac_ext
3863   ac_cv_exeext=
3864   if { (eval echo configure:3865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
3865     for file in conftest.*; do
3866       case $file in
3867       *.c | *.C | *.o | *.obj | *.xcoff) ;;
3868       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
3869       esac
3870     done
3871   else
3872     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
3873   fi
3874   rm -f conftest*
3875   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
3876 fi
3877 fi
3878
3879 EXEEXT=""
3880 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
3881 echo "$ac_t""${ac_cv_exeext}" 1>&6
3882 ac_exeext=$EXEEXT
3883
3884 if test $host != $build; then
3885   ac_tool_prefix=${host_alias}-
3886 else
3887   ac_tool_prefix=
3888 fi
3889
3890
3891
3892
3893 # Check for command to grab the raw symbol name followed by C symbol from nm.
3894 echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
3895 echo "configure:3896: checking command to parse $NM output" >&5
3896 if eval "test \"\${lt_cv_sys_global_symbol_pipe+set}\" = set"; then
3897   echo $ac_n "(cached) $ac_c" 1>&6
3898 else
3899   
3900 # These are sane defaults that work on at least a few old systems.
3901 # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3902
3903 # Character class describing NM global symbol codes.
3904 symcode='[BCDEGRST]'
3905
3906 # Regexp to match symbols that can be accessed directly from C.
3907 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
3908
3909 # Transform the above into a raw symbol and a C symbol.
3910 symxfrm='\1 \2\3 \3'
3911
3912 # Transform an extracted symbol line into a proper C declaration
3913 lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
3914
3915 # Transform an extracted symbol line into symbol name and symbol address
3916 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'"
3917
3918 # Define system-specific variables.
3919 case $host_os in
3920 aix*)
3921   symcode='[BCDT]'
3922   ;;
3923 cygwin* | mingw* | pw32*)
3924   symcode='[ABCDGISTW]'
3925   ;;
3926 hpux*) # Its linker distinguishes data from code symbols
3927   lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3928   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'"
3929   ;;
3930 irix*)
3931   symcode='[BCDEGRST]'
3932   ;;
3933 solaris* | sysv5*)
3934   symcode='[BDT]'
3935   ;;
3936 sysv4)
3937   symcode='[DFNSTU]'
3938   ;;
3939 esac
3940
3941 # Handle CRLF in mingw tool chain
3942 opt_cr=
3943 case $host_os in
3944 mingw*)
3945   opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
3946   ;;
3947 esac
3948
3949 # If we're using GNU nm, then use its standard symbol codes.
3950 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
3951   symcode='[ABCDGISTW]'
3952 fi
3953
3954 # Try without a prefix undercore, then with it.
3955 for ac_symprfx in "" "_"; do
3956
3957   # Write the raw and C identifiers.
3958 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[         ]\($symcode$symcode*\)[         ][      ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
3959
3960   # Check to see that the pipe works correctly.
3961   pipe_works=no
3962   rm -f conftest*
3963   cat > conftest.$ac_ext <<EOF
3964 #ifdef __cplusplus
3965 extern "C" {
3966 #endif
3967 char nm_test_var;
3968 void nm_test_func(){}
3969 #ifdef __cplusplus
3970 }
3971 #endif
3972 int main(){nm_test_var='a';nm_test_func();return(0);}
3973 EOF
3974
3975   if { (eval echo configure:3976: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3976     # Now try to grab the symbols.
3977     nlist=conftest.nm
3978     if { (eval echo configure:3979: \"$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
3979       # Try sorting and uniquifying the output.
3980       if sort "$nlist" | uniq > "$nlist"T; then
3981         mv -f "$nlist"T "$nlist"
3982       else
3983         rm -f "$nlist"T
3984       fi
3985
3986       # Make sure that we snagged all the symbols we need.
3987       if egrep ' nm_test_var$' "$nlist" >/dev/null; then
3988         if egrep ' nm_test_func$' "$nlist" >/dev/null; then
3989           cat <<EOF > conftest.$ac_ext
3990 #ifdef __cplusplus
3991 extern "C" {
3992 #endif
3993
3994 EOF
3995           # Now generate the symbol file.
3996           eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
3997
3998           cat <<EOF >> conftest.$ac_ext
3999 #if defined (__STDC__) && __STDC__
4000 # define lt_ptr void *
4001 #else
4002 # define lt_ptr char *
4003 # define const
4004 #endif
4005
4006 /* The mapping between symbol names and symbols. */
4007 const struct {
4008   const char *name;
4009   lt_ptr address;
4010 }
4011 lt_preloaded_symbols[] =
4012 {
4013 EOF
4014           sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
4015           cat <<\EOF >> conftest.$ac_ext
4016   {0, (lt_ptr) 0}
4017 };
4018
4019 #ifdef __cplusplus
4020 }
4021 #endif
4022 EOF
4023           # Now try linking the two files.
4024           mv conftest.$ac_objext conftstm.$ac_objext
4025           save_LIBS="$LIBS"
4026           save_CFLAGS="$CFLAGS"
4027           LIBS="conftstm.$ac_objext"
4028           CFLAGS="$CFLAGS$no_builtin_flag"
4029           if { (eval echo configure:4030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4030             pipe_works=yes
4031           fi
4032           LIBS="$save_LIBS"
4033           CFLAGS="$save_CFLAGS"
4034         else
4035           echo "cannot find nm_test_func in $nlist" >&5
4036         fi
4037       else
4038         echo "cannot find nm_test_var in $nlist" >&5
4039       fi
4040     else
4041       echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
4042     fi
4043   else
4044     echo "$progname: failed program was:" >&5
4045     cat conftest.$ac_ext >&5
4046   fi
4047   rm -f conftest* conftst*
4048
4049   # Do not use the global_symbol_pipe unless it works.
4050   if test "$pipe_works" = yes; then
4051     break
4052   else
4053     lt_cv_sys_global_symbol_pipe=
4054   fi
4055 done
4056
4057 fi
4058
4059 global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
4060 if test -z "$lt_cv_sys_global_symbol_pipe"; then
4061   global_symbol_to_cdecl=
4062   global_symbol_to_c_name_address=
4063 else
4064   global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
4065   global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
4066 fi
4067 if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
4068 then
4069   echo "$ac_t""failed" 1>&6
4070 else
4071   echo "$ac_t""ok" 1>&6
4072 fi
4073
4074 for ac_hdr in dlfcn.h
4075 do
4076 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4077 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4078 echo "configure:4079: checking for $ac_hdr" >&5
4079 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4080   echo $ac_n "(cached) $ac_c" 1>&6
4081 else
4082   cat > conftest.$ac_ext <<EOF
4083 #line 4084 "configure"
4084 #include "confdefs.h"
4085 #include <$ac_hdr>
4086 EOF
4087 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4088 { (eval echo configure:4089: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4089 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4090 if test -z "$ac_err"; then
4091   rm -rf conftest*
4092   eval "ac_cv_header_$ac_safe=yes"
4093 else
4094   echo "$ac_err" >&5
4095   echo "configure: failed program was:" >&5
4096   cat conftest.$ac_ext >&5
4097   rm -rf conftest*
4098   eval "ac_cv_header_$ac_safe=no"
4099 fi
4100 rm -f conftest*
4101 fi
4102 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4103   echo "$ac_t""yes" 1>&6
4104     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4105   cat >> confdefs.h <<EOF
4106 #define $ac_tr_hdr 1
4107 EOF
4108  
4109 else
4110   echo "$ac_t""no" 1>&6
4111 fi
4112 done
4113
4114
4115
4116
4117
4118 # Only perform the check for file, if the check method requires it
4119 case $deplibs_check_method in
4120 file_magic*)
4121   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
4122     echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
4123 echo "configure:4124: checking for ${ac_tool_prefix}file" >&5
4124 if eval "test \"\${lt_cv_path_MAGIC_CMD+set}\" = set"; then
4125   echo $ac_n "(cached) $ac_c" 1>&6
4126 else
4127   case $MAGIC_CMD in
4128   /*)
4129   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4130   ;;
4131   ?:/*)
4132   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
4133   ;;
4134   *)
4135   ac_save_MAGIC_CMD="$MAGIC_CMD"
4136   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4137   ac_dummy="/usr/bin:$PATH"
4138   for ac_dir in $ac_dummy; do
4139     test -z "$ac_dir" && ac_dir=.
4140     if test -f $ac_dir/${ac_tool_prefix}file; then
4141       lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
4142       if test -n "$file_magic_test_file"; then
4143         case $deplibs_check_method in
4144         "file_magic "*)
4145           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
4146           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4147           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4148             egrep "$file_magic_regex" > /dev/null; then
4149             :
4150           else
4151             cat <<EOF 1>&2
4152
4153 *** Warning: the command libtool uses to detect shared libraries,
4154 *** $file_magic_cmd, produces output that libtool cannot recognize.
4155 *** The result is that libtool may fail to recognize shared libraries
4156 *** as such.  This will affect the creation of libtool libraries that
4157 *** depend on shared libraries, but programs linked with such libtool
4158 *** libraries will work regardless of this problem.  Nevertheless, you
4159 *** may want to report the problem to your system manager and/or to
4160 *** bug-libtool@gnu.org
4161
4162 EOF
4163           fi ;;
4164         esac
4165       fi
4166       break
4167     fi
4168   done
4169   IFS="$ac_save_ifs"
4170   MAGIC_CMD="$ac_save_MAGIC_CMD"
4171   ;;
4172 esac
4173 fi
4174
4175 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4176 if test -n "$MAGIC_CMD"; then
4177   echo "$ac_t""$MAGIC_CMD" 1>&6
4178 else
4179   echo "$ac_t""no" 1>&6
4180 fi
4181
4182 if test -z "$lt_cv_path_MAGIC_CMD"; then
4183   if test -n "$ac_tool_prefix"; then
4184     echo $ac_n "checking for file""... $ac_c" 1>&6
4185 echo "configure:4186: checking for file" >&5
4186 if eval "test \"\${lt_cv_path_MAGIC_CMD+set}\" = set"; then
4187   echo $ac_n "(cached) $ac_c" 1>&6
4188 else
4189   case $MAGIC_CMD in
4190   /*)
4191   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4192   ;;
4193   ?:/*)
4194   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
4195   ;;
4196   *)
4197   ac_save_MAGIC_CMD="$MAGIC_CMD"
4198   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4199   ac_dummy="/usr/bin:$PATH"
4200   for ac_dir in $ac_dummy; do
4201     test -z "$ac_dir" && ac_dir=.
4202     if test -f $ac_dir/file; then
4203       lt_cv_path_MAGIC_CMD="$ac_dir/file"
4204       if test -n "$file_magic_test_file"; then
4205         case $deplibs_check_method in
4206         "file_magic "*)
4207           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
4208           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4209           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4210             egrep "$file_magic_regex" > /dev/null; then
4211             :
4212           else
4213             cat <<EOF 1>&2
4214
4215 *** Warning: the command libtool uses to detect shared libraries,
4216 *** $file_magic_cmd, produces output that libtool cannot recognize.
4217 *** The result is that libtool may fail to recognize shared libraries
4218 *** as such.  This will affect the creation of libtool libraries that
4219 *** depend on shared libraries, but programs linked with such libtool
4220 *** libraries will work regardless of this problem.  Nevertheless, you
4221 *** may want to report the problem to your system manager and/or to
4222 *** bug-libtool@gnu.org
4223
4224 EOF
4225           fi ;;
4226         esac
4227       fi
4228       break
4229     fi
4230   done
4231   IFS="$ac_save_ifs"
4232   MAGIC_CMD="$ac_save_MAGIC_CMD"
4233   ;;
4234 esac
4235 fi
4236
4237 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4238 if test -n "$MAGIC_CMD"; then
4239   echo "$ac_t""$MAGIC_CMD" 1>&6
4240 else
4241   echo "$ac_t""no" 1>&6
4242 fi
4243
4244   else
4245     MAGIC_CMD=:
4246   fi
4247 fi
4248
4249   fi
4250   ;;
4251 esac
4252
4253 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
4254 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
4255 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4256 echo "configure:4257: checking for $ac_word" >&5
4257 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
4258   echo $ac_n "(cached) $ac_c" 1>&6
4259 else
4260   if test -n "$RANLIB"; then
4261   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
4262 else
4263   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4264   ac_dummy="$PATH"
4265   for ac_dir in $ac_dummy; do
4266     test -z "$ac_dir" && ac_dir=.
4267     if test -f $ac_dir/$ac_word; then
4268       ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
4269       break
4270     fi
4271   done
4272   IFS="$ac_save_ifs"
4273 fi
4274 fi
4275 RANLIB="$ac_cv_prog_RANLIB"
4276 if test -n "$RANLIB"; then
4277   echo "$ac_t""$RANLIB" 1>&6
4278 else
4279   echo "$ac_t""no" 1>&6
4280 fi
4281
4282
4283 if test -z "$ac_cv_prog_RANLIB"; then
4284 if test -n "$ac_tool_prefix"; then
4285   # Extract the first word of "ranlib", so it can be a program name with args.
4286 set dummy ranlib; ac_word=$2
4287 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4288 echo "configure:4289: checking for $ac_word" >&5
4289 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
4290   echo $ac_n "(cached) $ac_c" 1>&6
4291 else
4292   if test -n "$RANLIB"; then
4293   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
4294 else
4295   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4296   ac_dummy="$PATH"
4297   for ac_dir in $ac_dummy; do
4298     test -z "$ac_dir" && ac_dir=.
4299     if test -f $ac_dir/$ac_word; then
4300       ac_cv_prog_RANLIB="ranlib"
4301       break
4302     fi
4303   done
4304   IFS="$ac_save_ifs"
4305   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
4306 fi
4307 fi
4308 RANLIB="$ac_cv_prog_RANLIB"
4309 if test -n "$RANLIB"; then
4310   echo "$ac_t""$RANLIB" 1>&6
4311 else
4312   echo "$ac_t""no" 1>&6
4313 fi
4314
4315 else
4316   RANLIB=":"
4317 fi
4318 fi
4319
4320 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
4321 set dummy ${ac_tool_prefix}strip; ac_word=$2
4322 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4323 echo "configure:4324: checking for $ac_word" >&5
4324 if eval "test \"\${ac_cv_prog_STRIP+set}\" = set"; then
4325   echo $ac_n "(cached) $ac_c" 1>&6
4326 else
4327   if test -n "$STRIP"; then
4328   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
4329 else
4330   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4331   ac_dummy="$PATH"
4332   for ac_dir in $ac_dummy; do
4333     test -z "$ac_dir" && ac_dir=.
4334     if test -f $ac_dir/$ac_word; then
4335       ac_cv_prog_STRIP="${ac_tool_prefix}strip"
4336       break
4337     fi
4338   done
4339   IFS="$ac_save_ifs"
4340 fi
4341 fi
4342 STRIP="$ac_cv_prog_STRIP"
4343 if test -n "$STRIP"; then
4344   echo "$ac_t""$STRIP" 1>&6
4345 else
4346   echo "$ac_t""no" 1>&6
4347 fi
4348
4349
4350 if test -z "$ac_cv_prog_STRIP"; then
4351 if test -n "$ac_tool_prefix"; then
4352   # Extract the first word of "strip", so it can be a program name with args.
4353 set dummy strip; ac_word=$2
4354 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4355 echo "configure:4356: checking for $ac_word" >&5
4356 if eval "test \"\${ac_cv_prog_STRIP+set}\" = set"; then
4357   echo $ac_n "(cached) $ac_c" 1>&6
4358 else
4359   if test -n "$STRIP"; then
4360   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
4361 else
4362   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4363   ac_dummy="$PATH"
4364   for ac_dir in $ac_dummy; do
4365     test -z "$ac_dir" && ac_dir=.
4366     if test -f $ac_dir/$ac_word; then
4367       ac_cv_prog_STRIP="strip"
4368       break
4369     fi
4370   done
4371   IFS="$ac_save_ifs"
4372   test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
4373 fi
4374 fi
4375 STRIP="$ac_cv_prog_STRIP"
4376 if test -n "$STRIP"; then
4377   echo "$ac_t""$STRIP" 1>&6
4378 else
4379   echo "$ac_t""no" 1>&6
4380 fi
4381
4382 else
4383   STRIP=":"
4384 fi
4385 fi
4386
4387
4388 enable_dlopen=yes
4389 enable_win32_dll=yes
4390
4391 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
4392 if test "${enable_libtool_lock+set}" = set; then
4393   enableval="$enable_libtool_lock"
4394   :
4395 fi
4396
4397 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
4398
4399 # Some flags need to be propagated to the compiler or linker for good
4400 # libtool support.
4401 case $host in
4402 *-*-irix6*)
4403   # Find out which ABI we are using.
4404   echo '#line 4405 "configure"' > conftest.$ac_ext
4405   if { (eval echo configure:4406: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4406     case `/usr/bin/file conftest.$ac_objext` in
4407     *32-bit*)
4408       LD="${LD-ld} -32"
4409       ;;
4410     *N32*)
4411       LD="${LD-ld} -n32"
4412       ;;
4413     *64-bit*)
4414       LD="${LD-ld} -64"
4415       ;;
4416     esac
4417   fi
4418   rm -rf conftest*
4419   ;;
4420
4421 *-*-sco3.2v5*)
4422   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
4423   SAVE_CFLAGS="$CFLAGS"
4424   CFLAGS="$CFLAGS -belf"
4425   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
4426 echo "configure:4427: checking whether the C compiler needs -belf" >&5
4427 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
4428   echo $ac_n "(cached) $ac_c" 1>&6
4429 else
4430   
4431      ac_ext=c
4432 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
4433 ac_cpp='$CPP $CPPFLAGS'
4434 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
4435 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
4436 cross_compiling=$ac_cv_prog_cc_cross
4437
4438      cat > conftest.$ac_ext <<EOF
4439 #line 4440 "configure"
4440 #include "confdefs.h"
4441
4442 int main() {
4443
4444 ; return 0; }
4445 EOF
4446 if { (eval echo configure:4447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4447   rm -rf conftest*
4448   lt_cv_cc_needs_belf=yes
4449 else
4450   echo "configure: failed program was:" >&5
4451   cat conftest.$ac_ext >&5
4452   rm -rf conftest*
4453   lt_cv_cc_needs_belf=no
4454 fi
4455 rm -f conftest*
4456      ac_ext=c
4457 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
4458 ac_cpp='$CPP $CPPFLAGS'
4459 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
4460 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
4461 cross_compiling=$ac_cv_prog_cc_cross
4462
4463 fi
4464
4465 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
4466   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
4467     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
4468     CFLAGS="$SAVE_CFLAGS"
4469   fi
4470   ;;
4471
4472 *-*-cygwin* | *-*-mingw* | *-*-pw32*)
4473   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
4474 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
4475 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4476 echo "configure:4477: checking for $ac_word" >&5
4477 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
4478   echo $ac_n "(cached) $ac_c" 1>&6
4479 else
4480   if test -n "$DLLTOOL"; then
4481   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
4482 else
4483   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4484   ac_dummy="$PATH"
4485   for ac_dir in $ac_dummy; do
4486     test -z "$ac_dir" && ac_dir=.
4487     if test -f $ac_dir/$ac_word; then
4488       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
4489       break
4490     fi
4491   done
4492   IFS="$ac_save_ifs"
4493 fi
4494 fi
4495 DLLTOOL="$ac_cv_prog_DLLTOOL"
4496 if test -n "$DLLTOOL"; then
4497   echo "$ac_t""$DLLTOOL" 1>&6
4498 else
4499   echo "$ac_t""no" 1>&6
4500 fi
4501
4502
4503 if test -z "$ac_cv_prog_DLLTOOL"; then
4504 if test -n "$ac_tool_prefix"; then
4505   # Extract the first word of "dlltool", so it can be a program name with args.
4506 set dummy dlltool; ac_word=$2
4507 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4508 echo "configure:4509: checking for $ac_word" >&5
4509 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
4510   echo $ac_n "(cached) $ac_c" 1>&6
4511 else
4512   if test -n "$DLLTOOL"; then
4513   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
4514 else
4515   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4516   ac_dummy="$PATH"
4517   for ac_dir in $ac_dummy; do
4518     test -z "$ac_dir" && ac_dir=.
4519     if test -f $ac_dir/$ac_word; then
4520       ac_cv_prog_DLLTOOL="dlltool"
4521       break
4522     fi
4523   done
4524   IFS="$ac_save_ifs"
4525   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
4526 fi
4527 fi
4528 DLLTOOL="$ac_cv_prog_DLLTOOL"
4529 if test -n "$DLLTOOL"; then
4530   echo "$ac_t""$DLLTOOL" 1>&6
4531 else
4532   echo "$ac_t""no" 1>&6
4533 fi
4534
4535 else
4536   DLLTOOL="false"
4537 fi
4538 fi
4539
4540   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
4541 set dummy ${ac_tool_prefix}as; ac_word=$2
4542 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4543 echo "configure:4544: checking for $ac_word" >&5
4544 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
4545   echo $ac_n "(cached) $ac_c" 1>&6
4546 else
4547   if test -n "$AS"; then
4548   ac_cv_prog_AS="$AS" # Let the user override the test.
4549 else
4550   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4551   ac_dummy="$PATH"
4552   for ac_dir in $ac_dummy; do
4553     test -z "$ac_dir" && ac_dir=.
4554     if test -f $ac_dir/$ac_word; then
4555       ac_cv_prog_AS="${ac_tool_prefix}as"
4556       break
4557     fi
4558   done
4559   IFS="$ac_save_ifs"
4560 fi
4561 fi
4562 AS="$ac_cv_prog_AS"
4563 if test -n "$AS"; then
4564   echo "$ac_t""$AS" 1>&6
4565 else
4566   echo "$ac_t""no" 1>&6
4567 fi
4568
4569
4570 if test -z "$ac_cv_prog_AS"; then
4571 if test -n "$ac_tool_prefix"; then
4572   # Extract the first word of "as", so it can be a program name with args.
4573 set dummy as; ac_word=$2
4574 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4575 echo "configure:4576: checking for $ac_word" >&5
4576 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
4577   echo $ac_n "(cached) $ac_c" 1>&6
4578 else
4579   if test -n "$AS"; then
4580   ac_cv_prog_AS="$AS" # Let the user override the test.
4581 else
4582   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4583   ac_dummy="$PATH"
4584   for ac_dir in $ac_dummy; do
4585     test -z "$ac_dir" && ac_dir=.
4586     if test -f $ac_dir/$ac_word; then
4587       ac_cv_prog_AS="as"
4588       break
4589     fi
4590   done
4591   IFS="$ac_save_ifs"
4592   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
4593 fi
4594 fi
4595 AS="$ac_cv_prog_AS"
4596 if test -n "$AS"; then
4597   echo "$ac_t""$AS" 1>&6
4598 else
4599   echo "$ac_t""no" 1>&6
4600 fi
4601
4602 else
4603   AS="false"
4604 fi
4605 fi
4606
4607   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
4608 set dummy ${ac_tool_prefix}objdump; ac_word=$2
4609 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4610 echo "configure:4611: checking for $ac_word" >&5
4611 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
4612   echo $ac_n "(cached) $ac_c" 1>&6
4613 else
4614   if test -n "$OBJDUMP"; then
4615   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
4616 else
4617   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4618   ac_dummy="$PATH"
4619   for ac_dir in $ac_dummy; do
4620     test -z "$ac_dir" && ac_dir=.
4621     if test -f $ac_dir/$ac_word; then
4622       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
4623       break
4624     fi
4625   done
4626   IFS="$ac_save_ifs"
4627 fi
4628 fi
4629 OBJDUMP="$ac_cv_prog_OBJDUMP"
4630 if test -n "$OBJDUMP"; then
4631   echo "$ac_t""$OBJDUMP" 1>&6
4632 else
4633   echo "$ac_t""no" 1>&6
4634 fi
4635
4636
4637 if test -z "$ac_cv_prog_OBJDUMP"; then
4638 if test -n "$ac_tool_prefix"; then
4639   # Extract the first word of "objdump", so it can be a program name with args.
4640 set dummy objdump; ac_word=$2
4641 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4642 echo "configure:4643: checking for $ac_word" >&5
4643 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
4644   echo $ac_n "(cached) $ac_c" 1>&6
4645 else
4646   if test -n "$OBJDUMP"; then
4647   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
4648 else
4649   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4650   ac_dummy="$PATH"
4651   for ac_dir in $ac_dummy; do
4652     test -z "$ac_dir" && ac_dir=.
4653     if test -f $ac_dir/$ac_word; then
4654       ac_cv_prog_OBJDUMP="objdump"
4655       break
4656     fi
4657   done
4658   IFS="$ac_save_ifs"
4659   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
4660 fi
4661 fi
4662 OBJDUMP="$ac_cv_prog_OBJDUMP"
4663 if test -n "$OBJDUMP"; then
4664   echo "$ac_t""$OBJDUMP" 1>&6
4665 else
4666   echo "$ac_t""no" 1>&6
4667 fi
4668
4669 else
4670   OBJDUMP="false"
4671 fi
4672 fi
4673
4674
4675   # recent cygwin and mingw systems supply a stub DllMain which the user
4676   # can override, but on older systems we have to supply one
4677   echo $ac_n "checking if libtool should supply DllMain function""... $ac_c" 1>&6
4678 echo "configure:4679: checking if libtool should supply DllMain function" >&5
4679 if eval "test \"\${lt_cv_need_dllmain+set}\" = set"; then
4680   echo $ac_n "(cached) $ac_c" 1>&6
4681 else
4682   cat > conftest.$ac_ext <<EOF
4683 #line 4684 "configure"
4684 #include "confdefs.h"
4685
4686 int main() {
4687 extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
4688       DllMain (0, 0, 0);
4689 ; return 0; }
4690 EOF
4691 if { (eval echo configure:4692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4692   rm -rf conftest*
4693   lt_cv_need_dllmain=no
4694 else
4695   echo "configure: failed program was:" >&5
4696   cat conftest.$ac_ext >&5
4697   rm -rf conftest*
4698   lt_cv_need_dllmain=yes
4699 fi
4700 rm -f conftest*
4701 fi
4702
4703 echo "$ac_t""$lt_cv_need_dllmain" 1>&6
4704
4705   case $host/$CC in
4706   *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
4707     # old mingw systems require "-dll" to link a DLL, while more recent ones
4708     # require "-mdll"
4709     SAVE_CFLAGS="$CFLAGS"
4710     CFLAGS="$CFLAGS -mdll"
4711     echo $ac_n "checking how to link DLLs""... $ac_c" 1>&6
4712 echo "configure:4713: checking how to link DLLs" >&5
4713 if eval "test \"\${lt_cv_cc_dll_switch+set}\" = set"; then
4714   echo $ac_n "(cached) $ac_c" 1>&6
4715 else
4716   cat > conftest.$ac_ext <<EOF
4717 #line 4718 "configure"
4718 #include "confdefs.h"
4719
4720 int main() {
4721
4722 ; return 0; }
4723 EOF
4724 if { (eval echo configure:4725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4725   rm -rf conftest*
4726   lt_cv_cc_dll_switch=-mdll
4727 else
4728   echo "configure: failed program was:" >&5
4729   cat conftest.$ac_ext >&5
4730   rm -rf conftest*
4731   lt_cv_cc_dll_switch=-dll
4732 fi
4733 rm -f conftest*
4734 fi
4735
4736 echo "$ac_t""$lt_cv_cc_dll_switch" 1>&6
4737     CFLAGS="$SAVE_CFLAGS" ;;
4738   *-*-cygwin* | *-*-pw32*)
4739     # cygwin systems need to pass --dll to the linker, and not link
4740     # crt.o which will require a WinMain@16 definition.
4741     lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
4742   esac
4743   ;;
4744   
4745 esac
4746
4747 # Sed substitution that helps us do robust quoting.  It backslashifies
4748 # metacharacters that are still active within double-quoted strings.
4749 Xsed='sed -e s/^X//'
4750 sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
4751
4752 # Same as above, but do not quote variable references.
4753 double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
4754
4755 # Sed substitution to delay expansion of an escaped shell variable in a
4756 # double_quote_subst'ed string.
4757 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
4758
4759 # Constants:
4760 rm="rm -f"
4761
4762 # Global variables:
4763 default_ofile=libtool
4764 can_build_shared=yes
4765
4766 # All known linkers require a `.a' archive for static linking (except M$VC,
4767 # which needs '.lib').
4768 libext=a
4769 ltmain="$ac_aux_dir/ltmain.sh"
4770 ofile="$default_ofile"
4771 with_gnu_ld="$lt_cv_prog_gnu_ld"
4772 need_locks="$enable_libtool_lock"
4773
4774 old_CC="$CC"
4775 old_CFLAGS="$CFLAGS"
4776
4777 # Set sane defaults for various variables
4778 test -z "$AR" && AR=ar
4779 test -z "$AR_FLAGS" && AR_FLAGS=cru
4780 test -z "$AS" && AS=as
4781 test -z "$CC" && CC=cc
4782 test -z "$DLLTOOL" && DLLTOOL=dlltool
4783 test -z "$LD" && LD=ld
4784 test -z "$LN_S" && LN_S="ln -s"
4785 test -z "$MAGIC_CMD" && MAGIC_CMD=file
4786 test -z "$NM" && NM=nm
4787 test -z "$OBJDUMP" && OBJDUMP=objdump
4788 test -z "$RANLIB" && RANLIB=:
4789 test -z "$STRIP" && STRIP=:
4790 test -z "$ac_objext" && ac_objext=o
4791
4792 if test x"$host" != x"$build"; then
4793   ac_tool_prefix=${host_alias}-
4794 else
4795   ac_tool_prefix=
4796 fi
4797
4798 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
4799 case $host_os in
4800 linux-gnu*) ;;
4801 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
4802 esac
4803
4804 case $host_os in
4805 aix3*)
4806   # AIX sometimes has problems with the GCC collect2 program.  For some
4807   # reason, if we set the COLLECT_NAMES environment variable, the problems
4808   # vanish in a puff of smoke.
4809   if test "X${COLLECT_NAMES+set}" != Xset; then
4810     COLLECT_NAMES=
4811     export COLLECT_NAMES
4812   fi
4813   ;;
4814 esac
4815
4816 # Determine commands to create old-style static archives.
4817 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
4818 old_postinstall_cmds='chmod 644 $oldlib'
4819 old_postuninstall_cmds=
4820
4821 if test -n "$RANLIB"; then
4822   case $host_os in
4823   openbsd*)
4824     old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
4825     ;;
4826   *)
4827     old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
4828     ;;
4829   esac
4830   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
4831 fi
4832
4833 # Allow CC to be a program name with arguments.
4834 set dummy $CC
4835 compiler="$2"
4836
4837 echo $ac_n "checking for objdir""... $ac_c" 1>&6
4838 echo "configure:4839: checking for objdir" >&5
4839 rm -f .libs 2>/dev/null
4840 mkdir .libs 2>/dev/null
4841 if test -d .libs; then
4842   objdir=.libs
4843 else
4844   # MS-DOS does not allow filenames that begin with a dot.
4845   objdir=_libs
4846 fi
4847 rmdir .libs 2>/dev/null
4848 echo "$ac_t""$objdir" 1>&6
4849
4850
4851 # Check whether --with-pic or --without-pic was given.
4852 if test "${with_pic+set}" = set; then
4853   withval="$with_pic"
4854   pic_mode="$withval"
4855 else
4856   pic_mode=default
4857 fi
4858
4859 test -z "$pic_mode" && pic_mode=default
4860
4861 # We assume here that the value for lt_cv_prog_cc_pic will not be cached
4862 # in isolation, and that seeing it set (from the cache) indicates that
4863 # the associated values are set (in the cache) correctly too.
4864 echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6
4865 echo "configure:4866: checking for $compiler option to produce PIC" >&5
4866 if eval "test \"\${lt_cv_prog_cc_pic+set}\" = set"; then
4867   echo $ac_n "(cached) $ac_c" 1>&6
4868 else
4869    lt_cv_prog_cc_pic=
4870   lt_cv_prog_cc_shlib=
4871   lt_cv_prog_cc_wl=
4872   lt_cv_prog_cc_static=
4873   lt_cv_prog_cc_no_builtin=
4874   lt_cv_prog_cc_can_build_shared=$can_build_shared
4875
4876   if test "$GCC" = yes; then
4877     lt_cv_prog_cc_wl='-Wl,'
4878     lt_cv_prog_cc_static='-static'
4879
4880     case $host_os in
4881     aix*)
4882       # Below there is a dirty hack to force normal static linking with -ldl
4883       # The problem is because libdl dynamically linked with both libc and
4884       # libC (AIX C++ library), which obviously doesn't included in libraries
4885       # list by gcc. This cause undefined symbols with -static flags.
4886       # This hack allows C programs to be linked with "-static -ldl", but
4887       # not sure about C++ programs.
4888       lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
4889       ;;
4890     amigaos*)
4891       # FIXME: we need at least 68020 code to build shared libraries, but
4892       # adding the `-m68020' flag to GCC prevents building anything better,
4893       # like `-m68040'.
4894       lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
4895       ;;
4896     beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
4897       # PIC is the default for these OSes.
4898       ;;
4899     darwin* | rhapsody*)
4900       # PIC is the default on this platform
4901       # Common symbols not allowed in MH_DYLIB files
4902       lt_cv_prog_cc_pic='-fno-common'
4903       ;;
4904     cygwin* | mingw* | pw32* | os2*)
4905       # This hack is so that the source file can tell whether it is being
4906       # built for inclusion in a dll (and should export symbols for example).
4907       lt_cv_prog_cc_pic='-DDLL_EXPORT'
4908       ;;
4909     sysv4*MP*)
4910       if test -d /usr/nec; then
4911          lt_cv_prog_cc_pic=-Kconform_pic
4912       fi
4913       ;;
4914     *)
4915       lt_cv_prog_cc_pic='-fPIC'
4916       ;;
4917     esac
4918   else
4919     # PORTME Check for PIC flags for the system compiler.
4920     case $host_os in
4921     aix3* | aix4* | aix5*)
4922       lt_cv_prog_cc_wl='-Wl,'
4923       # All AIX code is PIC.
4924       if test "$host_cpu" = ia64; then
4925         # AIX 5 now supports IA64 processor
4926         lt_cv_prog_cc_static='-Bstatic'
4927       else
4928         lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
4929       fi
4930       ;;
4931
4932     hpux9* | hpux10* | hpux11*)
4933       # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
4934       lt_cv_prog_cc_wl='-Wl,'
4935       lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
4936       lt_cv_prog_cc_pic='+Z'
4937       ;;
4938
4939     irix5* | irix6*)
4940       lt_cv_prog_cc_wl='-Wl,'
4941       lt_cv_prog_cc_static='-non_shared'
4942       # PIC (with -KPIC) is the default.
4943       ;;
4944
4945     cygwin* | mingw* | pw32* | os2*)
4946       # This hack is so that the source file can tell whether it is being
4947       # built for inclusion in a dll (and should export symbols for example).
4948       lt_cv_prog_cc_pic='-DDLL_EXPORT'
4949       ;;
4950
4951     newsos6)
4952       lt_cv_prog_cc_pic='-KPIC'
4953       lt_cv_prog_cc_static='-Bstatic'
4954       ;;
4955
4956     osf3* | osf4* | osf5*)
4957       # All OSF/1 code is PIC.
4958       lt_cv_prog_cc_wl='-Wl,'
4959       lt_cv_prog_cc_static='-non_shared'
4960       ;;
4961
4962     sco3.2v5*)
4963       lt_cv_prog_cc_pic='-Kpic'
4964       lt_cv_prog_cc_static='-dn'
4965       lt_cv_prog_cc_shlib='-belf'
4966       ;;
4967
4968     solaris*)
4969       lt_cv_prog_cc_pic='-KPIC'
4970       lt_cv_prog_cc_static='-Bstatic'
4971       lt_cv_prog_cc_wl='-Wl,'
4972       ;;
4973
4974     sunos4*)
4975       lt_cv_prog_cc_pic='-PIC'
4976       lt_cv_prog_cc_static='-Bstatic'
4977       lt_cv_prog_cc_wl='-Qoption ld '
4978       ;;
4979
4980     sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
4981       lt_cv_prog_cc_pic='-KPIC'
4982       lt_cv_prog_cc_static='-Bstatic'
4983       if test "x$host_vendor" = xsni; then
4984         lt_cv_prog_cc_wl='-LD'
4985       else
4986         lt_cv_prog_cc_wl='-Wl,'
4987       fi
4988       ;;
4989
4990     uts4*)
4991       lt_cv_prog_cc_pic='-pic'
4992       lt_cv_prog_cc_static='-Bstatic'
4993       ;;
4994
4995     sysv4*MP*)
4996       if test -d /usr/nec ;then
4997         lt_cv_prog_cc_pic='-Kconform_pic'
4998         lt_cv_prog_cc_static='-Bstatic'
4999       fi
5000       ;;
5001
5002     *)
5003       lt_cv_prog_cc_can_build_shared=no
5004       ;;
5005     esac
5006   fi
5007
5008 fi
5009
5010 if test -z "$lt_cv_prog_cc_pic"; then
5011   echo "$ac_t""none" 1>&6
5012 else
5013   echo "$ac_t""$lt_cv_prog_cc_pic" 1>&6
5014
5015   # Check to make sure the pic_flag actually works.
5016   echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6
5017 echo "configure:5018: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
5018   if eval "test \"\${lt_cv_prog_cc_pic_works+set}\" = set"; then
5019   echo $ac_n "(cached) $ac_c" 1>&6
5020 else
5021       save_CFLAGS="$CFLAGS"
5022     CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
5023     cat > conftest.$ac_ext <<EOF
5024 #line 5025 "configure"
5025 #include "confdefs.h"
5026
5027 int main() {
5028
5029 ; return 0; }
5030 EOF
5031 if { (eval echo configure:5032: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5032   rm -rf conftest*
5033         case $host_os in
5034       hpux9* | hpux10* | hpux11*)
5035         # On HP-UX, both CC and GCC only warn that PIC is supported... then
5036         # they create non-PIC objects.  So, if there were any warnings, we
5037         # assume that PIC is not supported.
5038         if test -s conftest.err; then
5039           lt_cv_prog_cc_pic_works=no
5040         else
5041           lt_cv_prog_cc_pic_works=yes
5042         fi
5043         ;;
5044       *)
5045         lt_cv_prog_cc_pic_works=yes
5046         ;;
5047       esac
5048     
5049 else
5050   echo "configure: failed program was:" >&5
5051   cat conftest.$ac_ext >&5
5052   rm -rf conftest*
5053         lt_cv_prog_cc_pic_works=no
5054     
5055 fi
5056 rm -f conftest*
5057     CFLAGS="$save_CFLAGS"
5058   
5059 fi
5060
5061
5062   if test "X$lt_cv_prog_cc_pic_works" = Xno; then
5063     lt_cv_prog_cc_pic=
5064     lt_cv_prog_cc_can_build_shared=no
5065   else
5066     lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
5067   fi
5068
5069   echo "$ac_t""$lt_cv_prog_cc_pic_works" 1>&6
5070 fi
5071
5072 # Check for any special shared library compilation flags.
5073 if test -n "$lt_cv_prog_cc_shlib"; then
5074   echo "configure: warning: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" 1>&2
5075   if echo "$old_CC $old_CFLAGS " | egrep -e "[  ]$lt_cv_prog_cc_shlib[  ]" >/dev/null; then :
5076   else
5077    echo "configure: warning: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2
5078     lt_cv_prog_cc_can_build_shared=no
5079   fi
5080 fi
5081
5082 echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6
5083 echo "configure:5084: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
5084 if eval "test \"\${lt_cv_prog_cc_static_works+set}\" = set"; then
5085   echo $ac_n "(cached) $ac_c" 1>&6
5086 else
5087     lt_cv_prog_cc_static_works=no
5088   save_LDFLAGS="$LDFLAGS"
5089   LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
5090   cat > conftest.$ac_ext <<EOF
5091 #line 5092 "configure"
5092 #include "confdefs.h"
5093
5094 int main() {
5095
5096 ; return 0; }
5097 EOF
5098 if { (eval echo configure:5099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5099   rm -rf conftest*
5100   lt_cv_prog_cc_static_works=yes
5101 else
5102   echo "configure: failed program was:" >&5
5103   cat conftest.$ac_ext >&5
5104 fi
5105 rm -f conftest*
5106   LDFLAGS="$save_LDFLAGS"
5107
5108 fi
5109
5110
5111 # Belt *and* braces to stop my trousers falling down:
5112 test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
5113 echo "$ac_t""$lt_cv_prog_cc_static_works" 1>&6
5114
5115 pic_flag="$lt_cv_prog_cc_pic"
5116 special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
5117 wl="$lt_cv_prog_cc_wl"
5118 link_static_flag="$lt_cv_prog_cc_static"
5119 no_builtin_flag="$lt_cv_prog_cc_no_builtin"
5120 can_build_shared="$lt_cv_prog_cc_can_build_shared"
5121
5122
5123 # Check to see if options -o and -c are simultaneously supported by compiler
5124 echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6
5125 echo "configure:5126: checking if $compiler supports -c -o file.$ac_objext" >&5
5126 if eval "test \"\${lt_cv_compiler_c_o+set}\" = set"; then
5127   echo $ac_n "(cached) $ac_c" 1>&6
5128 else
5129   
5130 $rm -r conftest 2>/dev/null
5131 mkdir conftest
5132 cd conftest
5133 echo "int some_variable = 0;" > conftest.$ac_ext
5134 mkdir out
5135 # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
5136 # that will create temporary files in the current directory regardless of
5137 # the output directory.  Thus, making CWD read-only will cause this test
5138 # to fail, enabling locking or at least warning the user not to do parallel
5139 # builds.
5140 chmod -w .
5141 save_CFLAGS="$CFLAGS"
5142 CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
5143 compiler_c_o=no
5144 if { (eval echo configure:5145: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
5145   # The compiler can only warn and ignore the option if not recognized
5146   # So say no if there are warnings
5147   if test -s out/conftest.err; then
5148     lt_cv_compiler_c_o=no
5149   else
5150     lt_cv_compiler_c_o=yes
5151   fi
5152 else
5153   # Append any errors to the config.log.
5154   cat out/conftest.err 1>&5
5155   lt_cv_compiler_c_o=no
5156 fi
5157 CFLAGS="$save_CFLAGS"
5158 chmod u+w .
5159 $rm conftest* out/*
5160 rmdir out
5161 cd ..
5162 rmdir conftest
5163 $rm -r conftest 2>/dev/null
5164
5165 fi
5166
5167 compiler_c_o=$lt_cv_compiler_c_o
5168 echo "$ac_t""$compiler_c_o" 1>&6
5169
5170 if test x"$compiler_c_o" = x"yes"; then
5171   # Check to see if we can write to a .lo
5172   echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6
5173 echo "configure:5174: checking if $compiler supports -c -o file.lo" >&5
5174   if eval "test \"\${lt_cv_compiler_o_lo+set}\" = set"; then
5175   echo $ac_n "(cached) $ac_c" 1>&6
5176 else
5177   
5178   lt_cv_compiler_o_lo=no
5179   save_CFLAGS="$CFLAGS"
5180   CFLAGS="$CFLAGS -c -o conftest.lo"
5181   save_objext="$ac_objext"
5182   ac_objext=lo
5183   cat > conftest.$ac_ext <<EOF
5184 #line 5185 "configure"
5185 #include "confdefs.h"
5186
5187 int main() {
5188 int some_variable = 0;
5189 ; return 0; }
5190 EOF
5191 if { (eval echo configure:5192: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5192   rm -rf conftest*
5193       # The compiler can only warn and ignore the option if not recognized
5194     # So say no if there are warnings
5195     if test -s conftest.err; then
5196       lt_cv_compiler_o_lo=no
5197     else
5198       lt_cv_compiler_o_lo=yes
5199     fi
5200   
5201 else
5202   echo "configure: failed program was:" >&5
5203   cat conftest.$ac_ext >&5
5204 fi
5205 rm -f conftest*
5206   ac_objext="$save_objext"
5207   CFLAGS="$save_CFLAGS"
5208   
5209 fi
5210
5211   compiler_o_lo=$lt_cv_compiler_o_lo
5212   echo "$ac_t""$compiler_o_lo" 1>&6
5213 else
5214   compiler_o_lo=no
5215 fi
5216
5217 # Check to see if we can do hard links to lock some files if needed
5218 hard_links="nottested"
5219 if test "$compiler_c_o" = no && test "$need_locks" != no; then
5220   # do not overwrite the value of need_locks provided by the user
5221   echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6
5222 echo "configure:5223: checking if we can lock with hard links" >&5
5223   hard_links=yes
5224   $rm conftest*
5225   ln conftest.a conftest.b 2>/dev/null && hard_links=no
5226   touch conftest.a
5227   ln conftest.a conftest.b 2>&5 || hard_links=no
5228   ln conftest.a conftest.b 2>/dev/null && hard_links=no
5229   echo "$ac_t""$hard_links" 1>&6
5230   if test "$hard_links" = no; then
5231     echo "configure: warning: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" 1>&2
5232     need_locks=warn
5233   fi
5234 else
5235   need_locks=no
5236 fi
5237
5238 if test "$GCC" = yes; then
5239   # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
5240   echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6
5241 echo "configure:5242: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
5242   echo "int some_variable = 0;" > conftest.$ac_ext
5243   save_CFLAGS="$CFLAGS"
5244   CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
5245   compiler_rtti_exceptions=no
5246   cat > conftest.$ac_ext <<EOF
5247 #line 5248 "configure"
5248 #include "confdefs.h"
5249
5250 int main() {
5251 int some_variable = 0;
5252 ; return 0; }
5253 EOF
5254 if { (eval echo configure:5255: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5255   rm -rf conftest*
5256       # The compiler can only warn and ignore the option if not recognized
5257     # So say no if there are warnings
5258     if test -s conftest.err; then
5259       compiler_rtti_exceptions=no
5260     else
5261       compiler_rtti_exceptions=yes
5262     fi
5263   
5264 else
5265   echo "configure: failed program was:" >&5
5266   cat conftest.$ac_ext >&5
5267 fi
5268 rm -f conftest*
5269   CFLAGS="$save_CFLAGS"
5270   echo "$ac_t""$compiler_rtti_exceptions" 1>&6
5271
5272   if test "$compiler_rtti_exceptions" = "yes"; then
5273     no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
5274   else
5275     no_builtin_flag=' -fno-builtin'
5276   fi
5277 fi
5278
5279 # See if the linker supports building shared libraries.
5280 echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6
5281 echo "configure:5282: checking whether the linker ($LD) supports shared libraries" >&5
5282
5283 allow_undefined_flag=
5284 no_undefined_flag=
5285 need_lib_prefix=unknown
5286 need_version=unknown
5287 # when you set need_version to no, make sure it does not cause -set_version
5288 # flags to be left without arguments
5289 archive_cmds=
5290 archive_expsym_cmds=
5291 old_archive_from_new_cmds=
5292 old_archive_from_expsyms_cmds=
5293 export_dynamic_flag_spec=
5294 whole_archive_flag_spec=
5295 thread_safe_flag_spec=
5296 hardcode_into_libs=no
5297 hardcode_libdir_flag_spec=
5298 hardcode_libdir_separator=
5299 hardcode_direct=no
5300 hardcode_minus_L=no
5301 hardcode_shlibpath_var=unsupported
5302 runpath_var=
5303 link_all_deplibs=unknown
5304 always_export_symbols=no
5305 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
5306 # include_expsyms should be a list of space-separated symbols to be *always*
5307 # included in the symbol list
5308 include_expsyms=
5309 # exclude_expsyms can be an egrep regular expression of symbols to exclude
5310 # it will be wrapped by ` (' and `)$', so one must not match beginning or
5311 # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5312 # as well as any symbol that contains `d'.
5313 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
5314 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5315 # platforms (ab)use it in PIC code, but their linkers get confused if
5316 # the symbol is explicitly referenced.  Since portable code cannot
5317 # rely on this symbol name, it's probably fine to never include it in
5318 # preloaded symbol tables.
5319 extract_expsyms_cmds=
5320
5321 case $host_os in
5322 cygwin* | mingw* | pw32*)
5323   # FIXME: the MSVC++ port hasn't been tested in a loooong time
5324   # When not using gcc, we currently assume that we are using
5325   # Microsoft Visual C++.
5326   if test "$GCC" != yes; then
5327     with_gnu_ld=no
5328   fi
5329   ;;
5330 openbsd*)
5331   with_gnu_ld=no
5332   ;;
5333 esac
5334
5335 ld_shlibs=yes
5336 if test "$with_gnu_ld" = yes; then
5337   # If archive_cmds runs LD, not CC, wlarc should be empty
5338   wlarc='${wl}'
5339
5340   # See if GNU ld supports shared libraries.
5341   case $host_os in
5342   aix3* | aix4* | aix5*)
5343     # On AIX, the GNU linker is very broken
5344     # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
5345     ld_shlibs=no
5346     cat <<EOF 1>&2
5347
5348 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
5349 *** to be unable to reliably create shared libraries on AIX.
5350 *** Therefore, libtool is disabling shared libraries support.  If you
5351 *** really care for shared libraries, you may want to modify your PATH
5352 *** so that a non-GNU linker is found, and then restart.
5353
5354 EOF
5355     ;;
5356
5357   amigaos*)
5358     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)'
5359     hardcode_libdir_flag_spec='-L$libdir'
5360     hardcode_minus_L=yes
5361
5362     # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
5363     # that the semantics of dynamic libraries on AmigaOS, at least up
5364     # to version 4, is to share data among multiple programs linked
5365     # with the same dynamic library.  Since this doesn't match the
5366     # behavior of shared libraries on other platforms, we can use
5367     # them.
5368     ld_shlibs=no
5369     ;;
5370
5371   beos*)
5372     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5373       allow_undefined_flag=unsupported
5374       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5375       # support --undefined.  This deserves some investigation.  FIXME
5376       archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5377     else
5378       ld_shlibs=no
5379     fi
5380     ;;
5381
5382   cygwin* | mingw* | pw32*)
5383     # hardcode_libdir_flag_spec is actually meaningless, as there is
5384     # no search path for DLLs.
5385     hardcode_libdir_flag_spec='-L$libdir'
5386     allow_undefined_flag=unsupported
5387     always_export_symbols=yes
5388
5389     extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
5390       sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
5391       test -f $output_objdir/impgen.exe || (cd $output_objdir && \
5392       if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
5393       else $CC -o impgen impgen.c ; fi)~
5394       $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
5395
5396     old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
5397
5398     # cygwin and mingw dlls have different entry points and sets of symbols
5399     # to exclude.
5400     # FIXME: what about values for MSVC?
5401     dll_entry=__cygwin_dll_entry@12
5402     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
5403     case $host_os in
5404     mingw*)
5405       # mingw values
5406       dll_entry=_DllMainCRTStartup@12
5407       dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
5408       ;;
5409     esac
5410
5411     # mingw and cygwin differ, and it's simplest to just exclude the union
5412     # of the two symbol sets.
5413     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
5414
5415     # recent cygwin and mingw systems supply a stub DllMain which the user
5416     # can override, but on older systems we have to supply one (in ltdll.c)
5417     if test "x$lt_cv_need_dllmain" = "xyes"; then
5418       ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
5419       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~
5420         test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
5421     else
5422       ltdll_obj=
5423       ltdll_cmds=
5424     fi
5425
5426     # Extract the symbol export list from an `--export-all' def file,
5427     # then regenerate the def file from the symbol export list, so that
5428     # the compiled dll only exports the symbol export list.
5429     # Be careful not to strip the DATA tag left be newer dlltools.
5430     export_symbols_cmds="$ltdll_cmds"'
5431       $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
5432       sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
5433
5434     # If the export-symbols file already is a .def file (1st line
5435     # is EXPORTS), use it as is.
5436     # If DATA tags from a recent dlltool are present, honour them!
5437     archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
5438         cp $export_symbols $output_objdir/$soname-def;
5439       else
5440         echo EXPORTS > $output_objdir/$soname-def;
5441         _lt_hint=1;
5442         cat $export_symbols | while read symbol; do
5443          set dummy \$symbol;
5444          case \$# in
5445            2) echo "   \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
5446            *) echo "     \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
5447          esac;
5448          _lt_hint=`expr 1 + \$_lt_hint`;
5449         done;
5450       fi~
5451       '"$ltdll_cmds"'
5452       $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~
5453       $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~
5454       $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~
5455       $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~
5456       $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
5457     ;;
5458
5459   netbsd*)
5460     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5461       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5462       wlarc=
5463     else
5464       archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5465       archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5466     fi
5467     ;;
5468
5469   solaris* | sysv5*)
5470     if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
5471       ld_shlibs=no
5472       cat <<EOF 1>&2
5473
5474 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
5475 *** create shared libraries on Solaris systems.  Therefore, libtool
5476 *** is disabling shared libraries support.  We urge you to upgrade GNU
5477 *** binutils to release 2.9.1 or newer.  Another option is to modify
5478 *** your PATH or compiler configuration so that the native linker is
5479 *** used, and then restart.
5480
5481 EOF
5482     elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5483       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5484       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5485     else
5486       ld_shlibs=no
5487     fi
5488     ;;
5489
5490   sunos4*)
5491     archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5492     wlarc=
5493     hardcode_direct=yes
5494     hardcode_shlibpath_var=no
5495     ;;
5496
5497   *)
5498     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5499       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5500       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5501     else
5502       ld_shlibs=no
5503     fi
5504     ;;
5505   esac
5506
5507   if test "$ld_shlibs" = yes; then
5508     runpath_var=LD_RUN_PATH
5509     hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
5510     export_dynamic_flag_spec='${wl}--export-dynamic'
5511     case $host_os in
5512     cygwin* | mingw* | pw32*)
5513       # dlltool doesn't understand --whole-archive et. al.
5514       whole_archive_flag_spec=
5515       ;;
5516     *)
5517       # ancient GNU ld didn't support --whole-archive et. al.
5518       if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
5519         whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5520       else
5521         whole_archive_flag_spec=
5522       fi
5523       ;;
5524     esac
5525   fi
5526 else
5527   # PORTME fill in a description of your system's linker (not GNU ld)
5528   case $host_os in
5529   aix3*)
5530     allow_undefined_flag=unsupported
5531     always_export_symbols=yes
5532     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'
5533     # Note: this linker hardcodes the directories in LIBPATH if there
5534     # are no directories specified by -L.
5535     hardcode_minus_L=yes
5536     if test "$GCC" = yes && test -z "$link_static_flag"; then
5537       # Neither direct hardcoding nor static linking is supported with a
5538       # broken collect2.
5539       hardcode_direct=unsupported
5540     fi
5541     ;;
5542
5543   aix4* | aix5*)
5544     if test "$host_cpu" = ia64; then
5545       # On IA64, the linker does run time linking by default, so we don't
5546       # have to do anything special.
5547       aix_use_runtimelinking=no
5548       exp_sym_flag='-Bexport'
5549       no_entry_flag=""
5550     else
5551       aix_use_runtimelinking=no
5552
5553       # Test if we are trying to use run time linking or normal
5554       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5555       # need to do runtime linking.
5556       case $host_os in aix4.[23]|aix4.[23].*|aix5*)
5557         for ld_flag in $LDFLAGS; do
5558           if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
5559             aix_use_runtimelinking=yes
5560             break
5561           fi
5562         done
5563       esac
5564
5565       exp_sym_flag='-bexport'
5566       no_entry_flag='-bnoentry'
5567     fi
5568
5569     # When large executables or shared objects are built, AIX ld can
5570     # have problems creating the table of contents.  If linking a library
5571     # or program results in "error TOC overflow" add -mminimal-toc to
5572     # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5573     # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5574
5575     hardcode_direct=yes
5576     archive_cmds=''
5577     hardcode_libdir_separator=':'
5578     if test "$GCC" = yes; then
5579       case $host_os in aix4.[012]|aix4.[012].*)
5580         collect2name=`${CC} -print-prog-name=collect2`
5581         if test -f "$collect2name" && \
5582           strings "$collect2name" | grep resolve_lib_name >/dev/null
5583         then
5584           # We have reworked collect2
5585           hardcode_direct=yes
5586         else
5587           # We have old collect2
5588           hardcode_direct=unsupported
5589           # It fails to find uninstalled libraries when the uninstalled
5590           # path is not listed in the libpath.  Setting hardcode_minus_L
5591           # to unsupported forces relinking
5592           hardcode_minus_L=yes
5593           hardcode_libdir_flag_spec='-L$libdir'
5594           hardcode_libdir_separator=
5595         fi
5596       esac
5597
5598       shared_flag='-shared'
5599     else
5600       # not using gcc
5601       if test "$host_cpu" = ia64; then
5602         shared_flag='${wl}-G'
5603       else
5604         if test "$aix_use_runtimelinking" = yes; then
5605           shared_flag='${wl}-G'
5606         else
5607           shared_flag='${wl}-bM:SRE'
5608         fi
5609       fi
5610     fi
5611
5612     # It seems that -bexpall can do strange things, so it is better to
5613     # generate a list of symbols to export.
5614     always_export_symbols=yes
5615     if test "$aix_use_runtimelinking" = yes; then
5616       # Warning - without using the other runtime loading flags (-brtl),
5617       # -berok will link without error, but may produce a broken library.
5618       allow_undefined_flag='-berok'
5619       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
5620       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"
5621     else
5622       if test "$host_cpu" = ia64; then
5623         hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
5624         allow_undefined_flag="-z nodefs"
5625         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"
5626       else
5627         hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
5628         # Warning - without using the other run time loading flags,
5629         # -berok will link without error, but may produce a broken library.
5630         allow_undefined_flag='${wl}-berok'
5631         # This is a bit strange, but is similar to how AIX traditionally builds
5632         # it's shared libraries.
5633         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'
5634       fi
5635     fi
5636     ;;
5637
5638   amigaos*)
5639     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)'
5640     hardcode_libdir_flag_spec='-L$libdir'
5641     hardcode_minus_L=yes
5642     # see comment about different semantics on the GNU ld section
5643     ld_shlibs=no
5644     ;;
5645
5646   cygwin* | mingw* | pw32*)
5647     # When not using gcc, we currently assume that we are using
5648     # Microsoft Visual C++.
5649     # hardcode_libdir_flag_spec is actually meaningless, as there is
5650     # no search path for DLLs.
5651     hardcode_libdir_flag_spec=' '
5652     allow_undefined_flag=unsupported
5653     # Tell ltmain to make .lib files, not .a files.
5654     libext=lib
5655     # FIXME: Setting linknames here is a bad hack.
5656     archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
5657     # The linker will automatically build a .lib file if we build a DLL.
5658     old_archive_from_new_cmds='true'
5659     # FIXME: Should let the user specify the lib program.
5660     old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
5661     fix_srcfile_path='`cygpath -w "$srcfile"`'
5662     ;;
5663
5664   darwin* | rhapsody*)
5665     case "$host_os" in
5666     rhapsody* | darwin1.[012])
5667       allow_undefined_flag='-undefined suppress'
5668       ;;
5669     *) # Darwin 1.3 on
5670       allow_undefined_flag='-flat_namespace -undefined suppress'
5671       ;;
5672     esac
5673     # FIXME: Relying on posixy $() will cause problems for
5674     #        cross-compilation, but unfortunately the echo tests do not
5675     #        yet detect zsh echo's removal of \ escapes.
5676     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'
5677     # We need to add '_' to the symbols in $export_symbols first
5678     #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
5679     hardcode_direct=yes
5680     hardcode_shlibpath_var=no
5681     whole_archive_flag_spec='-all_load $convenience'
5682     ;;
5683
5684   freebsd1*)
5685     ld_shlibs=no
5686     ;;
5687
5688   # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5689   # support.  Future versions do this automatically, but an explicit c++rt0.o
5690   # does not break anything, and helps significantly (at the cost of a little
5691   # extra space).
5692   freebsd2.2*)
5693     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5694     hardcode_libdir_flag_spec='-R$libdir'
5695     hardcode_direct=yes
5696     hardcode_shlibpath_var=no
5697     ;;
5698
5699   # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5700   freebsd2*)
5701     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5702     hardcode_direct=yes
5703     hardcode_minus_L=yes
5704     hardcode_shlibpath_var=no
5705     ;;
5706
5707   # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5708   freebsd*)
5709     archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
5710     hardcode_libdir_flag_spec='-R$libdir'
5711     hardcode_direct=yes
5712     hardcode_shlibpath_var=no
5713     ;;
5714
5715   hpux9* | hpux10* | hpux11*)
5716     case $host_os in
5717     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' ;;
5718     *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
5719     esac
5720     hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
5721     hardcode_libdir_separator=:
5722     hardcode_direct=yes
5723     hardcode_minus_L=yes # Not in the search PATH, but as the default
5724                          # location of the library.
5725     export_dynamic_flag_spec='${wl}-E'
5726     ;;
5727
5728   irix5* | irix6*)
5729     if test "$GCC" = yes; then
5730       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'
5731     else
5732       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'
5733     fi
5734     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5735     hardcode_libdir_separator=:
5736     link_all_deplibs=yes
5737     ;;
5738
5739   netbsd*)
5740     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5741       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5742     else
5743       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5744     fi
5745     hardcode_libdir_flag_spec='-R$libdir'
5746     hardcode_direct=yes
5747     hardcode_shlibpath_var=no
5748     ;;
5749
5750   newsos6)
5751     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5752     hardcode_direct=yes
5753     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5754     hardcode_libdir_separator=:
5755     hardcode_shlibpath_var=no
5756     ;;
5757
5758   openbsd*)
5759     hardcode_direct=yes
5760     hardcode_shlibpath_var=no
5761     if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5762       archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
5763       hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
5764       export_dynamic_flag_spec='${wl}-E'
5765     else
5766       case "$host_os" in
5767       openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
5768         archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5769         hardcode_libdir_flag_spec='-R$libdir'
5770         ;;
5771       *)
5772         archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
5773         hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
5774         ;;
5775       esac
5776     fi
5777     ;;
5778
5779   os2*)
5780     hardcode_libdir_flag_spec='-L$libdir'
5781     hardcode_minus_L=yes
5782     allow_undefined_flag=unsupported
5783     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'
5784     old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
5785     ;;
5786
5787   osf3*)
5788     if test "$GCC" = yes; then
5789       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
5790       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'
5791     else
5792       allow_undefined_flag=' -expect_unresolved \*'
5793       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'
5794     fi
5795     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5796     hardcode_libdir_separator=:
5797     ;;
5798
5799   osf4* | osf5*)        # as osf3* with the addition of -msym flag
5800     if test "$GCC" = yes; then
5801       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
5802       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'
5803       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5804     else
5805       allow_undefined_flag=' -expect_unresolved \*'
5806       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'
5807       archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
5808       $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'
5809
5810       #Both c and cxx compiler support -rpath directly
5811       hardcode_libdir_flag_spec='-rpath $libdir'
5812     fi
5813     hardcode_libdir_separator=:
5814     ;;
5815
5816   sco3.2v5*)
5817     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5818     hardcode_shlibpath_var=no
5819     runpath_var=LD_RUN_PATH
5820     hardcode_runpath_var=yes
5821     export_dynamic_flag_spec='${wl}-Bexport'
5822     ;;
5823
5824   solaris*)
5825     # gcc --version < 3.0 without binutils cannot create self contained
5826     # shared libraries reliably, requiring libgcc.a to resolve some of
5827     # the object symbols generated in some cases.  Libraries that use
5828     # assert need libgcc.a to resolve __eprintf, for example.  Linking
5829     # a copy of libgcc.a into every shared library to guarantee resolving
5830     # such symbols causes other problems:  According to Tim Van Holder
5831     # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
5832     # (to the application) exception stack for one thing.
5833     no_undefined_flag=' -z defs'
5834     if test "$GCC" = yes; then
5835       case `$CC --version 2>/dev/null` in
5836       [12].*)
5837         cat <<EOF 1>&2
5838
5839 *** Warning: Releases of GCC earlier than version 3.0 cannot reliably
5840 *** create self contained shared libraries on Solaris systems, without
5841 *** introducing a dependency on libgcc.a.  Therefore, libtool is disabling
5842 *** -no-undefined support, which will at least allow you to build shared
5843 *** libraries.  However, you may find that when you link such libraries
5844 *** into an application without using GCC, you have to manually add
5845 *** \`gcc --print-libgcc-file-name\` to the link command.  We urge you to
5846 *** upgrade to a newer version of GCC.  Another option is to rebuild your
5847 *** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
5848
5849 EOF
5850         no_undefined_flag=
5851         ;;
5852       esac
5853     fi
5854     # $CC -shared without GNU ld will not create a library from C++
5855     # object files and a static libstdc++, better avoid it by now
5856     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
5857     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
5858                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
5859     hardcode_libdir_flag_spec='-R$libdir'
5860     hardcode_shlibpath_var=no
5861     case $host_os in
5862     solaris2.[0-5] | solaris2.[0-5].*) ;;
5863     *) # Supported since Solaris 2.6 (maybe 2.5.1?)
5864       whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
5865     esac
5866     link_all_deplibs=yes
5867     ;;
5868
5869   sunos4*)
5870     if test "x$host_vendor" = xsequent; then
5871       # Use $CC to link under sequent, because it throws in some extra .o
5872       # files that make .init and .fini sections work.
5873       archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5874     else
5875       archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5876     fi
5877     hardcode_libdir_flag_spec='-L$libdir'
5878     hardcode_direct=yes
5879     hardcode_minus_L=yes
5880     hardcode_shlibpath_var=no
5881     ;;
5882
5883   sysv4)
5884     if test "x$host_vendor" = xsno; then
5885       archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags'
5886       hardcode_direct=yes # is this really true???
5887     else
5888       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5889       hardcode_direct=no #Motorola manual says yes, but my tests say they lie
5890     fi
5891     runpath_var='LD_RUN_PATH'
5892     hardcode_shlibpath_var=no
5893     ;;
5894
5895   sysv4.3*)
5896     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5897     hardcode_shlibpath_var=no
5898     export_dynamic_flag_spec='-Bexport'
5899     ;;
5900
5901   sysv5*)
5902     no_undefined_flag=' -z text'
5903     # $CC -shared without GNU ld will not create a library from C++
5904     # object files and a static libstdc++, better avoid it by now
5905     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
5906     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
5907                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
5908     hardcode_libdir_flag_spec=
5909     hardcode_shlibpath_var=no
5910     runpath_var='LD_RUN_PATH'
5911     ;;
5912
5913   uts4*)
5914     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5915     hardcode_libdir_flag_spec='-L$libdir'
5916     hardcode_shlibpath_var=no
5917     ;;
5918
5919   dgux*)
5920     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5921     hardcode_libdir_flag_spec='-L$libdir'
5922     hardcode_shlibpath_var=no
5923     ;;
5924
5925   sysv4*MP*)
5926     if test -d /usr/nec; then
5927       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5928       hardcode_shlibpath_var=no
5929       runpath_var=LD_RUN_PATH
5930       hardcode_runpath_var=yes
5931       ld_shlibs=yes
5932     fi
5933     ;;
5934
5935   sysv4.2uw2*)
5936     archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5937     hardcode_direct=yes
5938     hardcode_minus_L=no
5939     hardcode_shlibpath_var=no
5940     hardcode_runpath_var=yes
5941     runpath_var=LD_RUN_PATH
5942     ;;
5943
5944   sysv5uw7* | unixware7*)
5945     no_undefined_flag='${wl}-z ${wl}text'
5946     if test "$GCC" = yes; then
5947       archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5948     else
5949       archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5950     fi
5951     runpath_var='LD_RUN_PATH'
5952     hardcode_shlibpath_var=no
5953     ;;
5954
5955   *)
5956     ld_shlibs=no
5957     ;;
5958   esac
5959 fi
5960 echo "$ac_t""$ld_shlibs" 1>&6
5961 test "$ld_shlibs" = no && can_build_shared=no
5962
5963 # Check hardcoding attributes.
5964 echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6
5965 echo "configure:5966: checking how to hardcode library paths into programs" >&5
5966 hardcode_action=
5967 if test -n "$hardcode_libdir_flag_spec" || \
5968    test -n "$runpath_var"; then
5969
5970   # We can hardcode non-existant directories.
5971   if test "$hardcode_direct" != no &&
5972      # If the only mechanism to avoid hardcoding is shlibpath_var, we
5973      # have to relink, otherwise we might link with an installed library
5974      # when we should be linking with a yet-to-be-installed one
5975      ## test "$hardcode_shlibpath_var" != no &&
5976      test "$hardcode_minus_L" != no; then
5977     # Linking always hardcodes the temporary library directory.
5978     hardcode_action=relink
5979   else
5980     # We can link without hardcoding, and we can hardcode nonexisting dirs.
5981     hardcode_action=immediate
5982   fi
5983 else
5984   # We cannot hardcode anything, or else we can only hardcode existing
5985   # directories.
5986   hardcode_action=unsupported
5987 fi
5988 echo "$ac_t""$hardcode_action" 1>&6
5989
5990 striplib=
5991 old_striplib=
5992 echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6
5993 echo "configure:5994: checking whether stripping libraries is possible" >&5
5994 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
5995   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
5996   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
5997   echo "$ac_t""yes" 1>&6
5998 else
5999   echo "$ac_t""no" 1>&6
6000 fi
6001
6002 reload_cmds='$LD$reload_flag -o $output$reload_objs'
6003 test -z "$deplibs_check_method" && deplibs_check_method=unknown
6004
6005 # PORTME Fill in your ld.so characteristics
6006 echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6
6007 echo "configure:6008: checking dynamic linker characteristics" >&5
6008 library_names_spec=
6009 libname_spec='lib$name'
6010 soname_spec=
6011 postinstall_cmds=
6012 postuninstall_cmds=
6013 finish_cmds=
6014 finish_eval=
6015 shlibpath_var=
6016 shlibpath_overrides_runpath=unknown
6017 version_type=none
6018 dynamic_linker="$host_os ld.so"
6019 sys_lib_dlsearch_path_spec="/lib /usr/lib"
6020 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
6021
6022 case $host_os in
6023 aix3*)
6024   version_type=linux
6025   library_names_spec='${libname}${release}.so$versuffix $libname.a'
6026   shlibpath_var=LIBPATH
6027
6028   # AIX has no versioning support, so we append a major version to the name.
6029   soname_spec='${libname}${release}.so$major'
6030   ;;
6031
6032 aix4* | aix5*)
6033   version_type=linux
6034   if test "$host_cpu" = ia64; then
6035     # AIX 5 supports IA64
6036     library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
6037     shlibpath_var=LD_LIBRARY_PATH
6038   else
6039     # With GCC up to 2.95.x, collect2 would create an import file
6040     # for dependence libraries.  The import file would start with
6041     # the line `#! .'.  This would cause the generated library to
6042     # depend on `.', always an invalid library.  This was fixed in
6043     # development snapshots of GCC prior to 3.0.
6044     case $host_os in
6045       aix4 | aix4.[01] | aix4.[01].*)
6046         if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
6047              echo ' yes '
6048              echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
6049           :
6050         else
6051           can_build_shared=no
6052         fi
6053         ;;
6054     esac
6055     # AIX (on Power*) has no versioning support, so currently we can
6056     # not hardcode correct soname into executable. Probably we can
6057     # add versioning support to collect2, so additional links can
6058     # be useful in future.
6059     if test "$aix_use_runtimelinking" = yes; then
6060       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
6061       # instead of lib<name>.a to let people know that these are not
6062       # typical AIX shared libraries.
6063       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6064     else
6065       # We preserve .a as extension for shared libraries through AIX4.2
6066       # and later when we are not doing run time linking.
6067       library_names_spec='${libname}${release}.a $libname.a'
6068       soname_spec='${libname}${release}.so$major'
6069     fi
6070     shlibpath_var=LIBPATH
6071   fi
6072   ;;
6073
6074 amigaos*)
6075   library_names_spec='$libname.ixlibrary $libname.a'
6076   # Create ${libname}_ixlibrary.a entries in /sys/libs.
6077   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'
6078   ;;
6079
6080 beos*)
6081   library_names_spec='${libname}.so'
6082   dynamic_linker="$host_os ld.so"
6083   shlibpath_var=LIBRARY_PATH
6084   ;;
6085
6086 bsdi4*)
6087   version_type=linux
6088   need_version=no
6089   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6090   soname_spec='${libname}${release}.so$major'
6091   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
6092   shlibpath_var=LD_LIBRARY_PATH
6093   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
6094   sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
6095   export_dynamic_flag_spec=-rdynamic
6096   # the default ld.so.conf also contains /usr/contrib/lib and
6097   # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
6098   # libtool to hard-code these into programs
6099   ;;
6100
6101 cygwin* | mingw* | pw32*)
6102   version_type=windows
6103   need_version=no
6104   need_lib_prefix=no
6105   case $GCC,$host_os in
6106   yes,cygwin*)
6107     library_names_spec='$libname.dll.a'
6108     soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
6109     postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
6110       dldir=$destdir/`dirname \$dlpath`~
6111       test -d \$dldir || mkdir -p \$dldir~
6112       $install_prog .libs/$dlname \$dldir/$dlname'
6113     postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
6114       dlpath=$dir/\$dldll~
6115        $rm \$dlpath'
6116     ;;
6117   yes,mingw*)
6118     library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
6119     sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
6120     ;;
6121   yes,pw32*)
6122     library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll'
6123     ;;
6124   *)
6125     library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
6126     ;;
6127   esac
6128   dynamic_linker='Win32 ld.exe'
6129   # FIXME: first we should search . and the directory the executable is in
6130   shlibpath_var=PATH
6131   ;;
6132
6133 darwin* | rhapsody*)
6134   dynamic_linker="$host_os dyld"
6135   version_type=darwin
6136   need_lib_prefix=no
6137   need_version=no
6138   # FIXME: Relying on posixy $() will cause problems for
6139   #        cross-compilation, but unfortunately the echo tests do not
6140   #        yet detect zsh echo's removal of \ escapes.
6141   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)'
6142   soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
6143   shlibpath_overrides_runpath=yes
6144   shlibpath_var=DYLD_LIBRARY_PATH
6145   ;;
6146
6147 freebsd1*)
6148   dynamic_linker=no
6149   ;;
6150
6151 freebsd*)
6152   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
6153   version_type=freebsd-$objformat
6154   case $version_type in
6155     freebsd-elf*)
6156       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
6157       need_version=no
6158       need_lib_prefix=no
6159       ;;
6160     freebsd-*)
6161       library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
6162       need_version=yes
6163       ;;
6164   esac
6165   shlibpath_var=LD_LIBRARY_PATH
6166   case $host_os in
6167   freebsd2*)
6168     shlibpath_overrides_runpath=yes
6169     ;;
6170   *)
6171     shlibpath_overrides_runpath=no
6172     hardcode_into_libs=yes
6173     ;;
6174   esac
6175   ;;
6176
6177 gnu*)
6178   version_type=linux
6179   need_lib_prefix=no
6180   need_version=no
6181   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
6182   soname_spec='${libname}${release}.so$major'
6183   shlibpath_var=LD_LIBRARY_PATH
6184   hardcode_into_libs=yes
6185   ;;
6186
6187 hpux9* | hpux10* | hpux11*)
6188   # Give a soname corresponding to the major version so that dld.sl refuses to
6189   # link against other versions.
6190   dynamic_linker="$host_os dld.sl"
6191   version_type=sunos
6192   need_lib_prefix=no
6193   need_version=no
6194   shlibpath_var=SHLIB_PATH
6195   shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
6196   library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
6197   soname_spec='${libname}${release}.sl$major'
6198   # HP-UX runs *really* slowly unless shared libraries are mode 555.
6199   postinstall_cmds='chmod 555 $lib'
6200   ;;
6201
6202 irix5* | irix6*)
6203   version_type=irix
6204   need_lib_prefix=no
6205   need_version=no
6206   soname_spec='${libname}${release}.so$major'
6207   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
6208   case $host_os in
6209   irix5*)
6210     libsuff= shlibsuff=
6211     ;;
6212   *)
6213     case $LD in # libtool.m4 will add one of these switches to LD
6214     *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
6215     *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
6216     *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
6217     *) libsuff= shlibsuff= libmagic=never-match;;
6218     esac
6219     ;;
6220   esac
6221   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
6222   shlibpath_overrides_runpath=no
6223   sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
6224   sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
6225   ;;
6226
6227 # No shared lib support for Linux oldld, aout, or coff.
6228 linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
6229   dynamic_linker=no
6230   ;;
6231
6232 # This must be Linux ELF.
6233 linux-gnu*)
6234   version_type=linux
6235   need_lib_prefix=no
6236   need_version=no
6237   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6238   soname_spec='${libname}${release}.so$major'
6239   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
6240   shlibpath_var=LD_LIBRARY_PATH
6241   shlibpath_overrides_runpath=no
6242   # This implies no fast_install, which is unacceptable.
6243   # Some rework will be needed to allow for fast_install
6244   # before this can be enabled.
6245   hardcode_into_libs=yes
6246
6247   # We used to test for /lib/ld.so.1 and disable shared libraries on
6248   # powerpc, because MkLinux only supported shared libraries with the
6249   # GNU dynamic linker.  Since this was broken with cross compilers,
6250   # most powerpc-linux boxes support dynamic linking these days and
6251   # people can always --disable-shared, the test was removed, and we
6252   # assume the GNU/Linux dynamic linker is in use.
6253   dynamic_linker='GNU/Linux ld.so'
6254   ;;
6255
6256 netbsd*)
6257   version_type=sunos
6258   need_lib_prefix=no
6259   need_version=no
6260   if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6261     library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6262     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6263     dynamic_linker='NetBSD (a.out) ld.so'
6264   else
6265     library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
6266     soname_spec='${libname}${release}.so$major'
6267     dynamic_linker='NetBSD ld.elf_so'
6268   fi
6269   shlibpath_var=LD_LIBRARY_PATH
6270   shlibpath_overrides_runpath=yes
6271   hardcode_into_libs=yes
6272   ;;
6273
6274 newsos6)
6275   version_type=linux
6276   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6277   shlibpath_var=LD_LIBRARY_PATH
6278   shlibpath_overrides_runpath=yes
6279   ;;
6280
6281 openbsd*)
6282   version_type=sunos
6283   need_lib_prefix=no
6284   need_version=no
6285   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6286     case "$host_os" in
6287     openbsd2.[89] | openbsd2.[89].*)
6288       shlibpath_overrides_runpath=no
6289       ;;
6290     *)
6291       shlibpath_overrides_runpath=yes
6292       ;;
6293     esac
6294   else
6295     shlibpath_overrides_runpath=yes
6296   fi
6297   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6298   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6299   shlibpath_var=LD_LIBRARY_PATH
6300   ;;
6301
6302 os2*)
6303   libname_spec='$name'
6304   need_lib_prefix=no
6305   library_names_spec='$libname.dll $libname.a'
6306   dynamic_linker='OS/2 ld.exe'
6307   shlibpath_var=LIBPATH
6308   ;;
6309
6310 osf3* | osf4* | osf5*)
6311   version_type=osf
6312   need_version=no
6313   soname_spec='${libname}${release}.so'
6314   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
6315   shlibpath_var=LD_LIBRARY_PATH
6316   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
6317   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
6318   ;;
6319
6320 sco3.2v5*)
6321   version_type=osf
6322   soname_spec='${libname}${release}.so$major'
6323   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6324   shlibpath_var=LD_LIBRARY_PATH
6325   ;;
6326
6327 solaris*)
6328   version_type=linux
6329   need_lib_prefix=no
6330   need_version=no
6331   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6332   soname_spec='${libname}${release}.so$major'
6333   shlibpath_var=LD_LIBRARY_PATH
6334   shlibpath_overrides_runpath=yes
6335   hardcode_into_libs=yes
6336   # ldd complains unless libraries are executable
6337   postinstall_cmds='chmod +x $lib'
6338   ;;
6339
6340 sunos4*)
6341   version_type=sunos
6342   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6343   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
6344   shlibpath_var=LD_LIBRARY_PATH
6345   shlibpath_overrides_runpath=yes
6346   if test "$with_gnu_ld" = yes; then
6347     need_lib_prefix=no
6348   fi
6349   need_version=yes
6350   ;;
6351
6352 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6353   version_type=linux
6354   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6355   soname_spec='${libname}${release}.so$major'
6356   shlibpath_var=LD_LIBRARY_PATH
6357   case $host_vendor in
6358     sni)
6359       shlibpath_overrides_runpath=no
6360       ;;
6361     motorola)
6362       need_lib_prefix=no
6363       need_version=no
6364       shlibpath_overrides_runpath=no
6365       sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
6366       ;;
6367   esac
6368   ;;
6369
6370 uts4*)
6371   version_type=linux
6372   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6373   soname_spec='${libname}${release}.so$major'
6374   shlibpath_var=LD_LIBRARY_PATH
6375   ;;
6376
6377 dgux*)
6378   version_type=linux
6379   need_lib_prefix=no
6380   need_version=no
6381   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6382   soname_spec='${libname}${release}.so$major'
6383   shlibpath_var=LD_LIBRARY_PATH
6384   ;;
6385
6386 sysv4*MP*)
6387   if test -d /usr/nec ;then
6388     version_type=linux
6389     library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
6390     soname_spec='$libname.so.$major'
6391     shlibpath_var=LD_LIBRARY_PATH
6392   fi
6393   ;;
6394
6395 *)
6396   dynamic_linker=no
6397   ;;
6398 esac
6399 echo "$ac_t""$dynamic_linker" 1>&6
6400 test "$dynamic_linker" = no && can_build_shared=no
6401
6402 # Report the final consequences.
6403 echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6
6404 echo "configure:6405: checking if libtool supports shared libraries" >&5
6405 echo "$ac_t""$can_build_shared" 1>&6
6406
6407 echo $ac_n "checking whether to build shared libraries""... $ac_c" 1>&6
6408 echo "configure:6409: checking whether to build shared libraries" >&5
6409 test "$can_build_shared" = "no" && enable_shared=no
6410
6411 # On AIX, shared libraries and static libraries use the same namespace, and
6412 # are all built from PIC.
6413 case "$host_os" in
6414 aix3*)
6415   test "$enable_shared" = yes && enable_static=no
6416   if test -n "$RANLIB"; then
6417     archive_cmds="$archive_cmds~\$RANLIB \$lib"
6418     postinstall_cmds='$RANLIB $lib'
6419   fi
6420   ;;
6421
6422 aix4*)
6423   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6424     test "$enable_shared" = yes && enable_static=no
6425   fi
6426   ;;
6427 esac
6428 echo "$ac_t""$enable_shared" 1>&6
6429
6430 echo $ac_n "checking whether to build static libraries""... $ac_c" 1>&6
6431 echo "configure:6432: checking whether to build static libraries" >&5
6432 # Make sure either enable_shared or enable_static is yes.
6433 test "$enable_shared" = yes || enable_static=yes
6434 echo "$ac_t""$enable_static" 1>&6
6435
6436 if test "$hardcode_action" = relink; then
6437   # Fast installation is not supported
6438   enable_fast_install=no
6439 elif test "$shlibpath_overrides_runpath" = yes ||
6440      test "$enable_shared" = no; then
6441   # Fast installation is not necessary
6442   enable_fast_install=needless
6443 fi
6444
6445 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
6446 if test "$GCC" = yes; then
6447   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
6448 fi
6449
6450 if test "x$enable_dlopen" != xyes; then
6451   enable_dlopen=unknown
6452   enable_dlopen_self=unknown
6453   enable_dlopen_self_static=unknown
6454 else
6455   lt_cv_dlopen=no
6456   lt_cv_dlopen_libs=
6457
6458   case $host_os in
6459   beos*)
6460     lt_cv_dlopen="load_add_on"
6461     lt_cv_dlopen_libs=
6462     lt_cv_dlopen_self=yes
6463     ;;
6464
6465   cygwin* | mingw* | pw32*)
6466     lt_cv_dlopen="LoadLibrary"
6467     lt_cv_dlopen_libs=
6468    ;;
6469
6470   *)
6471     echo $ac_n "checking for shl_load""... $ac_c" 1>&6
6472 echo "configure:6473: checking for shl_load" >&5
6473 if eval "test \"\${ac_cv_func_shl_load+set}\" = set"; then
6474   echo $ac_n "(cached) $ac_c" 1>&6
6475 else
6476   cat > conftest.$ac_ext <<EOF
6477 #line 6478 "configure"
6478 #include "confdefs.h"
6479 /* System header to define __stub macros and hopefully few prototypes,
6480     which can conflict with char shl_load(); below.  */
6481 #include <assert.h>
6482 /* Override any gcc2 internal prototype to avoid an error.  */
6483 /* We use char because int might match the return type of a gcc2
6484     builtin and then its argument prototype would still apply.  */
6485 char shl_load();
6486 char (*f)();
6487
6488 int main() {
6489
6490 /* The GNU C library defines this for functions which it implements
6491     to always fail with ENOSYS.  Some functions are actually named
6492     something starting with __ and the normal name is an alias.  */
6493 #if defined (__stub_shl_load) || defined (__stub___shl_load)
6494 choke me
6495 #else
6496 f = shl_load;
6497 #endif
6498
6499 ; return 0; }
6500 EOF
6501 if { (eval echo configure:6502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6502   rm -rf conftest*
6503   eval "ac_cv_func_shl_load=yes"
6504 else
6505   echo "configure: failed program was:" >&5
6506   cat conftest.$ac_ext >&5
6507   rm -rf conftest*
6508   eval "ac_cv_func_shl_load=no"
6509 fi
6510 rm -f conftest*
6511 fi
6512
6513 if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
6514   echo "$ac_t""yes" 1>&6
6515   lt_cv_dlopen="shl_load"
6516 else
6517   echo "$ac_t""no" 1>&6
6518 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
6519 echo "configure:6520: checking for shl_load in -ldld" >&5
6520 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-:%__p__%'`
6521 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6522   echo $ac_n "(cached) $ac_c" 1>&6
6523 else
6524   ac_save_LIBS="$LIBS"
6525 LIBS="-ldld  $LIBS"
6526 cat > conftest.$ac_ext <<EOF
6527 #line 6528 "configure"
6528 #include "confdefs.h"
6529 /* Override any gcc2 internal prototype to avoid an error.  */
6530 /* We use char because int might match the return type of a gcc2
6531     builtin and then its argument prototype would still apply.  */
6532 char shl_load();
6533
6534 int main() {
6535 shl_load()
6536 ; return 0; }
6537 EOF
6538 if { (eval echo configure:6539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6539   rm -rf conftest*
6540   eval "ac_cv_lib_$ac_lib_var=yes"
6541 else
6542   echo "configure: failed program was:" >&5
6543   cat conftest.$ac_ext >&5
6544   rm -rf conftest*
6545   eval "ac_cv_lib_$ac_lib_var=no"
6546 fi
6547 rm -f conftest*
6548 LIBS="$ac_save_LIBS"
6549
6550 fi
6551 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6552   echo "$ac_t""yes" 1>&6
6553   lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
6554 else
6555   echo "$ac_t""no" 1>&6
6556 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
6557 echo "configure:6558: checking for dlopen" >&5
6558 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
6559   echo $ac_n "(cached) $ac_c" 1>&6
6560 else
6561   cat > conftest.$ac_ext <<EOF
6562 #line 6563 "configure"
6563 #include "confdefs.h"
6564 /* System header to define __stub macros and hopefully few prototypes,
6565     which can conflict with char dlopen(); below.  */
6566 #include <assert.h>
6567 /* Override any gcc2 internal prototype to avoid an error.  */
6568 /* We use char because int might match the return type of a gcc2
6569     builtin and then its argument prototype would still apply.  */
6570 char dlopen();
6571 char (*f)();
6572
6573 int main() {
6574
6575 /* The GNU C library defines this for functions which it implements
6576     to always fail with ENOSYS.  Some functions are actually named
6577     something starting with __ and the normal name is an alias.  */
6578 #if defined (__stub_dlopen) || defined (__stub___dlopen)
6579 choke me
6580 #else
6581 f = dlopen;
6582 #endif
6583
6584 ; return 0; }
6585 EOF
6586 if { (eval echo configure:6587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6587   rm -rf conftest*
6588   eval "ac_cv_func_dlopen=yes"
6589 else
6590   echo "configure: failed program was:" >&5
6591   cat conftest.$ac_ext >&5
6592   rm -rf conftest*
6593   eval "ac_cv_func_dlopen=no"
6594 fi
6595 rm -f conftest*
6596 fi
6597
6598 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
6599   echo "$ac_t""yes" 1>&6
6600   lt_cv_dlopen="dlopen"
6601 else
6602   echo "$ac_t""no" 1>&6
6603 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
6604 echo "configure:6605: checking for dlopen in -ldl" >&5
6605 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
6606 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6607   echo $ac_n "(cached) $ac_c" 1>&6
6608 else
6609   ac_save_LIBS="$LIBS"
6610 LIBS="-ldl  $LIBS"
6611 cat > conftest.$ac_ext <<EOF
6612 #line 6613 "configure"
6613 #include "confdefs.h"
6614 /* Override any gcc2 internal prototype to avoid an error.  */
6615 /* We use char because int might match the return type of a gcc2
6616     builtin and then its argument prototype would still apply.  */
6617 char dlopen();
6618
6619 int main() {
6620 dlopen()
6621 ; return 0; }
6622 EOF
6623 if { (eval echo configure:6624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6624   rm -rf conftest*
6625   eval "ac_cv_lib_$ac_lib_var=yes"
6626 else
6627   echo "configure: failed program was:" >&5
6628   cat conftest.$ac_ext >&5
6629   rm -rf conftest*
6630   eval "ac_cv_lib_$ac_lib_var=no"
6631 fi
6632 rm -f conftest*
6633 LIBS="$ac_save_LIBS"
6634
6635 fi
6636 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6637   echo "$ac_t""yes" 1>&6
6638   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
6639 else
6640   echo "$ac_t""no" 1>&6
6641 echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
6642 echo "configure:6643: checking for dlopen in -lsvld" >&5
6643 ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-:%__p__%'`
6644 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6645   echo $ac_n "(cached) $ac_c" 1>&6
6646 else
6647   ac_save_LIBS="$LIBS"
6648 LIBS="-lsvld  $LIBS"
6649 cat > conftest.$ac_ext <<EOF
6650 #line 6651 "configure"
6651 #include "confdefs.h"
6652 /* Override any gcc2 internal prototype to avoid an error.  */
6653 /* We use char because int might match the return type of a gcc2
6654     builtin and then its argument prototype would still apply.  */
6655 char dlopen();
6656
6657 int main() {
6658 dlopen()
6659 ; return 0; }
6660 EOF
6661 if { (eval echo configure:6662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6662   rm -rf conftest*
6663   eval "ac_cv_lib_$ac_lib_var=yes"
6664 else
6665   echo "configure: failed program was:" >&5
6666   cat conftest.$ac_ext >&5
6667   rm -rf conftest*
6668   eval "ac_cv_lib_$ac_lib_var=no"
6669 fi
6670 rm -f conftest*
6671 LIBS="$ac_save_LIBS"
6672
6673 fi
6674 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6675   echo "$ac_t""yes" 1>&6
6676   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
6677 else
6678   echo "$ac_t""no" 1>&6
6679 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
6680 echo "configure:6681: checking for dld_link in -ldld" >&5
6681 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-:%__p__%'`
6682 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6683   echo $ac_n "(cached) $ac_c" 1>&6
6684 else
6685   ac_save_LIBS="$LIBS"
6686 LIBS="-ldld  $LIBS"
6687 cat > conftest.$ac_ext <<EOF
6688 #line 6689 "configure"
6689 #include "confdefs.h"
6690 /* Override any gcc2 internal prototype to avoid an error.  */
6691 /* We use char because int might match the return type of a gcc2
6692     builtin and then its argument prototype would still apply.  */
6693 char dld_link();
6694
6695 int main() {
6696 dld_link()
6697 ; return 0; }
6698 EOF
6699 if { (eval echo configure:6700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6700   rm -rf conftest*
6701   eval "ac_cv_lib_$ac_lib_var=yes"
6702 else
6703   echo "configure: failed program was:" >&5
6704   cat conftest.$ac_ext >&5
6705   rm -rf conftest*
6706   eval "ac_cv_lib_$ac_lib_var=no"
6707 fi
6708 rm -f conftest*
6709 LIBS="$ac_save_LIBS"
6710
6711 fi
6712 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6713   echo "$ac_t""yes" 1>&6
6714   lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
6715 else
6716   echo "$ac_t""no" 1>&6
6717 fi
6718
6719               
6720 fi
6721
6722             
6723 fi
6724
6725           
6726 fi
6727
6728         
6729 fi
6730
6731       
6732 fi
6733
6734     ;;
6735   esac
6736
6737   if test "x$lt_cv_dlopen" != xno; then
6738     enable_dlopen=yes
6739   else
6740     enable_dlopen=no
6741   fi
6742
6743   case $lt_cv_dlopen in
6744   dlopen)
6745     save_CPPFLAGS="$CPPFLAGS"
6746         test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
6747
6748     save_LDFLAGS="$LDFLAGS"
6749     eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
6750
6751     save_LIBS="$LIBS"
6752     LIBS="$lt_cv_dlopen_libs $LIBS"
6753
6754     echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
6755 echo "configure:6756: checking whether a program can dlopen itself" >&5
6756 if eval "test \"\${lt_cv_dlopen_self+set}\" = set"; then
6757   echo $ac_n "(cached) $ac_c" 1>&6
6758 else
6759           if test "$cross_compiling" = yes; then :
6760   lt_cv_dlopen_self=cross
6761 else
6762     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
6763   lt_status=$lt_dlunknown
6764   cat > conftest.$ac_ext <<EOF
6765 #line 6766 "configure"
6766 #include "confdefs.h"
6767
6768 #if HAVE_DLFCN_H
6769 #include <dlfcn.h>
6770 #endif
6771
6772 #include <stdio.h>
6773
6774 #ifdef RTLD_GLOBAL
6775 #  define LT_DLGLOBAL           RTLD_GLOBAL
6776 #else
6777 #  ifdef DL_GLOBAL
6778 #    define LT_DLGLOBAL         DL_GLOBAL
6779 #  else
6780 #    define LT_DLGLOBAL         0
6781 #  endif
6782 #endif
6783
6784 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
6785    find out it does not work in some platform. */
6786 #ifndef LT_DLLAZY_OR_NOW
6787 #  ifdef RTLD_LAZY
6788 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
6789 #  else
6790 #    ifdef DL_LAZY
6791 #      define LT_DLLAZY_OR_NOW          DL_LAZY
6792 #    else
6793 #      ifdef RTLD_NOW
6794 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
6795 #      else
6796 #        ifdef DL_NOW
6797 #          define LT_DLLAZY_OR_NOW      DL_NOW
6798 #        else
6799 #          define LT_DLLAZY_OR_NOW      0
6800 #        endif
6801 #      endif
6802 #    endif
6803 #  endif
6804 #endif
6805
6806 #ifdef __cplusplus
6807 extern "C" void exit (int);
6808 #endif
6809
6810 void fnord() { int i=42;}
6811 int main ()
6812 {
6813   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
6814   int status = $lt_dlunknown;
6815
6816   if (self)
6817     {
6818       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
6819       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
6820       /* dlclose (self); */
6821     }
6822
6823     exit (status);
6824 }
6825 EOF
6826   if { (eval echo configure:6827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
6827     (./conftest; exit; ) 2>/dev/null
6828     lt_status=$?
6829     case x$lt_status in
6830       x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
6831       x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
6832       x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
6833     esac
6834   else :
6835     # compilation failed
6836     lt_cv_dlopen_self=no
6837   fi
6838 fi
6839 rm -fr conftest*
6840
6841     
6842 fi
6843
6844 echo "$ac_t""$lt_cv_dlopen_self" 1>&6
6845
6846     if test "x$lt_cv_dlopen_self" = xyes; then
6847       LDFLAGS="$LDFLAGS $link_static_flag"
6848       echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
6849 echo "configure:6850: checking whether a statically linked program can dlopen itself" >&5
6850 if eval "test \"\${lt_cv_dlopen_self_static+set}\" = set"; then
6851   echo $ac_n "(cached) $ac_c" 1>&6
6852 else
6853           if test "$cross_compiling" = yes; then :
6854   lt_cv_dlopen_self_static=cross
6855 else
6856     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
6857   lt_status=$lt_dlunknown
6858   cat > conftest.$ac_ext <<EOF
6859 #line 6860 "configure"
6860 #include "confdefs.h"
6861
6862 #if HAVE_DLFCN_H
6863 #include <dlfcn.h>
6864 #endif
6865
6866 #include <stdio.h>
6867
6868 #ifdef RTLD_GLOBAL
6869 #  define LT_DLGLOBAL           RTLD_GLOBAL
6870 #else
6871 #  ifdef DL_GLOBAL
6872 #    define LT_DLGLOBAL         DL_GLOBAL
6873 #  else
6874 #    define LT_DLGLOBAL         0
6875 #  endif
6876 #endif
6877
6878 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
6879    find out it does not work in some platform. */
6880 #ifndef LT_DLLAZY_OR_NOW
6881 #  ifdef RTLD_LAZY
6882 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
6883 #  else
6884 #    ifdef DL_LAZY
6885 #      define LT_DLLAZY_OR_NOW          DL_LAZY
6886 #    else
6887 #      ifdef RTLD_NOW
6888 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
6889 #      else
6890 #        ifdef DL_NOW
6891 #          define LT_DLLAZY_OR_NOW      DL_NOW
6892 #        else
6893 #          define LT_DLLAZY_OR_NOW      0
6894 #        endif
6895 #      endif
6896 #    endif
6897 #  endif
6898 #endif
6899
6900 #ifdef __cplusplus
6901 extern "C" void exit (int);
6902 #endif
6903
6904 void fnord() { int i=42;}
6905 int main ()
6906 {
6907   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
6908   int status = $lt_dlunknown;
6909
6910   if (self)
6911     {
6912       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
6913       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
6914       /* dlclose (self); */
6915     }
6916
6917     exit (status);
6918 }
6919 EOF
6920   if { (eval echo configure:6921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
6921     (./conftest; exit; ) 2>/dev/null
6922     lt_status=$?
6923     case x$lt_status in
6924       x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
6925       x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
6926       x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
6927     esac
6928   else :
6929     # compilation failed
6930     lt_cv_dlopen_self_static=no
6931   fi
6932 fi
6933 rm -fr conftest*
6934
6935       
6936 fi
6937
6938 echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
6939     fi
6940
6941     CPPFLAGS="$save_CPPFLAGS"
6942     LDFLAGS="$save_LDFLAGS"
6943     LIBS="$save_LIBS"
6944     ;;
6945   esac
6946
6947   case $lt_cv_dlopen_self in
6948   yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
6949   *) enable_dlopen_self=unknown ;;
6950   esac
6951
6952   case $lt_cv_dlopen_self_static in
6953   yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
6954   *) enable_dlopen_self_static=unknown ;;
6955   esac
6956 fi
6957
6958
6959 if test "$enable_shared" = yes && test "$GCC" = yes; then
6960   case $archive_cmds in
6961   *'~'*)
6962     # FIXME: we may have to deal with multi-command sequences.
6963     ;;
6964   '$CC '*)
6965     # Test whether the compiler implicitly links with -lc since on some
6966     # systems, -lgcc has to come before -lc. If gcc already passes -lc
6967     # to ld, don't add -lc before -lgcc.
6968     echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6
6969 echo "configure:6970: checking whether -lc should be explicitly linked in" >&5
6970     if eval "test \"\${lt_cv_archive_cmds_need_lc+set}\" = set"; then
6971   echo $ac_n "(cached) $ac_c" 1>&6
6972 else
6973   $rm conftest*
6974     echo 'static int dummy;' > conftest.$ac_ext
6975
6976     if { (eval echo configure:6977: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6977       soname=conftest
6978       lib=conftest
6979       libobjs=conftest.$ac_objext
6980       deplibs=
6981       wl=$lt_cv_prog_cc_wl
6982       compiler_flags=-v
6983       linker_flags=-v
6984       verstring=
6985       output_objdir=.
6986       libname=conftest
6987       save_allow_undefined_flag=$allow_undefined_flag
6988       allow_undefined_flag=
6989       if { (eval echo configure:6990: \"$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; }
6990       then
6991         lt_cv_archive_cmds_need_lc=no
6992       else
6993         lt_cv_archive_cmds_need_lc=yes
6994       fi
6995       allow_undefined_flag=$save_allow_undefined_flag
6996     else
6997       cat conftest.err 1>&5
6998     fi
6999 fi
7000
7001     echo "$ac_t""$lt_cv_archive_cmds_need_lc" 1>&6
7002     ;;
7003   esac
7004 fi
7005 need_lc=${lt_cv_archive_cmds_need_lc-yes}
7006
7007 # The second clause should only fire when bootstrapping the
7008 # libtool distribution, otherwise you forgot to ship ltmain.sh
7009 # with your package, and you will get complaints that there are
7010 # no rules to generate ltmain.sh.
7011 if test -f "$ltmain"; then
7012   :
7013 else
7014   # If there is no Makefile yet, we rely on a make rule to execute
7015   # `config.status --recheck' to rerun these tests and create the
7016   # libtool script then.
7017   test -f Makefile && make "$ltmain"
7018 fi
7019
7020 if test -f "$ltmain"; then
7021   trap "$rm \"${ofile}T\"; exit 1" 1 2 15
7022   $rm -f "${ofile}T"
7023
7024   echo creating $ofile
7025
7026   # Now quote all the things that may contain metacharacters while being
7027   # careful not to overquote the AC_SUBSTed values.  We take copies of the
7028   # variables and quote the copies for generation of the libtool script.
7029   for var in echo old_CC old_CFLAGS \
7030     AR AR_FLAGS CC LD LN_S NM SHELL \
7031     reload_flag reload_cmds wl \
7032     pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
7033     thread_safe_flag_spec whole_archive_flag_spec libname_spec \
7034     library_names_spec soname_spec \
7035     RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
7036     old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
7037     postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
7038     old_striplib striplib file_magic_cmd export_symbols_cmds \
7039     deplibs_check_method allow_undefined_flag no_undefined_flag \
7040     finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
7041     global_symbol_to_c_name_address \
7042     hardcode_libdir_flag_spec hardcode_libdir_separator  \
7043     sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
7044     compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
7045
7046     case $var in
7047     reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
7048     old_postinstall_cmds | old_postuninstall_cmds | \
7049     export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
7050     extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
7051     postinstall_cmds | postuninstall_cmds | \
7052     finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
7053       # Double-quote double-evaled strings.
7054       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
7055       ;;
7056     *)
7057       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
7058       ;;
7059     esac
7060   done
7061
7062   cat <<__EOF__ > "${ofile}T"
7063 #! $SHELL
7064
7065 # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
7066 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
7067 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
7068 #
7069 # Copyright (C) 1996-2000 Free Software Foundation, Inc.
7070 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7071 #
7072 # This program is free software; you can redistribute it and/or modify
7073 # it under the terms of the GNU General Public License as published by
7074 # the Free Software Foundation; either version 2 of the License, or
7075 # (at your option) any later version.
7076 #
7077 # This program is distributed in the hope that it will be useful, but
7078 # WITHOUT ANY WARRANTY; without even the implied warranty of
7079 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
7080 # General Public License for more details.
7081 #
7082 # You should have received a copy of the GNU General Public License
7083 # along with this program; if not, write to the Free Software
7084 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
7085 #
7086 # As a special exception to the GNU General Public License, if you
7087 # distribute this file as part of a program that contains a
7088 # configuration script generated by Autoconf, you may include it under
7089 # the same distribution terms that you use for the rest of that program.
7090
7091 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
7092 Xsed="sed -e s/^X//"
7093
7094 # The HP-UX ksh and POSIX shell print the target directory to stdout
7095 # if CDPATH is set.
7096 if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
7097
7098 # ### BEGIN LIBTOOL CONFIG
7099
7100 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
7101
7102 # Shell to use when invoking shell scripts.
7103 SHELL=$lt_SHELL
7104
7105 # Whether or not to build shared libraries.
7106 build_libtool_libs=$enable_shared
7107
7108 # Whether or not to build static libraries.
7109 build_old_libs=$enable_static
7110
7111 # Whether or not to add -lc for building shared libraries.
7112 build_libtool_need_lc=$need_lc
7113
7114 # Whether or not to optimize for fast installation.
7115 fast_install=$enable_fast_install
7116
7117 # The host system.
7118 host_alias=$host_alias
7119 host=$host
7120
7121 # An echo program that does not interpret backslashes.
7122 echo=$lt_echo
7123
7124 # The archiver.
7125 AR=$lt_AR
7126 AR_FLAGS=$lt_AR_FLAGS
7127
7128 # The default C compiler.
7129 CC=$lt_CC
7130
7131 # Is the compiler the GNU C compiler?
7132 with_gcc=$GCC
7133
7134 # The linker used to build libraries.
7135 LD=$lt_LD
7136
7137 # Whether we need hard or soft links.
7138 LN_S=$lt_LN_S
7139
7140 # A BSD-compatible nm program.
7141 NM=$lt_NM
7142
7143 # A symbol stripping program
7144 STRIP=$STRIP
7145
7146 # Used to examine libraries when file_magic_cmd begins "file"
7147 MAGIC_CMD=$MAGIC_CMD
7148
7149 # Used on cygwin: DLL creation program.
7150 DLLTOOL="$DLLTOOL"
7151
7152 # Used on cygwin: object dumper.
7153 OBJDUMP="$OBJDUMP"
7154
7155 # Used on cygwin: assembler.
7156 AS="$AS"
7157
7158 # The name of the directory that contains temporary libtool files.
7159 objdir=$objdir
7160
7161 # How to create reloadable object files.
7162 reload_flag=$lt_reload_flag
7163 reload_cmds=$lt_reload_cmds
7164
7165 # How to pass a linker flag through the compiler.
7166 wl=$lt_wl
7167
7168 # Object file suffix (normally "o").
7169 objext="$ac_objext"
7170
7171 # Old archive suffix (normally "a").
7172 libext="$libext"
7173
7174 # Executable file suffix (normally "").
7175 exeext="$exeext"
7176
7177 # Additional compiler flags for building library objects.
7178 pic_flag=$lt_pic_flag
7179 pic_mode=$pic_mode
7180
7181 # Does compiler simultaneously support -c and -o options?
7182 compiler_c_o=$lt_compiler_c_o
7183
7184 # Can we write directly to a .lo ?
7185 compiler_o_lo=$lt_compiler_o_lo
7186
7187 # Must we lock files when doing compilation ?
7188 need_locks=$lt_need_locks
7189
7190 # Do we need the lib prefix for modules?
7191 need_lib_prefix=$need_lib_prefix
7192
7193 # Do we need a version for libraries?
7194 need_version=$need_version
7195
7196 # Whether dlopen is supported.
7197 dlopen_support=$enable_dlopen
7198
7199 # Whether dlopen of programs is supported.
7200 dlopen_self=$enable_dlopen_self
7201
7202 # Whether dlopen of statically linked programs is supported.
7203 dlopen_self_static=$enable_dlopen_self_static
7204
7205 # Compiler flag to prevent dynamic linking.
7206 link_static_flag=$lt_link_static_flag
7207
7208 # Compiler flag to turn off builtin functions.
7209 no_builtin_flag=$lt_no_builtin_flag
7210
7211 # Compiler flag to allow reflexive dlopens.
7212 export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
7213
7214 # Compiler flag to generate shared objects directly from archives.
7215 whole_archive_flag_spec=$lt_whole_archive_flag_spec
7216
7217 # Compiler flag to generate thread-safe objects.
7218 thread_safe_flag_spec=$lt_thread_safe_flag_spec
7219
7220 # Library versioning type.
7221 version_type=$version_type
7222
7223 # Format of library name prefix.
7224 libname_spec=$lt_libname_spec
7225
7226 # List of archive names.  First name is the real one, the rest are links.
7227 # The last name is the one that the linker finds with -lNAME.
7228 library_names_spec=$lt_library_names_spec
7229
7230 # The coded name of the library, if different from the real name.
7231 soname_spec=$lt_soname_spec
7232
7233 # Commands used to build and install an old-style archive.
7234 RANLIB=$lt_RANLIB
7235 old_archive_cmds=$lt_old_archive_cmds
7236 old_postinstall_cmds=$lt_old_postinstall_cmds
7237 old_postuninstall_cmds=$lt_old_postuninstall_cmds
7238
7239 # Create an old-style archive from a shared archive.
7240 old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
7241
7242 # Create a temporary old-style archive to link instead of a shared archive.
7243 old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
7244
7245 # Commands used to build and install a shared archive.
7246 archive_cmds=$lt_archive_cmds
7247 archive_expsym_cmds=$lt_archive_expsym_cmds
7248 postinstall_cmds=$lt_postinstall_cmds
7249 postuninstall_cmds=$lt_postuninstall_cmds
7250
7251 # Commands to strip libraries.
7252 old_striplib=$lt_old_striplib
7253 striplib=$lt_striplib
7254
7255 # Method to check whether dependent libraries are shared objects.
7256 deplibs_check_method=$lt_deplibs_check_method
7257
7258 # Command to use when deplibs_check_method == file_magic.
7259 file_magic_cmd=$lt_file_magic_cmd
7260
7261 # Flag that allows shared libraries with undefined symbols to be built.
7262 allow_undefined_flag=$lt_allow_undefined_flag
7263
7264 # Flag that forces no undefined symbols.
7265 no_undefined_flag=$lt_no_undefined_flag
7266
7267 # Commands used to finish a libtool library installation in a directory.
7268 finish_cmds=$lt_finish_cmds
7269
7270 # Same as above, but a single script fragment to be evaled but not shown.
7271 finish_eval=$lt_finish_eval
7272
7273 # Take the output of nm and produce a listing of raw symbols and C names.
7274 global_symbol_pipe=$lt_global_symbol_pipe
7275
7276 # Transform the output of nm in a proper C declaration
7277 global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
7278
7279 # Transform the output of nm in a C name address pair
7280 global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
7281
7282 # This is the shared library runtime path variable.
7283 runpath_var=$runpath_var
7284
7285 # This is the shared library path variable.
7286 shlibpath_var=$shlibpath_var
7287
7288 # Is shlibpath searched before the hard-coded library search path?
7289 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
7290
7291 # How to hardcode a shared library path into an executable.
7292 hardcode_action=$hardcode_action
7293
7294 # Whether we should hardcode library paths into libraries.
7295 hardcode_into_libs=$hardcode_into_libs
7296
7297 # Flag to hardcode \$libdir into a binary during linking.
7298 # This must work even if \$libdir does not exist.
7299 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
7300
7301 # Whether we need a single -rpath flag with a separated argument.
7302 hardcode_libdir_separator=$lt_hardcode_libdir_separator
7303
7304 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
7305 # resulting binary.
7306 hardcode_direct=$hardcode_direct
7307
7308 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7309 # resulting binary.
7310 hardcode_minus_L=$hardcode_minus_L
7311
7312 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7313 # the resulting binary.
7314 hardcode_shlibpath_var=$hardcode_shlibpath_var
7315
7316 # Variables whose values should be saved in libtool wrapper scripts and
7317 # restored at relink time.
7318 variables_saved_for_relink="$variables_saved_for_relink"
7319
7320 # Whether libtool must link a program against all its dependency libraries.
7321 link_all_deplibs=$link_all_deplibs
7322
7323 # Compile-time system search path for libraries
7324 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
7325
7326 # Run-time system search path for libraries
7327 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
7328
7329 # Fix the shell variable \$srcfile for the compiler.
7330 fix_srcfile_path="$fix_srcfile_path"
7331
7332 # Set to yes if exported symbols are required.
7333 always_export_symbols=$always_export_symbols
7334
7335 # The commands to list exported symbols.
7336 export_symbols_cmds=$lt_export_symbols_cmds
7337
7338 # The commands to extract the exported symbol list from a shared archive.
7339 extract_expsyms_cmds=$lt_extract_expsyms_cmds
7340
7341 # Symbols that should not be listed in the preloaded symbols.
7342 exclude_expsyms=$lt_exclude_expsyms
7343
7344 # Symbols that must always be exported.
7345 include_expsyms=$lt_include_expsyms
7346
7347 # ### END LIBTOOL CONFIG
7348
7349 __EOF__
7350
7351   case $host_os in
7352   aix3*)
7353     cat <<\EOF >> "${ofile}T"
7354
7355 # AIX sometimes has problems with the GCC collect2 program.  For some
7356 # reason, if we set the COLLECT_NAMES environment variable, the problems
7357 # vanish in a puff of smoke.
7358 if test "X${COLLECT_NAMES+set}" != Xset; then
7359   COLLECT_NAMES=
7360   export COLLECT_NAMES
7361 fi
7362 EOF
7363     ;;
7364   esac
7365
7366   case $host_os in
7367   cygwin* | mingw* | pw32* | os2*)
7368     cat <<'EOF' >> "${ofile}T"
7369       # This is a source program that is used to create dlls on Windows
7370       # Don't remove nor modify the starting and closing comments
7371 # /* ltdll.c starts here */
7372 # #define WIN32_LEAN_AND_MEAN
7373 # #include <windows.h>
7374 # #undef WIN32_LEAN_AND_MEAN
7375 # #include <stdio.h>
7376 #
7377 # #ifndef __CYGWIN__
7378 # #  ifdef __CYGWIN32__
7379 # #    define __CYGWIN__ __CYGWIN32__
7380 # #  endif
7381 # #endif
7382 #
7383 # #ifdef __cplusplus
7384 # extern "C" {
7385 # #endif
7386 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
7387 # #ifdef __cplusplus
7388 # }
7389 # #endif
7390 #
7391 # #ifdef __CYGWIN__
7392 # #include <cygwin/cygwin_dll.h>
7393 # DECLARE_CYGWIN_DLL( DllMain );
7394 # #endif
7395 # HINSTANCE __hDllInstance_base;
7396 #
7397 # BOOL APIENTRY
7398 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
7399 # {
7400 #   __hDllInstance_base = hInst;
7401 #   return TRUE;
7402 # }
7403 # /* ltdll.c ends here */
7404         # This is a source program that is used to create import libraries
7405         # on Windows for dlls which lack them. Don't remove nor modify the
7406         # starting and closing comments
7407 # /* impgen.c starts here */
7408 # /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
7409 #
7410 #  This file is part of GNU libtool.
7411 #
7412 #  This program is free software; you can redistribute it and/or modify
7413 #  it under the terms of the GNU General Public License as published by
7414 #  the Free Software Foundation; either version 2 of the License, or
7415 #  (at your option) any later version.
7416 #
7417 #  This program is distributed in the hope that it will be useful,
7418 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
7419 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
7420 #  GNU General Public License for more details.
7421 #
7422 #  You should have received a copy of the GNU General Public License
7423 #  along with this program; if not, write to the Free Software
7424 #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
7425 #  */
7426 #
7427 # #include <stdio.h>            /* for printf() */
7428 # #include <unistd.h>           /* for open(), lseek(), read() */
7429 # #include <fcntl.h>            /* for O_RDONLY, O_BINARY */
7430 # #include <string.h>           /* for strdup() */
7431 #
7432 # /* O_BINARY isn't required (or even defined sometimes) under Unix */
7433 # #ifndef O_BINARY
7434 # #define O_BINARY 0
7435 # #endif
7436 #
7437 # static unsigned int
7438 # pe_get16 (fd, offset)
7439 #      int fd;
7440 #      int offset;
7441 # {
7442 #   unsigned char b[2];
7443 #   lseek (fd, offset, SEEK_SET);
7444 #   read (fd, b, 2);
7445 #   return b[0] + (b[1]<<8);
7446 # }
7447 #
7448 # static unsigned int
7449 # pe_get32 (fd, offset)
7450 #     int fd;
7451 #     int offset;
7452 # {
7453 #   unsigned char b[4];
7454 #   lseek (fd, offset, SEEK_SET);
7455 #   read (fd, b, 4);
7456 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
7457 # }
7458 #
7459 # static unsigned int
7460 # pe_as32 (ptr)
7461 #      void *ptr;
7462 # {
7463 #   unsigned char *b = ptr;
7464 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
7465 # }
7466 #
7467 # int
7468 # main (argc, argv)
7469 #     int argc;
7470 #     char *argv[];
7471 # {
7472 #     int dll;
7473 #     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
7474 #     unsigned long export_rva, export_size, nsections, secptr, expptr;
7475 #     unsigned long name_rvas, nexp;
7476 #     unsigned char *expdata, *erva;
7477 #     char *filename, *dll_name;
7478 #
7479 #     filename = argv[1];
7480 #
7481 #     dll = open(filename, O_RDONLY|O_BINARY);
7482 #     if (dll < 1)
7483 #       return 1;
7484 #
7485 #     dll_name = filename;
7486 #
7487 #     for (i=0; filename[i]; i++)
7488 #       if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
7489 #           dll_name = filename + i +1;
7490 #
7491 #     pe_header_offset = pe_get32 (dll, 0x3c);
7492 #     opthdr_ofs = pe_header_offset + 4 + 20;
7493 #     num_entries = pe_get32 (dll, opthdr_ofs + 92);
7494 #
7495 #     if (num_entries < 1) /* no exports */
7496 #       return 1;
7497 #
7498 #     export_rva = pe_get32 (dll, opthdr_ofs + 96);
7499 #     export_size = pe_get32 (dll, opthdr_ofs + 100);
7500 #     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
7501 #     secptr = (pe_header_offset + 4 + 20 +
7502 #             pe_get16 (dll, pe_header_offset + 4 + 16));
7503 #
7504 #     expptr = 0;
7505 #     for (i = 0; i < nsections; i++)
7506 #     {
7507 #       char sname[8];
7508 #       unsigned long secptr1 = secptr + 40 * i;
7509 #       unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
7510 #       unsigned long vsize = pe_get32 (dll, secptr1 + 16);
7511 #       unsigned long fptr = pe_get32 (dll, secptr1 + 20);
7512 #       lseek(dll, secptr1, SEEK_SET);
7513 #       read(dll, sname, 8);
7514 #       if (vaddr <= export_rva && vaddr+vsize > export_rva)
7515 #       {
7516 #           expptr = fptr + (export_rva - vaddr);
7517 #           if (export_rva + export_size > vaddr + vsize)
7518 #               export_size = vsize - (export_rva - vaddr);
7519 #           break;
7520 #       }
7521 #     }
7522 #
7523 #     expdata = (unsigned char*)malloc(export_size);
7524 #     lseek (dll, expptr, SEEK_SET);
7525 #     read (dll, expdata, export_size);
7526 #     erva = expdata - export_rva;
7527 #
7528 #     nexp = pe_as32 (expdata+24);
7529 #     name_rvas = pe_as32 (expdata+32);
7530 #
7531 #     printf ("EXPORTS\n");
7532 #     for (i = 0; i<nexp; i++)
7533 #     {
7534 #       unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
7535 #       printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
7536 #     }
7537 #
7538 #     return 0;
7539 # }
7540 # /* impgen.c ends here */
7541
7542 EOF
7543     ;;
7544   esac
7545
7546   # We use sed instead of cat because bash on DJGPP gets confused if
7547   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
7548   # text mode, it properly converts lines to CR/LF.  This bash problem
7549   # is reportedly fixed, but why not run on old versions too?
7550   sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
7551
7552   mv -f "${ofile}T" "$ofile" || \
7553     (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
7554   chmod +x "$ofile"
7555 fi
7556
7557
7558
7559
7560
7561 # This can be used to rebuild libtool when needed
7562 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
7563
7564 # Always use our own libtool.
7565 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
7566
7567 # Prevent multiple expansion
7568
7569
7570
7571 for ac_prog in mawk gawk nawk awk
7572 do
7573 # Extract the first word of "$ac_prog", so it can be a program name with args.
7574 set dummy $ac_prog; ac_word=$2
7575 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7576 echo "configure:7577: checking for $ac_word" >&5
7577 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
7578   echo $ac_n "(cached) $ac_c" 1>&6
7579 else
7580   if test -n "$AWK"; then
7581   ac_cv_prog_AWK="$AWK" # Let the user override the test.
7582 else
7583   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7584   ac_dummy="$PATH"
7585   for ac_dir in $ac_dummy; do
7586     test -z "$ac_dir" && ac_dir=.
7587     if test -f $ac_dir/$ac_word; then
7588       ac_cv_prog_AWK="$ac_prog"
7589       break
7590     fi
7591   done
7592   IFS="$ac_save_ifs"
7593 fi
7594 fi
7595 AWK="$ac_cv_prog_AWK"
7596 if test -n "$AWK"; then
7597   echo "$ac_t""$AWK" 1>&6
7598 else
7599   echo "$ac_t""no" 1>&6
7600 fi
7601
7602 test -n "$AWK" && break
7603 done
7604
7605 # test for ln hardlink support
7606 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
7607 echo "configure:7608: checking whether ln works" >&5
7608 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
7609   echo $ac_n "(cached) $ac_c" 1>&6
7610 else
7611   rm -f conftest.src conftest.dst
7612 echo "conftest" > conftest.src
7613 if ln conftest.src conftest.dst 2>/dev/null
7614 then
7615   ol_cv_prog_LN_H="ln"
7616 else
7617   ol_cv_prog_LN_H="cp"
7618 fi
7619 rm -f conftest.src conftest.dst
7620
7621 fi
7622 LN_H="$ol_cv_prog_LN_H"
7623 if test "$ol_cv_prog_LN_H" = "ln"; then
7624         echo "$ac_t""yes" 1>&6
7625 else
7626         echo "$ac_t""no" 1>&6
7627 fi
7628
7629 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
7630 echo "configure:7631: checking whether ln -s works" >&5
7631 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
7632   echo $ac_n "(cached) $ac_c" 1>&6
7633 else
7634   rm -f conftestdata
7635 if ln -s X conftestdata 2>/dev/null
7636 then
7637   rm -f conftestdata
7638   ac_cv_prog_LN_S="ln -s"
7639 else
7640   ac_cv_prog_LN_S=ln
7641 fi
7642 fi
7643 LN_S="$ac_cv_prog_LN_S"
7644 if test "$ac_cv_prog_LN_S" = "ln -s"; then
7645   echo "$ac_t""yes" 1>&6
7646 else
7647   echo "$ac_t""no" 1>&6
7648 fi
7649
7650
7651 # Extract the first word of "sendmail", so it can be a program name with args.
7652 set dummy sendmail; ac_word=$2
7653 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7654 echo "configure:7655: checking for $ac_word" >&5
7655 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
7656   echo $ac_n "(cached) $ac_c" 1>&6
7657 else
7658   case "$SENDMAIL" in
7659   /*)
7660   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
7661   ;;
7662   ?:/*)
7663   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
7664   ;;
7665   *)
7666   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7667   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
7668   for ac_dir in $ac_dummy; do 
7669     test -z "$ac_dir" && ac_dir=.
7670     if test -f $ac_dir/$ac_word; then
7671       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
7672       break
7673     fi
7674   done
7675   IFS="$ac_save_ifs"
7676   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
7677   ;;
7678 esac
7679 fi
7680 SENDMAIL="$ac_cv_path_SENDMAIL"
7681 if test -n "$SENDMAIL"; then
7682   echo "$ac_t""$SENDMAIL" 1>&6
7683 else
7684   echo "$ac_t""no" 1>&6
7685 fi
7686
7687 # Extract the first word of "vi", so it can be a program name with args.
7688 set dummy vi; ac_word=$2
7689 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7690 echo "configure:7691: checking for $ac_word" >&5
7691 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
7692   echo $ac_n "(cached) $ac_c" 1>&6
7693 else
7694   case "$EDITOR" in
7695   /*)
7696   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
7697   ;;
7698   ?:/*)
7699   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
7700   ;;
7701   *)
7702   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7703   ac_dummy="$PATH:/usr/ucb"
7704   for ac_dir in $ac_dummy; do 
7705     test -z "$ac_dir" && ac_dir=.
7706     if test -f $ac_dir/$ac_word; then
7707       ac_cv_path_EDITOR="$ac_dir/$ac_word"
7708       break
7709     fi
7710   done
7711   IFS="$ac_save_ifs"
7712   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
7713   ;;
7714 esac
7715 fi
7716 EDITOR="$ac_cv_path_EDITOR"
7717 if test -n "$EDITOR"; then
7718   echo "$ac_t""$EDITOR" 1>&6
7719 else
7720   echo "$ac_t""no" 1>&6
7721 fi
7722
7723 # Extract the first word of "finger", so it can be a program name with args.
7724 set dummy finger; ac_word=$2
7725 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7726 echo "configure:7727: checking for $ac_word" >&5
7727 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
7728   echo $ac_n "(cached) $ac_c" 1>&6
7729 else
7730   case "$FINGER" in
7731   /*)
7732   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
7733   ;;
7734   ?:/*)
7735   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
7736   ;;
7737   *)
7738   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7739   ac_dummy="$PATH:/usr/ucb"
7740   for ac_dir in $ac_dummy; do 
7741     test -z "$ac_dir" && ac_dir=.
7742     if test -f $ac_dir/$ac_word; then
7743       ac_cv_path_FINGER="$ac_dir/$ac_word"
7744       break
7745     fi
7746   done
7747   IFS="$ac_save_ifs"
7748   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
7749   ;;
7750 esac
7751 fi
7752 FINGER="$ac_cv_path_FINGER"
7753 if test -n "$FINGER"; then
7754   echo "$ac_t""$FINGER" 1>&6
7755 else
7756   echo "$ac_t""no" 1>&6
7757 fi
7758
7759
7760 ol_link_perl=no
7761 if test $ol_enable_perl != no ; then
7762         # Extract the first word of "perl", so it can be a program name with args.
7763 set dummy perl; ac_word=$2
7764 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7765 echo "configure:7766: checking for $ac_word" >&5
7766 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
7767   echo $ac_n "(cached) $ac_c" 1>&6
7768 else
7769   case "$PERLBIN" in
7770   /*)
7771   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
7772   ;;
7773   ?:/*)
7774   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
7775   ;;
7776   *)
7777   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7778   ac_dummy="$PATH"
7779   for ac_dir in $ac_dummy; do 
7780     test -z "$ac_dir" && ac_dir=.
7781     if test -f $ac_dir/$ac_word; then
7782       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
7783       break
7784     fi
7785   done
7786   IFS="$ac_save_ifs"
7787   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
7788   ;;
7789 esac
7790 fi
7791 PERLBIN="$ac_cv_path_PERLBIN"
7792 if test -n "$PERLBIN"; then
7793   echo "$ac_t""$PERLBIN" 1>&6
7794 else
7795   echo "$ac_t""no" 1>&6
7796 fi
7797
7798
7799         if test "no$PERLBIN" = "no" ; then
7800                 if test $ol_enable_perl = yes ; then
7801                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
7802                 fi
7803
7804         else
7805                 PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
7806                 if test x"$ol_with_perl_module" = "xstatic" ; then
7807                         SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
7808                 else
7809                         MOD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
7810                 fi
7811                                 ol_link_perl=yes
7812         fi
7813 fi
7814
7815 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
7816 echo "configure:7817: checking how to run the C preprocessor" >&5
7817 # On Suns, sometimes $CPP names a directory.
7818 if test -n "$CPP" && test -d "$CPP"; then
7819   CPP=
7820 fi
7821 if test -z "$CPP"; then
7822 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
7823   echo $ac_n "(cached) $ac_c" 1>&6
7824 else
7825     # This must be in double quotes, not single quotes, because CPP may get
7826   # substituted into the Makefile and "${CC-cc}" will confuse make.
7827   CPP="${CC-cc} -E"
7828   # On the NeXT, cc -E runs the code through the compiler's parser,
7829   # not just through cpp.
7830   cat > conftest.$ac_ext <<EOF
7831 #line 7832 "configure"
7832 #include "confdefs.h"
7833 #include <assert.h>
7834 Syntax Error
7835 EOF
7836 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7837 { (eval echo configure:7838: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7838 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7839 if test -z "$ac_err"; then
7840   :
7841 else
7842   echo "$ac_err" >&5
7843   echo "configure: failed program was:" >&5
7844   cat conftest.$ac_ext >&5
7845   rm -rf conftest*
7846   CPP="${CC-cc} -E -traditional-cpp"
7847   cat > conftest.$ac_ext <<EOF
7848 #line 7849 "configure"
7849 #include "confdefs.h"
7850 #include <assert.h>
7851 Syntax Error
7852 EOF
7853 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7854 { (eval echo configure:7855: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7855 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7856 if test -z "$ac_err"; then
7857   :
7858 else
7859   echo "$ac_err" >&5
7860   echo "configure: failed program was:" >&5
7861   cat conftest.$ac_ext >&5
7862   rm -rf conftest*
7863   CPP="${CC-cc} -nologo -E"
7864   cat > conftest.$ac_ext <<EOF
7865 #line 7866 "configure"
7866 #include "confdefs.h"
7867 #include <assert.h>
7868 Syntax Error
7869 EOF
7870 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7871 { (eval echo configure:7872: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7872 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7873 if test -z "$ac_err"; then
7874   :
7875 else
7876   echo "$ac_err" >&5
7877   echo "configure: failed program was:" >&5
7878   cat conftest.$ac_ext >&5
7879   rm -rf conftest*
7880   CPP=/lib/cpp
7881 fi
7882 rm -f conftest*
7883 fi
7884 rm -f conftest*
7885 fi
7886 rm -f conftest*
7887   ac_cv_prog_CPP="$CPP"
7888 fi
7889   CPP="$ac_cv_prog_CPP"
7890 else
7891   ac_cv_prog_CPP="$CPP"
7892 fi
7893 echo "$ac_t""$CPP" 1>&6
7894
7895
7896 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
7897         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
7898
7899 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
7900         echo "configure: warning: programs compiled here do run here..." 1>&2
7901         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
7902
7903 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
7904         echo "configure: warning: programs compiled here do not run here..." 1>&2
7905         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
7906 fi
7907
7908
7909 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
7910 echo "configure:7911: checking for Cygwin environment" >&5
7911 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
7912   echo $ac_n "(cached) $ac_c" 1>&6
7913 else
7914   cat > conftest.$ac_ext <<EOF
7915 #line 7916 "configure"
7916 #include "confdefs.h"
7917
7918 int main() {
7919
7920 #ifndef __CYGWIN__
7921 #define __CYGWIN__ __CYGWIN32__
7922 #endif
7923 return __CYGWIN__;
7924 ; return 0; }
7925 EOF
7926 if { (eval echo configure:7927: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7927   rm -rf conftest*
7928   ac_cv_cygwin=yes
7929 else
7930   echo "configure: failed program was:" >&5
7931   cat conftest.$ac_ext >&5
7932   rm -rf conftest*
7933   ac_cv_cygwin=no
7934 fi
7935 rm -f conftest*
7936 fi
7937
7938 echo "$ac_t""$ac_cv_cygwin" 1>&6
7939 CYGWIN=
7940 test "$ac_cv_cygwin" = yes && CYGWIN=yes
7941 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
7942 echo "configure:7943: checking for mingw32 environment" >&5
7943 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
7944   echo $ac_n "(cached) $ac_c" 1>&6
7945 else
7946   cat > conftest.$ac_ext <<EOF
7947 #line 7948 "configure"
7948 #include "confdefs.h"
7949
7950 int main() {
7951 return __MINGW32__;
7952 ; return 0; }
7953 EOF
7954 if { (eval echo configure:7955: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7955   rm -rf conftest*
7956   ac_cv_mingw32=yes
7957 else
7958   echo "configure: failed program was:" >&5
7959   cat conftest.$ac_ext >&5
7960   rm -rf conftest*
7961   ac_cv_mingw32=no
7962 fi
7963 rm -f conftest*
7964 fi
7965
7966 echo "$ac_t""$ac_cv_mingw32" 1>&6
7967 MINGW32=
7968 test "$ac_cv_mingw32" = yes && MINGW32=yes
7969
7970
7971
7972 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
7973 echo "configure:7974: checking for executable suffix" >&5
7974 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
7975   echo $ac_n "(cached) $ac_c" 1>&6
7976 else
7977   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
7978   ac_cv_exeext=.exe
7979 else
7980   rm -f conftest*
7981   echo 'int main () { return 0; }' > conftest.$ac_ext
7982   ac_cv_exeext=
7983   if { (eval echo configure:7984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
7984     for file in conftest.*; do
7985       case $file in
7986       *.c | *.C | *.o | *.obj | *.xcoff) ;;
7987       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
7988       esac
7989     done
7990   else
7991     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
7992   fi
7993   rm -f conftest*
7994   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
7995 fi
7996 fi
7997
7998 EXEEXT=""
7999 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
8000 echo "$ac_t""${ac_cv_exeext}" 1>&6
8001 ac_exeext=$EXEEXT
8002
8003 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
8004 echo "configure:8005: checking for object suffix" >&5
8005 if eval "test \"\${ac_cv_objext+set}\" = set"; then
8006   echo $ac_n "(cached) $ac_c" 1>&6
8007 else
8008   rm -f conftest*
8009 echo 'int i = 1;' > conftest.$ac_ext
8010 if { (eval echo configure:8011: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8011   for ac_file in conftest.*; do
8012     case $ac_file in
8013     *.c) ;;
8014     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
8015     esac
8016   done
8017 else
8018   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
8019 fi
8020 rm -f conftest*
8021 fi
8022
8023 echo "$ac_t""$ac_cv_objext" 1>&6
8024 OBJEXT=$ac_cv_objext
8025 ac_objext=$ac_cv_objext
8026
8027
8028 cat >> confdefs.h <<EOF
8029 #define EXEEXT "${EXEEXT}"
8030 EOF
8031
8032
8033 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
8034 echo "configure:8035: checking for be_app in -lbe" >&5
8035 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
8036 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8037   echo $ac_n "(cached) $ac_c" 1>&6
8038 else
8039   ac_save_LIBS="$LIBS"
8040 LIBS="-lbe -lroot -lnet $LIBS"
8041 cat > conftest.$ac_ext <<EOF
8042 #line 8043 "configure"
8043 #include "confdefs.h"
8044 /* Override any gcc2 internal prototype to avoid an error.  */
8045 /* We use char because int might match the return type of a gcc2
8046     builtin and then its argument prototype would still apply.  */
8047 char be_app();
8048
8049 int main() {
8050 be_app()
8051 ; return 0; }
8052 EOF
8053 if { (eval echo configure:8054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8054   rm -rf conftest*
8055   eval "ac_cv_lib_$ac_lib_var=yes"
8056 else
8057   echo "configure: failed program was:" >&5
8058   cat conftest.$ac_ext >&5
8059   rm -rf conftest*
8060   eval "ac_cv_lib_$ac_lib_var=no"
8061 fi
8062 rm -f conftest*
8063 LIBS="$ac_save_LIBS"
8064
8065 fi
8066 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8067   echo "$ac_t""yes" 1>&6
8068   LIBS="$LIBS -lbe -lroot -lnet"
8069 else
8070   echo "$ac_t""no" 1>&6
8071 :
8072 fi
8073
8074
8075
8076
8077
8078 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
8079 echo "configure:8080: checking for ${CC-cc} option to accept ANSI C" >&5
8080 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
8081   echo $ac_n "(cached) $ac_c" 1>&6
8082 else
8083   am_cv_prog_cc_stdc=no
8084 ac_save_CC="$CC"
8085 # Don't try gcc -ansi; that turns off useful extensions and
8086 # breaks some systems' header files.
8087 # AIX                   -qlanglvl=ansi
8088 # Ultrix and OSF/1      -std1
8089 # HP-UX 10.20 and later -Ae
8090 # HP-UX older versions  -Aa -D_HPUX_SOURCE
8091 # SVR4                  -Xc -D__EXTENSIONS__
8092 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
8093 do
8094   CC="$ac_save_CC $ac_arg"
8095   cat > conftest.$ac_ext <<EOF
8096 #line 8097 "configure"
8097 #include "confdefs.h"
8098 #include <stdarg.h>
8099 #include <stdio.h>
8100 #include <sys/types.h>
8101 #include <sys/stat.h>
8102 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
8103 struct buf { int x; };
8104 FILE * (*rcsopen) (struct buf *, struct stat *, int);
8105 static char *e (p, i)
8106      char **p;
8107      int i;
8108 {
8109   return p[i];
8110 }
8111 static char *f (char * (*g) (char **, int), char **p, ...)
8112 {
8113   char *s;
8114   va_list v;
8115   va_start (v,p);
8116   s = g (p, va_arg (v,int));
8117   va_end (v);
8118   return s;
8119 }
8120 int test (int i, double x);
8121 struct s1 {int (*f) (int a);};
8122 struct s2 {int (*f) (double a);};
8123 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
8124 int argc;
8125 char **argv;
8126
8127 int main() {
8128
8129 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
8130
8131 ; return 0; }
8132 EOF
8133 if { (eval echo configure:8134: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8134   rm -rf conftest*
8135   am_cv_prog_cc_stdc="$ac_arg"; break
8136 else
8137   echo "configure: failed program was:" >&5
8138   cat conftest.$ac_ext >&5
8139 fi
8140 rm -f conftest*
8141 done
8142 CC="$ac_save_CC"
8143
8144 fi
8145
8146 if test -z "$am_cv_prog_cc_stdc"; then
8147   echo "$ac_t""none needed" 1>&6
8148 else
8149   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
8150 fi
8151 case "x$am_cv_prog_cc_stdc" in
8152   x|xno) ;;
8153   *) CC="$CC $am_cv_prog_cc_stdc" ;;
8154 esac
8155
8156 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
8157         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
8158 fi
8159
8160 # test for make depend flag
8161 OL_MKDEP=
8162 OL_MKDEP_FLAGS=
8163 if test -z "${MKDEP}"; then
8164         OL_MKDEP="${CC-cc}"
8165         if test -z "${MKDEP_FLAGS}"; then
8166                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
8167 echo "configure:8168: checking for ${OL_MKDEP} depend flag" >&5
8168 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
8169   echo $ac_n "(cached) $ac_c" 1>&6
8170 else
8171   
8172                         ol_cv_mkdep=no
8173                         for flag in "-M" "-xM"; do
8174                                 cat > conftest.c <<EOF
8175  noCode;
8176 EOF
8177                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:8178: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
8178                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
8179                                 then
8180                                         if test ! -f conftest."${ac_object}" ; then
8181                                                 ol_cv_mkdep=$flag
8182                                                 OL_MKDEP_FLAGS="$flag"
8183                                                 break
8184                                         fi
8185                                 fi
8186                         done
8187                         rm -f conftest*
8188                 
8189 fi
8190
8191 echo "$ac_t""$ol_cv_mkdep" 1>&6
8192         else
8193                 cc_cv_mkdep=yes
8194                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
8195         fi
8196 else
8197         cc_cv_mkdep=yes
8198         OL_MKDEP="${MKDEP}"
8199         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
8200 fi
8201
8202
8203
8204 if test "${ol_cv_mkdep}" = no ; then
8205         # this will soon become an error
8206         echo "configure: warning: do not know how to generate dependencies" 1>&2
8207 fi
8208
8209 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
8210 echo "configure:8211: checking for afopen in -ls" >&5
8211 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
8212 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8213   echo $ac_n "(cached) $ac_c" 1>&6
8214 else
8215   ac_save_LIBS="$LIBS"
8216 LIBS="-ls  $LIBS"
8217 cat > conftest.$ac_ext <<EOF
8218 #line 8219 "configure"
8219 #include "confdefs.h"
8220 /* Override any gcc2 internal prototype to avoid an error.  */
8221 /* We use char because int might match the return type of a gcc2
8222     builtin and then its argument prototype would still apply.  */
8223 char afopen();
8224
8225 int main() {
8226 afopen()
8227 ; return 0; }
8228 EOF
8229 if { (eval echo configure:8230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8230   rm -rf conftest*
8231   eval "ac_cv_lib_$ac_lib_var=yes"
8232 else
8233   echo "configure: failed program was:" >&5
8234   cat conftest.$ac_ext >&5
8235   rm -rf conftest*
8236   eval "ac_cv_lib_$ac_lib_var=no"
8237 fi
8238 rm -f conftest*
8239 LIBS="$ac_save_LIBS"
8240
8241 fi
8242 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8243   echo "$ac_t""yes" 1>&6
8244   
8245         AUTH_LIBS=-ls
8246         cat >> confdefs.h <<\EOF
8247 #define HAVE_AIX_SECURITY 1
8248 EOF
8249
8250
8251 else
8252   echo "$ac_t""no" 1>&6
8253 fi
8254
8255
8256
8257 ol_link_modules=no
8258 if test $ol_enable_modules != no ; then
8259         for ac_hdr in ltdl.h
8260 do
8261 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8262 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8263 echo "configure:8264: checking for $ac_hdr" >&5
8264 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8265   echo $ac_n "(cached) $ac_c" 1>&6
8266 else
8267   cat > conftest.$ac_ext <<EOF
8268 #line 8269 "configure"
8269 #include "confdefs.h"
8270 #include <$ac_hdr>
8271 EOF
8272 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8273 { (eval echo configure:8274: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8274 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8275 if test -z "$ac_err"; then
8276   rm -rf conftest*
8277   eval "ac_cv_header_$ac_safe=yes"
8278 else
8279   echo "$ac_err" >&5
8280   echo "configure: failed program was:" >&5
8281   cat conftest.$ac_ext >&5
8282   rm -rf conftest*
8283   eval "ac_cv_header_$ac_safe=no"
8284 fi
8285 rm -f conftest*
8286 fi
8287 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8288   echo "$ac_t""yes" 1>&6
8289     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8290   cat >> confdefs.h <<EOF
8291 #define $ac_tr_hdr 1
8292 EOF
8293  
8294 else
8295   echo "$ac_t""no" 1>&6
8296 fi
8297 done
8298
8299
8300         if test $ac_cv_header_ltdl_h = no ; then
8301                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
8302         fi
8303
8304         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
8305 echo "configure:8306: checking for lt_dlinit in -lltdl" >&5
8306 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
8307 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8308   echo $ac_n "(cached) $ac_c" 1>&6
8309 else
8310   ac_save_LIBS="$LIBS"
8311 LIBS="-lltdl  $LIBS"
8312 cat > conftest.$ac_ext <<EOF
8313 #line 8314 "configure"
8314 #include "confdefs.h"
8315 /* Override any gcc2 internal prototype to avoid an error.  */
8316 /* We use char because int might match the return type of a gcc2
8317     builtin and then its argument prototype would still apply.  */
8318 char lt_dlinit();
8319
8320 int main() {
8321 lt_dlinit()
8322 ; return 0; }
8323 EOF
8324 if { (eval echo configure:8325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8325   rm -rf conftest*
8326   eval "ac_cv_lib_$ac_lib_var=yes"
8327 else
8328   echo "configure: failed program was:" >&5
8329   cat conftest.$ac_ext >&5
8330   rm -rf conftest*
8331   eval "ac_cv_lib_$ac_lib_var=no"
8332 fi
8333 rm -f conftest*
8334 LIBS="$ac_save_LIBS"
8335
8336 fi
8337 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8338   echo "$ac_t""yes" 1>&6
8339   
8340                 MODULES_LIBS=-lltdl
8341                 cat >> confdefs.h <<\EOF
8342 #define HAVE_LIBLTDL 1
8343 EOF
8344
8345         
8346 else
8347   echo "$ac_t""no" 1>&6
8348 fi
8349
8350
8351         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
8352                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
8353         fi
8354         ol_link_modules=yes
8355 else
8356         ol_with_bdb_module=static
8357         ol_with_dnssrv_module=static
8358         ol_with_ldap_module=static
8359         ol_with_ldbm_module=static
8360         ol_with_meta_module=static
8361         ol_with_monitor_module=static
8362         ol_with_passwd_module=static
8363         ol_with_perl_module=static
8364         ol_with_shell_module=static
8365         ol_with_sql_module=static
8366 fi
8367
8368 # test for EBCDIC
8369 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
8370 echo "configure:8371: checking for EBCDIC" >&5
8371 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
8372   echo $ac_n "(cached) $ac_c" 1>&6
8373 else
8374   
8375         cat > conftest.$ac_ext <<EOF
8376 #line 8377 "configure"
8377 #include "confdefs.h"
8378
8379 #if !('M' == 0xd4)
8380 #include <__ASCII__/generate_error.h>
8381 #endif
8382
8383 EOF
8384 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8385 { (eval echo configure:8386: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8386 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8387 if test -z "$ac_err"; then
8388   rm -rf conftest*
8389   ol_cv_cpp_ebcdic=yes
8390 else
8391   echo "$ac_err" >&5
8392   echo "configure: failed program was:" >&5
8393   cat conftest.$ac_ext >&5
8394   rm -rf conftest*
8395   ol_cv_cpp_ebcdic=no
8396 fi
8397 rm -f conftest*
8398 fi
8399
8400 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
8401 if test $ol_cv_cpp_ebcdic = yes ; then
8402         cat >> confdefs.h <<\EOF
8403 #define HAVE_EBCDIC 1
8404 EOF
8405
8406 fi
8407
8408 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
8409 echo "configure:8410: checking for ANSI C header files" >&5
8410 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
8411   echo $ac_n "(cached) $ac_c" 1>&6
8412 else
8413   cat > conftest.$ac_ext <<EOF
8414 #line 8415 "configure"
8415 #include "confdefs.h"
8416 #include <stdlib.h>
8417 #include <stdarg.h>
8418 #include <string.h>
8419 #include <float.h>
8420 EOF
8421 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8422 { (eval echo configure:8423: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8423 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8424 if test -z "$ac_err"; then
8425   rm -rf conftest*
8426   ol_cv_header_stdc=yes
8427 else
8428   echo "$ac_err" >&5
8429   echo "configure: failed program was:" >&5
8430   cat conftest.$ac_ext >&5
8431   rm -rf conftest*
8432   ol_cv_header_stdc=no
8433 fi
8434 rm -f conftest*
8435
8436 if test $ol_cv_header_stdc = yes; then
8437   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
8438 cat > conftest.$ac_ext <<EOF
8439 #line 8440 "configure"
8440 #include "confdefs.h"
8441 #include <string.h>
8442 EOF
8443 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8444   egrep "memchr" >/dev/null 2>&1; then
8445   :
8446 else
8447   rm -rf conftest*
8448   ol_cv_header_stdc=no
8449 fi
8450 rm -f conftest*
8451
8452 fi
8453
8454 if test $ol_cv_header_stdc = yes; then
8455   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
8456 cat > conftest.$ac_ext <<EOF
8457 #line 8458 "configure"
8458 #include "confdefs.h"
8459 #include <stdlib.h>
8460 EOF
8461 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8462   egrep "free" >/dev/null 2>&1; then
8463   :
8464 else
8465   rm -rf conftest*
8466   ol_cv_header_stdc=no
8467 fi
8468 rm -f conftest*
8469
8470 fi
8471
8472 if test $ol_cv_header_stdc = yes; then
8473   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
8474 if test "$cross_compiling" = yes; then
8475   :
8476 else
8477   cat > conftest.$ac_ext <<EOF
8478 #line 8479 "configure"
8479 #include "confdefs.h"
8480 #include <ctype.h>
8481 #ifndef HAVE_EBCDIC
8482 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
8483 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
8484 #else
8485 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
8486                 || ('j' <= (c) && (c) <= 'r') \
8487                 || ('s' <= (c) && (c) <= 'z'))
8488 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
8489 #endif
8490 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
8491 int main () { int i; for (i = 0; i < 256; i++)
8492 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
8493 exit (0); }
8494
8495 EOF
8496 if { (eval echo configure:8497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8497 then
8498   :
8499 else
8500   echo "configure: failed program was:" >&5
8501   cat conftest.$ac_ext >&5
8502   rm -fr conftest*
8503   ol_cv_header_stdc=no
8504 fi
8505 rm -fr conftest*
8506 fi
8507
8508 fi
8509 fi
8510
8511 echo "$ac_t""$ol_cv_header_stdc" 1>&6
8512 if test $ol_cv_header_stdc = yes; then
8513   cat >> confdefs.h <<\EOF
8514 #define STDC_HEADERS 1
8515 EOF
8516
8517 fi
8518 ac_cv_header_stdc=disable
8519
8520
8521 if test $ol_cv_header_stdc != yes; then
8522         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
8523 fi
8524
8525 ac_header_dirent=no
8526 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
8527 do
8528 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8529 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
8530 echo "configure:8531: checking for $ac_hdr that defines DIR" >&5
8531 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
8532   echo $ac_n "(cached) $ac_c" 1>&6
8533 else
8534   cat > conftest.$ac_ext <<EOF
8535 #line 8536 "configure"
8536 #include "confdefs.h"
8537 #include <sys/types.h>
8538 #include <$ac_hdr>
8539 int main() {
8540 DIR *dirp = 0;
8541 ; return 0; }
8542 EOF
8543 if { (eval echo configure:8544: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8544   rm -rf conftest*
8545   eval "ac_cv_header_dirent_$ac_safe=yes"
8546 else
8547   echo "configure: failed program was:" >&5
8548   cat conftest.$ac_ext >&5
8549   rm -rf conftest*
8550   eval "ac_cv_header_dirent_$ac_safe=no"
8551 fi
8552 rm -f conftest*
8553 fi
8554 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
8555   echo "$ac_t""yes" 1>&6
8556     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8557   cat >> confdefs.h <<EOF
8558 #define $ac_tr_hdr 1
8559 EOF
8560  ac_header_dirent=$ac_hdr; break
8561 else
8562   echo "$ac_t""no" 1>&6
8563 fi
8564 done
8565 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
8566 if test $ac_header_dirent = dirent.h; then
8567 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
8568 echo "configure:8569: checking for opendir in -ldir" >&5
8569 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
8570 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8571   echo $ac_n "(cached) $ac_c" 1>&6
8572 else
8573   ac_save_LIBS="$LIBS"
8574 LIBS="-ldir  $LIBS"
8575 cat > conftest.$ac_ext <<EOF
8576 #line 8577 "configure"
8577 #include "confdefs.h"
8578 /* Override any gcc2 internal prototype to avoid an error.  */
8579 /* We use char because int might match the return type of a gcc2
8580     builtin and then its argument prototype would still apply.  */
8581 char opendir();
8582
8583 int main() {
8584 opendir()
8585 ; return 0; }
8586 EOF
8587 if { (eval echo configure:8588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8588   rm -rf conftest*
8589   eval "ac_cv_lib_$ac_lib_var=yes"
8590 else
8591   echo "configure: failed program was:" >&5
8592   cat conftest.$ac_ext >&5
8593   rm -rf conftest*
8594   eval "ac_cv_lib_$ac_lib_var=no"
8595 fi
8596 rm -f conftest*
8597 LIBS="$ac_save_LIBS"
8598
8599 fi
8600 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8601   echo "$ac_t""yes" 1>&6
8602   LIBS="$LIBS -ldir"
8603 else
8604   echo "$ac_t""no" 1>&6
8605 fi
8606
8607 else
8608 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
8609 echo "configure:8610: checking for opendir in -lx" >&5
8610 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
8611 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8612   echo $ac_n "(cached) $ac_c" 1>&6
8613 else
8614   ac_save_LIBS="$LIBS"
8615 LIBS="-lx  $LIBS"
8616 cat > conftest.$ac_ext <<EOF
8617 #line 8618 "configure"
8618 #include "confdefs.h"
8619 /* Override any gcc2 internal prototype to avoid an error.  */
8620 /* We use char because int might match the return type of a gcc2
8621     builtin and then its argument prototype would still apply.  */
8622 char opendir();
8623
8624 int main() {
8625 opendir()
8626 ; return 0; }
8627 EOF
8628 if { (eval echo configure:8629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8629   rm -rf conftest*
8630   eval "ac_cv_lib_$ac_lib_var=yes"
8631 else
8632   echo "configure: failed program was:" >&5
8633   cat conftest.$ac_ext >&5
8634   rm -rf conftest*
8635   eval "ac_cv_lib_$ac_lib_var=no"
8636 fi
8637 rm -f conftest*
8638 LIBS="$ac_save_LIBS"
8639
8640 fi
8641 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8642   echo "$ac_t""yes" 1>&6
8643   LIBS="$LIBS -lx"
8644 else
8645   echo "$ac_t""no" 1>&6
8646 fi
8647
8648 fi
8649
8650 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
8651 echo "configure:8652: checking for sys/wait.h that is POSIX.1 compatible" >&5
8652 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
8653   echo $ac_n "(cached) $ac_c" 1>&6
8654 else
8655   cat > conftest.$ac_ext <<EOF
8656 #line 8657 "configure"
8657 #include "confdefs.h"
8658 #include <sys/types.h>
8659 #include <sys/wait.h>
8660 #ifndef WEXITSTATUS
8661 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
8662 #endif
8663 #ifndef WIFEXITED
8664 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
8665 #endif
8666 int main() {
8667 int s;
8668 wait (&s);
8669 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
8670 ; return 0; }
8671 EOF
8672 if { (eval echo configure:8673: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8673   rm -rf conftest*
8674   ac_cv_header_sys_wait_h=yes
8675 else
8676   echo "configure: failed program was:" >&5
8677   cat conftest.$ac_ext >&5
8678   rm -rf conftest*
8679   ac_cv_header_sys_wait_h=no
8680 fi
8681 rm -f conftest*
8682 fi
8683
8684 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
8685 if test $ac_cv_header_sys_wait_h = yes; then
8686   cat >> confdefs.h <<\EOF
8687 #define HAVE_SYS_WAIT_H 1
8688 EOF
8689
8690 fi
8691
8692 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
8693 echo "configure:8694: checking POSIX termios" >&5
8694 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
8695   echo $ac_n "(cached) $ac_c" 1>&6
8696 else
8697   cat > conftest.$ac_ext <<EOF
8698 #line 8699 "configure"
8699 #include "confdefs.h"
8700 #include <sys/types.h>
8701 #include <unistd.h>
8702 #include <termios.h>
8703 int main() {
8704 /* SunOS 4.0.3 has termios.h but not the library calls.  */
8705    tcgetattr(0, 0);
8706 ; return 0; }
8707 EOF
8708 if { (eval echo configure:8709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8709   rm -rf conftest*
8710   am_cv_sys_posix_termios=yes
8711 else
8712   echo "configure: failed program was:" >&5
8713   cat conftest.$ac_ext >&5
8714   rm -rf conftest*
8715   am_cv_sys_posix_termios=no
8716 fi
8717 rm -f conftest*
8718 fi
8719
8720 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
8721
8722
8723  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
8724 echo "configure:8725: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
8725 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
8726   echo $ac_n "(cached) $ac_c" 1>&6
8727 else
8728   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
8729
8730   gwinsz_in_termios_h=no
8731   if test $am_cv_sys_posix_termios = yes; then
8732     cat > conftest.$ac_ext <<EOF
8733 #line 8734 "configure"
8734 #include "confdefs.h"
8735 #include <sys/types.h>
8736 #     include <termios.h>
8737 #     ifdef TIOCGWINSZ
8738         yes
8739 #     endif
8740     
8741 EOF
8742 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8743   egrep "yes" >/dev/null 2>&1; then
8744   rm -rf conftest*
8745   gwinsz_in_termios_h=yes
8746 fi
8747 rm -f conftest*
8748
8749   fi
8750
8751   if test $gwinsz_in_termios_h = no; then
8752     cat > conftest.$ac_ext <<EOF
8753 #line 8754 "configure"
8754 #include "confdefs.h"
8755 #include <sys/types.h>
8756 #     include <sys/ioctl.h>
8757 #     ifdef TIOCGWINSZ
8758         yes
8759 #     endif
8760     
8761 EOF
8762 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8763   egrep "yes" >/dev/null 2>&1; then
8764   rm -rf conftest*
8765   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
8766 fi
8767 rm -f conftest*
8768
8769   fi
8770   
8771 fi
8772
8773 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
8774   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
8775     cat >> confdefs.h <<\EOF
8776 #define GWINSZ_IN_SYS_IOCTL 1
8777 EOF
8778
8779   fi
8780
8781 if test $am_cv_sys_posix_termios = yes ; then
8782         cat >> confdefs.h <<\EOF
8783 #define HAVE_POSIX_TERMIOS 1
8784 EOF
8785
8786 fi
8787
8788 for ac_hdr in \
8789         arpa/inet.h             \
8790         arpa/nameser.h  \
8791         assert.h                \
8792         conio.h                 \
8793         crypt.h                 \
8794         direct.h                \
8795         errno.h                 \
8796         fcntl.h                 \
8797         filio.h                 \
8798         getopt.h                \
8799         grp.h                   \
8800         io.h                    \
8801         libutil.h               \
8802         limits.h                \
8803         locale.h                \
8804         netinet/tcp.h   \
8805         malloc.h                \
8806         memory.h                \
8807         psap.h                  \
8808         pwd.h                   \
8809         process.h               \
8810         resolv.h                \
8811         sgtty.h                 \
8812         shadow.h                \
8813         stddef.h                \
8814         string.h                \
8815         strings.h               \
8816         sysexits.h              \
8817         sys/file.h              \
8818         sys/filio.h             \
8819         sys/errno.h             \
8820         sys/ioctl.h             \
8821         sys/param.h             \
8822         sys/resource.h  \
8823         sys/select.h    \
8824         sys/socket.h    \
8825         sys/syslog.h    \
8826         sys/time.h              \
8827         sys/types.h             \
8828         syslog.h                \
8829         termios.h               \
8830         unistd.h                \
8831         winsock.h               \
8832         winsock2.h              \
8833
8834 do
8835 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8836 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8837 echo "configure:8838: checking for $ac_hdr" >&5
8838 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8839   echo $ac_n "(cached) $ac_c" 1>&6
8840 else
8841   cat > conftest.$ac_ext <<EOF
8842 #line 8843 "configure"
8843 #include "confdefs.h"
8844 #include <$ac_hdr>
8845 EOF
8846 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8847 { (eval echo configure:8848: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8848 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8849 if test -z "$ac_err"; then
8850   rm -rf conftest*
8851   eval "ac_cv_header_$ac_safe=yes"
8852 else
8853   echo "$ac_err" >&5
8854   echo "configure: failed program was:" >&5
8855   cat conftest.$ac_ext >&5
8856   rm -rf conftest*
8857   eval "ac_cv_header_$ac_safe=no"
8858 fi
8859 rm -f conftest*
8860 fi
8861 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8862   echo "$ac_t""yes" 1>&6
8863     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8864   cat >> confdefs.h <<EOF
8865 #define $ac_tr_hdr 1
8866 EOF
8867  
8868 else
8869   echo "$ac_t""no" 1>&6
8870 fi
8871 done
8872
8873
8874
8875
8876 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
8877 echo "configure:8878: checking for dlopen" >&5
8878 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
8879   echo $ac_n "(cached) $ac_c" 1>&6
8880 else
8881   cat > conftest.$ac_ext <<EOF
8882 #line 8883 "configure"
8883 #include "confdefs.h"
8884 /* System header to define __stub macros and hopefully few prototypes,
8885     which can conflict with char dlopen(); below.  */
8886 #include <assert.h>
8887 /* Override any gcc2 internal prototype to avoid an error.  */
8888 /* We use char because int might match the return type of a gcc2
8889     builtin and then its argument prototype would still apply.  */
8890 char dlopen();
8891 char (*f)();
8892
8893 int main() {
8894
8895 /* The GNU C library defines this for functions which it implements
8896     to always fail with ENOSYS.  Some functions are actually named
8897     something starting with __ and the normal name is an alias.  */
8898 #if defined (__stub_dlopen) || defined (__stub___dlopen)
8899 choke me
8900 #else
8901 f = dlopen;
8902 #endif
8903
8904 ; return 0; }
8905 EOF
8906 if { (eval echo configure:8907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8907   rm -rf conftest*
8908   eval "ac_cv_func_dlopen=yes"
8909 else
8910   echo "configure: failed program was:" >&5
8911   cat conftest.$ac_ext >&5
8912   rm -rf conftest*
8913   eval "ac_cv_func_dlopen=no"
8914 fi
8915 rm -f conftest*
8916 fi
8917
8918 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
8919   echo "$ac_t""yes" 1>&6
8920   :
8921 else
8922   echo "$ac_t""no" 1>&6
8923 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
8924 echo "configure:8925: checking for dlopen in -ldl" >&5
8925 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
8926 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8927   echo $ac_n "(cached) $ac_c" 1>&6
8928 else
8929   ac_save_LIBS="$LIBS"
8930 LIBS="-ldl  $LIBS"
8931 cat > conftest.$ac_ext <<EOF
8932 #line 8933 "configure"
8933 #include "confdefs.h"
8934 /* Override any gcc2 internal prototype to avoid an error.  */
8935 /* We use char because int might match the return type of a gcc2
8936     builtin and then its argument prototype would still apply.  */
8937 char dlopen();
8938
8939 int main() {
8940 dlopen()
8941 ; return 0; }
8942 EOF
8943 if { (eval echo configure:8944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8944   rm -rf conftest*
8945   eval "ac_cv_lib_$ac_lib_var=yes"
8946 else
8947   echo "configure: failed program was:" >&5
8948   cat conftest.$ac_ext >&5
8949   rm -rf conftest*
8950   eval "ac_cv_lib_$ac_lib_var=no"
8951 fi
8952 rm -f conftest*
8953 LIBS="$ac_save_LIBS"
8954
8955 fi
8956 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8957   echo "$ac_t""yes" 1>&6
8958     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8959     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8960   cat >> confdefs.h <<EOF
8961 #define $ac_tr_lib 1
8962 EOF
8963
8964   LIBS="-ldl $LIBS"
8965
8966 else
8967   echo "$ac_t""no" 1>&6
8968 fi
8969
8970 fi
8971
8972
8973 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
8974 echo "configure:8975: checking for sigset in -lV3" >&5
8975 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
8976 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8977   echo $ac_n "(cached) $ac_c" 1>&6
8978 else
8979   ac_save_LIBS="$LIBS"
8980 LIBS="-lV3  $LIBS"
8981 cat > conftest.$ac_ext <<EOF
8982 #line 8983 "configure"
8983 #include "confdefs.h"
8984 /* Override any gcc2 internal prototype to avoid an error.  */
8985 /* We use char because int might match the return type of a gcc2
8986     builtin and then its argument prototype would still apply.  */
8987 char sigset();
8988
8989 int main() {
8990 sigset()
8991 ; return 0; }
8992 EOF
8993 if { (eval echo configure:8994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8994   rm -rf conftest*
8995   eval "ac_cv_lib_$ac_lib_var=yes"
8996 else
8997   echo "configure: failed program was:" >&5
8998   cat conftest.$ac_ext >&5
8999   rm -rf conftest*
9000   eval "ac_cv_lib_$ac_lib_var=no"
9001 fi
9002 rm -f conftest*
9003 LIBS="$ac_save_LIBS"
9004
9005 fi
9006 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9007   echo "$ac_t""yes" 1>&6
9008     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9009     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9010   cat >> confdefs.h <<EOF
9011 #define $ac_tr_lib 1
9012 EOF
9013
9014   LIBS="-lV3 $LIBS"
9015
9016 else
9017   echo "$ac_t""no" 1>&6
9018 fi
9019
9020
9021 echo $ac_n "checking for winsock""... $ac_c" 1>&6
9022 echo "configure:9023: checking for winsock" >&5
9023 save_LIBS="$LIBS"
9024 for curlib in ws2_32 wsock32; do
9025         LIBS="$LIBS -l$curlib"
9026         cat > conftest.$ac_ext <<EOF
9027 #line 9028 "configure"
9028 #include "confdefs.h"
9029
9030                         char socket@12();
9031                         char select@20();
9032                         char closesocket@4();
9033                         char gethostname@8();
9034                         
9035 int main() {
9036
9037                         socket@12();
9038                         select@20();
9039                         closesocket@4();
9040                         gethostname@8();
9041                         
9042 ; return 0; }
9043 EOF
9044 if { (eval echo configure:9045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9045   rm -rf conftest*
9046   have_winsock=yes
9047 else
9048   echo "configure: failed program was:" >&5
9049   cat conftest.$ac_ext >&5
9050   rm -rf conftest*
9051   have_winsock=no
9052 fi
9053 rm -f conftest*
9054
9055         if test $have_winsock = yes; then
9056                 cat >> confdefs.h <<\EOF
9057 #define HAVE_WINSOCK 1
9058 EOF
9059
9060                 ac_cv_func_socket=yes
9061                 ac_cv_func_select=yes
9062                 ac_cv_func_closesocket=yes
9063                 ac_cv_func_gethostname=yes
9064                 if test $curlib = ws2_32; then
9065                         have_winsock=winsock2
9066                         cat >> confdefs.h <<\EOF
9067 #define HAVE_WINSOCK2 1
9068 EOF
9069
9070                 fi
9071                 break
9072         fi
9073         LIBS="$save_LIBS"
9074 done
9075 echo "$ac_t""$have_winsock" 1>&6
9076
9077
9078 echo $ac_n "checking for socket""... $ac_c" 1>&6
9079 echo "configure:9080: checking for socket" >&5
9080 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
9081   echo $ac_n "(cached) $ac_c" 1>&6
9082 else
9083   cat > conftest.$ac_ext <<EOF
9084 #line 9085 "configure"
9085 #include "confdefs.h"
9086 /* System header to define __stub macros and hopefully few prototypes,
9087     which can conflict with char socket(); below.  */
9088 #include <assert.h>
9089 /* Override any gcc2 internal prototype to avoid an error.  */
9090 /* We use char because int might match the return type of a gcc2
9091     builtin and then its argument prototype would still apply.  */
9092 char socket();
9093 char (*f)();
9094
9095 int main() {
9096
9097 /* The GNU C library defines this for functions which it implements
9098     to always fail with ENOSYS.  Some functions are actually named
9099     something starting with __ and the normal name is an alias.  */
9100 #if defined (__stub_socket) || defined (__stub___socket)
9101 choke me
9102 #else
9103 f = socket;
9104 #endif
9105
9106 ; return 0; }
9107 EOF
9108 if { (eval echo configure:9109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9109   rm -rf conftest*
9110   eval "ac_cv_func_socket=yes"
9111 else
9112   echo "configure: failed program was:" >&5
9113   cat conftest.$ac_ext >&5
9114   rm -rf conftest*
9115   eval "ac_cv_func_socket=no"
9116 fi
9117 rm -f conftest*
9118 fi
9119
9120 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
9121   echo "$ac_t""yes" 1>&6
9122   :
9123 else
9124   echo "$ac_t""no" 1>&6
9125         
9126         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
9127 echo "configure:9128: checking for main in -lsocket" >&5
9128 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
9129 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9130   echo $ac_n "(cached) $ac_c" 1>&6
9131 else
9132   ac_save_LIBS="$LIBS"
9133 LIBS="-lsocket  $LIBS"
9134 cat > conftest.$ac_ext <<EOF
9135 #line 9136 "configure"
9136 #include "confdefs.h"
9137
9138 int main() {
9139 main()
9140 ; return 0; }
9141 EOF
9142 if { (eval echo configure:9143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9143   rm -rf conftest*
9144   eval "ac_cv_lib_$ac_lib_var=yes"
9145 else
9146   echo "configure: failed program was:" >&5
9147   cat conftest.$ac_ext >&5
9148   rm -rf conftest*
9149   eval "ac_cv_lib_$ac_lib_var=no"
9150 fi
9151 rm -f conftest*
9152 LIBS="$ac_save_LIBS"
9153
9154 fi
9155 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9156   echo "$ac_t""yes" 1>&6
9157     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9158     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9159   cat >> confdefs.h <<EOF
9160 #define $ac_tr_lib 1
9161 EOF
9162
9163   LIBS="-lsocket $LIBS"
9164
9165 else
9166   echo "$ac_t""no" 1>&6
9167 fi
9168
9169         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
9170 echo "configure:9171: checking for main in -lnet" >&5
9171 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
9172 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9173   echo $ac_n "(cached) $ac_c" 1>&6
9174 else
9175   ac_save_LIBS="$LIBS"
9176 LIBS="-lnet  $LIBS"
9177 cat > conftest.$ac_ext <<EOF
9178 #line 9179 "configure"
9179 #include "confdefs.h"
9180
9181 int main() {
9182 main()
9183 ; return 0; }
9184 EOF
9185 if { (eval echo configure:9186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9186   rm -rf conftest*
9187   eval "ac_cv_lib_$ac_lib_var=yes"
9188 else
9189   echo "configure: failed program was:" >&5
9190   cat conftest.$ac_ext >&5
9191   rm -rf conftest*
9192   eval "ac_cv_lib_$ac_lib_var=no"
9193 fi
9194 rm -f conftest*
9195 LIBS="$ac_save_LIBS"
9196
9197 fi
9198 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9199   echo "$ac_t""yes" 1>&6
9200     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9201     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9202   cat >> confdefs.h <<EOF
9203 #define $ac_tr_lib 1
9204 EOF
9205
9206   LIBS="-lnet $LIBS"
9207
9208 else
9209   echo "$ac_t""no" 1>&6
9210 fi
9211
9212         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
9213 echo "configure:9214: checking for main in -lnsl_s" >&5
9214 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
9215 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9216   echo $ac_n "(cached) $ac_c" 1>&6
9217 else
9218   ac_save_LIBS="$LIBS"
9219 LIBS="-lnsl_s  $LIBS"
9220 cat > conftest.$ac_ext <<EOF
9221 #line 9222 "configure"
9222 #include "confdefs.h"
9223
9224 int main() {
9225 main()
9226 ; return 0; }
9227 EOF
9228 if { (eval echo configure:9229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9229   rm -rf conftest*
9230   eval "ac_cv_lib_$ac_lib_var=yes"
9231 else
9232   echo "configure: failed program was:" >&5
9233   cat conftest.$ac_ext >&5
9234   rm -rf conftest*
9235   eval "ac_cv_lib_$ac_lib_var=no"
9236 fi
9237 rm -f conftest*
9238 LIBS="$ac_save_LIBS"
9239
9240 fi
9241 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9242   echo "$ac_t""yes" 1>&6
9243     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9244     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9245   cat >> confdefs.h <<EOF
9246 #define $ac_tr_lib 1
9247 EOF
9248
9249   LIBS="-lnsl_s $LIBS"
9250
9251 else
9252   echo "$ac_t""no" 1>&6
9253 fi
9254
9255         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
9256 echo "configure:9257: checking for main in -lnsl" >&5
9257 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
9258 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9259   echo $ac_n "(cached) $ac_c" 1>&6
9260 else
9261   ac_save_LIBS="$LIBS"
9262 LIBS="-lnsl  $LIBS"
9263 cat > conftest.$ac_ext <<EOF
9264 #line 9265 "configure"
9265 #include "confdefs.h"
9266
9267 int main() {
9268 main()
9269 ; return 0; }
9270 EOF
9271 if { (eval echo configure:9272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9272   rm -rf conftest*
9273   eval "ac_cv_lib_$ac_lib_var=yes"
9274 else
9275   echo "configure: failed program was:" >&5
9276   cat conftest.$ac_ext >&5
9277   rm -rf conftest*
9278   eval "ac_cv_lib_$ac_lib_var=no"
9279 fi
9280 rm -f conftest*
9281 LIBS="$ac_save_LIBS"
9282
9283 fi
9284 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9285   echo "$ac_t""yes" 1>&6
9286     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9287     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9288   cat >> confdefs.h <<EOF
9289 #define $ac_tr_lib 1
9290 EOF
9291
9292   LIBS="-lnsl $LIBS"
9293
9294 else
9295   echo "$ac_t""no" 1>&6
9296 fi
9297
9298         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
9299 echo "configure:9300: checking for socket in -linet" >&5
9300 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
9301 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9302   echo $ac_n "(cached) $ac_c" 1>&6
9303 else
9304   ac_save_LIBS="$LIBS"
9305 LIBS="-linet  $LIBS"
9306 cat > conftest.$ac_ext <<EOF
9307 #line 9308 "configure"
9308 #include "confdefs.h"
9309 /* Override any gcc2 internal prototype to avoid an error.  */
9310 /* We use char because int might match the return type of a gcc2
9311     builtin and then its argument prototype would still apply.  */
9312 char socket();
9313
9314 int main() {
9315 socket()
9316 ; return 0; }
9317 EOF
9318 if { (eval echo configure:9319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9319   rm -rf conftest*
9320   eval "ac_cv_lib_$ac_lib_var=yes"
9321 else
9322   echo "configure: failed program was:" >&5
9323   cat conftest.$ac_ext >&5
9324   rm -rf conftest*
9325   eval "ac_cv_lib_$ac_lib_var=no"
9326 fi
9327 rm -f conftest*
9328 LIBS="$ac_save_LIBS"
9329
9330 fi
9331 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9332   echo "$ac_t""yes" 1>&6
9333     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9334     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9335   cat >> confdefs.h <<EOF
9336 #define $ac_tr_lib 1
9337 EOF
9338
9339   LIBS="-linet $LIBS"
9340
9341 else
9342   echo "$ac_t""no" 1>&6
9343 fi
9344
9345         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
9346 echo "configure:9347: checking for main in -lgen" >&5
9347 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
9348 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9349   echo $ac_n "(cached) $ac_c" 1>&6
9350 else
9351   ac_save_LIBS="$LIBS"
9352 LIBS="-lgen  $LIBS"
9353 cat > conftest.$ac_ext <<EOF
9354 #line 9355 "configure"
9355 #include "confdefs.h"
9356
9357 int main() {
9358 main()
9359 ; return 0; }
9360 EOF
9361 if { (eval echo configure:9362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9362   rm -rf conftest*
9363   eval "ac_cv_lib_$ac_lib_var=yes"
9364 else
9365   echo "configure: failed program was:" >&5
9366   cat conftest.$ac_ext >&5
9367   rm -rf conftest*
9368   eval "ac_cv_lib_$ac_lib_var=no"
9369 fi
9370 rm -f conftest*
9371 LIBS="$ac_save_LIBS"
9372
9373 fi
9374 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9375   echo "$ac_t""yes" 1>&6
9376     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9377     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9378   cat >> confdefs.h <<EOF
9379 #define $ac_tr_lib 1
9380 EOF
9381
9382   LIBS="-lgen $LIBS"
9383
9384 else
9385   echo "$ac_t""no" 1>&6
9386 fi
9387
9388
9389 fi
9390
9391
9392 echo $ac_n "checking for select""... $ac_c" 1>&6
9393 echo "configure:9394: checking for select" >&5
9394 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
9395   echo $ac_n "(cached) $ac_c" 1>&6
9396 else
9397   cat > conftest.$ac_ext <<EOF
9398 #line 9399 "configure"
9399 #include "confdefs.h"
9400 /* System header to define __stub macros and hopefully few prototypes,
9401     which can conflict with char select(); below.  */
9402 #include <assert.h>
9403 /* Override any gcc2 internal prototype to avoid an error.  */
9404 /* We use char because int might match the return type of a gcc2
9405     builtin and then its argument prototype would still apply.  */
9406 char select();
9407 char (*f)();
9408
9409 int main() {
9410
9411 /* The GNU C library defines this for functions which it implements
9412     to always fail with ENOSYS.  Some functions are actually named
9413     something starting with __ and the normal name is an alias.  */
9414 #if defined (__stub_select) || defined (__stub___select)
9415 choke me
9416 #else
9417 f = select;
9418 #endif
9419
9420 ; return 0; }
9421 EOF
9422 if { (eval echo configure:9423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9423   rm -rf conftest*
9424   eval "ac_cv_func_select=yes"
9425 else
9426   echo "configure: failed program was:" >&5
9427   cat conftest.$ac_ext >&5
9428   rm -rf conftest*
9429   eval "ac_cv_func_select=no"
9430 fi
9431 rm -f conftest*
9432 fi
9433
9434 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
9435   echo "$ac_t""yes" 1>&6
9436   :
9437 else
9438   echo "$ac_t""no" 1>&6
9439 { echo "configure: error: select() required." 1>&2; exit 1; }
9440 fi
9441
9442
9443 if test "${ac_cv_header_winsock_h}" != yes; then
9444                                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
9445 echo "configure:9446: checking types of arguments for select()" >&5
9446  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
9447   echo $ac_n "(cached) $ac_c" 1>&6
9448 else
9449    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
9450   echo $ac_n "(cached) $ac_c" 1>&6
9451 else
9452     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
9453   echo $ac_n "(cached) $ac_c" 1>&6
9454 else
9455      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
9456      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
9457       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
9458        cat > conftest.$ac_ext <<EOF
9459 #line 9460 "configure"
9460 #include "confdefs.h"
9461 #ifdef HAVE_SYS_TYPES_H
9462 #include <sys/types.h>
9463 #endif
9464 #ifdef HAVE_SYS_TIME_H
9465 #include <sys/time.h>
9466 #endif
9467 #ifdef HAVE_SYS_SELECT_H
9468 #include <sys/select.h>
9469 #endif
9470 #ifdef HAVE_SYS_SOCKET_H
9471 #include <sys/socket.h>
9472 #endif
9473 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);
9474 int main() {
9475
9476 ; return 0; }
9477 EOF
9478 if { (eval echo configure:9479: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9479   rm -rf conftest*
9480           ac_not_found=no ; break 3
9481 else
9482   echo "configure: failed program was:" >&5
9483   cat conftest.$ac_ext >&5
9484   rm -rf conftest*
9485   ac_not_found=yes
9486 fi
9487 rm -f conftest*
9488       done
9489      done
9490     done
9491    
9492 fi
9493   
9494 fi
9495  
9496 fi
9497  if test "$ac_not_found" = yes; then
9498   ac_cv_func_select_arg1=int 
9499   ac_cv_func_select_arg234='int *' 
9500   ac_cv_func_select_arg5='struct timeval *'
9501  fi
9502  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
9503  cat >> confdefs.h <<EOF
9504 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
9505 EOF
9506
9507  cat >> confdefs.h <<EOF
9508 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
9509 EOF
9510
9511  cat >> confdefs.h <<EOF
9512 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
9513 EOF
9514
9515
9516 fi
9517
9518
9519 for ac_hdr in regex.h 
9520 do
9521 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9522 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9523 echo "configure:9524: checking for $ac_hdr" >&5
9524 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9525   echo $ac_n "(cached) $ac_c" 1>&6
9526 else
9527   cat > conftest.$ac_ext <<EOF
9528 #line 9529 "configure"
9529 #include "confdefs.h"
9530 #include <$ac_hdr>
9531 EOF
9532 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9533 { (eval echo configure:9534: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9534 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9535 if test -z "$ac_err"; then
9536   rm -rf conftest*
9537   eval "ac_cv_header_$ac_safe=yes"
9538 else
9539   echo "$ac_err" >&5
9540   echo "configure: failed program was:" >&5
9541   cat conftest.$ac_ext >&5
9542   rm -rf conftest*
9543   eval "ac_cv_header_$ac_safe=no"
9544 fi
9545 rm -f conftest*
9546 fi
9547 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9548   echo "$ac_t""yes" 1>&6
9549     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9550   cat >> confdefs.h <<EOF
9551 #define $ac_tr_hdr 1
9552 EOF
9553  
9554 else
9555   echo "$ac_t""no" 1>&6
9556 fi
9557 done
9558
9559 if test "$ac_cv_header_regex_h" != yes ; then
9560         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
9561 fi
9562
9563 echo $ac_n "checking for library containing regfree""... $ac_c" 1>&6
9564 echo "configure:9565: checking for library containing regfree" >&5
9565 if eval "test \"\${ac_cv_search_regfree+set}\" = set"; then
9566   echo $ac_n "(cached) $ac_c" 1>&6
9567 else
9568   ac_func_search_save_LIBS="$LIBS"
9569 ac_cv_search_regfree="no"
9570 cat > conftest.$ac_ext <<EOF
9571 #line 9572 "configure"
9572 #include "confdefs.h"
9573 /* Override any gcc2 internal prototype to avoid an error.  */
9574 /* We use char because int might match the return type of a gcc2
9575     builtin and then its argument prototype would still apply.  */
9576 char regfree();
9577
9578 int main() {
9579 regfree()
9580 ; return 0; }
9581 EOF
9582 if { (eval echo configure:9583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9583   rm -rf conftest*
9584   ac_cv_search_regfree="none required"
9585 else
9586   echo "configure: failed program was:" >&5
9587   cat conftest.$ac_ext >&5
9588 fi
9589 rm -f conftest*
9590 test "$ac_cv_search_regfree" = "no" && for ac_lib in regex gnuregex; do
9591 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9592 cat > conftest.$ac_ext <<EOF
9593 #line 9594 "configure"
9594 #include "confdefs.h"
9595 /* Override any gcc2 internal prototype to avoid an error.  */
9596 /* We use char because int might match the return type of a gcc2
9597     builtin and then its argument prototype would still apply.  */
9598 char regfree();
9599
9600 int main() {
9601 regfree()
9602 ; return 0; }
9603 EOF
9604 if { (eval echo configure:9605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9605   rm -rf conftest*
9606   ac_cv_search_regfree="-l$ac_lib"
9607 break
9608 else
9609   echo "configure: failed program was:" >&5
9610   cat conftest.$ac_ext >&5
9611 fi
9612 rm -f conftest*
9613 done
9614 LIBS="$ac_func_search_save_LIBS"
9615 fi
9616
9617 echo "$ac_t""$ac_cv_search_regfree" 1>&6
9618 if test "$ac_cv_search_regfree" != "no"; then
9619   test "$ac_cv_search_regfree" = "none required" || LIBS="$ac_cv_search_regfree $LIBS"
9620   :
9621 else :
9622   { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
9623 fi
9624
9625
9626 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
9627 echo "configure:9628: checking for compatible POSIX regex" >&5
9628 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
9629   echo $ac_n "(cached) $ac_c" 1>&6
9630 else
9631   
9632         if test "$cross_compiling" = yes; then
9633   ol_cv_c_posix_regex=cross
9634 else
9635   cat > conftest.$ac_ext <<EOF
9636 #line 9637 "configure"
9637 #include "confdefs.h"
9638
9639 #include <sys/types.h>
9640 #include <regex.h>
9641 static char *pattern, *string;
9642 main()
9643 {
9644         int rc;
9645         regex_t re;
9646
9647         pattern = "^A";
9648
9649         if(regcomp(&re, pattern, 0)) {
9650                 return -1;
9651         }
9652         
9653         string = "ALL MATCH";
9654         
9655         rc = regexec(&re, string, 0, (void*)0, 0);
9656
9657         regfree(&re);
9658
9659         return rc;
9660 }
9661 EOF
9662 if { (eval echo configure:9663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9663 then
9664   ol_cv_c_posix_regex=yes
9665 else
9666   echo "configure: failed program was:" >&5
9667   cat conftest.$ac_ext >&5
9668   rm -fr conftest*
9669   ol_cv_c_posix_regex=no
9670 fi
9671 rm -fr conftest*
9672 fi
9673
9674 fi
9675
9676 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
9677
9678 if test "$ol_cv_c_posix_regex" = no ; then
9679         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
9680 fi
9681
9682
9683 have_uuid=no
9684 for ac_hdr in sys/uuid.h
9685 do
9686 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9687 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9688 echo "configure:9689: checking for $ac_hdr" >&5
9689 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9690   echo $ac_n "(cached) $ac_c" 1>&6
9691 else
9692   cat > conftest.$ac_ext <<EOF
9693 #line 9694 "configure"
9694 #include "confdefs.h"
9695 #include <$ac_hdr>
9696 EOF
9697 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9698 { (eval echo configure:9699: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9699 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9700 if test -z "$ac_err"; then
9701   rm -rf conftest*
9702   eval "ac_cv_header_$ac_safe=yes"
9703 else
9704   echo "$ac_err" >&5
9705   echo "configure: failed program was:" >&5
9706   cat conftest.$ac_ext >&5
9707   rm -rf conftest*
9708   eval "ac_cv_header_$ac_safe=no"
9709 fi
9710 rm -f conftest*
9711 fi
9712 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9713   echo "$ac_t""yes" 1>&6
9714     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9715   cat >> confdefs.h <<EOF
9716 #define $ac_tr_hdr 1
9717 EOF
9718  
9719 else
9720   echo "$ac_t""no" 1>&6
9721 fi
9722 done
9723
9724 if test $ac_cv_header_sys_uuid_h = yes ; then
9725         save_LIBS="$LIBS"
9726         
9727 echo $ac_n "checking for library containing uuid_to_str""... $ac_c" 1>&6
9728 echo "configure:9729: checking for library containing uuid_to_str" >&5
9729 if eval "test \"\${ac_cv_search_uuid_to_str+set}\" = set"; then
9730   echo $ac_n "(cached) $ac_c" 1>&6
9731 else
9732   ac_func_search_save_LIBS="$LIBS"
9733 ac_cv_search_uuid_to_str="no"
9734 cat > conftest.$ac_ext <<EOF
9735 #line 9736 "configure"
9736 #include "confdefs.h"
9737 /* Override any gcc2 internal prototype to avoid an error.  */
9738 /* We use char because int might match the return type of a gcc2
9739     builtin and then its argument prototype would still apply.  */
9740 char uuid_to_str();
9741
9742 int main() {
9743 uuid_to_str()
9744 ; return 0; }
9745 EOF
9746 if { (eval echo configure:9747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9747   rm -rf conftest*
9748   ac_cv_search_uuid_to_str="none required"
9749 else
9750   echo "configure: failed program was:" >&5
9751   cat conftest.$ac_ext >&5
9752 fi
9753 rm -f conftest*
9754 test "$ac_cv_search_uuid_to_str" = "no" && for ac_lib in uuid; do
9755 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9756 cat > conftest.$ac_ext <<EOF
9757 #line 9758 "configure"
9758 #include "confdefs.h"
9759 /* Override any gcc2 internal prototype to avoid an error.  */
9760 /* We use char because int might match the return type of a gcc2
9761     builtin and then its argument prototype would still apply.  */
9762 char uuid_to_str();
9763
9764 int main() {
9765 uuid_to_str()
9766 ; return 0; }
9767 EOF
9768 if { (eval echo configure:9769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9769   rm -rf conftest*
9770   ac_cv_search_uuid_to_str="-l$ac_lib"
9771 break
9772 else
9773   echo "configure: failed program was:" >&5
9774   cat conftest.$ac_ext >&5
9775 fi
9776 rm -f conftest*
9777 done
9778 LIBS="$ac_func_search_save_LIBS"
9779 fi
9780
9781 echo "$ac_t""$ac_cv_search_uuid_to_str" 1>&6
9782 if test "$ac_cv_search_uuid_to_str" != "no"; then
9783   test "$ac_cv_search_uuid_to_str" = "none required" || LIBS="$ac_cv_search_uuid_to_str $LIBS"
9784   have_uuid=yes
9785 else :
9786   :
9787 fi
9788         LIBS="$save_LIBS"
9789
9790         if test have_uuid = yes ; then
9791                 cat >> confdefs.h <<\EOF
9792 #define HAVE_UUID_TO_STR 1
9793 EOF
9794
9795
9796                 test "$ac_cv_search_uuid_to_str" = "none required" || \
9797                         SLAPD_LIBS="$SLAPD_LIBS $ac_cv_search_uuid_to_str"
9798         fi
9799 fi
9800
9801 if test $have_uuid = no ; then
9802         echo $ac_n "checking to see if -lrpcrt4 is needed for win32 UUID support""... $ac_c" 1>&6
9803 echo "configure:9804: checking to see if -lrpcrt4 is needed for win32 UUID support" >&5
9804         save_LIBS="$LIBS"
9805         LIBS="$LIBS -lrpcrt4"
9806         cat > conftest.$ac_ext <<EOF
9807 #line 9808 "configure"
9808 #include "confdefs.h"
9809
9810                 char UuidCreate@4();
9811                 char UuidToStringA@8();
9812                 
9813 int main() {
9814
9815                 UuidCreate@4();
9816                 UuidToStringA@8();
9817                 
9818 ; return 0; }
9819 EOF
9820 if { (eval echo configure:9821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9821   rm -rf conftest*
9822   need_rpcrt=yes
9823 else
9824   echo "configure: failed program was:" >&5
9825   cat conftest.$ac_ext >&5
9826   rm -rf conftest*
9827   need_rpcrt=no
9828 fi
9829 rm -f conftest*
9830         if test $need_rpcrt = yes; then
9831                 SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
9832         fi
9833         LIBS="$save_LIBS"
9834         echo "$ac_t""$need_rpcrt" 1>&6
9835 fi
9836
9837 ol_link_dnssrv=no
9838 echo $ac_n "checking for res_query""... $ac_c" 1>&6
9839 echo "configure:9840: checking for res_query" >&5
9840 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
9841   echo $ac_n "(cached) $ac_c" 1>&6
9842 else
9843   cat > conftest.$ac_ext <<EOF
9844 #line 9845 "configure"
9845 #include "confdefs.h"
9846 /* System header to define __stub macros and hopefully few prototypes,
9847     which can conflict with char res_query(); below.  */
9848 #include <assert.h>
9849 /* Override any gcc2 internal prototype to avoid an error.  */
9850 /* We use char because int might match the return type of a gcc2
9851     builtin and then its argument prototype would still apply.  */
9852 char res_query();
9853 char (*f)();
9854
9855 int main() {
9856
9857 /* The GNU C library defines this for functions which it implements
9858     to always fail with ENOSYS.  Some functions are actually named
9859     something starting with __ and the normal name is an alias.  */
9860 #if defined (__stub_res_query) || defined (__stub___res_query)
9861 choke me
9862 #else
9863 f = res_query;
9864 #endif
9865
9866 ; return 0; }
9867 EOF
9868 if { (eval echo configure:9869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9869   rm -rf conftest*
9870   eval "ac_cv_func_res_query=yes"
9871 else
9872   echo "configure: failed program was:" >&5
9873   cat conftest.$ac_ext >&5
9874   rm -rf conftest*
9875   eval "ac_cv_func_res_query=no"
9876 fi
9877 rm -f conftest*
9878 fi
9879
9880 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
9881   echo "$ac_t""yes" 1>&6
9882   :
9883 else
9884   echo "$ac_t""no" 1>&6
9885 fi
9886
9887 if test $ac_cv_func_res_query = no ; then 
9888         echo $ac_n "checking for __res_query""... $ac_c" 1>&6
9889 echo "configure:9890: checking for __res_query" >&5
9890 if eval "test \"\${ac_cv_func___res_query+set}\" = set"; then
9891   echo $ac_n "(cached) $ac_c" 1>&6
9892 else
9893   cat > conftest.$ac_ext <<EOF
9894 #line 9895 "configure"
9895 #include "confdefs.h"
9896 /* System header to define __stub macros and hopefully few prototypes,
9897     which can conflict with char __res_query(); below.  */
9898 #include <assert.h>
9899 /* Override any gcc2 internal prototype to avoid an error.  */
9900 /* We use char because int might match the return type of a gcc2
9901     builtin and then its argument prototype would still apply.  */
9902 char __res_query();
9903 char (*f)();
9904
9905 int main() {
9906
9907 /* The GNU C library defines this for functions which it implements
9908     to always fail with ENOSYS.  Some functions are actually named
9909     something starting with __ and the normal name is an alias.  */
9910 #if defined (__stub___res_query) || defined (__stub_____res_query)
9911 choke me
9912 #else
9913 f = __res_query;
9914 #endif
9915
9916 ; return 0; }
9917 EOF
9918 if { (eval echo configure:9919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9919   rm -rf conftest*
9920   eval "ac_cv_func___res_query=yes"
9921 else
9922   echo "configure: failed program was:" >&5
9923   cat conftest.$ac_ext >&5
9924   rm -rf conftest*
9925   eval "ac_cv_func___res_query=no"
9926 fi
9927 rm -f conftest*
9928 fi
9929
9930 if eval "test \"`echo '$ac_cv_func_'__res_query`\" = yes"; then
9931   echo "$ac_t""yes" 1>&6
9932   :
9933 else
9934   echo "$ac_t""no" 1>&6
9935 fi
9936
9937         ac_cv_func_res_query=$ac_cv_func___res_query
9938 fi
9939
9940 if test $ac_cv_func_res_query = no ; then 
9941         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
9942 echo "configure:9943: checking for res_query in -lbind" >&5
9943 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
9944 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9945   echo $ac_n "(cached) $ac_c" 1>&6
9946 else
9947   ac_save_LIBS="$LIBS"
9948 LIBS="-lbind  $LIBS"
9949 cat > conftest.$ac_ext <<EOF
9950 #line 9951 "configure"
9951 #include "confdefs.h"
9952 /* Override any gcc2 internal prototype to avoid an error.  */
9953 /* We use char because int might match the return type of a gcc2
9954     builtin and then its argument prototype would still apply.  */
9955 char res_query();
9956
9957 int main() {
9958 res_query()
9959 ; return 0; }
9960 EOF
9961 if { (eval echo configure:9962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9962   rm -rf conftest*
9963   eval "ac_cv_lib_$ac_lib_var=yes"
9964 else
9965   echo "configure: failed program was:" >&5
9966   cat conftest.$ac_ext >&5
9967   rm -rf conftest*
9968   eval "ac_cv_lib_$ac_lib_var=no"
9969 fi
9970 rm -f conftest*
9971 LIBS="$ac_save_LIBS"
9972
9973 fi
9974 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9975   echo "$ac_t""yes" 1>&6
9976     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9977     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9978   cat >> confdefs.h <<EOF
9979 #define $ac_tr_lib 1
9980 EOF
9981
9982   LIBS="-lbind $LIBS"
9983
9984 else
9985   echo "$ac_t""no" 1>&6
9986 fi
9987
9988         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
9989 fi
9990
9991 if test $ac_cv_func_res_query = no ; then 
9992         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
9993 echo "configure:9994: checking for __res_query in -lbind" >&5
9994 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
9995 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9996   echo $ac_n "(cached) $ac_c" 1>&6
9997 else
9998   ac_save_LIBS="$LIBS"
9999 LIBS="-lbind  $LIBS"
10000 cat > conftest.$ac_ext <<EOF
10001 #line 10002 "configure"
10002 #include "confdefs.h"
10003 /* Override any gcc2 internal prototype to avoid an error.  */
10004 /* We use char because int might match the return type of a gcc2
10005     builtin and then its argument prototype would still apply.  */
10006 char __res_query();
10007
10008 int main() {
10009 __res_query()
10010 ; return 0; }
10011 EOF
10012 if { (eval echo configure:10013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10013   rm -rf conftest*
10014   eval "ac_cv_lib_$ac_lib_var=yes"
10015 else
10016   echo "configure: failed program was:" >&5
10017   cat conftest.$ac_ext >&5
10018   rm -rf conftest*
10019   eval "ac_cv_lib_$ac_lib_var=no"
10020 fi
10021 rm -f conftest*
10022 LIBS="$ac_save_LIBS"
10023
10024 fi
10025 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10026   echo "$ac_t""yes" 1>&6
10027     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10028     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10029   cat >> confdefs.h <<EOF
10030 #define $ac_tr_lib 1
10031 EOF
10032
10033   LIBS="-lbind $LIBS"
10034
10035 else
10036   echo "$ac_t""no" 1>&6
10037 fi
10038
10039         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
10040 fi
10041
10042 if test $ac_cv_func_res_query = no ; then 
10043         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
10044 echo "configure:10045: checking for res_query in -lresolv" >&5
10045 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
10046 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10047   echo $ac_n "(cached) $ac_c" 1>&6
10048 else
10049   ac_save_LIBS="$LIBS"
10050 LIBS="-lresolv  $LIBS"
10051 cat > conftest.$ac_ext <<EOF
10052 #line 10053 "configure"
10053 #include "confdefs.h"
10054 /* Override any gcc2 internal prototype to avoid an error.  */
10055 /* We use char because int might match the return type of a gcc2
10056     builtin and then its argument prototype would still apply.  */
10057 char res_query();
10058
10059 int main() {
10060 res_query()
10061 ; return 0; }
10062 EOF
10063 if { (eval echo configure:10064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10064   rm -rf conftest*
10065   eval "ac_cv_lib_$ac_lib_var=yes"
10066 else
10067   echo "configure: failed program was:" >&5
10068   cat conftest.$ac_ext >&5
10069   rm -rf conftest*
10070   eval "ac_cv_lib_$ac_lib_var=no"
10071 fi
10072 rm -f conftest*
10073 LIBS="$ac_save_LIBS"
10074
10075 fi
10076 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10077   echo "$ac_t""yes" 1>&6
10078     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10079     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10080   cat >> confdefs.h <<EOF
10081 #define $ac_tr_lib 1
10082 EOF
10083
10084   LIBS="-lresolv $LIBS"
10085
10086 else
10087   echo "$ac_t""no" 1>&6
10088 fi
10089
10090         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
10091 fi
10092
10093 if test $ac_cv_func_res_query = no ; then 
10094         echo $ac_n "checking for __res_query in -lresolv""... $ac_c" 1>&6
10095 echo "configure:10096: checking for __res_query in -lresolv" >&5
10096 ac_lib_var=`echo resolv'_'__res_query | sed 'y%./+-:%__p__%'`
10097 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10098   echo $ac_n "(cached) $ac_c" 1>&6
10099 else
10100   ac_save_LIBS="$LIBS"
10101 LIBS="-lresolv  $LIBS"
10102 cat > conftest.$ac_ext <<EOF
10103 #line 10104 "configure"
10104 #include "confdefs.h"
10105 /* Override any gcc2 internal prototype to avoid an error.  */
10106 /* We use char because int might match the return type of a gcc2
10107     builtin and then its argument prototype would still apply.  */
10108 char __res_query();
10109
10110 int main() {
10111 __res_query()
10112 ; return 0; }
10113 EOF
10114 if { (eval echo configure:10115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10115   rm -rf conftest*
10116   eval "ac_cv_lib_$ac_lib_var=yes"
10117 else
10118   echo "configure: failed program was:" >&5
10119   cat conftest.$ac_ext >&5
10120   rm -rf conftest*
10121   eval "ac_cv_lib_$ac_lib_var=no"
10122 fi
10123 rm -f conftest*
10124 LIBS="$ac_save_LIBS"
10125
10126 fi
10127 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10128   echo "$ac_t""yes" 1>&6
10129     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10130     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10131   cat >> confdefs.h <<EOF
10132 #define $ac_tr_lib 1
10133 EOF
10134
10135   LIBS="-lresolv $LIBS"
10136
10137 else
10138   echo "$ac_t""no" 1>&6
10139 fi
10140
10141         ac_cv_func_res_query=$ac_cv_lib_resolv___res_query
10142 fi
10143
10144 if test "$ac_cv_func_res_query" = yes ; then
10145         cat >> confdefs.h <<\EOF
10146 #define HAVE_RES_QUERY 1
10147 EOF
10148
10149
10150         if test $ol_enable_dnssrv != no ; then
10151                 ol_link_dnssrv=yes
10152         fi
10153 fi
10154
10155 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
10156         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
10157 fi
10158
10159 for ac_func in getaddrinfo gai_strerror inet_ntop 
10160 do
10161 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10162 echo "configure:10163: checking for $ac_func" >&5
10163 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10164   echo $ac_n "(cached) $ac_c" 1>&6
10165 else
10166   cat > conftest.$ac_ext <<EOF
10167 #line 10168 "configure"
10168 #include "confdefs.h"
10169 /* System header to define __stub macros and hopefully few prototypes,
10170     which can conflict with char $ac_func(); below.  */
10171 #include <assert.h>
10172 /* Override any gcc2 internal prototype to avoid an error.  */
10173 /* We use char because int might match the return type of a gcc2
10174     builtin and then its argument prototype would still apply.  */
10175 char $ac_func();
10176 char (*f)();
10177
10178 int main() {
10179
10180 /* The GNU C library defines this for functions which it implements
10181     to always fail with ENOSYS.  Some functions are actually named
10182     something starting with __ and the normal name is an alias.  */
10183 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10184 choke me
10185 #else
10186 f = $ac_func;
10187 #endif
10188
10189 ; return 0; }
10190 EOF
10191 if { (eval echo configure:10192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10192   rm -rf conftest*
10193   eval "ac_cv_func_$ac_func=yes"
10194 else
10195   echo "configure: failed program was:" >&5
10196   cat conftest.$ac_ext >&5
10197   rm -rf conftest*
10198   eval "ac_cv_func_$ac_func=no"
10199 fi
10200 rm -f conftest*
10201 fi
10202
10203 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10204   echo "$ac_t""yes" 1>&6
10205     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10206   cat >> confdefs.h <<EOF
10207 #define $ac_tr_func 1
10208 EOF
10209  
10210 else
10211   echo "$ac_t""no" 1>&6
10212 fi
10213 done
10214
10215
10216 ol_link_ipv6=no
10217 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
10218         if test $ol_enable_ipv6 = yes ; then
10219                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
10220         fi
10221 elif test $ol_enable_ipv6 != no ; then
10222         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
10223 echo "configure:10224: checking INET6_ADDRSTRLEN" >&5
10224 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
10225   echo $ac_n "(cached) $ac_c" 1>&6
10226 else
10227   
10228                 cat > conftest.$ac_ext <<EOF
10229 #line 10230 "configure"
10230 #include "confdefs.h"
10231
10232 #                       include <netinet/in.h>
10233 #                       ifdef INET6_ADDRSTRLEN
10234                                 __has_inet6_addrstrlen__;
10235 #                       endif
10236                 
10237 EOF
10238 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10239   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
10240   rm -rf conftest*
10241   ol_cv_inet6_addrstrlen=yes
10242 else
10243   rm -rf conftest*
10244   ol_cv_inet6_addrstrlen=no
10245 fi
10246 rm -f conftest*
10247
10248 fi
10249
10250 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
10251
10252         if test $ol_cv_inet6_addrstrlen = yes ; then
10253                 ol_link_ipv6=yes
10254         elif test $ol_enable_ipv6 = yes ; then
10255                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
10256         fi
10257 fi
10258
10259 if test $ol_enable_local != no ; then
10260         for ac_hdr in sys/un.h 
10261 do
10262 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10263 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10264 echo "configure:10265: checking for $ac_hdr" >&5
10265 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10266   echo $ac_n "(cached) $ac_c" 1>&6
10267 else
10268   cat > conftest.$ac_ext <<EOF
10269 #line 10270 "configure"
10270 #include "confdefs.h"
10271 #include <$ac_hdr>
10272 EOF
10273 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10274 { (eval echo configure:10275: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10275 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10276 if test -z "$ac_err"; then
10277   rm -rf conftest*
10278   eval "ac_cv_header_$ac_safe=yes"
10279 else
10280   echo "$ac_err" >&5
10281   echo "configure: failed program was:" >&5
10282   cat conftest.$ac_ext >&5
10283   rm -rf conftest*
10284   eval "ac_cv_header_$ac_safe=no"
10285 fi
10286 rm -f conftest*
10287 fi
10288 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10289   echo "$ac_t""yes" 1>&6
10290     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10291   cat >> confdefs.h <<EOF
10292 #define $ac_tr_hdr 1
10293 EOF
10294  
10295 else
10296   echo "$ac_t""no" 1>&6
10297 fi
10298 done
10299
10300
10301         if test $ol_enable_local = auto ; then
10302                 ol_enable_local=$ac_cv_header_sys_un_h
10303         elif test $ac_cv_header_sys_un_h = no ; then
10304                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
10305         fi
10306 fi
10307
10308 ol_link_kbind=no
10309 ol_link_kpasswd=no
10310 ol_link_krb5=no
10311 ol_link_krb4=no
10312
10313 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
10314         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
10315         -o $ol_with_kerberos = k425 ; then
10316
10317         for ac_hdr in krb5.h
10318 do
10319 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10320 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10321 echo "configure:10322: checking for $ac_hdr" >&5
10322 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10323   echo $ac_n "(cached) $ac_c" 1>&6
10324 else
10325   cat > conftest.$ac_ext <<EOF
10326 #line 10327 "configure"
10327 #include "confdefs.h"
10328 #include <$ac_hdr>
10329 EOF
10330 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10331 { (eval echo configure:10332: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10332 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10333 if test -z "$ac_err"; then
10334   rm -rf conftest*
10335   eval "ac_cv_header_$ac_safe=yes"
10336 else
10337   echo "$ac_err" >&5
10338   echo "configure: failed program was:" >&5
10339   cat conftest.$ac_ext >&5
10340   rm -rf conftest*
10341   eval "ac_cv_header_$ac_safe=no"
10342 fi
10343 rm -f conftest*
10344 fi
10345 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10346   echo "$ac_t""yes" 1>&6
10347     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10348   cat >> confdefs.h <<EOF
10349 #define $ac_tr_hdr 1
10350 EOF
10351  
10352 else
10353   echo "$ac_t""no" 1>&6
10354 fi
10355 done
10356
10357
10358         if test $ac_cv_header_krb5_h = yes ; then
10359                                 for ac_hdr in heim_err.h
10360 do
10361 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10362 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10363 echo "configure:10364: checking for $ac_hdr" >&5
10364 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10365   echo $ac_n "(cached) $ac_c" 1>&6
10366 else
10367   cat > conftest.$ac_ext <<EOF
10368 #line 10369 "configure"
10369 #include "confdefs.h"
10370 #include <$ac_hdr>
10371 EOF
10372 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10373 { (eval echo configure:10374: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10374 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10375 if test -z "$ac_err"; then
10376   rm -rf conftest*
10377   eval "ac_cv_header_$ac_safe=yes"
10378 else
10379   echo "$ac_err" >&5
10380   echo "configure: failed program was:" >&5
10381   cat conftest.$ac_ext >&5
10382   rm -rf conftest*
10383   eval "ac_cv_header_$ac_safe=no"
10384 fi
10385 rm -f conftest*
10386 fi
10387 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10388   echo "$ac_t""yes" 1>&6
10389     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10390   cat >> confdefs.h <<EOF
10391 #define $ac_tr_hdr 1
10392 EOF
10393  
10394 else
10395   echo "$ac_t""no" 1>&6
10396 fi
10397 done
10398
10399                 if test $ac_cv_header_heim_err_h = yes ; then
10400                         krb5_impl=heimdal
10401                 else
10402                         krb5_impl=mit
10403                 fi
10404
10405                 if test $krb5_impl = mit; then
10406                         echo $ac_n "checking for main in -lk5crypto""... $ac_c" 1>&6
10407 echo "configure:10408: checking for main in -lk5crypto" >&5
10408 ac_lib_var=`echo k5crypto'_'main | sed 'y%./+-:%__p__%'`
10409 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10410   echo $ac_n "(cached) $ac_c" 1>&6
10411 else
10412   ac_save_LIBS="$LIBS"
10413 LIBS="-lk5crypto  $LIBS"
10414 cat > conftest.$ac_ext <<EOF
10415 #line 10416 "configure"
10416 #include "confdefs.h"
10417
10418 int main() {
10419 main()
10420 ; return 0; }
10421 EOF
10422 if { (eval echo configure:10423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10423   rm -rf conftest*
10424   eval "ac_cv_lib_$ac_lib_var=yes"
10425 else
10426   echo "configure: failed program was:" >&5
10427   cat conftest.$ac_ext >&5
10428   rm -rf conftest*
10429   eval "ac_cv_lib_$ac_lib_var=no"
10430 fi
10431 rm -f conftest*
10432 LIBS="$ac_save_LIBS"
10433
10434 fi
10435 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10436   echo "$ac_t""yes" 1>&6
10437   krb5crypto=k5crypto
10438 else
10439   echo "$ac_t""no" 1>&6
10440 krb5crypto=crypto
10441 fi
10442
10443
10444                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
10445 echo "configure:10446: checking for main in -lkrb5" >&5
10446 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
10447 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10448   echo $ac_n "(cached) $ac_c" 1>&6
10449 else
10450   ac_save_LIBS="$LIBS"
10451 LIBS="-lkrb5 -l$krb5crypto -lcom_err $LIBS"
10452 cat > conftest.$ac_ext <<EOF
10453 #line 10454 "configure"
10454 #include "confdefs.h"
10455
10456 int main() {
10457 main()
10458 ; return 0; }
10459 EOF
10460 if { (eval echo configure:10461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10461   rm -rf conftest*
10462   eval "ac_cv_lib_$ac_lib_var=yes"
10463 else
10464   echo "configure: failed program was:" >&5
10465   cat conftest.$ac_ext >&5
10466   rm -rf conftest*
10467   eval "ac_cv_lib_$ac_lib_var=no"
10468 fi
10469 rm -f conftest*
10470 LIBS="$ac_save_LIBS"
10471
10472 fi
10473 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10474   echo "$ac_t""yes" 1>&6
10475   have_krb5=yes
10476                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lcom_err"
10477 else
10478   echo "$ac_t""no" 1>&6
10479 have_krb5=no
10480 fi
10481
10482
10483                 elif test $krb5_impl = heimdal; then
10484                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
10485 echo "configure:10486: checking for main in -lkrb5" >&5
10486 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
10487 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10488   echo $ac_n "(cached) $ac_c" 1>&6
10489 else
10490   ac_save_LIBS="$LIBS"
10491 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
10492 cat > conftest.$ac_ext <<EOF
10493 #line 10494 "configure"
10494 #include "confdefs.h"
10495
10496 int main() {
10497 main()
10498 ; return 0; }
10499 EOF
10500 if { (eval echo configure:10501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10501   rm -rf conftest*
10502   eval "ac_cv_lib_$ac_lib_var=yes"
10503 else
10504   echo "configure: failed program was:" >&5
10505   cat conftest.$ac_ext >&5
10506   rm -rf conftest*
10507   eval "ac_cv_lib_$ac_lib_var=no"
10508 fi
10509 rm -f conftest*
10510 LIBS="$ac_save_LIBS"
10511
10512 fi
10513 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10514   echo "$ac_t""yes" 1>&6
10515   have_krb5=yes
10516                                 KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
10517 else
10518   echo "$ac_t""no" 1>&6
10519 have_krb5=no
10520 fi
10521
10522
10523                         cat >> confdefs.h <<\EOF
10524 #define HAVE_HEIMDAL_KERBEROS 1
10525 EOF
10526
10527
10528                 else
10529                         have_krb5=no
10530                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
10531                 fi
10532
10533                 if test $have_krb5 = yes ; then
10534                         ol_link_krb5=yes
10535
10536                         cat >> confdefs.h <<\EOF
10537 #define HAVE_KRB5 1
10538 EOF
10539
10540
10541                         if test $ol_enable_kpasswd != no ; then
10542                                 ol_link_kpasswd=yes;
10543                         fi
10544
10545                         if test $ol_with_kerberos = k5only ; then
10546                                 ol_with_kerberos=found
10547                         fi
10548
10549                 elif test $ol_with_kerberos != auto ; then
10550                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
10551                 fi
10552
10553         fi
10554 fi
10555
10556 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
10557         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
10558
10559         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
10560 do
10561 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10562 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10563 echo "configure:10564: checking for $ac_hdr" >&5
10564 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10565   echo $ac_n "(cached) $ac_c" 1>&6
10566 else
10567   cat > conftest.$ac_ext <<EOF
10568 #line 10569 "configure"
10569 #include "confdefs.h"
10570 #include <$ac_hdr>
10571 EOF
10572 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10573 { (eval echo configure:10574: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10574 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10575 if test -z "$ac_err"; then
10576   rm -rf conftest*
10577   eval "ac_cv_header_$ac_safe=yes"
10578 else
10579   echo "$ac_err" >&5
10580   echo "configure: failed program was:" >&5
10581   cat conftest.$ac_ext >&5
10582   rm -rf conftest*
10583   eval "ac_cv_header_$ac_safe=no"
10584 fi
10585 rm -f conftest*
10586 fi
10587 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10588   echo "$ac_t""yes" 1>&6
10589     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10590   cat >> confdefs.h <<EOF
10591 #define $ac_tr_hdr 1
10592 EOF
10593  
10594 else
10595   echo "$ac_t""no" 1>&6
10596 fi
10597 done
10598
10599
10600         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
10601                 if test $krb5_impl = mit; then
10602                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
10603 echo "configure:10604: checking for main in -lkrb4" >&5
10604 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
10605 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10606   echo $ac_n "(cached) $ac_c" 1>&6
10607 else
10608   ac_save_LIBS="$LIBS"
10609 LIBS="-lkrb4 -ldes425 -lkrb5 -l$krb5crypto -lcom_err $LIBS"
10610 cat > conftest.$ac_ext <<EOF
10611 #line 10612 "configure"
10612 #include "confdefs.h"
10613
10614 int main() {
10615 main()
10616 ; return 0; }
10617 EOF
10618 if { (eval echo configure:10619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10619   rm -rf conftest*
10620   eval "ac_cv_lib_$ac_lib_var=yes"
10621 else
10622   echo "configure: failed program was:" >&5
10623   cat conftest.$ac_ext >&5
10624   rm -rf conftest*
10625   eval "ac_cv_lib_$ac_lib_var=no"
10626 fi
10627 rm -f conftest*
10628 LIBS="$ac_save_LIBS"
10629
10630 fi
10631 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10632   echo "$ac_t""yes" 1>&6
10633   have_k425=yes
10634                                 KRB4_LIBS="-lkrb4 -ldes425"
10635 else
10636   echo "$ac_t""no" 1>&6
10637 have_k425=no
10638 fi
10639
10640
10641                 elif test $krb5_impl = heimdal; then
10642                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
10643 echo "configure:10644: checking for main in -lkrb4" >&5
10644 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
10645 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10646   echo $ac_n "(cached) $ac_c" 1>&6
10647 else
10648   ac_save_LIBS="$LIBS"
10649 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
10650 cat > conftest.$ac_ext <<EOF
10651 #line 10652 "configure"
10652 #include "confdefs.h"
10653
10654 int main() {
10655 main()
10656 ; return 0; }
10657 EOF
10658 if { (eval echo configure:10659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10659   rm -rf conftest*
10660   eval "ac_cv_lib_$ac_lib_var=yes"
10661 else
10662   echo "configure: failed program was:" >&5
10663   cat conftest.$ac_ext >&5
10664   rm -rf conftest*
10665   eval "ac_cv_lib_$ac_lib_var=no"
10666 fi
10667 rm -f conftest*
10668 LIBS="$ac_save_LIBS"
10669
10670 fi
10671 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10672   echo "$ac_t""yes" 1>&6
10673   have_k425=yes
10674                                 KRB4_LIBS="-lkrb4"
10675 else
10676   echo "$ac_t""no" 1>&6
10677 have_k425=no
10678 fi
10679
10680
10681                 else
10682                         have_425=no
10683                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
10684                 fi
10685
10686                 if test $have_k425 = yes ; then
10687                         ol_with_kerberos=found
10688                         ol_link_krb4=yes
10689
10690                         cat >> confdefs.h <<\EOF
10691 #define HAVE_KRB425 1
10692 EOF
10693
10694                         cat >> confdefs.h <<\EOF
10695 #define HAVE_KRB4 1
10696 EOF
10697
10698
10699                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
10700 echo "configure:10701: checking for des_debug in Kerberos libraries" >&5
10701 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
10702   echo $ac_n "(cached) $ac_c" 1>&6
10703 else
10704   
10705                                                                 save_LIBS="$LIBS"
10706                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
10707                                 cat > conftest.$ac_ext <<EOF
10708 #line 10709 "configure"
10709 #include "confdefs.h"
10710
10711 #include <kerberosIV/krb.h>
10712 #include <kerberosIV/des.h>
10713 extern int des_debug;
10714
10715 int main() {
10716
10717 des_debug = 1;
10718
10719 ; return 0; }
10720 EOF
10721 if { (eval echo configure:10722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10722   rm -rf conftest*
10723   ol_cv_var_des_debug=yes
10724 else
10725   echo "configure: failed program was:" >&5
10726   cat conftest.$ac_ext >&5
10727   rm -rf conftest*
10728   ol_cv_var_des_debug=no
10729 fi
10730 rm -f conftest*
10731                                                                 LIBS="$save_LIBS"
10732                         
10733 fi
10734
10735 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
10736
10737                         if test $ol_cv_var_des_debug = yes ; then
10738                                 cat >> confdefs.h <<\EOF
10739 #define HAVE_DES_DEBUG 1
10740 EOF
10741
10742                         fi
10743
10744                         LIBS="$save_LIBS"
10745                 fi
10746         fi
10747 fi
10748
10749 if test $ol_link_krb5 = yes ; then
10750         ol_with_kerberos=found
10751 fi
10752
10753 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
10754         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
10755
10756         for ac_hdr in krb.h des.h krb-archaeology.h 
10757 do
10758 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10759 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10760 echo "configure:10761: checking for $ac_hdr" >&5
10761 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10762   echo $ac_n "(cached) $ac_c" 1>&6
10763 else
10764   cat > conftest.$ac_ext <<EOF
10765 #line 10766 "configure"
10766 #include "confdefs.h"
10767 #include <$ac_hdr>
10768 EOF
10769 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10770 { (eval echo configure:10771: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10771 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10772 if test -z "$ac_err"; then
10773   rm -rf conftest*
10774   eval "ac_cv_header_$ac_safe=yes"
10775 else
10776   echo "$ac_err" >&5
10777   echo "configure: failed program was:" >&5
10778   cat conftest.$ac_ext >&5
10779   rm -rf conftest*
10780   eval "ac_cv_header_$ac_safe=no"
10781 fi
10782 rm -f conftest*
10783 fi
10784 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10785   echo "$ac_t""yes" 1>&6
10786     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10787   cat >> confdefs.h <<EOF
10788 #define $ac_tr_hdr 1
10789 EOF
10790  
10791 else
10792   echo "$ac_t""no" 1>&6
10793 fi
10794 done
10795
10796
10797         if test $ac_cv_header_krb_h = yes ; then
10798                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
10799 echo "configure:10800: checking for main in -lkrb" >&5
10800 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
10801 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10802   echo $ac_n "(cached) $ac_c" 1>&6
10803 else
10804   ac_save_LIBS="$LIBS"
10805 LIBS="-lkrb -ldes $LIBS"
10806 cat > conftest.$ac_ext <<EOF
10807 #line 10808 "configure"
10808 #include "confdefs.h"
10809
10810 int main() {
10811 main()
10812 ; return 0; }
10813 EOF
10814 if { (eval echo configure:10815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10815   rm -rf conftest*
10816   eval "ac_cv_lib_$ac_lib_var=yes"
10817 else
10818   echo "configure: failed program was:" >&5
10819   cat conftest.$ac_ext >&5
10820   rm -rf conftest*
10821   eval "ac_cv_lib_$ac_lib_var=no"
10822 fi
10823 rm -f conftest*
10824 LIBS="$ac_save_LIBS"
10825
10826 fi
10827 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10828   echo "$ac_t""yes" 1>&6
10829   have_k4=yes
10830 else
10831   echo "$ac_t""no" 1>&6
10832 have_k4=no
10833 fi
10834
10835
10836                 if test $have_k4 = yes ; then
10837                         ol_with_kerberos=found
10838                         ol_link_krb4=yes
10839
10840                         cat >> confdefs.h <<\EOF
10841 #define HAVE_KRB4 1
10842 EOF
10843
10844
10845                         KRB4_LIBS="-lkrb -ldes"
10846
10847                         if test $ac_cv_header_krb_archaeology_h = yes ; then
10848                                 cat >> confdefs.h <<\EOF
10849 #define HAVE_KTH_KERBEROS 1
10850 EOF
10851
10852                         fi
10853                 fi
10854         fi
10855 fi
10856
10857 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
10858         ol_link_kpasswd=yes
10859 fi
10860
10861 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
10862         ol_link_kbind=yes
10863
10864 elif test $ol_enable_kbind = yes ; then
10865         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
10866 fi
10867
10868 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
10869         cat >> confdefs.h <<\EOF
10870 #define HAVE_KERBEROS 1
10871 EOF
10872
10873
10874 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
10875         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
10876 fi
10877
10878 ol_link_tls=no
10879 if test $ol_with_tls != no ; then
10880         for ac_hdr in openssl/ssl.h ssl.h
10881 do
10882 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10883 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10884 echo "configure:10885: checking for $ac_hdr" >&5
10885 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10886   echo $ac_n "(cached) $ac_c" 1>&6
10887 else
10888   cat > conftest.$ac_ext <<EOF
10889 #line 10890 "configure"
10890 #include "confdefs.h"
10891 #include <$ac_hdr>
10892 EOF
10893 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10894 { (eval echo configure:10895: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10895 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10896 if test -z "$ac_err"; then
10897   rm -rf conftest*
10898   eval "ac_cv_header_$ac_safe=yes"
10899 else
10900   echo "$ac_err" >&5
10901   echo "configure: failed program was:" >&5
10902   cat conftest.$ac_ext >&5
10903   rm -rf conftest*
10904   eval "ac_cv_header_$ac_safe=no"
10905 fi
10906 rm -f conftest*
10907 fi
10908 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10909   echo "$ac_t""yes" 1>&6
10910     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10911   cat >> confdefs.h <<EOF
10912 #define $ac_tr_hdr 1
10913 EOF
10914  
10915 else
10916   echo "$ac_t""no" 1>&6
10917 fi
10918 done
10919
10920         
10921         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
10922                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
10923 echo "configure:10924: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
10924 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
10925 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10926   echo $ac_n "(cached) $ac_c" 1>&6
10927 else
10928   ac_save_LIBS="$LIBS"
10929 LIBS="-lssl -lcrypto $LIBS"
10930 cat > conftest.$ac_ext <<EOF
10931 #line 10932 "configure"
10932 #include "confdefs.h"
10933 /* Override any gcc2 internal prototype to avoid an error.  */
10934 /* We use char because int might match the return type of a gcc2
10935     builtin and then its argument prototype would still apply.  */
10936 char SSLeay_add_ssl_algorithms();
10937
10938 int main() {
10939 SSLeay_add_ssl_algorithms()
10940 ; return 0; }
10941 EOF
10942 if { (eval echo configure:10943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10943   rm -rf conftest*
10944   eval "ac_cv_lib_$ac_lib_var=yes"
10945 else
10946   echo "configure: failed program was:" >&5
10947   cat conftest.$ac_ext >&5
10948   rm -rf conftest*
10949   eval "ac_cv_lib_$ac_lib_var=no"
10950 fi
10951 rm -f conftest*
10952 LIBS="$ac_save_LIBS"
10953
10954 fi
10955 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10956   echo "$ac_t""yes" 1>&6
10957   have_ssleay=yes
10958                         need_rsaref=no
10959 else
10960   echo "$ac_t""no" 1>&6
10961 have_ssleay=no
10962 fi
10963
10964                         
10965                 if test $have_ssleay = no ; then
10966                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
10967 echo "configure:10968: checking for SSL_library_init in -lssl" >&5
10968 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
10969 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10970   echo $ac_n "(cached) $ac_c" 1>&6
10971 else
10972   ac_save_LIBS="$LIBS"
10973 LIBS="-lssl -lcrypto $LIBS"
10974 cat > conftest.$ac_ext <<EOF
10975 #line 10976 "configure"
10976 #include "confdefs.h"
10977 /* Override any gcc2 internal prototype to avoid an error.  */
10978 /* We use char because int might match the return type of a gcc2
10979     builtin and then its argument prototype would still apply.  */
10980 char SSL_library_init();
10981
10982 int main() {
10983 SSL_library_init()
10984 ; return 0; }
10985 EOF
10986 if { (eval echo configure:10987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10987   rm -rf conftest*
10988   eval "ac_cv_lib_$ac_lib_var=yes"
10989 else
10990   echo "configure: failed program was:" >&5
10991   cat conftest.$ac_ext >&5
10992   rm -rf conftest*
10993   eval "ac_cv_lib_$ac_lib_var=no"
10994 fi
10995 rm -f conftest*
10996 LIBS="$ac_save_LIBS"
10997
10998 fi
10999 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11000   echo "$ac_t""yes" 1>&6
11001   have_ssleay=yes
11002                                 need_rsaref=no
11003 else
11004   echo "$ac_t""no" 1>&6
11005 have_ssleay=no
11006 fi
11007
11008                 fi
11009
11010                 if test $have_ssleay = no ; then
11011                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
11012 echo "configure:11013: checking for ssl3_accept in -lssl" >&5
11013 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
11014 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11015   echo $ac_n "(cached) $ac_c" 1>&6
11016 else
11017   ac_save_LIBS="$LIBS"
11018 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
11019 cat > conftest.$ac_ext <<EOF
11020 #line 11021 "configure"
11021 #include "confdefs.h"
11022 /* Override any gcc2 internal prototype to avoid an error.  */
11023 /* We use char because int might match the return type of a gcc2
11024     builtin and then its argument prototype would still apply.  */
11025 char ssl3_accept();
11026
11027 int main() {
11028 ssl3_accept()
11029 ; return 0; }
11030 EOF
11031 if { (eval echo configure:11032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11032   rm -rf conftest*
11033   eval "ac_cv_lib_$ac_lib_var=yes"
11034 else
11035   echo "configure: failed program was:" >&5
11036   cat conftest.$ac_ext >&5
11037   rm -rf conftest*
11038   eval "ac_cv_lib_$ac_lib_var=no"
11039 fi
11040 rm -f conftest*
11041 LIBS="$ac_save_LIBS"
11042
11043 fi
11044 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11045   echo "$ac_t""yes" 1>&6
11046   have_ssleay=yes
11047                                 need_rsaref=yes
11048 else
11049   echo "$ac_t""no" 1>&6
11050 have_ssleay=no
11051 fi
11052
11053                 fi
11054
11055                 if test $have_ssleay = yes ; then
11056                         ol_with_tls=found
11057                         ol_link_tls=yes
11058
11059                         cat >> confdefs.h <<\EOF
11060 #define HAVE_SSLEAY 1
11061 EOF
11062
11063
11064                         if test $need_rsaref = yes; then
11065                                 cat >> confdefs.h <<\EOF
11066 #define HAVE_RSAREF 1
11067 EOF
11068
11069
11070                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
11071                         else
11072                                 TLS_LIBS="-lssl -lcrypto"
11073                         fi
11074                 fi
11075         fi
11076
11077 else
11078         echo "configure: warning: TLS privacy protection not supported!" 1>&2
11079 fi
11080
11081 if test $ol_link_tls = yes ; then
11082         cat >> confdefs.h <<\EOF
11083 #define HAVE_TLS 1
11084 EOF
11085
11086
11087 elif test $ol_with_tls = auto ; then
11088         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
11089         echo "configure: warning: TLS privacy protection not supported!" 1>&2
11090
11091 elif test $ol_with_tls != no ; then
11092         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
11093 fi
11094
11095 if test $ol_enable_lmpasswd != no; then
11096         if test $ol_link_tls != yes ; then
11097                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
11098         fi
11099
11100         cat >> confdefs.h <<\EOF
11101 #define SLAPD_LMHASH 1
11102 EOF
11103
11104 fi
11105
11106 for ac_func in \
11107         ctime_r                 \
11108         gethostbyname_r gethostbyaddr_r \
11109
11110 do
11111 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11112 echo "configure:11113: checking for $ac_func" >&5
11113 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11114   echo $ac_n "(cached) $ac_c" 1>&6
11115 else
11116   cat > conftest.$ac_ext <<EOF
11117 #line 11118 "configure"
11118 #include "confdefs.h"
11119 /* System header to define __stub macros and hopefully few prototypes,
11120     which can conflict with char $ac_func(); below.  */
11121 #include <assert.h>
11122 /* Override any gcc2 internal prototype to avoid an error.  */
11123 /* We use char because int might match the return type of a gcc2
11124     builtin and then its argument prototype would still apply.  */
11125 char $ac_func();
11126 char (*f)();
11127
11128 int main() {
11129
11130 /* The GNU C library defines this for functions which it implements
11131     to always fail with ENOSYS.  Some functions are actually named
11132     something starting with __ and the normal name is an alias.  */
11133 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11134 choke me
11135 #else
11136 f = $ac_func;
11137 #endif
11138
11139 ; return 0; }
11140 EOF
11141 if { (eval echo configure:11142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11142   rm -rf conftest*
11143   eval "ac_cv_func_$ac_func=yes"
11144 else
11145   echo "configure: failed program was:" >&5
11146   cat conftest.$ac_ext >&5
11147   rm -rf conftest*
11148   eval "ac_cv_func_$ac_func=no"
11149 fi
11150 rm -f conftest*
11151 fi
11152
11153 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11154   echo "$ac_t""yes" 1>&6
11155     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11156   cat >> confdefs.h <<EOF
11157 #define $ac_tr_func 1
11158 EOF
11159  
11160 else
11161   echo "$ac_t""no" 1>&6
11162 fi
11163 done
11164
11165
11166 if test "$ac_cv_func_ctime_r" = no ; then
11167         ol_cv_func_ctime_r_nargs=0
11168 else
11169         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
11170 echo "configure:11171: checking number of arguments of ctime_r" >&5
11171 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
11172   echo $ac_n "(cached) $ac_c" 1>&6
11173 else
11174   cat > conftest.$ac_ext <<EOF
11175 #line 11176 "configure"
11176 #include "confdefs.h"
11177 #include <time.h>
11178 int main() {
11179 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
11180 ; return 0; }
11181 EOF
11182 if { (eval echo configure:11183: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11183   rm -rf conftest*
11184   ol_cv_func_ctime_r_nargs3=yes
11185 else
11186   echo "configure: failed program was:" >&5
11187   cat conftest.$ac_ext >&5
11188   rm -rf conftest*
11189   ol_cv_func_ctime_r_nargs3=no
11190 fi
11191 rm -f conftest*
11192
11193         cat > conftest.$ac_ext <<EOF
11194 #line 11195 "configure"
11195 #include "confdefs.h"
11196 #include <time.h>
11197 int main() {
11198 time_t ti; char *buffer; ctime_r(&ti,buffer);
11199 ; return 0; }
11200 EOF
11201 if { (eval echo configure:11202: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11202   rm -rf conftest*
11203   ol_cv_func_ctime_r_nargs2=yes
11204 else
11205   echo "configure: failed program was:" >&5
11206   cat conftest.$ac_ext >&5
11207   rm -rf conftest*
11208   ol_cv_func_ctime_r_nargs2=no
11209 fi
11210 rm -f conftest*
11211
11212         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
11213                 $ol_cv_func_ctime_r_nargs2 = no ; then
11214
11215                 ol_cv_func_ctime_r_nargs=3
11216
11217         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
11218                 $ol_cv_func_ctime_r_nargs2 = yes ; then
11219
11220                 ol_cv_func_ctime_r_nargs=2
11221
11222         else
11223                 ol_cv_func_ctime_r_nargs=0
11224         fi
11225   
11226 fi
11227
11228 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
11229
11230   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
11231         cat >> confdefs.h <<EOF
11232 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
11233 EOF
11234
11235   fi
11236
11237 fi
11238
11239 if test "$ac_cv_func_gethostbyname_r" = yes ; then
11240         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
11241 echo "configure:11242: checking number of arguments of gethostbyname_r" >&5
11242 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
11243   echo $ac_n "(cached) $ac_c" 1>&6
11244 else
11245   cat > conftest.$ac_ext <<EOF
11246 #line 11247 "configure"
11247 #include "confdefs.h"
11248 #include <sys/types.h>
11249 #include <sys/socket.h>
11250 #include <netinet/in.h>
11251 #include <netdb.h>
11252 #define BUFSIZE (sizeof(struct hostent)+10)
11253 int main() {
11254 struct hostent hent; char buffer[BUFSIZE];
11255                 int bufsize=BUFSIZE;int h_errno;
11256                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
11257                         buffer, bufsize, &h_errno);
11258 ; return 0; }
11259 EOF
11260 if { (eval echo configure:11261: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11261   rm -rf conftest*
11262   ol_cv_func_gethostbyname_r_nargs5=yes
11263 else
11264   echo "configure: failed program was:" >&5
11265   cat conftest.$ac_ext >&5
11266   rm -rf conftest*
11267   ol_cv_func_gethostbyname_r_nargs5=no
11268 fi
11269 rm -f conftest*
11270
11271         cat > conftest.$ac_ext <<EOF
11272 #line 11273 "configure"
11273 #include "confdefs.h"
11274 #include <sys/types.h>
11275 #include <sys/socket.h>
11276 #include <netinet/in.h>
11277 #include <netdb.h>
11278 #define BUFSIZE (sizeof(struct hostent)+10)
11279 int main() {
11280 struct hostent hent;struct hostent *rhent;
11281                 char buffer[BUFSIZE];
11282                 int bufsize=BUFSIZE;int h_errno;
11283                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
11284                         &rhent, &h_errno);
11285 ; return 0; }
11286 EOF
11287 if { (eval echo configure:11288: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11288   rm -rf conftest*
11289   ol_cv_func_gethostbyname_r_nargs6=yes
11290 else
11291   echo "configure: failed program was:" >&5
11292   cat conftest.$ac_ext >&5
11293   rm -rf conftest*
11294   ol_cv_func_gethostbyname_r_nargs6=no
11295 fi
11296 rm -f conftest*
11297
11298         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
11299                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
11300
11301                 ol_cv_func_gethostbyname_r_nargs=5
11302
11303         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
11304                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
11305
11306                 ol_cv_func_gethostbyname_r_nargs=6
11307
11308         else
11309                 ol_cv_func_gethostbyname_r_nargs=0
11310         fi
11311   
11312 fi
11313
11314 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
11315   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
11316         cat >> confdefs.h <<EOF
11317 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
11318 EOF
11319
11320   fi
11321
11322 else
11323         ol_cv_func_gethostbyname_r_nargs=0
11324 fi
11325  
11326 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
11327         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
11328 echo "configure:11329: checking number of arguments of gethostbyaddr_r" >&5
11329 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
11330   echo $ac_n "(cached) $ac_c" 1>&6
11331 else
11332   cat > conftest.$ac_ext <<EOF
11333 #line 11334 "configure"
11334 #include "confdefs.h"
11335 #include <sys/types.h>
11336 #include <sys/socket.h>
11337 #include <netinet/in.h>
11338 #include <netdb.h>
11339 #define BUFSIZE (sizeof(struct hostent)+10)
11340 int main() {
11341 struct hostent hent; char buffer[BUFSIZE]; 
11342             struct in_addr add;
11343             size_t alen=sizeof(struct in_addr);
11344             int bufsize=BUFSIZE;int h_errno;
11345                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
11346                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
11347 ; return 0; }
11348 EOF
11349 if { (eval echo configure:11350: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11350   rm -rf conftest*
11351   ol_cv_func_gethostbyaddr_r_nargs7=yes
11352 else
11353   echo "configure: failed program was:" >&5
11354   cat conftest.$ac_ext >&5
11355   rm -rf conftest*
11356   ol_cv_func_gethostbyaddr_r_nargs7=no
11357 fi
11358 rm -f conftest*
11359
11360         cat > conftest.$ac_ext <<EOF
11361 #line 11362 "configure"
11362 #include "confdefs.h"
11363 #include <sys/types.h>
11364 #include <sys/socket.h>
11365 #include <netinet/in.h>
11366 #include <netdb.h>
11367 #define BUFSIZE (sizeof(struct hostent)+10)
11368 int main() {
11369 struct hostent hent;
11370                 struct hostent *rhent; char buffer[BUFSIZE]; 
11371                 struct in_addr add;
11372                 size_t alen=sizeof(struct in_addr);
11373                 int bufsize=BUFSIZE;int h_errno;
11374                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
11375                         alen, AF_INET, &hent, buffer, bufsize, 
11376                         &rhent, &h_errno);
11377 ; return 0; }
11378 EOF
11379 if { (eval echo configure:11380: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11380   rm -rf conftest*
11381   ol_cv_func_gethostbyaddr_r_nargs8=yes
11382 else
11383   echo "configure: failed program was:" >&5
11384   cat conftest.$ac_ext >&5
11385   rm -rf conftest*
11386   ol_cv_func_gethostbyaddr_r_nargs8=no
11387 fi
11388 rm -f conftest*
11389
11390         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
11391                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
11392
11393                 ol_cv_func_gethostbyaddr_r_nargs=7
11394
11395         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
11396                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
11397
11398                 ol_cv_func_gethostbyaddr_r_nargs=8
11399
11400         else
11401                 ol_cv_func_gethostbyaddr_r_nargs=0
11402         fi
11403   
11404 fi
11405
11406 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
11407   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
11408     cat >> confdefs.h <<EOF
11409 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
11410 EOF
11411
11412   fi
11413
11414 else
11415         ol_cv_func_gethostbyaddr_r_nargs=0
11416 fi
11417
11418 if test "$ac_cv_func_ctime_r" = yes \
11419         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
11420         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
11421         -a "$ac_cv_func_gethostbyname_r" = yes \
11422         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
11423         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
11424         -a "$ac_cv_func_gethostbyaddr_r" = yes \
11425         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
11426         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
11427         ; then
11428  
11429         cat >> confdefs.h <<\EOF
11430 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
11431 EOF
11432
11433 fi
11434
11435 ol_link_threads=no
11436
11437 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11438         -o $ol_with_threads = nt ; then
11439
11440         
11441         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
11442 echo "configure:11443: checking for _beginthread" >&5
11443 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
11444   echo $ac_n "(cached) $ac_c" 1>&6
11445 else
11446   cat > conftest.$ac_ext <<EOF
11447 #line 11448 "configure"
11448 #include "confdefs.h"
11449 /* System header to define __stub macros and hopefully few prototypes,
11450     which can conflict with char _beginthread(); below.  */
11451 #include <assert.h>
11452 /* Override any gcc2 internal prototype to avoid an error.  */
11453 /* We use char because int might match the return type of a gcc2
11454     builtin and then its argument prototype would still apply.  */
11455 char _beginthread();
11456 char (*f)();
11457
11458 int main() {
11459
11460 /* The GNU C library defines this for functions which it implements
11461     to always fail with ENOSYS.  Some functions are actually named
11462     something starting with __ and the normal name is an alias.  */
11463 #if defined (__stub__beginthread) || defined (__stub____beginthread)
11464 choke me
11465 #else
11466 f = _beginthread;
11467 #endif
11468
11469 ; return 0; }
11470 EOF
11471 if { (eval echo configure:11472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11472   rm -rf conftest*
11473   eval "ac_cv_func__beginthread=yes"
11474 else
11475   echo "configure: failed program was:" >&5
11476   cat conftest.$ac_ext >&5
11477   rm -rf conftest*
11478   eval "ac_cv_func__beginthread=no"
11479 fi
11480 rm -f conftest*
11481 fi
11482
11483 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
11484   echo "$ac_t""yes" 1>&6
11485   :
11486 else
11487   echo "$ac_t""no" 1>&6
11488 fi
11489
11490
11491         if test $ac_cv_func__beginthread = yes ; then
11492                 cat >> confdefs.h <<\EOF
11493 #define HAVE_NT_THREADS 1
11494 EOF
11495
11496                 ol_cv_nt_threads=yes
11497         fi
11498
11499
11500         if test "$ol_cv_nt_threads" = yes ; then
11501                 ol_link_threads=nt
11502                 ol_with_threads=found
11503                 ol_with_yielding_select=yes
11504
11505                 cat >> confdefs.h <<\EOF
11506 #define HAVE_NT_SERVICE_MANAGER 1
11507 EOF
11508
11509                 cat >> confdefs.h <<\EOF
11510 #define HAVE_NT_EVENT_LOG 1
11511 EOF
11512
11513         fi
11514
11515         if test $ol_with_threads = nt ; then
11516                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
11517         fi
11518 fi
11519
11520 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11521         -o $ol_with_threads = posix ; then
11522
11523         for ac_hdr in pthread.h
11524 do
11525 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11526 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11527 echo "configure:11528: checking for $ac_hdr" >&5
11528 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11529   echo $ac_n "(cached) $ac_c" 1>&6
11530 else
11531   cat > conftest.$ac_ext <<EOF
11532 #line 11533 "configure"
11533 #include "confdefs.h"
11534 #include <$ac_hdr>
11535 EOF
11536 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11537 { (eval echo configure:11538: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11538 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11539 if test -z "$ac_err"; then
11540   rm -rf conftest*
11541   eval "ac_cv_header_$ac_safe=yes"
11542 else
11543   echo "$ac_err" >&5
11544   echo "configure: failed program was:" >&5
11545   cat conftest.$ac_ext >&5
11546   rm -rf conftest*
11547   eval "ac_cv_header_$ac_safe=no"
11548 fi
11549 rm -f conftest*
11550 fi
11551 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11552   echo "$ac_t""yes" 1>&6
11553     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11554   cat >> confdefs.h <<EOF
11555 #define $ac_tr_hdr 1
11556 EOF
11557  
11558 else
11559   echo "$ac_t""no" 1>&6
11560 fi
11561 done
11562
11563
11564         if test $ac_cv_header_pthread_h = yes ; then
11565                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
11566 echo "configure:11567: checking POSIX thread version" >&5
11567 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
11568   echo $ac_n "(cached) $ac_c" 1>&6
11569 else
11570   
11571         cat > conftest.$ac_ext <<EOF
11572 #line 11573 "configure"
11573 #include "confdefs.h"
11574
11575 #               include <pthread.h>
11576                 /* this check could be improved */
11577 #               ifdef PTHREAD_ONCE_INIT
11578                         pthread_version_final;
11579 #               endif
11580         
11581 EOF
11582 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11583   egrep "pthread_version_final" >/dev/null 2>&1; then
11584   rm -rf conftest*
11585   ol_pthread_final=yes
11586 else
11587   rm -rf conftest*
11588   ol_pthread_final=no
11589 fi
11590 rm -f conftest*
11591
11592
11593         cat > conftest.$ac_ext <<EOF
11594 #line 11595 "configure"
11595 #include "confdefs.h"
11596
11597 #               include <pthread.h>
11598                 /* this check could be improved */
11599 #               ifdef pthread_once_init
11600                         pthread_version_draft4;
11601 #               endif
11602         
11603 EOF
11604 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11605   egrep "pthread_version_draft4" >/dev/null 2>&1; then
11606   rm -rf conftest*
11607   ol_pthread_draft4=yes
11608 else
11609   rm -rf conftest*
11610   ol_pthread_draft4=no
11611 fi
11612 rm -f conftest*
11613
11614
11615         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
11616                 ol_cv_pthread_version=final
11617         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
11618                 ol_cv_pthread_version=draft4
11619         else
11620                 ol_cv_pthread_version=unknown
11621         fi
11622
11623 fi
11624
11625 echo "$ac_t""$ol_cv_pthread_version" 1>&6
11626
11627
11628                 if test $ol_cv_pthread_version = final ; then
11629                         cat >> confdefs.h <<\EOF
11630 #define HAVE_PTHREADS_FINAL 1
11631 EOF
11632
11633                 elif test $ol_cv_pthread_version = draft4 ; then
11634                         cat >> confdefs.h <<\EOF
11635 #define HAVE_PTHREADS_D4 1
11636 EOF
11637
11638                 else
11639                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
11640                 fi
11641
11642                 # consider threads found
11643                 ol_with_threads=found
11644
11645                 
11646         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
11647 echo "configure:11648: checking for LinuxThreads pthread.h" >&5
11648 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
11649   echo $ac_n "(cached) $ac_c" 1>&6
11650 else
11651   cat > conftest.$ac_ext <<EOF
11652 #line 11653 "configure"
11653 #include "confdefs.h"
11654 #include <pthread.h>
11655 EOF
11656 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11657   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
11658   rm -rf conftest*
11659   ol_cv_header_linux_threads=yes
11660 else
11661   rm -rf conftest*
11662   ol_cv_header_linux_threads=no
11663 fi
11664 rm -f conftest*
11665
11666                 
11667 fi
11668
11669 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
11670         if test $ol_cv_header_linux_threads = yes; then
11671                 cat >> confdefs.h <<\EOF
11672 #define HAVE_LINUX_THREADS 1
11673 EOF
11674
11675         fi
11676
11677                 
11678         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
11679 echo "configure:11680: checking for GNU Pth pthread.h" >&5
11680 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
11681   echo $ac_n "(cached) $ac_c" 1>&6
11682 else
11683   cat > conftest.$ac_ext <<EOF
11684 #line 11685 "configure"
11685 #include "confdefs.h"
11686 #include <pthread.h>
11687 #ifdef _POSIX_THREAD_IS_GNU_PTH
11688         __gnu_pth__;
11689 #endif
11690
11691 EOF
11692 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11693   egrep "__gnu_pth__" >/dev/null 2>&1; then
11694   rm -rf conftest*
11695   ol_cv_header_gnu_pth_pthread_h=yes
11696 else
11697   rm -rf conftest*
11698   ol_cv_header_gnu_pth_pthread_h=no
11699 fi
11700 rm -f conftest*
11701
11702                 
11703 fi
11704
11705 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
11706
11707
11708                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
11709                         for ac_hdr in sched.h
11710 do
11711 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11712 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11713 echo "configure:11714: checking for $ac_hdr" >&5
11714 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11715   echo $ac_n "(cached) $ac_c" 1>&6
11716 else
11717   cat > conftest.$ac_ext <<EOF
11718 #line 11719 "configure"
11719 #include "confdefs.h"
11720 #include <$ac_hdr>
11721 EOF
11722 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11723 { (eval echo configure:11724: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11724 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11725 if test -z "$ac_err"; then
11726   rm -rf conftest*
11727   eval "ac_cv_header_$ac_safe=yes"
11728 else
11729   echo "$ac_err" >&5
11730   echo "configure: failed program was:" >&5
11731   cat conftest.$ac_ext >&5
11732   rm -rf conftest*
11733   eval "ac_cv_header_$ac_safe=no"
11734 fi
11735 rm -f conftest*
11736 fi
11737 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11738   echo "$ac_t""yes" 1>&6
11739     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11740   cat >> confdefs.h <<EOF
11741 #define $ac_tr_hdr 1
11742 EOF
11743  
11744 else
11745   echo "$ac_t""no" 1>&6
11746 fi
11747 done
11748
11749                 fi
11750
11751                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
11752                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
11753 echo "configure:11754: checking for pthread_create in default libraries" >&5
11754 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
11755   echo $ac_n "(cached) $ac_c" 1>&6
11756 else
11757   
11758                 if test "$cross_compiling" = yes; then
11759   cat > conftest.$ac_ext <<EOF
11760 #line 11761 "configure"
11761 #include "confdefs.h"
11762 /* pthread test headers */
11763 #include <pthread.h>
11764 #ifndef NULL
11765 #define NULL (void*)0
11766 #endif
11767
11768 static void *task(p)
11769         void *p;
11770 {
11771         return (void *) (p == NULL);
11772 }
11773
11774 int main() {
11775
11776         /* pthread test function */
11777         pthread_t t;
11778         int status;
11779         int detach = 1;
11780
11781 #ifdef HAVE_PTHREADS_FINAL
11782         /* Final pthreads */
11783         pthread_attr_t attr;
11784
11785         status = pthread_attr_init(&attr);
11786         if( status ) return status;
11787
11788 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11789         if( !detach ) {
11790 #if defined( PTHREAD_CREATE_JOINABLE )
11791                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11792 #else
11793                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11794 #endif
11795
11796 #ifdef PTHREAD_CREATE_DETACHED
11797         } else {
11798                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11799 #endif
11800         }
11801         if( status ) return status;
11802 #endif
11803
11804         status = pthread_create( &t, &attr, task, NULL );
11805         if( status ) return status;
11806
11807 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11808         if( detach ) {
11809                 /* give thread a chance to complete */
11810                 /* it should remain joinable and hence detachable */
11811                 sleep( 1 );
11812
11813                 status = pthread_detach( t );
11814                 if( status ) return status;
11815         }
11816 #endif
11817
11818 #else
11819         /* Draft 4 pthreads */
11820         status = pthread_create( &t, pthread_attr_default, task, NULL );
11821         if( status ) return status;
11822
11823         if( detach ) {
11824                 /* give thread a chance to complete */
11825                 /* it should remain joinable and hence detachable */
11826                 sleep( 1 );
11827
11828                 status = pthread_detach( &t );
11829                 if( status ) return status;
11830         }
11831 #endif
11832
11833 #ifdef HAVE_LINUX_THREADS
11834         pthread_kill_other_threads_np();
11835 #endif
11836
11837         return 0;
11838
11839 ; return 0; }
11840 EOF
11841 if { (eval echo configure:11842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11842   rm -rf conftest*
11843   ol_cv_pthread_create=yes
11844 else
11845   echo "configure: failed program was:" >&5
11846   cat conftest.$ac_ext >&5
11847   rm -rf conftest*
11848   ol_cv_pthread_create=no
11849 fi
11850 rm -f conftest*
11851 else
11852   cat > conftest.$ac_ext <<EOF
11853 #line 11854 "configure"
11854 #include "confdefs.h"
11855 /* pthread test headers */
11856 #include <pthread.h>
11857 #ifndef NULL
11858 #define NULL (void*)0
11859 #endif
11860
11861 static void *task(p)
11862         void *p;
11863 {
11864         return (void *) (p == NULL);
11865 }
11866
11867
11868 int main(argc, argv)
11869         int argc;
11870         char **argv;
11871 {
11872
11873         /* pthread test function */
11874         pthread_t t;
11875         int status;
11876         int detach = 1;
11877
11878 #ifdef HAVE_PTHREADS_FINAL
11879         /* Final pthreads */
11880         pthread_attr_t attr;
11881
11882         status = pthread_attr_init(&attr);
11883         if( status ) return status;
11884
11885 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11886         if( !detach ) {
11887 #if defined( PTHREAD_CREATE_JOINABLE )
11888                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11889 #else
11890                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11891 #endif
11892
11893 #ifdef PTHREAD_CREATE_DETACHED
11894         } else {
11895                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11896 #endif
11897         }
11898         if( status ) return status;
11899 #endif
11900
11901         status = pthread_create( &t, &attr, task, NULL );
11902         if( status ) return status;
11903
11904 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11905         if( detach ) {
11906                 /* give thread a chance to complete */
11907                 /* it should remain joinable and hence detachable */
11908                 sleep( 1 );
11909
11910                 status = pthread_detach( t );
11911                 if( status ) return status;
11912         }
11913 #endif
11914
11915 #else
11916         /* Draft 4 pthreads */
11917         status = pthread_create( &t, pthread_attr_default, task, NULL );
11918         if( status ) return status;
11919
11920         if( detach ) {
11921                 /* give thread a chance to complete */
11922                 /* it should remain joinable and hence detachable */
11923                 sleep( 1 );
11924
11925                 status = pthread_detach( &t );
11926                 if( status ) return status;
11927         }
11928 #endif
11929
11930 #ifdef HAVE_LINUX_THREADS
11931         pthread_kill_other_threads_np();
11932 #endif
11933
11934         return 0;
11935
11936 }
11937
11938 EOF
11939 if { (eval echo configure:11940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11940 then
11941   ol_cv_pthread_create=yes
11942 else
11943   echo "configure: failed program was:" >&5
11944   cat conftest.$ac_ext >&5
11945   rm -fr conftest*
11946   ol_cv_pthread_create=no
11947 fi
11948 rm -fr conftest*
11949 fi
11950
11951 fi
11952
11953 echo "$ac_t""$ol_cv_pthread_create" 1>&6
11954
11955                 if test $ol_cv_pthread_create != no ; then
11956                         ol_link_threads=posix
11957                         ol_link_pthreads=""
11958                 fi
11959                 
11960                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
11961 if test "$ol_link_threads" = no ; then
11962         # try -kthread
11963         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
11964 echo "configure:11965: checking for pthread link with -kthread" >&5
11965 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
11966   echo $ac_n "(cached) $ac_c" 1>&6
11967 else
11968   
11969                 # save the flags
11970                 ol_LIBS="$LIBS"
11971                 LIBS="-kthread $LIBS"
11972
11973                 if test "$cross_compiling" = yes; then
11974   cat > conftest.$ac_ext <<EOF
11975 #line 11976 "configure"
11976 #include "confdefs.h"
11977 /* pthread test headers */
11978 #include <pthread.h>
11979 #ifndef NULL
11980 #define NULL (void*)0
11981 #endif
11982
11983 static void *task(p)
11984         void *p;
11985 {
11986         return (void *) (p == NULL);
11987 }
11988
11989 int main() {
11990
11991         /* pthread test function */
11992         pthread_t t;
11993         int status;
11994         int detach = 1;
11995
11996 #ifdef HAVE_PTHREADS_FINAL
11997         /* Final pthreads */
11998         pthread_attr_t attr;
11999
12000         status = pthread_attr_init(&attr);
12001         if( status ) return status;
12002
12003 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
12004         if( !detach ) {
12005 #if defined( PTHREAD_CREATE_JOINABLE )
12006                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
12007 #else
12008                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
12009 #endif
12010
12011 #ifdef PTHREAD_CREATE_DETACHED
12012         } else {
12013                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
12014 #endif
12015         }
12016         if( status ) return status;
12017 #endif
12018
12019         status = pthread_create( &t, &attr, task, NULL );
12020         if( status ) return status;
12021
12022 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
12023         if( detach ) {
12024                 /* give thread a chance to complete */
12025                 /* it should remain joinable and hence detachable */
12026                 sleep( 1 );
12027
12028                 status = pthread_detach( t );
12029                 if( status ) return status;
12030         }
12031 #endif
12032
12033 #else
12034         /* Draft 4 pthreads */
12035         status = pthread_create( &t, pthread_attr_default, task, NULL );
12036         if( status ) return status;
12037
12038         if( detach ) {
12039                 /* give thread a chance to complete */
12040                 /* it should remain joinable and hence detachable */
12041                 sleep( 1 );
12042
12043                 status = pthread_detach( &t );
12044                 if( status ) return status;
12045         }
12046 #endif
12047
12048 #ifdef HAVE_LINUX_THREADS
12049         pthread_kill_other_threads_np();
12050 #endif
12051
12052         return 0;
12053
12054 ; return 0; }
12055 EOF
12056 if { (eval echo configure:12057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12057   rm -rf conftest*
12058   ol_cv_pthread_kthread=yes
12059 else
12060   echo "configure: failed program was:" >&5
12061   cat conftest.$ac_ext >&5
12062   rm -rf conftest*
12063   ol_cv_pthread_kthread=no
12064 fi
12065 rm -f conftest*
12066 else
12067   cat > conftest.$ac_ext <<EOF
12068 #line 12069 "configure"
12069 #include "confdefs.h"
12070 /* pthread test headers */
12071 #include <pthread.h>
12072 #ifndef NULL
12073 #define NULL (void*)0
12074 #endif
12075
12076 static void *task(p)
12077         void *p;
12078 {
12079         return (void *) (p == NULL);
12080 }
12081
12082
12083 int main(argc, argv)
12084         int argc;
12085         char **argv;
12086 {
12087
12088         /* pthread test function */
12089         pthread_t t;
12090         int status;
12091         int detach = 1;
12092
12093 #ifdef HAVE_PTHREADS_FINAL
12094         /* Final pthreads */
12095         pthread_attr_t attr;
12096
12097         status = pthread_attr_init(&attr);
12098         if( status ) return status;
12099
12100 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
12101         if( !detach ) {
12102 #if defined( PTHREAD_CREATE_JOINABLE )
12103                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
12104 #else
12105                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
12106 #endif
12107
12108 #ifdef PTHREAD_CREATE_DETACHED
12109         } else {
12110                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
12111 #endif
12112         }
12113         if( status ) return status;
12114 #endif
12115
12116         status = pthread_create( &t, &attr, task, NULL );
12117         if( status ) return status;
12118
12119 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
12120         if( detach ) {
12121                 /* give thread a chance to complete */
12122                 /* it should remain joinable and hence detachable */
12123                 sleep( 1 );
12124
12125                 status = pthread_detach( t );
12126                 if( status ) return status;
12127         }
12128 #endif
12129
12130 #else
12131         /* Draft 4 pthreads */
12132         status = pthread_create( &t, pthread_attr_default, task, NULL );
12133         if( status ) return status;
12134
12135         if( detach ) {
12136                 /* give thread a chance to complete */
12137                 /* it should remain joinable and hence detachable */
12138                 sleep( 1 );
12139
12140                 status = pthread_detach( &t );
12141                 if( status ) return status;
12142         }
12143 #endif
12144
12145 #ifdef HAVE_LINUX_THREADS
12146         pthread_kill_other_threads_np();
12147 #endif
12148
12149         return 0;
12150
12151 }
12152
12153 EOF
12154 if { (eval echo configure:12155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12155 then
12156   ol_cv_pthread_kthread=yes
12157 else
12158   echo "configure: failed program was:" >&5
12159   cat conftest.$ac_ext >&5
12160   rm -fr conftest*
12161   ol_cv_pthread_kthread=no
12162 fi
12163 rm -fr conftest*
12164 fi
12165
12166
12167                 # restore the LIBS
12168                 LIBS="$ol_LIBS"
12169         
12170 fi
12171
12172 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
12173
12174         if test $ol_cv_pthread_kthread = yes ; then
12175                 ol_link_pthreads="-kthread"
12176                 ol_link_threads=posix
12177         fi
12178 fi
12179
12180                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
12181 if test "$ol_link_threads" = no ; then
12182         # try -pthread
12183         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
12184 echo "configure:12185: checking for pthread link with -pthread" >&5
12185 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
12186   echo $ac_n "(cached) $ac_c" 1>&6
12187 else
12188   
12189                 # save the flags
12190                 ol_LIBS="$LIBS"
12191                 LIBS="-pthread $LIBS"
12192
12193                 if test "$cross_compiling" = yes; then
12194   cat > conftest.$ac_ext <<EOF
12195 #line 12196 "configure"
12196 #include "confdefs.h"
12197 /* pthread test headers */
12198 #include <pthread.h>
12199 #ifndef NULL
12200 #define NULL (void*)0
12201 #endif
12202
12203 static void *task(p)
12204         void *p;
12205 {
12206         return (void *) (p == NULL);
12207 }
12208
12209 int main() {
12210
12211         /* pthread test function */
12212         pthread_t t;
12213         int status;
12214         int detach = 1;
12215
12216 #ifdef HAVE_PTHREADS_FINAL
12217         /* Final pthreads */
12218         pthread_attr_t attr;
12219
12220         status = pthread_attr_init(&attr);
12221         if( status ) return status;
12222
12223 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
12224         if( !detach ) {
12225 #if defined( PTHREAD_CREATE_JOINABLE )
12226                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
12227 #else
12228                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
12229 #endif
12230
12231 #ifdef PTHREAD_CREATE_DETACHED
12232         } else {
12233                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
12234 #endif
12235         }
12236         if( status ) return status;
12237 #endif
12238
12239         status = pthread_create( &t, &attr, task, NULL );
12240         if( status ) return status;
12241
12242 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
12243         if( detach ) {
12244                 /* give thread a chance to complete */
12245                 /* it should remain joinable and hence detachable */
12246                 sleep( 1 );
12247
12248                 status = pthread_detach( t );
12249                 if( status ) return status;
12250         }
12251 #endif
12252
12253 #else
12254         /* Draft 4 pthreads */
12255         status = pthread_create( &t, pthread_attr_default, task, NULL );
12256         if( status ) return status;
12257
12258         if( detach ) {
12259                 /* give thread a chance to complete */
12260                 /* it should remain joinable and hence detachable */
12261                 sleep( 1 );
12262
12263                 status = pthread_detach( &t );
12264                 if( status ) return status;
12265         }
12266 #endif
12267
12268 #ifdef HAVE_LINUX_THREADS
12269         pthread_kill_other_threads_np();
12270 #endif
12271
12272         return 0;
12273
12274 ; return 0; }
12275 EOF
12276 if { (eval echo configure:12277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12277   rm -rf conftest*
12278   ol_cv_pthread_pthread=yes
12279 else
12280   echo "configure: failed program was:" >&5
12281   cat conftest.$ac_ext >&5
12282   rm -rf conftest*
12283   ol_cv_pthread_pthread=no
12284 fi
12285 rm -f conftest*
12286 else
12287   cat > conftest.$ac_ext <<EOF
12288 #line 12289 "configure"
12289 #include "confdefs.h"
12290 /* pthread test headers */
12291 #include <pthread.h>
12292 #ifndef NULL
12293 #define NULL (void*)0
12294 #endif
12295
12296 static void *task(p)
12297         void *p;
12298 {
12299         return (void *) (p == NULL);
12300 }
12301
12302
12303 int main(argc, argv)
12304         int argc;
12305         char **argv;
12306 {
12307
12308         /* pthread test function */
12309         pthread_t t;
12310         int status;
12311         int detach = 1;
12312
12313 #ifdef HAVE_PTHREADS_FINAL
12314         /* Final pthreads */
12315         pthread_attr_t attr;
12316
12317         status = pthread_attr_init(&attr);
12318         if( status ) return status;
12319
12320 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
12321         if( !detach ) {
12322 #if defined( PTHREAD_CREATE_JOINABLE )
12323                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
12324 #else
12325                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
12326 #endif
12327
12328 #ifdef PTHREAD_CREATE_DETACHED
12329         } else {
12330                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
12331 #endif
12332         }
12333         if( status ) return status;
12334 #endif
12335
12336         status = pthread_create( &t, &attr, task, NULL );
12337         if( status ) return status;
12338
12339 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
12340         if( detach ) {
12341                 /* give thread a chance to complete */
12342                 /* it should remain joinable and hence detachable */
12343                 sleep( 1 );
12344
12345                 status = pthread_detach( t );
12346                 if( status ) return status;
12347         }
12348 #endif
12349
12350 #else
12351         /* Draft 4 pthreads */
12352         status = pthread_create( &t, pthread_attr_default, task, NULL );
12353         if( status ) return status;
12354
12355         if( detach ) {
12356                 /* give thread a chance to complete */
12357                 /* it should remain joinable and hence detachable */
12358                 sleep( 1 );
12359
12360                 status = pthread_detach( &t );
12361                 if( status ) return status;
12362         }
12363 #endif
12364
12365 #ifdef HAVE_LINUX_THREADS
12366         pthread_kill_other_threads_np();
12367 #endif
12368
12369         return 0;
12370
12371 }
12372
12373 EOF
12374 if { (eval echo configure:12375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12375 then
12376   ol_cv_pthread_pthread=yes
12377 else
12378   echo "configure: failed program was:" >&5
12379   cat conftest.$ac_ext >&5
12380   rm -fr conftest*
12381   ol_cv_pthread_pthread=no
12382 fi
12383 rm -fr conftest*
12384 fi
12385
12386
12387                 # restore the LIBS
12388                 LIBS="$ol_LIBS"
12389         
12390 fi
12391
12392 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
12393
12394         if test $ol_cv_pthread_pthread = yes ; then
12395                 ol_link_pthreads="-pthread"
12396                 ol_link_threads=posix
12397         fi
12398 fi
12399
12400                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
12401 if test "$ol_link_threads" = no ; then
12402         # try -pthreads
12403         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
12404 echo "configure:12405: checking for pthread link with -pthreads" >&5
12405 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
12406   echo $ac_n "(cached) $ac_c" 1>&6
12407 else
12408   
12409                 # save the flags
12410                 ol_LIBS="$LIBS"
12411                 LIBS="-pthreads $LIBS"
12412
12413                 if test "$cross_compiling" = yes; then
12414   cat > conftest.$ac_ext <<EOF
12415 #line 12416 "configure"
12416 #include "confdefs.h"
12417 /* pthread test headers */
12418 #include <pthread.h>
12419 #ifndef NULL
12420 #define NULL (void*)0
12421 #endif
12422
12423 static void *task(p)
12424         void *p;
12425 {
12426         return (void *) (p == NULL);
12427 }
12428
12429 int main() {
12430
12431         /* pthread test function */
12432         pthread_t t;
12433         int status;
12434         int detach = 1;
12435
12436 #ifdef HAVE_PTHREADS_FINAL
12437         /* Final pthreads */
12438         pthread_attr_t attr;
12439
12440         status = pthread_attr_init(&attr);
12441         if( status ) return status;
12442
12443 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
12444         if( !detach ) {
12445 #if defined( PTHREAD_CREATE_JOINABLE )
12446                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
12447 #else
12448                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
12449 #endif
12450
12451 #ifdef PTHREAD_CREATE_DETACHED
12452         } else {
12453                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
12454 #endif
12455         }
12456         if( status ) return status;
12457 #endif
12458
12459         status = pthread_create( &t, &attr, task, NULL );
12460         if( status ) return status;
12461
12462 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
12463         if( detach ) {
12464                 /* give thread a chance to complete */
12465                 /* it should remain joinable and hence detachable */
12466                 sleep( 1 );
12467
12468                 status = pthread_detach( t );
12469                 if( status ) return status;
12470         }
12471 #endif
12472
12473 #else
12474         /* Draft 4 pthreads */
12475         status = pthread_create( &t, pthread_attr_default, task, NULL );
12476         if( status ) return status;
12477
12478         if( detach ) {
12479                 /* give thread a chance to complete */
12480                 /* it should remain joinable and hence detachable */
12481                 sleep( 1 );
12482
12483                 status = pthread_detach( &t );
12484                 if( status ) return status;
12485         }
12486 #endif
12487
12488 #ifdef HAVE_LINUX_THREADS
12489         pthread_kill_other_threads_np();
12490 #endif
12491
12492         return 0;
12493
12494 ; return 0; }
12495 EOF
12496 if { (eval echo configure:12497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12497   rm -rf conftest*
12498   ol_cv_pthread_pthreads=yes
12499 else
12500   echo "configure: failed program was:" >&5
12501   cat conftest.$ac_ext >&5
12502   rm -rf conftest*
12503   ol_cv_pthread_pthreads=no
12504 fi
12505 rm -f conftest*
12506 else
12507   cat > conftest.$ac_ext <<EOF
12508 #line 12509 "configure"
12509 #include "confdefs.h"
12510 /* pthread test headers */
12511 #include <pthread.h>
12512 #ifndef NULL
12513 #define NULL (void*)0
12514 #endif
12515
12516 static void *task(p)
12517         void *p;
12518 {
12519         return (void *) (p == NULL);
12520 }
12521
12522
12523 int main(argc, argv)
12524         int argc;
12525         char **argv;
12526 {
12527
12528         /* pthread test function */
12529         pthread_t t;
12530         int status;
12531         int detach = 1;
12532
12533 #ifdef HAVE_PTHREADS_FINAL
12534         /* Final pthreads */
12535         pthread_attr_t attr;
12536
12537         status = pthread_attr_init(&attr);
12538         if( status ) return status;
12539
12540 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
12541         if( !detach ) {
12542 #if defined( PTHREAD_CREATE_JOINABLE )
12543                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
12544 #else
12545                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
12546 #endif
12547
12548 #ifdef PTHREAD_CREATE_DETACHED
12549         } else {
12550                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
12551 #endif
12552         }
12553         if( status ) return status;
12554 #endif
12555
12556         status = pthread_create( &t, &attr, task, NULL );
12557         if( status ) return status;
12558
12559 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
12560         if( detach ) {
12561                 /* give thread a chance to complete */
12562                 /* it should remain joinable and hence detachable */
12563                 sleep( 1 );
12564
12565                 status = pthread_detach( t );
12566                 if( status ) return status;
12567         }
12568 #endif
12569
12570 #else
12571         /* Draft 4 pthreads */
12572         status = pthread_create( &t, pthread_attr_default, task, NULL );
12573         if( status ) return status;
12574
12575         if( detach ) {
12576                 /* give thread a chance to complete */
12577                 /* it should remain joinable and hence detachable */
12578                 sleep( 1 );
12579
12580                 status = pthread_detach( &t );
12581                 if( status ) return status;
12582         }
12583 #endif
12584
12585 #ifdef HAVE_LINUX_THREADS
12586         pthread_kill_other_threads_np();
12587 #endif
12588
12589         return 0;
12590
12591 }
12592
12593 EOF
12594 if { (eval echo configure:12595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12595 then
12596   ol_cv_pthread_pthreads=yes
12597 else
12598   echo "configure: failed program was:" >&5
12599   cat conftest.$ac_ext >&5
12600   rm -fr conftest*
12601   ol_cv_pthread_pthreads=no
12602 fi
12603 rm -fr conftest*
12604 fi
12605
12606
12607                 # restore the LIBS
12608                 LIBS="$ol_LIBS"
12609         
12610 fi
12611
12612 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
12613
12614         if test $ol_cv_pthread_pthreads = yes ; then
12615                 ol_link_pthreads="-pthreads"
12616                 ol_link_threads=posix
12617         fi
12618 fi
12619
12620                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
12621 if test "$ol_link_threads" = no ; then
12622         # try -mthreads
12623         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
12624 echo "configure:12625: checking for pthread link with -mthreads" >&5
12625 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
12626   echo $ac_n "(cached) $ac_c" 1>&6
12627 else
12628   
12629                 # save the flags
12630                 ol_LIBS="$LIBS"
12631                 LIBS="-mthreads $LIBS"
12632
12633                 if test "$cross_compiling" = yes; then
12634   cat > conftest.$ac_ext <<EOF
12635 #line 12636 "configure"
12636 #include "confdefs.h"
12637 /* pthread test headers */
12638 #include <pthread.h>
12639 #ifndef NULL
12640 #define NULL (void*)0
12641 #endif
12642
12643 static void *task(p)
12644         void *p;
12645 {
12646         return (void *) (p == NULL);
12647 }
12648
12649 int main() {
12650
12651         /* pthread test function */
12652         pthread_t t;
12653         int status;
12654         int detach = 1;
12655
12656 #ifdef HAVE_PTHREADS_FINAL
12657         /* Final pthreads */
12658         pthread_attr_t attr;
12659
12660         status = pthread_attr_init(&attr);
12661         if( status ) return status;
12662
12663 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
12664         if( !detach ) {
12665 #if defined( PTHREAD_CREATE_JOINABLE )
12666                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
12667 #else
12668                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
12669 #endif
12670
12671 #ifdef PTHREAD_CREATE_DETACHED
12672         } else {
12673                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
12674 #endif
12675         }
12676         if( status ) return status;
12677 #endif
12678
12679         status = pthread_create( &t, &attr, task, NULL );
12680         if( status ) return status;
12681
12682 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
12683         if( detach ) {
12684                 /* give thread a chance to complete */
12685                 /* it should remain joinable and hence detachable */
12686                 sleep( 1 );
12687
12688                 status = pthread_detach( t );
12689                 if( status ) return status;
12690         }
12691 #endif
12692
12693 #else
12694         /* Draft 4 pthreads */
12695         status = pthread_create( &t, pthread_attr_default, task, NULL );
12696         if( status ) return status;
12697
12698         if( detach ) {
12699                 /* give thread a chance to complete */
12700                 /* it should remain joinable and hence detachable */
12701                 sleep( 1 );
12702
12703                 status = pthread_detach( &t );
12704                 if( status ) return status;
12705         }
12706 #endif
12707
12708 #ifdef HAVE_LINUX_THREADS
12709         pthread_kill_other_threads_np();
12710 #endif
12711
12712         return 0;
12713
12714 ; return 0; }
12715 EOF
12716 if { (eval echo configure:12717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12717   rm -rf conftest*
12718   ol_cv_pthread_mthreads=yes
12719 else
12720   echo "configure: failed program was:" >&5
12721   cat conftest.$ac_ext >&5
12722   rm -rf conftest*
12723   ol_cv_pthread_mthreads=no
12724 fi
12725 rm -f conftest*
12726 else
12727   cat > conftest.$ac_ext <<EOF
12728 #line 12729 "configure"
12729 #include "confdefs.h"
12730 /* pthread test headers */
12731 #include <pthread.h>
12732 #ifndef NULL
12733 #define NULL (void*)0
12734 #endif
12735
12736 static void *task(p)
12737         void *p;
12738 {
12739         return (void *) (p == NULL);
12740 }
12741
12742
12743 int main(argc, argv)
12744         int argc;
12745         char **argv;
12746 {
12747
12748         /* pthread test function */
12749         pthread_t t;
12750         int status;
12751         int detach = 1;
12752
12753 #ifdef HAVE_PTHREADS_FINAL
12754         /* Final pthreads */
12755         pthread_attr_t attr;
12756
12757         status = pthread_attr_init(&attr);
12758         if( status ) return status;
12759
12760 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
12761         if( !detach ) {
12762 #if defined( PTHREAD_CREATE_JOINABLE )
12763                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
12764 #else
12765                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
12766 #endif
12767
12768 #ifdef PTHREAD_CREATE_DETACHED
12769         } else {
12770                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
12771 #endif
12772         }
12773         if( status ) return status;
12774 #endif
12775
12776         status = pthread_create( &t, &attr, task, NULL );
12777         if( status ) return status;
12778
12779 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
12780         if( detach ) {
12781                 /* give thread a chance to complete */
12782                 /* it should remain joinable and hence detachable */
12783                 sleep( 1 );
12784
12785                 status = pthread_detach( t );
12786                 if( status ) return status;
12787         }
12788 #endif
12789
12790 #else
12791         /* Draft 4 pthreads */
12792         status = pthread_create( &t, pthread_attr_default, task, NULL );
12793         if( status ) return status;
12794
12795         if( detach ) {
12796                 /* give thread a chance to complete */
12797                 /* it should remain joinable and hence detachable */
12798                 sleep( 1 );
12799
12800                 status = pthread_detach( &t );
12801                 if( status ) return status;
12802         }
12803 #endif
12804
12805 #ifdef HAVE_LINUX_THREADS
12806         pthread_kill_other_threads_np();
12807 #endif
12808
12809         return 0;
12810
12811 }
12812
12813 EOF
12814 if { (eval echo configure:12815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12815 then
12816   ol_cv_pthread_mthreads=yes
12817 else
12818   echo "configure: failed program was:" >&5
12819   cat conftest.$ac_ext >&5
12820   rm -fr conftest*
12821   ol_cv_pthread_mthreads=no
12822 fi
12823 rm -fr conftest*
12824 fi
12825
12826
12827                 # restore the LIBS
12828                 LIBS="$ol_LIBS"
12829         
12830 fi
12831
12832 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
12833
12834         if test $ol_cv_pthread_mthreads = yes ; then
12835                 ol_link_pthreads="-mthreads"
12836                 ol_link_threads=posix
12837         fi
12838 fi
12839
12840                 # Pthread try link: -thread (ol_cv_pthread_thread)
12841 if test "$ol_link_threads" = no ; then
12842         # try -thread
12843         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
12844 echo "configure:12845: checking for pthread link with -thread" >&5
12845 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
12846   echo $ac_n "(cached) $ac_c" 1>&6
12847 else
12848   
12849                 # save the flags
12850                 ol_LIBS="$LIBS"
12851                 LIBS="-thread $LIBS"
12852
12853                 if test "$cross_compiling" = yes; then
12854   cat > conftest.$ac_ext <<EOF
12855 #line 12856 "configure"
12856 #include "confdefs.h"
12857 /* pthread test headers */
12858 #include <pthread.h>
12859 #ifndef NULL
12860 #define NULL (void*)0
12861 #endif
12862
12863 static void *task(p)
12864         void *p;
12865 {
12866         return (void *) (p == NULL);
12867 }
12868
12869 int main() {
12870
12871         /* pthread test function */
12872         pthread_t t;
12873         int status;
12874         int detach = 1;
12875
12876 #ifdef HAVE_PTHREADS_FINAL
12877         /* Final pthreads */
12878         pthread_attr_t attr;
12879
12880         status = pthread_attr_init(&attr);
12881         if( status ) return status;
12882
12883 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
12884         if( !detach ) {
12885 #if defined( PTHREAD_CREATE_JOINABLE )
12886                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
12887 #else
12888                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
12889 #endif
12890
12891 #ifdef PTHREAD_CREATE_DETACHED
12892         } else {
12893                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
12894 #endif
12895         }
12896         if( status ) return status;
12897 #endif
12898
12899         status = pthread_create( &t, &attr, task, NULL );
12900         if( status ) return status;
12901
12902 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
12903         if( detach ) {
12904                 /* give thread a chance to complete */
12905                 /* it should remain joinable and hence detachable */
12906                 sleep( 1 );
12907
12908                 status = pthread_detach( t );
12909                 if( status ) return status;
12910         }
12911 #endif
12912
12913 #else
12914         /* Draft 4 pthreads */
12915         status = pthread_create( &t, pthread_attr_default, task, NULL );
12916         if( status ) return status;
12917
12918         if( detach ) {
12919                 /* give thread a chance to complete */
12920                 /* it should remain joinable and hence detachable */
12921                 sleep( 1 );
12922
12923                 status = pthread_detach( &t );
12924                 if( status ) return status;
12925         }
12926 #endif
12927
12928 #ifdef HAVE_LINUX_THREADS
12929         pthread_kill_other_threads_np();
12930 #endif
12931
12932         return 0;
12933
12934 ; return 0; }
12935 EOF
12936 if { (eval echo configure:12937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12937   rm -rf conftest*
12938   ol_cv_pthread_thread=yes
12939 else
12940   echo "configure: failed program was:" >&5
12941   cat conftest.$ac_ext >&5
12942   rm -rf conftest*
12943   ol_cv_pthread_thread=no
12944 fi
12945 rm -f conftest*
12946 else
12947   cat > conftest.$ac_ext <<EOF
12948 #line 12949 "configure"
12949 #include "confdefs.h"
12950 /* pthread test headers */
12951 #include <pthread.h>
12952 #ifndef NULL
12953 #define NULL (void*)0
12954 #endif
12955
12956 static void *task(p)
12957         void *p;
12958 {
12959         return (void *) (p == NULL);
12960 }
12961
12962
12963 int main(argc, argv)
12964         int argc;
12965         char **argv;
12966 {
12967
12968         /* pthread test function */
12969         pthread_t t;
12970         int status;
12971         int detach = 1;
12972
12973 #ifdef HAVE_PTHREADS_FINAL
12974         /* Final pthreads */
12975         pthread_attr_t attr;
12976
12977         status = pthread_attr_init(&attr);
12978         if( status ) return status;
12979
12980 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
12981         if( !detach ) {
12982 #if defined( PTHREAD_CREATE_JOINABLE )
12983                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
12984 #else
12985                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
12986 #endif
12987
12988 #ifdef PTHREAD_CREATE_DETACHED
12989         } else {
12990                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
12991 #endif
12992         }
12993         if( status ) return status;
12994 #endif
12995
12996         status = pthread_create( &t, &attr, task, NULL );
12997         if( status ) return status;
12998
12999 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
13000         if( detach ) {
13001                 /* give thread a chance to complete */
13002                 /* it should remain joinable and hence detachable */
13003                 sleep( 1 );
13004
13005                 status = pthread_detach( t );
13006                 if( status ) return status;
13007         }
13008 #endif
13009
13010 #else
13011         /* Draft 4 pthreads */
13012         status = pthread_create( &t, pthread_attr_default, task, NULL );
13013         if( status ) return status;
13014
13015         if( detach ) {
13016                 /* give thread a chance to complete */
13017                 /* it should remain joinable and hence detachable */
13018                 sleep( 1 );
13019
13020                 status = pthread_detach( &t );
13021                 if( status ) return status;
13022         }
13023 #endif
13024
13025 #ifdef HAVE_LINUX_THREADS
13026         pthread_kill_other_threads_np();
13027 #endif
13028
13029         return 0;
13030
13031 }
13032
13033 EOF
13034 if { (eval echo configure:13035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13035 then
13036   ol_cv_pthread_thread=yes
13037 else
13038   echo "configure: failed program was:" >&5
13039   cat conftest.$ac_ext >&5
13040   rm -fr conftest*
13041   ol_cv_pthread_thread=no
13042 fi
13043 rm -fr conftest*
13044 fi
13045
13046
13047                 # restore the LIBS
13048                 LIBS="$ol_LIBS"
13049         
13050 fi
13051
13052 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
13053
13054         if test $ol_cv_pthread_thread = yes ; then
13055                 ol_link_pthreads="-thread"
13056                 ol_link_threads=posix
13057         fi
13058 fi
13059
13060
13061                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
13062 if test "$ol_link_threads" = no ; then
13063         # try -lpthread -lmach -lexc -lc_r
13064         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
13065 echo "configure:13066: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
13066 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
13067   echo $ac_n "(cached) $ac_c" 1>&6
13068 else
13069   
13070                 # save the flags
13071                 ol_LIBS="$LIBS"
13072                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
13073
13074                 if test "$cross_compiling" = yes; then
13075   cat > conftest.$ac_ext <<EOF
13076 #line 13077 "configure"
13077 #include "confdefs.h"
13078 /* pthread test headers */
13079 #include <pthread.h>
13080 #ifndef NULL
13081 #define NULL (void*)0
13082 #endif
13083
13084 static void *task(p)
13085         void *p;
13086 {
13087         return (void *) (p == NULL);
13088 }
13089
13090 int main() {
13091
13092         /* pthread test function */
13093         pthread_t t;
13094         int status;
13095         int detach = 1;
13096
13097 #ifdef HAVE_PTHREADS_FINAL
13098         /* Final pthreads */
13099         pthread_attr_t attr;
13100
13101         status = pthread_attr_init(&attr);
13102         if( status ) return status;
13103
13104 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
13105         if( !detach ) {
13106 #if defined( PTHREAD_CREATE_JOINABLE )
13107                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
13108 #else
13109                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
13110 #endif
13111
13112 #ifdef PTHREAD_CREATE_DETACHED
13113         } else {
13114                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
13115 #endif
13116         }
13117         if( status ) return status;
13118 #endif
13119
13120         status = pthread_create( &t, &attr, task, NULL );
13121         if( status ) return status;
13122
13123 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
13124         if( detach ) {
13125                 /* give thread a chance to complete */
13126                 /* it should remain joinable and hence detachable */
13127                 sleep( 1 );
13128
13129                 status = pthread_detach( t );
13130                 if( status ) return status;
13131         }
13132 #endif
13133
13134 #else
13135         /* Draft 4 pthreads */
13136         status = pthread_create( &t, pthread_attr_default, task, NULL );
13137         if( status ) return status;
13138
13139         if( detach ) {
13140                 /* give thread a chance to complete */
13141                 /* it should remain joinable and hence detachable */
13142                 sleep( 1 );
13143
13144                 status = pthread_detach( &t );
13145                 if( status ) return status;
13146         }
13147 #endif
13148
13149 #ifdef HAVE_LINUX_THREADS
13150         pthread_kill_other_threads_np();
13151 #endif
13152
13153         return 0;
13154
13155 ; return 0; }
13156 EOF
13157 if { (eval echo configure:13158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13158   rm -rf conftest*
13159   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
13160 else
13161   echo "configure: failed program was:" >&5
13162   cat conftest.$ac_ext >&5
13163   rm -rf conftest*
13164   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
13165 fi
13166 rm -f conftest*
13167 else
13168   cat > conftest.$ac_ext <<EOF
13169 #line 13170 "configure"
13170 #include "confdefs.h"
13171 /* pthread test headers */
13172 #include <pthread.h>
13173 #ifndef NULL
13174 #define NULL (void*)0
13175 #endif
13176
13177 static void *task(p)
13178         void *p;
13179 {
13180         return (void *) (p == NULL);
13181 }
13182
13183
13184 int main(argc, argv)
13185         int argc;
13186         char **argv;
13187 {
13188
13189         /* pthread test function */
13190         pthread_t t;
13191         int status;
13192         int detach = 1;
13193
13194 #ifdef HAVE_PTHREADS_FINAL
13195         /* Final pthreads */
13196         pthread_attr_t attr;
13197
13198         status = pthread_attr_init(&attr);
13199         if( status ) return status;
13200
13201 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
13202         if( !detach ) {
13203 #if defined( PTHREAD_CREATE_JOINABLE )
13204                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
13205 #else
13206                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
13207 #endif
13208
13209 #ifdef PTHREAD_CREATE_DETACHED
13210         } else {
13211                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
13212 #endif
13213         }
13214         if( status ) return status;
13215 #endif
13216
13217         status = pthread_create( &t, &attr, task, NULL );
13218         if( status ) return status;
13219
13220 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
13221         if( detach ) {
13222                 /* give thread a chance to complete */
13223                 /* it should remain joinable and hence detachable */
13224                 sleep( 1 );
13225
13226                 status = pthread_detach( t );
13227                 if( status ) return status;
13228         }
13229 #endif
13230
13231 #else
13232         /* Draft 4 pthreads */
13233         status = pthread_create( &t, pthread_attr_default, task, NULL );
13234         if( status ) return status;
13235
13236         if( detach ) {
13237                 /* give thread a chance to complete */
13238                 /* it should remain joinable and hence detachable */
13239                 sleep( 1 );
13240
13241                 status = pthread_detach( &t );
13242                 if( status ) return status;
13243         }
13244 #endif
13245
13246 #ifdef HAVE_LINUX_THREADS
13247         pthread_kill_other_threads_np();
13248 #endif
13249
13250         return 0;
13251
13252 }
13253
13254 EOF
13255 if { (eval echo configure:13256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13256 then
13257   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
13258 else
13259   echo "configure: failed program was:" >&5
13260   cat conftest.$ac_ext >&5
13261   rm -fr conftest*
13262   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
13263 fi
13264 rm -fr conftest*
13265 fi
13266
13267
13268                 # restore the LIBS
13269                 LIBS="$ol_LIBS"
13270         
13271 fi
13272
13273 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
13274
13275         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
13276                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
13277                 ol_link_threads=posix
13278         fi
13279 fi
13280
13281                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
13282 if test "$ol_link_threads" = no ; then
13283         # try -lpthread -lmach -lexc
13284         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
13285 echo "configure:13286: checking for pthread link with -lpthread -lmach -lexc" >&5
13286 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
13287   echo $ac_n "(cached) $ac_c" 1>&6
13288 else
13289   
13290                 # save the flags
13291                 ol_LIBS="$LIBS"
13292                 LIBS="-lpthread -lmach -lexc $LIBS"
13293
13294                 if test "$cross_compiling" = yes; then
13295   cat > conftest.$ac_ext <<EOF
13296 #line 13297 "configure"
13297 #include "confdefs.h"
13298 /* pthread test headers */
13299 #include <pthread.h>
13300 #ifndef NULL
13301 #define NULL (void*)0
13302 #endif
13303
13304 static void *task(p)
13305         void *p;
13306 {
13307         return (void *) (p == NULL);
13308 }
13309
13310 int main() {
13311
13312         /* pthread test function */
13313         pthread_t t;
13314         int status;
13315         int detach = 1;
13316
13317 #ifdef HAVE_PTHREADS_FINAL
13318         /* Final pthreads */
13319         pthread_attr_t attr;
13320
13321         status = pthread_attr_init(&attr);
13322         if( status ) return status;
13323
13324 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
13325         if( !detach ) {
13326 #if defined( PTHREAD_CREATE_JOINABLE )
13327                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
13328 #else
13329                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
13330 #endif
13331
13332 #ifdef PTHREAD_CREATE_DETACHED
13333         } else {
13334                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
13335 #endif
13336         }
13337         if( status ) return status;
13338 #endif
13339
13340         status = pthread_create( &t, &attr, task, NULL );
13341         if( status ) return status;
13342
13343 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
13344         if( detach ) {
13345                 /* give thread a chance to complete */
13346                 /* it should remain joinable and hence detachable */
13347                 sleep( 1 );
13348
13349                 status = pthread_detach( t );
13350                 if( status ) return status;
13351         }
13352 #endif
13353
13354 #else
13355         /* Draft 4 pthreads */
13356         status = pthread_create( &t, pthread_attr_default, task, NULL );
13357         if( status ) return status;
13358
13359         if( detach ) {
13360                 /* give thread a chance to complete */
13361                 /* it should remain joinable and hence detachable */
13362                 sleep( 1 );
13363
13364                 status = pthread_detach( &t );
13365                 if( status ) return status;
13366         }
13367 #endif
13368
13369 #ifdef HAVE_LINUX_THREADS
13370         pthread_kill_other_threads_np();
13371 #endif
13372
13373         return 0;
13374
13375 ; return 0; }
13376 EOF
13377 if { (eval echo configure:13378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13378   rm -rf conftest*
13379   ol_cv_pthread_lpthread_lmach_lexc=yes
13380 else
13381   echo "configure: failed program was:" >&5
13382   cat conftest.$ac_ext >&5
13383   rm -rf conftest*
13384   ol_cv_pthread_lpthread_lmach_lexc=no
13385 fi
13386 rm -f conftest*
13387 else
13388   cat > conftest.$ac_ext <<EOF
13389 #line 13390 "configure"
13390 #include "confdefs.h"
13391 /* pthread test headers */
13392 #include <pthread.h>
13393 #ifndef NULL
13394 #define NULL (void*)0
13395 #endif
13396
13397 static void *task(p)
13398         void *p;
13399 {
13400         return (void *) (p == NULL);
13401 }
13402
13403
13404 int main(argc, argv)
13405         int argc;
13406         char **argv;
13407 {
13408
13409         /* pthread test function */
13410         pthread_t t;
13411         int status;
13412         int detach = 1;
13413
13414 #ifdef HAVE_PTHREADS_FINAL
13415         /* Final pthreads */
13416         pthread_attr_t attr;
13417
13418         status = pthread_attr_init(&attr);
13419         if( status ) return status;
13420
13421 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
13422         if( !detach ) {
13423 #if defined( PTHREAD_CREATE_JOINABLE )
13424                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
13425 #else
13426                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
13427 #endif
13428
13429 #ifdef PTHREAD_CREATE_DETACHED
13430         } else {
13431                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
13432 #endif
13433         }
13434         if( status ) return status;
13435 #endif
13436
13437         status = pthread_create( &t, &attr, task, NULL );
13438         if( status ) return status;
13439
13440 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
13441         if( detach ) {
13442                 /* give thread a chance to complete */
13443                 /* it should remain joinable and hence detachable */
13444                 sleep( 1 );
13445
13446                 status = pthread_detach( t );
13447                 if( status ) return status;
13448         }
13449 #endif
13450
13451 #else
13452         /* Draft 4 pthreads */
13453         status = pthread_create( &t, pthread_attr_default, task, NULL );
13454         if( status ) return status;
13455
13456         if( detach ) {
13457                 /* give thread a chance to complete */
13458                 /* it should remain joinable and hence detachable */
13459                 sleep( 1 );
13460
13461                 status = pthread_detach( &t );
13462                 if( status ) return status;
13463         }
13464 #endif
13465
13466 #ifdef HAVE_LINUX_THREADS
13467         pthread_kill_other_threads_np();
13468 #endif
13469
13470         return 0;
13471
13472 }
13473
13474 EOF
13475 if { (eval echo configure:13476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13476 then
13477   ol_cv_pthread_lpthread_lmach_lexc=yes
13478 else
13479   echo "configure: failed program was:" >&5
13480   cat conftest.$ac_ext >&5
13481   rm -fr conftest*
13482   ol_cv_pthread_lpthread_lmach_lexc=no
13483 fi
13484 rm -fr conftest*
13485 fi
13486
13487
13488                 # restore the LIBS
13489                 LIBS="$ol_LIBS"
13490         
13491 fi
13492
13493 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
13494
13495         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
13496                 ol_link_pthreads="-lpthread -lmach -lexc"
13497                 ol_link_threads=posix
13498         fi
13499 fi
13500
13501
13502                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
13503 if test "$ol_link_threads" = no ; then
13504         # try -lpthread -Wl,-woff,85
13505         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
13506 echo "configure:13507: checking for pthread link with -lpthread -Wl,-woff,85" >&5
13507 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
13508   echo $ac_n "(cached) $ac_c" 1>&6
13509 else
13510   
13511                 # save the flags
13512                 ol_LIBS="$LIBS"
13513                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
13514
13515                 if test "$cross_compiling" = yes; then
13516   cat > conftest.$ac_ext <<EOF
13517 #line 13518 "configure"
13518 #include "confdefs.h"
13519 /* pthread test headers */
13520 #include <pthread.h>
13521 #ifndef NULL
13522 #define NULL (void*)0
13523 #endif
13524
13525 static void *task(p)
13526         void *p;
13527 {
13528         return (void *) (p == NULL);
13529 }
13530
13531 int main() {
13532
13533         /* pthread test function */
13534         pthread_t t;
13535         int status;
13536         int detach = 1;
13537
13538 #ifdef HAVE_PTHREADS_FINAL
13539         /* Final pthreads */
13540         pthread_attr_t attr;
13541
13542         status = pthread_attr_init(&attr);
13543         if( status ) return status;
13544
13545 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
13546         if( !detach ) {
13547 #if defined( PTHREAD_CREATE_JOINABLE )
13548                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
13549 #else
13550                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
13551 #endif
13552
13553 #ifdef PTHREAD_CREATE_DETACHED
13554         } else {
13555                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
13556 #endif
13557         }
13558         if( status ) return status;
13559 #endif
13560
13561         status = pthread_create( &t, &attr, task, NULL );
13562         if( status ) return status;
13563
13564 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
13565         if( detach ) {
13566                 /* give thread a chance to complete */
13567                 /* it should remain joinable and hence detachable */
13568                 sleep( 1 );
13569
13570                 status = pthread_detach( t );
13571                 if( status ) return status;
13572         }
13573 #endif
13574
13575 #else
13576         /* Draft 4 pthreads */
13577         status = pthread_create( &t, pthread_attr_default, task, NULL );
13578         if( status ) return status;
13579
13580         if( detach ) {
13581                 /* give thread a chance to complete */
13582                 /* it should remain joinable and hence detachable */
13583                 sleep( 1 );
13584
13585                 status = pthread_detach( &t );
13586                 if( status ) return status;
13587         }
13588 #endif
13589
13590 #ifdef HAVE_LINUX_THREADS
13591         pthread_kill_other_threads_np();
13592 #endif
13593
13594         return 0;
13595
13596 ; return 0; }
13597 EOF
13598 if { (eval echo configure:13599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13599   rm -rf conftest*
13600   ol_cv_pthread_lib_lpthread_woff=yes
13601 else
13602   echo "configure: failed program was:" >&5
13603   cat conftest.$ac_ext >&5
13604   rm -rf conftest*
13605   ol_cv_pthread_lib_lpthread_woff=no
13606 fi
13607 rm -f conftest*
13608 else
13609   cat > conftest.$ac_ext <<EOF
13610 #line 13611 "configure"
13611 #include "confdefs.h"
13612 /* pthread test headers */
13613 #include <pthread.h>
13614 #ifndef NULL
13615 #define NULL (void*)0
13616 #endif
13617
13618 static void *task(p)
13619         void *p;
13620 {
13621         return (void *) (p == NULL);
13622 }
13623
13624
13625 int main(argc, argv)
13626         int argc;
13627         char **argv;
13628 {
13629
13630         /* pthread test function */
13631         pthread_t t;
13632         int status;
13633         int detach = 1;
13634
13635 #ifdef HAVE_PTHREADS_FINAL
13636         /* Final pthreads */
13637         pthread_attr_t attr;
13638
13639         status = pthread_attr_init(&attr);
13640         if( status ) return status;
13641
13642 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
13643         if( !detach ) {
13644 #if defined( PTHREAD_CREATE_JOINABLE )
13645                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
13646 #else
13647                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
13648 #endif
13649
13650 #ifdef PTHREAD_CREATE_DETACHED
13651         } else {
13652                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
13653 #endif
13654         }
13655         if( status ) return status;
13656 #endif
13657
13658         status = pthread_create( &t, &attr, task, NULL );
13659         if( status ) return status;
13660
13661 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
13662         if( detach ) {
13663                 /* give thread a chance to complete */
13664                 /* it should remain joinable and hence detachable */
13665                 sleep( 1 );
13666
13667                 status = pthread_detach( t );
13668                 if( status ) return status;
13669         }
13670 #endif
13671
13672 #else
13673         /* Draft 4 pthreads */
13674         status = pthread_create( &t, pthread_attr_default, task, NULL );
13675         if( status ) return status;
13676
13677         if( detach ) {
13678                 /* give thread a chance to complete */
13679                 /* it should remain joinable and hence detachable */
13680                 sleep( 1 );
13681
13682                 status = pthread_detach( &t );
13683                 if( status ) return status;
13684         }
13685 #endif
13686
13687 #ifdef HAVE_LINUX_THREADS
13688         pthread_kill_other_threads_np();
13689 #endif
13690
13691         return 0;
13692
13693 }
13694
13695 EOF
13696 if { (eval echo configure:13697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13697 then
13698   ol_cv_pthread_lib_lpthread_woff=yes
13699 else
13700   echo "configure: failed program was:" >&5
13701   cat conftest.$ac_ext >&5
13702   rm -fr conftest*
13703   ol_cv_pthread_lib_lpthread_woff=no
13704 fi
13705 rm -fr conftest*
13706 fi
13707
13708
13709                 # restore the LIBS
13710                 LIBS="$ol_LIBS"
13711         
13712 fi
13713
13714 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
13715
13716         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
13717                 ol_link_pthreads="-lpthread -Wl,-woff,85"
13718                 ol_link_threads=posix
13719         fi
13720 fi
13721
13722
13723                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
13724 if test "$ol_link_threads" = no ; then
13725         # try -lpthread
13726         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
13727 echo "configure:13728: checking for pthread link with -lpthread" >&5
13728 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
13729   echo $ac_n "(cached) $ac_c" 1>&6
13730 else
13731   
13732                 # save the flags
13733                 ol_LIBS="$LIBS"
13734                 LIBS="-lpthread $LIBS"
13735
13736                 if test "$cross_compiling" = yes; then
13737   cat > conftest.$ac_ext <<EOF
13738 #line 13739 "configure"
13739 #include "confdefs.h"
13740 /* pthread test headers */
13741 #include <pthread.h>
13742 #ifndef NULL
13743 #define NULL (void*)0
13744 #endif
13745
13746 static void *task(p)
13747         void *p;
13748 {
13749         return (void *) (p == NULL);
13750 }
13751
13752 int main() {
13753
13754         /* pthread test function */
13755         pthread_t t;
13756         int status;
13757         int detach = 1;
13758
13759 #ifdef HAVE_PTHREADS_FINAL
13760         /* Final pthreads */
13761         pthread_attr_t attr;
13762
13763         status = pthread_attr_init(&attr);
13764         if( status ) return status;
13765
13766 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
13767         if( !detach ) {
13768 #if defined( PTHREAD_CREATE_JOINABLE )
13769                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
13770 #else
13771                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
13772 #endif
13773
13774 #ifdef PTHREAD_CREATE_DETACHED
13775         } else {
13776                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
13777 #endif
13778         }
13779         if( status ) return status;
13780 #endif
13781
13782         status = pthread_create( &t, &attr, task, NULL );
13783         if( status ) return status;
13784
13785 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
13786         if( detach ) {
13787                 /* give thread a chance to complete */
13788                 /* it should remain joinable and hence detachable */
13789                 sleep( 1 );
13790
13791                 status = pthread_detach( t );
13792                 if( status ) return status;
13793         }
13794 #endif
13795
13796 #else
13797         /* Draft 4 pthreads */
13798         status = pthread_create( &t, pthread_attr_default, task, NULL );
13799         if( status ) return status;
13800
13801         if( detach ) {
13802                 /* give thread a chance to complete */
13803                 /* it should remain joinable and hence detachable */
13804                 sleep( 1 );
13805
13806                 status = pthread_detach( &t );
13807                 if( status ) return status;
13808         }
13809 #endif
13810
13811 #ifdef HAVE_LINUX_THREADS
13812         pthread_kill_other_threads_np();
13813 #endif
13814
13815         return 0;
13816
13817 ; return 0; }
13818 EOF
13819 if { (eval echo configure:13820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13820   rm -rf conftest*
13821   ol_cv_pthread_lpthread=yes
13822 else
13823   echo "configure: failed program was:" >&5
13824   cat conftest.$ac_ext >&5
13825   rm -rf conftest*
13826   ol_cv_pthread_lpthread=no
13827 fi
13828 rm -f conftest*
13829 else
13830   cat > conftest.$ac_ext <<EOF
13831 #line 13832 "configure"
13832 #include "confdefs.h"
13833 /* pthread test headers */
13834 #include <pthread.h>
13835 #ifndef NULL
13836 #define NULL (void*)0
13837 #endif
13838
13839 static void *task(p)
13840         void *p;
13841 {
13842         return (void *) (p == NULL);
13843 }
13844
13845
13846 int main(argc, argv)
13847         int argc;
13848         char **argv;
13849 {
13850
13851         /* pthread test function */
13852         pthread_t t;
13853         int status;
13854         int detach = 1;
13855
13856 #ifdef HAVE_PTHREADS_FINAL
13857         /* Final pthreads */
13858         pthread_attr_t attr;
13859
13860         status = pthread_attr_init(&attr);
13861         if( status ) return status;
13862
13863 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
13864         if( !detach ) {
13865 #if defined( PTHREAD_CREATE_JOINABLE )
13866                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
13867 #else
13868                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
13869 #endif
13870
13871 #ifdef PTHREAD_CREATE_DETACHED
13872         } else {
13873                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
13874 #endif
13875         }
13876         if( status ) return status;
13877 #endif
13878
13879         status = pthread_create( &t, &attr, task, NULL );
13880         if( status ) return status;
13881
13882 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
13883         if( detach ) {
13884                 /* give thread a chance to complete */
13885                 /* it should remain joinable and hence detachable */
13886                 sleep( 1 );
13887
13888                 status = pthread_detach( t );
13889                 if( status ) return status;
13890         }
13891 #endif
13892
13893 #else
13894         /* Draft 4 pthreads */
13895         status = pthread_create( &t, pthread_attr_default, task, NULL );
13896         if( status ) return status;
13897
13898         if( detach ) {
13899                 /* give thread a chance to complete */
13900                 /* it should remain joinable and hence detachable */
13901                 sleep( 1 );
13902
13903                 status = pthread_detach( &t );
13904                 if( status ) return status;
13905         }
13906 #endif
13907
13908 #ifdef HAVE_LINUX_THREADS
13909         pthread_kill_other_threads_np();
13910 #endif
13911
13912         return 0;
13913
13914 }
13915
13916 EOF
13917 if { (eval echo configure:13918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13918 then
13919   ol_cv_pthread_lpthread=yes
13920 else
13921   echo "configure: failed program was:" >&5
13922   cat conftest.$ac_ext >&5
13923   rm -fr conftest*
13924   ol_cv_pthread_lpthread=no
13925 fi
13926 rm -fr conftest*
13927 fi
13928
13929
13930                 # restore the LIBS
13931                 LIBS="$ol_LIBS"
13932         
13933 fi
13934
13935 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
13936
13937         if test $ol_cv_pthread_lpthread = yes ; then
13938                 ol_link_pthreads="-lpthread"
13939                 ol_link_threads=posix
13940         fi
13941 fi
13942
13943                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
13944 if test "$ol_link_threads" = no ; then
13945         # try -lc_r
13946         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
13947 echo "configure:13948: checking for pthread link with -lc_r" >&5
13948 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
13949   echo $ac_n "(cached) $ac_c" 1>&6
13950 else
13951   
13952                 # save the flags
13953                 ol_LIBS="$LIBS"
13954                 LIBS="-lc_r $LIBS"
13955
13956                 if test "$cross_compiling" = yes; then
13957   cat > conftest.$ac_ext <<EOF
13958 #line 13959 "configure"
13959 #include "confdefs.h"
13960 /* pthread test headers */
13961 #include <pthread.h>
13962 #ifndef NULL
13963 #define NULL (void*)0
13964 #endif
13965
13966 static void *task(p)
13967         void *p;
13968 {
13969         return (void *) (p == NULL);
13970 }
13971
13972 int main() {
13973
13974         /* pthread test function */
13975         pthread_t t;
13976         int status;
13977         int detach = 1;
13978
13979 #ifdef HAVE_PTHREADS_FINAL
13980         /* Final pthreads */
13981         pthread_attr_t attr;
13982
13983         status = pthread_attr_init(&attr);
13984         if( status ) return status;
13985
13986 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
13987         if( !detach ) {
13988 #if defined( PTHREAD_CREATE_JOINABLE )
13989                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
13990 #else
13991                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
13992 #endif
13993
13994 #ifdef PTHREAD_CREATE_DETACHED
13995         } else {
13996                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
13997 #endif
13998         }
13999         if( status ) return status;
14000 #endif
14001
14002         status = pthread_create( &t, &attr, task, NULL );
14003         if( status ) return status;
14004
14005 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
14006         if( detach ) {
14007                 /* give thread a chance to complete */
14008                 /* it should remain joinable and hence detachable */
14009                 sleep( 1 );
14010
14011                 status = pthread_detach( t );
14012                 if( status ) return status;
14013         }
14014 #endif
14015
14016 #else
14017         /* Draft 4 pthreads */
14018         status = pthread_create( &t, pthread_attr_default, task, NULL );
14019         if( status ) return status;
14020
14021         if( detach ) {
14022                 /* give thread a chance to complete */
14023                 /* it should remain joinable and hence detachable */
14024                 sleep( 1 );
14025
14026                 status = pthread_detach( &t );
14027                 if( status ) return status;
14028         }
14029 #endif
14030
14031 #ifdef HAVE_LINUX_THREADS
14032         pthread_kill_other_threads_np();
14033 #endif
14034
14035         return 0;
14036
14037 ; return 0; }
14038 EOF
14039 if { (eval echo configure:14040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14040   rm -rf conftest*
14041   ol_cv_pthread_lc_r=yes
14042 else
14043   echo "configure: failed program was:" >&5
14044   cat conftest.$ac_ext >&5
14045   rm -rf conftest*
14046   ol_cv_pthread_lc_r=no
14047 fi
14048 rm -f conftest*
14049 else
14050   cat > conftest.$ac_ext <<EOF
14051 #line 14052 "configure"
14052 #include "confdefs.h"
14053 /* pthread test headers */
14054 #include <pthread.h>
14055 #ifndef NULL
14056 #define NULL (void*)0
14057 #endif
14058
14059 static void *task(p)
14060         void *p;
14061 {
14062         return (void *) (p == NULL);
14063 }
14064
14065
14066 int main(argc, argv)
14067         int argc;
14068         char **argv;
14069 {
14070
14071         /* pthread test function */
14072         pthread_t t;
14073         int status;
14074         int detach = 1;
14075
14076 #ifdef HAVE_PTHREADS_FINAL
14077         /* Final pthreads */
14078         pthread_attr_t attr;
14079
14080         status = pthread_attr_init(&attr);
14081         if( status ) return status;
14082
14083 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
14084         if( !detach ) {
14085 #if defined( PTHREAD_CREATE_JOINABLE )
14086                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
14087 #else
14088                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
14089 #endif
14090
14091 #ifdef PTHREAD_CREATE_DETACHED
14092         } else {
14093                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
14094 #endif
14095         }
14096         if( status ) return status;
14097 #endif
14098
14099         status = pthread_create( &t, &attr, task, NULL );
14100         if( status ) return status;
14101
14102 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
14103         if( detach ) {
14104                 /* give thread a chance to complete */
14105                 /* it should remain joinable and hence detachable */
14106                 sleep( 1 );
14107
14108                 status = pthread_detach( t );
14109                 if( status ) return status;
14110         }
14111 #endif
14112
14113 #else
14114         /* Draft 4 pthreads */
14115         status = pthread_create( &t, pthread_attr_default, task, NULL );
14116         if( status ) return status;
14117
14118         if( detach ) {
14119                 /* give thread a chance to complete */
14120                 /* it should remain joinable and hence detachable */
14121                 sleep( 1 );
14122
14123                 status = pthread_detach( &t );
14124                 if( status ) return status;
14125         }
14126 #endif
14127
14128 #ifdef HAVE_LINUX_THREADS
14129         pthread_kill_other_threads_np();
14130 #endif
14131
14132         return 0;
14133
14134 }
14135
14136 EOF
14137 if { (eval echo configure:14138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14138 then
14139   ol_cv_pthread_lc_r=yes
14140 else
14141   echo "configure: failed program was:" >&5
14142   cat conftest.$ac_ext >&5
14143   rm -fr conftest*
14144   ol_cv_pthread_lc_r=no
14145 fi
14146 rm -fr conftest*
14147 fi
14148
14149
14150                 # restore the LIBS
14151                 LIBS="$ol_LIBS"
14152         
14153 fi
14154
14155 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
14156
14157         if test $ol_cv_pthread_lc_r = yes ; then
14158                 ol_link_pthreads="-lc_r"
14159                 ol_link_threads=posix
14160         fi
14161 fi
14162
14163
14164                 # Pthread try link: -threads (ol_cv_pthread_threads)
14165 if test "$ol_link_threads" = no ; then
14166         # try -threads
14167         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
14168 echo "configure:14169: checking for pthread link with -threads" >&5
14169 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
14170   echo $ac_n "(cached) $ac_c" 1>&6
14171 else
14172   
14173                 # save the flags
14174                 ol_LIBS="$LIBS"
14175                 LIBS="-threads $LIBS"
14176
14177                 if test "$cross_compiling" = yes; then
14178   cat > conftest.$ac_ext <<EOF
14179 #line 14180 "configure"
14180 #include "confdefs.h"
14181 /* pthread test headers */
14182 #include <pthread.h>
14183 #ifndef NULL
14184 #define NULL (void*)0
14185 #endif
14186
14187 static void *task(p)
14188         void *p;
14189 {
14190         return (void *) (p == NULL);
14191 }
14192
14193 int main() {
14194
14195         /* pthread test function */
14196         pthread_t t;
14197         int status;
14198         int detach = 1;
14199
14200 #ifdef HAVE_PTHREADS_FINAL
14201         /* Final pthreads */
14202         pthread_attr_t attr;
14203
14204         status = pthread_attr_init(&attr);
14205         if( status ) return status;
14206
14207 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
14208         if( !detach ) {
14209 #if defined( PTHREAD_CREATE_JOINABLE )
14210                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
14211 #else
14212                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
14213 #endif
14214
14215 #ifdef PTHREAD_CREATE_DETACHED
14216         } else {
14217                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
14218 #endif
14219         }
14220         if( status ) return status;
14221 #endif
14222
14223         status = pthread_create( &t, &attr, task, NULL );
14224         if( status ) return status;
14225
14226 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
14227         if( detach ) {
14228                 /* give thread a chance to complete */
14229                 /* it should remain joinable and hence detachable */
14230                 sleep( 1 );
14231
14232                 status = pthread_detach( t );
14233                 if( status ) return status;
14234         }
14235 #endif
14236
14237 #else
14238         /* Draft 4 pthreads */
14239         status = pthread_create( &t, pthread_attr_default, task, NULL );
14240         if( status ) return status;
14241
14242         if( detach ) {
14243                 /* give thread a chance to complete */
14244                 /* it should remain joinable and hence detachable */
14245                 sleep( 1 );
14246
14247                 status = pthread_detach( &t );
14248                 if( status ) return status;
14249         }
14250 #endif
14251
14252 #ifdef HAVE_LINUX_THREADS
14253         pthread_kill_other_threads_np();
14254 #endif
14255
14256         return 0;
14257
14258 ; return 0; }
14259 EOF
14260 if { (eval echo configure:14261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14261   rm -rf conftest*
14262   ol_cv_pthread_threads=yes
14263 else
14264   echo "configure: failed program was:" >&5
14265   cat conftest.$ac_ext >&5
14266   rm -rf conftest*
14267   ol_cv_pthread_threads=no
14268 fi
14269 rm -f conftest*
14270 else
14271   cat > conftest.$ac_ext <<EOF
14272 #line 14273 "configure"
14273 #include "confdefs.h"
14274 /* pthread test headers */
14275 #include <pthread.h>
14276 #ifndef NULL
14277 #define NULL (void*)0
14278 #endif
14279
14280 static void *task(p)
14281         void *p;
14282 {
14283         return (void *) (p == NULL);
14284 }
14285
14286
14287 int main(argc, argv)
14288         int argc;
14289         char **argv;
14290 {
14291
14292         /* pthread test function */
14293         pthread_t t;
14294         int status;
14295         int detach = 1;
14296
14297 #ifdef HAVE_PTHREADS_FINAL
14298         /* Final pthreads */
14299         pthread_attr_t attr;
14300
14301         status = pthread_attr_init(&attr);
14302         if( status ) return status;
14303
14304 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
14305         if( !detach ) {
14306 #if defined( PTHREAD_CREATE_JOINABLE )
14307                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
14308 #else
14309                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
14310 #endif
14311
14312 #ifdef PTHREAD_CREATE_DETACHED
14313         } else {
14314                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
14315 #endif
14316         }
14317         if( status ) return status;
14318 #endif
14319
14320         status = pthread_create( &t, &attr, task, NULL );
14321         if( status ) return status;
14322
14323 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
14324         if( detach ) {
14325                 /* give thread a chance to complete */
14326                 /* it should remain joinable and hence detachable */
14327                 sleep( 1 );
14328
14329                 status = pthread_detach( t );
14330                 if( status ) return status;
14331         }
14332 #endif
14333
14334 #else
14335         /* Draft 4 pthreads */
14336         status = pthread_create( &t, pthread_attr_default, task, NULL );
14337         if( status ) return status;
14338
14339         if( detach ) {
14340                 /* give thread a chance to complete */
14341                 /* it should remain joinable and hence detachable */
14342                 sleep( 1 );
14343
14344                 status = pthread_detach( &t );
14345                 if( status ) return status;
14346         }
14347 #endif
14348
14349 #ifdef HAVE_LINUX_THREADS
14350         pthread_kill_other_threads_np();
14351 #endif
14352
14353         return 0;
14354
14355 }
14356
14357 EOF
14358 if { (eval echo configure:14359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14359 then
14360   ol_cv_pthread_threads=yes
14361 else
14362   echo "configure: failed program was:" >&5
14363   cat conftest.$ac_ext >&5
14364   rm -fr conftest*
14365   ol_cv_pthread_threads=no
14366 fi
14367 rm -fr conftest*
14368 fi
14369
14370
14371                 # restore the LIBS
14372                 LIBS="$ol_LIBS"
14373         
14374 fi
14375
14376 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
14377
14378         if test $ol_cv_pthread_threads = yes ; then
14379                 ol_link_pthreads="-threads"
14380                 ol_link_threads=posix
14381         fi
14382 fi
14383
14384
14385                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
14386 if test "$ol_link_threads" = no ; then
14387         # try -lpthreads -lmach -lexc -lc_r
14388         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
14389 echo "configure:14390: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
14390 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
14391   echo $ac_n "(cached) $ac_c" 1>&6
14392 else
14393   
14394                 # save the flags
14395                 ol_LIBS="$LIBS"
14396                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
14397
14398                 if test "$cross_compiling" = yes; then
14399   cat > conftest.$ac_ext <<EOF
14400 #line 14401 "configure"
14401 #include "confdefs.h"
14402 /* pthread test headers */
14403 #include <pthread.h>
14404 #ifndef NULL
14405 #define NULL (void*)0
14406 #endif
14407
14408 static void *task(p)
14409         void *p;
14410 {
14411         return (void *) (p == NULL);
14412 }
14413
14414 int main() {
14415
14416         /* pthread test function */
14417         pthread_t t;
14418         int status;
14419         int detach = 1;
14420
14421 #ifdef HAVE_PTHREADS_FINAL
14422         /* Final pthreads */
14423         pthread_attr_t attr;
14424
14425         status = pthread_attr_init(&attr);
14426         if( status ) return status;
14427
14428 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
14429         if( !detach ) {
14430 #if defined( PTHREAD_CREATE_JOINABLE )
14431                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
14432 #else
14433                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
14434 #endif
14435
14436 #ifdef PTHREAD_CREATE_DETACHED
14437         } else {
14438                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
14439 #endif
14440         }
14441         if( status ) return status;
14442 #endif
14443
14444         status = pthread_create( &t, &attr, task, NULL );
14445         if( status ) return status;
14446
14447 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
14448         if( detach ) {
14449                 /* give thread a chance to complete */
14450                 /* it should remain joinable and hence detachable */
14451                 sleep( 1 );
14452
14453                 status = pthread_detach( t );
14454                 if( status ) return status;
14455         }
14456 #endif
14457
14458 #else
14459         /* Draft 4 pthreads */
14460         status = pthread_create( &t, pthread_attr_default, task, NULL );
14461         if( status ) return status;
14462
14463         if( detach ) {
14464                 /* give thread a chance to complete */
14465                 /* it should remain joinable and hence detachable */
14466                 sleep( 1 );
14467
14468                 status = pthread_detach( &t );
14469                 if( status ) return status;
14470         }
14471 #endif
14472
14473 #ifdef HAVE_LINUX_THREADS
14474         pthread_kill_other_threads_np();
14475 #endif
14476
14477         return 0;
14478
14479 ; return 0; }
14480 EOF
14481 if { (eval echo configure:14482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14482   rm -rf conftest*
14483   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
14484 else
14485   echo "configure: failed program was:" >&5
14486   cat conftest.$ac_ext >&5
14487   rm -rf conftest*
14488   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
14489 fi
14490 rm -f conftest*
14491 else
14492   cat > conftest.$ac_ext <<EOF
14493 #line 14494 "configure"
14494 #include "confdefs.h"
14495 /* pthread test headers */
14496 #include <pthread.h>
14497 #ifndef NULL
14498 #define NULL (void*)0
14499 #endif
14500
14501 static void *task(p)
14502         void *p;
14503 {
14504         return (void *) (p == NULL);
14505 }
14506
14507
14508 int main(argc, argv)
14509         int argc;
14510         char **argv;
14511 {
14512
14513         /* pthread test function */
14514         pthread_t t;
14515         int status;
14516         int detach = 1;
14517
14518 #ifdef HAVE_PTHREADS_FINAL
14519         /* Final pthreads */
14520         pthread_attr_t attr;
14521
14522         status = pthread_attr_init(&attr);
14523         if( status ) return status;
14524
14525 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
14526         if( !detach ) {
14527 #if defined( PTHREAD_CREATE_JOINABLE )
14528                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
14529 #else
14530                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
14531 #endif
14532
14533 #ifdef PTHREAD_CREATE_DETACHED
14534         } else {
14535                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
14536 #endif
14537         }
14538         if( status ) return status;
14539 #endif
14540
14541         status = pthread_create( &t, &attr, task, NULL );
14542         if( status ) return status;
14543
14544 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
14545         if( detach ) {
14546                 /* give thread a chance to complete */
14547                 /* it should remain joinable and hence detachable */
14548                 sleep( 1 );
14549
14550                 status = pthread_detach( t );
14551                 if( status ) return status;
14552         }
14553 #endif
14554
14555 #else
14556         /* Draft 4 pthreads */
14557         status = pthread_create( &t, pthread_attr_default, task, NULL );
14558         if( status ) return status;
14559
14560         if( detach ) {
14561                 /* give thread a chance to complete */
14562                 /* it should remain joinable and hence detachable */
14563                 sleep( 1 );
14564
14565                 status = pthread_detach( &t );
14566                 if( status ) return status;
14567         }
14568 #endif
14569
14570 #ifdef HAVE_LINUX_THREADS
14571         pthread_kill_other_threads_np();
14572 #endif
14573
14574         return 0;
14575
14576 }
14577
14578 EOF
14579 if { (eval echo configure:14580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14580 then
14581   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
14582 else
14583   echo "configure: failed program was:" >&5
14584   cat conftest.$ac_ext >&5
14585   rm -fr conftest*
14586   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
14587 fi
14588 rm -fr conftest*
14589 fi
14590
14591
14592                 # restore the LIBS
14593                 LIBS="$ol_LIBS"
14594         
14595 fi
14596
14597 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
14598
14599         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
14600                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
14601                 ol_link_threads=posix
14602         fi
14603 fi
14604
14605                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
14606 if test "$ol_link_threads" = no ; then
14607         # try -lpthreads -lmach -lexc
14608         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
14609 echo "configure:14610: checking for pthread link with -lpthreads -lmach -lexc" >&5
14610 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
14611   echo $ac_n "(cached) $ac_c" 1>&6
14612 else
14613   
14614                 # save the flags
14615                 ol_LIBS="$LIBS"
14616                 LIBS="-lpthreads -lmach -lexc $LIBS"
14617
14618                 if test "$cross_compiling" = yes; then
14619   cat > conftest.$ac_ext <<EOF
14620 #line 14621 "configure"
14621 #include "confdefs.h"
14622 /* pthread test headers */
14623 #include <pthread.h>
14624 #ifndef NULL
14625 #define NULL (void*)0
14626 #endif
14627
14628 static void *task(p)
14629         void *p;
14630 {
14631         return (void *) (p == NULL);
14632 }
14633
14634 int main() {
14635
14636         /* pthread test function */
14637         pthread_t t;
14638         int status;
14639         int detach = 1;
14640
14641 #ifdef HAVE_PTHREADS_FINAL
14642         /* Final pthreads */
14643         pthread_attr_t attr;
14644
14645         status = pthread_attr_init(&attr);
14646         if( status ) return status;
14647
14648 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
14649         if( !detach ) {
14650 #if defined( PTHREAD_CREATE_JOINABLE )
14651                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
14652 #else
14653                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
14654 #endif
14655
14656 #ifdef PTHREAD_CREATE_DETACHED
14657         } else {
14658                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
14659 #endif
14660         }
14661         if( status ) return status;
14662 #endif
14663
14664         status = pthread_create( &t, &attr, task, NULL );
14665         if( status ) return status;
14666
14667 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
14668         if( detach ) {
14669                 /* give thread a chance to complete */
14670                 /* it should remain joinable and hence detachable */
14671                 sleep( 1 );
14672
14673                 status = pthread_detach( t );
14674                 if( status ) return status;
14675         }
14676 #endif
14677
14678 #else
14679         /* Draft 4 pthreads */
14680         status = pthread_create( &t, pthread_attr_default, task, NULL );
14681         if( status ) return status;
14682
14683         if( detach ) {
14684                 /* give thread a chance to complete */
14685                 /* it should remain joinable and hence detachable */
14686                 sleep( 1 );
14687
14688                 status = pthread_detach( &t );
14689                 if( status ) return status;
14690         }
14691 #endif
14692
14693 #ifdef HAVE_LINUX_THREADS
14694         pthread_kill_other_threads_np();
14695 #endif
14696
14697         return 0;
14698
14699 ; return 0; }
14700 EOF
14701 if { (eval echo configure:14702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14702   rm -rf conftest*
14703   ol_cv_pthread_lpthreads_lmach_lexc=yes
14704 else
14705   echo "configure: failed program was:" >&5
14706   cat conftest.$ac_ext >&5
14707   rm -rf conftest*
14708   ol_cv_pthread_lpthreads_lmach_lexc=no
14709 fi
14710 rm -f conftest*
14711 else
14712   cat > conftest.$ac_ext <<EOF
14713 #line 14714 "configure"
14714 #include "confdefs.h"
14715 /* pthread test headers */
14716 #include <pthread.h>
14717 #ifndef NULL
14718 #define NULL (void*)0
14719 #endif
14720
14721 static void *task(p)
14722         void *p;
14723 {
14724         return (void *) (p == NULL);
14725 }
14726
14727
14728 int main(argc, argv)
14729         int argc;
14730         char **argv;
14731 {
14732
14733         /* pthread test function */
14734         pthread_t t;
14735         int status;
14736         int detach = 1;
14737
14738 #ifdef HAVE_PTHREADS_FINAL
14739         /* Final pthreads */
14740         pthread_attr_t attr;
14741
14742         status = pthread_attr_init(&attr);
14743         if( status ) return status;
14744
14745 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
14746         if( !detach ) {
14747 #if defined( PTHREAD_CREATE_JOINABLE )
14748                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
14749 #else
14750                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
14751 #endif
14752
14753 #ifdef PTHREAD_CREATE_DETACHED
14754         } else {
14755                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
14756 #endif
14757         }
14758         if( status ) return status;
14759 #endif
14760
14761         status = pthread_create( &t, &attr, task, NULL );
14762         if( status ) return status;
14763
14764 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
14765         if( detach ) {
14766                 /* give thread a chance to complete */
14767                 /* it should remain joinable and hence detachable */
14768                 sleep( 1 );
14769
14770                 status = pthread_detach( t );
14771                 if( status ) return status;
14772         }
14773 #endif
14774
14775 #else
14776         /* Draft 4 pthreads */
14777         status = pthread_create( &t, pthread_attr_default, task, NULL );
14778         if( status ) return status;
14779
14780         if( detach ) {
14781                 /* give thread a chance to complete */
14782                 /* it should remain joinable and hence detachable */
14783                 sleep( 1 );
14784
14785                 status = pthread_detach( &t );
14786                 if( status ) return status;
14787         }
14788 #endif
14789
14790 #ifdef HAVE_LINUX_THREADS
14791         pthread_kill_other_threads_np();
14792 #endif
14793
14794         return 0;
14795
14796 }
14797
14798 EOF
14799 if { (eval echo configure:14800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14800 then
14801   ol_cv_pthread_lpthreads_lmach_lexc=yes
14802 else
14803   echo "configure: failed program was:" >&5
14804   cat conftest.$ac_ext >&5
14805   rm -fr conftest*
14806   ol_cv_pthread_lpthreads_lmach_lexc=no
14807 fi
14808 rm -fr conftest*
14809 fi
14810
14811
14812                 # restore the LIBS
14813                 LIBS="$ol_LIBS"
14814         
14815 fi
14816
14817 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
14818
14819         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
14820                 ol_link_pthreads="-lpthreads -lmach -lexc"
14821                 ol_link_threads=posix
14822         fi
14823 fi
14824
14825                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
14826 if test "$ol_link_threads" = no ; then
14827         # try -lpthreads -lexc
14828         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
14829 echo "configure:14830: checking for pthread link with -lpthreads -lexc" >&5
14830 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
14831   echo $ac_n "(cached) $ac_c" 1>&6
14832 else
14833   
14834                 # save the flags
14835                 ol_LIBS="$LIBS"
14836                 LIBS="-lpthreads -lexc $LIBS"
14837
14838                 if test "$cross_compiling" = yes; then
14839   cat > conftest.$ac_ext <<EOF
14840 #line 14841 "configure"
14841 #include "confdefs.h"
14842 /* pthread test headers */
14843 #include <pthread.h>
14844 #ifndef NULL
14845 #define NULL (void*)0
14846 #endif
14847
14848 static void *task(p)
14849         void *p;
14850 {
14851         return (void *) (p == NULL);
14852 }
14853
14854 int main() {
14855
14856         /* pthread test function */
14857         pthread_t t;
14858         int status;
14859         int detach = 1;
14860
14861 #ifdef HAVE_PTHREADS_FINAL
14862         /* Final pthreads */
14863         pthread_attr_t attr;
14864
14865         status = pthread_attr_init(&attr);
14866         if( status ) return status;
14867
14868 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
14869         if( !detach ) {
14870 #if defined( PTHREAD_CREATE_JOINABLE )
14871                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
14872 #else
14873                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
14874 #endif
14875
14876 #ifdef PTHREAD_CREATE_DETACHED
14877         } else {
14878                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
14879 #endif
14880         }
14881         if( status ) return status;
14882 #endif
14883
14884         status = pthread_create( &t, &attr, task, NULL );
14885         if( status ) return status;
14886
14887 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
14888         if( detach ) {
14889                 /* give thread a chance to complete */
14890                 /* it should remain joinable and hence detachable */
14891                 sleep( 1 );
14892
14893                 status = pthread_detach( t );
14894                 if( status ) return status;
14895         }
14896 #endif
14897
14898 #else
14899         /* Draft 4 pthreads */
14900         status = pthread_create( &t, pthread_attr_default, task, NULL );
14901         if( status ) return status;
14902
14903         if( detach ) {
14904                 /* give thread a chance to complete */
14905                 /* it should remain joinable and hence detachable */
14906                 sleep( 1 );
14907
14908                 status = pthread_detach( &t );
14909                 if( status ) return status;
14910         }
14911 #endif
14912
14913 #ifdef HAVE_LINUX_THREADS
14914         pthread_kill_other_threads_np();
14915 #endif
14916
14917         return 0;
14918
14919 ; return 0; }
14920 EOF
14921 if { (eval echo configure:14922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14922   rm -rf conftest*
14923   ol_cv_pthread_lpthreads_lexc=yes
14924 else
14925   echo "configure: failed program was:" >&5
14926   cat conftest.$ac_ext >&5
14927   rm -rf conftest*
14928   ol_cv_pthread_lpthreads_lexc=no
14929 fi
14930 rm -f conftest*
14931 else
14932   cat > conftest.$ac_ext <<EOF
14933 #line 14934 "configure"
14934 #include "confdefs.h"
14935 /* pthread test headers */
14936 #include <pthread.h>
14937 #ifndef NULL
14938 #define NULL (void*)0
14939 #endif
14940
14941 static void *task(p)
14942         void *p;
14943 {
14944         return (void *) (p == NULL);
14945 }
14946
14947
14948 int main(argc, argv)
14949         int argc;
14950         char **argv;
14951 {
14952
14953         /* pthread test function */
14954         pthread_t t;
14955         int status;
14956         int detach = 1;
14957
14958 #ifdef HAVE_PTHREADS_FINAL
14959         /* Final pthreads */
14960         pthread_attr_t attr;
14961
14962         status = pthread_attr_init(&attr);
14963         if( status ) return status;
14964
14965 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
14966         if( !detach ) {
14967 #if defined( PTHREAD_CREATE_JOINABLE )
14968                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
14969 #else
14970                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
14971 #endif
14972
14973 #ifdef PTHREAD_CREATE_DETACHED
14974         } else {
14975                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
14976 #endif
14977         }
14978         if( status ) return status;
14979 #endif
14980
14981         status = pthread_create( &t, &attr, task, NULL );
14982         if( status ) return status;
14983
14984 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
14985         if( detach ) {
14986                 /* give thread a chance to complete */
14987                 /* it should remain joinable and hence detachable */
14988                 sleep( 1 );
14989
14990                 status = pthread_detach( t );
14991                 if( status ) return status;
14992         }
14993 #endif
14994
14995 #else
14996         /* Draft 4 pthreads */
14997         status = pthread_create( &t, pthread_attr_default, task, NULL );
14998         if( status ) return status;
14999
15000         if( detach ) {
15001                 /* give thread a chance to complete */
15002                 /* it should remain joinable and hence detachable */
15003                 sleep( 1 );
15004
15005                 status = pthread_detach( &t );
15006                 if( status ) return status;
15007         }
15008 #endif
15009
15010 #ifdef HAVE_LINUX_THREADS
15011         pthread_kill_other_threads_np();
15012 #endif
15013
15014         return 0;
15015
15016 }
15017
15018 EOF
15019 if { (eval echo configure:15020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15020 then
15021   ol_cv_pthread_lpthreads_lexc=yes
15022 else
15023   echo "configure: failed program was:" >&5
15024   cat conftest.$ac_ext >&5
15025   rm -fr conftest*
15026   ol_cv_pthread_lpthreads_lexc=no
15027 fi
15028 rm -fr conftest*
15029 fi
15030
15031
15032                 # restore the LIBS
15033                 LIBS="$ol_LIBS"
15034         
15035 fi
15036
15037 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
15038
15039         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
15040                 ol_link_pthreads="-lpthreads -lexc"
15041                 ol_link_threads=posix
15042         fi
15043 fi
15044
15045
15046                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
15047 if test "$ol_link_threads" = no ; then
15048         # try -lpthreads
15049         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
15050 echo "configure:15051: checking for pthread link with -lpthreads" >&5
15051 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
15052   echo $ac_n "(cached) $ac_c" 1>&6
15053 else
15054   
15055                 # save the flags
15056                 ol_LIBS="$LIBS"
15057                 LIBS="-lpthreads $LIBS"
15058
15059                 if test "$cross_compiling" = yes; then
15060   cat > conftest.$ac_ext <<EOF
15061 #line 15062 "configure"
15062 #include "confdefs.h"
15063 /* pthread test headers */
15064 #include <pthread.h>
15065 #ifndef NULL
15066 #define NULL (void*)0
15067 #endif
15068
15069 static void *task(p)
15070         void *p;
15071 {
15072         return (void *) (p == NULL);
15073 }
15074
15075 int main() {
15076
15077         /* pthread test function */
15078         pthread_t t;
15079         int status;
15080         int detach = 1;
15081
15082 #ifdef HAVE_PTHREADS_FINAL
15083         /* Final pthreads */
15084         pthread_attr_t attr;
15085
15086         status = pthread_attr_init(&attr);
15087         if( status ) return status;
15088
15089 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
15090         if( !detach ) {
15091 #if defined( PTHREAD_CREATE_JOINABLE )
15092                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
15093 #else
15094                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
15095 #endif
15096
15097 #ifdef PTHREAD_CREATE_DETACHED
15098         } else {
15099                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
15100 #endif
15101         }
15102         if( status ) return status;
15103 #endif
15104
15105         status = pthread_create( &t, &attr, task, NULL );
15106         if( status ) return status;
15107
15108 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
15109         if( detach ) {
15110                 /* give thread a chance to complete */
15111                 /* it should remain joinable and hence detachable */
15112                 sleep( 1 );
15113
15114                 status = pthread_detach( t );
15115                 if( status ) return status;
15116         }
15117 #endif
15118
15119 #else
15120         /* Draft 4 pthreads */
15121         status = pthread_create( &t, pthread_attr_default, task, NULL );
15122         if( status ) return status;
15123
15124         if( detach ) {
15125                 /* give thread a chance to complete */
15126                 /* it should remain joinable and hence detachable */
15127                 sleep( 1 );
15128
15129                 status = pthread_detach( &t );
15130                 if( status ) return status;
15131         }
15132 #endif
15133
15134 #ifdef HAVE_LINUX_THREADS
15135         pthread_kill_other_threads_np();
15136 #endif
15137
15138         return 0;
15139
15140 ; return 0; }
15141 EOF
15142 if { (eval echo configure:15143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15143   rm -rf conftest*
15144   ol_cv_pthread_lib_lpthreads=yes
15145 else
15146   echo "configure: failed program was:" >&5
15147   cat conftest.$ac_ext >&5
15148   rm -rf conftest*
15149   ol_cv_pthread_lib_lpthreads=no
15150 fi
15151 rm -f conftest*
15152 else
15153   cat > conftest.$ac_ext <<EOF
15154 #line 15155 "configure"
15155 #include "confdefs.h"
15156 /* pthread test headers */
15157 #include <pthread.h>
15158 #ifndef NULL
15159 #define NULL (void*)0
15160 #endif
15161
15162 static void *task(p)
15163         void *p;
15164 {
15165         return (void *) (p == NULL);
15166 }
15167
15168
15169 int main(argc, argv)
15170         int argc;
15171         char **argv;
15172 {
15173
15174         /* pthread test function */
15175         pthread_t t;
15176         int status;
15177         int detach = 1;
15178
15179 #ifdef HAVE_PTHREADS_FINAL
15180         /* Final pthreads */
15181         pthread_attr_t attr;
15182
15183         status = pthread_attr_init(&attr);
15184         if( status ) return status;
15185
15186 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
15187         if( !detach ) {
15188 #if defined( PTHREAD_CREATE_JOINABLE )
15189                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
15190 #else
15191                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
15192 #endif
15193
15194 #ifdef PTHREAD_CREATE_DETACHED
15195         } else {
15196                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
15197 #endif
15198         }
15199         if( status ) return status;
15200 #endif
15201
15202         status = pthread_create( &t, &attr, task, NULL );
15203         if( status ) return status;
15204
15205 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
15206         if( detach ) {
15207                 /* give thread a chance to complete */
15208                 /* it should remain joinable and hence detachable */
15209                 sleep( 1 );
15210
15211                 status = pthread_detach( t );
15212                 if( status ) return status;
15213         }
15214 #endif
15215
15216 #else
15217         /* Draft 4 pthreads */
15218         status = pthread_create( &t, pthread_attr_default, task, NULL );
15219         if( status ) return status;
15220
15221         if( detach ) {
15222                 /* give thread a chance to complete */
15223                 /* it should remain joinable and hence detachable */
15224                 sleep( 1 );
15225
15226                 status = pthread_detach( &t );
15227                 if( status ) return status;
15228         }
15229 #endif
15230
15231 #ifdef HAVE_LINUX_THREADS
15232         pthread_kill_other_threads_np();
15233 #endif
15234
15235         return 0;
15236
15237 }
15238
15239 EOF
15240 if { (eval echo configure:15241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15241 then
15242   ol_cv_pthread_lib_lpthreads=yes
15243 else
15244   echo "configure: failed program was:" >&5
15245   cat conftest.$ac_ext >&5
15246   rm -fr conftest*
15247   ol_cv_pthread_lib_lpthreads=no
15248 fi
15249 rm -fr conftest*
15250 fi
15251
15252
15253                 # restore the LIBS
15254                 LIBS="$ol_LIBS"
15255         
15256 fi
15257
15258 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
15259
15260         if test $ol_cv_pthread_lib_lpthreads = yes ; then
15261                 ol_link_pthreads="-lpthreads"
15262                 ol_link_threads=posix
15263         fi
15264 fi
15265
15266
15267                 if test $ol_link_threads != no ; then
15268                         cat >> confdefs.h <<\EOF
15269 #define HAVE_PTHREADS 1
15270 EOF
15271
15272
15273                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
15274
15275                                                 save_CPPFLAGS="$CPPFLAGS"
15276                         save_LIBS="$LIBS"
15277                         LIBS="$LTHREAD_LIBS $LIBS"
15278
15279                                                                                                 for ac_func in sched_yield pthread_yield
15280 do
15281 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15282 echo "configure:15283: checking for $ac_func" >&5
15283 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15284   echo $ac_n "(cached) $ac_c" 1>&6
15285 else
15286   cat > conftest.$ac_ext <<EOF
15287 #line 15288 "configure"
15288 #include "confdefs.h"
15289 /* System header to define __stub macros and hopefully few prototypes,
15290     which can conflict with char $ac_func(); below.  */
15291 #include <assert.h>
15292 /* Override any gcc2 internal prototype to avoid an error.  */
15293 /* We use char because int might match the return type of a gcc2
15294     builtin and then its argument prototype would still apply.  */
15295 char $ac_func();
15296 char (*f)();
15297
15298 int main() {
15299
15300 /* The GNU C library defines this for functions which it implements
15301     to always fail with ENOSYS.  Some functions are actually named
15302     something starting with __ and the normal name is an alias.  */
15303 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15304 choke me
15305 #else
15306 f = $ac_func;
15307 #endif
15308
15309 ; return 0; }
15310 EOF
15311 if { (eval echo configure:15312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15312   rm -rf conftest*
15313   eval "ac_cv_func_$ac_func=yes"
15314 else
15315   echo "configure: failed program was:" >&5
15316   cat conftest.$ac_ext >&5
15317   rm -rf conftest*
15318   eval "ac_cv_func_$ac_func=no"
15319 fi
15320 rm -f conftest*
15321 fi
15322
15323 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15324   echo "$ac_t""yes" 1>&6
15325     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15326   cat >> confdefs.h <<EOF
15327 #define $ac_tr_func 1
15328 EOF
15329  
15330 else
15331   echo "$ac_t""no" 1>&6
15332 fi
15333 done
15334
15335
15336                         if test $ac_cv_func_sched_yield = no -a \
15337                                 $ac_cv_func_pthread_yield = no ; then
15338                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
15339 echo "configure:15340: checking for sched_yield in -lrt" >&5
15340 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
15341 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15342   echo $ac_n "(cached) $ac_c" 1>&6
15343 else
15344   ac_save_LIBS="$LIBS"
15345 LIBS="-lrt  $LIBS"
15346 cat > conftest.$ac_ext <<EOF
15347 #line 15348 "configure"
15348 #include "confdefs.h"
15349 /* Override any gcc2 internal prototype to avoid an error.  */
15350 /* We use char because int might match the return type of a gcc2
15351     builtin and then its argument prototype would still apply.  */
15352 char sched_yield();
15353
15354 int main() {
15355 sched_yield()
15356 ; return 0; }
15357 EOF
15358 if { (eval echo configure:15359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15359   rm -rf conftest*
15360   eval "ac_cv_lib_$ac_lib_var=yes"
15361 else
15362   echo "configure: failed program was:" >&5
15363   cat conftest.$ac_ext >&5
15364   rm -rf conftest*
15365   eval "ac_cv_lib_$ac_lib_var=no"
15366 fi
15367 rm -f conftest*
15368 LIBS="$ac_save_LIBS"
15369
15370 fi
15371 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15372   echo "$ac_t""yes" 1>&6
15373   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
15374                                         cat >> confdefs.h <<\EOF
15375 #define HAVE_SCHED_YIELD 1
15376 EOF
15377
15378                                         ac_cv_func_sched_yield=yes
15379 else
15380   echo "$ac_t""no" 1>&6
15381 ac_cv_func_sched_yield=no
15382 fi
15383
15384                         fi
15385                         if test $ac_cv_func_sched_yield = no -a \
15386                                 $ac_cv_func_pthread_yield = no ; then
15387                                                                                                 for ac_func in thr_yield
15388 do
15389 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15390 echo "configure:15391: checking for $ac_func" >&5
15391 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15392   echo $ac_n "(cached) $ac_c" 1>&6
15393 else
15394   cat > conftest.$ac_ext <<EOF
15395 #line 15396 "configure"
15396 #include "confdefs.h"
15397 /* System header to define __stub macros and hopefully few prototypes,
15398     which can conflict with char $ac_func(); below.  */
15399 #include <assert.h>
15400 /* Override any gcc2 internal prototype to avoid an error.  */
15401 /* We use char because int might match the return type of a gcc2
15402     builtin and then its argument prototype would still apply.  */
15403 char $ac_func();
15404 char (*f)();
15405
15406 int main() {
15407
15408 /* The GNU C library defines this for functions which it implements
15409     to always fail with ENOSYS.  Some functions are actually named
15410     something starting with __ and the normal name is an alias.  */
15411 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15412 choke me
15413 #else
15414 f = $ac_func;
15415 #endif
15416
15417 ; return 0; }
15418 EOF
15419 if { (eval echo configure:15420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15420   rm -rf conftest*
15421   eval "ac_cv_func_$ac_func=yes"
15422 else
15423   echo "configure: failed program was:" >&5
15424   cat conftest.$ac_ext >&5
15425   rm -rf conftest*
15426   eval "ac_cv_func_$ac_func=no"
15427 fi
15428 rm -f conftest*
15429 fi
15430
15431 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15432   echo "$ac_t""yes" 1>&6
15433     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15434   cat >> confdefs.h <<EOF
15435 #define $ac_tr_func 1
15436 EOF
15437  
15438 else
15439   echo "$ac_t""no" 1>&6
15440 fi
15441 done
15442
15443                         fi
15444                         if test $ac_cv_func_sched_yield = no -a \
15445                                 $ac_cv_func_pthread_yield = no -a \
15446                                 "$ac_cv_func_thr_yield" = no ; then
15447                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
15448                         fi
15449
15450                                                 for ac_func in pthread_kill pthread_rwlock_destroy
15451 do
15452 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15453 echo "configure:15454: checking for $ac_func" >&5
15454 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15455   echo $ac_n "(cached) $ac_c" 1>&6
15456 else
15457   cat > conftest.$ac_ext <<EOF
15458 #line 15459 "configure"
15459 #include "confdefs.h"
15460 /* System header to define __stub macros and hopefully few prototypes,
15461     which can conflict with char $ac_func(); below.  */
15462 #include <assert.h>
15463 /* Override any gcc2 internal prototype to avoid an error.  */
15464 /* We use char because int might match the return type of a gcc2
15465     builtin and then its argument prototype would still apply.  */
15466 char $ac_func();
15467 char (*f)();
15468
15469 int main() {
15470
15471 /* The GNU C library defines this for functions which it implements
15472     to always fail with ENOSYS.  Some functions are actually named
15473     something starting with __ and the normal name is an alias.  */
15474 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15475 choke me
15476 #else
15477 f = $ac_func;
15478 #endif
15479
15480 ; return 0; }
15481 EOF
15482 if { (eval echo configure:15483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15483   rm -rf conftest*
15484   eval "ac_cv_func_$ac_func=yes"
15485 else
15486   echo "configure: failed program was:" >&5
15487   cat conftest.$ac_ext >&5
15488   rm -rf conftest*
15489   eval "ac_cv_func_$ac_func=no"
15490 fi
15491 rm -f conftest*
15492 fi
15493
15494 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15495   echo "$ac_t""yes" 1>&6
15496     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15497   cat >> confdefs.h <<EOF
15498 #define $ac_tr_func 1
15499 EOF
15500  
15501 else
15502   echo "$ac_t""no" 1>&6
15503 fi
15504 done
15505
15506
15507                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
15508 echo "configure:15509: checking for pthread_detach with <pthread.h>" >&5
15509 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
15510   echo $ac_n "(cached) $ac_c" 1>&6
15511 else
15512   
15513                                                                 cat > conftest.$ac_ext <<EOF
15514 #line 15515 "configure"
15515 #include "confdefs.h"
15516
15517 #include <pthread.h>
15518 #ifndef NULL
15519 #define NULL (void*)0
15520 #endif
15521
15522 int main() {
15523 pthread_detach(NULL);
15524 ; return 0; }
15525 EOF
15526 if { (eval echo configure:15527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15527   rm -rf conftest*
15528   ol_cv_func_pthread_detach=yes
15529 else
15530   echo "configure: failed program was:" >&5
15531   cat conftest.$ac_ext >&5
15532   rm -rf conftest*
15533   ol_cv_func_pthread_detach=no
15534 fi
15535 rm -f conftest*
15536                         
15537 fi
15538
15539 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
15540
15541                         if test $ol_cv_func_pthread_detach = no ; then
15542                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
15543                         fi
15544
15545                         cat >> confdefs.h <<\EOF
15546 #define HAVE_PTHREAD_DETACH 1
15547 EOF
15548
15549
15550                                                 for ac_func in \
15551                                 pthread_setconcurrency \
15552                                 pthread_getconcurrency \
15553                                 thr_setconcurrency \
15554                                 thr_getconcurrency \
15555                         
15556 do
15557 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15558 echo "configure:15559: checking for $ac_func" >&5
15559 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15560   echo $ac_n "(cached) $ac_c" 1>&6
15561 else
15562   cat > conftest.$ac_ext <<EOF
15563 #line 15564 "configure"
15564 #include "confdefs.h"
15565 /* System header to define __stub macros and hopefully few prototypes,
15566     which can conflict with char $ac_func(); below.  */
15567 #include <assert.h>
15568 /* Override any gcc2 internal prototype to avoid an error.  */
15569 /* We use char because int might match the return type of a gcc2
15570     builtin and then its argument prototype would still apply.  */
15571 char $ac_func();
15572 char (*f)();
15573
15574 int main() {
15575
15576 /* The GNU C library defines this for functions which it implements
15577     to always fail with ENOSYS.  Some functions are actually named
15578     something starting with __ and the normal name is an alias.  */
15579 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15580 choke me
15581 #else
15582 f = $ac_func;
15583 #endif
15584
15585 ; return 0; }
15586 EOF
15587 if { (eval echo configure:15588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15588   rm -rf conftest*
15589   eval "ac_cv_func_$ac_func=yes"
15590 else
15591   echo "configure: failed program was:" >&5
15592   cat conftest.$ac_ext >&5
15593   rm -rf conftest*
15594   eval "ac_cv_func_$ac_func=no"
15595 fi
15596 rm -f conftest*
15597 fi
15598
15599 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15600   echo "$ac_t""yes" 1>&6
15601     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15602   cat >> confdefs.h <<EOF
15603 #define $ac_tr_func 1
15604 EOF
15605  
15606 else
15607   echo "$ac_t""no" 1>&6
15608 fi
15609 done
15610
15611
15612                         
15613         for ac_func in pthread_kill_other_threads_np
15614 do
15615 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15616 echo "configure:15617: checking for $ac_func" >&5
15617 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15618   echo $ac_n "(cached) $ac_c" 1>&6
15619 else
15620   cat > conftest.$ac_ext <<EOF
15621 #line 15622 "configure"
15622 #include "confdefs.h"
15623 /* System header to define __stub macros and hopefully few prototypes,
15624     which can conflict with char $ac_func(); below.  */
15625 #include <assert.h>
15626 /* Override any gcc2 internal prototype to avoid an error.  */
15627 /* We use char because int might match the return type of a gcc2
15628     builtin and then its argument prototype would still apply.  */
15629 char $ac_func();
15630 char (*f)();
15631
15632 int main() {
15633
15634 /* The GNU C library defines this for functions which it implements
15635     to always fail with ENOSYS.  Some functions are actually named
15636     something starting with __ and the normal name is an alias.  */
15637 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15638 choke me
15639 #else
15640 f = $ac_func;
15641 #endif
15642
15643 ; return 0; }
15644 EOF
15645 if { (eval echo configure:15646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15646   rm -rf conftest*
15647   eval "ac_cv_func_$ac_func=yes"
15648 else
15649   echo "configure: failed program was:" >&5
15650   cat conftest.$ac_ext >&5
15651   rm -rf conftest*
15652   eval "ac_cv_func_$ac_func=no"
15653 fi
15654 rm -f conftest*
15655 fi
15656
15657 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15658   echo "$ac_t""yes" 1>&6
15659     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15660   cat >> confdefs.h <<EOF
15661 #define $ac_tr_func 1
15662 EOF
15663  
15664 else
15665   echo "$ac_t""no" 1>&6
15666 fi
15667 done
15668
15669         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
15670 echo "configure:15671: checking for LinuxThreads implementation" >&5
15671 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
15672   echo $ac_n "(cached) $ac_c" 1>&6
15673 else
15674   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
15675 fi
15676
15677 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
15678
15679                         
15680         
15681         
15682         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
15683 echo "configure:15684: checking for LinuxThreads consistency" >&5
15684 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
15685   echo $ac_n "(cached) $ac_c" 1>&6
15686 else
15687   
15688                 if test $ol_cv_header_linux_threads = yes -a \
15689                         $ol_cv_sys_linux_threads = yes; then
15690                         ol_cv_linux_threads=yes
15691                 elif test $ol_cv_header_linux_threads = no -a \
15692                         $ol_cv_sys_linux_threads = no; then
15693                         ol_cv_linux_threads=no
15694                 else
15695                         ol_cv_linux_threads=error
15696                 fi
15697         
15698 fi
15699
15700 echo "$ac_t""$ol_cv_linux_threads" 1>&6
15701
15702
15703                         if test $ol_cv_linux_threads = error; then
15704                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
15705                         fi
15706
15707                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
15708 echo "configure:15709: checking if pthread_create() works" >&5
15709 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
15710   echo $ac_n "(cached) $ac_c" 1>&6
15711 else
15712   
15713                         if test "$cross_compiling" = yes; then
15714                                 ol_cv_pthread_create_works=yes
15715 else
15716   cat > conftest.$ac_ext <<EOF
15717 #line 15718 "configure"
15718 #include "confdefs.h"
15719 /* pthread test headers */
15720 #include <pthread.h>
15721 #ifndef NULL
15722 #define NULL (void*)0
15723 #endif
15724
15725 static void *task(p)
15726         void *p;
15727 {
15728         return (void *) (p == NULL);
15729 }
15730
15731
15732 int main(argc, argv)
15733         int argc;
15734         char **argv;
15735 {
15736
15737         /* pthread test function */
15738         pthread_t t;
15739         int status;
15740         int detach = 1;
15741
15742 #ifdef HAVE_PTHREADS_FINAL
15743         /* Final pthreads */
15744         pthread_attr_t attr;
15745
15746         status = pthread_attr_init(&attr);
15747         if( status ) return status;
15748
15749 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
15750         if( !detach ) {
15751 #if defined( PTHREAD_CREATE_JOINABLE )
15752                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
15753 #else
15754                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
15755 #endif
15756
15757 #ifdef PTHREAD_CREATE_DETACHED
15758         } else {
15759                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
15760 #endif
15761         }
15762         if( status ) return status;
15763 #endif
15764
15765         status = pthread_create( &t, &attr, task, NULL );
15766         if( status ) return status;
15767
15768 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
15769         if( detach ) {
15770                 /* give thread a chance to complete */
15771                 /* it should remain joinable and hence detachable */
15772                 sleep( 1 );
15773
15774                 status = pthread_detach( t );
15775                 if( status ) return status;
15776         }
15777 #endif
15778
15779 #else
15780         /* Draft 4 pthreads */
15781         status = pthread_create( &t, pthread_attr_default, task, NULL );
15782         if( status ) return status;
15783
15784         if( detach ) {
15785                 /* give thread a chance to complete */
15786                 /* it should remain joinable and hence detachable */
15787                 sleep( 1 );
15788
15789                 status = pthread_detach( &t );
15790                 if( status ) return status;
15791         }
15792 #endif
15793
15794 #ifdef HAVE_LINUX_THREADS
15795         pthread_kill_other_threads_np();
15796 #endif
15797
15798         return 0;
15799
15800 }
15801
15802 EOF
15803 if { (eval echo configure:15804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15804 then
15805   ol_cv_pthread_create_works=yes
15806 else
15807   echo "configure: failed program was:" >&5
15808   cat conftest.$ac_ext >&5
15809   rm -fr conftest*
15810   ol_cv_pthread_create_works=no
15811 fi
15812 rm -fr conftest*
15813 fi
15814
15815 fi
15816
15817 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
15818
15819                         if test $ol_cv_pthread_create_works = no ; then
15820                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
15821                         fi
15822
15823                                                 if test $ol_with_yielding_select = auto ; then
15824                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
15825 echo "configure:15826: checking if select yields when using pthreads" >&5
15826 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
15827   echo $ac_n "(cached) $ac_c" 1>&6
15828 else
15829   
15830                                 if test "$cross_compiling" = yes; then
15831   ol_cv_pthread_select_yields=cross
15832 else
15833   cat > conftest.$ac_ext <<EOF
15834 #line 15835 "configure"
15835 #include "confdefs.h"
15836
15837 #include <sys/types.h>
15838 #include <sys/time.h>
15839 #include <unistd.h>
15840 #include <pthread.h>
15841 #ifndef NULL
15842 #define NULL (void*) 0
15843 #endif
15844
15845 static int fildes[2];
15846
15847 static void *task(p)
15848         void *p;
15849 {
15850         int i;
15851         struct timeval tv;
15852
15853         fd_set rfds;
15854
15855         tv.tv_sec=10;
15856         tv.tv_usec=0;
15857
15858         FD_ZERO(&rfds);
15859         FD_SET(fildes[0], &rfds);
15860
15861         /* we're not interested in any fds */
15862         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
15863
15864         if(i < 0) {
15865                 perror("select");
15866                 exit(10);
15867         }
15868
15869         exit(0); /* if we exit here, the select blocked the whole process */
15870 }
15871
15872 int main(argc, argv)
15873         int argc;
15874         char **argv;
15875 {
15876         pthread_t t;
15877
15878         /* create a pipe to select */
15879         if(pipe(&fildes[0])) {
15880                 perror("select");
15881                 exit(1);
15882         }
15883
15884 #ifdef HAVE_PTHREAD_SETCONCURRENCY
15885         (void) pthread_setconcurrency(2);
15886 #else
15887 #ifdef HAVE_THR_SETCONCURRENCY
15888         /* Set Solaris LWP concurrency to 2 */
15889         thr_setconcurrency(2);
15890 #endif
15891 #endif
15892
15893 #if HAVE_PTHREADS_D4
15894         pthread_create(&t, pthread_attr_default, task, NULL);
15895 #else
15896         pthread_create(&t, NULL, task, NULL);
15897 #endif
15898
15899 #if HAVE_SCHED_YIELD
15900         sched_yield();  /* make sure task runs first */
15901 #else
15902 #ifdef HAVE_PTHREAD_YIELD
15903         pthread_yield();        /* make sure task runs first */
15904 #endif
15905 #endif
15906
15907         exit(2);
15908 }
15909 EOF
15910 if { (eval echo configure:15911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15911 then
15912   ol_cv_pthread_select_yields=no
15913 else
15914   echo "configure: failed program was:" >&5
15915   cat conftest.$ac_ext >&5
15916   rm -fr conftest*
15917   ol_cv_pthread_select_yields=yes
15918 fi
15919 rm -fr conftest*
15920 fi
15921
15922 fi
15923
15924 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
15925
15926                                 if test $ol_cv_pthread_select_yields = cross ; then
15927                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
15928                                 fi
15929
15930                                 if test $ol_cv_pthread_select_yields = yes ; then
15931                                         ol_with_yielding_select=yes
15932                                 fi
15933                         fi
15934
15935                                                 CPPFLAGS="$save_CPPFLAGS"
15936                         LIBS="$save_LIBS"
15937                 else
15938                         { echo "configure: error: could not locate usable POSIX Threads" 1>&2; exit 1; }
15939                 fi
15940         fi
15941
15942         if test $ol_with_threads = posix ; then
15943                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
15944         fi
15945 fi
15946
15947 if test $ol_with_threads = auto -o $ol_with_threads = yes \
15948         -o $ol_with_threads = mach ; then
15949
15950                 for ac_hdr in mach/cthreads.h cthreads.h
15951 do
15952 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15953 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15954 echo "configure:15955: checking for $ac_hdr" >&5
15955 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15956   echo $ac_n "(cached) $ac_c" 1>&6
15957 else
15958   cat > conftest.$ac_ext <<EOF
15959 #line 15960 "configure"
15960 #include "confdefs.h"
15961 #include <$ac_hdr>
15962 EOF
15963 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15964 { (eval echo configure:15965: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15965 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15966 if test -z "$ac_err"; then
15967   rm -rf conftest*
15968   eval "ac_cv_header_$ac_safe=yes"
15969 else
15970   echo "$ac_err" >&5
15971   echo "configure: failed program was:" >&5
15972   cat conftest.$ac_ext >&5
15973   rm -rf conftest*
15974   eval "ac_cv_header_$ac_safe=no"
15975 fi
15976 rm -f conftest*
15977 fi
15978 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15979   echo "$ac_t""yes" 1>&6
15980     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15981   cat >> confdefs.h <<EOF
15982 #define $ac_tr_hdr 1
15983 EOF
15984  
15985 else
15986   echo "$ac_t""no" 1>&6
15987 fi
15988 done
15989
15990         if test $ac_cv_header_mach_cthreads_h = yes ; then
15991                 ol_with_threads=found
15992
15993                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
15994 echo "configure:15995: checking for cthread_fork" >&5
15995 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
15996   echo $ac_n "(cached) $ac_c" 1>&6
15997 else
15998   cat > conftest.$ac_ext <<EOF
15999 #line 16000 "configure"
16000 #include "confdefs.h"
16001 /* System header to define __stub macros and hopefully few prototypes,
16002     which can conflict with char cthread_fork(); below.  */
16003 #include <assert.h>
16004 /* Override any gcc2 internal prototype to avoid an error.  */
16005 /* We use char because int might match the return type of a gcc2
16006     builtin and then its argument prototype would still apply.  */
16007 char cthread_fork();
16008 char (*f)();
16009
16010 int main() {
16011
16012 /* The GNU C library defines this for functions which it implements
16013     to always fail with ENOSYS.  Some functions are actually named
16014     something starting with __ and the normal name is an alias.  */
16015 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
16016 choke me
16017 #else
16018 f = cthread_fork;
16019 #endif
16020
16021 ; return 0; }
16022 EOF
16023 if { (eval echo configure:16024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16024   rm -rf conftest*
16025   eval "ac_cv_func_cthread_fork=yes"
16026 else
16027   echo "configure: failed program was:" >&5
16028   cat conftest.$ac_ext >&5
16029   rm -rf conftest*
16030   eval "ac_cv_func_cthread_fork=no"
16031 fi
16032 rm -f conftest*
16033 fi
16034
16035 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
16036   echo "$ac_t""yes" 1>&6
16037   ol_link_threads=yes
16038 else
16039   echo "$ac_t""no" 1>&6
16040 fi
16041
16042
16043                 if test $ol_link_threads = no ; then
16044                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
16045 echo "configure:16046: checking for cthread_fork with -all_load" >&5
16046 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
16047   echo $ac_n "(cached) $ac_c" 1>&6
16048 else
16049   
16050                                                                 save_LIBS="$LIBS"
16051                                 LIBS="-all_load $LIBS"
16052                                 cat > conftest.$ac_ext <<EOF
16053 #line 16054 "configure"
16054 #include "confdefs.h"
16055 #include <mach/cthreads.h>
16056 int main() {
16057
16058                                         cthread_fork((void *)0, (void *)0);
16059                                         
16060 ; return 0; }
16061 EOF
16062 if { (eval echo configure:16063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16063   rm -rf conftest*
16064   ol_cv_cthread_all_load=yes
16065 else
16066   echo "configure: failed program was:" >&5
16067   cat conftest.$ac_ext >&5
16068   rm -rf conftest*
16069   ol_cv_cthread_all_load=no
16070 fi
16071 rm -f conftest*
16072                                                                 LIBS="$save_LIBS"
16073                         
16074 fi
16075
16076 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
16077
16078                         if test $ol_cv_cthread_all_load = yes ; then
16079                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
16080                                 ol_link_threads=mach
16081                                 ol_with_threads=found
16082                         fi
16083                 fi
16084
16085         elif test $ac_cv_header_cthreads_h = yes ; then
16086                                 
16087                 ol_with_threads=found
16088  
16089                                 save_LIBS="$LIBS"
16090                 LIBS="$LIBS -lthreads"
16091                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
16092 echo "configure:16093: checking for cthread_fork" >&5
16093 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
16094   echo $ac_n "(cached) $ac_c" 1>&6
16095 else
16096   cat > conftest.$ac_ext <<EOF
16097 #line 16098 "configure"
16098 #include "confdefs.h"
16099 /* System header to define __stub macros and hopefully few prototypes,
16100     which can conflict with char cthread_fork(); below.  */
16101 #include <assert.h>
16102 /* Override any gcc2 internal prototype to avoid an error.  */
16103 /* We use char because int might match the return type of a gcc2
16104     builtin and then its argument prototype would still apply.  */
16105 char cthread_fork();
16106 char (*f)();
16107
16108 int main() {
16109
16110 /* The GNU C library defines this for functions which it implements
16111     to always fail with ENOSYS.  Some functions are actually named
16112     something starting with __ and the normal name is an alias.  */
16113 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
16114 choke me
16115 #else
16116 f = cthread_fork;
16117 #endif
16118
16119 ; return 0; }
16120 EOF
16121 if { (eval echo configure:16122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16122   rm -rf conftest*
16123   eval "ac_cv_func_cthread_fork=yes"
16124 else
16125   echo "configure: failed program was:" >&5
16126   cat conftest.$ac_ext >&5
16127   rm -rf conftest*
16128   eval "ac_cv_func_cthread_fork=no"
16129 fi
16130 rm -f conftest*
16131 fi
16132
16133 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
16134   echo "$ac_t""yes" 1>&6
16135   ol_link_threads=yes
16136 else
16137   echo "$ac_t""no" 1>&6
16138 fi
16139
16140                 LIBS="$save_LIBS"
16141
16142                 if test $ol_link_threads = yes ; then
16143                         LTHREAD_LIBS="-lthreads"
16144                         ol_link_threads=mach
16145                         ol_with_threads=found
16146                 else
16147                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
16148                 fi
16149
16150         elif test $ol_with_threads = mach ; then
16151                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
16152         fi
16153
16154         if test $ol_link_threads = mach ; then
16155                 cat >> confdefs.h <<\EOF
16156 #define HAVE_MACH_CTHREADS 1
16157 EOF
16158
16159         elif test $ol_with_threads = found ; then
16160                 { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
16161         fi
16162 fi
16163
16164 if test $ol_with_threads = auto -o $ol_with_threads = yes \
16165         -o $ol_with_threads = pth ; then
16166
16167         for ac_hdr in pth.h
16168 do
16169 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16170 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16171 echo "configure:16172: checking for $ac_hdr" >&5
16172 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16173   echo $ac_n "(cached) $ac_c" 1>&6
16174 else
16175   cat > conftest.$ac_ext <<EOF
16176 #line 16177 "configure"
16177 #include "confdefs.h"
16178 #include <$ac_hdr>
16179 EOF
16180 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16181 { (eval echo configure:16182: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16182 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16183 if test -z "$ac_err"; then
16184   rm -rf conftest*
16185   eval "ac_cv_header_$ac_safe=yes"
16186 else
16187   echo "$ac_err" >&5
16188   echo "configure: failed program was:" >&5
16189   cat conftest.$ac_ext >&5
16190   rm -rf conftest*
16191   eval "ac_cv_header_$ac_safe=no"
16192 fi
16193 rm -f conftest*
16194 fi
16195 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16196   echo "$ac_t""yes" 1>&6
16197     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16198   cat >> confdefs.h <<EOF
16199 #define $ac_tr_hdr 1
16200 EOF
16201  
16202 else
16203   echo "$ac_t""no" 1>&6
16204 fi
16205 done
16206
16207
16208         if test $ac_cv_header_pth_h = yes ; then
16209                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
16210 echo "configure:16211: checking for pth_version in -lpth" >&5
16211 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
16212 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
16213   echo $ac_n "(cached) $ac_c" 1>&6
16214 else
16215   ac_save_LIBS="$LIBS"
16216 LIBS="-lpth  $LIBS"
16217 cat > conftest.$ac_ext <<EOF
16218 #line 16219 "configure"
16219 #include "confdefs.h"
16220 /* Override any gcc2 internal prototype to avoid an error.  */
16221 /* We use char because int might match the return type of a gcc2
16222     builtin and then its argument prototype would still apply.  */
16223 char pth_version();
16224
16225 int main() {
16226 pth_version()
16227 ; return 0; }
16228 EOF
16229 if { (eval echo configure:16230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16230   rm -rf conftest*
16231   eval "ac_cv_lib_$ac_lib_var=yes"
16232 else
16233   echo "configure: failed program was:" >&5
16234   cat conftest.$ac_ext >&5
16235   rm -rf conftest*
16236   eval "ac_cv_lib_$ac_lib_var=no"
16237 fi
16238 rm -f conftest*
16239 LIBS="$ac_save_LIBS"
16240
16241 fi
16242 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
16243   echo "$ac_t""yes" 1>&6
16244   have_pth=yes
16245 else
16246   echo "$ac_t""no" 1>&6
16247 have_pth=no
16248 fi
16249
16250
16251                 if test $have_pth = yes ; then
16252                         cat >> confdefs.h <<\EOF
16253 #define HAVE_GNU_PTH 1
16254 EOF
16255
16256                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
16257                         ol_link_threads=pth
16258                         ol_with_threads=found
16259
16260                         if test $ol_with_yielding_select = auto ; then
16261                                 ol_with_yielding_select=yes
16262                         fi
16263                 fi
16264         fi
16265 fi
16266
16267 if test $ol_with_threads = auto -o $ol_with_threads = yes \
16268         -o $ol_with_threads = lwp ; then
16269
16270                 for ac_hdr in thread.h synch.h
16271 do
16272 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16273 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16274 echo "configure:16275: checking for $ac_hdr" >&5
16275 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16276   echo $ac_n "(cached) $ac_c" 1>&6
16277 else
16278   cat > conftest.$ac_ext <<EOF
16279 #line 16280 "configure"
16280 #include "confdefs.h"
16281 #include <$ac_hdr>
16282 EOF
16283 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16284 { (eval echo configure:16285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16285 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16286 if test -z "$ac_err"; then
16287   rm -rf conftest*
16288   eval "ac_cv_header_$ac_safe=yes"
16289 else
16290   echo "$ac_err" >&5
16291   echo "configure: failed program was:" >&5
16292   cat conftest.$ac_ext >&5
16293   rm -rf conftest*
16294   eval "ac_cv_header_$ac_safe=no"
16295 fi
16296 rm -f conftest*
16297 fi
16298 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16299   echo "$ac_t""yes" 1>&6
16300     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16301   cat >> confdefs.h <<EOF
16302 #define $ac_tr_hdr 1
16303 EOF
16304  
16305 else
16306   echo "$ac_t""no" 1>&6
16307 fi
16308 done
16309
16310         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
16311                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
16312 echo "configure:16313: checking for thr_create in -lthread" >&5
16313 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
16314 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
16315   echo $ac_n "(cached) $ac_c" 1>&6
16316 else
16317   ac_save_LIBS="$LIBS"
16318 LIBS="-lthread  $LIBS"
16319 cat > conftest.$ac_ext <<EOF
16320 #line 16321 "configure"
16321 #include "confdefs.h"
16322 /* Override any gcc2 internal prototype to avoid an error.  */
16323 /* We use char because int might match the return type of a gcc2
16324     builtin and then its argument prototype would still apply.  */
16325 char thr_create();
16326
16327 int main() {
16328 thr_create()
16329 ; return 0; }
16330 EOF
16331 if { (eval echo configure:16332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16332   rm -rf conftest*
16333   eval "ac_cv_lib_$ac_lib_var=yes"
16334 else
16335   echo "configure: failed program was:" >&5
16336   cat conftest.$ac_ext >&5
16337   rm -rf conftest*
16338   eval "ac_cv_lib_$ac_lib_var=no"
16339 fi
16340 rm -f conftest*
16341 LIBS="$ac_save_LIBS"
16342
16343 fi
16344 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
16345   echo "$ac_t""yes" 1>&6
16346   have_thr=yes
16347 else
16348   echo "$ac_t""no" 1>&6
16349 have_thr=no
16350 fi
16351
16352
16353                 if test $have_thr = yes ; then
16354                         cat >> confdefs.h <<\EOF
16355 #define HAVE_THR 1
16356 EOF
16357
16358                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
16359                         ol_link_threads=thr
16360
16361                         if test $ol_with_yielding_select = auto ; then
16362                                 ol_with_yielding_select=yes
16363                         fi
16364
16365                                                 for ac_func in \
16366                                 thr_setconcurrency \
16367                                 thr_getconcurrency \
16368                         
16369 do
16370 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16371 echo "configure:16372: checking for $ac_func" >&5
16372 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16373   echo $ac_n "(cached) $ac_c" 1>&6
16374 else
16375   cat > conftest.$ac_ext <<EOF
16376 #line 16377 "configure"
16377 #include "confdefs.h"
16378 /* System header to define __stub macros and hopefully few prototypes,
16379     which can conflict with char $ac_func(); below.  */
16380 #include <assert.h>
16381 /* Override any gcc2 internal prototype to avoid an error.  */
16382 /* We use char because int might match the return type of a gcc2
16383     builtin and then its argument prototype would still apply.  */
16384 char $ac_func();
16385 char (*f)();
16386
16387 int main() {
16388
16389 /* The GNU C library defines this for functions which it implements
16390     to always fail with ENOSYS.  Some functions are actually named
16391     something starting with __ and the normal name is an alias.  */
16392 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16393 choke me
16394 #else
16395 f = $ac_func;
16396 #endif
16397
16398 ; return 0; }
16399 EOF
16400 if { (eval echo configure:16401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16401   rm -rf conftest*
16402   eval "ac_cv_func_$ac_func=yes"
16403 else
16404   echo "configure: failed program was:" >&5
16405   cat conftest.$ac_ext >&5
16406   rm -rf conftest*
16407   eval "ac_cv_func_$ac_func=no"
16408 fi
16409 rm -f conftest*
16410 fi
16411
16412 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16413   echo "$ac_t""yes" 1>&6
16414     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16415   cat >> confdefs.h <<EOF
16416 #define $ac_tr_func 1
16417 EOF
16418  
16419 else
16420   echo "$ac_t""no" 1>&6
16421 fi
16422 done
16423
16424                 fi
16425         fi
16426
16427                 for ac_hdr in lwp/lwp.h
16428 do
16429 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16430 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16431 echo "configure:16432: checking for $ac_hdr" >&5
16432 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16433   echo $ac_n "(cached) $ac_c" 1>&6
16434 else
16435   cat > conftest.$ac_ext <<EOF
16436 #line 16437 "configure"
16437 #include "confdefs.h"
16438 #include <$ac_hdr>
16439 EOF
16440 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16441 { (eval echo configure:16442: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16442 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16443 if test -z "$ac_err"; then
16444   rm -rf conftest*
16445   eval "ac_cv_header_$ac_safe=yes"
16446 else
16447   echo "$ac_err" >&5
16448   echo "configure: failed program was:" >&5
16449   cat conftest.$ac_ext >&5
16450   rm -rf conftest*
16451   eval "ac_cv_header_$ac_safe=no"
16452 fi
16453 rm -f conftest*
16454 fi
16455 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16456   echo "$ac_t""yes" 1>&6
16457     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16458   cat >> confdefs.h <<EOF
16459 #define $ac_tr_hdr 1
16460 EOF
16461  
16462 else
16463   echo "$ac_t""no" 1>&6
16464 fi
16465 done
16466
16467         if test $ac_cv_header_lwp_lwp_h = yes ; then
16468                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
16469 echo "configure:16470: checking for lwp_create in -llwp" >&5
16470 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
16471 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
16472   echo $ac_n "(cached) $ac_c" 1>&6
16473 else
16474   ac_save_LIBS="$LIBS"
16475 LIBS="-llwp  $LIBS"
16476 cat > conftest.$ac_ext <<EOF
16477 #line 16478 "configure"
16478 #include "confdefs.h"
16479 /* Override any gcc2 internal prototype to avoid an error.  */
16480 /* We use char because int might match the return type of a gcc2
16481     builtin and then its argument prototype would still apply.  */
16482 char lwp_create();
16483
16484 int main() {
16485 lwp_create()
16486 ; return 0; }
16487 EOF
16488 if { (eval echo configure:16489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16489   rm -rf conftest*
16490   eval "ac_cv_lib_$ac_lib_var=yes"
16491 else
16492   echo "configure: failed program was:" >&5
16493   cat conftest.$ac_ext >&5
16494   rm -rf conftest*
16495   eval "ac_cv_lib_$ac_lib_var=no"
16496 fi
16497 rm -f conftest*
16498 LIBS="$ac_save_LIBS"
16499
16500 fi
16501 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
16502   echo "$ac_t""yes" 1>&6
16503   have_lwp=yes
16504 else
16505   echo "$ac_t""no" 1>&6
16506 have_lwp=no
16507 fi
16508
16509
16510                 if test $have_lwp = yes ; then
16511                         cat >> confdefs.h <<\EOF
16512 #define HAVE_LWP 1
16513 EOF
16514
16515                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
16516                         ol_link_threads=lwp
16517
16518                         if test $ol_with_yielding_select = auto ; then
16519                                 ol_with_yielding_select=no
16520                         fi
16521                 fi
16522         fi
16523 fi
16524
16525 if test $ol_with_yielding_select = yes ; then
16526         cat >> confdefs.h <<\EOF
16527 #define HAVE_YIELDING_SELECT 1
16528 EOF
16529
16530 fi
16531
16532 if test $ol_with_threads = manual ; then
16533                 ol_link_threads=yes
16534
16535         echo "configure: warning: thread defines and link options must be set manually" 1>&2
16536
16537         for ac_hdr in pthread.h sched.h
16538 do
16539 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16540 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16541 echo "configure:16542: checking for $ac_hdr" >&5
16542 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16543   echo $ac_n "(cached) $ac_c" 1>&6
16544 else
16545   cat > conftest.$ac_ext <<EOF
16546 #line 16547 "configure"
16547 #include "confdefs.h"
16548 #include <$ac_hdr>
16549 EOF
16550 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16551 { (eval echo configure:16552: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16552 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16553 if test -z "$ac_err"; then
16554   rm -rf conftest*
16555   eval "ac_cv_header_$ac_safe=yes"
16556 else
16557   echo "$ac_err" >&5
16558   echo "configure: failed program was:" >&5
16559   cat conftest.$ac_ext >&5
16560   rm -rf conftest*
16561   eval "ac_cv_header_$ac_safe=no"
16562 fi
16563 rm -f conftest*
16564 fi
16565 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16566   echo "$ac_t""yes" 1>&6
16567     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16568   cat >> confdefs.h <<EOF
16569 #define $ac_tr_hdr 1
16570 EOF
16571  
16572 else
16573   echo "$ac_t""no" 1>&6
16574 fi
16575 done
16576
16577         for ac_func in sched_yield pthread_yield
16578 do
16579 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16580 echo "configure:16581: checking for $ac_func" >&5
16581 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16582   echo $ac_n "(cached) $ac_c" 1>&6
16583 else
16584   cat > conftest.$ac_ext <<EOF
16585 #line 16586 "configure"
16586 #include "confdefs.h"
16587 /* System header to define __stub macros and hopefully few prototypes,
16588     which can conflict with char $ac_func(); below.  */
16589 #include <assert.h>
16590 /* Override any gcc2 internal prototype to avoid an error.  */
16591 /* We use char because int might match the return type of a gcc2
16592     builtin and then its argument prototype would still apply.  */
16593 char $ac_func();
16594 char (*f)();
16595
16596 int main() {
16597
16598 /* The GNU C library defines this for functions which it implements
16599     to always fail with ENOSYS.  Some functions are actually named
16600     something starting with __ and the normal name is an alias.  */
16601 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16602 choke me
16603 #else
16604 f = $ac_func;
16605 #endif
16606
16607 ; return 0; }
16608 EOF
16609 if { (eval echo configure:16610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16610   rm -rf conftest*
16611   eval "ac_cv_func_$ac_func=yes"
16612 else
16613   echo "configure: failed program was:" >&5
16614   cat conftest.$ac_ext >&5
16615   rm -rf conftest*
16616   eval "ac_cv_func_$ac_func=no"
16617 fi
16618 rm -f conftest*
16619 fi
16620
16621 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16622   echo "$ac_t""yes" 1>&6
16623     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16624   cat >> confdefs.h <<EOF
16625 #define $ac_tr_func 1
16626 EOF
16627  
16628 else
16629   echo "$ac_t""no" 1>&6
16630 fi
16631 done
16632
16633         
16634         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
16635 echo "configure:16636: checking for LinuxThreads pthread.h" >&5
16636 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
16637   echo $ac_n "(cached) $ac_c" 1>&6
16638 else
16639   cat > conftest.$ac_ext <<EOF
16640 #line 16641 "configure"
16641 #include "confdefs.h"
16642 #include <pthread.h>
16643 EOF
16644 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16645   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
16646   rm -rf conftest*
16647   ol_cv_header_linux_threads=yes
16648 else
16649   rm -rf conftest*
16650   ol_cv_header_linux_threads=no
16651 fi
16652 rm -f conftest*
16653
16654                 
16655 fi
16656
16657 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
16658         if test $ol_cv_header_linux_threads = yes; then
16659                 cat >> confdefs.h <<\EOF
16660 #define HAVE_LINUX_THREADS 1
16661 EOF
16662
16663         fi
16664
16665
16666         for ac_hdr in mach/cthreads.h
16667 do
16668 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16669 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16670 echo "configure:16671: checking for $ac_hdr" >&5
16671 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16672   echo $ac_n "(cached) $ac_c" 1>&6
16673 else
16674   cat > conftest.$ac_ext <<EOF
16675 #line 16676 "configure"
16676 #include "confdefs.h"
16677 #include <$ac_hdr>
16678 EOF
16679 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16680 { (eval echo configure:16681: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16681 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16682 if test -z "$ac_err"; then
16683   rm -rf conftest*
16684   eval "ac_cv_header_$ac_safe=yes"
16685 else
16686   echo "$ac_err" >&5
16687   echo "configure: failed program was:" >&5
16688   cat conftest.$ac_ext >&5
16689   rm -rf conftest*
16690   eval "ac_cv_header_$ac_safe=no"
16691 fi
16692 rm -f conftest*
16693 fi
16694 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16695   echo "$ac_t""yes" 1>&6
16696     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16697   cat >> confdefs.h <<EOF
16698 #define $ac_tr_hdr 1
16699 EOF
16700  
16701 else
16702   echo "$ac_t""no" 1>&6
16703 fi
16704 done
16705
16706         for ac_hdr in lwp/lwp.h
16707 do
16708 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16709 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16710 echo "configure:16711: checking for $ac_hdr" >&5
16711 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16712   echo $ac_n "(cached) $ac_c" 1>&6
16713 else
16714   cat > conftest.$ac_ext <<EOF
16715 #line 16716 "configure"
16716 #include "confdefs.h"
16717 #include <$ac_hdr>
16718 EOF
16719 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16720 { (eval echo configure:16721: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16721 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16722 if test -z "$ac_err"; then
16723   rm -rf conftest*
16724   eval "ac_cv_header_$ac_safe=yes"
16725 else
16726   echo "$ac_err" >&5
16727   echo "configure: failed program was:" >&5
16728   cat conftest.$ac_ext >&5
16729   rm -rf conftest*
16730   eval "ac_cv_header_$ac_safe=no"
16731 fi
16732 rm -f conftest*
16733 fi
16734 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16735   echo "$ac_t""yes" 1>&6
16736     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16737   cat >> confdefs.h <<EOF
16738 #define $ac_tr_hdr 1
16739 EOF
16740  
16741 else
16742   echo "$ac_t""no" 1>&6
16743 fi
16744 done
16745
16746         for ac_hdr in thread.h synch.h
16747 do
16748 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16749 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16750 echo "configure:16751: checking for $ac_hdr" >&5
16751 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16752   echo $ac_n "(cached) $ac_c" 1>&6
16753 else
16754   cat > conftest.$ac_ext <<EOF
16755 #line 16756 "configure"
16756 #include "confdefs.h"
16757 #include <$ac_hdr>
16758 EOF
16759 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16760 { (eval echo configure:16761: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16761 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16762 if test -z "$ac_err"; then
16763   rm -rf conftest*
16764   eval "ac_cv_header_$ac_safe=yes"
16765 else
16766   echo "$ac_err" >&5
16767   echo "configure: failed program was:" >&5
16768   cat conftest.$ac_ext >&5
16769   rm -rf conftest*
16770   eval "ac_cv_header_$ac_safe=no"
16771 fi
16772 rm -f conftest*
16773 fi
16774 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16775   echo "$ac_t""yes" 1>&6
16776     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16777   cat >> confdefs.h <<EOF
16778 #define $ac_tr_hdr 1
16779 EOF
16780  
16781 else
16782   echo "$ac_t""no" 1>&6
16783 fi
16784 done
16785
16786 fi
16787
16788 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
16789                         cat >> confdefs.h <<\EOF
16790 #define REENTRANT 1
16791 EOF
16792
16793         cat >> confdefs.h <<\EOF
16794 #define _REENTRANT 1
16795 EOF
16796
16797         cat >> confdefs.h <<\EOF
16798 #define THREAD_SAFE 1
16799 EOF
16800
16801         cat >> confdefs.h <<\EOF
16802 #define _THREAD_SAFE 1
16803 EOF
16804
16805         cat >> confdefs.h <<\EOF
16806 #define THREADSAFE 1
16807 EOF
16808
16809         cat >> confdefs.h <<\EOF
16810 #define _THREADSAFE 1
16811 EOF
16812
16813         cat >> confdefs.h <<\EOF
16814 #define _SGI_MP_SOURCE 1
16815 EOF
16816
16817
16818                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
16819 echo "configure:16820: checking for thread specific errno" >&5
16820 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
16821   echo $ac_n "(cached) $ac_c" 1>&6
16822 else
16823   
16824                 cat > conftest.$ac_ext <<EOF
16825 #line 16826 "configure"
16826 #include "confdefs.h"
16827 #include <errno.h>
16828 int main() {
16829 errno = 0;
16830 ; return 0; }
16831 EOF
16832 if { (eval echo configure:16833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16833   rm -rf conftest*
16834   ol_cv_errno_thread_specific=yes
16835 else
16836   echo "configure: failed program was:" >&5
16837   cat conftest.$ac_ext >&5
16838   rm -rf conftest*
16839   ol_cv_errno_thread_specific=no
16840 fi
16841 rm -f conftest*
16842         
16843 fi
16844
16845 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
16846
16847                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
16848 echo "configure:16849: checking for thread specific h_errno" >&5
16849 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
16850   echo $ac_n "(cached) $ac_c" 1>&6
16851 else
16852   
16853                 cat > conftest.$ac_ext <<EOF
16854 #line 16855 "configure"
16855 #include "confdefs.h"
16856 #include <netdb.h>
16857 int main() {
16858 h_errno = 0;
16859 ; return 0; }
16860 EOF
16861 if { (eval echo configure:16862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16862   rm -rf conftest*
16863   ol_cv_h_errno_thread_specific=yes
16864 else
16865   echo "configure: failed program was:" >&5
16866   cat conftest.$ac_ext >&5
16867   rm -rf conftest*
16868   ol_cv_h_errno_thread_specific=no
16869 fi
16870 rm -f conftest*
16871         
16872 fi
16873
16874 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
16875
16876         if test $ol_cv_errno_thread_specific != yes \
16877                 -o $ol_cv_h_errno_thread_specific != yes ; then
16878                 LIBS="$LTHREAD_LIBS $LIBS"
16879                 LTHREAD_LIBS=""
16880         fi
16881
16882 fi  
16883
16884 if test $ol_link_threads = no ; then
16885         if test $ol_with_threads = yes ; then
16886                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
16887         fi
16888
16889         if test $ol_with_threads = auto ; then
16890                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
16891                 ol_with_threads=no
16892         fi
16893
16894         cat >> confdefs.h <<\EOF
16895 #define NO_THREADS 1
16896 EOF
16897
16898         LTHREAD_LIBS=""
16899 fi
16900
16901 if test $ol_link_threads != no ; then
16902         cat >> confdefs.h <<\EOF
16903 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
16904 EOF
16905
16906 fi
16907
16908 ol_link_ldbm=no 
16909
16910 if test $ol_with_ldbm_api = auto \
16911         -o $ol_with_ldbm_api = berkeley \
16912         -o $ol_with_ldbm_api = bcompat ; then
16913
16914         if test $ol_with_ldbm_api = bcompat; then \
16915                 for ac_hdr in db_185.h db.h
16916 do
16917 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16918 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16919 echo "configure:16920: checking for $ac_hdr" >&5
16920 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16921   echo $ac_n "(cached) $ac_c" 1>&6
16922 else
16923   cat > conftest.$ac_ext <<EOF
16924 #line 16925 "configure"
16925 #include "confdefs.h"
16926 #include <$ac_hdr>
16927 EOF
16928 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16929 { (eval echo configure:16930: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16930 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16931 if test -z "$ac_err"; then
16932   rm -rf conftest*
16933   eval "ac_cv_header_$ac_safe=yes"
16934 else
16935   echo "$ac_err" >&5
16936   echo "configure: failed program was:" >&5
16937   cat conftest.$ac_ext >&5
16938   rm -rf conftest*
16939   eval "ac_cv_header_$ac_safe=no"
16940 fi
16941 rm -f conftest*
16942 fi
16943 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16944   echo "$ac_t""yes" 1>&6
16945     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16946   cat >> confdefs.h <<EOF
16947 #define $ac_tr_hdr 1
16948 EOF
16949  
16950 else
16951   echo "$ac_t""no" 1>&6
16952 fi
16953 done
16954
16955 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
16956         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
16957 echo "configure:16958: checking if Berkeley DB header compatibility" >&5
16958 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
16959   echo $ac_n "(cached) $ac_c" 1>&6
16960 else
16961   
16962                 cat > conftest.$ac_ext <<EOF
16963 #line 16964 "configure"
16964 #include "confdefs.h"
16965
16966 #if HAVE_DB_185_H
16967 #       include <db_185.h>
16968 #else
16969 #       include <db.h>
16970 #endif
16971
16972  /* this check could be improved */
16973 #ifndef DB_VERSION_MAJOR
16974 #       define DB_VERSION_MAJOR 1
16975 #endif
16976
16977 #if DB_VERSION_MAJOR == 1 
16978         __db_version_1
16979 #endif
16980
16981 EOF
16982 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16983   egrep "__db_version_1" >/dev/null 2>&1; then
16984   rm -rf conftest*
16985   ol_cv_header_db1=yes
16986 else
16987   rm -rf conftest*
16988   ol_cv_header_db1=no
16989 fi
16990 rm -f conftest*
16991
16992 fi
16993
16994 echo "$ac_t""$ol_cv_header_db1" 1>&6
16995
16996         if test $ol_cv_header_db1 = yes ; then
16997                 ol_cv_lib_db=no
16998 if test $ol_cv_lib_db = no ; then
16999         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
17000 echo "configure:17001: checking for Berkeley DB link (default)" >&5
17001 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
17002   echo $ac_n "(cached) $ac_c" 1>&6
17003 else
17004   
17005         ol_DB_LIB=
17006         ol_LIBS=$LIBS
17007         LIBS="$ol_DB_LIB $LIBS"
17008
17009         cat > conftest.$ac_ext <<EOF
17010 #line 17011 "configure"
17011 #include "confdefs.h"
17012
17013 #ifdef HAVE_DB_185_H
17014 # include <db_185.h>
17015 #else
17016 # include <db.h>
17017 #endif
17018
17019 #ifndef DB_VERSION_MAJOR
17020 # define DB_VERSION_MAJOR 1
17021 #endif
17022
17023 #ifndef NULL
17024 #define NULL ((void*)0)
17025 #endif
17026
17027 int main() {
17028
17029 #if DB_VERSION_MAJOR > 1
17030         {
17031                 char *version;
17032                 int major, minor, patch;
17033
17034                 version = db_version( &major, &minor, &patch );
17035
17036                 if( major != DB_VERSION_MAJOR ||
17037                         minor < DB_VERSION_MINOR )
17038                 {
17039                         printf("Berkeley DB version mismatch\n"
17040                                 "\texpected: %s\n\tgot: %s\n",
17041                                 DB_VERSION_STRING, version);
17042                         return 1;
17043                 }
17044         }
17045 #endif
17046
17047 #if DB_VERSION_MAJOR > 2
17048         db_env_create( NULL, 0 );
17049 #elif DB_VERSION_MAJOR > 1
17050         db_appexit( NULL );
17051 #else
17052         (void) dbopen( NULL, 0, 0, 0, NULL);
17053 #endif
17054
17055 ; return 0; }
17056 EOF
17057 if { (eval echo configure:17058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17058   rm -rf conftest*
17059   ol_cv_db_none=yes
17060 else
17061   echo "configure: failed program was:" >&5
17062   cat conftest.$ac_ext >&5
17063   rm -rf conftest*
17064   ol_cv_db_none=no
17065 fi
17066 rm -f conftest*
17067
17068         LIBS="$ol_LIBS"
17069
17070 fi
17071
17072 echo "$ac_t""$ol_cv_db_none" 1>&6
17073
17074         if test $ol_cv_db_none = yes ; then
17075                 ol_cv_lib_db=yes
17076         fi
17077 fi
17078
17079 if test $ol_cv_lib_db = no ; then
17080         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
17081 echo "configure:17082: checking for Berkeley DB link (-ldb)" >&5
17082 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
17083   echo $ac_n "(cached) $ac_c" 1>&6
17084 else
17085   
17086         ol_DB_LIB=-ldb
17087         ol_LIBS=$LIBS
17088         LIBS="$ol_DB_LIB $LIBS"
17089
17090         cat > conftest.$ac_ext <<EOF
17091 #line 17092 "configure"
17092 #include "confdefs.h"
17093
17094 #ifdef HAVE_DB_185_H
17095 # include <db_185.h>
17096 #else
17097 # include <db.h>
17098 #endif
17099
17100 #ifndef DB_VERSION_MAJOR
17101 # define DB_VERSION_MAJOR 1
17102 #endif
17103
17104 #ifndef NULL
17105 #define NULL ((void*)0)
17106 #endif
17107
17108 int main() {
17109
17110 #if DB_VERSION_MAJOR > 1
17111         {
17112                 char *version;
17113                 int major, minor, patch;
17114
17115                 version = db_version( &major, &minor, &patch );
17116
17117                 if( major != DB_VERSION_MAJOR ||
17118                         minor < DB_VERSION_MINOR )
17119                 {
17120                         printf("Berkeley DB version mismatch\n"
17121                                 "\texpected: %s\n\tgot: %s\n",
17122                                 DB_VERSION_STRING, version);
17123                         return 1;
17124                 }
17125         }
17126 #endif
17127
17128 #if DB_VERSION_MAJOR > 2
17129         db_env_create( NULL, 0 );
17130 #elif DB_VERSION_MAJOR > 1
17131         db_appexit( NULL );
17132 #else
17133         (void) dbopen( NULL, 0, 0, 0, NULL);
17134 #endif
17135
17136 ; return 0; }
17137 EOF
17138 if { (eval echo configure:17139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17139   rm -rf conftest*
17140   ol_cv_db_db=yes
17141 else
17142   echo "configure: failed program was:" >&5
17143   cat conftest.$ac_ext >&5
17144   rm -rf conftest*
17145   ol_cv_db_db=no
17146 fi
17147 rm -f conftest*
17148
17149         LIBS="$ol_LIBS"
17150
17151 fi
17152
17153 echo "$ac_t""$ol_cv_db_db" 1>&6
17154
17155         if test $ol_cv_db_db = yes ; then
17156                 ol_cv_lib_db=-ldb
17157         fi
17158 fi
17159
17160 if test $ol_cv_lib_db = no ; then
17161         echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
17162 echo "configure:17163: checking for Berkeley DB link (-ldb4)" >&5
17163 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
17164   echo $ac_n "(cached) $ac_c" 1>&6
17165 else
17166   
17167         ol_DB_LIB=-ldb4
17168         ol_LIBS=$LIBS
17169         LIBS="$ol_DB_LIB $LIBS"
17170
17171         cat > conftest.$ac_ext <<EOF
17172 #line 17173 "configure"
17173 #include "confdefs.h"
17174
17175 #ifdef HAVE_DB_185_H
17176 # include <db_185.h>
17177 #else
17178 # include <db.h>
17179 #endif
17180
17181 #ifndef DB_VERSION_MAJOR
17182 # define DB_VERSION_MAJOR 1
17183 #endif
17184
17185 #ifndef NULL
17186 #define NULL ((void*)0)
17187 #endif
17188
17189 int main() {
17190
17191 #if DB_VERSION_MAJOR > 1
17192         {
17193                 char *version;
17194                 int major, minor, patch;
17195
17196                 version = db_version( &major, &minor, &patch );
17197
17198                 if( major != DB_VERSION_MAJOR ||
17199                         minor < DB_VERSION_MINOR )
17200                 {
17201                         printf("Berkeley DB version mismatch\n"
17202                                 "\texpected: %s\n\tgot: %s\n",
17203                                 DB_VERSION_STRING, version);
17204                         return 1;
17205                 }
17206         }
17207 #endif
17208
17209 #if DB_VERSION_MAJOR > 2
17210         db_env_create( NULL, 0 );
17211 #elif DB_VERSION_MAJOR > 1
17212         db_appexit( NULL );
17213 #else
17214         (void) dbopen( NULL, 0, 0, 0, NULL);
17215 #endif
17216
17217 ; return 0; }
17218 EOF
17219 if { (eval echo configure:17220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17220   rm -rf conftest*
17221   ol_cv_db_db4=yes
17222 else
17223   echo "configure: failed program was:" >&5
17224   cat conftest.$ac_ext >&5
17225   rm -rf conftest*
17226   ol_cv_db_db4=no
17227 fi
17228 rm -f conftest*
17229
17230         LIBS="$ol_LIBS"
17231
17232 fi
17233
17234 echo "$ac_t""$ol_cv_db_db4" 1>&6
17235
17236         if test $ol_cv_db_db4 = yes ; then
17237                 ol_cv_lib_db=-ldb4
17238         fi
17239 fi
17240
17241 if test $ol_cv_lib_db = no ; then
17242         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
17243 echo "configure:17244: checking for Berkeley DB link (-ldb3)" >&5
17244 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
17245   echo $ac_n "(cached) $ac_c" 1>&6
17246 else
17247   
17248         ol_DB_LIB=-ldb3
17249         ol_LIBS=$LIBS
17250         LIBS="$ol_DB_LIB $LIBS"
17251
17252         cat > conftest.$ac_ext <<EOF
17253 #line 17254 "configure"
17254 #include "confdefs.h"
17255
17256 #ifdef HAVE_DB_185_H
17257 # include <db_185.h>
17258 #else
17259 # include <db.h>
17260 #endif
17261
17262 #ifndef DB_VERSION_MAJOR
17263 # define DB_VERSION_MAJOR 1
17264 #endif
17265
17266 #ifndef NULL
17267 #define NULL ((void*)0)
17268 #endif
17269
17270 int main() {
17271
17272 #if DB_VERSION_MAJOR > 1
17273         {
17274                 char *version;
17275                 int major, minor, patch;
17276
17277                 version = db_version( &major, &minor, &patch );
17278
17279                 if( major != DB_VERSION_MAJOR ||
17280                         minor < DB_VERSION_MINOR )
17281                 {
17282                         printf("Berkeley DB version mismatch\n"
17283                                 "\texpected: %s\n\tgot: %s\n",
17284                                 DB_VERSION_STRING, version);
17285                         return 1;
17286                 }
17287         }
17288 #endif
17289
17290 #if DB_VERSION_MAJOR > 2
17291         db_env_create( NULL, 0 );
17292 #elif DB_VERSION_MAJOR > 1
17293         db_appexit( NULL );
17294 #else
17295         (void) dbopen( NULL, 0, 0, 0, NULL);
17296 #endif
17297
17298 ; return 0; }
17299 EOF
17300 if { (eval echo configure:17301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17301   rm -rf conftest*
17302   ol_cv_db_db3=yes
17303 else
17304   echo "configure: failed program was:" >&5
17305   cat conftest.$ac_ext >&5
17306   rm -rf conftest*
17307   ol_cv_db_db3=no
17308 fi
17309 rm -f conftest*
17310
17311         LIBS="$ol_LIBS"
17312
17313 fi
17314
17315 echo "$ac_t""$ol_cv_db_db3" 1>&6
17316
17317         if test $ol_cv_db_db3 = yes ; then
17318                 ol_cv_lib_db=-ldb3
17319         fi
17320 fi
17321
17322 if test $ol_cv_lib_db = no ; then
17323         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
17324 echo "configure:17325: checking for Berkeley DB link (-ldb2)" >&5
17325 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
17326   echo $ac_n "(cached) $ac_c" 1>&6
17327 else
17328   
17329         ol_DB_LIB=-ldb2
17330         ol_LIBS=$LIBS
17331         LIBS="$ol_DB_LIB $LIBS"
17332
17333         cat > conftest.$ac_ext <<EOF
17334 #line 17335 "configure"
17335 #include "confdefs.h"
17336
17337 #ifdef HAVE_DB_185_H
17338 # include <db_185.h>
17339 #else
17340 # include <db.h>
17341 #endif
17342
17343 #ifndef DB_VERSION_MAJOR
17344 # define DB_VERSION_MAJOR 1
17345 #endif
17346
17347 #ifndef NULL
17348 #define NULL ((void*)0)
17349 #endif
17350
17351 int main() {
17352
17353 #if DB_VERSION_MAJOR > 1
17354         {
17355                 char *version;
17356                 int major, minor, patch;
17357
17358                 version = db_version( &major, &minor, &patch );
17359
17360                 if( major != DB_VERSION_MAJOR ||
17361                         minor < DB_VERSION_MINOR )
17362                 {
17363                         printf("Berkeley DB version mismatch\n"
17364                                 "\texpected: %s\n\tgot: %s\n",
17365                                 DB_VERSION_STRING, version);
17366                         return 1;
17367                 }
17368         }
17369 #endif
17370
17371 #if DB_VERSION_MAJOR > 2
17372         db_env_create( NULL, 0 );
17373 #elif DB_VERSION_MAJOR > 1
17374         db_appexit( NULL );
17375 #else
17376         (void) dbopen( NULL, 0, 0, 0, NULL);
17377 #endif
17378
17379 ; return 0; }
17380 EOF
17381 if { (eval echo configure:17382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17382   rm -rf conftest*
17383   ol_cv_db_db2=yes
17384 else
17385   echo "configure: failed program was:" >&5
17386   cat conftest.$ac_ext >&5
17387   rm -rf conftest*
17388   ol_cv_db_db2=no
17389 fi
17390 rm -f conftest*
17391
17392         LIBS="$ol_LIBS"
17393
17394 fi
17395
17396 echo "$ac_t""$ol_cv_db_db2" 1>&6
17397
17398         if test $ol_cv_db_db2 = yes ; then
17399                 ol_cv_lib_db=-ldb2
17400         fi
17401 fi
17402
17403 if test $ol_cv_lib_db = no ; then
17404         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
17405 echo "configure:17406: checking for Berkeley DB link (-ldb1)" >&5
17406 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
17407   echo $ac_n "(cached) $ac_c" 1>&6
17408 else
17409   
17410         ol_DB_LIB=-ldb1
17411         ol_LIBS=$LIBS
17412         LIBS="$ol_DB_LIB $LIBS"
17413
17414         cat > conftest.$ac_ext <<EOF
17415 #line 17416 "configure"
17416 #include "confdefs.h"
17417
17418 #ifdef HAVE_DB_185_H
17419 # include <db_185.h>
17420 #else
17421 # include <db.h>
17422 #endif
17423
17424 #ifndef DB_VERSION_MAJOR
17425 # define DB_VERSION_MAJOR 1
17426 #endif
17427
17428 #ifndef NULL
17429 #define NULL ((void*)0)
17430 #endif
17431
17432 int main() {
17433
17434 #if DB_VERSION_MAJOR > 1
17435         {
17436                 char *version;
17437                 int major, minor, patch;
17438
17439                 version = db_version( &major, &minor, &patch );
17440
17441                 if( major != DB_VERSION_MAJOR ||
17442                         minor < DB_VERSION_MINOR )
17443                 {
17444                         printf("Berkeley DB version mismatch\n"
17445                                 "\texpected: %s\n\tgot: %s\n",
17446                                 DB_VERSION_STRING, version);
17447                         return 1;
17448                 }
17449         }
17450 #endif
17451
17452 #if DB_VERSION_MAJOR > 2
17453         db_env_create( NULL, 0 );
17454 #elif DB_VERSION_MAJOR > 1
17455         db_appexit( NULL );
17456 #else
17457         (void) dbopen( NULL, 0, 0, 0, NULL);
17458 #endif
17459
17460 ; return 0; }
17461 EOF
17462 if { (eval echo configure:17463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17463   rm -rf conftest*
17464   ol_cv_db_db1=yes
17465 else
17466   echo "configure: failed program was:" >&5
17467   cat conftest.$ac_ext >&5
17468   rm -rf conftest*
17469   ol_cv_db_db1=no
17470 fi
17471 rm -f conftest*
17472
17473         LIBS="$ol_LIBS"
17474
17475 fi
17476
17477 echo "$ac_t""$ol_cv_db_db1" 1>&6
17478
17479         if test $ol_cv_db_db1 = yes ; then
17480                 ol_cv_lib_db=-ldb1
17481         fi
17482 fi
17483
17484
17485                 if test "$ol_cv_lib_db" != no ; then
17486                         ol_cv_berkeley_db=yes
17487                 fi
17488         fi
17489 fi
17490
17491         else
17492                 ol_cv_berkeley_db=no
17493 for ac_hdr in db.h
17494 do
17495 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
17496 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
17497 echo "configure:17498: checking for $ac_hdr" >&5
17498 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
17499   echo $ac_n "(cached) $ac_c" 1>&6
17500 else
17501   cat > conftest.$ac_ext <<EOF
17502 #line 17503 "configure"
17503 #include "confdefs.h"
17504 #include <$ac_hdr>
17505 EOF
17506 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
17507 { (eval echo configure:17508: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
17508 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
17509 if test -z "$ac_err"; then
17510   rm -rf conftest*
17511   eval "ac_cv_header_$ac_safe=yes"
17512 else
17513   echo "$ac_err" >&5
17514   echo "configure: failed program was:" >&5
17515   cat conftest.$ac_ext >&5
17516   rm -rf conftest*
17517   eval "ac_cv_header_$ac_safe=no"
17518 fi
17519 rm -f conftest*
17520 fi
17521 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
17522   echo "$ac_t""yes" 1>&6
17523     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
17524   cat >> confdefs.h <<EOF
17525 #define $ac_tr_hdr 1
17526 EOF
17527  
17528 else
17529   echo "$ac_t""no" 1>&6
17530 fi
17531 done
17532
17533 if test $ac_cv_header_db_h = yes; then
17534         ol_cv_lib_db=no
17535 if test $ol_cv_lib_db = no ; then
17536         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
17537 echo "configure:17538: checking for Berkeley DB link (default)" >&5
17538 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
17539   echo $ac_n "(cached) $ac_c" 1>&6
17540 else
17541   
17542         ol_DB_LIB=
17543         ol_LIBS=$LIBS
17544         LIBS="$ol_DB_LIB $LIBS"
17545
17546         cat > conftest.$ac_ext <<EOF
17547 #line 17548 "configure"
17548 #include "confdefs.h"
17549
17550 #ifdef HAVE_DB_185_H
17551 # include <db_185.h>
17552 #else
17553 # include <db.h>
17554 #endif
17555
17556 #ifndef DB_VERSION_MAJOR
17557 # define DB_VERSION_MAJOR 1
17558 #endif
17559
17560 #ifndef NULL
17561 #define NULL ((void*)0)
17562 #endif
17563
17564 int main() {
17565
17566 #if DB_VERSION_MAJOR > 1
17567         {
17568                 char *version;
17569                 int major, minor, patch;
17570
17571                 version = db_version( &major, &minor, &patch );
17572
17573                 if( major != DB_VERSION_MAJOR ||
17574                         minor < DB_VERSION_MINOR )
17575                 {
17576                         printf("Berkeley DB version mismatch\n"
17577                                 "\texpected: %s\n\tgot: %s\n",
17578                                 DB_VERSION_STRING, version);
17579                         return 1;
17580                 }
17581         }
17582 #endif
17583
17584 #if DB_VERSION_MAJOR > 2
17585         db_env_create( NULL, 0 );
17586 #elif DB_VERSION_MAJOR > 1
17587         db_appexit( NULL );
17588 #else
17589         (void) dbopen( NULL, 0, 0, 0, NULL);
17590 #endif
17591
17592 ; return 0; }
17593 EOF
17594 if { (eval echo configure:17595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17595   rm -rf conftest*
17596   ol_cv_db_none=yes
17597 else
17598   echo "configure: failed program was:" >&5
17599   cat conftest.$ac_ext >&5
17600   rm -rf conftest*
17601   ol_cv_db_none=no
17602 fi
17603 rm -f conftest*
17604
17605         LIBS="$ol_LIBS"
17606
17607 fi
17608
17609 echo "$ac_t""$ol_cv_db_none" 1>&6
17610
17611         if test $ol_cv_db_none = yes ; then
17612                 ol_cv_lib_db=yes
17613         fi
17614 fi
17615
17616 if test $ol_cv_lib_db = no ; then
17617         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
17618 echo "configure:17619: checking for Berkeley DB link (-ldb)" >&5
17619 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
17620   echo $ac_n "(cached) $ac_c" 1>&6
17621 else
17622   
17623         ol_DB_LIB=-ldb
17624         ol_LIBS=$LIBS
17625         LIBS="$ol_DB_LIB $LIBS"
17626
17627         cat > conftest.$ac_ext <<EOF
17628 #line 17629 "configure"
17629 #include "confdefs.h"
17630
17631 #ifdef HAVE_DB_185_H
17632 # include <db_185.h>
17633 #else
17634 # include <db.h>
17635 #endif
17636
17637 #ifndef DB_VERSION_MAJOR
17638 # define DB_VERSION_MAJOR 1
17639 #endif
17640
17641 #ifndef NULL
17642 #define NULL ((void*)0)
17643 #endif
17644
17645 int main() {
17646
17647 #if DB_VERSION_MAJOR > 1
17648         {
17649                 char *version;
17650                 int major, minor, patch;
17651
17652                 version = db_version( &major, &minor, &patch );
17653
17654                 if( major != DB_VERSION_MAJOR ||
17655                         minor < DB_VERSION_MINOR )
17656                 {
17657                         printf("Berkeley DB version mismatch\n"
17658                                 "\texpected: %s\n\tgot: %s\n",
17659                                 DB_VERSION_STRING, version);
17660                         return 1;
17661                 }
17662         }
17663 #endif
17664
17665 #if DB_VERSION_MAJOR > 2
17666         db_env_create( NULL, 0 );
17667 #elif DB_VERSION_MAJOR > 1
17668         db_appexit( NULL );
17669 #else
17670         (void) dbopen( NULL, 0, 0, 0, NULL);
17671 #endif
17672
17673 ; return 0; }
17674 EOF
17675 if { (eval echo configure:17676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17676   rm -rf conftest*
17677   ol_cv_db_db=yes
17678 else
17679   echo "configure: failed program was:" >&5
17680   cat conftest.$ac_ext >&5
17681   rm -rf conftest*
17682   ol_cv_db_db=no
17683 fi
17684 rm -f conftest*
17685
17686         LIBS="$ol_LIBS"
17687
17688 fi
17689
17690 echo "$ac_t""$ol_cv_db_db" 1>&6
17691
17692         if test $ol_cv_db_db = yes ; then
17693                 ol_cv_lib_db=-ldb
17694         fi
17695 fi
17696
17697 if test $ol_cv_lib_db = no ; then
17698         echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
17699 echo "configure:17700: checking for Berkeley DB link (-ldb4)" >&5
17700 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
17701   echo $ac_n "(cached) $ac_c" 1>&6
17702 else
17703   
17704         ol_DB_LIB=-ldb4
17705         ol_LIBS=$LIBS
17706         LIBS="$ol_DB_LIB $LIBS"
17707
17708         cat > conftest.$ac_ext <<EOF
17709 #line 17710 "configure"
17710 #include "confdefs.h"
17711
17712 #ifdef HAVE_DB_185_H
17713 # include <db_185.h>
17714 #else
17715 # include <db.h>
17716 #endif
17717
17718 #ifndef DB_VERSION_MAJOR
17719 # define DB_VERSION_MAJOR 1
17720 #endif
17721
17722 #ifndef NULL
17723 #define NULL ((void*)0)
17724 #endif
17725
17726 int main() {
17727
17728 #if DB_VERSION_MAJOR > 1
17729         {
17730                 char *version;
17731                 int major, minor, patch;
17732
17733                 version = db_version( &major, &minor, &patch );
17734
17735                 if( major != DB_VERSION_MAJOR ||
17736                         minor < DB_VERSION_MINOR )
17737                 {
17738                         printf("Berkeley DB version mismatch\n"
17739                                 "\texpected: %s\n\tgot: %s\n",
17740                                 DB_VERSION_STRING, version);
17741                         return 1;
17742                 }
17743         }
17744 #endif
17745
17746 #if DB_VERSION_MAJOR > 2
17747         db_env_create( NULL, 0 );
17748 #elif DB_VERSION_MAJOR > 1
17749         db_appexit( NULL );
17750 #else
17751         (void) dbopen( NULL, 0, 0, 0, NULL);
17752 #endif
17753
17754 ; return 0; }
17755 EOF
17756 if { (eval echo configure:17757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17757   rm -rf conftest*
17758   ol_cv_db_db4=yes
17759 else
17760   echo "configure: failed program was:" >&5
17761   cat conftest.$ac_ext >&5
17762   rm -rf conftest*
17763   ol_cv_db_db4=no
17764 fi
17765 rm -f conftest*
17766
17767         LIBS="$ol_LIBS"
17768
17769 fi
17770
17771 echo "$ac_t""$ol_cv_db_db4" 1>&6
17772
17773         if test $ol_cv_db_db4 = yes ; then
17774                 ol_cv_lib_db=-ldb4
17775         fi
17776 fi
17777
17778 if test $ol_cv_lib_db = no ; then
17779         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
17780 echo "configure:17781: checking for Berkeley DB link (-ldb3)" >&5
17781 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
17782   echo $ac_n "(cached) $ac_c" 1>&6
17783 else
17784   
17785         ol_DB_LIB=-ldb3
17786         ol_LIBS=$LIBS
17787         LIBS="$ol_DB_LIB $LIBS"
17788
17789         cat > conftest.$ac_ext <<EOF
17790 #line 17791 "configure"
17791 #include "confdefs.h"
17792
17793 #ifdef HAVE_DB_185_H
17794 # include <db_185.h>
17795 #else
17796 # include <db.h>
17797 #endif
17798
17799 #ifndef DB_VERSION_MAJOR
17800 # define DB_VERSION_MAJOR 1
17801 #endif
17802
17803 #ifndef NULL
17804 #define NULL ((void*)0)
17805 #endif
17806
17807 int main() {
17808
17809 #if DB_VERSION_MAJOR > 1
17810         {
17811                 char *version;
17812                 int major, minor, patch;
17813
17814                 version = db_version( &major, &minor, &patch );
17815
17816                 if( major != DB_VERSION_MAJOR ||
17817                         minor < DB_VERSION_MINOR )
17818                 {
17819                         printf("Berkeley DB version mismatch\n"
17820                                 "\texpected: %s\n\tgot: %s\n",
17821                                 DB_VERSION_STRING, version);
17822                         return 1;
17823                 }
17824         }
17825 #endif
17826
17827 #if DB_VERSION_MAJOR > 2
17828         db_env_create( NULL, 0 );
17829 #elif DB_VERSION_MAJOR > 1
17830         db_appexit( NULL );
17831 #else
17832         (void) dbopen( NULL, 0, 0, 0, NULL);
17833 #endif
17834
17835 ; return 0; }
17836 EOF
17837 if { (eval echo configure:17838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17838   rm -rf conftest*
17839   ol_cv_db_db3=yes
17840 else
17841   echo "configure: failed program was:" >&5
17842   cat conftest.$ac_ext >&5
17843   rm -rf conftest*
17844   ol_cv_db_db3=no
17845 fi
17846 rm -f conftest*
17847
17848         LIBS="$ol_LIBS"
17849
17850 fi
17851
17852 echo "$ac_t""$ol_cv_db_db3" 1>&6
17853
17854         if test $ol_cv_db_db3 = yes ; then
17855                 ol_cv_lib_db=-ldb3
17856         fi
17857 fi
17858
17859 if test $ol_cv_lib_db = no ; then
17860         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
17861 echo "configure:17862: checking for Berkeley DB link (-ldb2)" >&5
17862 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
17863   echo $ac_n "(cached) $ac_c" 1>&6
17864 else
17865   
17866         ol_DB_LIB=-ldb2
17867         ol_LIBS=$LIBS
17868         LIBS="$ol_DB_LIB $LIBS"
17869
17870         cat > conftest.$ac_ext <<EOF
17871 #line 17872 "configure"
17872 #include "confdefs.h"
17873
17874 #ifdef HAVE_DB_185_H
17875 # include <db_185.h>
17876 #else
17877 # include <db.h>
17878 #endif
17879
17880 #ifndef DB_VERSION_MAJOR
17881 # define DB_VERSION_MAJOR 1
17882 #endif
17883
17884 #ifndef NULL
17885 #define NULL ((void*)0)
17886 #endif
17887
17888 int main() {
17889
17890 #if DB_VERSION_MAJOR > 1
17891         {
17892                 char *version;
17893                 int major, minor, patch;
17894
17895                 version = db_version( &major, &minor, &patch );
17896
17897                 if( major != DB_VERSION_MAJOR ||
17898                         minor < DB_VERSION_MINOR )
17899                 {
17900                         printf("Berkeley DB version mismatch\n"
17901                                 "\texpected: %s\n\tgot: %s\n",
17902                                 DB_VERSION_STRING, version);
17903                         return 1;
17904                 }
17905         }
17906 #endif
17907
17908 #if DB_VERSION_MAJOR > 2
17909         db_env_create( NULL, 0 );
17910 #elif DB_VERSION_MAJOR > 1
17911         db_appexit( NULL );
17912 #else
17913         (void) dbopen( NULL, 0, 0, 0, NULL);
17914 #endif
17915
17916 ; return 0; }
17917 EOF
17918 if { (eval echo configure:17919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17919   rm -rf conftest*
17920   ol_cv_db_db2=yes
17921 else
17922   echo "configure: failed program was:" >&5
17923   cat conftest.$ac_ext >&5
17924   rm -rf conftest*
17925   ol_cv_db_db2=no
17926 fi
17927 rm -f conftest*
17928
17929         LIBS="$ol_LIBS"
17930
17931 fi
17932
17933 echo "$ac_t""$ol_cv_db_db2" 1>&6
17934
17935         if test $ol_cv_db_db2 = yes ; then
17936                 ol_cv_lib_db=-ldb2
17937         fi
17938 fi
17939
17940 if test $ol_cv_lib_db = no ; then
17941         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
17942 echo "configure:17943: checking for Berkeley DB link (-ldb1)" >&5
17943 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
17944   echo $ac_n "(cached) $ac_c" 1>&6
17945 else
17946   
17947         ol_DB_LIB=-ldb1
17948         ol_LIBS=$LIBS
17949         LIBS="$ol_DB_LIB $LIBS"
17950
17951         cat > conftest.$ac_ext <<EOF
17952 #line 17953 "configure"
17953 #include "confdefs.h"
17954
17955 #ifdef HAVE_DB_185_H
17956 # include <db_185.h>
17957 #else
17958 # include <db.h>
17959 #endif
17960
17961 #ifndef DB_VERSION_MAJOR
17962 # define DB_VERSION_MAJOR 1
17963 #endif
17964
17965 #ifndef NULL
17966 #define NULL ((void*)0)
17967 #endif
17968
17969 int main() {
17970
17971 #if DB_VERSION_MAJOR > 1
17972         {
17973                 char *version;
17974                 int major, minor, patch;
17975
17976                 version = db_version( &major, &minor, &patch );
17977
17978                 if( major != DB_VERSION_MAJOR ||
17979                         minor < DB_VERSION_MINOR )
17980                 {
17981                         printf("Berkeley DB version mismatch\n"
17982                                 "\texpected: %s\n\tgot: %s\n",
17983                                 DB_VERSION_STRING, version);
17984                         return 1;
17985                 }
17986         }
17987 #endif
17988
17989 #if DB_VERSION_MAJOR > 2
17990         db_env_create( NULL, 0 );
17991 #elif DB_VERSION_MAJOR > 1
17992         db_appexit( NULL );
17993 #else
17994         (void) dbopen( NULL, 0, 0, 0, NULL);
17995 #endif
17996
17997 ; return 0; }
17998 EOF
17999 if { (eval echo configure:18000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18000   rm -rf conftest*
18001   ol_cv_db_db1=yes
18002 else
18003   echo "configure: failed program was:" >&5
18004   cat conftest.$ac_ext >&5
18005   rm -rf conftest*
18006   ol_cv_db_db1=no
18007 fi
18008 rm -f conftest*
18009
18010         LIBS="$ol_LIBS"
18011
18012 fi
18013
18014 echo "$ac_t""$ol_cv_db_db1" 1>&6
18015
18016         if test $ol_cv_db_db1 = yes ; then
18017                 ol_cv_lib_db=-ldb1
18018         fi
18019 fi
18020
18021
18022         if test "$ol_cv_lib_db" != no ; then
18023                 ol_cv_berkeley_db=yes
18024                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
18025 echo "configure:18026: checking for Berkeley DB thread support" >&5
18026 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
18027   echo $ac_n "(cached) $ac_c" 1>&6
18028 else
18029   
18030         ol_LIBS="$LIBS"
18031         if test $ol_cv_lib_db != yes ; then
18032                 LIBS="$ol_cv_lib_db"
18033         fi
18034
18035         if test "$cross_compiling" = yes; then
18036   ol_cv_berkeley_db_thread=cross
18037 else
18038   cat > conftest.$ac_ext <<EOF
18039 #line 18040 "configure"
18040 #include "confdefs.h"
18041
18042 #ifdef HAVE_DB_185_H
18043         choke me;
18044 #else
18045 #include <db.h>
18046 #endif
18047 #ifndef NULL
18048 #define NULL ((void *)0)
18049 #endif
18050 main()
18051 {
18052         int rc;
18053         u_int32_t flags = DB_CREATE |
18054 #ifdef DB_PRIVATE
18055                 DB_PRIVATE |
18056 #endif
18057                 DB_THREAD;
18058
18059 #if DB_VERSION_MAJOR > 2
18060         DB_ENV *env = NULL;
18061
18062         rc = db_env_create( &env, 0 );
18063
18064         flags |= DB_INIT_MPOOL;
18065 #ifdef DB_MPOOL_PRIVATE
18066         flags |= DB_MPOOL_PRIVATE;
18067 #endif
18068
18069         if( rc ) {
18070                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
18071                 return rc;
18072         }
18073
18074 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
18075         rc = env->open( env, NULL, flags, 0 );
18076 #else
18077         rc = env->open( env, NULL, NULL, flags, 0 );
18078 #endif
18079
18080         if ( rc == 0 ) {
18081                 rc = env->close( env, 0 );
18082         }
18083
18084         if( rc ) {
18085                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
18086                 return rc;
18087         }
18088
18089 #else
18090         DB_ENV env;
18091         memset( &env, '\0', sizeof(env) );
18092
18093         rc = db_appinit( NULL, NULL, &env, flags );
18094
18095         if( rc == 0 ) {
18096                 db_appexit( &env );
18097         }
18098
18099         unlink("__db_mpool.share");
18100         unlink("__db_lock.share");
18101 #endif
18102
18103         return rc;
18104 }
18105 EOF
18106 if { (eval echo configure:18107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
18107 then
18108   ol_cv_berkeley_db_thread=yes
18109 else
18110   echo "configure: failed program was:" >&5
18111   cat conftest.$ac_ext >&5
18112   rm -fr conftest*
18113   ol_cv_berkeley_db_thread=no
18114 fi
18115 rm -fr conftest*
18116 fi
18117
18118
18119         LIBS="$ol_LIBS"
18120
18121         if test $ol_cv_berkeley_db_thread != no ; then
18122                 cat >> confdefs.h <<\EOF
18123 #define HAVE_BERKELEY_DB_THREAD 1
18124 EOF
18125
18126         fi
18127
18128 fi
18129
18130 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
18131         fi
18132 fi
18133
18134         fi
18135
18136         if test $ol_cv_berkeley_db != no ; then
18137                 cat >> confdefs.h <<\EOF
18138 #define HAVE_BERKELEY_DB 1
18139 EOF
18140
18141
18142                 ol_link_ldbm=berkeley
18143                 ol_with_ldbm_api=berkeley
18144
18145                 if test $ol_with_ldbm_type = hash ; then
18146                         cat >> confdefs.h <<\EOF
18147 #define LDBM_USE_DBHASH 1
18148 EOF
18149
18150                 else
18151                         cat >> confdefs.h <<\EOF
18152 #define LDBM_USE_DBBTREE 1
18153 EOF
18154
18155                 fi
18156
18157                                                 if test $ol_cv_lib_db != yes ; then
18158                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
18159                 fi
18160         fi
18161 fi
18162
18163 if test $ol_enable_bdb = yes -a $ol_link_ldbm != berkeley ; then
18164         { echo "configure: error: BDB: BerkeleyDB not available" 1>&2; exit 1; }
18165 elif test $ol_enable_bdb != no -a $ol_link_ldbm = berkeley ; then
18166         echo $ac_n "checking Berkeley DB version for BDB backend""... $ac_c" 1>&6
18167 echo "configure:18168: checking Berkeley DB version for BDB backend" >&5
18168 if eval "test \"\${ol_cv_bdb_compat+set}\" = set"; then
18169   echo $ac_n "(cached) $ac_c" 1>&6
18170 else
18171   
18172         cat > conftest.$ac_ext <<EOF
18173 #line 18174 "configure"
18174 #include "confdefs.h"
18175
18176 #include <db.h>
18177
18178  /* this check could be improved */
18179 #ifndef DB_VERSION_MAJOR
18180 #       define DB_VERSION_MAJOR 1
18181 #endif
18182
18183 /* require 4.0 or later */
18184 #if DB_VERSION_MAJOR >= 4 
18185         __db_version_compat
18186 #endif
18187         
18188 EOF
18189 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
18190   egrep "__db_version_compat" >/dev/null 2>&1; then
18191   rm -rf conftest*
18192   ol_cv_bdb_compat=yes
18193 else
18194   rm -rf conftest*
18195   ol_cv_bdb_compat=no
18196 fi
18197 rm -f conftest*
18198
18199 fi
18200
18201 echo "$ac_t""$ol_cv_bdb_compat" 1>&6
18202
18203
18204         if test $ol_cv_bdb_compat = yes ; then
18205                 ol_enable_bdb=yes
18206         elif test $ol_enable_bdb = yes ; then
18207                 { echo "configure: error: BDB: BerkeleyDB version incompatible" 1>&2; exit 1; }
18208         else
18209                 ol_enable_bdb=no
18210         fi
18211 fi
18212
18213 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
18214         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
18215         ol_with_ldbm_api=none
18216 fi
18217
18218 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
18219         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
18220 echo "configure:18221: checking for MDBM library" >&5
18221 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
18222   echo $ac_n "(cached) $ac_c" 1>&6
18223 else
18224         ol_LIBS="$LIBS"
18225         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
18226 echo "configure:18227: checking for mdbm_set_chain" >&5
18227 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
18228   echo $ac_n "(cached) $ac_c" 1>&6
18229 else
18230   cat > conftest.$ac_ext <<EOF
18231 #line 18232 "configure"
18232 #include "confdefs.h"
18233 /* System header to define __stub macros and hopefully few prototypes,
18234     which can conflict with char mdbm_set_chain(); below.  */
18235 #include <assert.h>
18236 /* Override any gcc2 internal prototype to avoid an error.  */
18237 /* We use char because int might match the return type of a gcc2
18238     builtin and then its argument prototype would still apply.  */
18239 char mdbm_set_chain();
18240 char (*f)();
18241
18242 int main() {
18243
18244 /* The GNU C library defines this for functions which it implements
18245     to always fail with ENOSYS.  Some functions are actually named
18246     something starting with __ and the normal name is an alias.  */
18247 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
18248 choke me
18249 #else
18250 f = mdbm_set_chain;
18251 #endif
18252
18253 ; return 0; }
18254 EOF
18255 if { (eval echo configure:18256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18256   rm -rf conftest*
18257   eval "ac_cv_func_mdbm_set_chain=yes"
18258 else
18259   echo "configure: failed program was:" >&5
18260   cat conftest.$ac_ext >&5
18261   rm -rf conftest*
18262   eval "ac_cv_func_mdbm_set_chain=no"
18263 fi
18264 rm -f conftest*
18265 fi
18266
18267 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
18268   echo "$ac_t""yes" 1>&6
18269   ol_cv_lib_mdbm=yes
18270 else
18271   echo "$ac_t""no" 1>&6
18272
18273                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
18274 echo "configure:18275: checking for mdbm_set_chain in -lmdbm" >&5
18275 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
18276 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
18277   echo $ac_n "(cached) $ac_c" 1>&6
18278 else
18279   ac_save_LIBS="$LIBS"
18280 LIBS="-lmdbm  $LIBS"
18281 cat > conftest.$ac_ext <<EOF
18282 #line 18283 "configure"
18283 #include "confdefs.h"
18284 /* Override any gcc2 internal prototype to avoid an error.  */
18285 /* We use char because int might match the return type of a gcc2
18286     builtin and then its argument prototype would still apply.  */
18287 char mdbm_set_chain();
18288
18289 int main() {
18290 mdbm_set_chain()
18291 ; return 0; }
18292 EOF
18293 if { (eval echo configure:18294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18294   rm -rf conftest*
18295   eval "ac_cv_lib_$ac_lib_var=yes"
18296 else
18297   echo "configure: failed program was:" >&5
18298   cat conftest.$ac_ext >&5
18299   rm -rf conftest*
18300   eval "ac_cv_lib_$ac_lib_var=no"
18301 fi
18302 rm -f conftest*
18303 LIBS="$ac_save_LIBS"
18304
18305 fi
18306 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
18307   echo "$ac_t""yes" 1>&6
18308   ol_cv_lib_mdbm=-lmdbm
18309 else
18310   echo "$ac_t""no" 1>&6
18311 ol_cv_lib_mdbm=no
18312 fi
18313
18314         
18315 fi
18316
18317         LIBS="$ol_LIBS"
18318
18319 fi
18320
18321 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
18322
18323
18324  for ac_hdr in mdbm.h
18325 do
18326 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
18327 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
18328 echo "configure:18329: checking for $ac_hdr" >&5
18329 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
18330   echo $ac_n "(cached) $ac_c" 1>&6
18331 else
18332   cat > conftest.$ac_ext <<EOF
18333 #line 18334 "configure"
18334 #include "confdefs.h"
18335 #include <$ac_hdr>
18336 EOF
18337 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
18338 { (eval echo configure:18339: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
18339 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
18340 if test -z "$ac_err"; then
18341   rm -rf conftest*
18342   eval "ac_cv_header_$ac_safe=yes"
18343 else
18344   echo "$ac_err" >&5
18345   echo "configure: failed program was:" >&5
18346   cat conftest.$ac_ext >&5
18347   rm -rf conftest*
18348   eval "ac_cv_header_$ac_safe=no"
18349 fi
18350 rm -f conftest*
18351 fi
18352 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
18353   echo "$ac_t""yes" 1>&6
18354     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
18355   cat >> confdefs.h <<EOF
18356 #define $ac_tr_hdr 1
18357 EOF
18358  
18359 else
18360   echo "$ac_t""no" 1>&6
18361 fi
18362 done
18363
18364  echo $ac_n "checking for db""... $ac_c" 1>&6
18365 echo "configure:18366: checking for db" >&5
18366 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
18367   echo $ac_n "(cached) $ac_c" 1>&6
18368 else
18369   
18370         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
18371                 ol_cv_mdbm=no
18372         else
18373                 ol_cv_mdbm=yes
18374         fi
18375
18376 fi
18377
18378 echo "$ac_t""$ol_cv_mdbm" 1>&6
18379  if test $ol_cv_mdbm = yes ; then
18380         cat >> confdefs.h <<\EOF
18381 #define HAVE_MDBM 1
18382 EOF
18383
18384  fi
18385
18386
18387         if test $ol_cv_mdbm = yes ; then
18388                 ol_link_ldbm=mdbm
18389                 ol_with_ldbm_api=mdbm
18390                 if test $ol_cv_lib_mdbm != yes ; then
18391                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
18392                 fi
18393         fi
18394 fi
18395
18396 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
18397         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
18398 echo "configure:18399: checking for GDBM library" >&5
18399 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
18400   echo $ac_n "(cached) $ac_c" 1>&6
18401 else
18402         ol_LIBS="$LIBS"
18403         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
18404 echo "configure:18405: checking for gdbm_open" >&5
18405 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
18406   echo $ac_n "(cached) $ac_c" 1>&6
18407 else
18408   cat > conftest.$ac_ext <<EOF
18409 #line 18410 "configure"
18410 #include "confdefs.h"
18411 /* System header to define __stub macros and hopefully few prototypes,
18412     which can conflict with char gdbm_open(); below.  */
18413 #include <assert.h>
18414 /* Override any gcc2 internal prototype to avoid an error.  */
18415 /* We use char because int might match the return type of a gcc2
18416     builtin and then its argument prototype would still apply.  */
18417 char gdbm_open();
18418 char (*f)();
18419
18420 int main() {
18421
18422 /* The GNU C library defines this for functions which it implements
18423     to always fail with ENOSYS.  Some functions are actually named
18424     something starting with __ and the normal name is an alias.  */
18425 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
18426 choke me
18427 #else
18428 f = gdbm_open;
18429 #endif
18430
18431 ; return 0; }
18432 EOF
18433 if { (eval echo configure:18434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18434   rm -rf conftest*
18435   eval "ac_cv_func_gdbm_open=yes"
18436 else
18437   echo "configure: failed program was:" >&5
18438   cat conftest.$ac_ext >&5
18439   rm -rf conftest*
18440   eval "ac_cv_func_gdbm_open=no"
18441 fi
18442 rm -f conftest*
18443 fi
18444
18445 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
18446   echo "$ac_t""yes" 1>&6
18447   ol_cv_lib_gdbm=yes
18448 else
18449   echo "$ac_t""no" 1>&6
18450
18451                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
18452 echo "configure:18453: checking for gdbm_open in -lgdbm" >&5
18453 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
18454 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
18455   echo $ac_n "(cached) $ac_c" 1>&6
18456 else
18457   ac_save_LIBS="$LIBS"
18458 LIBS="-lgdbm  $LIBS"
18459 cat > conftest.$ac_ext <<EOF
18460 #line 18461 "configure"
18461 #include "confdefs.h"
18462 /* Override any gcc2 internal prototype to avoid an error.  */
18463 /* We use char because int might match the return type of a gcc2
18464     builtin and then its argument prototype would still apply.  */
18465 char gdbm_open();
18466
18467 int main() {
18468 gdbm_open()
18469 ; return 0; }
18470 EOF
18471 if { (eval echo configure:18472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18472   rm -rf conftest*
18473   eval "ac_cv_lib_$ac_lib_var=yes"
18474 else
18475   echo "configure: failed program was:" >&5
18476   cat conftest.$ac_ext >&5
18477   rm -rf conftest*
18478   eval "ac_cv_lib_$ac_lib_var=no"
18479 fi
18480 rm -f conftest*
18481 LIBS="$ac_save_LIBS"
18482
18483 fi
18484 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
18485   echo "$ac_t""yes" 1>&6
18486   ol_cv_lib_gdbm=-lgdbm
18487 else
18488   echo "$ac_t""no" 1>&6
18489 ol_cv_lib_gdbm=no
18490 fi
18491
18492         
18493 fi
18494
18495         LIBS="$ol_LIBS"
18496
18497 fi
18498
18499 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
18500
18501
18502  for ac_hdr in gdbm.h
18503 do
18504 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
18505 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
18506 echo "configure:18507: checking for $ac_hdr" >&5
18507 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
18508   echo $ac_n "(cached) $ac_c" 1>&6
18509 else
18510   cat > conftest.$ac_ext <<EOF
18511 #line 18512 "configure"
18512 #include "confdefs.h"
18513 #include <$ac_hdr>
18514 EOF
18515 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
18516 { (eval echo configure:18517: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
18517 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
18518 if test -z "$ac_err"; then
18519   rm -rf conftest*
18520   eval "ac_cv_header_$ac_safe=yes"
18521 else
18522   echo "$ac_err" >&5
18523   echo "configure: failed program was:" >&5
18524   cat conftest.$ac_ext >&5
18525   rm -rf conftest*
18526   eval "ac_cv_header_$ac_safe=no"
18527 fi
18528 rm -f conftest*
18529 fi
18530 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
18531   echo "$ac_t""yes" 1>&6
18532     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
18533   cat >> confdefs.h <<EOF
18534 #define $ac_tr_hdr 1
18535 EOF
18536  
18537 else
18538   echo "$ac_t""no" 1>&6
18539 fi
18540 done
18541
18542  echo $ac_n "checking for db""... $ac_c" 1>&6
18543 echo "configure:18544: checking for db" >&5
18544 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
18545   echo $ac_n "(cached) $ac_c" 1>&6
18546 else
18547   
18548         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
18549                 ol_cv_gdbm=no
18550         else
18551                 ol_cv_gdbm=yes
18552         fi
18553
18554 fi
18555
18556 echo "$ac_t""$ol_cv_gdbm" 1>&6
18557  if test $ol_cv_gdbm = yes ; then
18558         cat >> confdefs.h <<\EOF
18559 #define HAVE_GDBM 1
18560 EOF
18561
18562  fi
18563
18564
18565         if test $ol_cv_gdbm = yes ; then
18566                 ol_link_ldbm=gdbm
18567                 ol_with_ldbm_api=gdbm
18568
18569                 if test $ol_cv_lib_gdbm != yes ; then
18570                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
18571                 fi
18572         fi
18573 fi
18574
18575 if test $ol_with_ldbm_api = ndbm ; then
18576         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
18577 echo "configure:18578: checking for NDBM library" >&5
18578 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
18579   echo $ac_n "(cached) $ac_c" 1>&6
18580 else
18581         ol_LIBS="$LIBS"
18582         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
18583 echo "configure:18584: checking for dbm_open" >&5
18584 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
18585   echo $ac_n "(cached) $ac_c" 1>&6
18586 else
18587   cat > conftest.$ac_ext <<EOF
18588 #line 18589 "configure"
18589 #include "confdefs.h"
18590 /* System header to define __stub macros and hopefully few prototypes,
18591     which can conflict with char dbm_open(); below.  */
18592 #include <assert.h>
18593 /* Override any gcc2 internal prototype to avoid an error.  */
18594 /* We use char because int might match the return type of a gcc2
18595     builtin and then its argument prototype would still apply.  */
18596 char dbm_open();
18597 char (*f)();
18598
18599 int main() {
18600
18601 /* The GNU C library defines this for functions which it implements
18602     to always fail with ENOSYS.  Some functions are actually named
18603     something starting with __ and the normal name is an alias.  */
18604 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
18605 choke me
18606 #else
18607 f = dbm_open;
18608 #endif
18609
18610 ; return 0; }
18611 EOF
18612 if { (eval echo configure:18613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18613   rm -rf conftest*
18614   eval "ac_cv_func_dbm_open=yes"
18615 else
18616   echo "configure: failed program was:" >&5
18617   cat conftest.$ac_ext >&5
18618   rm -rf conftest*
18619   eval "ac_cv_func_dbm_open=no"
18620 fi
18621 rm -f conftest*
18622 fi
18623
18624 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
18625   echo "$ac_t""yes" 1>&6
18626   ol_cv_lib_ndbm=yes
18627 else
18628   echo "$ac_t""no" 1>&6
18629
18630                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
18631 echo "configure:18632: checking for dbm_open in -lndbm" >&5
18632 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
18633 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
18634   echo $ac_n "(cached) $ac_c" 1>&6
18635 else
18636   ac_save_LIBS="$LIBS"
18637 LIBS="-lndbm  $LIBS"
18638 cat > conftest.$ac_ext <<EOF
18639 #line 18640 "configure"
18640 #include "confdefs.h"
18641 /* Override any gcc2 internal prototype to avoid an error.  */
18642 /* We use char because int might match the return type of a gcc2
18643     builtin and then its argument prototype would still apply.  */
18644 char dbm_open();
18645
18646 int main() {
18647 dbm_open()
18648 ; return 0; }
18649 EOF
18650 if { (eval echo configure:18651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18651   rm -rf conftest*
18652   eval "ac_cv_lib_$ac_lib_var=yes"
18653 else
18654   echo "configure: failed program was:" >&5
18655   cat conftest.$ac_ext >&5
18656   rm -rf conftest*
18657   eval "ac_cv_lib_$ac_lib_var=no"
18658 fi
18659 rm -f conftest*
18660 LIBS="$ac_save_LIBS"
18661
18662 fi
18663 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
18664   echo "$ac_t""yes" 1>&6
18665   ol_cv_lib_ndbm=-lndbm
18666 else
18667   echo "$ac_t""no" 1>&6
18668
18669                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
18670 echo "configure:18671: checking for dbm_open in -ldbm" >&5
18671 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
18672 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
18673   echo $ac_n "(cached) $ac_c" 1>&6
18674 else
18675   ac_save_LIBS="$LIBS"
18676 LIBS="-ldbm  $LIBS"
18677 cat > conftest.$ac_ext <<EOF
18678 #line 18679 "configure"
18679 #include "confdefs.h"
18680 /* Override any gcc2 internal prototype to avoid an error.  */
18681 /* We use char because int might match the return type of a gcc2
18682     builtin and then its argument prototype would still apply.  */
18683 char dbm_open();
18684
18685 int main() {
18686 dbm_open()
18687 ; return 0; }
18688 EOF
18689 if { (eval echo configure:18690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18690   rm -rf conftest*
18691   eval "ac_cv_lib_$ac_lib_var=yes"
18692 else
18693   echo "configure: failed program was:" >&5
18694   cat conftest.$ac_ext >&5
18695   rm -rf conftest*
18696   eval "ac_cv_lib_$ac_lib_var=no"
18697 fi
18698 rm -f conftest*
18699 LIBS="$ac_save_LIBS"
18700
18701 fi
18702 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
18703   echo "$ac_t""yes" 1>&6
18704   ol_cv_lib_ndbm=-ldbm
18705 else
18706   echo "$ac_t""no" 1>&6
18707 ol_cv_lib_ndbm=no
18708 fi
18709                 
18710 fi
18711
18712         
18713 fi
18714
18715         LIBS="$ol_LIBS"
18716
18717 fi
18718
18719 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
18720
18721
18722  for ac_hdr in ndbm.h
18723 do
18724 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
18725 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
18726 echo "configure:18727: checking for $ac_hdr" >&5
18727 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
18728   echo $ac_n "(cached) $ac_c" 1>&6
18729 else
18730   cat > conftest.$ac_ext <<EOF
18731 #line 18732 "configure"
18732 #include "confdefs.h"
18733 #include <$ac_hdr>
18734 EOF
18735 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
18736 { (eval echo configure:18737: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
18737 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
18738 if test -z "$ac_err"; then
18739   rm -rf conftest*
18740   eval "ac_cv_header_$ac_safe=yes"
18741 else
18742   echo "$ac_err" >&5
18743   echo "configure: failed program was:" >&5
18744   cat conftest.$ac_ext >&5
18745   rm -rf conftest*
18746   eval "ac_cv_header_$ac_safe=no"
18747 fi
18748 rm -f conftest*
18749 fi
18750 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
18751   echo "$ac_t""yes" 1>&6
18752     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
18753   cat >> confdefs.h <<EOF
18754 #define $ac_tr_hdr 1
18755 EOF
18756  
18757 else
18758   echo "$ac_t""no" 1>&6
18759 fi
18760 done
18761
18762  echo $ac_n "checking for db""... $ac_c" 1>&6
18763 echo "configure:18764: checking for db" >&5
18764 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
18765   echo $ac_n "(cached) $ac_c" 1>&6
18766 else
18767   
18768         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
18769                 ol_cv_ndbm=no
18770         else
18771                 ol_cv_ndbm=yes
18772         fi
18773
18774 fi
18775
18776 echo "$ac_t""$ol_cv_ndbm" 1>&6
18777  if test $ol_cv_ndbm = yes ; then
18778         cat >> confdefs.h <<\EOF
18779 #define HAVE_NDBM 1
18780 EOF
18781
18782  fi
18783
18784
18785         if test $ol_cv_ndbm = yes ; then
18786                 ol_link_ldbm=ndbm
18787                 ol_with_ldbm_api=ndbm
18788
18789                 if test $ol_cv_lib_ndbm != yes ; then
18790                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
18791                 fi
18792         fi
18793 fi
18794
18795 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
18796         echo "configure: warning: could not find suitable LDBM backend" 1>&2
18797         if test $ol_enable_ldbm = yes ; then
18798                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
18799         fi
18800
18801         echo "configure: warning: disabling LDBM" 1>&2
18802         ol_enable_ldbm=no
18803 fi
18804
18805 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
18806         BUILD_LIBS_DYNAMIC=shared
18807         cat >> confdefs.h <<\EOF
18808 #define LDAP_LIBS_DYNAMIC 1
18809 EOF
18810
18811 else
18812         BUILD_LIBS_DYNAMIC=static
18813 fi
18814
18815 if test $ol_enable_wrappers != no ; then
18816         for ac_hdr in tcpd.h
18817 do
18818 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
18819 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
18820 echo "configure:18821: checking for $ac_hdr" >&5
18821 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
18822   echo $ac_n "(cached) $ac_c" 1>&6
18823 else
18824   cat > conftest.$ac_ext <<EOF
18825 #line 18826 "configure"
18826 #include "confdefs.h"
18827 #include <$ac_hdr>
18828 EOF
18829 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
18830 { (eval echo configure:18831: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
18831 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
18832 if test -z "$ac_err"; then
18833   rm -rf conftest*
18834   eval "ac_cv_header_$ac_safe=yes"
18835 else
18836   echo "$ac_err" >&5
18837   echo "configure: failed program was:" >&5
18838   cat conftest.$ac_ext >&5
18839   rm -rf conftest*
18840   eval "ac_cv_header_$ac_safe=no"
18841 fi
18842 rm -f conftest*
18843 fi
18844 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
18845   echo "$ac_t""yes" 1>&6
18846     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
18847   cat >> confdefs.h <<EOF
18848 #define $ac_tr_hdr 1
18849 EOF
18850  
18851                 echo $ac_n "checking for TCP wrappers library""... $ac_c" 1>&6
18852 echo "configure:18853: checking for TCP wrappers library" >&5
18853                 save_LIBS="$LIBS"
18854                 LIBS="$LIBS -lwrap"
18855                 cat > conftest.$ac_ext <<EOF
18856 #line 18857 "configure"
18857 #include "confdefs.h"
18858
18859 #include <tcpd.h>
18860 int allow_severity = 0;
18861 int deny_severity  = 0;
18862
18863 struct request_info *req;
18864                 
18865 int main() {
18866
18867 hosts_access(req)
18868                 
18869 ; return 0; }
18870 EOF
18871 if { (eval echo configure:18872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18872   rm -rf conftest*
18873   echo "$ac_t""-lwrap" 1>&6
18874                 have_wrappers=yes
18875                 LIBS="$save_LIBS"
18876 else
18877   echo "configure: failed program was:" >&5
18878   cat conftest.$ac_ext >&5
18879   rm -rf conftest*
18880   
18881                                 LIBS="$LIBS -lnsl"
18882                 cat > conftest.$ac_ext <<EOF
18883 #line 18884 "configure"
18884 #include "confdefs.h"
18885
18886 #include <tcpd.h>
18887 int allow_severity = 0;
18888 int deny_severity  = 0;
18889
18890 struct request_info *req;
18891                 
18892 int main() {
18893
18894 hosts_access(req)
18895                 
18896 ; return 0; }
18897 EOF
18898 if { (eval echo configure:18899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18899   rm -rf conftest*
18900   echo "$ac_t""-lwrap -lnsl" 1>&6
18901                 have_wrappers=yes
18902                 LIBS="$save_LIBS -lnsl"
18903 else
18904   echo "configure: failed program was:" >&5
18905   cat conftest.$ac_ext >&5
18906   rm -rf conftest*
18907   
18908                 echo "$ac_t""no" 1>&6
18909                 have_wrappers=no
18910                 LIBS=$save_LIBS
18911 fi
18912 rm -f conftest*
18913 fi
18914 rm -f conftest*
18915 else
18916   echo "$ac_t""no" 1>&6
18917 have_wrappers=no
18918 fi
18919 done
18920
18921
18922         if test $have_wrappers = yes ; then
18923                 cat >> confdefs.h <<\EOF
18924 #define HAVE_TCPD 1
18925 EOF
18926
18927                 WRAP_LIBS="-lwrap"
18928         elif test $ol_enable_wrappers = yes ; then
18929                 { echo "configure: error: could not find TCP wrappers, select apppropriate options ore disable" 1>&2; exit 1; }
18930         else
18931                 echo "configure: warning: could not find TCP wrappers, support disabled" 1>&2
18932                 WRAP_LIBS=""
18933         fi
18934 fi
18935
18936 if test $ol_enable_syslog != no ; then
18937         echo $ac_n "checking for openlog""... $ac_c" 1>&6
18938 echo "configure:18939: checking for openlog" >&5
18939 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
18940   echo $ac_n "(cached) $ac_c" 1>&6
18941 else
18942   cat > conftest.$ac_ext <<EOF
18943 #line 18944 "configure"
18944 #include "confdefs.h"
18945 /* System header to define __stub macros and hopefully few prototypes,
18946     which can conflict with char openlog(); below.  */
18947 #include <assert.h>
18948 /* Override any gcc2 internal prototype to avoid an error.  */
18949 /* We use char because int might match the return type of a gcc2
18950     builtin and then its argument prototype would still apply.  */
18951 char openlog();
18952 char (*f)();
18953
18954 int main() {
18955
18956 /* The GNU C library defines this for functions which it implements
18957     to always fail with ENOSYS.  Some functions are actually named
18958     something starting with __ and the normal name is an alias.  */
18959 #if defined (__stub_openlog) || defined (__stub___openlog)
18960 choke me
18961 #else
18962 f = openlog;
18963 #endif
18964
18965 ; return 0; }
18966 EOF
18967 if { (eval echo configure:18968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18968   rm -rf conftest*
18969   eval "ac_cv_func_openlog=yes"
18970 else
18971   echo "configure: failed program was:" >&5
18972   cat conftest.$ac_ext >&5
18973   rm -rf conftest*
18974   eval "ac_cv_func_openlog=no"
18975 fi
18976 rm -f conftest*
18977 fi
18978
18979 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
18980   echo "$ac_t""yes" 1>&6
18981   :
18982 else
18983   echo "$ac_t""no" 1>&6
18984 fi
18985
18986         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
18987                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
18988         fi
18989         ol_enable_syslog=$ac_cv_func_openlog
18990 fi
18991
18992
18993 ol_link_sql=no
18994 if test $ol_enable_sql != no ; then
18995         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
18996 echo "configure:18997: checking for SQLDriverConnect in -liodbc" >&5
18997 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
18998 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
18999   echo $ac_n "(cached) $ac_c" 1>&6
19000 else
19001   ac_save_LIBS="$LIBS"
19002 LIBS="-liodbc  $LIBS"
19003 cat > conftest.$ac_ext <<EOF
19004 #line 19005 "configure"
19005 #include "confdefs.h"
19006 /* Override any gcc2 internal prototype to avoid an error.  */
19007 /* We use char because int might match the return type of a gcc2
19008     builtin and then its argument prototype would still apply.  */
19009 char SQLDriverConnect();
19010
19011 int main() {
19012 SQLDriverConnect()
19013 ; return 0; }
19014 EOF
19015 if { (eval echo configure:19016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19016   rm -rf conftest*
19017   eval "ac_cv_lib_$ac_lib_var=yes"
19018 else
19019   echo "configure: failed program was:" >&5
19020   cat conftest.$ac_ext >&5
19021   rm -rf conftest*
19022   eval "ac_cv_lib_$ac_lib_var=no"
19023 fi
19024 rm -f conftest*
19025 LIBS="$ac_save_LIBS"
19026
19027 fi
19028 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19029   echo "$ac_t""yes" 1>&6
19030   have_iodbc=yes
19031 else
19032   echo "$ac_t""no" 1>&6
19033 have_iodbc=no
19034 fi
19035
19036         if test $have_iodbc = yes ; then
19037                 ol_link_sql="-liodbc"
19038         else
19039                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
19040 echo "configure:19041: checking for SQLDriverConnect in -lodbc" >&5
19041 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
19042 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19043   echo $ac_n "(cached) $ac_c" 1>&6
19044 else
19045   ac_save_LIBS="$LIBS"
19046 LIBS="-lodbc  $LIBS"
19047 cat > conftest.$ac_ext <<EOF
19048 #line 19049 "configure"
19049 #include "confdefs.h"
19050 /* Override any gcc2 internal prototype to avoid an error.  */
19051 /* We use char because int might match the return type of a gcc2
19052     builtin and then its argument prototype would still apply.  */
19053 char SQLDriverConnect();
19054
19055 int main() {
19056 SQLDriverConnect()
19057 ; return 0; }
19058 EOF
19059 if { (eval echo configure:19060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19060   rm -rf conftest*
19061   eval "ac_cv_lib_$ac_lib_var=yes"
19062 else
19063   echo "configure: failed program was:" >&5
19064   cat conftest.$ac_ext >&5
19065   rm -rf conftest*
19066   eval "ac_cv_lib_$ac_lib_var=no"
19067 fi
19068 rm -f conftest*
19069 LIBS="$ac_save_LIBS"
19070
19071 fi
19072 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19073   echo "$ac_t""yes" 1>&6
19074   have_odbc=yes
19075 else
19076   echo "$ac_t""no" 1>&6
19077 have_odbc=no
19078 fi
19079
19080                 if test $have_odbc = yes ; then
19081                         ol_link_sql="-lodbc"
19082                 fi
19083         fi
19084
19085         if test $ol_link_sql != no ; then
19086                 SLAPD_SQL_LIBS="$ol_link_sql"
19087
19088         elif test $ol_enable_sql != auto ; then
19089                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
19090         fi
19091 fi
19092
19093 ol_link_termcap=no
19094 for ac_hdr in termcap.h ncurses.h
19095 do
19096 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19097 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19098 echo "configure:19099: checking for $ac_hdr" >&5
19099 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19100   echo $ac_n "(cached) $ac_c" 1>&6
19101 else
19102   cat > conftest.$ac_ext <<EOF
19103 #line 19104 "configure"
19104 #include "confdefs.h"
19105 #include <$ac_hdr>
19106 EOF
19107 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19108 { (eval echo configure:19109: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19109 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19110 if test -z "$ac_err"; then
19111   rm -rf conftest*
19112   eval "ac_cv_header_$ac_safe=yes"
19113 else
19114   echo "$ac_err" >&5
19115   echo "configure: failed program was:" >&5
19116   cat conftest.$ac_ext >&5
19117   rm -rf conftest*
19118   eval "ac_cv_header_$ac_safe=no"
19119 fi
19120 rm -f conftest*
19121 fi
19122 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19123   echo "$ac_t""yes" 1>&6
19124     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19125   cat >> confdefs.h <<EOF
19126 #define $ac_tr_hdr 1
19127 EOF
19128  
19129 else
19130   echo "$ac_t""no" 1>&6
19131 fi
19132 done
19133
19134
19135 if test $ol_link_termcap = no ; then
19136         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
19137 echo "configure:19138: checking for tputs in -ltermcap" >&5
19138 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
19139 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19140   echo $ac_n "(cached) $ac_c" 1>&6
19141 else
19142   ac_save_LIBS="$LIBS"
19143 LIBS="-ltermcap  $LIBS"
19144 cat > conftest.$ac_ext <<EOF
19145 #line 19146 "configure"
19146 #include "confdefs.h"
19147 /* Override any gcc2 internal prototype to avoid an error.  */
19148 /* We use char because int might match the return type of a gcc2
19149     builtin and then its argument prototype would still apply.  */
19150 char tputs();
19151
19152 int main() {
19153 tputs()
19154 ; return 0; }
19155 EOF
19156 if { (eval echo configure:19157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19157   rm -rf conftest*
19158   eval "ac_cv_lib_$ac_lib_var=yes"
19159 else
19160   echo "configure: failed program was:" >&5
19161   cat conftest.$ac_ext >&5
19162   rm -rf conftest*
19163   eval "ac_cv_lib_$ac_lib_var=no"
19164 fi
19165 rm -f conftest*
19166 LIBS="$ac_save_LIBS"
19167
19168 fi
19169 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19170   echo "$ac_t""yes" 1>&6
19171   have_termcap=yes
19172 else
19173   echo "$ac_t""no" 1>&6
19174 have_termcap=no
19175 fi
19176
19177         if test $have_termcap = yes ; then
19178                 cat >> confdefs.h <<\EOF
19179 #define HAVE_TERMCAP 1
19180 EOF
19181
19182                 ol_link_termcap=yes
19183                 TERMCAP_LIBS=-ltermcap
19184         fi
19185 fi
19186
19187 if test $ol_link_termcap = no ; then
19188         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
19189 echo "configure:19190: checking for initscr in -lncurses" >&5
19190 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
19191 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19192   echo $ac_n "(cached) $ac_c" 1>&6
19193 else
19194   ac_save_LIBS="$LIBS"
19195 LIBS="-lncurses  $LIBS"
19196 cat > conftest.$ac_ext <<EOF
19197 #line 19198 "configure"
19198 #include "confdefs.h"
19199 /* Override any gcc2 internal prototype to avoid an error.  */
19200 /* We use char because int might match the return type of a gcc2
19201     builtin and then its argument prototype would still apply.  */
19202 char initscr();
19203
19204 int main() {
19205 initscr()
19206 ; return 0; }
19207 EOF
19208 if { (eval echo configure:19209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19209   rm -rf conftest*
19210   eval "ac_cv_lib_$ac_lib_var=yes"
19211 else
19212   echo "configure: failed program was:" >&5
19213   cat conftest.$ac_ext >&5
19214   rm -rf conftest*
19215   eval "ac_cv_lib_$ac_lib_var=no"
19216 fi
19217 rm -f conftest*
19218 LIBS="$ac_save_LIBS"
19219
19220 fi
19221 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19222   echo "$ac_t""yes" 1>&6
19223   have_ncurses=yes
19224 else
19225   echo "$ac_t""no" 1>&6
19226 have_ncurses=no
19227 fi
19228
19229         if test $have_ncurses = yes ; then
19230                 cat >> confdefs.h <<\EOF
19231 #define HAVE_NCURSES 1
19232 EOF
19233
19234                 ol_link_termcap=yes
19235                 TERMCAP_LIBS=-lncurses
19236         fi
19237 fi
19238
19239 if test $ol_link_termcap = no ; then
19240         cat >> confdefs.h <<\EOF
19241 #define NO_TERMCAP 1
19242 EOF
19243
19244         TERMCAP_LIBS=
19245 fi
19246
19247 ol_link_sasl=no
19248 ol_link_spasswd=no
19249 if test $ol_with_cyrus_sasl != no ; then
19250         for ac_hdr in sasl/sasl.h sasl.h
19251 do
19252 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19253 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19254 echo "configure:19255: checking for $ac_hdr" >&5
19255 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19256   echo $ac_n "(cached) $ac_c" 1>&6
19257 else
19258   cat > conftest.$ac_ext <<EOF
19259 #line 19260 "configure"
19260 #include "confdefs.h"
19261 #include <$ac_hdr>
19262 EOF
19263 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19264 { (eval echo configure:19265: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19265 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19266 if test -z "$ac_err"; then
19267   rm -rf conftest*
19268   eval "ac_cv_header_$ac_safe=yes"
19269 else
19270   echo "$ac_err" >&5
19271   echo "configure: failed program was:" >&5
19272   cat conftest.$ac_ext >&5
19273   rm -rf conftest*
19274   eval "ac_cv_header_$ac_safe=no"
19275 fi
19276 rm -f conftest*
19277 fi
19278 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19279   echo "$ac_t""yes" 1>&6
19280     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19281   cat >> confdefs.h <<EOF
19282 #define $ac_tr_hdr 1
19283 EOF
19284  
19285 else
19286   echo "$ac_t""no" 1>&6
19287 fi
19288 done
19289
19290
19291         if test $ac_cv_header_sasl_sasl_h = yes -o $ac_cv_header_sasl_h = yes; then
19292                 echo $ac_n "checking for sasl_client_init in -lsasl2""... $ac_c" 1>&6
19293 echo "configure:19294: checking for sasl_client_init in -lsasl2" >&5
19294 ac_lib_var=`echo sasl2'_'sasl_client_init | sed 'y%./+-:%__p__%'`
19295 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19296   echo $ac_n "(cached) $ac_c" 1>&6
19297 else
19298   ac_save_LIBS="$LIBS"
19299 LIBS="-lsasl2  $LIBS"
19300 cat > conftest.$ac_ext <<EOF
19301 #line 19302 "configure"
19302 #include "confdefs.h"
19303 /* Override any gcc2 internal prototype to avoid an error.  */
19304 /* We use char because int might match the return type of a gcc2
19305     builtin and then its argument prototype would still apply.  */
19306 char sasl_client_init();
19307
19308 int main() {
19309 sasl_client_init()
19310 ; return 0; }
19311 EOF
19312 if { (eval echo configure:19313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19313   rm -rf conftest*
19314   eval "ac_cv_lib_$ac_lib_var=yes"
19315 else
19316   echo "configure: failed program was:" >&5
19317   cat conftest.$ac_ext >&5
19318   rm -rf conftest*
19319   eval "ac_cv_lib_$ac_lib_var=no"
19320 fi
19321 rm -f conftest*
19322 LIBS="$ac_save_LIBS"
19323
19324 fi
19325 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19326   echo "$ac_t""yes" 1>&6
19327   ol_link_sasl="-lsasl2"
19328 else
19329   echo "$ac_t""no" 1>&6
19330 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
19331 echo "configure:19332: checking for sasl_client_init in -lsasl" >&5
19332 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
19333 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19334   echo $ac_n "(cached) $ac_c" 1>&6
19335 else
19336   ac_save_LIBS="$LIBS"
19337 LIBS="-lsasl  $LIBS"
19338 cat > conftest.$ac_ext <<EOF
19339 #line 19340 "configure"
19340 #include "confdefs.h"
19341 /* Override any gcc2 internal prototype to avoid an error.  */
19342 /* We use char because int might match the return type of a gcc2
19343     builtin and then its argument prototype would still apply.  */
19344 char sasl_client_init();
19345
19346 int main() {
19347 sasl_client_init()
19348 ; return 0; }
19349 EOF
19350 if { (eval echo configure:19351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19351   rm -rf conftest*
19352   eval "ac_cv_lib_$ac_lib_var=yes"
19353 else
19354   echo "configure: failed program was:" >&5
19355   cat conftest.$ac_ext >&5
19356   rm -rf conftest*
19357   eval "ac_cv_lib_$ac_lib_var=no"
19358 fi
19359 rm -f conftest*
19360 LIBS="$ac_save_LIBS"
19361
19362 fi
19363 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19364   echo "$ac_t""yes" 1>&6
19365   ol_link_sasl="-lsasl"
19366 else
19367   echo "$ac_t""no" 1>&6
19368 fi
19369
19370 fi
19371
19372         fi
19373
19374         if test $ol_link_sasl = no ; then
19375                 if test $ol_with_cyrus_sasl != auto ; then
19376                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
19377                 else
19378                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
19379                         echo "configure: warning: SASL authentication not supported!" 1>&2
19380                         if test $ol_link_tls = no ; then
19381                                 echo "configure: warning: Strong authentication not supported!" 1>&2
19382                         fi
19383                 fi
19384         else
19385                 cat >> confdefs.h <<\EOF
19386 #define HAVE_CYRUS_SASL 1
19387 EOF
19388
19389                 SASL_LIBS="$ol_link_sasl"
19390                 if test $ol_enable_spasswd != no ; then
19391                         ol_link_spasswd=yes
19392                 fi
19393         fi
19394
19395 else
19396         echo "configure: warning: SASL authentication not supported!" 1>&2
19397         if test $ol_link_tls = no ; then
19398                 echo "configure: warning: Strong authentication not supported!" 1>&2
19399         fi
19400 fi
19401
19402 if test $cross_compiling != yes -a "$ac_cv_mingw32" != yes ; then
19403         dev=no
19404         if test -r /dev/urandom ; then
19405                 dev="/dev/urandom";
19406         elif test -r /idev/urandom ; then
19407                 dev="/idev/urandom";
19408         elif test -r /dev/srandom ; then
19409                 dev="/dev/srandom";
19410         elif test -r /dev/random ; then
19411                 dev="/dev/random";
19412         elif test -r /idev/random ; then
19413                 dev="/idev/random";
19414         fi
19415
19416         if test $dev != no ; then
19417                 cat >> confdefs.h <<EOF
19418 #define URANDOM_DEVICE "$dev"
19419 EOF
19420
19421         fi
19422 fi
19423
19424 ol_link_fetch=no
19425 if test $ol_with_fetch != no ; then
19426         ol_LIBS=$LIBS
19427 LIBS="-lfetch -lcom_err $LIBS"
19428 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
19429 echo "configure:19430: checking fetch(3) library" >&5
19430 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
19431   echo $ac_n "(cached) $ac_c" 1>&6
19432 else
19433   
19434         cat > conftest.$ac_ext <<EOF
19435 #line 19436 "configure"
19436 #include "confdefs.h"
19437
19438 #include <sys/param.h>
19439 #include <stdio.h>
19440 #include <fetch.h>
19441 int main() {
19442 struct url *u = fetchParseURL("file:///"); 
19443 ; return 0; }
19444 EOF
19445 if { (eval echo configure:19446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19446   rm -rf conftest*
19447   ol_cv_lib_fetch=yes
19448 else
19449   echo "configure: failed program was:" >&5
19450   cat conftest.$ac_ext >&5
19451   rm -rf conftest*
19452   ol_cv_lib_fetch=no
19453 fi
19454 rm -f conftest*
19455 fi
19456
19457 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
19458 LIBS=$ol_LIBS
19459 if test $ol_cv_lib_fetch != no ; then
19460         ol_link_fetch="-lfetch -lcom_err"
19461         cat >> confdefs.h <<\EOF
19462 #define HAVE_FETCH 1
19463 EOF
19464
19465 fi
19466
19467
19468         if test $ol_cv_lib_fetch != no ; then
19469                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
19470                 ol_link_fetch=freebsd
19471
19472         elif test $ol_with_fetch != auto ; then
19473                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
19474         fi 
19475 fi
19476
19477 ol_link_readline=no
19478 if test $ol_with_readline != no ; then
19479         for ac_hdr in readline/readline.h readline/history.h
19480 do
19481 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19482 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19483 echo "configure:19484: checking for $ac_hdr" >&5
19484 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19485   echo $ac_n "(cached) $ac_c" 1>&6
19486 else
19487   cat > conftest.$ac_ext <<EOF
19488 #line 19489 "configure"
19489 #include "confdefs.h"
19490 #include <$ac_hdr>
19491 EOF
19492 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19493 { (eval echo configure:19494: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19494 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19495 if test -z "$ac_err"; then
19496   rm -rf conftest*
19497   eval "ac_cv_header_$ac_safe=yes"
19498 else
19499   echo "$ac_err" >&5
19500   echo "configure: failed program was:" >&5
19501   cat conftest.$ac_ext >&5
19502   rm -rf conftest*
19503   eval "ac_cv_header_$ac_safe=no"
19504 fi
19505 rm -f conftest*
19506 fi
19507 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19508   echo "$ac_t""yes" 1>&6
19509     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19510   cat >> confdefs.h <<EOF
19511 #define $ac_tr_hdr 1
19512 EOF
19513  
19514 else
19515   echo "$ac_t""no" 1>&6
19516 fi
19517 done
19518
19519
19520         if test $ac_cv_header_readline_readline_h = yes ; then
19521                 save_LIBS="$LIBS"
19522                 LIBS="$TERMCAP_LIBS $LIBS"
19523                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
19524 echo "configure:19525: checking for readline in -lreadline" >&5
19525 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
19526 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19527   echo $ac_n "(cached) $ac_c" 1>&6
19528 else
19529   ac_save_LIBS="$LIBS"
19530 LIBS="-lreadline  $LIBS"
19531 cat > conftest.$ac_ext <<EOF
19532 #line 19533 "configure"
19533 #include "confdefs.h"
19534 /* Override any gcc2 internal prototype to avoid an error.  */
19535 /* We use char because int might match the return type of a gcc2
19536     builtin and then its argument prototype would still apply.  */
19537 char readline();
19538
19539 int main() {
19540 readline()
19541 ; return 0; }
19542 EOF
19543 if { (eval echo configure:19544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19544   rm -rf conftest*
19545   eval "ac_cv_lib_$ac_lib_var=yes"
19546 else
19547   echo "configure: failed program was:" >&5
19548   cat conftest.$ac_ext >&5
19549   rm -rf conftest*
19550   eval "ac_cv_lib_$ac_lib_var=no"
19551 fi
19552 rm -f conftest*
19553 LIBS="$ac_save_LIBS"
19554
19555 fi
19556 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19557   echo "$ac_t""yes" 1>&6
19558   have_readline=yes
19559 else
19560   echo "$ac_t""no" 1>&6
19561 have_readline=no
19562 fi
19563
19564                 LIBS="$save_LIBS"
19565                         
19566                 if test $have_readline = yes ; then
19567                         ol_with_readline=found
19568                         ol_link_readline=yes
19569
19570                         READLINE_LIBS="-lreadline"
19571                 fi
19572         fi
19573 fi
19574
19575 if test $ol_link_readline = yes ; then
19576         cat >> confdefs.h <<\EOF
19577 #define HAVE_READLINE 1
19578 EOF
19579
19580 fi
19581
19582
19583 if test $ol_enable_crypt != no ; then
19584         echo $ac_n "checking for crypt""... $ac_c" 1>&6
19585 echo "configure:19586: checking for crypt" >&5
19586 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
19587   echo $ac_n "(cached) $ac_c" 1>&6
19588 else
19589   cat > conftest.$ac_ext <<EOF
19590 #line 19591 "configure"
19591 #include "confdefs.h"
19592 /* System header to define __stub macros and hopefully few prototypes,
19593     which can conflict with char crypt(); below.  */
19594 #include <assert.h>
19595 /* Override any gcc2 internal prototype to avoid an error.  */
19596 /* We use char because int might match the return type of a gcc2
19597     builtin and then its argument prototype would still apply.  */
19598 char crypt();
19599 char (*f)();
19600
19601 int main() {
19602
19603 /* The GNU C library defines this for functions which it implements
19604     to always fail with ENOSYS.  Some functions are actually named
19605     something starting with __ and the normal name is an alias.  */
19606 #if defined (__stub_crypt) || defined (__stub___crypt)
19607 choke me
19608 #else
19609 f = crypt;
19610 #endif
19611
19612 ; return 0; }
19613 EOF
19614 if { (eval echo configure:19615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19615   rm -rf conftest*
19616   eval "ac_cv_func_crypt=yes"
19617 else
19618   echo "configure: failed program was:" >&5
19619   cat conftest.$ac_ext >&5
19620   rm -rf conftest*
19621   eval "ac_cv_func_crypt=no"
19622 fi
19623 rm -f conftest*
19624 fi
19625
19626 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
19627   echo "$ac_t""yes" 1>&6
19628   have_crypt=yes
19629 else
19630   echo "$ac_t""no" 1>&6
19631
19632                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
19633 echo "configure:19634: checking for crypt in -lcrypt" >&5
19634 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
19635 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19636   echo $ac_n "(cached) $ac_c" 1>&6
19637 else
19638   ac_save_LIBS="$LIBS"
19639 LIBS="-lcrypt  $LIBS"
19640 cat > conftest.$ac_ext <<EOF
19641 #line 19642 "configure"
19642 #include "confdefs.h"
19643 /* Override any gcc2 internal prototype to avoid an error.  */
19644 /* We use char because int might match the return type of a gcc2
19645     builtin and then its argument prototype would still apply.  */
19646 char crypt();
19647
19648 int main() {
19649 crypt()
19650 ; return 0; }
19651 EOF
19652 if { (eval echo configure:19653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19653   rm -rf conftest*
19654   eval "ac_cv_lib_$ac_lib_var=yes"
19655 else
19656   echo "configure: failed program was:" >&5
19657   cat conftest.$ac_ext >&5
19658   rm -rf conftest*
19659   eval "ac_cv_lib_$ac_lib_var=no"
19660 fi
19661 rm -f conftest*
19662 LIBS="$ac_save_LIBS"
19663
19664 fi
19665 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19666   echo "$ac_t""yes" 1>&6
19667   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
19668                         have_crypt=yes
19669 else
19670   echo "$ac_t""no" 1>&6
19671 have_crypt=no
19672 fi
19673
19674 fi
19675
19676
19677         if test $have_crypt = yes ; then
19678                 cat >> confdefs.h <<\EOF
19679 #define HAVE_CRYPT 1
19680 EOF
19681
19682         else
19683                 echo "configure: warning: could not find crypt" 1>&2
19684                 if test $ol_enable_crypt = yes ; then
19685                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
19686                 fi
19687
19688                 echo "configure: warning: disabling crypt support" 1>&2
19689                 ol_enable_crypt=no
19690         fi
19691 fi
19692
19693 if test $ol_enable_proctitle != no ; then
19694         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
19695 echo "configure:19696: checking for setproctitle" >&5
19696 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
19697   echo $ac_n "(cached) $ac_c" 1>&6
19698 else
19699   cat > conftest.$ac_ext <<EOF
19700 #line 19701 "configure"
19701 #include "confdefs.h"
19702 /* System header to define __stub macros and hopefully few prototypes,
19703     which can conflict with char setproctitle(); below.  */
19704 #include <assert.h>
19705 /* Override any gcc2 internal prototype to avoid an error.  */
19706 /* We use char because int might match the return type of a gcc2
19707     builtin and then its argument prototype would still apply.  */
19708 char setproctitle();
19709 char (*f)();
19710
19711 int main() {
19712
19713 /* The GNU C library defines this for functions which it implements
19714     to always fail with ENOSYS.  Some functions are actually named
19715     something starting with __ and the normal name is an alias.  */
19716 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
19717 choke me
19718 #else
19719 f = setproctitle;
19720 #endif
19721
19722 ; return 0; }
19723 EOF
19724 if { (eval echo configure:19725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19725   rm -rf conftest*
19726   eval "ac_cv_func_setproctitle=yes"
19727 else
19728   echo "configure: failed program was:" >&5
19729   cat conftest.$ac_ext >&5
19730   rm -rf conftest*
19731   eval "ac_cv_func_setproctitle=no"
19732 fi
19733 rm -f conftest*
19734 fi
19735
19736 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
19737   echo "$ac_t""yes" 1>&6
19738   have_setproctitle=yes
19739 else
19740   echo "$ac_t""no" 1>&6
19741
19742                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
19743 echo "configure:19744: checking for setproctitle in -lutil" >&5
19744 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
19745 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19746   echo $ac_n "(cached) $ac_c" 1>&6
19747 else
19748   ac_save_LIBS="$LIBS"
19749 LIBS="-lutil  $LIBS"
19750 cat > conftest.$ac_ext <<EOF
19751 #line 19752 "configure"
19752 #include "confdefs.h"
19753 /* Override any gcc2 internal prototype to avoid an error.  */
19754 /* We use char because int might match the return type of a gcc2
19755     builtin and then its argument prototype would still apply.  */
19756 char setproctitle();
19757
19758 int main() {
19759 setproctitle()
19760 ; return 0; }
19761 EOF
19762 if { (eval echo configure:19763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19763   rm -rf conftest*
19764   eval "ac_cv_lib_$ac_lib_var=yes"
19765 else
19766   echo "configure: failed program was:" >&5
19767   cat conftest.$ac_ext >&5
19768   rm -rf conftest*
19769   eval "ac_cv_lib_$ac_lib_var=no"
19770 fi
19771 rm -f conftest*
19772 LIBS="$ac_save_LIBS"
19773
19774 fi
19775 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19776   echo "$ac_t""yes" 1>&6
19777   have_setproctitle=yes
19778                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
19779 else
19780   echo "$ac_t""no" 1>&6
19781 have_setproctitle=no
19782                         LIBOBJS="$LIBOBJS setproctitle.o"
19783                         LIBSRCS="$LIBSRCS setproctitle.c"
19784 fi
19785
19786 fi
19787
19788
19789         if test $have_setproctitle = yes ; then
19790                 cat >> confdefs.h <<\EOF
19791 #define HAVE_SETPROCTITLE 1
19792 EOF
19793
19794         fi
19795 fi
19796
19797 if test $ol_enable_slp != no ; then
19798         for ac_hdr in slp.h 
19799 do
19800 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19801 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19802 echo "configure:19803: checking for $ac_hdr" >&5
19803 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19804   echo $ac_n "(cached) $ac_c" 1>&6
19805 else
19806   cat > conftest.$ac_ext <<EOF
19807 #line 19808 "configure"
19808 #include "confdefs.h"
19809 #include <$ac_hdr>
19810 EOF
19811 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19812 { (eval echo configure:19813: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19813 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19814 if test -z "$ac_err"; then
19815   rm -rf conftest*
19816   eval "ac_cv_header_$ac_safe=yes"
19817 else
19818   echo "$ac_err" >&5
19819   echo "configure: failed program was:" >&5
19820   cat conftest.$ac_ext >&5
19821   rm -rf conftest*
19822   eval "ac_cv_header_$ac_safe=no"
19823 fi
19824 rm -f conftest*
19825 fi
19826 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19827   echo "$ac_t""yes" 1>&6
19828     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19829   cat >> confdefs.h <<EOF
19830 #define $ac_tr_hdr 1
19831 EOF
19832  
19833 else
19834   echo "$ac_t""no" 1>&6
19835 fi
19836 done
19837
19838
19839         if test $ac_cv_header_slp_h = yes ; then
19840                 echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
19841 echo "configure:19842: checking for SLPOpen in -lslp" >&5
19842 ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-:%__p__%'`
19843 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19844   echo $ac_n "(cached) $ac_c" 1>&6
19845 else
19846   ac_save_LIBS="$LIBS"
19847 LIBS="-lslp  $LIBS"
19848 cat > conftest.$ac_ext <<EOF
19849 #line 19850 "configure"
19850 #include "confdefs.h"
19851 /* Override any gcc2 internal prototype to avoid an error.  */
19852 /* We use char because int might match the return type of a gcc2
19853     builtin and then its argument prototype would still apply.  */
19854 char SLPOpen();
19855
19856 int main() {
19857 SLPOpen()
19858 ; return 0; }
19859 EOF
19860 if { (eval echo configure:19861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19861   rm -rf conftest*
19862   eval "ac_cv_lib_$ac_lib_var=yes"
19863 else
19864   echo "configure: failed program was:" >&5
19865   cat conftest.$ac_ext >&5
19866   rm -rf conftest*
19867   eval "ac_cv_lib_$ac_lib_var=no"
19868 fi
19869 rm -f conftest*
19870 LIBS="$ac_save_LIBS"
19871
19872 fi
19873 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19874   echo "$ac_t""yes" 1>&6
19875   have_slp=yes
19876 else
19877   echo "$ac_t""no" 1>&6
19878 have_slp=no
19879 fi
19880
19881                 if test $have_slp = yes ; then
19882                         cat >> confdefs.h <<\EOF
19883 #define HAVE_SLP 1
19884 EOF
19885
19886                         SLAPD_SLP_LIBS=-lslp
19887                 fi
19888
19889         elif test $ol_enable_slp = yes ; then
19890                 { echo "configure: error: SLP not found" 1>&2; exit 1; }
19891         fi
19892 fi
19893
19894 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
19895 echo "configure:19896: checking for ANSI C header files" >&5
19896 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
19897   echo $ac_n "(cached) $ac_c" 1>&6
19898 else
19899   cat > conftest.$ac_ext <<EOF
19900 #line 19901 "configure"
19901 #include "confdefs.h"
19902 #include <stdlib.h>
19903 #include <stdarg.h>
19904 #include <string.h>
19905 #include <float.h>
19906 EOF
19907 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19908 { (eval echo configure:19909: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19909 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19910 if test -z "$ac_err"; then
19911   rm -rf conftest*
19912   ac_cv_header_stdc=yes
19913 else
19914   echo "$ac_err" >&5
19915   echo "configure: failed program was:" >&5
19916   cat conftest.$ac_ext >&5
19917   rm -rf conftest*
19918   ac_cv_header_stdc=no
19919 fi
19920 rm -f conftest*
19921
19922 if test $ac_cv_header_stdc = yes; then
19923   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
19924 cat > conftest.$ac_ext <<EOF
19925 #line 19926 "configure"
19926 #include "confdefs.h"
19927 #include <string.h>
19928 EOF
19929 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
19930   egrep "memchr" >/dev/null 2>&1; then
19931   :
19932 else
19933   rm -rf conftest*
19934   ac_cv_header_stdc=no
19935 fi
19936 rm -f conftest*
19937
19938 fi
19939
19940 if test $ac_cv_header_stdc = yes; then
19941   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
19942 cat > conftest.$ac_ext <<EOF
19943 #line 19944 "configure"
19944 #include "confdefs.h"
19945 #include <stdlib.h>
19946 EOF
19947 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
19948   egrep "free" >/dev/null 2>&1; then
19949   :
19950 else
19951   rm -rf conftest*
19952   ac_cv_header_stdc=no
19953 fi
19954 rm -f conftest*
19955
19956 fi
19957
19958 if test $ac_cv_header_stdc = yes; then
19959   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
19960 if test "$cross_compiling" = yes; then
19961   :
19962 else
19963   cat > conftest.$ac_ext <<EOF
19964 #line 19965 "configure"
19965 #include "confdefs.h"
19966 #include <ctype.h>
19967 #if ((' ' & 0x0FF) == 0x020)
19968 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
19969 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
19970 #else
19971 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
19972  || ('j' <= (c) && (c) <= 'r') \
19973  || ('s' <= (c) && (c) <= 'z'))
19974 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
19975 #endif
19976 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
19977 int main () { int i; for (i = 0; i < 256; i++)
19978 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
19979 exit (0); }
19980
19981 EOF
19982 if { (eval echo configure:19983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
19983 then
19984   :
19985 else
19986   echo "configure: failed program was:" >&5
19987   cat conftest.$ac_ext >&5
19988   rm -fr conftest*
19989   ac_cv_header_stdc=no
19990 fi
19991 rm -fr conftest*
19992 fi
19993
19994 fi
19995 fi
19996
19997 echo "$ac_t""$ac_cv_header_stdc" 1>&6
19998 if test $ac_cv_header_stdc = yes; then
19999   cat >> confdefs.h <<\EOF
20000 #define STDC_HEADERS 1
20001 EOF
20002
20003 fi
20004
20005 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
20006 echo "configure:20007: checking for mode_t" >&5
20007 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
20008   echo $ac_n "(cached) $ac_c" 1>&6
20009 else
20010   cat > conftest.$ac_ext <<EOF
20011 #line 20012 "configure"
20012 #include "confdefs.h"
20013 #include <sys/types.h>
20014 #if STDC_HEADERS
20015 #include <stdlib.h>
20016 #include <stddef.h>
20017 #endif
20018
20019 EOF
20020 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20021   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
20022   rm -rf conftest*
20023   eval "ac_cv_type_mode_t=yes"
20024 else
20025   rm -rf conftest*
20026   eval "ac_cv_type_mode_t=no"
20027 fi
20028 rm -f conftest*
20029
20030 fi
20031 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
20032   echo "$ac_t""yes" 1>&6
20033 else
20034   echo "$ac_t""no" 1>&6
20035   cat >> confdefs.h <<EOF
20036 #define mode_t int
20037 EOF
20038
20039 fi
20040
20041 echo $ac_n "checking for off_t""... $ac_c" 1>&6
20042 echo "configure:20043: checking for off_t" >&5
20043 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
20044   echo $ac_n "(cached) $ac_c" 1>&6
20045 else
20046   cat > conftest.$ac_ext <<EOF
20047 #line 20048 "configure"
20048 #include "confdefs.h"
20049 #include <sys/types.h>
20050 #if STDC_HEADERS
20051 #include <stdlib.h>
20052 #include <stddef.h>
20053 #endif
20054
20055 EOF
20056 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20057   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
20058   rm -rf conftest*
20059   eval "ac_cv_type_off_t=yes"
20060 else
20061   rm -rf conftest*
20062   eval "ac_cv_type_off_t=no"
20063 fi
20064 rm -f conftest*
20065
20066 fi
20067 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
20068   echo "$ac_t""yes" 1>&6
20069 else
20070   echo "$ac_t""no" 1>&6
20071   cat >> confdefs.h <<EOF
20072 #define off_t long
20073 EOF
20074
20075 fi
20076
20077 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
20078 echo "configure:20079: checking for pid_t" >&5
20079 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
20080   echo $ac_n "(cached) $ac_c" 1>&6
20081 else
20082   cat > conftest.$ac_ext <<EOF
20083 #line 20084 "configure"
20084 #include "confdefs.h"
20085 #include <sys/types.h>
20086 #if STDC_HEADERS
20087 #include <stdlib.h>
20088 #include <stddef.h>
20089 #endif
20090
20091 EOF
20092 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20093   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
20094   rm -rf conftest*
20095   eval "ac_cv_type_pid_t=yes"
20096 else
20097   rm -rf conftest*
20098   eval "ac_cv_type_pid_t=no"
20099 fi
20100 rm -f conftest*
20101
20102 fi
20103 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
20104   echo "$ac_t""yes" 1>&6
20105 else
20106   echo "$ac_t""no" 1>&6
20107   cat >> confdefs.h <<EOF
20108 #define pid_t int
20109 EOF
20110
20111 fi
20112
20113 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
20114 echo "configure:20115: checking for ptrdiff_t" >&5
20115 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
20116   echo $ac_n "(cached) $ac_c" 1>&6
20117 else
20118   cat > conftest.$ac_ext <<EOF
20119 #line 20120 "configure"
20120 #include "confdefs.h"
20121 #include <stddef.h>
20122 int main() {
20123 ptrdiff_t p
20124 ; return 0; }
20125 EOF
20126 if { (eval echo configure:20127: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
20127   rm -rf conftest*
20128   am_cv_type_ptrdiff_t=yes
20129 else
20130   echo "configure: failed program was:" >&5
20131   cat conftest.$ac_ext >&5
20132   rm -rf conftest*
20133   am_cv_type_ptrdiff_t=no
20134 fi
20135 rm -f conftest*
20136 fi
20137
20138 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
20139    if test $am_cv_type_ptrdiff_t = yes; then
20140      cat >> confdefs.h <<\EOF
20141 #define HAVE_PTRDIFF_T 1
20142 EOF
20143
20144    fi
20145
20146 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
20147 echo "configure:20148: checking return type of signal handlers" >&5
20148 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
20149   echo $ac_n "(cached) $ac_c" 1>&6
20150 else
20151   cat > conftest.$ac_ext <<EOF
20152 #line 20153 "configure"
20153 #include "confdefs.h"
20154 #include <sys/types.h>
20155 #include <signal.h>
20156 #ifdef signal
20157 #undef signal
20158 #endif
20159 #ifdef __cplusplus
20160 extern "C" void (*signal (int, void (*)(int)))(int);
20161 #else
20162 void (*signal ()) ();
20163 #endif
20164
20165 int main() {
20166 int i;
20167 ; return 0; }
20168 EOF
20169 if { (eval echo configure:20170: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
20170   rm -rf conftest*
20171   ac_cv_type_signal=void
20172 else
20173   echo "configure: failed program was:" >&5
20174   cat conftest.$ac_ext >&5
20175   rm -rf conftest*
20176   ac_cv_type_signal=int
20177 fi
20178 rm -f conftest*
20179 fi
20180
20181 echo "$ac_t""$ac_cv_type_signal" 1>&6
20182 cat >> confdefs.h <<EOF
20183 #define RETSIGTYPE $ac_cv_type_signal
20184 EOF
20185
20186
20187 echo $ac_n "checking for size_t""... $ac_c" 1>&6
20188 echo "configure:20189: checking for size_t" >&5
20189 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
20190   echo $ac_n "(cached) $ac_c" 1>&6
20191 else
20192   cat > conftest.$ac_ext <<EOF
20193 #line 20194 "configure"
20194 #include "confdefs.h"
20195 #include <sys/types.h>
20196 #if STDC_HEADERS
20197 #include <stdlib.h>
20198 #include <stddef.h>
20199 #endif
20200
20201 EOF
20202 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20203   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
20204   rm -rf conftest*
20205   eval "ac_cv_type_size_t=yes"
20206 else
20207   rm -rf conftest*
20208   eval "ac_cv_type_size_t=no"
20209 fi
20210 rm -f conftest*
20211
20212 fi
20213 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
20214   echo "$ac_t""yes" 1>&6
20215 else
20216   echo "$ac_t""no" 1>&6
20217   cat >> confdefs.h <<EOF
20218 #define size_t unsigned
20219 EOF
20220
20221 fi
20222
20223
20224 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
20225 echo "configure:20226: checking for ssize_t" >&5
20226 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
20227   echo $ac_n "(cached) $ac_c" 1>&6
20228 else
20229   cat > conftest.$ac_ext <<EOF
20230 #line 20231 "configure"
20231 #include "confdefs.h"
20232 #include <sys/types.h>
20233 #if STDC_HEADERS
20234 #include <stdlib.h>
20235 #include <stddef.h>
20236 #endif
20237
20238 EOF
20239 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20240   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
20241   rm -rf conftest*
20242   eval "ac_cv_type_ssize_t=yes"
20243 else
20244   rm -rf conftest*
20245   eval "ac_cv_type_ssize_t=no"
20246 fi
20247 rm -f conftest*
20248
20249 fi
20250 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
20251   echo "$ac_t""yes" 1>&6
20252 else
20253   echo "$ac_t""no" 1>&6
20254   cat >> confdefs.h <<EOF
20255 #define ssize_t signed int
20256 EOF
20257
20258 fi
20259
20260 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
20261 echo "configure:20262: checking for caddr_t" >&5
20262 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
20263   echo $ac_n "(cached) $ac_c" 1>&6
20264 else
20265   cat > conftest.$ac_ext <<EOF
20266 #line 20267 "configure"
20267 #include "confdefs.h"
20268 #include <sys/types.h>
20269 #if STDC_HEADERS
20270 #include <stdlib.h>
20271 #include <stddef.h>
20272 #endif
20273
20274 EOF
20275 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20276   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
20277   rm -rf conftest*
20278   eval "ac_cv_type_caddr_t=yes"
20279 else
20280   rm -rf conftest*
20281   eval "ac_cv_type_caddr_t=no"
20282 fi
20283 rm -f conftest*
20284
20285 fi
20286 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
20287   echo "$ac_t""yes" 1>&6
20288 else
20289   echo "$ac_t""no" 1>&6
20290   cat >> confdefs.h <<EOF
20291 #define caddr_t char *
20292 EOF
20293
20294 fi
20295
20296
20297 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
20298 echo "configure:20299: checking for socklen_t" >&5
20299 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
20300   echo $ac_n "(cached) $ac_c" 1>&6
20301 else
20302   cat > conftest.$ac_ext <<EOF
20303 #line 20304 "configure"
20304 #include "confdefs.h"
20305
20306 #ifdef HAVE_SYS_TYPES_H
20307 #include <sys/types.h>
20308 #endif
20309 #ifdef HAVE_SYS_SOCKET_H
20310 #include <sys/socket.h>
20311 #endif
20312
20313 int main() {
20314 socklen_t len;
20315 ; return 0; }
20316 EOF
20317 if { (eval echo configure:20318: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
20318   rm -rf conftest*
20319   ol_cv_type_socklen_t=yes
20320 else
20321   echo "configure: failed program was:" >&5
20322   cat conftest.$ac_ext >&5
20323   rm -rf conftest*
20324   ol_cv_type_socklen_t=no
20325 fi
20326 rm -f conftest*
20327 fi
20328
20329 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
20330   if test $ol_cv_type_socklen_t = no; then
20331     cat >> confdefs.h <<\EOF
20332 #define socklen_t int
20333 EOF
20334
20335   fi
20336  
20337 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
20338 echo "configure:20339: checking for member st_blksize in aggregate type struct stat" >&5
20339 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
20340   echo $ac_n "(cached) $ac_c" 1>&6
20341 else
20342   cat > conftest.$ac_ext <<EOF
20343 #line 20344 "configure"
20344 #include "confdefs.h"
20345 #include <sys/types.h>
20346 #include <sys/stat.h>
20347 int main() {
20348 struct stat foo; foo.st_blksize;
20349 ; return 0; }
20350 EOF
20351 if { (eval echo configure:20352: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
20352   rm -rf conftest*
20353   ac_cv_c_struct_member_st_blksize=yes
20354 else
20355   echo "configure: failed program was:" >&5
20356   cat conftest.$ac_ext >&5
20357   rm -rf conftest*
20358   ac_cv_c_struct_member_st_blksize=no
20359 fi
20360 rm -f conftest*
20361 fi
20362
20363 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
20364 st_blksize="$ac_cv_c_struct_member_st_blksize"
20365 if test $ac_cv_c_struct_member_st_blksize = yes; then
20366   cat >> confdefs.h <<\EOF
20367 #define HAVE_ST_BLKSIZE 1
20368 EOF
20369
20370 fi
20371
20372 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
20373 echo "configure:20374: checking whether time.h and sys/time.h may both be included" >&5
20374 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
20375   echo $ac_n "(cached) $ac_c" 1>&6
20376 else
20377   cat > conftest.$ac_ext <<EOF
20378 #line 20379 "configure"
20379 #include "confdefs.h"
20380 #include <sys/types.h>
20381 #include <sys/time.h>
20382 #include <time.h>
20383 int main() {
20384 struct tm *tp;
20385 ; return 0; }
20386 EOF
20387 if { (eval echo configure:20388: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
20388   rm -rf conftest*
20389   ac_cv_header_time=yes
20390 else
20391   echo "configure: failed program was:" >&5
20392   cat conftest.$ac_ext >&5
20393   rm -rf conftest*
20394   ac_cv_header_time=no
20395 fi
20396 rm -f conftest*
20397 fi
20398
20399 echo "$ac_t""$ac_cv_header_time" 1>&6
20400 if test $ac_cv_header_time = yes; then
20401   cat >> confdefs.h <<\EOF
20402 #define TIME_WITH_SYS_TIME 1
20403 EOF
20404
20405 fi
20406
20407 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
20408 echo "configure:20409: checking whether struct tm is in sys/time.h or time.h" >&5
20409 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
20410   echo $ac_n "(cached) $ac_c" 1>&6
20411 else
20412   cat > conftest.$ac_ext <<EOF
20413 #line 20414 "configure"
20414 #include "confdefs.h"
20415 #include <sys/types.h>
20416 #include <time.h>
20417 int main() {
20418 struct tm *tp; tp->tm_sec;
20419 ; return 0; }
20420 EOF
20421 if { (eval echo configure:20422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
20422   rm -rf conftest*
20423   ac_cv_struct_tm=time.h
20424 else
20425   echo "configure: failed program was:" >&5
20426   cat conftest.$ac_ext >&5
20427   rm -rf conftest*
20428   ac_cv_struct_tm=sys/time.h
20429 fi
20430 rm -f conftest*
20431 fi
20432
20433 echo "$ac_t""$ac_cv_struct_tm" 1>&6
20434 if test $ac_cv_struct_tm = sys/time.h; then
20435   cat >> confdefs.h <<\EOF
20436 #define TM_IN_SYS_TIME 1
20437 EOF
20438
20439 fi
20440
20441 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
20442 echo "configure:20443: checking for uid_t in sys/types.h" >&5
20443 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
20444   echo $ac_n "(cached) $ac_c" 1>&6
20445 else
20446   cat > conftest.$ac_ext <<EOF
20447 #line 20448 "configure"
20448 #include "confdefs.h"
20449 #include <sys/types.h>
20450 EOF
20451 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20452   egrep "uid_t" >/dev/null 2>&1; then
20453   rm -rf conftest*
20454   ac_cv_type_uid_t=yes
20455 else
20456   rm -rf conftest*
20457   ac_cv_type_uid_t=no
20458 fi
20459 rm -f conftest*
20460
20461 fi
20462
20463 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
20464 if test $ac_cv_type_uid_t = no; then
20465   cat >> confdefs.h <<\EOF
20466 #define uid_t int
20467 EOF
20468
20469   cat >> confdefs.h <<\EOF
20470 #define gid_t int
20471 EOF
20472
20473 fi
20474
20475 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
20476 echo "configure:20477: checking for sig_atomic_t" >&5
20477 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
20478   echo $ac_n "(cached) $ac_c" 1>&6
20479 else
20480   cat > conftest.$ac_ext <<EOF
20481 #line 20482 "configure"
20482 #include "confdefs.h"
20483 #include <signal.h>
20484 int main() {
20485 sig_atomic_t atomic;
20486 ; return 0; }
20487 EOF
20488 if { (eval echo configure:20489: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
20489   rm -rf conftest*
20490   ol_cv_type_sig_atomic_t=yes
20491 else
20492   echo "configure: failed program was:" >&5
20493   cat conftest.$ac_ext >&5
20494   rm -rf conftest*
20495   ol_cv_type_sig_atomic_t=no
20496 fi
20497 rm -f conftest*
20498 fi
20499
20500 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
20501   if test $ol_cv_type_sig_atomic_t = no; then
20502     cat >> confdefs.h <<\EOF
20503 #define sig_atomic_t int
20504 EOF
20505
20506   fi
20507  
20508
20509
20510 # test for pw_gecos in struct passwd
20511 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
20512 echo "configure:20513: checking struct passwd for pw_gecos" >&5
20513 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
20514   echo $ac_n "(cached) $ac_c" 1>&6
20515 else
20516   
20517         cat > conftest.$ac_ext <<EOF
20518 #line 20519 "configure"
20519 #include "confdefs.h"
20520 #include <pwd.h>
20521 int main() {
20522
20523         struct passwd pwd;
20524         pwd.pw_gecos = pwd.pw_name;
20525
20526 ; return 0; }
20527 EOF
20528 if { (eval echo configure:20529: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
20529   rm -rf conftest*
20530   ol_cv_struct_passwd_pw_gecos=yes
20531 else
20532   echo "configure: failed program was:" >&5
20533   cat conftest.$ac_ext >&5
20534   rm -rf conftest*
20535   ol_cv_struct_passwd_pw_gecos=no
20536 fi
20537 rm -f conftest*
20538 fi
20539
20540 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
20541 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
20542         cat >> confdefs.h <<\EOF
20543 #define HAVE_PW_GECOS 1
20544 EOF
20545
20546 fi
20547
20548 # test for pw_passwd in struct passwd
20549 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
20550 echo "configure:20551: checking struct passwd for pw_passwd" >&5
20551 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
20552   echo $ac_n "(cached) $ac_c" 1>&6
20553 else
20554   
20555         cat > conftest.$ac_ext <<EOF
20556 #line 20557 "configure"
20557 #include "confdefs.h"
20558 #include <pwd.h>
20559 int main() {
20560
20561         struct passwd pwd;
20562         pwd.pw_passwd = pwd.pw_name;
20563
20564 ; return 0; }
20565 EOF
20566 if { (eval echo configure:20567: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
20567   rm -rf conftest*
20568   ol_cv_struct_passwd_pw_passwd=yes
20569 else
20570   echo "configure: failed program was:" >&5
20571   cat conftest.$ac_ext >&5
20572   rm -rf conftest*
20573   ol_cv_struct_passwd_pw_passwd=no
20574 fi
20575 rm -f conftest*
20576 fi
20577
20578 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
20579 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
20580         cat >> confdefs.h <<\EOF
20581 #define HAVE_PW_PASSWD 1
20582 EOF
20583
20584 fi
20585
20586
20587 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
20588 echo "configure:20589: checking if toupper() requires islower()" >&5
20589 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
20590   echo $ac_n "(cached) $ac_c" 1>&6
20591 else
20592   
20593         if test "$cross_compiling" = yes; then
20594   ol_cv_c_upper_lower=safe
20595 else
20596   cat > conftest.$ac_ext <<EOF
20597 #line 20598 "configure"
20598 #include "confdefs.h"
20599
20600 #include <ctype.h>
20601 main()
20602 {
20603         if ('C' == toupper('C'))
20604                 exit(0);
20605         else
20606                 exit(1);
20607 }
20608 EOF
20609 if { (eval echo configure:20610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
20610 then
20611   ol_cv_c_upper_lower=no
20612 else
20613   echo "configure: failed program was:" >&5
20614   cat conftest.$ac_ext >&5
20615   rm -fr conftest*
20616   ol_cv_c_upper_lower=yes
20617 fi
20618 rm -fr conftest*
20619 fi
20620
20621 fi
20622
20623 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
20624 if test $ol_cv_c_upper_lower != no ; then
20625         cat >> confdefs.h <<\EOF
20626 #define C_UPPER_LOWER 1
20627 EOF
20628
20629 fi
20630
20631 echo $ac_n "checking for working const""... $ac_c" 1>&6
20632 echo "configure:20633: checking for working const" >&5
20633 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
20634   echo $ac_n "(cached) $ac_c" 1>&6
20635 else
20636   cat > conftest.$ac_ext <<EOF
20637 #line 20638 "configure"
20638 #include "confdefs.h"
20639
20640 int main() {
20641
20642 /* Ultrix mips cc rejects this.  */
20643 typedef int charset[2]; const charset x;
20644 /* SunOS 4.1.1 cc rejects this.  */
20645 char const *const *ccp;
20646 char **p;
20647 /* NEC SVR4.0.2 mips cc rejects this.  */
20648 struct point {int x, y;};
20649 static struct point const zero = {0,0};
20650 /* AIX XL C 1.02.0.0 rejects this.
20651    It does not let you subtract one const X* pointer from another in an arm
20652    of an if-expression whose if-part is not a constant expression */
20653 const char *g = "string";
20654 ccp = &g + (g ? g-g : 0);
20655 /* HPUX 7.0 cc rejects these. */
20656 ++ccp;
20657 p = (char**) ccp;
20658 ccp = (char const *const *) p;
20659 { /* SCO 3.2v4 cc rejects this.  */
20660   char *t;
20661   char const *s = 0 ? (char *) 0 : (char const *) 0;
20662
20663   *t++ = 0;
20664 }
20665 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
20666   int x[] = {25, 17};
20667   const int *foo = &x[0];
20668   ++foo;
20669 }
20670 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
20671   typedef const int *iptr;
20672   iptr p = 0;
20673   ++p;
20674 }
20675 { /* AIX XL C 1.02.0.0 rejects this saying
20676      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
20677   struct s { int j; const int *ap[3]; };
20678   struct s *b; b->j = 5;
20679 }
20680 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
20681   const int foo = 10;
20682 }
20683
20684 ; return 0; }
20685 EOF
20686 if { (eval echo configure:20687: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
20687   rm -rf conftest*
20688   ac_cv_c_const=yes
20689 else
20690   echo "configure: failed program was:" >&5
20691   cat conftest.$ac_ext >&5
20692   rm -rf conftest*
20693   ac_cv_c_const=no
20694 fi
20695 rm -f conftest*
20696 fi
20697
20698 echo "$ac_t""$ac_cv_c_const" 1>&6
20699 if test $ac_cv_c_const = no; then
20700   cat >> confdefs.h <<\EOF
20701 #define const 
20702 EOF
20703
20704 fi
20705
20706 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
20707 echo "configure:20708: checking if compiler understands volatile" >&5
20708 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
20709   echo $ac_n "(cached) $ac_c" 1>&6
20710 else
20711   cat > conftest.$ac_ext <<EOF
20712 #line 20713 "configure"
20713 #include "confdefs.h"
20714 int x, y, z;
20715 int main() {
20716 volatile int a; int * volatile b = x ? &y : &z;
20717       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
20718       *b = 0;
20719 ; return 0; }
20720 EOF
20721 if { (eval echo configure:20722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
20722   rm -rf conftest*
20723   ol_cv_c_volatile=yes
20724 else
20725   echo "configure: failed program was:" >&5
20726   cat conftest.$ac_ext >&5
20727   rm -rf conftest*
20728   ol_cv_c_volatile=no
20729 fi
20730 rm -f conftest*
20731 fi
20732
20733 echo "$ac_t""$ol_cv_c_volatile" 1>&6
20734   if test $ol_cv_c_volatile = yes; then
20735     : 
20736   else
20737     cat >> confdefs.h <<\EOF
20738 #define volatile 
20739 EOF
20740
20741   fi
20742  
20743
20744 if test $cross_compiling = yes ; then
20745         cat >> confdefs.h <<\EOF
20746 #define CROSS_COMPILING 1
20747 EOF
20748
20749 else
20750         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
20751 echo "configure:20752: checking whether byte ordering is bigendian" >&5
20752 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
20753   echo $ac_n "(cached) $ac_c" 1>&6
20754 else
20755   ac_cv_c_bigendian=unknown
20756 # See if sys/param.h defines the BYTE_ORDER macro.
20757 cat > conftest.$ac_ext <<EOF
20758 #line 20759 "configure"
20759 #include "confdefs.h"
20760 #include <sys/types.h>
20761 #include <sys/param.h>
20762 int main() {
20763
20764 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
20765  bogus endian macros
20766 #endif
20767 ; return 0; }
20768 EOF
20769 if { (eval echo configure:20770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
20770   rm -rf conftest*
20771   # It does; now see whether it defined to BIG_ENDIAN or not.
20772 cat > conftest.$ac_ext <<EOF
20773 #line 20774 "configure"
20774 #include "confdefs.h"
20775 #include <sys/types.h>
20776 #include <sys/param.h>
20777 int main() {
20778
20779 #if BYTE_ORDER != BIG_ENDIAN
20780  not big endian
20781 #endif
20782 ; return 0; }
20783 EOF
20784 if { (eval echo configure:20785: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
20785   rm -rf conftest*
20786   ac_cv_c_bigendian=yes
20787 else
20788   echo "configure: failed program was:" >&5
20789   cat conftest.$ac_ext >&5
20790   rm -rf conftest*
20791   ac_cv_c_bigendian=no
20792 fi
20793 rm -f conftest*
20794 else
20795   echo "configure: failed program was:" >&5
20796   cat conftest.$ac_ext >&5
20797 fi
20798 rm -f conftest*
20799 if test $ac_cv_c_bigendian = unknown; then
20800 if test "$cross_compiling" = yes; then
20801     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
20802 else
20803   cat > conftest.$ac_ext <<EOF
20804 #line 20805 "configure"
20805 #include "confdefs.h"
20806 main () {
20807   /* Are we little or big endian?  From Harbison&Steele.  */
20808   union
20809   {
20810     long l;
20811     char c[sizeof (long)];
20812   } u;
20813   u.l = 1;
20814   exit (u.c[sizeof (long) - 1] == 1);
20815 }
20816 EOF
20817 if { (eval echo configure:20818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
20818 then
20819   ac_cv_c_bigendian=no
20820 else
20821   echo "configure: failed program was:" >&5
20822   cat conftest.$ac_ext >&5
20823   rm -fr conftest*
20824   ac_cv_c_bigendian=yes
20825 fi
20826 rm -fr conftest*
20827 fi
20828
20829 fi
20830 fi
20831
20832 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
20833 if test $ac_cv_c_bigendian = yes; then
20834   cat >> confdefs.h <<\EOF
20835 #define WORDS_BIGENDIAN 1
20836 EOF
20837
20838 fi
20839
20840 fi
20841
20842 echo $ac_n "checking size of short""... $ac_c" 1>&6
20843 echo "configure:20844: checking size of short" >&5 
20844 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
20845   echo $ac_n "(cached) $ac_c" 1>&6
20846 else
20847   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
20848   cat > conftest.$ac_ext <<EOF
20849 #line 20850 "configure"
20850 #include "confdefs.h"
20851 #include "confdefs.h" 
20852 #include <sys/types.h> 
20853  
20854
20855 int main() {
20856 switch (0) case 0: case (sizeof (short) == $ac_size):;
20857 ; return 0; }
20858 EOF
20859 if { (eval echo configure:20860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
20860   rm -rf conftest*
20861   ac_cv_sizeof_short=$ac_size
20862 else
20863   echo "configure: failed program was:" >&5
20864   cat conftest.$ac_ext >&5
20865 fi
20866 rm -f conftest* 
20867   if test x$ac_cv_sizeof_short != x ; then break; fi 
20868 done 
20869
20870 fi
20871  
20872 if test x$ac_cv_sizeof_short = x ; then 
20873   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
20874 fi 
20875 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
20876 cat >> confdefs.h <<EOF
20877 #define SIZEOF_SHORT $ac_cv_sizeof_short
20878 EOF
20879  
20880  
20881 echo $ac_n "checking size of int""... $ac_c" 1>&6
20882 echo "configure:20883: checking size of int" >&5 
20883 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
20884   echo $ac_n "(cached) $ac_c" 1>&6
20885 else
20886   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
20887   cat > conftest.$ac_ext <<EOF
20888 #line 20889 "configure"
20889 #include "confdefs.h"
20890 #include "confdefs.h" 
20891 #include <sys/types.h> 
20892  
20893
20894 int main() {
20895 switch (0) case 0: case (sizeof (int) == $ac_size):;
20896 ; return 0; }
20897 EOF
20898 if { (eval echo configure:20899: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
20899   rm -rf conftest*
20900   ac_cv_sizeof_int=$ac_size
20901 else
20902   echo "configure: failed program was:" >&5
20903   cat conftest.$ac_ext >&5
20904 fi
20905 rm -f conftest* 
20906   if test x$ac_cv_sizeof_int != x ; then break; fi 
20907 done 
20908
20909 fi
20910  
20911 if test x$ac_cv_sizeof_int = x ; then 
20912   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
20913 fi 
20914 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
20915 cat >> confdefs.h <<EOF
20916 #define SIZEOF_INT $ac_cv_sizeof_int
20917 EOF
20918  
20919  
20920 echo $ac_n "checking size of long""... $ac_c" 1>&6
20921 echo "configure:20922: checking size of long" >&5 
20922 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
20923   echo $ac_n "(cached) $ac_c" 1>&6
20924 else
20925   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
20926   cat > conftest.$ac_ext <<EOF
20927 #line 20928 "configure"
20928 #include "confdefs.h"
20929 #include "confdefs.h" 
20930 #include <sys/types.h> 
20931  
20932
20933 int main() {
20934 switch (0) case 0: case (sizeof (long) == $ac_size):;
20935 ; return 0; }
20936 EOF
20937 if { (eval echo configure:20938: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
20938   rm -rf conftest*
20939   ac_cv_sizeof_long=$ac_size
20940 else
20941   echo "configure: failed program was:" >&5
20942   cat conftest.$ac_ext >&5
20943 fi
20944 rm -f conftest* 
20945   if test x$ac_cv_sizeof_long != x ; then break; fi 
20946 done 
20947
20948 fi
20949  
20950 if test x$ac_cv_sizeof_long = x ; then 
20951   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
20952 fi 
20953 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
20954 cat >> confdefs.h <<EOF
20955 #define SIZEOF_LONG $ac_cv_sizeof_long
20956 EOF
20957  
20958
20959
20960 if test "$ac_cv_sizeof_int" -lt 4 ; then
20961         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
20962
20963         cat >> confdefs.h <<\EOF
20964 #define LBER_INT_T long
20965 EOF
20966
20967 else
20968         cat >> confdefs.h <<\EOF
20969 #define LBER_INT_T int
20970 EOF
20971
20972 fi
20973
20974 cat >> confdefs.h <<\EOF
20975 #define LBER_LEN_T long
20976 EOF
20977
20978 cat >> confdefs.h <<\EOF
20979 #define LBER_SOCKET_T int
20980 EOF
20981
20982 cat >> confdefs.h <<\EOF
20983 #define LBER_TAG_T long
20984 EOF
20985
20986
20987 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
20988 echo "configure:20989: checking for 8-bit clean memcmp" >&5
20989 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
20990   echo $ac_n "(cached) $ac_c" 1>&6
20991 else
20992   if test "$cross_compiling" = yes; then
20993   ac_cv_func_memcmp_clean=no
20994 else
20995   cat > conftest.$ac_ext <<EOF
20996 #line 20997 "configure"
20997 #include "confdefs.h"
20998
20999 main()
21000 {
21001   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
21002   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
21003 }
21004
21005 EOF
21006 if { (eval echo configure:21007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
21007 then
21008   ac_cv_func_memcmp_clean=yes
21009 else
21010   echo "configure: failed program was:" >&5
21011   cat conftest.$ac_ext >&5
21012   rm -fr conftest*
21013   ac_cv_func_memcmp_clean=no
21014 fi
21015 rm -fr conftest*
21016 fi
21017
21018 fi
21019
21020 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
21021 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
21022
21023 echo $ac_n "checking for strftime""... $ac_c" 1>&6
21024 echo "configure:21025: checking for strftime" >&5
21025 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
21026   echo $ac_n "(cached) $ac_c" 1>&6
21027 else
21028   cat > conftest.$ac_ext <<EOF
21029 #line 21030 "configure"
21030 #include "confdefs.h"
21031 /* System header to define __stub macros and hopefully few prototypes,
21032     which can conflict with char strftime(); below.  */
21033 #include <assert.h>
21034 /* Override any gcc2 internal prototype to avoid an error.  */
21035 /* We use char because int might match the return type of a gcc2
21036     builtin and then its argument prototype would still apply.  */
21037 char strftime();
21038 char (*f)();
21039
21040 int main() {
21041
21042 /* The GNU C library defines this for functions which it implements
21043     to always fail with ENOSYS.  Some functions are actually named
21044     something starting with __ and the normal name is an alias.  */
21045 #if defined (__stub_strftime) || defined (__stub___strftime)
21046 choke me
21047 #else
21048 f = strftime;
21049 #endif
21050
21051 ; return 0; }
21052 EOF
21053 if { (eval echo configure:21054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21054   rm -rf conftest*
21055   eval "ac_cv_func_strftime=yes"
21056 else
21057   echo "configure: failed program was:" >&5
21058   cat conftest.$ac_ext >&5
21059   rm -rf conftest*
21060   eval "ac_cv_func_strftime=no"
21061 fi
21062 rm -f conftest*
21063 fi
21064
21065 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
21066   echo "$ac_t""yes" 1>&6
21067   cat >> confdefs.h <<\EOF
21068 #define HAVE_STRFTIME 1
21069 EOF
21070
21071 else
21072   echo "$ac_t""no" 1>&6
21073 # strftime is in -lintl on SCO UNIX.
21074 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
21075 echo "configure:21076: checking for strftime in -lintl" >&5
21076 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
21077 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
21078   echo $ac_n "(cached) $ac_c" 1>&6
21079 else
21080   ac_save_LIBS="$LIBS"
21081 LIBS="-lintl  $LIBS"
21082 cat > conftest.$ac_ext <<EOF
21083 #line 21084 "configure"
21084 #include "confdefs.h"
21085 /* Override any gcc2 internal prototype to avoid an error.  */
21086 /* We use char because int might match the return type of a gcc2
21087     builtin and then its argument prototype would still apply.  */
21088 char strftime();
21089
21090 int main() {
21091 strftime()
21092 ; return 0; }
21093 EOF
21094 if { (eval echo configure:21095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21095   rm -rf conftest*
21096   eval "ac_cv_lib_$ac_lib_var=yes"
21097 else
21098   echo "configure: failed program was:" >&5
21099   cat conftest.$ac_ext >&5
21100   rm -rf conftest*
21101   eval "ac_cv_lib_$ac_lib_var=no"
21102 fi
21103 rm -f conftest*
21104 LIBS="$ac_save_LIBS"
21105
21106 fi
21107 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
21108   echo "$ac_t""yes" 1>&6
21109   cat >> confdefs.h <<\EOF
21110 #define HAVE_STRFTIME 1
21111 EOF
21112
21113 LIBS="-lintl $LIBS"
21114 else
21115   echo "$ac_t""no" 1>&6
21116 fi
21117
21118 fi
21119
21120
21121 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
21122 echo "configure:21123: checking for inet_aton()" >&5
21123 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
21124   echo $ac_n "(cached) $ac_c" 1>&6
21125 else
21126   cat > conftest.$ac_ext <<EOF
21127 #line 21128 "configure"
21128 #include "confdefs.h"
21129
21130 #ifdef HAVE_SYS_TYPES_H
21131 #       include <sys/types.h>
21132 #endif
21133 #ifdef HAVE_SYS_SOCKET_H
21134 #       include <sys/socket.h>
21135 #       ifdef HAVE_SYS_SELECT_H
21136 #               include <sys/select.h>
21137 #       endif
21138 #       include <netinet/in.h>
21139 #       ifdef HAVE_ARPA_INET_H
21140 #               include <arpa/inet.h>
21141 #       endif
21142 #endif
21143
21144 int main() {
21145 struct in_addr in;
21146 int rc = inet_aton( "255.255.255.255", &in );
21147 ; return 0; }
21148 EOF
21149 if { (eval echo configure:21150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21150   rm -rf conftest*
21151   ol_cv_func_inet_aton=yes
21152 else
21153   echo "configure: failed program was:" >&5
21154   cat conftest.$ac_ext >&5
21155   rm -rf conftest*
21156   ol_cv_func_inet_aton=no
21157 fi
21158 rm -f conftest*
21159 fi
21160
21161 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
21162   if test $ol_cv_func_inet_aton != no; then
21163     cat >> confdefs.h <<\EOF
21164 #define HAVE_INET_ATON 1
21165 EOF
21166
21167   fi
21168  
21169
21170 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
21171 echo "configure:21172: checking for _spawnlp" >&5
21172 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
21173   echo $ac_n "(cached) $ac_c" 1>&6
21174 else
21175   cat > conftest.$ac_ext <<EOF
21176 #line 21177 "configure"
21177 #include "confdefs.h"
21178 /* System header to define __stub macros and hopefully few prototypes,
21179     which can conflict with char _spawnlp(); below.  */
21180 #include <assert.h>
21181 /* Override any gcc2 internal prototype to avoid an error.  */
21182 /* We use char because int might match the return type of a gcc2
21183     builtin and then its argument prototype would still apply.  */
21184 char _spawnlp();
21185 char (*f)();
21186
21187 int main() {
21188
21189 /* The GNU C library defines this for functions which it implements
21190     to always fail with ENOSYS.  Some functions are actually named
21191     something starting with __ and the normal name is an alias.  */
21192 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
21193 choke me
21194 #else
21195 f = _spawnlp;
21196 #endif
21197
21198 ; return 0; }
21199 EOF
21200 if { (eval echo configure:21201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21201   rm -rf conftest*
21202   eval "ac_cv_func__spawnlp=yes"
21203 else
21204   echo "configure: failed program was:" >&5
21205   cat conftest.$ac_ext >&5
21206   rm -rf conftest*
21207   eval "ac_cv_func__spawnlp=no"
21208 fi
21209 rm -f conftest*
21210 fi
21211
21212 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
21213   echo "$ac_t""yes" 1>&6
21214   cat >> confdefs.h <<\EOF
21215 #define HAVE_SPAWNLP 1
21216 EOF
21217
21218 else
21219   echo "$ac_t""no" 1>&6
21220 fi
21221
21222
21223 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
21224 echo "configure:21225: checking for _snprintf" >&5
21225 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
21226   echo $ac_n "(cached) $ac_c" 1>&6
21227 else
21228   cat > conftest.$ac_ext <<EOF
21229 #line 21230 "configure"
21230 #include "confdefs.h"
21231 /* System header to define __stub macros and hopefully few prototypes,
21232     which can conflict with char _snprintf(); below.  */
21233 #include <assert.h>
21234 /* Override any gcc2 internal prototype to avoid an error.  */
21235 /* We use char because int might match the return type of a gcc2
21236     builtin and then its argument prototype would still apply.  */
21237 char _snprintf();
21238 char (*f)();
21239
21240 int main() {
21241
21242 /* The GNU C library defines this for functions which it implements
21243     to always fail with ENOSYS.  Some functions are actually named
21244     something starting with __ and the normal name is an alias.  */
21245 #if defined (__stub__snprintf) || defined (__stub____snprintf)
21246 choke me
21247 #else
21248 f = _snprintf;
21249 #endif
21250
21251 ; return 0; }
21252 EOF
21253 if { (eval echo configure:21254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21254   rm -rf conftest*
21255   eval "ac_cv_func__snprintf=yes"
21256 else
21257   echo "configure: failed program was:" >&5
21258   cat conftest.$ac_ext >&5
21259   rm -rf conftest*
21260   eval "ac_cv_func__snprintf=no"
21261 fi
21262 rm -f conftest*
21263 fi
21264
21265 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
21266   echo "$ac_t""yes" 1>&6
21267   ac_cv_func_snprintf=yes
21268         cat >> confdefs.h <<\EOF
21269 #define snprintf _snprintf
21270 EOF
21271
21272
21273 else
21274   echo "$ac_t""no" 1>&6
21275 fi
21276
21277
21278 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
21279 echo "configure:21280: checking for _vsnprintf" >&5
21280 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
21281   echo $ac_n "(cached) $ac_c" 1>&6
21282 else
21283   cat > conftest.$ac_ext <<EOF
21284 #line 21285 "configure"
21285 #include "confdefs.h"
21286 /* System header to define __stub macros and hopefully few prototypes,
21287     which can conflict with char _vsnprintf(); below.  */
21288 #include <assert.h>
21289 /* Override any gcc2 internal prototype to avoid an error.  */
21290 /* We use char because int might match the return type of a gcc2
21291     builtin and then its argument prototype would still apply.  */
21292 char _vsnprintf();
21293 char (*f)();
21294
21295 int main() {
21296
21297 /* The GNU C library defines this for functions which it implements
21298     to always fail with ENOSYS.  Some functions are actually named
21299     something starting with __ and the normal name is an alias.  */
21300 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
21301 choke me
21302 #else
21303 f = _vsnprintf;
21304 #endif
21305
21306 ; return 0; }
21307 EOF
21308 if { (eval echo configure:21309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21309   rm -rf conftest*
21310   eval "ac_cv_func__vsnprintf=yes"
21311 else
21312   echo "configure: failed program was:" >&5
21313   cat conftest.$ac_ext >&5
21314   rm -rf conftest*
21315   eval "ac_cv_func__vsnprintf=no"
21316 fi
21317 rm -f conftest*
21318 fi
21319
21320 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
21321   echo "$ac_t""yes" 1>&6
21322   ac_cv_func_vsnprintf=yes
21323         cat >> confdefs.h <<\EOF
21324 #define vsnprintf _vsnprintf
21325 EOF
21326
21327
21328 else
21329   echo "$ac_t""no" 1>&6
21330 fi
21331
21332
21333 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
21334 echo "configure:21335: checking for vprintf" >&5
21335 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
21336   echo $ac_n "(cached) $ac_c" 1>&6
21337 else
21338   cat > conftest.$ac_ext <<EOF
21339 #line 21340 "configure"
21340 #include "confdefs.h"
21341 /* System header to define __stub macros and hopefully few prototypes,
21342     which can conflict with char vprintf(); below.  */
21343 #include <assert.h>
21344 /* Override any gcc2 internal prototype to avoid an error.  */
21345 /* We use char because int might match the return type of a gcc2
21346     builtin and then its argument prototype would still apply.  */
21347 char vprintf();
21348 char (*f)();
21349
21350 int main() {
21351
21352 /* The GNU C library defines this for functions which it implements
21353     to always fail with ENOSYS.  Some functions are actually named
21354     something starting with __ and the normal name is an alias.  */
21355 #if defined (__stub_vprintf) || defined (__stub___vprintf)
21356 choke me
21357 #else
21358 f = vprintf;
21359 #endif
21360
21361 ; return 0; }
21362 EOF
21363 if { (eval echo configure:21364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21364   rm -rf conftest*
21365   eval "ac_cv_func_vprintf=yes"
21366 else
21367   echo "configure: failed program was:" >&5
21368   cat conftest.$ac_ext >&5
21369   rm -rf conftest*
21370   eval "ac_cv_func_vprintf=no"
21371 fi
21372 rm -f conftest*
21373 fi
21374
21375 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
21376   echo "$ac_t""yes" 1>&6
21377   cat >> confdefs.h <<\EOF
21378 #define HAVE_VPRINTF 1
21379 EOF
21380
21381 else
21382   echo "$ac_t""no" 1>&6
21383 fi
21384
21385 if test "$ac_cv_func_vprintf" != yes; then
21386 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
21387 echo "configure:21388: checking for _doprnt" >&5
21388 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
21389   echo $ac_n "(cached) $ac_c" 1>&6
21390 else
21391   cat > conftest.$ac_ext <<EOF
21392 #line 21393 "configure"
21393 #include "confdefs.h"
21394 /* System header to define __stub macros and hopefully few prototypes,
21395     which can conflict with char _doprnt(); below.  */
21396 #include <assert.h>
21397 /* Override any gcc2 internal prototype to avoid an error.  */
21398 /* We use char because int might match the return type of a gcc2
21399     builtin and then its argument prototype would still apply.  */
21400 char _doprnt();
21401 char (*f)();
21402
21403 int main() {
21404
21405 /* The GNU C library defines this for functions which it implements
21406     to always fail with ENOSYS.  Some functions are actually named
21407     something starting with __ and the normal name is an alias.  */
21408 #if defined (__stub__doprnt) || defined (__stub____doprnt)
21409 choke me
21410 #else
21411 f = _doprnt;
21412 #endif
21413
21414 ; return 0; }
21415 EOF
21416 if { (eval echo configure:21417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21417   rm -rf conftest*
21418   eval "ac_cv_func__doprnt=yes"
21419 else
21420   echo "configure: failed program was:" >&5
21421   cat conftest.$ac_ext >&5
21422   rm -rf conftest*
21423   eval "ac_cv_func__doprnt=no"
21424 fi
21425 rm -f conftest*
21426 fi
21427
21428 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
21429   echo "$ac_t""yes" 1>&6
21430   cat >> confdefs.h <<\EOF
21431 #define HAVE_DOPRNT 1
21432 EOF
21433
21434 else
21435   echo "$ac_t""no" 1>&6
21436 fi
21437
21438 fi
21439
21440
21441 if test $ac_cv_func_vprintf = yes ; then
21442                 for ac_func in vsnprintf vsprintf
21443 do
21444 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
21445 echo "configure:21446: checking for $ac_func" >&5
21446 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
21447   echo $ac_n "(cached) $ac_c" 1>&6
21448 else
21449   cat > conftest.$ac_ext <<EOF
21450 #line 21451 "configure"
21451 #include "confdefs.h"
21452 /* System header to define __stub macros and hopefully few prototypes,
21453     which can conflict with char $ac_func(); below.  */
21454 #include <assert.h>
21455 /* Override any gcc2 internal prototype to avoid an error.  */
21456 /* We use char because int might match the return type of a gcc2
21457     builtin and then its argument prototype would still apply.  */
21458 char $ac_func();
21459 char (*f)();
21460
21461 int main() {
21462
21463 /* The GNU C library defines this for functions which it implements
21464     to always fail with ENOSYS.  Some functions are actually named
21465     something starting with __ and the normal name is an alias.  */
21466 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
21467 choke me
21468 #else
21469 f = $ac_func;
21470 #endif
21471
21472 ; return 0; }
21473 EOF
21474 if { (eval echo configure:21475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21475   rm -rf conftest*
21476   eval "ac_cv_func_$ac_func=yes"
21477 else
21478   echo "configure: failed program was:" >&5
21479   cat conftest.$ac_ext >&5
21480   rm -rf conftest*
21481   eval "ac_cv_func_$ac_func=no"
21482 fi
21483 rm -f conftest*
21484 fi
21485
21486 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
21487   echo "$ac_t""yes" 1>&6
21488     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
21489   cat >> confdefs.h <<EOF
21490 #define $ac_tr_func 1
21491 EOF
21492  
21493 else
21494   echo "$ac_t""no" 1>&6
21495 fi
21496 done
21497
21498 fi
21499
21500 for ac_func in \
21501         bcopy                   \
21502         closesocket             \
21503         chroot                  \
21504         endgrent                \
21505         endpwent                \
21506         fcntl                   \
21507         flock                   \
21508         getdtablesize   \
21509         getgrgid                \
21510         gethostname             \
21511         getpass                 \
21512         getpassphrase   \
21513         getpwuid                \
21514         getpwnam                \
21515         getspnam                \
21516         gettimeofday    \
21517         initgroups              \
21518         lockf                   \
21519         memcpy                  \
21520         memmove                 \
21521         mkstemp                 \
21522         mktemp                  \
21523         pipe                    \
21524         read                    \
21525         recv                    \
21526         recvfrom                \
21527         setpwfile               \
21528         setgid                  \
21529         setegid                 \
21530         setsid                  \
21531         setuid                  \
21532         seteuid                 \
21533         sigaction               \
21534         signal                  \
21535         sigset                  \
21536         strdup                  \
21537         strerror                \
21538         strpbrk                 \
21539         strrchr                 \
21540         strsep                  \
21541         strstr                  \
21542         strtol                  \
21543         strtoul                 \
21544         strspn                  \
21545         sysconf                 \
21546         usleep                  \
21547         waitpid                 \
21548         wait4                   \
21549         write                   \
21550         send                    \
21551         sendto                  \
21552
21553 do
21554 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
21555 echo "configure:21556: checking for $ac_func" >&5
21556 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
21557   echo $ac_n "(cached) $ac_c" 1>&6
21558 else
21559   cat > conftest.$ac_ext <<EOF
21560 #line 21561 "configure"
21561 #include "confdefs.h"
21562 /* System header to define __stub macros and hopefully few prototypes,
21563     which can conflict with char $ac_func(); below.  */
21564 #include <assert.h>
21565 /* Override any gcc2 internal prototype to avoid an error.  */
21566 /* We use char because int might match the return type of a gcc2
21567     builtin and then its argument prototype would still apply.  */
21568 char $ac_func();
21569 char (*f)();
21570
21571 int main() {
21572
21573 /* The GNU C library defines this for functions which it implements
21574     to always fail with ENOSYS.  Some functions are actually named
21575     something starting with __ and the normal name is an alias.  */
21576 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
21577 choke me
21578 #else
21579 f = $ac_func;
21580 #endif
21581
21582 ; return 0; }
21583 EOF
21584 if { (eval echo configure:21585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21585   rm -rf conftest*
21586   eval "ac_cv_func_$ac_func=yes"
21587 else
21588   echo "configure: failed program was:" >&5
21589   cat conftest.$ac_ext >&5
21590   rm -rf conftest*
21591   eval "ac_cv_func_$ac_func=no"
21592 fi
21593 rm -f conftest*
21594 fi
21595
21596 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
21597   echo "$ac_t""yes" 1>&6
21598     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
21599   cat >> confdefs.h <<EOF
21600 #define $ac_tr_func 1
21601 EOF
21602  
21603 else
21604   echo "$ac_t""no" 1>&6
21605 fi
21606 done
21607
21608
21609 for ac_func in getopt
21610 do
21611 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
21612 echo "configure:21613: checking for $ac_func" >&5
21613 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
21614   echo $ac_n "(cached) $ac_c" 1>&6
21615 else
21616   cat > conftest.$ac_ext <<EOF
21617 #line 21618 "configure"
21618 #include "confdefs.h"
21619 /* System header to define __stub macros and hopefully few prototypes,
21620     which can conflict with char $ac_func(); below.  */
21621 #include <assert.h>
21622 /* Override any gcc2 internal prototype to avoid an error.  */
21623 /* We use char because int might match the return type of a gcc2
21624     builtin and then its argument prototype would still apply.  */
21625 char $ac_func();
21626 char (*f)();
21627
21628 int main() {
21629
21630 /* The GNU C library defines this for functions which it implements
21631     to always fail with ENOSYS.  Some functions are actually named
21632     something starting with __ and the normal name is an alias.  */
21633 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
21634 choke me
21635 #else
21636 f = $ac_func;
21637 #endif
21638
21639 ; return 0; }
21640 EOF
21641 if { (eval echo configure:21642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21642   rm -rf conftest*
21643   eval "ac_cv_func_$ac_func=yes"
21644 else
21645   echo "configure: failed program was:" >&5
21646   cat conftest.$ac_ext >&5
21647   rm -rf conftest*
21648   eval "ac_cv_func_$ac_func=no"
21649 fi
21650 rm -f conftest*
21651 fi
21652
21653 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
21654   echo "$ac_t""yes" 1>&6
21655     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
21656   cat >> confdefs.h <<EOF
21657 #define $ac_tr_func 1
21658 EOF
21659  
21660 else
21661   echo "$ac_t""no" 1>&6
21662 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
21663 fi
21664 done
21665
21666
21667
21668 if test "$ac_cv_func_getopt" != yes; then
21669         LIBSRCS="$LIBSRCS getopt.c"
21670 fi
21671
21672 # Check Configuration
21673 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
21674 echo "configure:21675: checking declaration of sys_errlist" >&5
21675 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
21676   echo $ac_n "(cached) $ac_c" 1>&6
21677 else
21678   
21679         cat > conftest.$ac_ext <<EOF
21680 #line 21681 "configure"
21681 #include "confdefs.h"
21682
21683 #include <stdio.h>
21684 #include <sys/types.h>
21685 #include <errno.h>
21686 #ifdef WINNT
21687 #include <stdlib.h>
21688 #endif 
21689 int main() {
21690 char *c = (char *) *sys_errlist
21691 ; return 0; }
21692 EOF
21693 if { (eval echo configure:21694: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21694   rm -rf conftest*
21695   ol_cv_dcl_sys_errlist=yes
21696         ol_cv_have_sys_errlist=yes
21697 else
21698   echo "configure: failed program was:" >&5
21699   cat conftest.$ac_ext >&5
21700   rm -rf conftest*
21701   ol_cv_dcl_sys_errlist=no
21702 fi
21703 rm -f conftest*
21704 fi
21705
21706 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
21707 #
21708 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
21709 if test $ol_cv_dcl_sys_errlist = no ; then
21710         cat >> confdefs.h <<\EOF
21711 #define DECL_SYS_ERRLIST 1
21712 EOF
21713
21714
21715         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
21716 echo "configure:21717: checking existence of sys_errlist" >&5
21717 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
21718   echo $ac_n "(cached) $ac_c" 1>&6
21719 else
21720   
21721                 cat > conftest.$ac_ext <<EOF
21722 #line 21723 "configure"
21723 #include "confdefs.h"
21724 #include <errno.h>
21725 int main() {
21726 char *c = (char *) *sys_errlist
21727 ; return 0; }
21728 EOF
21729 if { (eval echo configure:21730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21730   rm -rf conftest*
21731   ol_cv_have_sys_errlist=yes
21732 else
21733   echo "configure: failed program was:" >&5
21734   cat conftest.$ac_ext >&5
21735   rm -rf conftest*
21736   ol_cv_have_sys_errlist=no
21737 fi
21738 rm -f conftest*
21739 fi
21740
21741 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
21742 fi
21743 if test $ol_cv_have_sys_errlist = yes ; then
21744         cat >> confdefs.h <<\EOF
21745 #define HAVE_SYS_ERRLIST 1
21746 EOF
21747
21748 fi
21749
21750
21751
21752 if test "$ol_enable_debug" != no ; then
21753         cat >> confdefs.h <<\EOF
21754 #define LDAP_DEBUG 1
21755 EOF
21756
21757 fi
21758 if test "$ol_enable_syslog" = yes ; then
21759         cat >> confdefs.h <<\EOF
21760 #define LDAP_SYSLOG 1
21761 EOF
21762
21763 fi
21764 if test "$ol_enable_cache" = no ; then
21765         cat >> confdefs.h <<\EOF
21766 #define LDAP_NOCACHE 1
21767 EOF
21768
21769 fi
21770 if test "$ol_link_kbind" != no ; then
21771         cat >> confdefs.h <<\EOF
21772 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
21773 EOF
21774
21775 fi
21776 if test "$ol_enable_proctitle" != no ; then
21777         cat >> confdefs.h <<\EOF
21778 #define LDAP_PROCTITLE 1
21779 EOF
21780
21781 fi
21782 if test "$ol_enable_referrals" != no ; then
21783         cat >> confdefs.h <<\EOF
21784 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
21785 EOF
21786
21787 fi
21788 if test "$ol_enable_local" != no; then
21789         cat >> confdefs.h <<\EOF
21790 #define LDAP_PF_LOCAL 1
21791 EOF
21792
21793 fi
21794 if test "$ol_link_ipv6" != no; then
21795         cat >> confdefs.h <<\EOF
21796 #define LDAP_PF_INET6 1
21797 EOF
21798
21799 fi
21800 if test "$ol_enable_cleartext" != no ; then
21801         cat >> confdefs.h <<\EOF
21802 #define SLAPD_CLEARTEXT 1
21803 EOF
21804
21805 fi
21806 if test "$ol_enable_crypt" != no ; then
21807         cat >> confdefs.h <<\EOF
21808 #define SLAPD_CRYPT 1
21809 EOF
21810
21811 fi
21812 if test "$ol_link_kpasswd" != no ; then
21813         cat >> confdefs.h <<\EOF
21814 #define SLAPD_KPASSWD 1
21815 EOF
21816
21817 fi
21818 if test "$ol_link_spasswd" != no ; then
21819         cat >> confdefs.h <<\EOF
21820 #define SLAPD_SPASSWD 1
21821 EOF
21822
21823 fi
21824 if test "$ol_enable_phonetic" != no ; then
21825         cat >> confdefs.h <<\EOF
21826 #define SLAPD_PHONETIC 1
21827 EOF
21828
21829 fi
21830 if test "$ol_enable_rlookups" != no ; then
21831         cat >> confdefs.h <<\EOF
21832 #define SLAPD_RLOOKUPS 1
21833 EOF
21834
21835 fi
21836 if test "$ol_enable_aci" != no ; then
21837         cat >> confdefs.h <<\EOF
21838 #define SLAPD_ACI_ENABLED 1
21839 EOF
21840
21841 fi
21842
21843 if test "$ol_link_modules" != no ; then
21844         cat >> confdefs.h <<\EOF
21845 #define SLAPD_MODULES 1
21846 EOF
21847
21848         BUILD_SLAPD=yes
21849         SLAPD_MODULES_LDFLAGS="-dlopen self"
21850 fi
21851
21852 if test "$ol_enable_bdb" != no ; then
21853         cat >> confdefs.h <<\EOF
21854 #define SLAPD_BDB 1
21855 EOF
21856
21857         BUILD_SLAPD=yes
21858         BUILD_BDB=yes
21859         if test "$ol_with_bdb_module" != static ; then
21860                 cat >> confdefs.h <<\EOF
21861 #define SLAPD_BDB_DYNAMIC 1
21862 EOF
21863
21864                 BUILD_BDB=mod
21865                 BUILD_BDB_DYNAMIC=shared
21866                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-bdb/back_bdb.la"
21867                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-bdb"
21868         else
21869                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-bdb"
21870         fi
21871 fi
21872
21873 if test "$ol_link_dnssrv" != no ; then
21874         cat >> confdefs.h <<\EOF
21875 #define SLAPD_DNSSRV 1
21876 EOF
21877
21878         BUILD_SLAPD=yes
21879         BUILD_DNSSRV=yes
21880         if test "$ol_with_dnssrv_module" != static ; then
21881                 cat >> confdefs.h <<\EOF
21882 #define SLAPD_DNSSRV_DYNAMIC 1
21883 EOF
21884
21885                 BUILD_DNSSRV=mod
21886                 BUILD_DNSSRV_DYNAMIC=shared
21887                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
21888                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-dnssrv"
21889         else
21890                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-dnssrv"
21891         fi
21892 fi
21893
21894 if test "$ol_enable_ldap" != no ; then
21895         cat >> confdefs.h <<\EOF
21896 #define SLAPD_LDAP 1
21897 EOF
21898
21899         BUILD_SLAPD=yes
21900         BUILD_LDAP=yes
21901         if test "$ol_with_ldap_module" != static ; then
21902                 cat >> confdefs.h <<\EOF
21903 #define SLAPD_LDAP_DYNAMIC 1
21904 EOF
21905
21906                 BUILD_LDAP=mod
21907                 BUILD_LDAP_DYNAMIC=shared
21908                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
21909                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldap"
21910         else
21911                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldap"
21912         fi
21913 fi
21914
21915 if test "$ol_link_ldbm" != no -a $ol_enable_ldbm != no; then
21916         cat >> confdefs.h <<\EOF
21917 #define SLAPD_LDBM 1
21918 EOF
21919
21920         BUILD_SLAPD=yes
21921         BUILD_LDBM=yes
21922         LDBM_LIB="-lldbm"
21923         if test "$ol_with_ldbm_module" != static ; then
21924                 cat >> confdefs.h <<\EOF
21925 #define SLAPD_LDBM_DYNAMIC 1
21926 EOF
21927
21928                 BUILD_LDBM=mod
21929                 BUILD_LDBM_DYNAMIC=shared
21930                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
21931                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldbm"
21932         else
21933                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldbm"
21934         fi
21935 fi
21936
21937 if test "$ol_enable_meta" != no ; then
21938         if test "$ol_enable_ldap" = no ; then
21939                 { echo "configure: error: need --enable-ldap to use --enable-meta" 1>&2; exit 1; }
21940         fi
21941         if test "$ol_enable_rewrite" = no ; then
21942                 { echo "configure: error: need --enable-rewrite to use --enable-meta" 1>&2; exit 1; }
21943         fi
21944         cat >> confdefs.h <<\EOF
21945 #define SLAPD_META 1
21946 EOF
21947
21948         BUILD_SLAPD=yes
21949         BUILD_META=yes
21950         if test "$ol_with_meta_module" != static ; then
21951                 cat >> confdefs.h <<\EOF
21952 #define SLAPD_META_DYNAMIC 1
21953 EOF
21954
21955                 BUILD_META=mod
21956                 BUILD_META_DYNAMIC=shared
21957                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-meta/back_meta.la"
21958                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-meta"
21959         else
21960                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-meta"
21961         fi
21962 fi
21963
21964 if test "$ol_enable_monitor" != no ; then
21965         cat >> confdefs.h <<\EOF
21966 #define SLAPD_MONITOR 1
21967 EOF
21968
21969         BUILD_SLAPD=yes
21970         BUILD_MONITOR=yes
21971         if test "$ol_with_monitor_module" != static ; then
21972                 cat >> confdefs.h <<\EOF
21973 #define SLAPD_MONITOR_DYNAMIC 1
21974 EOF
21975
21976                 BUILD_MONITOR=mod
21977                 BUILD_MONITOR_DYNAMIC=shared
21978                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-monitor/back_monitor.la"
21979                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-monitor"
21980         else
21981                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-monitor"
21982         fi
21983 fi
21984
21985 if test "$ol_enable_passwd" != no ; then
21986         cat >> confdefs.h <<\EOF
21987 #define SLAPD_PASSWD 1
21988 EOF
21989
21990         BUILD_SLAPD=yes
21991         BUILD_PASSWD=yes
21992         if test "$ol_with_passwd_module" != static ; then
21993                 cat >> confdefs.h <<\EOF
21994 #define SLAPD_PASSWD_DYNAMIC 1
21995 EOF
21996
21997                 BUILD_PASSWD=mod
21998                 BUILD_PASSWD_DYNAMIC=shared
21999                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
22000                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-passwd"
22001         else
22002                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-passwd"
22003         fi
22004 fi
22005
22006 if test "$ol_link_perl" != no ; then
22007         cat >> confdefs.h <<\EOF
22008 #define SLAPD_PERL 1
22009 EOF
22010
22011         BUILD_SLAPD=yes
22012         BUILD_PERL=yes
22013         if test "$ol_with_perl_module" != static ; then
22014                 cat >> confdefs.h <<\EOF
22015 #define SLAPD_PERL_DYNAMIC 1
22016 EOF
22017
22018                 BUILD_PERL=mod
22019                 BUILD_PERL_DYNAMIC=shared
22020                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-perl/back_perl.la"
22021                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-perl"
22022         else
22023                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-perl"
22024         fi
22025 fi
22026
22027 if test "$ol_enable_shell" != no ; then
22028         cat >> confdefs.h <<\EOF
22029 #define SLAPD_SHELL 1
22030 EOF
22031
22032         BUILD_SLAPD=yes
22033         BUILD_SHELL=yes
22034         if test "$ol_with_shell_module" != static ; then
22035                 cat >> confdefs.h <<\EOF
22036 #define SLAPD_SHELL_DYNAMIC 1
22037 EOF
22038
22039                 BUILD_SHELL=mod
22040                 BUILD_SHELL_DYNAMIC=shared
22041                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
22042                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-shell"
22043         else
22044                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-shell"
22045         fi
22046 fi
22047
22048 if test "$ol_link_sql" != no ; then
22049         cat >> confdefs.h <<\EOF
22050 #define SLAPD_SQL 1
22051 EOF
22052
22053         BUILD_SLAPD=yes
22054         BUILD_SQL=yes
22055         if test "$ol_with_sql_module" != static; then
22056                 cat >> confdefs.h <<\EOF
22057 #define SLAPD_SQL_DYNAMIC 1
22058 EOF
22059
22060                 BUILD_SQL=mod
22061                 BUILD_SQL_DYNAMIC=shared
22062                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
22063                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-sql"
22064         else
22065                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-sql"
22066         fi
22067 fi
22068
22069 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
22070         $BUILD_SLAPD = yes ; then
22071         BUILD_SLURPD=yes
22072 fi
22073
22074 if test "$ol_enable_rewrite" != no ; then
22075         cat >> confdefs.h <<\EOF
22076 #define ENABLE_REWRITE 1
22077 EOF
22078
22079         BUILD_REWRITE=yes
22080 fi
22081
22082
22083
22084 if test "$ac_cv_mingw32" = yes ; then
22085         PLAT=NT
22086         SLAPD_MODULES_LDFLAGS=
22087         SLAPD_MODULES_LIST=
22088 else
22089         PLAT=UNIX
22090 fi
22091
22092
22093
22094
22095
22096
22097   
22098   
22099   
22100   
22101   
22102   
22103   
22104   
22105   
22106   
22107   
22108   
22109   
22110   
22111   
22112   
22113   
22114   
22115   
22116   
22117
22118
22119
22120
22121
22122
22123
22124
22125
22126
22127
22128
22129
22130
22131
22132
22133
22134
22135
22136
22137
22138
22139
22140
22141
22142
22143
22144
22145
22146
22147
22148
22149
22150
22151
22152
22153
22154
22155
22156 # Check whether --with-xxinstall or --without-xxinstall was given.
22157 if test "${with_xxinstall+set}" = set; then
22158   withval="$with_xxinstall"
22159   :
22160 fi
22161
22162
22163
22164 trap '' 1 2 15
22165
22166 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
22167
22168 test "x$prefix" = xNONE && prefix=$ac_default_prefix
22169 # Let make expand exec_prefix.
22170 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
22171
22172 # Any assignment to VPATH causes Sun make to only execute
22173 # the first set of double-colon rules, so remove it if not needed.
22174 # If there is a colon in the path, we need to keep it.
22175 if test "x$srcdir" = x.; then
22176   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
22177 fi
22178
22179 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
22180
22181 DEFS=-DHAVE_CONFIG_H
22182
22183 # Without the "./", some shells look in PATH for config.status.
22184 : ${CONFIG_STATUS=./config.status}
22185
22186 echo creating $CONFIG_STATUS
22187 rm -f $CONFIG_STATUS
22188 cat > $CONFIG_STATUS <<EOF
22189 #! /bin/sh
22190 # Generated automatically by configure.
22191 # Run this file to recreate the current configuration.
22192 # This directory was configured as follows,
22193 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
22194 #
22195 # $0 $ac_configure_args
22196 #
22197 # Compiler output produced by configure, useful for debugging
22198 # configure, is in ./config.log if it exists.
22199
22200 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
22201 for ac_option
22202 do
22203   case "\$ac_option" in
22204   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
22205     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
22206     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
22207   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
22208     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
22209     exit 0 ;;
22210   -help | --help | --hel | --he | --h)
22211     echo "\$ac_cs_usage"; exit 0 ;;
22212   *) echo "\$ac_cs_usage"; exit 1 ;;
22213   esac
22214 done
22215
22216 ac_given_srcdir=$srcdir
22217 ac_given_INSTALL="$INSTALL"
22218
22219 trap 'rm -fr `echo "\
22220 Makefile:build/top.mk:Makefile.in:build/dir.mk \
22221 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
22222 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
22223 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
22224 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
22225 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
22226 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
22227 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
22228 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
22229 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
22230 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
22231 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
22232 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
22233 include/Makefile:build/top.mk:include/Makefile.in \
22234 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
22235 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
22236 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
22237 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
22238 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
22239 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
22240 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
22241 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
22242 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
22243 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
22244 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
22245 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
22246 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
22247 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
22248 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
22249 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
22250 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
22251 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
22252 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
22253 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
22254 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
22255 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
22256 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
22257 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
22258 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
22259 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
22260 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
22261  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
22262 EOF
22263 cat >> $CONFIG_STATUS <<EOF
22264
22265 # Protect against being on the right side of a sed subst in config.status.
22266 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
22267  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
22268 $ac_vpsub
22269 $extrasub
22270 s%@SHELL@%$SHELL%g
22271 s%@CFLAGS@%$CFLAGS%g
22272 s%@CPPFLAGS@%$CPPFLAGS%g
22273 s%@CXXFLAGS@%$CXXFLAGS%g
22274 s%@FFLAGS@%$FFLAGS%g
22275 s%@DEFS@%$DEFS%g
22276 s%@LDFLAGS@%$LDFLAGS%g
22277 s%@LIBS@%$LIBS%g
22278 s%@exec_prefix@%$exec_prefix%g
22279 s%@prefix@%$prefix%g
22280 s%@program_transform_name@%$program_transform_name%g
22281 s%@bindir@%$bindir%g
22282 s%@sbindir@%$sbindir%g
22283 s%@libexecdir@%$libexecdir%g
22284 s%@datadir@%$datadir%g
22285 s%@sysconfdir@%$sysconfdir%g
22286 s%@sharedstatedir@%$sharedstatedir%g
22287 s%@localstatedir@%$localstatedir%g
22288 s%@libdir@%$libdir%g
22289 s%@includedir@%$includedir%g
22290 s%@oldincludedir@%$oldincludedir%g
22291 s%@infodir@%$infodir%g
22292 s%@mandir@%$mandir%g
22293 s%@host@%$host%g
22294 s%@host_alias@%$host_alias%g
22295 s%@host_cpu@%$host_cpu%g
22296 s%@host_vendor@%$host_vendor%g
22297 s%@host_os@%$host_os%g
22298 s%@target@%$target%g
22299 s%@target_alias@%$target_alias%g
22300 s%@target_cpu@%$target_cpu%g
22301 s%@target_vendor@%$target_vendor%g
22302 s%@target_os@%$target_os%g
22303 s%@build@%$build%g
22304 s%@build_alias@%$build_alias%g
22305 s%@build_cpu@%$build_cpu%g
22306 s%@build_vendor@%$build_vendor%g
22307 s%@build_os@%$build_os%g
22308 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
22309 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
22310 s%@INSTALL_DATA@%$INSTALL_DATA%g
22311 s%@PACKAGE@%$PACKAGE%g
22312 s%@VERSION@%$VERSION%g
22313 s%@ACLOCAL@%$ACLOCAL%g
22314 s%@AUTOCONF@%$AUTOCONF%g
22315 s%@AUTOMAKE@%$AUTOMAKE%g
22316 s%@AUTOHEADER@%$AUTOHEADER%g
22317 s%@MAKEINFO@%$MAKEINFO%g
22318 s%@install_sh@%$install_sh%g
22319 s%@AMTAR@%$AMTAR%g
22320 s%@AWK@%$AWK%g
22321 s%@AMTARFLAGS@%$AMTARFLAGS%g
22322 s%@SET_MAKE@%$SET_MAKE%g
22323 s%@OPENLDAP_LIBVERSION@%$OPENLDAP_LIBVERSION%g
22324 s%@top_builddir@%$top_builddir%g
22325 s%@ldap_subdir@%$ldap_subdir%g
22326 s%@CC@%$CC%g
22327 s%@AR@%$AR%g
22328 s%@LN_S@%$LN_S%g
22329 s%@OBJEXT@%$OBJEXT%g
22330 s%@EXEEXT@%$EXEEXT%g
22331 s%@ECHO@%$ECHO%g
22332 s%@RANLIB@%$RANLIB%g
22333 s%@STRIP@%$STRIP%g
22334 s%@DLLTOOL@%$DLLTOOL%g
22335 s%@AS@%$AS%g
22336 s%@OBJDUMP@%$OBJDUMP%g
22337 s%@CPP@%$CPP%g
22338 s%@LIBTOOL@%$LIBTOOL%g
22339 s%@LN_H@%$LN_H%g
22340 s%@SENDMAIL@%$SENDMAIL%g
22341 s%@EDITOR@%$EDITOR%g
22342 s%@FINGER@%$FINGER%g
22343 s%@PERLBIN@%$PERLBIN%g
22344 s%@OL_MKDEP@%$OL_MKDEP%g
22345 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
22346 s%@LIBOBJS@%$LIBOBJS%g
22347 s%@LIBSRCS@%$LIBSRCS%g
22348 s%@PLAT@%$PLAT%g
22349 s%@BUILD_LIBS_DYNAMIC@%$BUILD_LIBS_DYNAMIC%g
22350 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
22351 s%@BUILD_BDB@%$BUILD_BDB%g
22352 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
22353 s%@BUILD_LDAP@%$BUILD_LDAP%g
22354 s%@BUILD_LDBM@%$BUILD_LDBM%g
22355 s%@BUILD_META@%$BUILD_META%g
22356 s%@BUILD_MONITOR@%$BUILD_MONITOR%g
22357 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
22358 s%@BUILD_PERL@%$BUILD_PERL%g
22359 s%@BUILD_SHELL@%$BUILD_SHELL%g
22360 s%@BUILD_SQL@%$BUILD_SQL%g
22361 s%@BUILD_BDB_DYNAMIC@%$BUILD_BDB_DYNAMIC%g
22362 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
22363 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
22364 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
22365 s%@BUILD_META_DYNAMIC@%$BUILD_META_DYNAMIC%g
22366 s%@BUILD_MONITOR_DYNAMIC@%$BUILD_MONITOR_DYNAMIC%g
22367 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
22368 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
22369 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
22370 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
22371 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
22372 s%@LDBM_LIB@%$LDBM_LIB%g
22373 s%@LDAP_LIBS@%$LDAP_LIBS%g
22374 s%@LDIF_LIBS@%$LDIF_LIBS%g
22375 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
22376 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
22377 s%@LDBM_LIBS@%$LDBM_LIBS%g
22378 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
22379 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
22380 s%@WRAP_LIBS@%$WRAP_LIBS%g
22381 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
22382 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
22383 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
22384 s%@SLAPD_STATIC_BACKENDS@%$SLAPD_STATIC_BACKENDS%g
22385 s%@SLAPD_DYNAMIC_BACKENDS@%$SLAPD_DYNAMIC_BACKENDS%g
22386 s%@PERL_CPPFLAGS@%$PERL_CPPFLAGS%g
22387 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
22388 s%@MOD_PERL_LDFLAGS@%$MOD_PERL_LDFLAGS%g
22389 s%@KRB4_LIBS@%$KRB4_LIBS%g
22390 s%@KRB5_LIBS@%$KRB5_LIBS%g
22391 s%@READLINE_LIBS@%$READLINE_LIBS%g
22392 s%@SASL_LIBS@%$SASL_LIBS%g
22393 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
22394 s%@TLS_LIBS@%$TLS_LIBS%g
22395 s%@MODULES_LIBS@%$MODULES_LIBS%g
22396 s%@AUTH_LIBS@%$AUTH_LIBS%g
22397 s%@SLAPD_SLP_LIBS@%$SLAPD_SLP_LIBS%g
22398 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
22399 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
22400 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
22401
22402 CEOF
22403 EOF
22404
22405 cat >> $CONFIG_STATUS <<\EOF
22406
22407 # Split the substitutions into bite-sized pieces for seds with
22408 # small command number limits, like on Digital OSF/1 and HP-UX.
22409 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
22410 ac_file=1 # Number of current file.
22411 ac_beg=1 # First line for current file.
22412 ac_end=$ac_max_sed_cmds # Line after last line for current file.
22413 ac_more_lines=:
22414 ac_sed_cmds=""
22415 while $ac_more_lines; do
22416   if test $ac_beg -gt 1; then
22417     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
22418   else
22419     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
22420   fi
22421   if test ! -s conftest.s$ac_file; then
22422     ac_more_lines=false
22423     rm -f conftest.s$ac_file
22424   else
22425     if test -z "$ac_sed_cmds"; then
22426       ac_sed_cmds="sed -f conftest.s$ac_file"
22427     else
22428       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
22429     fi
22430     ac_file=`expr $ac_file + 1`
22431     ac_beg=$ac_end
22432     ac_end=`expr $ac_end + $ac_max_sed_cmds`
22433   fi
22434 done
22435 if test -z "$ac_sed_cmds"; then
22436   ac_sed_cmds=cat
22437 fi
22438 EOF
22439
22440 cat >> $CONFIG_STATUS <<EOF
22441
22442 CONFIG_FILES=\${CONFIG_FILES-"\
22443 Makefile:build/top.mk:Makefile.in:build/dir.mk \
22444 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
22445 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
22446 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
22447 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
22448 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
22449 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
22450 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
22451 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
22452 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
22453 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
22454 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
22455 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
22456 include/Makefile:build/top.mk:include/Makefile.in \
22457 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
22458 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
22459 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
22460 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
22461 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
22462 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
22463 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
22464 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
22465 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
22466 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
22467 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
22468 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
22469 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
22470 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
22471 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
22472 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
22473 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
22474 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
22475 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
22476 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
22477 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
22478 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
22479 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
22480 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
22481 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
22482 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
22483 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
22484 "}
22485 EOF
22486 cat >> $CONFIG_STATUS <<\EOF
22487 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
22488   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
22489   case "$ac_file" in
22490   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
22491        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
22492   *) ac_file_in="${ac_file}.in" ;;
22493   esac
22494
22495   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
22496
22497   # Remove last slash and all that follows it.  Not all systems have dirname.
22498   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
22499   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
22500     # The file is in a subdirectory.
22501     test ! -d "$ac_dir" && mkdir "$ac_dir"
22502     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
22503     # A "../" for each directory in $ac_dir_suffix.
22504     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
22505   else
22506     ac_dir_suffix= ac_dots=
22507   fi
22508
22509   case "$ac_given_srcdir" in
22510   .)  srcdir=.
22511       if test -z "$ac_dots"; then top_srcdir=.
22512       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
22513   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
22514   *) # Relative path.
22515     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
22516     top_srcdir="$ac_dots$ac_given_srcdir" ;;
22517   esac
22518
22519   case "$ac_given_INSTALL" in
22520   [/$]*) INSTALL="$ac_given_INSTALL" ;;
22521   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
22522   esac
22523
22524   echo creating "$ac_file"
22525   rm -f "$ac_file"
22526   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
22527   case "$ac_file" in
22528   *[Mm]akefile*) ac_comsub="1i\\
22529 # $configure_input" ;;
22530   *) ac_comsub= ;;
22531   esac
22532
22533   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
22534   sed -e "$ac_comsub
22535 s%@configure_input@%$configure_input%g
22536 s%@srcdir@%$srcdir%g
22537 s%@top_srcdir@%$top_srcdir%g
22538 s%@INSTALL@%$INSTALL%g
22539 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
22540 fi; done
22541 rm -f conftest.s*
22542
22543 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
22544 # NAME is the cpp macro being defined and VALUE is the value it is being given.
22545 #
22546 # ac_d sets the value in "#define NAME VALUE" lines.
22547 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
22548 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
22549 ac_dC='\3'
22550 ac_dD='%g'
22551 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
22552 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
22553 ac_uB='\([      ]\)%\1#\2define\3'
22554 ac_uC=' '
22555 ac_uD='\4%g'
22556 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
22557 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
22558 ac_eB='$%\1#\2define\3'
22559 ac_eC=' '
22560 ac_eD='%g'
22561
22562 if test "${CONFIG_HEADERS+set}" != set; then
22563 EOF
22564 cat >> $CONFIG_STATUS <<EOF
22565   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
22566 EOF
22567 cat >> $CONFIG_STATUS <<\EOF
22568 fi
22569 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
22570   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
22571   case "$ac_file" in
22572   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
22573        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
22574   *) ac_file_in="${ac_file}.in" ;;
22575   esac
22576
22577   echo creating $ac_file
22578
22579   rm -f conftest.frag conftest.in conftest.out
22580   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
22581   cat $ac_file_inputs > conftest.in
22582
22583 EOF
22584
22585 # Transform confdefs.h into a sed script conftest.vals that substitutes
22586 # the proper values into config.h.in to produce config.h.  And first:
22587 # Protect against being on the right side of a sed subst in config.status.
22588 # Protect against being in an unquoted here document in config.status.
22589 rm -f conftest.vals
22590 cat > conftest.hdr <<\EOF
22591 s/[\\&%]/\\&/g
22592 s%[\\$`]%\\&%g
22593 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
22594 s%ac_d%ac_u%gp
22595 s%ac_u%ac_e%gp
22596 EOF
22597 sed -n -f conftest.hdr confdefs.h > conftest.vals
22598 rm -f conftest.hdr
22599
22600 # This sed command replaces #undef with comments.  This is necessary, for
22601 # example, in the case of _POSIX_SOURCE, which is predefined and required
22602 # on some systems where configure will not decide to define it.
22603 cat >> conftest.vals <<\EOF
22604 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
22605 EOF
22606
22607 # Break up conftest.vals because some shells have a limit on
22608 # the size of here documents, and old seds have small limits too.
22609
22610 rm -f conftest.tail
22611 while :
22612 do
22613   ac_lines=`grep -c . conftest.vals`
22614   # grep -c gives empty output for an empty file on some AIX systems.
22615   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
22616   # Write a limited-size here document to conftest.frag.
22617   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
22618   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
22619   echo 'CEOF
22620   sed -f conftest.frag conftest.in > conftest.out
22621   rm -f conftest.in
22622   mv conftest.out conftest.in
22623 ' >> $CONFIG_STATUS
22624   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
22625   rm -f conftest.vals
22626   mv conftest.tail conftest.vals
22627 done
22628 rm -f conftest.vals
22629
22630 cat >> $CONFIG_STATUS <<\EOF
22631   rm -f conftest.frag conftest.h
22632   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
22633   cat conftest.in >> conftest.h
22634   rm -f conftest.in
22635   if cmp -s $ac_file conftest.h 2>/dev/null; then
22636     echo "$ac_file is unchanged"
22637     rm -f conftest.h
22638   else
22639     # Remove last slash and all that follows it.  Not all systems have dirname.
22640       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
22641       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
22642       # The file is in a subdirectory.
22643       test ! -d "$ac_dir" && mkdir "$ac_dir"
22644     fi
22645     rm -f $ac_file
22646     mv conftest.h $ac_file
22647   fi
22648 fi; done
22649
22650 EOF
22651 cat >> $CONFIG_STATUS <<EOF
22652
22653 EOF
22654 cat >> $CONFIG_STATUS <<\EOF
22655
22656 date > stamp-h
22657 echo Please run \"make depend\" to build dependencies
22658
22659 exit 0
22660 EOF
22661 chmod +x $CONFIG_STATUS
22662 rm -fr confdefs* $ac_clean_files
22663 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
22664